Skip to content

AabResGuard

Jugg can read the resources-mapping.txt file generated by AabResGuard and write its resource-name mappings to the res guard mapping file used by aapt2 inclink. This helps incremental resource artifacts preserve the obfuscated resource names in the already built APK or AAB.

AabResGuard mapping scope

ScenarioCurrent supportBehavior
resources-mapping.txt existsSupportedParses the res id mapping: section and generates the aapt2 mapping input
Regular incremental resource linkSupported togetherPasses --res-guard-mapping during aapt2 load/link
Mapping is missingSkipped automaticallyDoes not block resource compilation
Mapping parsing failsSkipped in degraded modePrints a warning without directly stopping the current run

How AabResGuard takes effect

text
Gradle build produces resources-mapping.txt
  -> Jugg's resource stage reads the mapping
  -> Converts it into the res guard mapping file used by aapt2 inclink
  -> Passes --res-guard-mapping during aapt2 load/link
  -> Incremental resource artifacts preserve obfuscated names

Jugg currently uses outputs/bundle/<variant>/resources-mapping.txt under the module build directory as the default path.