Effective ProGuard keep rules for smaller applications
summary
R8 replaces ProGuard as a shrinker and uses the same keep‑rule language, but causes about 200 build errors on naive minify by default because reflection, annotations and Java APIs missing on Android break static analysis; fixing requires forensics, five targeted keep/warning rules and specific modifiers such as allowshrinking modifier, plus keep class members for getters/setters and supplying AAPT‑generated manifest rules; result: Guava drops from 1.4MB to 8KB, AndroidPlot 180KB to ~100KB, app code 35KB to 2KB.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:25Why it matters
- 9:30ProGuard
- 11:18AIT
- 15:25Android
- 23:04How to fix this
- 23:20AndroidPlots keep rule
- 24:11Adb log
- 24:59Reflection
- 26:34KeepClass
- 27:32Modifiers
- 28:34Checking the code
- 29:26Plot serious
- 30:29Keep class members
- 31:56Results
- 33:21Tips
- 34:38Library Developer
- 35:31Feedback
related talks
27mFrom ProGuard to R8: Take Care of Your Bytecode
33mHow ProGuard Works
28mEscaping from a 'It Kinda Works' ProGuard Setup
41mShrink, Secure & Optimize Your App With R8
36mPractical obfuscation guide
44mRelevance of code minification in a performance world
21mHow to optimise app size to below 10MB
36mAdvanced Android app shrinking techniques
