How to Prevent Conflicts with ProGuard in Android Apps
This article provides important information about the compatibility issues between ProGuard and some of Appdome’s protections. If Appdome users attempt to upload mobile applications containing ProGuard, the upload will be blocked, and you will receive a message prompting you to disable ProGuard before proceeding. This is done specifically to avoid specific conflicts that certain ProGuard protections can cause if you attempt to implement Appdome.
What is ProGuard?
Why Can’t I Use ProGuard and Appdome in the same app?
In certain cases, ProGuard can collide with Appdome’s implementation of Obfuscate App Logic. Therefore, whenever an app is recognized as having ProGuard, Appdome does the following:
- Shows a visual indication in the app preview.
- Displays an additional alert inside the Build Tab which instructs the user how to resolve the conflict by removing ProGuard from their app.
How to Disable ProGuard with Groovy
- Got to the build,gradle of your app
- Mark the minifyEnabled and shrinkResources configurations as “false”
Note: If you require additional information, please refer to this developer guide on how to Shrink,
android {
buildTypes {
release {
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type. Make sure to use a build
// variant with `debuggable false`.
minifyEnabled false
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources false
// Includes the default ProGuard rules files that are packaged with
// the Android Gradle plugin. To learn more, go to the section about
// R8 configuration files.
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
...
}
How to Disable ProGuard with Kotlin
- Got to build,gradle of your app
- Mark the minifyEnabled and shrinkResources configurations as “false”
android {
...
buildTypes {
getByName("release") {
isShrinkResources = false
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
}
}
}
Related Articles:
- Beta Android and iOS Testing and Release Program for Appdome Secured Apps
- How to Protect Dynamic Features
- How Appdome Enables Signing Secured iOS Apps without Xcode
Thank you!
Thanks for visiting Appdome! Our mission is to secure every app on the planet by making mobile app security easy. We hope we’re living up to the mission with your project.