Dưới đây là cấu hình Proguard của tôi (tôi sao chép nó từ thư mục công cụ android và thêm một số dòngKhông thể teo loạt với 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
Tôi muốn sử dụng Flurry trong ứng dụng của tôi, nhưng khi tôi cố gắng để xáo trộn ứng dụng của tôi với FlurryAgen.jar các Proguard không nói một dosens lỗi như thế này:.
Warning: com.flurry.android.ay: can't find referenced class com.google.ads.AdListener
Cũng Proguard thất bại khi tôi cố gắng không để xáo trộn các nguồn
Làm thế nào để sử dụng loạt với Proguard 012?Và làm thế nào để làm cho proguard không obfuscate nguồn của tôi?
CẬP NHẬT Ngoài ra tôi đã đề cập rằng FlurryAgent.jar dường như đã bị làm mờ - http://korniltsev.ru/p/jBU0f1c.png. Có thể chúng ta có thể bỏ qua việc thu hẹp toàn bộ cái bình?
bạn đã có thể xác minh rằng Flurry vẫn đang thu thập số liệu thống kê chính xác trong thực tế, với '-dontwarn com.flurry. **'? Tôi đang ở trong tình trạng tương tự đang cố gắng sử dụng Proguard trên một ứng dụng sử dụng Flurry, nhưng hơi thận trọng khi nói đến việc sử dụng 'dontwarn' vì tôi không thực sự hiểu chuyện gì đang diễn ra. –
Theo dõi: chỉ để thêm một chút quyền hạn cho câu trả lời của bạn, tôi vừa tải xuống lại SDK Flurry Android và trong tệp * FlurryAds-READMEv3.0.5.pdf *, ở phần cuối, có một phần rất ngắn gọn lần đọc: * 7. Sử dụng ProGuard (Tùy chọn) Nếu bạn dự định chạy ProGuard trên APK của mình trước khi phát hành ứng dụng, bạn cần thêm thông tin sau vào tệp "proguard.cfg": -keep class com.flurry. ** {*; } -dontwarn com.flurry. ** * Vì vậy, tôi đoán tôi sẽ sử dụng phương pháp này, mặc dù bỏ qua nhiều cảnh báo này khiến tôi hơi khó chịu. –