-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Xamarin.Android.Build.Tasks] Add support for Proguard mapping.txt
file
#5304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update one test to check mapping.txt
exists?
…file. Fixes dotnet#5186 When uploading a package to the Google Play Store users are seeing the following warning. This App Bundle contains Java/Kotlin code, which might be obfuscated. To fix this users need to provide a `mapping.txt` file which contains the Java class mappings from their plain versions to the ones which are obfuscated. By default we do not obfuscate the java code but the warning still shows. To fix this issue we have a new property `$(AndroidProguardMappingFile)` which defaults to `$(OutputPath)mapping.txt`. This file will be produced as part of the build process. In order for this mapping file to be generated the following lines needed to be added to the `proguard_xamarin.cfg` file. -keepattributes SourceFile -keepattributes LineNumberTable
0f333b2
to
d91b9d5
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I restarted CI, looks good to me otherwise.
Context: dotnet#5304 The Proguard mapping.txt PR was not quite ready for prime time and has seemingly caused some new proguard test failures and an .apk size regression in our Xamarin.Forms baseline. Let's disable this by default for now until we can fix these issues.
Context: #5304 The Proguard mapping.txt PR was not quite ready for prime time and has seemingly caused some new proguard test failures and an .apk size regression in our Xamarin.Forms baseline. Let's disable this by default for now until we can fix these issues.
thats is awesome. is it already in any release we can test. By the way, it is said that Xamarin.Android r8 doesnt do obfuscation, is it correct? |
@EmilAlipiev it should be in d16-9 Preview 2 (I think). Generally we turn off r8 obfuscation because it stops our C#->Java intro layer working see https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Resources/proguard_xamarin.cfg#L3 |
This seems to be working in the latest releases. when i locally build, i can see that mapping.txt file is generated but in the AzureDevops i am not able to see the file under the artifacts. Do i have to something special in my Yaml file? |
@EmilAlipiev It takes a while for the latest release to get on to DevOps (assuming you are using the system installed XA on DevOps). As they have to update the image, tests it etc. Perhaps it might be better to use a tool like boots to install the specific version you want? |
Fixes #5186
When uploading a package to the Google Play Store users are seeing
the following warning.
To fix this users need to provide a
mapping.txt
file which containsthe Java class mappings from their plain versions to the ones which
are obfuscated. By default we do not obfuscate the java code but the
warning still shows.
To fix this issue we have a new property
$(AndroidProguardMappingFile)
which defaults to
$(OutputPath)mapping.txt
. This file will be producedas part of the build process. In order for this mapping file to be
generated the following lines needed to be added to the
proguard_xamarin.cfg
file.