question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proguard not supported by default

See original GitHub issue

When using proguard + msal, the following rules are required to make the client work:

# This enum is accessed via reflection in common msal lib thus proguard removes it.
-keep public enum com.microsoft.identity.common.internal.ui.AuthorizationAgent  {
    *;
}

# Classes for below package is used by MSAL library. Ignore warning coming from the dependency.
-dontwarn com.nimbusds.jose.**

This rules can be packaged directly in the msal library and common library instead of asking developers to do so.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
guperrotcommented, May 10, 2019

This is what came up when fixing the rules when used in AppCenter:

https://github.com/microsoft/AppCenter-SDK-Android/pull/1149/files#diff-54abb45c98c994c8e22a56dc46f07a0b

This covers basic AAD B2C scenarios but you might want to apply that keep rules to every model or enum used via Gson.

1reaction
guperrotcommented, Mar 21, 2019

We can already do it in proguard, the Microsoft AppCenter SDK uses this already.

Just needs

android {

        defaultConfig {
            consumerProguardFiles 'proguard-rules.pro'

In the build.gradle for the library.

It will be automatically added by android gradle plugin as proguard.txt in the AAR file and added to app rules if consumed as a dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pro-guard Obfuscation not working in android studio
Below is the sample how to enable default ProGuard in Android Studio. 1) Go to the build.gradle file of app. 2) enable the...
Read more >
Configuring ProGuard | CodePath Android Cliffnotes
ProGuard can be enabled by using the minifyEnabled option for any build type. If you intend to use it for production, it is...
Read more >
Android Default ProGuard Rules | Guide - ProAndroidDev
This rule specifies that the @Keep annotated elements like methods and classes that are accessed only via reflection should not be removed when ......
Read more >
Troubleshooting ProGuard issues on Android - Medium
The Android ProGuard rules include some safe defaults for every Android app, such as making sure View getters and setters - which are...
Read more >
ProGuard Manual: Troubleshooting - Guardsquare
If ProGuard is not keeping the right classes or class members, make sure you are using fully qualified class names. If the package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found