這裏是我的ProGuard配置文件(我在Android tools文件夾複製,並增加了一些線條無法收縮亂舞使用ProGuard
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
-dontpreverify
# The remainder of this file is identical to the non-optimized version
# of the Proguard configuration file (except that the other file has
# flags to turn off optimization).
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
######################
# added by me
########################
# guava
-keepclasseswithmembers class com.google.common.base.internal.Finalizer{
<methods>;
}
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
#
#Action Bar Sherlock
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }
#-dontobfuscate
#-libraryjars libs/FlurryAgent.jar
我想在我的應用程序使用亂舞,但是當我試圖混淆我與FlurryAgen.jar應用ProGuard的失敗,說錯誤的這樣一個dosens:
Warning: com.flurry.android.ay: can't find referenced class com.google.ads.AdListener
而且當我嘗試不要混淆來源proguard的失敗
如何使用亂舞使用ProGuard 012?如何使proguard不混淆我的來源?
UPDATE 此外,我提到FlurryAgent.jar似乎已經模糊 - http://korniltsev.ru/p/jBU0f1c.png。可能我們可以忽略整個罐子的縮小?
您是否已經能夠驗證Flurry是否仍然在實踐中正確收集統計信息,因爲'-twtwarn com.flurry。**'?我處於嘗試在使用Flurry的應用程序中使用Proguard的情況,但是在使用'dontwarn'時我有點小心謹慎,因爲我不明白髮生了什麼。 –
後續行動:爲了給你的答案增加一點權限,我剛剛重新下載了Flurry Android SDK,並在文件* FlurryAds-READMEv3.0.5.pdf *中,最後有一個非常簡短的部分全文如下: * 7。使用ProGuard(可選) 如果您計劃在發佈應用程序之前在APK上運行ProGuard,則需要將以下內容添加到「proguard.cfg」文件中: -keep class com.flurry。** {*; } -dontwarn com.flurry。** * 所以我想我會使用這種方法,即使忽略這麼多的警告讓我有點不舒服。 –