261 Commits

Author SHA1 Message Date
niccolo.piazzesi
8f67c1977b Fix test task dependency 2026-02-12 09:11:03 +01:00
niccolo.piazzesi
0303116af9 Update and clean gradle configuration 2026-02-12 09:07:16 +01:00
niccolo.piazzesi
8425e86946 Update ProguardCORE, address API changes 2026-02-12 09:03:30 +01:00
niccolo.piazzesi
164e3d8f4d Remove java-test-fixtures plugin
The Java-test-fixtures plugin would create incorrect pom files. Since we  don't actually define test fixtures in Proguard (the published jars are empty, you can look older releases), we can just remove it.
2026-01-21 12:03:07 +01:00
piazzesiNiccolo-GS
14dcc28ba2 Reapply moved InterfaceUsageMarker to fx interface constant marking (#510) 2025-12-01 09:47:13 +01:00
Bengt Verscheure
d2170bad63 Use StructuredLineNumberInfo in LineNumberLinearizer 2025-10-24 11:02:26 +02:00
niccolo.piazzesi
6dfd878ebb Run InterfaceUsageMarker before NestUsageMarker to prevent missing marking of permitted subclasses attribute
Closes #501

1. [ClassUsageMarker assumes that the NestUsageMarker will mark the permitted subclasses](869ce156b1/base/src/main/java/proguard/shrink/ClassUsageMarker.java (L1144)).

2. [ NestUsageMarker only marks class constants in the permittedSubclasses attribute if the referenced class is used ](869ce156b1/base/src/main/java/proguard/shrink/NestUsageMarker.java (L100)).

3.  [ If the referenced class is another interface, this is marked by the InterfaceUsageMarker ](869ce156b1/base/src/main/java/proguard/shrink/InterfaceUsageMarker.java (L36)).

4. [However, the interfaceUsageMarker only runs after the NestUsageMarker, hence nothing gets marked if a sealed interface permits another sealed interface](869ce156b1/base/src/main/java/proguard/shrink/UsageMarker.java (L119-130))
2025-10-14 13:43:05 +02:00
Fergal Whyte
124b33e473 Bump ProGuard to 7.8.0 and ProGuardCORE to 9.2.0 2025-10-07 13:34:16 +02:00
Thomas Vochten
f2ced20be4 Fix ktlint issue in ClassUsageMarkerTest 2025-08-21 08:28:19 +02:00
huqiuser
35ea6d587f fix NullPointerException for Kotlin typealias of typealias of lambda (#490) 2025-08-20 16:25:40 +02:00
Joren Hannes
bee74a9963 Run kotlin linter 2025-08-13 14:56:39 +02:00
Nolij
4781f5898f Exclude annotation members from aggressive overloading (#453)
* Exclude annotation members from aggressive overloading
2025-08-11 09:15:43 +02:00
niccolo.piazzesi
fbcf41fd67 Remove bad import 2024-12-13 14:26:54 +01:00
niccolo.piazzesi
bacde1cede Limit size of strings to 65535 bytes 2024-12-13 11:31:50 +01:00
Thomas Vochten
c1eafc7b6b Log ACD rules for parameterless constructors 2024-12-06 12:47:35 +01:00
Thomas Vochten
73860de626 Discard empty Kotlin metadata 2024-12-06 12:47:35 +01:00
Thomas Vochten
ff66baaced Remove references to encryption 2024-12-04 12:30:55 +01:00
Thomas Vochten
174d3f4155 Upgrade Gradle, upgrade dependencies, bump version to 7.6.1 2024-11-29 08:49:38 +01:00
Thomas Vochten
f5352fece7 Clean up Kotlin verification in ProGuard.java 2024-11-27 09:36:51 +01:00
Bengt Verscheure
844f3d76be Remove variable push replacements optimization 2024-11-20 09:27:50 +01:00
niccolo.piazzesi
7b6712e840 Replace all PartialEvaluator constructor calls with builder calls 2024-10-25 16:19:41 +02:00
James Hamilton
b3deed8286 Update versions for version 7.6 (#440) 2024-09-27 14:43:19 +02:00
Jelle De Coninck
03d7effdd2 Improve DictionaryNameFactory performance 2024-09-13 15:02:53 +02:00
daphnis.chevreton
ee3deb69fa Support a wider char range in class specifications 2024-07-02 10:48:14 +02:00
James Hamilton
aa43b9dc21 Update versions for 7.5 (#404)
Updates ProGuardCORE + other required dependencies for Kotlin 2 + Java 22; including running tests with Java 22.
2024-05-23 14:01:48 +02:00
Jelle De Coninck
0d9ceb7451 fix lint violations in ConfigurationParserTest 2024-05-06 11:29:28 +02:00
Jelle De Coninck
1d28c11e36 Synchronize keep flags on getter/setter/backing field for kotlin properties 2024-05-06 11:12:38 +02:00
Jelle De Coninck
0c95982828 integrate kotlin 2 support
Summary:
* Update PGC
* Change use of kotlinx.metadata to kotlin.metadata
* Remove unused `KotlinModuleRewriter` class
2024-04-30 16:58:26 +02:00
niccolo.piazzesi
7483ad32f4 Keep name of Kotlin companion classes when corresponding field is kept and resolve potential name collision in KotlinCompanionEqualizer 2024-03-15 12:46:53 +01:00
niccolo.piazzesi
20c99aa3e8 Parse -maximumremovedandroidloglevel 2024-03-07 10:44:31 +01:00
Vincent Rossetto
1c421bf780 Keep Kotlin interface method when default implementation is used 2024-02-13 11:09:20 +01:00
James Hamilton
712fd768ca Add ability to skip to next option if parse error
Allows providing a function to handle the case of an unknown option.

```
    public static void main(String[] args)
    {
        try
        {
            try (ConfigurationParser parser = new ConfigurationParser(new String[]{"-keep class * {}", "-unknownoption", "-whatisthisoption?"}, System.getProperties()))
            {
                parser.parse(new Configuration(), (option, location) -> {
                    System.out.println("Unknown option: " + option + " @ " + location);
                });
            }
            catch (ParseException ex)
            {
                ex.printStackTrace();
            }
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
        }
    }
```

Output:

```
Unknown option: -unknownoption @ argument number 2
Unknown option: -whatisthisoption? @ argument number 3
```
2024-01-22 14:55:53 +01:00
Oberon Swings
a7265a3536 Conservatively mark wide parameter used if it can only be partially marked. 2024-01-08 08:19:01 +01:00
Ruben Pieters
7160a9e484 Fix nullability flag on named type arguments and reified flag on type parameters 2023-12-07 16:49:40 +01:00
Robin Lefever
12c9c3f23e Fix MemberDescriptorSpecializer checking wrong processing flags
This diff also ensures the `IS_CLASS_AVAILABLE` processing flag is set on classes instead of its members.
This requires us to change usages of this flag in some other places as well.
2023-12-01 14:56:44 +01:00
daphnis.chevreton
a02100cb93 Fix potential access issues when backporting
Backporting nest host/members is not supported and can therefore introduce access issue.
Running the access fixer if `-allowaccessmodification` is set solves this issue by setting appropriate visibility.
2023-11-29 16:14:03 +01:00
Bengt Verscheure
38a0e498b9 Use system-specific line separators 2023-11-24 14:49:44 +01:00
Bengt Verscheure
789777ded5 Add support for <clinit> in ConfigurationParser 2023-11-17 13:40:46 +01:00
Dimitrios Anyfantakis
e76e47953f Close file handle in ConfigurationWriter 2023-11-03 12:28:07 +01:00
Fergal Whyte
836253f1da Use system-specific line separators in ConfigurationWriterTest 2023-10-26 13:51:26 +02:00
Fergal Whyte
f92fc632b1 Parse alwaysinline and identifiernamestring rules 2023-10-25 17:50:40 +02:00
Fergal Whyte
f5f04cbec5 Fix printing of hash characters in ConfigurationWriter 2023-10-25 17:50:40 +02:00
Fergal Whyte
ce2c8a8b5d Add ConfigurationWriterTest 2023-10-25 17:50:25 +02:00
Fergal Whyte
0032aa037c Prevent NullPointerException when parsing annotations 2023-10-25 17:44:19 +02:00
Sebastian Ratz
6f3610bd7b Fix inadvertent closing of System.out when printing configuration (#366)
Co-authored-by: Blend Hamiti <blend.hamiti@guardsquare.com>
2023-10-25 12:15:16 +02:00
James Hamilton
7c153f8eec Enable unit testing of Java 20 and 21 2023-10-12 12:59:11 +02:00
James Hamilton
bfdfa02f8c Support parsing of wildcard * when used as a field type or method return type in class specifications. 2023-10-11 18:10:05 +02:00
Thomas Vochten
7429219cd2 Allow method from interfaces to be inlined if it is private and is being called from within the interface 2023-09-22 09:05:54 +02:00
Thomas Vochten
8bb7cc0c4b Do not inline methods from interfaces 2023-09-21 05:37:20 +02:00
James Hamilton
57d4250464 Use internalShortClassName in KotlinMultiFileFacadeFixer 2023-07-07 15:58:50 +02:00