2013-08-09 4 views
1

Android 용 Robospice + Spring을 사용하고 있습니다. Proguard가 코드를 축소해도 제대로 작동하지만 난독 화 요청을 성공적으로 완료하면 (로그에 요청 청취자 1 명에게 null을 알리는 메시지가 표시됨). 하지만 그것은 청취자가 onRequestSuccess 대신 onRequestFailed를 받고있는 것 같습니다. 왜 그런가, 내 config 파일 (아래 첨부)에 뭔가가 있습니까?Robospice Proguard 요청에 대한 난독 화 원인이 "실패"합니다.

#-optimizationpasses 5 
-dontoptimize 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/commons-io-1.3.2.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/commons-lang3-3.1.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/jackson-core-asl-1.9.11.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/jackson-mapper-asl-1.9.11.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/robospice-1.4.6.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/robospice-cache-1.4.6.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/robospice-spring-android-1.4.6.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/spring-android-core-1.0.1.RELEASE.jar 
-libraryjars /Users/Ryan/git/haiku-learning-android/HaikuLearningAndroid/libs/spring-android-rest-template-1.0.1.RELEASE.jar 


#Specifies not to ignore non-public library classes. As of version 4.5, this is the default setting 
-dontskipnonpubliclibraryclasses 

#Preverification is irrelevant for the dex compiler and the Dalvik VM, so we can switch it off with the -dontpreverify option. 
-dontpreverify 

#Specifies to write out some more information during processing. If the program terminates with an exception, this option will print out the entire stack trace, instead of just the exception message. 


#The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. Note that the Dalvik VM also can't handle aggressive overloading (of static fields). 
#To understand or change this check http://proguard.sourceforge.net/index.html#/manual/optimizations.html 
#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 

#To repackage classes on a single package 
#-repackageclasses '' 

#Uncomment if using annotations to keep them. 
#-keepattributes *Annotation* 

#Keep classes that are referenced on the AndroidManifest 
-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 com.android.vending.licensing.ILicensingService 


#To remove debug logs: 
-assumenosideeffects class android.util.Log { 
    public static *** d(...); 
    public static *** v(...); 
} 

#To avoid changing names of methods invoked on layout's onClick. 
# Uncomment and add specific method names if using onClick on layouts 
-keepclassmembers class * { 
public void onClickButton(android.view.View); 
} 

#Maintain java native methods 
-keepclasseswithmembernames class * { 
    native <methods>; 
} 

#To maintain custom components names that are used on layouts XML. 
#Uncomment if having any problem with the approach below 
#-keep public class custom.components.package.and.name.** 

#To maintain custom components names that are used on layouts XML: 
-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*(...); 
} 

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

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

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

#To keep parcelable classes (to serialize - deserialize objects to sent through Intents) 
-keep class * implements android.os.Parcelable { 
    public static final android.os.Parcelable$Creator *; 
} 

#Keep the R 
-keepclassmembers class **.R$* { 
    public static <fields>; 
} 
# For RoboSpice 
#Results classes that only extend a generic should be preserved as they will be pruned by Proguard 
#as they are "empty", others are kept 
-keep class com.HaikuLearning.Android.POJOs.** 

#RoboSpice requests should be preserved in most cases 
-keepclassmembers class com.HaikuLearning.Android.Requests.** { 
    public void set*(***); 
    public *** get*(); 
    public *** is*(); 
} 

#Warnings to be removed. Otherwise maven plugin stops, but not dangerous 
-dontwarn android.support.** 
-dontwarn com.sun.xml.internal.** 
-dontwarn com.sun.istack.internal.** 
-dontwarn org.codehaus.jackson.** 
-dontwarn org.springframework.** 
-dontwarn java.awt.** 
-dontwarn javax.security.** 
-dontwarn java.beans.** 
-dontwarn javax.xml.** 
-dontwarn java.util.** 
-dontwarn org.w3c.dom.** 
-dontwarn com.google.common.** 
-dontwarn com.octo.android.robospice.persistence.** 

### Jackson SERIALIZER SETTINGS 
-keepclassmembers,allowobfuscation class * { 
    @org.codehaus.jackson.annotate.* <fields>; 
    @org.codehaus.jackson.annotate.* <init>(...); 
} 
-dontskipnonpubliclibraryclassmembers 
-keepattributes *Annotation*,EnclosingMethod 
-keepnames class org.codehaus.jackson.** { *; } 
+0

https://github.com/octo-online/robospice/wiki/Proguard-configuration-for-RoboSpice-projects에서 살펴보십시오. –

답변

2

난독 화가 실패하면 로그에 경고가 표시됩니다. 이클립스에서는 logcat보기에서 "모든 메시지"를 선택하고 경고 (오렌지색)로 필터링합니다.

VRFY :

당신은 같은 것들을 볼 수 클래스 XXX를 찾을 수 없습니다 또는 클래스 XXX의 슈퍼 클래스를 찾을 수 없습니다.

클래스를 찾을 수없는 것을 확인한 다음 proguard conf 파일에 추가 할 수 있습니다.

관련 문제