Skip to content

Commit 27f3aa9

Browse files
authored
Add JavascriptInterface rules to consumer proguard rules, Fixes AB#3463796 (#2837)
Adding keep for methods annotated with JavascriptInterface explicitly in consumer proguard files. Although default android proguard rules from proguard-android-optimize.txt or proguard-android.txt already keeps all JavascriptInterface methods. Fixes [AB#3463796](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3463796)
1 parent 7fd1e1e commit 27f3aa9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
vNext
22
----------
3+
- [PATCH] Add JavascriptInterface rules to consumer proguard rules (#2837)
34
- [MINOR] Add optimized saveAndLoadAggregatedAccountData method in BrokerOAuth2TokenCache (#2832)
45
- [MINOR] Remove MavenCentral repository from build.gradle files (#2830)
56
- [MINOR] Determine whether broker app opts out from battery optimization (#2819)

common/consumer-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
-keep class * extends com.microsoft.identity.common.java.authscheme.AbstractAuthenticationScheme { *; }
2727
-keep class com.microsoft.identity.common.internal.broker.AuthUxJsonPayload { *; }
2828

29+
# Keep WebView JS bridge methods annotated with @JavascriptInterface
30+
-keepclassmembers class com.microsoft.identity.** {
31+
@android.webkit.JavascriptInterface <methods>;
32+
}
2933

3034
#For Android Credential Manager: https://developer.android.com/training/sign-in/passkeys#proguard
3135
-if class androidx.credentials.CredentialManager

0 commit comments

Comments
 (0)