微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何使用Proguard保护Android Manifest和字符串xml

如何解决如何使用Proguard保护Android Manifest和字符串xml

我尝试使用proguard保护代码免遭反向工程,这是我的代码。但是,我的所有资源文件都不会被混淆。

# debugging stack traces.
-keepattributes SourceFile,LineNumberTable
-dontwarn com.alldaydr.clinician.ui.auth.model.*

#rules for custom view
-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context,android.util.AttributeSet);
    public <init>(android.content.Context,android.util.AttributeSet,int);
    public void set*(...);
}

#Keep Native codes
-keepclasseswithmembernames class * { native <methods>; }

#keep model class
-keepclassmembers class com.alldaydr.clinician.ui.auth.model.* { *; }

# OkHttp3
-keep class okhttp3.* { *; }
-dontwarn okhttp3.**
-dontwarn okio.**

#Retrofit 2
-keep class retrofit2.* { *; }
-dontwarn retrofit2.*

what all things I should include in the above code for protecting the code from reverse engineering. 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。