Retrofit2 用Proguard改装2

Retrofit2 用Proguard改装2,retrofit2,jsonschema2pojo,Retrofit2,Jsonschema2pojo,如果未启用Proguard,改装2将正常工作。。。但启用时,应用程序会崩溃 以下是我的程序规则: -dontwarn retrofit2.Platform$Java8 -dontwarn okio.** -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes Signature -keepattributes Exceptions -keepattributes *Annotation* -keepattri

如果未启用Proguard,改装2将正常工作。。。但启用时,应用程序会崩溃

以下是我的程序规则:

-dontwarn retrofit2.Platform$Java8
-dontwarn okio.**
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*

-keepattributes RuntimeVisibleAnnotations
-keepattributes RuntimeInvisibleAnnotations
-keepattributes RuntimeVisibleParameterAnnotations
-keepattributes RuntimeInvisibleParameterAnnotations

-keepattributes EnclosingMethod

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

-keepclasseswithmembers interface * {
    @retrofit2.* <methods>;
}
-keepclassmembers class demirci.omer.butun.gazeteler.siteler.newspapers.data.model.** { <fields>; }
-keep class demirci.omer.butun.gazeteler.siteler.newspapers.data.model.** { <fields>; }
-keep class demirci.omer.butun.gazeteler.siteler.newspapers.data.ApiEndPoint { <fields>; }
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
-keep class retrofit2.converter.gson.** { *; }
-dontwarn改造2.Platform$Java8
-唐特沃恩·奥基奥**
-dontwarn 2**
-保持类2.*{*;}
-保留署名
-保留特例
-keepattributes*注释*
-KeepAttribute运行时可视注释
-keepattributes运行时不可见标记
-keepattributes RuntimeVisibleParameterAnnotations
-keepattributes RuntimeInvisibleParameterAnnotations
-keepattributes封闭方法
-keepclassswithmembers类*{
@改装2.*;
}
-KeepClassSwithMembers接口*{
@改装2.*;
}
-keepclassmembers类demirci.omer.butun.gazeteler.siteler.papers.data.model.*{;}
-保留类demirci.omer.butun.gazeteler.siteler.papiers.data.model.*{;}
-保持类demirci.omer.butun.gazeteler.siteler.papiers.data.apidendpoint{;}
-保持类sun.misc.Unsafe{*;}
-保持类com.google.gson.stream.*{*;}
-保持类2.converter.gson.*{*;}
我已阅读以下问题:

但我也使用POJO改装2转换器。我认为这个问题出现了…发现了这个问题:

出现问题的地方有两个控制点

改装2 proguard规则不适用 如果字段模糊,则POJO的2转换器GSON未转换数据

我不知道哪种情况下会出现问题

这是我的api接口:

public interface ApiEndPoint {

    @FormUrlEncoded
    @POST("all_newspaper/get_text.php")
    Call<NewsContentClass> getContent(@Field("url") String url);

    @FormUrlEncoded
    @POST("all_newspaper/add_user_url.php")
    Call<Void> addUserUrl(@Field("app_name") String appName,@Field("mobile_url") String mobile_url,@Field("desktop_url") String desktop_url);
}
公共接口{
@FormUrlEncoded
@POST(“所有报纸/get_text.php”)
调用getContent(@Field(“url”)字符串url);
@FormUrlEncoded
@POST(“所有报纸/添加用户url.php”)
调用addUserUrl(@Field(“app\u name”)字符串appName,@Field(“mobile\u url”)字符串mobile\u url,@Field(“desktop\u url”)字符串desktop\u url);
}
尝试添加

-keepclasseswithmembers class * {
    @retrofit2.http.* <methods>;
}
-keepclassswithmembers类*{
@2.http.*;
}
尝试添加

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

从改装2站点尝试以下规则:

    ########--------Retrofit + RxJava--------#########
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

请从Reformation2站点尝试以下规则:

    ########--------Retrofit + RxJava--------#########
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions