appspector / android-sdk

AppSpector is a debugging service for mobile apps
https://appspector.com
43 stars 9 forks source link

Proguard rules #1

Closed davidbilik closed 5 years ago

davidbilik commented 6 years ago

Hello, what are the recommended proguard rules for your SDK? Because it does not work out of the box, it throws lot of warnings like

Warning: com.appspector.sdk.instrumentation.OkHttp2Instrument$CallWrapper: can't find superclass or interface com.squareup.okhttp.Call
Warning: com.appspector.sdk.instrumentation.OkHttp2Instrument$CallbackWrapper: can't find superclass or interface com.squareup.okhttp.Callback
Warning: com.appspector.sdk.core.connection.socket.TLSSocketFactory: can't find referenced class com.squareup.okhttp.TlsVersion
Warning: com.appspector.sdk.core.connection.socket.TLSSocketFactory: can't find referenced class com.squareup.okhttp.TlsVersion
Warning: com.appspector.sdk.core.connection.socket.TLSSocketFactory: can't find referenced class com.squareup.okhttp.TlsVersion
Warning: com.appspector.sdk.instrumentation.OkHttp2Instrument: can't find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.appspector.sdk.instrumentation.OkHttp2Instrument: can't find referenced class com.squareup.okhttp.OkHttpClient

however If I suppress this warnings with

-dontwarn com.appspector.sdk.**

it then crashes at runtime on

 java.lang.InternalError: Thread starting during runtime shutdown
        at java.lang.Thread.nativeCreate(Native Method)
        at java.lang.Thread.start(Thread.java:730)
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:941)
        at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:1009)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1151)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)

I even tried to keep all appspector classes but no change.

Anyway its a great tool but our testers are using proguarded app so its as close to production as possible.

Dimdron commented 5 years ago

Hi, we have an integrated rules to the SDK aar file, but I've provided proguard-rules.pro file just in case.