定期SDK Proguard规则

时间:2018-11-12 12:05:51

标签: java android android-proguard

任何人都可以为Tenor Sdk android提供保护规则。 git上的sdk没有提供任何规则。 git存储库的链接是:

https://github.com/Tenor-Inc/tenor-android-core

以下是我遇到的崩溃异常:

FATAL EXCEPTION: main
                                                   Process: com, PID: 14520
                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com/com.ui.activities.GifListActivity}: java.lang.IllegalArgumentException: Unable to create converter for class com.tenor.android.core.d.a.c
                                                       for method d.a
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
                                                       at android.app.ActivityThread.access$900(ActivityThread.java:157)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:148)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5525)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
                                                    Caused by: java.lang.IllegalArgumentException: Unable to create converter for class com.tenor.android.core.d.a.c
                                                       for method d.a
                                                       at h.n$a.a(ServiceMethod.java:752)
                                                       at h.n$a.c(ServiceMethod.java:738)
                                                       at h.n$a.a(ServiceMethod.java:169)
                                                       at h.m.a(Retrofit.java:170)
                                                       at h.m$1.invoke(Retrofit.java:147)
                                                       at java.lang.reflect.Proxy.invoke(Proxy.java:393)
                                                       at $Proxy0.a(Unknown Source)
                                                       at com.i.b.a(GiffRetrievalService.java:38)
                                                       at com.ui.activities.GifListActivity.a(GifListActivity.java:93)
                                                       at com.ui.activities.GifListActivity.a(GifListActivity.java:63)
                                                       at com.ui.activities.GifListActivity.onCreate(GifListActivity.java:58)
                                                       at android.app.Activity.performCreate(Activity.java:6272)
                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
                                                        ... 9 more
                                                    Caused by: java.lang.IllegalArgumentException: class com.tenor.android.core.b.a.b declares multiple JSON fields named a
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:170)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
                                                       at com.google.gson.f.a(Gson.java:423)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:115)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:164)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
                                                       at com.google.gson.f.a(Gson.java:423)
                                                       at com.google.gson.internal.bind.CollectionTypeAdapterFactory.a(CollectionTypeAdapterFactory.java:53)
                                                       at com.google.gson.f.a(Gson.java:423)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:115)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:164)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
                                                       at com.google.gson.f.a(Gson.java:423)
                                                       at com.google.gson.internal.bind.CollectionTypeAdapterFactory.a(CollectionTypeAdapterFactory.java:53)
                                                       at com.google.gson.f.a(Gson.java:423)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:115)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:164)
                                                       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
                                                       at com.google.gson.f.a(Gson.java:423)
                                                       at h.a.a.a.a(GsonConverterFactory.java:64)
                                                       at h.m.a(Retrofit.java:330)
                                                       at h.m.b(Retrofit.java:313)
                                                       at h.n$a.c(ServiceMethod.java:736)
                                                        ... 21 more

谢谢

1 个答案:

答案 0 :(得分:1)

使用此规则

 -keep class com.tenor.android.core.** { *; }

这将防止com.tenor.android.core软件包中所有分类的内容受到保护