Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscated application fails with AbstractMethodError when adding almost any Widget #150

Open
ComBatVision opened this issue Apr 10, 2023 · 2 comments

Comments

@ComBatVision
Copy link

ComBatVision commented Apr 10, 2023

Hello.
We have an application with recommended Proguard rules, but it fails in release version with AbstractMethodError when adding almost any widget on UI. Usual SDK without UX work pretty well.

What we are doing wrong?

java.lang.AbstractMethodError: abstract method "void dji.keysdk.callback.KeyListener.onValueChange(java.lang.Object, java.lang.Object)"
                                                                                                    	at dji.internal.hgf.fdd$dfh.run(Unknown Source:6)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:883)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    	at android.os.Looper.loop(Looper.java:237)
                                                                                                    	at android.os.HandlerThread.run(HandlerThread.java:67)

Proguard rules:

-dontwarn dji.**
-keep class dji.** { *; }
-keep class okio.** { *; }
-keep class com.secneo.sdk.** { *; }
-keep class com.google.gson.** { *; }
-keep class org.bouncycastle.** { *; }
-keep class org.greenrobot.eventbus.** { *; }
-keep class androidx.** { *; }
-keep class android.media.** { *; }
-keep class com.lmax.disruptor.** { *; }
-keep class com.qx.wz.dj.rtcm.* { *; }
-keep class com.squareup.wire.** { *; }

@ComBatVision
Copy link
Author

For some Reasons DJISDKModel.java class is loosing lambda expression in release version:

KeyListener var4 = (var2xx, var3x) -> {
                    if (var3x != null) {
                        var2.updateWidgetObservable(var2x).subscribeOn(AndroidSchedulers.mainThread()).startWith(var2.transformValueObservable(var3x, var2x)).subscribe();
                    }

                };

@ComBatVision
Copy link
Author

This issue appears in case SDK is used in a amdroid library gradle module, not in the main application module.

In case of SDK is used inside android library module it is required to add compile only dependency to provided SDK in application gradle.

compileOnly "com.dji:dji-sdk-provided:4.16.4"

Could you investigate is it possible to fix this problem to be able to isolate integration with SDK completely in android library module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant