3

Is there a way to prevent AndroidManifest.xml from being obfuscated by DexGuard? It seems that MobileIron has some troubles with obfuscated manifest of our Android application. It processes a "plain" application just fine, but throws an error at the manifest of an obfuscated app.

Edit:

I just noticed the xmlstrings table of the obfuscated app is missing a bunch of strings:

aapt d xmlstrings c:\dev\app_obf.apk AndroidManifest.xml

String pool of 119 unique UTF-16 non-sorted strings, 119 entries and 0 styles using 5112 bytes:
String #0: 
String #1: 
String #2: 
String #3: 
String #4: name
String #5: 
.
.
String #18: versionCode
.
.
(up to String #25, then it is the same as in plain app)

Whereas the plain app's listing is following:

aapt d xmlstrings c:\dev\app.apk AndroidManifest.xml

String pool of 119 unique UTF-16 non-sorted strings, 119 entries and 0 styles using 6744 bytes:
String #0: versionCode
String #1: versionName
String #2: minSdkVersion
String #3: targetSdkVersion
String #4: name
String #5: required
String #6: hardwareAccelerated
String #7: icon
String #8: label
String #9: debuggable
String #10: value
...

Could that play a role or is it a normal behavior?

Both plain and obfuscated version of the app run just fine on devices.

kibitzerCZ
  • 375
  • 7
  • 15

2 Answers2

1

If someone still struggling with this, this line solved the problem to me:

-keepresourcexmlattributenames manifest/**
user1279395
  • 98
  • 1
  • 6
  • thanks! I had an issue with pro-guard screwing up my intent filter auto-verification config (App Link was not being handled directly by the app) and this solved it. Had no idea proguard stuck its dirty hands into the Manifest! – hmac Jan 29 '20 at 18:29
0

add the following to your DexGuard config --keepresourcefiles AndroidManifest.xml however AFAIK this is in the default DexGuard config.

Maybe its something else that MobileIron is not liking? Might be worth posting your DexGuard config or raising support issue with MobileIron.

scottyab
  • 21,990
  • 15
  • 91
  • 102
  • Unfortunately, DexGuard 6.1 throws an error saying `Unknown option '-keepresourcefiles'` – kibitzerCZ Dec 03 '15 at 17:17
  • Ah sorry I'm using DexGuard 7 - of course the resource obfuscation is new feature. – scottyab Dec 04 '15 at 11:22
  • Tried DexGuard Enterprise 7.0.32 today with `-keepresourcefiles AndroidManifest.xml` and `-keepresourcexmlattributenames manifest/*` options, resulting in the same output as 6. Proguard, on the other hand, keeps the `xmlstrings` table untouched. Weird. Probably we will have to get in touch with DexGuard support. – kibitzerCZ Dec 15 '15 at 16:15