Skip to content

Commit

Permalink
Class merging only when optimizing aggressively
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlefever committed Feb 3, 2023
1 parent 98309c9 commit 12516ba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions base/src/main/java/proguard/optimize/Optimizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ public void execute(AppView appView) throws IOException
libraryGson = filter.matches(LIBRARY_GSON);
classMarkingFinal = filter.matches(CLASS_MARKING_FINAL);
classUnboxingEnum = filter.matches(CLASS_UNBOXING_ENUM);
classMergingVertical = filter.matches(CLASS_MERGING_VERTICAL);
classMergingHorizontal = filter.matches(CLASS_MERGING_HORIZONTAL);
classMergingWrapper = filter.matches(CLASS_MERGING_WRAPPER);
classMergingVertical = !configuration.optimizeConservatively && filter.matches(CLASS_MERGING_VERTICAL);
classMergingHorizontal = !configuration.optimizeConservatively && filter.matches(CLASS_MERGING_HORIZONTAL);
classMergingWrapper = !configuration.optimizeConservatively && filter.matches(CLASS_MERGING_WRAPPER);
fieldRemovalWriteonly = filter.matches(FIELD_REMOVAL_WRITEONLY);
fieldMarkingPrivate = filter.matches(FIELD_MARKING_PRIVATE);
fieldGeneralizationClass = filter.matches(FIELD_GENERALIZATION_CLASS);
Expand Down
2 changes: 1 addition & 1 deletion docs/md/manual/configuration/optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ that such an instruction can have a side effect. If this instruction is removed
during optimization, the code will thus behave differently under specific
circumstances. By default, such instructions are always preserved. Setting this
option will lead to these instructions being candidates for removal during
optimization.
optimization. Additionally, class merging is only enabled when this option is set.

## Gson optimization {: #gson}

Expand Down
2 changes: 1 addition & 1 deletion docs/md/manual/configuration/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ This page lists all available options for ProGuard, grouped logically.
during optimization, the code will thus behave differently under specific
circumstances. By default, such instructions are always preserved. Setting this
option will lead to these instructions being candidates for removal during
optimization.
optimization. Additionally, class merging is only enabled when this option is set.

## Obfuscation Options {: #obfuscationoptions}

Expand Down
6 changes: 6 additions & 0 deletions docs/md/manual/releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 7.3.2

### Improved

- Merge classes only when `-optimizeaggressively` is set.

## Version 7.3.1

### Kotlin support
Expand Down

0 comments on commit 12516ba

Please sign in to comment.