对混淆处理的apk加固启动后crash
indieexplore opened this issue · 4 comments
2023-08-31 14:34:59.614 12178-12178/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.sample, PID: 12178
java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: java.lang.NoClassDefFoundError: androidx/emoji2/text/EmojiCompatInitializer$1
at android.app.ActivityThread.installProvider(ActivityThread.java:8079)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7585)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7313)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8503)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Caused by: androidx.startup.StartupException: java.lang.NoClassDefFoundError: androidx/emoji2/text/EmojiCompatInitializer$1
at androidx.startup.AppInitializer.OooO0Oo(Native Method)
at androidx.startup.AppInitializer.OooO0O0(Native Method)
at androidx.startup.AppInitializer.OooO00o(Native Method)
at androidx.startup.InitializationProvider.onCreate(Native Method)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2468)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2433)
at android.app.ActivityThread.installProvider(ActivityThread.java:8074)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7585)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7313)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8503)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Caused by: java.lang.NoClassDefFoundError: androidx/emoji2/text/EmojiCompatInitializer$1
at androidx.emoji2.text.EmojiCompatInitializer.OooO0Oo(Native Method)
at androidx.emoji2.text.EmojiCompatInitializer.OooO0OO(Native Method)
at androidx.emoji2.text.EmojiCompatInitializer.OooO0O0(Unknown Source:1)
at androidx.startup.AppInitializer.OooO0Oo(Native Method)
at androidx.startup.AppInitializer.OooO0O0(Native Method)
at androidx.startup.AppInitializer.OooO00o(Native Method)
at androidx.startup.InitializationProvider.onCreate(Native Method)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2468)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2433)
at android.app.ActivityThread.installProvider(ActivityThread.java:8074)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7585)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7313)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8503)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
androidx相关应该跟加载so位置有关,你可以在自定义application里加载so。
还有没必要处理公开的lib,这纯粹给别人逆向提供后门,别人拿没加固前的代码,对比虚拟化后的指令序列,不需要分析vm就能轻易找到映射。
之前issue有androidx相关问题,就是在某次升级改变.so加载位置后报错的,因为加固androidx除了测试兼容性外没什么意义,所以没处理。最简单的解决方法就是自定义application里加载so, 早期版本是这样做,你可以参照早期的代码。
@maoabc 好的,感谢解惑,目前我直接将 androidx 等库exclude掉了,可以正常运行了🙇