chancerly / jtik

Dynamic java method hook for Android,Implemented by jvmti
MIT License
6 stars 1 forks source link

hook on start error #2

Open xyxdaily opened 7 months ago

xyxdaily commented 7 months ago

I want to hook the system class on start. image

however, the app crashed.

chancerly commented 7 months ago

Could you provide the stack trace of the crash? And can the TestCase HookActivity work ok on your device?

harshitshah4 commented 4 weeks ago

This is happening even with me. Crash logs:

09-03 12:08:27.503 E/AndroidRuntime(24335): java.lang.VerifyError: Verifier rejected class androidx.appcompat.app.WindowDecorActionBar: androidx.appcompat.view.ActionMode androidx.appcompat.app.WindowDecorActionBar.startActionMode(androidx.appcompat.view.ActionMode$Callback) failed to verify: androidx.appcompat.view.ActionMode androidx.appcompat.app.WindowDecorActionBar.startActionMode(androidx.appcompat.view.ActionMode$Callback): [0x2C] register v0 has type Precise Reference: androidx.appcompat.app.WindowDecorActionBar$ActionModeImpl but expected Reference: androidx.appcompat.view.ActionMode (declaration of 'androidx.appcompat.app.WindowDecorActionBar' appears in /data/app/~~TlLO9MbHKoqJWTnZNI1wYQ==/com.example.all_in_one-DqcQwgujRJ68tH3RxZIOZQ==/base.apk)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at androidx.appcompat.app.AppCompatDelegateImpl.initWindowDecorActionBar(AppCompatDelegateImpl.java:563)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at androidx.appcompat.app.AppCompatDelegateImpl.getSupportActionBar(AppCompatDelegateImpl.java:543)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at androidx.appcompat.app.AppCompatActivity.getSupportActionBar(AppCompatActivity.java:163)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at com.example.all_in_one.MainActivity.onCreate(MainActivity.java:60)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.Activity.performCreate(Activity.java:8290)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.Activity.performCreate(Activity.java:8269)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3657)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3813)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.os.Handler.dispatchMessage(Handler.java:106)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.os.Looper.loopOnce(Looper.java:201)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.os.Looper.loop(Looper.java:288)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at android.app.ActivityThread.main(ActivityThread.java:7898)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at java.lang.reflect.Method.invoke(Native Method)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-03 12:08:27.503 E/AndroidRuntime(24335):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
09-03 12:08:27.641 E/BcSmartspaceCard( 2599): No tap action can be set up
09-03 12:08:27.641 E/BcSmartspaceCard(18282): No tap action can be set up
09-03 12:08:27.997 E/WindowManager( 1509): setOnBackInvokedCallback(): No window state for package:com.android.systemui

Additionally this only happens if I set needHookSystemClass as true

harshitshah4 commented 3 weeks ago

@chancerly let me know if you need any help in debugging this