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

Hooking ContextWrapper.attachBaseContext in debug mode - segfault #54

Open
hacker-cb opened this issue Oct 21, 2023 · 1 comment
Open

Comments

@hacker-cb
Copy link

Hello.

There is always segfault when I run debug on app from Android Studio when I trying to hook ContextWrapper.attachBaseContext

Pine.hook(ContextWrapper.class.getDeclaredMethod("attachBaseContext", Context.class), new MethodHook() {
    @Override
    public void beforeCall(Pine.CallFrame callFrame) throws Throwable {
        ...
    }
});

Here is log:

Hooking method protected void android.content.ContextWrapper.attachBaseContext(android.content.Context) with callback com.modules.LocaleChangerModule$1@eed873d
JIT compilation is not supported in Android R yet
InstallReplacementTrampoline: origin 0x70f17c08 origin_entry 0x6da79fdfa0 bridge_jump 0x703bd3d0a0
attachBaseContext; base: android.app.ContextImpl@855b32
handleBridge: artMethod=0x70f17c08 originExtras=0xb400006e07fa9f70 extras=0xb400006e07f98bd0 sp=0x7ffa2aa510
handleCall for method protected void android.content.ContextWrapper.attachBaseContext(android.content.Context)
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xfffffffdf4489cb8 in tid 11925 (ple.allfeatures), pid 11925 (ple.allfeatures)
pid: 11925, tid: 11925, name: ple.allfeatures  >>> com.example.allfeatures <<<
      #22 pc 000000000029ae58  /data/app/~~VqzCA3Hstorc-eYIvNxnbw==/com.example.allfeatures-MOLI7OyBeYO8XK24ZiCZaQ==/base.apk (offset 0x10d000) (top.canyie.pine.Pine.callBackupMethod)
      #28 pc 000000000029a84c  /data/app/~~VqzCA3Hstorc-eYIvNxnbw==/com.example.allfeatures-MOLI7OyBeYO8XK24ZiCZaQ==/base.apk (offset 0x10d000) (top.canyie.pine.Pine$CallFrame.invokeOriginalMethod)
      #34 pc 000000000029aeb4  /data/app/~~VqzCA3Hstorc-eYIvNxnbw==/com.example.allfeatures-MOLI7OyBeYO8XK24ZiCZaQ==/base.apk (offset 0x10d000) (top.canyie.pine.Pine.handleCall)
      #40 pc 000000000029c794  /data/app/~~VqzCA3Hstorc-eYIvNxnbw==/com.example.allfeatures-MOLI7OyBeYO8XK24ZiCZaQ==/base.apk (offset 0x10d000) (top.canyie.pine.entry.Arm64Entry.handleBridge)
      #46 pc 000000000029cd74  /data/app/~~VqzCA3Hstorc-eYIvNxnbw==/com.example.allfeatures-MOLI7OyBeYO8XK24ZiCZaQ==/base.apk (offset 0x10d000) (top.canyie.pine.entry.Arm64Entry.voidBridge)
      #56 pc 000000000000117c  /data/app/~~VqzCA3Hstorc-eYIvNxnbw==/com.example.allfeatures-MOLI7OyBeYO8XK24ZiCZaQ==/base.apk (offset 0x56000) (com.example.allfeatures.App.attachBaseContext)
@ramanbranavitski
Copy link

Same issue. Any updates here?

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

2 participants