0

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.

shizhen
  • 12,251
  • 9
  • 52
  • 88
user681443
  • 267
  • 2
  • 11
  • My only advice is to contact Guardsquare support. They're generally quite good at helping to diagnose problems (as you'd expect for the price). We've had quite a few issues, both while building and at runtime. Approximately half of those issues were configuration errors on our end, but quite a few were bugs in their SDK, which they fixed reasonably promptly. – aaronmarino Dec 17 '19 at 16:37
  • Well unfortunately guardsquare told me that version 6.0.26 is old and I need to buy a newer version. Only problem is that the newer version is per package based licensing which isn't suitable for me, thanks though – user681443 Jan 07 '20 at 04:10

0 Answers0