Incremental obfuscation functionality #73
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since ProGuard supports incremental obfuscation by specifying
-applymapping
, I propose adding a functionality to incrementally obfuscate projects with multiple modules.root:pom
test1:jar
test.Class1
void method(test.Class1)
test.Keep1
test2:jar
test.Class2
void method(test.Class1)
test.Keep2
(An example of projects that actually work: incremental-obfuscation.zip)
In the project of the above layout, If you specify
proguard_map.txt
which is the result of obfuscatingtest1:jar
with-applymapping
when obfuscatingtest2:jar
, ProGuard will consider the result of changing the identifier intest1:jar
, sotest.Class1
andtest.Class2
will not change to the same name.In order to support such incremental obfuscation, I introduce the following two parameters.
File applyMappingFile (default: none)
-applymapping
parameterboolean incremental (default: false)
true
, the following behavior changesapplyMappingFile
is specified, if the file does not exist, omit-applymapping
(i.e. there is no mapping file to be applied to the originating project)applyMappingFile
In other words, if you set
incremental = true
, you will be able to obfuscate individual modules one by one in projects with multiple modules.Note that this functionality does not work properly in versions prior to ProGuard 5.3.