Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion profiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ dependencies {
implementation(libs.google.protobuf.java)

implementation(libs.rikka.hidden.compat)
implementation(libs.rikka.hidden.stub)
// compileOnly: packaged stubs make R8 treat framework interfaces as unimplemented app classes
// and rewrite calls through them to throws.
compileOnly(libs.rikka.hidden.stub)

implementation(platform(libs.compose.bom))
implementation(libs.compose.runtime)
Expand Down
4 changes: 3 additions & 1 deletion subprojects/privileged-services/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dependencies {
api(libs.androidx.annotation)

implementation(libs.rikka.hidden.compat)
implementation(libs.rikka.hidden.stub)
// compileOnly: packaged stubs make R8 treat framework interfaces as unimplemented app classes
// and rewrite calls through them to throws.
compileOnly(libs.rikka.hidden.stub)
implementation(libs.rikka.refine.runtime)
}
9 changes: 9 additions & 0 deletions subprojects/privileged-services/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Shizuku instantiates user services reflectively from the ComponentName class name
# (UserService.create), so R8 sees no constructor call and empties the class.
-keep class org.appdevforall.cotg.profiler.ProfilerUserService { public <init>(...); }

# The framework calls these observer callbacks over binder, so R8 sees no caller and drops
# them. The rules target the adapters because their hidden-API superclasses are compile-only
# and invisible to R8.
-keep class rikka.hidden.compat.adapter.** { public *; }
-keep class * extends rikka.hidden.compat.adapter.ProcessObserverAdapter { public *; }
11 changes: 11 additions & 0 deletions subprojects/shizuku-server/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The starter launches the server by class name through app_process (starter.cpp), so R8
# sees no caller and strips it; pairing then succeeds but the server dies with
# ClassNotFoundException.
-keep class rikka.shizuku.server.ShizukuService { public static void main(java.lang.String[]); }

# The framework calls these observer callbacks over binder, so R8 sees no caller and drops
# them; the server then dies with AbstractMethodError on the first callback. The rules target
# the adapters because their hidden-API superclasses are compile-only and invisible to R8.
-keep class rikka.hidden.compat.adapter.** { public *; }
-keep class * extends rikka.hidden.compat.adapter.ProcessObserverAdapter { public *; }
-keep class * extends rikka.hidden.compat.adapter.UidObserverAdapter { public *; }
3 changes: 3 additions & 0 deletions subprojects/shizuku-starter/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# User-service processes are started by class name through app_process
# (ServiceStarter.commandForUserService), so R8 sees no caller of main.
-keep class moe.shizuku.starter.ServiceStarter { public static void main(java.lang.String[]); }