microsoft-authentication-library-for-android: Proguard not supported by default
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.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 15 (9 by maintainers)
I have an issue with Proguard too when using MSAL v1.0.0:
UPDATE : This issue was fixed when I added the configuration file provided by the link in the previous post and the following lines:
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.
We can already do it in proguard, the Microsoft AppCenter SDK uses this already.
Just needs
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.