Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here

android-proguard-snippets

Proguard configurations for common Android libraries

Subscribe to updates I use android-proguard-snippets


Statistics on android-proguard-snippets

Number of watchers on Github 4632
Number of open issues 65
Average time to close an issue 3 months
Main language IDL
Average time to merge a PR 8 days
Open pull requests 51+
Closed pull requests 9+
Last commit over 4 years ago
Repo Created almost 7 years ago
Repo Last Updated 2 months ago
Size 204 KB
Homepage http://www.kevinr...
Organization / Authorkrschultz
Contributors45
Page Updated
Do you use android-proguard-snippets? Leave a review!
View open issues (65)
View android-proguard-snippets activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating android-proguard-snippets for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

android-proguard-snippets

Example Proguard configurations for common Android libraries.

This project assumes that your ProGuard configuration is based off of the latest official proguard-android.txt config as shown below. Each library configuration should only be the rules required for that specific library, not a complete Android ProGuard configuration. The various library configurations are combined by the Gradle build system. The library rules should be universal, any app specific rules (such as preserving model classes) should be added in a custom proguard-project.pro file.

Request additional libraries through issues. Pull requests are welcome.

Android Arsenal

Usage

android {
  buildTypes {
    release {
      minifyEnabled true
      // Library specific proguard files
      proguardFile 'proguard-google-play-services.pro'
      proguardFile 'proguard-gson.pro'
      ...
      // Default proguard files & project app specific rules,
      //  see examples folder for more information
      proguardFile 'proguard-project-app.pro'
      proguardFile getDefaultProguardFile('proguard-android.txt')
      // As of Gradle Android plugin 1.1.0, the test APK has a separate config
      testProguardFile 'proguard-project-test.pro'
    }
  }
}

Instead of declaring each configuration file manually, you could also store them in a seperate directory and include them all at once:

FileCollection proGuardFileCollection = files { file('./proguard').listFiles() }
proguardFiles(proGuardFileCollection)

Libraries

ProGuard tip for android libraries developers

The android libraries developers can include the proguard directives in the libraries. The Android Plugin for Gradle automatically appends ProGuard configuration files in an AAR (Android ARchive) package and appends that package to your ProGuard configuration

The developers only need to specify the Proguard file with consumerProguardFiles instead of proguardFiles:

defaultConfig {
    consumerProguardFiles 'proguard-file.pro'
}
android-proguard-snippets open issues Ask a question     (View All Issues)
  • almost 4 years error while adding multiple proguard directory in release type
  • about 4 years Greendao Proguard not up to date
  • over 4 years Leak Canary
  • over 4 years .DS_Store on osx is making the build fail
  • over 4 years proguard-google-play-services.pro no longer needed
  • over 4 years unknown reference to sun.misc.Unsafe in play-services
  • almost 5 years Guava EventBus config missing keepclassmembers for annotated methods
  • almost 5 years Upstream configuration on Android specific libraries
  • almost 5 years Wrong Reference in Guava
  • about 5 years Guava snippet doen't work
  • over 5 years add proguard config for circular progress button
  • over 5 years Add Samsung support-v7 workaround config
  • over 5 years Add for Samsung's Pass SDK
  • over 5 years Add Proguard for Admob
  • almost 6 years Add Proguard config for AndroidQuery
  • almost 6 years Add Ion
  • over 1 year proguard doesn't updated
  • over 1 year Add Proguard for Tesseract OCR library com.rmtheis:tess-two:9.0.0
  • about 2 years After Applying Proguard Cannot take build
  • over 2 years how to hide class names and activity names while reverse engineering
  • over 2 years Can you add proguard for PrettyTime?
  • over 3 years proguard-project.pro
android-proguard-snippets open pull requests (View All Pulls)
  • Update rxjava proguard rules to be compatible with 1.1.0
  • Create proguard-amazon-iap.pro
  • Add okio configuration to okhttp since it depends on it
  • Update Rules for RxJava 1.0.14
  • Gradle library with Jitpack support
  • rxjava: update for version 1.1.1
  • Create proguard-opentok.pro
  • Update proguard-rx-java.pro
  • Create proguard-twilio.pro
  • Create proguard rules for Square's Moshi
  • Update proguard-guava.pro
  • annotations should be kept
  • Update proguard-gson.pro
  • Update README.md
  • Add Butterknife 8 and Foresee rules
  • Create proguard-hockeyapp.pro
  • Update Jackson 2
  • Add support for Couchbase Lite
  • Add Pjsip library rules
  • add dontwarn to tencent bugly
  • Only include ProGuard files
  • Add rules for log4j
  • Update multiple proguard files import
  • adding proguard rules for yelp android
  • Create proguard-dart.pro
  • Guava 20.0 update
  • Update proguard-jackson-2.pro
  • Update proguard-butterknife-7.pro
  • Adding proguard-jsonpath.pro
  • Adding Akka specific rules.
  • Updating Parceler rules
  • rxjava patch
  • Update proguard-facebook-fresco.pro
  • Update OkHttp rules to follow official docs
  • Updated Fabric Twitter Kit URL
  • Update proguard file name to the default name.
  • Fix proguard-guava.pro for issue #89
  • Update README.md
  • Remove outdated ProGuard rules
  • Add Wire rules
  • Add Retrofit 2 rules
  • Add OkHttp rules
  • Update proguard-square-retrofit2.pro
  • Update proguard-logback-android.pro
  • keep class members using android webkit JavascriptInterface annotation
  • added rules for project uses WebView with JS
  • added ormlite proguard rules
  • added proguard rule to remove android util logs from code
  • add rules for google android ads consent library
  • Added progaurd file for sugar orm
  • Trying to merge all ProGuard forks. #5
android-proguard-snippets list of languages used
Other projects in IDL
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark