AzureAD / microsoft-authentication-library-for-android

Microsoft Authentication Library (MSAL) for Android
http://aka.ms/aadv2
MIT License
207 stars 120 forks source link

Missing classes when R8 minify is enabled #1677

Open lebeshev opened 1 year ago

lebeshev commented 1 year ago

Describe the bug When building app with

    isMinifyEnabled = true
    proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")

and

dependencies {
    implementation("com.microsoft.identity.client:msal:4.0.0")
}

R8 produces following warnings:

Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts)
Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 257 other contexts)
Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: com.microsoft.identity.common.internal.ui.webview.ExpectedPage com.microsoft.identity.common.internal.ui.webview.OAuth2WebViewClient.mExpectedPage and 59 other contexts)

Smartphone (please complete the following information):

lebeshev commented 1 year ago

My mistake. Full list of missing classes is this:

Missing class com.google.crypto.tink.subtle.Ed25519Sign$KeyPair (referenced from: com.nimbusds.jose.jwk.OctetKeyPair com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator.generate())
Missing class com.google.crypto.tink.subtle.Ed25519Sign (referenced from: com.google.crypto.tink.subtle.Ed25519Sign com.nimbusds.jose.crypto.Ed25519Signer.tinkSigner and 2 other contexts)
Missing class com.google.crypto.tink.subtle.Ed25519Verify (referenced from: com.google.crypto.tink.subtle.Ed25519Verify com.nimbusds.jose.crypto.Ed25519Verifier.tinkVerifier and 2 other contexts)
Missing class com.google.crypto.tink.subtle.X25519 (referenced from: com.nimbusds.jose.JWECryptoParts com.nimbusds.jose.crypto.X25519Encrypter.encrypt(com.nimbusds.jose.JWEHeader, byte[]) and 2 other contexts)
Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts)
Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 257 other contexts)
Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: com.microsoft.identity.common.internal.ui.webview.ExpectedPage com.microsoft.identity.common.internal.ui.webview.OAuth2WebViewClient.mExpectedPage and 59 other contexts)
Missing class javax.annotation.Nonnull (referenced from: com.microsoft.identity.common.java.telemetry.events.DeprecatedApiUsageEvent com.microsoft.identity.common.java.telemetry.events.DeprecatedApiUsageEvent.putDeprecatedClassUsage(java.lang.Class) and 4 other contexts)
Missing class javax.annotation.Nullable (referenced from: void com.microsoft.identity.common.java.exception.TerminalException.<init>(java.lang.String, java.lang.String) and 12 other contexts)
Missing class org.bouncycastle.asn1.ASN1Encodable (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.asn1.pkcs.PrivateKeyInfo (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.asn1.x509.AlgorithmIdentifier (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.asn1.x509.SubjectPublicKeyInfo (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate) and 3 other contexts)
Missing class org.bouncycastle.cert.X509CertificateHolder (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 2 other contexts)
Missing class org.bouncycastle.cert.jcajce.JcaX509CertificateHolder (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.crypto.BlockCipher (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]))
Missing class org.bouncycastle.crypto.CipherParameters (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.crypto.InvalidCipherTextException (referenced from: byte[] com.nimbusds.jose.crypto.impl.LegacyAESGCM.decrypt(javax.crypto.SecretKey, byte[], byte[], byte[], byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.engines.AESEngine (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.crypto.modes.GCMBlockCipher (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.AEADParameters (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]))
Missing class org.bouncycastle.crypto.params.KeyParameter (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider (referenced from: org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider com.nimbusds.jose.crypto.bc.BouncyCastleFIPSProviderSingleton.bouncyCastleFIPSProvider and 1 other context)
Missing class org.bouncycastle.jce.provider.BouncyCastleProvider (referenced from: org.bouncycastle.jce.provider.BouncyCastleProvider com.nimbusds.jose.crypto.bc.BouncyCastleProviderSingleton.bouncyCastleProvider and 1 other context)
Missing class org.bouncycastle.openssl.PEMException (referenced from: java.security.KeyPair com.nimbusds.jose.jwk.PEMEncodedKeyParser.toKeyPair(org.bouncycastle.asn1.pkcs.PrivateKeyInfo) and 3 other contexts)
Missing class org.bouncycastle.openssl.PEMKeyPair (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.openssl.PEMParser (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter (referenced from: org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter com.nimbusds.jose.jwk.PEMEncodedKeyParser.pemConverter and 5 other contexts)
jairrab commented 1 year ago

Saw similar warnings after adding the following dependency:

com.microsoft.identity.client:msal:4.1.0

Same issue after updating to 4.1.3

Logs:

WARNING:R8: Missing class com.google.auto.value.AutoValue$CopyAnnotations (referenced from: io.opentelemetry.sdk.common.InstrumentationLibraryInfo)
Missing class com.google.auto.value.extension.memoized.Memoized (referenced from: io.opentelemetry.api.common.Attributes io.opentelemetry.sdk.trace.internal.data.ImmutableExceptionEventData.getAttributes())
Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts)
Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 288 other contexts)
Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: boolean com.microsoft.identity.common.crypto.AndroidWrappedKeyLoader.sSkipKeyInvalidationCheck and 64 other contexts)
Missing class org.bouncycastle.asn1.ASN1Encodable (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.asn1.pkcs.PrivateKeyInfo (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.asn1.x509.AlgorithmIdentifier (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.asn1.x509.SubjectPublicKeyInfo (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate) and 3 other contexts)
Missing class org.bouncycastle.cert.X509CertificateHolder (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 2 other contexts)
Missing class org.bouncycastle.cert.jcajce.JcaX509CertificateHolder (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.crypto.BlockCipher (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]))
Missing class org.bouncycastle.crypto.CipherParameters (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.crypto.InvalidCipherTextException (referenced from: byte[] com.nimbusds.jose.crypto.impl.LegacyAESGCM.decrypt(javax.crypto.SecretKey, byte[], byte[], byte[], byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.engines.AESEngine (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.crypto.modes.GCMBlockCipher (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.AEADParameters (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]))
Missing class org.bouncycastle.crypto.params.KeyParameter (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider (referenced from: org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider com.nimbusds.jose.crypto.bc.BouncyCastleFIPSProviderSingleton.bouncyCastleFIPSProvider and 1 other context)
Missing class org.bouncycastle.jce.provider.BouncyCastleProvider (referenced from: org.bouncycastle.jce.provider.BouncyCastleProvider com.nimbusds.jose.crypto.bc.BouncyCastleProviderSingleton.bouncyCastleProvider and 1 other context)
Missing class org.bouncycastle.openssl.PEMKeyPair (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.openssl.PEMParser (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter (referenced from: org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter com.nimbusds.jose.jwk.PEMEncodedKeyParser.pemConverter and 5 other contexts)
argenkiwi commented 1 year ago

I have upgraded to AGP 8.0 and I get an error when making a build with R8 enabled. I believe it is related to this change.

I am on v.4.2.0. Please advice on what rules I should apply to be able to finish the build process without these errors.

krolikm commented 1 year ago

Same issue in v4.5.0. I was able to build the app with these rules in proguard-rules.pro:

-dontwarn edu.umd.cs.findbugs.annotations.NonNull
-dontwarn edu.umd.cs.findbugs.annotations.Nullable
-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings
dwane13 commented 11 months ago

Same with 4.6.1

Missing class com.google.crypto.tink.subtle.Ed25519Sign (referenced from: com.google.crypto.tink.subtle.Ed25519Sign com.nimbusds.jose.crypto.Ed25519Signer.tinkSigner and 2 other contexts)
Missing class com.google.crypto.tink.subtle.Ed25519Verify (referenced from: com.google.crypto.tink.subtle.Ed25519Verify com.nimbusds.jose.crypto.Ed25519Verifier.tinkVerifier and 2 other contexts)
Missing class com.google.crypto.tink.subtle.X25519 (referenced from: com.nimbusds.jose.JWECryptoParts com.nimbusds.jose.crypto.X25519Encrypter.encrypt(com.nimbusds.jose.JWEHeader, byte[]) and 2 other contexts)
Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts)
Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 296 other contexts)
Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: boolean com.microsoft.identity.common.crypto.AndroidWrappedKeyLoader.sSkipKeyInvalidationCheck and 70 other contexts)
Missing class org.bouncycastle.asn1.ASN1Encodable (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.asn1.pkcs.PrivateKeyInfo (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.asn1.x509.AlgorithmIdentifier (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.asn1.x509.SubjectPublicKeyInfo (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate) and 3 other contexts)
Missing class org.bouncycastle.cert.X509CertificateHolder (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 2 other contexts)
Missing class org.bouncycastle.cert.jcajce.JcaX509CertificateHolder (referenced from: com.nimbusds.jose.jwk.ECKey com.nimbusds.jose.jwk.ECKey.parse(java.security.cert.X509Certificate))
Missing class org.bouncycastle.crypto.BlockCipher (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]))
Missing class org.bouncycastle.crypto.CipherParameters (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.crypto.InvalidCipherTextException (referenced from: byte[] com.nimbusds.jose.crypto.impl.LegacyAESGCM.decrypt(javax.crypto.SecretKey, byte[], byte[], byte[], byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.engines.AESEngine (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.crypto.modes.GCMBlockCipher (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.AEADParameters (referenced from: org.bouncycastle.crypto.modes.GCMBlockCipher com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESGCMCipher(javax.crypto.SecretKey, boolean, byte[], byte[]))
Missing class org.bouncycastle.crypto.params.KeyParameter (referenced from: org.bouncycastle.crypto.engines.AESEngine com.nimbusds.jose.crypto.impl.LegacyAESGCM.createAESCipher(javax.crypto.SecretKey, boolean) and 1 other context)
Missing class org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider (referenced from: org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider com.nimbusds.jose.crypto.bc.BouncyCastleFIPSProviderSingleton.bouncyCastleFIPSProvider and 1 other context)
Missing class org.bouncycastle.jce.provider.BouncyCastleProvider (referenced from: org.bouncycastle.jce.provider.BouncyCastleProvider com.nimbusds.jose.crypto.bc.BouncyCastleProviderSingleton.bouncyCastleProvider and 1 other context)
Missing class org.bouncycastle.jsse.BCSSLParameters (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 1 other context)
Missing class org.bouncycastle.jsse.BCSSLSocket (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 5 other contexts)
Missing class org.bouncycastle.jsse.provider.BouncyCastleJsseProvider (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.<init>())
Missing class org.bouncycastle.openssl.PEMException (referenced from: java.security.KeyPair com.nimbusds.jose.jwk.PEMEncodedKeyParser.toKeyPair(org.bouncycastle.asn1.pkcs.PrivateKeyInfo) and 3 other contexts)
Missing class org.bouncycastle.openssl.PEMKeyPair (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.openssl.PEMParser (referenced from: java.util.List com.nimbusds.jose.jwk.PEMEncodedKeyParser.parseKeys(java.lang.String) and 1 other context)
Missing class org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter (referenced from: org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter com.nimbusds.jose.jwk.PEMEncodedKeyParser.pemConverter and 5 other contexts)
Missing class org.conscrypt.Conscrypt$Version (referenced from: boolean okhttp3.internal.platform.ConscryptPlatform$Companion.atLeastVersion(int, int, int))
Missing class org.conscrypt.Conscrypt (referenced from: boolean okhttp3.internal.platform.ConscryptPlatform$Companion.atLeastVersion(int, int, int) and 4 other contexts)
Missing class org.conscrypt.ConscryptHostnameVerifier (referenced from: okhttp3.internal.platform.ConscryptPlatform$DisabledHostnameVerifier)
Missing class org.openjsse.javax.net.ssl.SSLParameters (referenced from: void okhttp3.internal.platform.OpenJSSEPlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List))
Missing class org.openjsse.javax.net.ssl.SSLSocket (referenced from: void okhttp3.internal.platform.OpenJSSEPlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 1 other context)
Missing class org.openjsse.net.ssl.OpenJSSE (referenced from: void okhttp3.internal.platform.OpenJSSEPlatform.<init>())

Is there any updates about this issue?

andreas-umbricht commented 8 months ago

With AGP 8.0 and sdk version 4.9.0, I receive the following errors:

Missing class com.google.crypto.tink.subtle.Ed25519Sign$KeyPair (referenced from: com.nimbusds.jose.jwk.OctetKeyPair com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator.generate())
Missing class com.google.crypto.tink.subtle.Ed25519Sign (referenced from: com.google.crypto.tink.subtle.Ed25519Sign com.nimbusds.jose.crypto.Ed25519Signer.tinkSigner and 2 other contexts)
Missing class com.google.crypto.tink.subtle.Ed25519Verify (referenced from: com.google.crypto.tink.subtle.Ed25519Verify com.nimbusds.jose.crypto.Ed25519Verifier.tinkVerifier and 2 other contexts)
Missing class com.google.crypto.tink.subtle.X25519 (referenced from: com.nimbusds.jose.JWECryptoParts com.nimbusds.jose.crypto.X25519Encrypter.encrypt(com.nimbusds.jose.JWEHeader, byte[]) and 2 other contexts)
Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts)
Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 296 other contexts)
Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: boolean com.microsoft.identity.common.crypto.AndroidWrappedKeyLoader.sSkipKeyInvalidationCheck and 71 other contexts)

Do you have any viable rules for R8 to avoid this?

WonderCsabo commented 5 months ago

I get the following list with 5.0.0 :

Missing class com.google.crypto.tink.subtle.Ed25519Sign (referenced from: com.google.crypto.tink.subtle.Ed25519Sign com.nimbusds.jose.crypto.Ed25519Signer.tinkSigner and 2 other contexts)
Missing class com.google.crypto.tink.subtle.Ed25519Verify (referenced from: com.google.crypto.tink.subtle.Ed25519Verify com.nimbusds.jose.crypto.Ed25519Verifier.tinkVerifier and 2 other contexts)
Missing class com.google.crypto.tink.subtle.X25519 (referenced from: com.nimbusds.jose.JWECryptoParts com.nimbusds.jose.crypto.X25519Encrypter.encrypt(com.nimbusds.jose.JWEHeader, byte[]) and 2 other contexts)
Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts)
Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 302 other contexts)
Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: boolean com.microsoft.identity.common.crypto.AndroidWrappedKeyLoader.sSkipKeyInvalidationCheck and 76 other contexts)

This library should package R8 rules in consumerProguardFiles, so users do not face this issue.

MK2161 commented 4 months ago

dependencies { implementation("com.microsoft.identity.client:msal:4.0.0") }

and isMinifyEnabled = true proguardFiles( getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" )

com.microsoft.identity.client:msal:4.5.0

Issue Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts) Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 301 other contexts) Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: boolean com.microsoft.identity.common.crypto.AndroidWrappedKeyLoader.sSkipKeyInvalidationCheck and 71 other contexts) how to fix it

negoe commented 3 months ago

Tracked internally Product Backlog Item 2093560: GitHub Investigate: Defined multiple times when R8 minify is enabled #1695