Skip to content

Commit 95f2125

Browse files
committed
build: add Proguard rules for Shizuku and silent installer
- Add keep rules for `ShizukuInstallerServiceImpl` to prevent R8 from renaming the class name passed to Shizuku's `bindUserService()`. - Preserve AIDL-generated Stub and Proxy classes for `IShizukuInstallerService` to ensure functional IPC between the app and privileged processes. - Include keep and dontwarn rules for `rikka.shizuku` library internals and binder listeners.
1 parent c558dcd commit 95f2125

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

β€ŽcomposeApp/proguard-rules.proβ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@
167167
-keep class com.google.firebase.** { *; }
168168
-dontwarn com.google.firebase.**
169169

170+
# ── Shizuku (Silent Install) ─────────────────────────────────────────────
171+
# The UserService class name is passed to Shizuku via ComponentName β€” R8 must
172+
# not rename or remove it, otherwise bindUserService() silently fails.
173+
-keep class zed.rainxch.core.data.services.shizuku.ShizukuInstallerServiceImpl { *; }
174+
175+
# AIDL-generated Stub/Proxy classes for IPC between app and privileged process
176+
-keep class zed.rainxch.core.data.services.shizuku.IShizukuInstallerService { *; }
177+
-keep class zed.rainxch.core.data.services.shizuku.IShizukuInstallerService$Stub { *; }
178+
-keep class zed.rainxch.core.data.services.shizuku.IShizukuInstallerService$Stub$Proxy { *; }
179+
180+
# Shizuku library internals (binder listeners, service args, provider)
181+
-keep class rikka.shizuku.** { *; }
182+
-dontwarn rikka.shizuku.**
183+
170184
# ── Enum safety ────────────────────────────────────────────────────────────
171185
# Keep all enum values and valueOf methods (used by serialization/Room)
172186
-keepclassmembers enum * {

0 commit comments

Comments
Β (0)