使用Proguard的与Android不混淆 [英] Using Proguard with Android without obfuscation

查看:219
本文介绍了使用Proguard的与Android不混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个错误转换为的Dalvik格式失败,错误1使用-dontobfuscate标志的时候。否则,我的应用程序出口的罚款。我不想因为我使用BugSense错误跟踪混淆和他们收取$ 99个月,如果你需要去模糊处理堆栈跟踪。我仍然希望得到的ProGuard的文件大小和优化​​的好处。

I am getting an error "Conversion to Dalvik format failed with error 1" when using the -dontobfuscate flag. Otherwise my app exports fine. I don't want to obfuscate because I am using BugSense for error tracking and they charge $99 a month if you need to de-obfuscate your stack traces. I still want to get the file size and optimization benefits of proguard.

如果我注释掉-dontobfuscate每一件事情的伟大工程。除了不可读的堆栈跟踪。

If I comment out -dontobfuscate every thing works great. Except for the unreadable stack traces.

我progaurd.cfg文件:

my progaurd.cfg file:

-dontobfuscate
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

我也将接受一个指向我的方向是正确的答案。是否有一个日志文件,我应该看什么?

I will also accept an answer that points me in the right direction. Is there a log file I should be looking at?

推荐答案

加入!code /配置/变量的解决方法时,-dontobfuscate设为您的-optimizations ProGuard的错误

Add !code/allocation/variable is workaround for proguard bug when -dontobfuscate is set to your -optimizations

例如

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable

这篇关于使用Proguard的与Android不混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆