Adyen / adyen-android

Adyen Android Drop-in and Components
https://docs.adyen.com/checkout/android
MIT License
120 stars 66 forks source link

[v5.4.0] Disabling code obfuscation #1666

Closed wrozwad closed 2 weeks ago

wrozwad commented 3 weeks ago

Is your feature request related to a problem? Please describe. We have several libraries with obfuscated code in our project. Unfortunately, after updating from 5.3.1 to 5.4.0, we encountered an error

Duplicate class a.a found in modules some-library-12.3.1.aar -> some-library-12.3.1-runtime (com.some.library:some-library:12.3.1) 
and twint-5.4.0.aar -> twint-5.4.0-runtime (com.adyen.checkout:twint:5.4.0)

We tried to disable this module by:

exclude(group = "com.adyen.checkout", module = "twint")

Unfortunately, it is used in another action-core module so we can't do that.

Describe the solution you'd like Could you disable obfuscation for the entire Twint module? Currently, in TwintSdk-android-8.0.0.jar, there is a package a with classes a and b, which complicates SDK update. Or even better, could you disable code obfuscation for the entire project? The SDK is open-source anyway, and this would give us access to function comments and make it much easier to navigate bugs and debug why something isn't working for us.

OscarSpruit commented 3 weeks ago

Hi @wrozwad, thank you for the suggestion! Our SDK is only obfuscated if you enable it for your app. The minification process comes with a lot of optimizations, so we would like to keep supporting it. You could disable obfuscation of our SDK by adding -keep public class com.adyen.checkout.** to your Proguard rules.

Unfortunately, the Twint SDK is pre-obfuscated, so even when obfuscation is disabled for our SDK this problem will persist. We will reach out to Twint to see if they can fix it and we will look for a workaround in the mean time

OscarSpruit commented 2 weeks ago

@wrozwad we found the cause of the problem and the fix will land in the next release. R8 does not seem to understand compileOnly dependencies. For now you can include the following Proguard rules to work around it 👇 Thanks again for reporting!

-dontwarn com.adyen.checkout.adyen3ds2.**
-dontwarn com.adyen.checkout.twint.**
-dontwarn com.adyen.checkout.wechatpay.**