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

作者你好,你的混淆配置错误了,没有把规则打包进aar #164

Closed
davidgerka opened this issue Jul 16, 2021 · 5 comments
Closed

Comments

@davidgerka
Copy link

davidgerka commented Jul 16, 2021

如下图所示,把红框改为绿框就可以了
image
可以看看这两个贴,验证一下:
https://www.jianshu.com/p/a8614ff60647
https://blog.csdn.net/zjws23786/article/details/58587289

@davidgerka
Copy link
Author

新建一个库工程,as会自动添加混淆配置,如下图,我们应该是要用绿框这个
image

@DearZack
Copy link

在库没改的前提下你是怎么解决的

@princekin-f
Copy link
Owner

如下图所示,把红框改为绿框就可以了
image
可以看看这两个贴,验证一下:
https://www.jianshu.com/p/a8614ff60647
https://blog.csdn.net/zjws23786/article/details/58587289

好的,感谢分享反馈,学到了,再次感谢!

@princekin-f
Copy link
Owner

在库没改的前提下你是怎么解决的

可以把框架的混淆规则配到项目里:

# 保持配置类 config 不被混淆
-keep class com.lzf.easyfloat.data.FloatConfig {*;}

# 保持自定义控件、ContentProvider 不被混淆
-keep public class * extends android.view.View
-keep public class * extends android.content.ContentProvider

# 保持枚举 enum 类不被混淆
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# 保持反射不被混淆
-keepattributes EnclosingMethod

@princekin-f
Copy link
Owner

已修复v2.0.4

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

3 participants