asLody / SandHook

Android ART Hook/Native Inline Hook/Single Instruction Hook - support 4.4 - 11.0 32/64 bit - Xposed API Compat
Other
2.02k stars 443 forks source link

Android12 崩溃,有没有解决方案呢? #92

Open 15198184721 opened 2 years ago

15198184721 commented 2 years ago

2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: Timestamp: 2022-04-25 22:00:39.143668562+0800 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: Process uptime: 0s 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: Cmdline: com.lk.hook 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: pid: 17424, tid: 17424, name: com.lk.hook >>> com.lk.hook <<< 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: uid: 10251 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x41 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: Cause: null pointer dereference 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x0 0000000000000002 x1 0000007fff88ceb0 x2 0000000000000000 x3 0000007c692b2681 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x4 0000007fff88ce98 x5 0000000000000005 x6 0000000070def930 x7 0000000071a4ad7c 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x8 0000000000000000 x9 0000000000080019 x10 0000000000430000 x11 000000000000001e 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x12 0000007fff88ceb0 x13 00000000042957f0 x14 0000007c6964a5d0 x15 0000000000000007 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x16 0000007cfa5e1d60 x17 0000007cfa5d1654 x18 0000007d1b2d8000 x19 b400007d1acca3c0 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x20 0000000000000041 x21 b400007c3f731460 x22 0000000010080019 x23 0000007be236f3d8 2022-04-25 22:00:39.268 17453-17453/? A/DEBUG: x24 0000007be236f3d0 x25 b400007d1acb7000 x26 0000007d1af12000 x27 0000000000000015 ......................

15198184721 commented 2 years ago

初始化方法如下

   if (Build.VERSION.SDK_INT == 29 && getPreviewSDKInt() > 0) {
        // Android R preview
        SandHookConfig.SDK_INT = 30
    }
    SandHook.disableVMInline()
    SandHook.tryDisableProfile(context.packageName)
    //不设置的话。这可能会崩溃
    SandHook.disableDex2oatInline(false)
    //取消对内联hook方法的调用程序的优化,需要 >= 7.0
    // SandHook.deCompileMethod()

    if (SandHookConfig.SDK_INT >= Build.VERSION_CODES.P) {
        SandHook.passApiCheck()
    }

    //setup for xposed
    XposedCompat.cacheDir = context.cacheDir
    XposedCompat.context = context
    XposedCompat.classLoader = context.classLoader
    XposedCompat.isFirstApplication = true
huhuang03 commented 4 months ago

哈哈,Android11 同样的错误,

02-20 23:37:19.720 28368 28368 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
02-20 23:37:19.720 28368 28368 F DEBUG   : Cause: null pointer dereference
02-20 23:37:19.720 28368 28368 F DEBUG   :     x0  0000007fede4a7d7  x1  0000007869fa63d0  x2  0000000000000000  x3  0000000000000003

应该是没有办法解决的吧