简单来说就是C+ 和Java层交互调用
利用native层回调java层方法来使大部分工具的交叉引用查找失效 此工具用于自动化修改smali文件和生成cpp文件(待实现自动编译)
(这里的smali框架有的地方写的不好,上传太麻烦了,移步https://github.com/Hoimk/Smali-RestoreString)
- 使用apktool d 反编译apk
- 运行java -jar smalisafe.jar "要处理的smali文件名"
- 使用ndk-build编译jni下的SmaliSafe.cpp(注:此时smali文件已被修改)
- 将编译生成的libs文件夹改名lib移动至apktool工程中(注:只保留需要的abi,不然会导致如:arm64位的手机找不到原apk其他so)
- apktool b dir 回编译
-p <Apktool Project Dir>
--f <PageName>
-s <SmaliFile>
- 把java方法名,native数组名,native方法名混淆打乱。(Added)
- 稍微改改可以实现全工程~ (Added)
- 添加包名过滤(Added)
- 加入随机参数
- 方法路径保护
- smali中已存在clinit的话要自己手动添加load (Fixed)
- 性能损耗未知........
- 使用SafeProject会造成N种问题,如:方法太多so库太大,调用太多无法回编...所以待添加过滤。(Fixed)
- 调用太多无法回编可以试试多Dex。
- 待添加。
##Sample 酷安(+字符串混淆) (不要问我字符串混淆哪来的,https://github.com/Qrilee/obfuseSmaliText)
以下是smalisafe.jar -p coolapk --f com.coolapk.market.view.main后的处理结果