Skip to content
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

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

Open
309152665 opened this issue Jun 17, 2024 · 8 comments

Comments

@309152665
Copy link

image

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

@blackandwhiteforzj
Copy link

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

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

@309152665
Copy link
Author

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

@blackandwhiteforzj
Copy link

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

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

@309152665
Copy link
Author

consumer-rules.pro.zip

@blackandwhiteforzj
Copy link

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
Copy link
Author

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

@blackandwhiteforzj
Copy link

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

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

@309152665
Copy link
Author

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.** {
;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants