From 697331c53e1f0caac15cd7be6310e2dd1852b8af Mon Sep 17 00:00:00 2001 From: Dimitris Dafnis <68849116+jim-daf@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:43:49 +0200 Subject: [PATCH 1/2] fix(agentweb-core): ship consumer Proguard rules for @JavascriptInterface (#1072) --- agentweb-core/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agentweb-core/build.gradle b/agentweb-core/build.gradle index 009ff5d5..cb149619 100644 --- a/agentweb-core/build.gradle +++ b/agentweb-core/build.gradle @@ -13,6 +13,9 @@ android { versionName VERSION_NAME testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + // Issue #1072: ship Proguard/R8 rules so consumer apps do not have to + // re-declare the @JavascriptInterface keep rule themselves. + consumerProguardFiles 'consumer-rules.pro' } From 0346b03d36c23c2f3a936b4756d45e8f62636422 Mon Sep 17 00:00:00 2001 From: Dimitris Dafnis <68849116+jim-daf@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:43:51 +0200 Subject: [PATCH 2/2] fix(agentweb-core): ship consumer Proguard rules for @JavascriptInterface (#1072) --- agentweb-core/consumer-rules.pro | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 agentweb-core/consumer-rules.pro diff --git a/agentweb-core/consumer-rules.pro b/agentweb-core/consumer-rules.pro new file mode 100644 index 00000000..f400dd48 --- /dev/null +++ b/agentweb-core/consumer-rules.pro @@ -0,0 +1,14 @@ +# Consumer Proguard/R8 rules for AgentWeb. +# +# Issue #1072: in release builds the JS bridge methods were stripped because +# the host app did not have a keep rule for @JavascriptInterface. AgentWeb +# itself uses reflection-style discovery on these methods, so the rule needs +# to apply to every consumer that ships the library. + +-keepclassmembers class * { + @android.webkit.JavascriptInterface ; +} + +# AgentWeb's own bridge plumbing relies on reflection over its public API. +-keep class com.just.agentweb.** { *; } +-dontwarn com.just.agentweb.**