Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not able to hook early code in MIUI13(Android12) both spawn mode and gadget mode #266

Open
superabiliter opened this issue Sep 29, 2022 · 0 comments

Comments

@superabiliter
Copy link

I get the callstack when the script is perfrom in spawn mode. And result is
java.lang.Exception at android.app.ActivityThread.getPackageInfoNoCheck(Native Method) at android.app.ActivityThread$ActivityClientRecord.<init>(ActivityThread.java:677) at android.app.servertransaction.LaunchActivityItem.preExecute(LaunchActivityItem.java:85) at android.app.servertransaction.ClientTransaction.preExecute(ClientTransaction.java:117) at android.app.ClientTransactionHandler.scheduleTransaction(ClientTransactionHandler.java:50) at android.app.ActivityThread$ApplicationThread.scheduleTransaction(ActivityThread.java:1844) at android.app.IApplicationThread$Stub.onTransact(IApplicationThread.java:1295) at android.os.Binder.execTransactInternal(Binder.java:1187) at android.os.Binder.execTransact(Binder.java:1146)
I think in this scene frida inject the so too late.
In gadget mode, I loadlibrary in first line of MyApplication->attachBaseContext. And I found the script will execute when getPackageInfoNoCheck was called. I saw your code in this repo, and found perform script(initialize factory) has 3 types: hooking getPackageInfoNoCheck、makeApplication and the time loading the .so.
Maybe frida need two improves:

  1. ".so file" might inject to the process more earlier in new version of Android.
  2. We can find a way to initialize the factory and perform the script instead of waiting for hooking timing. (Maybe searching the application context object in memory?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant