Skip to content
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

Fix deobfuscation plugin for AGP 3.6 #1762

Merged
merged 1 commit into from
Mar 18, 2020
Merged

Fix deobfuscation plugin for AGP 3.6 #1762

merged 1 commit into from
Mar 18, 2020

Conversation

tevjef
Copy link
Contributor

@tevjef tevjef commented Feb 24, 2020

Fixes #1761

@claassistantio
Copy link

claassistantio commented Feb 24, 2020

CLA assistant check
All committers have signed the CLA.

@pyricau
Copy link
Member

pyricau commented Feb 24, 2020

Thanks! @mzgreen @stephanenicolas would you mind taking a look?

Copy link
Contributor

@mzgreen mzgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking time to investigate the issue and creating this fix! 👏

"minify${variant.name.capitalize()}WithR8"
) ?: findTaskProviderOrNull(
project,
"minify${variant.name.capitalize()}WithProguard"
) ?: throwMissingMinifiedVariantException()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine but I suggest to split it into separate methods. We'll need to change it again when new Variant and Artifact Transform API is available in AGP. So I think it's good to start splitting it now. We could have something like findMappingGeneratingTaskPreAGP3_6, findMappingGeneratingTaskAGP3_6 etc... (I don't like those names, it's just an example to show what I mean) so we can later add a separate method when the API changes again.
Also I think we can assume that users will use the newest plugin, so I would switch the order of those calls so that we first try to find the task using new AGP task names and then fall back to old AGP task names.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm merging as is, feel free to follow up with a refactor.

@Armaxis Armaxis mentioned this pull request Mar 10, 2020
@pyricau pyricau merged commit dddba06 into square:master Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deobfuscation plugin fails to create tasks on Android Gradle Plugin 3.6
5 participants