Skip to content

Commit 2ac407d

Browse files
committed
Use 'verify' filter for dexopt to prevent method inlining
This change switches the dexopt compiler filter from 'speed-profile' to 'verify' and keeps the force flag (-f). Purpose: - To ensure hook reliability: Higher optimization levels like 'speed' or 'speed-profile' perform Ahead-of-Time (AOT) method inlining. When a method is inlined, its original entry point is bypassed, making it impossible to hook. - By forcing 'verify', we invalidate existing optimized machine code (odex) and prevent new inlining, ensuring that ART uses the Interpreter or JIT which respects hook entry points.
1 parent 29ad3ca commit 2ac407d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

manager/src/main/java/org/lsposed/lspatch/util/ShizukuApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ object ShizukuApi {
125125
} ?: return false
126126

127127
return try {
128-
val command = "cmd package compile -m speed-profile -f $packageName"
128+
val command = "cmd package compile -m verify -f $packageName"
129129
val output = service.runShellCommand(command)
130130
// Return true if output contains "Success"
131131
output.contains("Success")

0 commit comments

Comments
 (0)