unplugged-system/external/gson/examples/android-proguard-example
2025-10-06 13:59:42 +00:00
..
res Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
src/com/google/gson/examples/android Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
AndroidManifest.xml Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
default.properties Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
proguard.cfg Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
README.md Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00

android-proguard-example

Example Android project showing how to properly configure ProGuard. ProGuard is a tool for 'shrinking' and obfuscating compiled classes. It can rename methods and fields, or remove them if they appear to be unused. This can cause issues for Gson which uses Java reflection to access the fields of a class. It is necessary to configure ProGuard to make sure that Gson works correctly.

Also have a look at the ProGuard manual for more details on how ProGuard can be configured.

The R8 code shrinker uses the same rule format as ProGuard, but there are differences between these two tools. Have a look at R8's Compatibility FAQ, and especially at the Gson section.