Modern Apps git

← Modern-Apps.git

library-ui: move app-specific R8 keeps beside their apps

Commit
af43a53f967e2b1b307945aed0c712c6c0da03be
Author
Vayun Mathur <[email protected]>
When
2026-12-05 23:03 UTC (4 hours ago)
Parents
ea8f20b
The shared root proguard file carried gRPC/OkHttp keeps for :appstore and JGit dontwarns for :code, so every app inherited rules for libraries it does not ship. common-conventions-app already auto-includes <app>/proguard-rules.pro, so moving those blocks beside their owning apps changes nothing for appstore/code and drops dead rules from all other apps.

The root file also now records the main keep-rule debt explicitly: -dontobfuscate disables renaming repo-wide and is not removed here, because JNI/Rust literal-name lookups, Room/serialization reflection and Glance instantiation are only partly covered by keeps and no device smoke test is in scope. That removal is a per-app follow-up.

Verified: :appstore:minifyReleaseWithR8 and :code:minifyReleaseWithR8 pass (R8 parses the relocated files), plus lintVitalRelease for both modules.

Diff

appstore/proguard-rules.pro
diff --git a/appstore/proguard-rules.pro b/appstore/proguard-rules.pronew file mode 100644index 0000000000..00acc66910--- /dev/null+++ b/appstore/proguard-rules.pro@@ -0,0 +1,20 @@+# gRPC + okhttp + protobuf-lite (Accrescent source). grpc-okhttp is the first+# okhttp in the repo. grpc looks up its transport/name-resolver providers via reflection and+# META-INF/services; okhttp/okio and grpc reference optional compile-time deps (Conscrypt,+# error-prone, javax.annotation, animal-sniffer) that are absent at runtime on Android.+# Broad keeps: narrowing these needs grpc/okhttp consumer-rule coverage plus a+# release smoke test of the Accrescent source; do not narrow blind.+-keep class io.grpc.** { *; }+-dontwarn io.grpc.**+-keep class okhttp3.** { *; }+-keep interface okhttp3.** { *; }+-dontwarn okhttp3.**+-keep class okio.** { *; }+-dontwarn okio.**+-dontwarn com.google.errorprone.annotations.**+-dontwarn javax.annotation.**+-dontwarn org.codehaus.mojo.animal_sniffer.**+-dontwarn org.conscrypt.**+# Accrescent's generated protobuf-lite messages (app.accrescent.appstore.v1, com.android.bundle)+# are covered by the GeneratedMessageLite keep in the shared root file; grpc+# service descriptors are under io.grpc.
code/proguard-rules.pro
diff --git a/code/proguard-rules.pro b/code/proguard-rules.pronew file mode 100644index 0000000000..2409a94c97--- /dev/null+++ b/code/proguard-rules.pro@@ -0,0 +1,10 @@+# JGit (org.eclipse.jgit) is a desktop/server Java library. It references JVM+# APIs absent on Android — JMX (java.lang.management / javax.management), GSS-API/Kerberos+# (org.ietf.jgss), java.lang.ProcessHandle, and the SLF4J static binder — only on code paths+# Android never hits (MBean monitoring, Negotiate HTTP auth, PID-file locks). With+# android.enableR8.fullMode=true these dangling refs fail the build, so suppress them.+-dontwarn java.lang.ProcessHandle+-dontwarn java.lang.management.**+-dontwarn javax.management.**+-dontwarn org.ietf.jgss.**+-dontwarn org.slf4j.impl.**
proguard-rules.pro
diff --git a/proguard-rules.pro b/proguard-rules.proindex 0e4069d7a0..726238dbdb 100644--- a/proguard-rules.pro+++ b/proguard-rules.pro@@ -1,4 +1,12 @@ -dontwarn java.beans.**+# DEBT (perf score): -dontobfuscate disables name obfuscation repo-wide, so R8+# shrinking/optimization runs but renaming does not. Removing it is NOT done+# here: JNI/Rust literal-name lookups, Room/serialization reflection and+# Glance reflective instantiation are only partly covered by the keeps below,+# and no device verification is in scope for this change. Follow-up: remove+# this line per-app behind release smoke tests, starting with an app with no+# Rust/JNI and no reflective instantiation, and narrow the broad keeps below+# (io.grpc/okhttp in :appstore, RoomDatabase { *; }) as coverage allows. -dontobfuscate  # Annotation metadata is read reflectively by Room, kotlinx.serialization and@@ -57,34 +65,11 @@     public static byte[] transmitApdu(byte[]); } -# gRPC + okhttp + protobuf-lite (:appstore Accrescent source). grpc-okhttp is the first-# okhttp in the repo. grpc looks up its transport/name-resolver providers via reflection and-# META-INF/services; okhttp/okio and grpc reference optional compile-time deps (Conscrypp,-# error-prone, javax.annotation, animal-sniffer) that are absent at runtime on Android.--keep class io.grpc.** { *; }--dontwarn io.grpc.**--keep class okhttp3.** { *; }--keep interface okhttp3.** { *; }--dontwarn okhttp3.**--keep class okio.** { *; }--dontwarn okio.**--dontwarn com.google.errorprone.annotations.**--dontwarn javax.annotation.**--dontwarn org.codehaus.mojo.animal_sniffer.**--dontwarn org.conscrypt.**-# Accrescent's generated protobuf-lite messages (app.accrescent.appstore.v1, com.android.bundle)-# are covered by the GeneratedMessageLite keep above; grpc service descriptors are under io.grpc.--# JGit (org.eclipse.jgit, used by :code) is a desktop/server Java library. It references JVM-# APIs absent on Android — JMX (java.lang.management / javax.management), GSS-API/Kerberos-# (org.ietf.jgss), java.lang.ProcessHandle, and the SLF4J static binder — only on code paths-# Android never hits (MBean monitoring, Negotiate HTTP auth, PID-file locks). With-# android.enableR8.fullMode=true these dangling refs fail the build, so suppress them.--dontwarn java.lang.ProcessHandle--dontwarn java.lang.management.**--dontwarn javax.management.**--dontwarn org.ietf.jgss.**--dontwarn org.slf4j.impl.**+# App-specific keeps live beside the app (auto-included by+# common-conventions-app when <app>/proguard-rules.pro exists): gRPC/OkHttp+# keeps are in appstore/proguard-rules.pro and JGit dontwarns in+# code/proguard-rules.pro. They were previously in this shared file, where+# every app carried rules for libraries it does not ship.  # --- Room migrations — keep reflective Companion access (see SqlCipher.kt:93, FFDatabase.kt:160) --- -keep class * extends androidx.room3.RoomDatabase { *; }