Questions tagged [android-proguard]

The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer.

The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security like when you are Licensing Your Applications.

ProGuard is integrated into the Android build system, so you do not have to invoke it manually. ProGuard runs only when you build your application in release mode, so you do not have to deal with obfuscated code when you build your application in debug mode. Having ProGuard run is completely optional, but highly recommended.

Official Documentation

1030 questions
15
votes
2 answers

How can I target kotlin `internal` classes with proguard?

I'd like to proguard (obfuscate) any classes marked with the kotlin internal visibility modifier. Kotlin internal classes are public on the JVM, so they are visible and usable from Java source. I don't want these classes to be used or appear in…
ZakTaccardi
  • 12,212
  • 15
  • 59
  • 107
15
votes
2 answers

Proguard not working after update to Google Play Services 11.8.0

After updating Google Play Services to 11.8.0 (from 11.6.2) my builds stop working. This is what I got: Unexpected error while computing stack sizes: Class = [com/google/android/gms/internal/zzao] Method =…
14
votes
1 answer

Proguard rules -keep vs -keepclassmembers vs -keepclasseswithmembers

Reading proguard rules I found my self facing three terms that seemed to be very similar keep keepclassmembers keepclasswithmembers I couldn't understand the difference between those three rules, Can someone explain the difference a bit better and…
john-salib
  • 724
  • 1
  • 12
  • 27
14
votes
2 answers

what is the difference between -keep class and -dontwarn

Hey I'm new with proGuard , I use it to protect my code from reverse engineering , but when I built my signed apk I got a lot of errors when I enabled proGuard ,I have googled my problem I've found answers that says use -dontwarn for the classes…
IT Developers
  • 185
  • 2
  • 10
13
votes
4 answers

How to reduce size of an apk file?

First of all, don't suggest me official documentation or this. When we build an app from Android Studio with predefined textview that simply displays "hello world", it generates an APK with more than 1.2MB. But some apps on playstore is available…
Rohit Singh
  • 411
  • 3
  • 15
13
votes
3 answers

Proguard minifyEnabled true for debug build, not working on pre-Lollipop

The methods count of my app is higher than the 64k limit, so I'm using Proguard to reduce it. Everything works fine for release builds. Debug builds, on the other hand, are successful only for Lollipop+ devices. When launching on pre-Lollipop…
Pierfrancesco Soffritti
  • 1,678
  • 1
  • 18
  • 22
13
votes
2 answers

Proguard - also use proguard files from modules

My projects build.gradle looks like following: android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "..." minSdkVersion 15 targetSdkVersion 22 versionCode 1 …
prom85
  • 16,896
  • 17
  • 122
  • 242
12
votes
2 answers

Android Build Error: Attribute Signature requires InnerClasses attribute. Check -keepattributes directive

I'm facing this error when trying to build the app in release mode. Error: Attribute Signature requires InnerClasses attribute. Check -keepattributes directive My proguard-rules.pro line looks like this: -keepattributes Signature what…
Daniele
  • 4,163
  • 7
  • 44
  • 95
12
votes
0 answers

Android Architecture Navigation component and Proguard results in java.lang.ClassNotFoundException

When running a proguard enabled build with the new android navigation component, my fragment class cannot be found. I receive this stack trace: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapppackage.path, PID:…
12
votes
3 answers

Proguard not keeping classes when building aar

From this reference: https://github.com/codepath/android_guides/wiki/Building-your-own-Android-library I have the following gradle file: android { compileSdkVersion 25 buildToolsVersion "26.0.2" buildTypes { release { …
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
12
votes
4 answers

Signed apk getting crashed in proguard enable

I am trying to use proguard in my app set the proguard to true and then the problem starts I am importing lib when I use proguard by following this -keepnames class com.somepackage.* with my package name the app is getting getting crashed when I try…
SAVVY
  • 842
  • 16
  • 33
12
votes
2 answers

Build fails with app:transformClassesAndResourcesWithProguardForRelease

I recently updated android studios to version 2.3, build tools to 25.0.2, gradle 2.3.0 and gradle distribution 3.3 and now i am getting this while building the project. Never had this issue with older versions. * Exception…
Sayed Jalil Hassan
  • 2,535
  • 7
  • 30
  • 42
12
votes
1 answer

How to obfuscate String in Android?

I want to obfuscate my api url.Can i use Proguard for this?If yes how do i do that?And how to add classes in Proguard configuration file to obfuscate the methods and variables​ present in the classes?
Jack
  • 308
  • 6
  • 15
12
votes
1 answer

ProtocolException: Too many follow-up requests: 21 with Proguard and OkHttp 3.0 in Android

I am creating an app using Retrofit 2.1.0 and OkHttp 3.4.2. In debug mode with minifyEnabled set to false everything works perfectly but as soon as i change minifyEnabled to true i get the following exception: HTTP FAILED:…
12
votes
1 answer

"can't find referenced class" with Proguard and Kotlin

I am having a strange problem with proguard and kotlin. I am gradually converting a proguarded project to kotlin - which went very fine so far but I am getting proguard errors when converting certain classes. I could not yet isolate what the special…
ligi
  • 39,001
  • 44
  • 144
  • 244
1 2
3
68 69