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

Applied mapping file contains invalid entries #335

Open
Denqu opened this issue May 22, 2024 · 3 comments
Open

Applied mapping file contains invalid entries #335

Denqu opened this issue May 22, 2024 · 3 comments

Comments

@Denqu
Copy link

Denqu commented May 22, 2024

Hello everyone,

first of all, thank you for the proguard maven plugin :)

Unfortunately we have noticed a issue, when using the applyMappingFile option.

Here is our setup:

  • a maven project with many modules, which are also executed parallel
  • enabled incremental option
  • applyMappingFile is set to "./globalMappingFile.txt" (so all modules write into that file)
  • Plugin Version 2.5.1

While running the maven build, all modules executes the proguard-maven-plugin. The plugin executions write into the applied mapping file.
Rarely thewrite process of the proguard-maven-plugin results into a "broken" mapping file.
Entries like
com.my.company.class.LoremIpsumClass -> com.mycom.my.company.class.AnotherLoremIpsumClass -> com.my.company.class.AnotherLoremIpsumClass
appears in the mapping file.

My assumption is, that multiple plugin executions writes at the same time into the file. So maybe the write process needs to be synchronized.

@lasselindqvist
Copy link
Collaborator

The short answer is to not use the same global file from multiple modules.

How do you expect the file to behave even if the writes were synced?

@Denqu
Copy link
Author

Denqu commented May 22, 2024

Our assumption was that, the incremental obfuscation requires a single mapping file.
So all following maven modules and maven projects can respect the obfuscation done in previous modules/projects by reading the global mapping file.

@lasselindqvist
Copy link
Collaborator

Makes sense.
Seems like a syncronizing lock would be neede for your use case. I will happily merge any pull request implementing it.

(https://www.guardsquare.com/manual/configuration/examples#incremental)

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

No branches or pull requests

2 participants