-
Notifications
You must be signed in to change notification settings - Fork 281
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
启动androidx崩溃问题 #92
Comments
找之前的issue有相关讨论, 要加固androidx相关,自己改so加载位置到自定义application里。顺便说一句加固开源库没任何意义,还能让人简单找到opcode映射表。这种跟那些隐藏dex的加固有很大的不同,弄清楚基本原理再使用。 |
有参考的代码可以看看吗? |
可以看以前代码,最初就是在自定义application里注入的静态初始化方法里System.loadLibrary("libnmmp.so")。后面更新才在NativeUtils里加载so,目前只是推测原因(两个类互相引用,类加载时导致静态初始化方法还没执行就提前调用本地方法,然后报错找到不到native方法)。简单解决就是忽略一些类,打断这种循环引用,或者前面提到的自定义appliction里加载so |
大佬问下,出于什么原因改到NativeUtils里加载so呢? |
为了让代码更简洁些,不用再额外处理自定义application。后面发现处理androidx就会出现native方法在System.loadLibrary()执行前调用的bug,按正常逻辑其他加固类会先调用NativeUtils里的initClass方法,这时NativeUtils的static{}方法会最先执行。不过一般情况根本不会处理androidx,遇到这类问题可以通过限制加固范围解决,所以就没必要回退到在自定义application里加载so |
该如何处理?
The text was updated successfully, but these errors were encountered: