2

My main concern is that when i extract my APK i can see all the layout files and the strings etc even the manifest. using proguard i have obfuscated all the java files using

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# If you want to enable optimization, you should include the
# following:
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**

what i am thinking that if we can encrypt the layout files grammatically and when the application starts to decrypt them or any other method to make them secure from being miss used

Thanks In Advance

1 Answers1

2

Not so sure about encrypting the resources by Proguard but at least, I believe you can obfuscate them.

Use AndResGuard:

AndResGuard is a tooling for reducing your apk size, it works like the ProGuard for Java source code, but only aim at the resource files. It changes res/drawable/wechat to r/d/a, and renames the resource file wechat.png to a.png. Finally, it repackages the apk with 7zip, which can reduce the package size obviously.

Obfuscate android resources. It contains all the resource type(such as drawable、layout、string...). It can prevent your apk from being reversed by Apktool.

However;

ProGuard only affects Java code, not resources. You will need to research other tools, like DexGuard, that may offer resource obfuscation. Whether there is a tool that can obfuscate raw resources is another matter.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • this was a good solution but this didn't have any effect on my layouts or drawables. It infact obfuscated my java code to a whole new level and that's also quite good for me – Neville Narcis Sep 26 '18 at 11:58
  • Did you read [this](https://github.com/shwenzhang/AndResGuard)? You'll also need to add a block `andResGuard` then doing stuff on it. However, it can obfuscate the codes and seperate them somehow for not to being readable, and actually, can't guarantee that it will have the same result as the java gets obfuscated on xml files. – ʍѳђઽ૯ท Sep 26 '18 at 12:00