Compare commits

...

6 Commits

Author SHA1 Message Date
niccolo.piazzesi
6776d6a3aa Prepare for 7.8.2 release
Summary: Update all relevant docs to prepare for release containing D56358

Reviewers: dominik.huber, thomas.vochten

Reviewed By: dominik.huber, thomas.vochten

Differential Revision: https://phabricator.guardsquare.com/D57357
2025-12-03 12:32:49 +01:00
niccolo.piazzesi
e1e2689c72 Document support up until java 25 2025-12-01 09:50:36 +01:00
piazzesiNiccolo-GS
14dcc28ba2 Reapply moved InterfaceUsageMarker to fx interface constant marking (#510) 2025-12-01 09:47:13 +01:00
niccolo.piazzesi
0c51b82946 Use latest version in all documentation 2025-10-27 09:11:20 +01:00
piazzesiNiccolo-GS
68dcc9880e Update proguard version 2025-10-27 09:08:23 +01:00
niccolo.piazzesi
7a76843f0c Add release note 2025-10-27 09:03:19 +01:00
12 changed files with 88 additions and 10 deletions

View File

@@ -108,7 +108,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.8.0'
classpath 'com.guardsquare:proguard-gradle:7.8.2'
}
}
```

View File

@@ -129,6 +129,9 @@ public class UsageMarker
new LocalVariableTypeUsageMarker(classUsageMarker)
))));
// Second Interface Usage marking, this is necessary for marking interface constants that are not directly referenced
// (e.g. interfaces only referenced through annotations). See https://github.com/Guardsquare/proguard/issues/508.
programClassPool.classesAccept(new InterfaceUsageMarker(classUsageMarker));
if (configuration.keepKotlinMetadata)
{

View File

@@ -21,6 +21,74 @@ import proguard.testutils.RequiresJavaVersion
import proguard.util.ProcessingFlagSetter
import proguard.util.ProcessingFlags.DONT_SHRINK
class UsageMarkerTest : BehaviorSpec({
Given("A class pool with interfaces only referenced through annotations") {
val (programClassPool, _) = ClassPoolBuilder.fromSource(
JavaSource("MyInterface.java","""
interface MyInterface {}
""".trimIndent()),
JavaSource("MyAnnotation.java","""
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Retention;
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation {
Class<?> value();
}
""".trimIndent()),
JavaSource("MyImpl.java","""
class MyImpl implements MyInterface {}
""".trimIndent()),
JavaSource("InterfaceTest.java", """
import java.lang.reflect.Field;
class InterfaceTest {
@MyAnnotation(MyImpl.class)
String s;
public static void main(String... args) throws Exception {
Field f = InterfaceTest.class.getDeclaredField("s");
MyAnnotation annotation = f.getAnnotation(MyAnnotation.class);
Object obj = annotation.value().getDeclaredConstructor().newInstance();
if (obj instanceof MyInterface) {
System.out.println("success");
} else {
throw new Exception(obj.getClass() + " does not implement " + MyInterface.class);
}
}
}
""".trimIndent())
)
val implClass = programClassPool.getClass("MyImpl")
val main = programClassPool.getClass("InterfaceTest")
main.accept(
MultiClassVisitor(ProcessingFlagSetter(DONT_SHRINK), AllMemberVisitor(
ProcessingFlagSetter(DONT_SHRINK)
)))
When("marking") {
val simpleUsageMarker = SimpleUsageMarker()
UsageMarker(Configuration()).mark(programClassPool,ClassPool(), ResourceFilePool(),simpleUsageMarker)
Then("The interface class should be marked as used.") {
val used = object : ConstantVisitor {
var used = false
override fun visitAnyConstant(
clazz: Clazz?,
constant: Constant?
) {
used = used or simpleUsageMarker.isUsed(constant)
}
}
implClass.interfaceConstantsAccept(used)
used.used shouldBe true
}
}
}
})
@RequiresJavaVersion(15)
class Java15UsageMarkerTest : BehaviorSpec({
// Regression test for https://github.com/Guardsquare/proguard/issues/501

View File

@@ -68,9 +68,9 @@ Yes, you can. **ProGuard** itself is distributed under the GPL, but this
doesn't affect the programs that you process. Your code remains yours, and its
license can remain the same.
## Does ProGuard work with Java 2, 5,..., 19? {: #jdk1.4}
## Does ProGuard work with Java 2, 5,..., 25? {: #jdk1.4}
Yes, **ProGuard** supports all JDKs from 1.1 up to and including 19. Java 2
Yes, **ProGuard** supports all JDKs from 1.1 up to and including 25. Java 2
introduced some small differences in the class file format. Java 5 added
attributes for generics and for annotations. Java 6 introduced optional
preverification attributes. Java 7 made preverification obligatory and

View File

@@ -1,4 +1,4 @@
Welcome to the manual for **ProGuard** version 7.8.0 ([what's new?](releasenotes.md)).
Welcome to the manual for **ProGuard** version 7.8.2 ([what's new?](releasenotes.md)).
ProGuard is an open-sourced Java class file shrinker, optimizer, obfuscator, and
preverifier. As a result, ProGuard processed applications and libraries are smaller and faster.

View File

@@ -3,4 +3,4 @@
!!! Warning
ProGuard no longer supports backporting, and cannot backport class files compiled with Java >11.
Provide supports Java versions up to and including 19.
Provide supports Java versions up to and including 25.

View File

@@ -1,8 +1,15 @@
## Version 7.8.2
### Bugfixes
- Fix regression in marking of interface constants (#508).
## Version 7.8.1
### Bugfixes
- Prevent `java.lang.IncompatibleClassChangeError` when shrinking is enabled and sealed interfaces are used (#501).
- Prevent `java.lang.ClassCastException` when inlining (#505).
## Version 7.8

View File

@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.8.0'
classpath 'com.guardsquare:proguard-gradle:7.8.2'
}
}

View File

@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.8.0'
classpath 'com.guardsquare:proguard-gradle:7.8.2'
}
}

View File

@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath("com.guardsquare:proguard-gradle:7.8.0")
classpath("com.guardsquare:proguard-gradle:7.8.2")
}
}

View File

@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.8.0'
classpath 'com.guardsquare:proguard-gradle:7.8.2'
}
}

View File

@@ -1,4 +1,4 @@
proguardVersion = 7.8.1
proguardVersion = 7.8.2
# The version of ProGuardCORE that sub-projects are built with
proguardCoreVersion = 9.2.0