Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

DexGuard removes native libraries (.so files) #134

Open
jukka828 opened this issue May 3, 2017 · 0 comments
Open

DexGuard removes native libraries (.so files) #134

jukka828 opened this issue May 3, 2017 · 0 comments

Comments

@jukka828
Copy link

jukka828 commented May 3, 2017

General information

  • SDK/Library version: 5.5.1
  • Android Version and Device: Happens with all devices

Issue description

When using DexGuard for obfuscating our application which uses the card.io library, all card.io native libraries (.so files) get removed from the final apk. DexGuard is a commercial extension of ProGuard. It removes all native libraries that it thinks are not used, unlike ProGuard which doesn't touch the native libraries.

The reason why DexGuard removes them for card.io is that in the CardScanner.java the native libraries are loaded differently than what DexGuard requires. They say in their documentation "... you should make sure that your code loads each native library with System.loadLibrary("mycode"), with the name specified as a string literal or constant.". But in CardScanner.java the libraries are loaded with a String variable inside the method "loadLibrary(String libraryName)". That's why DexGuard doesn't find the link between the native libraries and the Java code.

I wrote a fix for this locally and the native libraries are working with it in our application, but I haven't tried with ProGuard. I can send a patch file if needed.

jukka828 added a commit to jukka828/card.io-Android-source that referenced this issue Jul 28, 2017
This will fix the issue: card-io#134
The behaviour of the library does not change. Only the way it's written changes.

I tested with the SampleApp and our company's production app which uses DexGuard. I tested with these devices:
- Samsung Galaxy S6, Android 7.0
- Sony Xperia Z5 Compact, Android 7.1.1
- HTC One M8, Android 6.0
- Nexus 5, Android 5.1.1
- Samsung Galaxy S4, Android 4.4.2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant