Questions tagged [proguard]

ProGuard is a tool to shrink, optimize, obfuscate, and preverify Java classes. It is included in the Android SDK.

ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.

ProGuard is a command-line tool with an optional graphical user interface and with a plugin for Ant. ProGuard is integrated in Google's Android SDK, where it can be enabled for creating releases, from the command-line or in Eclipse. It is also supported in many development environments for Java Micro Edition.

Proguard is developed by Eric Lafortune and officially supported by GuardSquare.

4366 questions
848
votes
32 answers

How to avoid reverse engineering of an APK file

I am developing a payment processing app for Android, and I want to prevent a hacker from accessing any resources, assets or source code from the APK file. If someone changes the .apk extension to .zip then they can unzip it and easily access all…
sachin003
  • 8,983
  • 4
  • 21
  • 23
466
votes
13 answers

Best practice for storing and protecting private API keys in applications

Most app developers will integrate some third party libraries into their apps. If it's to access a service, such as Dropbox or YouTube, or for logging crashes. The number of third party libraries and services is staggering. Most of those libraries…
Basic Coder
  • 10,882
  • 6
  • 42
  • 75
446
votes
31 answers

How to remove all debug logging calls before building the release version of an Android app?

According to Google, I must "deactivate any calls to Log methods in the source code" before publishing my Android app to Google Play. Extract from section 3 of the publication checklist: Make sure you deactivate logging and disable the debugging…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
219
votes
10 answers

Where does Android Studio save the ProGuard mapping file?

In Android Studio, where are the ProGuard mapping files generated after compiling a signed APK? I'm not sure if it isn't working or if I just forgot the file path, and my compulsory Google/Stack Overflow search did not answer this
CQM
  • 42,592
  • 75
  • 224
  • 366
145
votes
5 answers

How to keep/exclude a particular package path when using proguard?

I want to exclude some file paths from ProGuard. Example com.myapp.customcomponents How can I do this? I hate to be placing -keep flags for every single custom component file I have in this directory. I have tried the following but it doesn't…
Jona
  • 13,325
  • 15
  • 86
  • 129
130
votes
9 answers

proguard hell - can't find referenced class

So, I'm TRYING to release some software but Proguard is giving me a headache. When I try to export using proguard I'm getting lots of warning ie "can't find referenced class" For example: [2011-08-07 17:44:37 - GAME] Warning:…
iasksillyquestions
  • 5,558
  • 12
  • 53
  • 75
123
votes
4 answers

NameNotFoundException webview

I am getting errors from Crashlytics that indicates that some devices are missing com.google.android.webview. How is that even possible? java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app/com.myapp.ReaderActivity}:…
112
votes
5 answers

Enabling ProGuard in Eclipse for Android

The new documentation on ProGuard for Android says to add a line to the default.properties file in the project home directory. However, on opening this file, I read at the top: # This file is automatically generated by Android Tools. # Do not…
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
105
votes
18 answers

Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug' if I enable the proguard

I get following error when I was running an app within Android Studio 2. Gradle tasks [:app:assembleDebug] Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug'. > Task with path 'dexDebug' not found in project ':app'. BUILD…
Sean Shi
  • 1,289
  • 2
  • 9
  • 14
101
votes
7 answers

How to use the ProGuard in Android Studio?

This is my first project in Android Studio, and the code of my apps are not obfuscated. Im using this configuration in build.gradle file: I'm using the Build > Generate Signed APK... with the Run Proguard checked. And, when I have tested using the…
Felipe Porge Xavier
  • 2,236
  • 6
  • 19
  • 27
99
votes
4 answers

What's the difference between "minifyEnabled" and "useProguard" in the Android Plugin for Gradle?

I see that the Android Plugin for Gradle has a minifyEnabled property as well as a useProguard property, as follows: android { buildTypes { debug { minifyEnabled true useProguard false } release { …
Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
93
votes
9 answers

Prevent class member name obfuscation by ProGuard

I have my class ClassMultiPoint with subclasses. public class ClassMultiPoints { public String message; public List data; public class ClassPoints { public String id; public List points; …
Tapa Save
  • 4,769
  • 5
  • 32
  • 54
86
votes
4 answers

ProGuard: duplicate definition of library class?

I run my ProGuard for my Android project and get the following warnings: Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver] Note: duplicate definition of library class…
Michael
  • 32,527
  • 49
  • 210
  • 370
84
votes
12 answers

transformClassesAndResourcesWithProguardForRelease FAILED

I am trying to Build my Android application with Gradle in console. But getting below error about task ':app:transformClassesAndResourcesWithProguardForRelease': build.gradle: buildscript { repositories { jcenter() maven { url…
82
votes
6 answers

Is it possible to use proguard in debug mode?

In my android app, i want to test some features with proguard on. I don't need to really "debug" it, but i want proguard to run when i hit run in eclipse. I don't want to export the binary every time (so, in release mode) and save as apk and get it…
frankish
  • 6,738
  • 9
  • 49
  • 100
1
2 3
99 100