Ovi
Ovi

Reputation: 362

Android: What is Proguard and ProGuard mapping

When i checked the crash of my application ,noticed this report

Upload your ProGuard deobfuscation file in order to deobfuscate future stack traces for this APK version. checked this link but didnot understand https://support.google.com/googleplay/android-developer/answer/6295281?hl=en

Upvotes: 9

Views: 5683

Answers (4)

yoAlex5
yoAlex5

Reputation: 34255

Proguard makes several things like shrinking, obfuscating...(Proguard) one by one and log it's work to specific files(ProGuard mapping)

[Read more here]

Upvotes: 0

Long Ranger
Long Ranger

Reputation: 6008

As my answer from here, Proguard is one of the main process when you tried to compile an apk (especially when you release the apk to google play store)

  1. Obfuscation

  2. Optimization

  3. Shrinking

Android studio import problems. (Apktool)

To say it in simple way, you can see it how a apk without proguard would be seen by using some reverse engineering technologies

https://ahbsa.wordpress.com/2015/04/30/decompiling-apk-reverse-engineering-android-application/

The classes inside apk with proguard would be something like that by using some reverse engineering technologies

enter image description here

You might have the mind now. Even though you used Proguard , the .dex classes could still be decomplied. But the code is almost unreadable if you used Proguard. And if you used some more advanced technologies ( such as Dexguard), they can provide better performance and the code will be more complicated after decompiled the .dex classes.

Upvotes: 4

Manoj
Manoj

Reputation: 11

In android studio

1) Go to Project's "build.gradle" (Module's build.gradle not root directories build.gradle file)

2) Edit it and under "buildTypes" add type (as i added release and debug mode)

3) Here "minifyEnable" is proguard option make it Enable to run proguard in respective mode by setting it TRUE (Release and Debug , i made true for release mode and false in debug mode )

4)Line after that "proguardFiles getDefaultProguardFile('proguard-android.txt'),represent the proguard rules file you will get this in app module (Module) bye the name " proguard-rules.pro"(As u can identify last entry in above line ) edite/add rules for proguard.

5) and here you done!

if i am missing something please tell me. Thank You.

proguard rules

Upvotes: 0

Saurabh Kataria
Saurabh Kataria

Reputation: 81

proguard you use for a number of reasons as mentioned in this qestion. Should I use ProGuard?

I am copying the answer from this question in case if the link is broken:

It is quite easy to reverse engineer Android applications, so if you want to prevent this from happening, yes, you should use ProGuard for its main function: obfuscation.

ProGuard has also two other important functions: shrinking which eliminates unused code and is obviously highly useful and also optimization. Optimization operates with Java bytecode, though, and since Android runs on Dalvik bytecode which is converted from Java bytecode, some optimizations won't work so well. So you should be careful there.

There are instructions on how to use proguard on the Android website. The main thing you need to check is that you have the line

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt in your project.properties file. Since you mention that you use Android Studio and you don't have this file, but you are asked about the config file, try selecting the one that is in the Android SDK (tools/proguard/proguard-android.txt).

Upvotes: 0

Related Questions