我有一個Jenkins構建服務器,用於構建ant和Android(SDK修訂版18)的Android APK。發佈APK的工作正常。但是,如果我通過提供一個proguard.cfg啓動proguard,並通過project.properties中的「proguard.config = proguard.cfg」指向它,以下似乎會發生:螞蟻似乎忽略由Proguard產生的jar而包裝APK
Proguard被執行(從shell輸出和之後會出現mappings.txt和seeds.txt) 已經生成了一個apk。但是由APK生成的Stacktraces根本不會被模糊處理。
任何人都有這個想法嗎?看起來,由proguard生成的jar是由於某些原因未包含在apk中。
這裏是我的ProGuard配置
-optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations!代碼/簡化/算術!現場/ ,!類/合併/
-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 *; } #ACRA specifics # we need line numbers in our stack traces otherwise they are pretty useless -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable # ACRA needs "annotations" so add this... -keepattributes *Annotation* # keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'. # Note: if you are removing log messages elsewhere in this file then this isn't necessary -keep class org.acra.ACRA { *; } # keep this around for some enums that ACRA needs -keep class org.acra.ReportingInteractionMode { *; } # keep this otherwise it is removed by ProGuard -keep public class org.acra.ErrorReporter { public void addCustomData(java.lang.String,java.lang.String); } # keep this otherwise it is removed by ProGuard -keep public class org.acra.ErrorReporter { public org.acra.ErrorReporter$ReportsSenderWorker handleSilentException(java.lang.Throwable); }
的mappings.txt指出我的代碼進行模糊處理:
de.cellular.crashtest.ObfuscateThisClass -> de.cellular.crashtest.b:
但是它沒有在報告堆棧跟蹤模糊