androidgradledexguard

Dexguarded Android Library is missing SO files


My issue has to do with building a dexguarded Android library, containing shared object files (*.so). The SO files are needed for a internal JAR we use in our library. The goal of our library is to simplify the use of the internal library and providing easy to use APIs. We have to dexguard the library to minimize the risk of reverse engineering as it is used for highly secure applications.

Anyways, when we build the library, the final product is missing the SO files. Again, I will iterate, we don't reference these SO files directly. They are used by an internal JAR that we use as a dependency.

The workaround that we have found to work, is to build our gradle target TWICE.

For example, running this target,

./gradlew assembleRelease

will create an AAR file with missing SO files.

However, if I perform these commands, in sequence, without cleaning in between,

./gradlew assembleRelease
./gradlew assembleRelease

the created AAR file will have the SO files present. It's really strange.

My goal is to be able to only run the task once, and have the SO files present in the AAR file. I've tried numerous things to try and solve this but without success.

I tried other things I cannot think of right now.

Regardless, if anyone has seen and solved this issue, please let me know. The workaround works for us right now, but this is something that has been an issue for about half a year now without a solution and I'd love to have a solution that isn't a workaround... or an explanation on why this is happening.


Solution

  • This issue has been resolved in newer versions of Dexguard. Upgrading Dexguard was our solution.