I am using dexguard 6.0.26 to obfuscate an android library. In the config file I have the following options
-android
-zipalign 4
-include E:\\DexGuard6.0.26\\lib\\dexguard-assumptions.pro
-dontoptimize
-dontshrink
-dontusemixedcaseclassnames
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
-dontskipnonpubliclibraryclasses
Along with the usual keep options for my classes. The library builds and my app that uses the library works fine on many devices, but on some devices (e.g asus zenpad 3s 10 z500kl , android 7.0), some strange behaviour occurs
- The library code uses the MD5 hash algorithm and on the faulty devices I get the error Message java.security.NoSuchAlgorithmException: MD5 MessageDigest not available, at the line MessageDigest.getInstance("MD5"); but on other devices the app works fine.
- Some blocks of code e.g if..else are completely skipped/ignored even though after decompiling the obfuscated jar I can see the code block in the class file!!
Just to make sure, if I add the dexguard option -dontobfuscate and re-build my jar, the app now works fine on all devices including the asus tablet, so I know for sure obfuscation is doing something crazy here.
Has anyone ever faced this issue and managed to resolved it? Any help/tips would be appreciated.