Status Update
Comments
sh...@gmail.com <sh...@gmail.com> #2
I have a simple source code project that clearly demonstrates the issue. The attached mapping.txt is the old style proguard mapping.
sh...@gmail.com <sh...@gmail.com> #3
And here is the new mapping with R8 with the same configuration
sh...@gmail.com <sh...@gmail.com> #4
Example code set up for R8 - with commented out sections to enable guardsquare
sh...@gmail.com <sh...@gmail.com> #5
Same example code set up for proguard -
ko...@google.com <ko...@google.com>
ch...@google.com <ch...@google.com>
sh...@gmail.com <sh...@gmail.com> #6
Please let me know if any additional information is needed. Ideally this behavior would be restored to mirror proguard but will accept if it is made a flag that you need to enable.
sg...@google.com <sg...@google.com> #7
Thank you for the report. The R8 mapping file has never included identity mappings, and there are no plans to include them at this point. You mention when feeding our mapping in to a newer build to keep the mappings consistent across releases. Are you using -applymapping
for that? If so you might run into other issues, as R8 does not support using -applymapping
for that.
sh...@gmail.com <sh...@gmail.com> #8
Just please confirm that the summary is accurate - proguard does support identity mappings and it was a decision by the developers of R8 to no longer support the identity mapping. Yes we are using apply mapping and I overly simplified the rational for the purposes of this bug report. We were expecting complete compatibility while switching over from proguard to R8 and it seems like this is not the case.
sg...@google.com <sg...@google.com> #9
R8 currently only supports -applymapping
to apply a mapping to non-optimized dependent code. Marking this as a duplicate of
Description
# {"fileName":"FileSystemUtils.java","id":"sourceFile"}
java.lang.String TAG -> TAG
Switching over to AGP 8.8.1 and enabling R8, we are not seeing the same behavior
# {"fileName":"FileSystemUtils.java","id":"sourceFile"}
where TAG is missing
Why this matters - when feeding our mapping in to a newer build to keep the mappings consistent across releases, the missing TAG now allows for a newer compilation to obfuscate it when it should not be obfuscated.
STEPS TO REPRODUCE:
1. Build an android project with a static final String that is not obfuscated (ie kept) with guardsquare
2. Switch over to using R8 with the same rules
3. Look for the same field in both mapping files.
ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
------------------
IMPORTANT: Please read
all required information.
------------------
Studio Build: None Used all command line
Version of Gradle Plugin: 7.4.2 (but will happen with newer versions)
Version of Gradle: 7.6.3
Version of Java: 17
OS: Linux