2017-03-15 5 views
0

私は適用の問題に直面していますProGuardBilldesk SDKです。Billdesk Android SDKのProguardルール

私は正常に動作し、その後ProGuardのせずにAPKを構築する場合、しかし、SDK適切に初期化されていません

、とProGuardのは、エラーを取得してビルドする場合。 Billdesk通話用の

私のアプリケーションの外観のための現在のProGuardのルールのように、

# code for optimazation 
-dontnote org.json.** 
-dontwarn org.apache.http.** 
-dontnote org.apache.http.** 
-dontwarn android.net.http.AndroidHttpClient 
-dontnote android.net.http.** 

#OKHTTP 
-keepattributes Signature 
-keepattributes *Annotation* 
-keep class okhttp3.** { *; } 
-keep interface okhttp3.** { *; } 
-dontwarn okhttp3.** 

-dontwarn okio.** 


# Retrofit 2.X 
## https://square.github.io/retrofit/ ## 

-dontwarn retrofit2.** 
-keep class retrofit2.** { *; } 
-keepattributes Signature 
-keepattributes Exceptions 

-keepclasseswithmembers class * { 
    @retrofit2.http.* <methods>; 
} 

# Simple-Xml Proguard Config 
# NOTE: You should also include the Android Proguard config found with the build tools: 
# $ANDROID_HOME/tools/proguard/proguard-android.txt 

# Keep public classes and methods. 
-dontwarn com.bea.xml.stream.** 

-dontwarn org.simpleframework.xml.stream.** 
-dontwarn javax.xml.** 

-keep public class org.simpleframework.**{ *; } 
-keep class org.simpleframework.xml.**{ *; } 
-keep class org.simpleframework.xml.core.**{ *; } 
-keep class org.simpleframework.xml.util.**{ *; } 

-keepattributes Signature 
-keepattributes *Annotation* 

# Ignore our XML Serialization classes 
-keep public class packagename.model.ServerResponse{ 
    public protected private *; 
} 
-keep public class packagename.model.ServerRequest{ 
    public protected private *; 
} 

-keep public class packagename.activity.ProceedToPayActivity{ 
    public protected private *; 
} 



-keep public class packagename.model.ServerResponseHeader{ 
    public protected private *; 
} 


# 
#-dontwarn com.bea.xml.stream.** 
# 
#-keep class org.simpleframework.xml.**{ *; } 
#-keepclassmembers,allowobfuscation class * { 
# @org.simpleframework.xml.* <fields>; 
# @org.simpleframework.xml.* <init>(...); 
#} 



-keep class com.jamesmurty.** { *; } 
-dontwarn com.jamesmurty.utils.** 

## 
##Billdesk rules 
-keep public class com.billdesk.sdk.* 
-keep public class com.billdesk.config.* 
-keep public class com.billdesk.utils.URLUtilActivity 
-keep public interface com.billdesk.sdk.LibraryPaymentStatusProtocol{ 
public void paymentStatus(java.lang.String,android.app.Activity); 
} 
-keep class com.billdesk.sdk.PaymentWebView$JavaScriptInterface{ 
public void gotMsg(java.lang.String); 
} 
-keepclassmembers class * { 
@android.webkit.JavascriptInterface <methods>; 
} 
-keepattributes JavascriptInterface 
-keep public class com.billdesk.sdk.PaymentWebView$JavaScriptInterface 
-keep public class * implements com.billdesk.sdk.PaymentWebView$JavaScriptInterface 
-keepclassmembers class com.billdesk.sdk.PaymentWebView$JavaScriptInterface { 
<methods>; 
} 

答えて

0

BilldeskPaymentCallback billdeskPaymentCallback = new BilldeskPaymentCallback(); 
Intent intent = new Intent(getApplicationContext(), PaymentOptions.class); 
intent.putExtra(Constants.BILLDESK_MESSAGE, billdeskToken); //pg_msg 
intent.putExtra(Constants.BILLDESK_CALLBACK, billdeskPaymentCallback); 
startActivity(intent); 

それはあなたの入力にアクセスし、それのためにJSONを作成します。

間違いは、私が適切にこのコードの動作を追加した後JSON、

ためProGuardのルールを記述していないでした。

-keep public class org.json.*{ *; } 
-keep class org.json.*{ *; } 
-keepclassmembers,allowobfuscation class * { 
    @org.json.* <fields>; 
    @org.json.* <init>(...); 
} 
関連する問題