luoyesiqiu / dpt-shell

An android Dex protects shell implementation
MIT License
519 stars 190 forks source link

我代码进行混淆之后加固会报错 , 但是我不混淆进行加固反而不报错. #47

Open 309152665 opened 2 weeks ago

309152665 commented 2 weeks ago
image

不混淆进行加固反而正常运行 , 混淆之后加固运行反而失败了.

blackandwhiteforzj commented 2 weeks ago
image

不混淆进行加固反而正常运行 , 混淆之后加固运行反而失败了.

完整的启动日志贴一下或者把加固前的apk发出来

309152665 commented 2 weeks ago

@blackandwhiteforzj 你这边提供个联系方式 , 我100多M的apk 平台上传不上去.

blackandwhiteforzj commented 2 weeks ago

@blackandwhiteforzj 你这边提供个联系方式 , 我100多M的apk 平台上传不上去.

你把你的混淆规则文件 proguard-rules.pro 发一下

309152665 commented 2 weeks ago

consumer-rules.pro.zip

blackandwhiteforzj commented 2 weeks ago

consumer-rules.pro.zip

保持所有 Activity 类不被混淆

-keep public class * extends android.app.Activity

保持所有 Fragment 类不被混淆

-keep public class extends android.app.Fragment -keep public class extends android.support.v4.app.Fragment

保持 ComponentActivity 及其子类不被混淆

-keep public class androidx.activity.ComponentActivity { ; } -keep public class androidx.fragment.app.FragmentActivity { ; }

保持所有继承自 ComponentActivity 和 FragmentActivity 的类不被混淆

-keep public class extends androidx.activity.ComponentActivity { ; } -keep public class extends androidx.fragment.app.FragmentActivity { ; }

309152665 commented 2 weeks ago

大佬有没有了解过 so 加固 , 或者有什么参考的项目源码?

blackandwhiteforzj commented 2 weeks ago

大佬有没有了解过 so 加固 , 或者有什么参考的项目源码?

有源码的加固难度不大,无源码的加固不好搞,如果只是自己项目安全考虑,ollvm混淆下 就行了

309152665 commented 1 week ago

consumer-rules.pro.zip

保持所有 Activity 类不被混淆

-keep public class * extends android.app.Activity

保持所有 Fragment 类不被混淆

-keep public class extends android.app.Fragment -keep public class extends android.support.v4.app.Fragment

保持 ComponentActivity 及其子类不被混淆

-keep public class androidx.activity.ComponentActivity { ; } -keep public class androidx.fragment.app.FragmentActivity { ; }

保持所有继承自 ComponentActivity 和 FragmentActivity 的类不被混淆

-keep public class extends androidx.activity.ComponentActivity { ; } -keep public class extends androidx.fragment.app.FragmentActivity { ; }

经过我几天的努力 , 我的应用不需要加上面这些混淆 , 只要你的壳的混淆要怎么写就不会不崩溃了.

-assumenosideeffects class android.util.Log { public static int d(...); public static int e(...); public static int w(...); public static int i(...); public static int v(...); }

-keep class com.luoyesiqiu.shell.JniBridge {*;} -keep class com.luoyesiqiu.shell.util.* {;}