Skip to content

Commit 12516ba

Browse files
committed
Class merging only when optimizing aggressively
1 parent 98309c9 commit 12516ba

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

base/src/main/java/proguard/optimize/Optimizer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ public void execute(AppView appView) throws IOException
358358
libraryGson = filter.matches(LIBRARY_GSON);
359359
classMarkingFinal = filter.matches(CLASS_MARKING_FINAL);
360360
classUnboxingEnum = filter.matches(CLASS_UNBOXING_ENUM);
361-
classMergingVertical = filter.matches(CLASS_MERGING_VERTICAL);
362-
classMergingHorizontal = filter.matches(CLASS_MERGING_HORIZONTAL);
363-
classMergingWrapper = filter.matches(CLASS_MERGING_WRAPPER);
361+
classMergingVertical = !configuration.optimizeConservatively && filter.matches(CLASS_MERGING_VERTICAL);
362+
classMergingHorizontal = !configuration.optimizeConservatively && filter.matches(CLASS_MERGING_HORIZONTAL);
363+
classMergingWrapper = !configuration.optimizeConservatively && filter.matches(CLASS_MERGING_WRAPPER);
364364
fieldRemovalWriteonly = filter.matches(FIELD_REMOVAL_WRITEONLY);
365365
fieldMarkingPrivate = filter.matches(FIELD_MARKING_PRIVATE);
366366
fieldGeneralizationClass = filter.matches(FIELD_GENERALIZATION_CLASS);

docs/md/manual/configuration/optimizations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ that such an instruction can have a side effect. If this instruction is removed
177177
during optimization, the code will thus behave differently under specific
178178
circumstances. By default, such instructions are always preserved. Setting this
179179
option will lead to these instructions being candidates for removal during
180-
optimization.
180+
optimization. Additionally, class merging is only enabled when this option is set.
181181

182182
## Gson optimization {: #gson}
183183

docs/md/manual/configuration/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ This page lists all available options for ProGuard, grouped logically.
342342
during optimization, the code will thus behave differently under specific
343343
circumstances. By default, such instructions are always preserved. Setting this
344344
option will lead to these instructions being candidates for removal during
345-
optimization.
345+
optimization. Additionally, class merging is only enabled when this option is set.
346346

347347
## Obfuscation Options {: #obfuscationoptions}
348348

docs/md/manual/releasenotes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Version 7.3.2
2+
3+
### Improved
4+
5+
- Merge classes only when `-optimizeaggressively` is set.
6+
17
## Version 7.3.1
28

39
### Kotlin support

0 commit comments

Comments
 (0)