Please take a look at the following two images from Analyze APK on Android Studio.
minifyEnabled = false
, and minifyEnabled = true
(after decoding with mapping.txt of course)
minifyEnabled = false
. BuildConfig
is there.
minifyEnabled = true
(decoded with mapping.txt). BuildConfig
is not there.
I can find BuildConfig
in classes.dex
before minifying, but not after minifying. I can't find any document/discussion about this, but is there some rule to strip BuildConfig
from classes.dex
after minifying with ProGuard? In that case, does it mean that it is relatively safe to put sensitive information in BuildConfig
? Or, probably it is just hidden in some other place?
My ProGuard version is 4.7 if that matters.
An additional feature of the minifying step is the inlining of constants. This would explain why the BuildConfig disappears, and yet the values still exist where needed. Once the values get inlined, there are no more references to the BuildConfig class and the minifier can remove it entirely.