Skip to content

Commit f0b6df7

Browse files
committed
updated change log documentation, examples, and properties for 4.1.0
1 parent bb1332c commit f0b6df7

File tree

29 files changed

+64
-45
lines changed

29 files changed

+64
-45
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [4.1.0]
8+
9+
### Added
10+
- Added support for obfuscating Java 21 class files.
11+
12+
### Changed
13+
- Updated and improved examples.
14+
15+
### Fixed
16+
- Stand-alone package names in resource files are no longer adjusted when using `replaceContentPolicy` `strict`.
17+
718
## [4.0.0]
819

920
### Added
@@ -26,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2637
- Added support for obfuscating multi-release jars.
2738
(Shrinking multi-release jars is not supported.)
2839

29-
### Improved
40+
### Changed
3041
- Improved support for type annotations.
3142

3243
### Fixed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ configurations {
2828
dependencies {
2929
annotation project(':annotation')
3030
implementation project(':annotation')
31-
implementation 'org.ow2.asm:asm:9.2'
32-
implementation 'org.apache.ant:ant:1.10.12'
33-
testImplementation 'junit:junit:4.13-beta-3'
31+
implementation 'org.ow2.asm:asm:9.6'
32+
implementation 'org.apache.ant:ant:1.10.14'
33+
testImplementation 'junit:junit:4.13.2'
3434
}
3535

3636
compileJava {
@@ -50,7 +50,7 @@ task generateSources(type: Copy) {
5050
// Use generated sources
5151
compileJava.dependsOn generateSources
5252

53-
def LIBRARIES = ["asm-9.2.jar"]
53+
def LIBRARIES = ["asm-9.6.jar"]
5454
def LIBRARY_JARS = configurations.dependents.filter {
5555
file -> file.name in LIBRARIES
5656
}

docs/compatibility.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
yGuard requires JDK 1.7.x or greater and Ant 1.5 or greater installed on your system. It may work with earlier versions of these pieces of software as well, however this has not been tested thoroughly. yGuard 1.3.x and upwards works together with Ant 1.6.
66

7+
## Java 18 - Java 21 Compatibility
8+
9+
Beginning with version 4.1.0, yGuard supports obfuscation of Java class files that use `ClassDesc`, `Enum.EnumDesc`, and `SwitchBootstraps` bootstrap method factories which were introduced in Java 12 and Java 21.
10+
11+
(This also means yGuard now supports obfuscating `dynamic` instructions which were introduced with the Java 11 `.class` file format.)
12+
713
## Java 14 - Java 17 Compatibility
814

915
Beginning with version 3.1.0, yGuard supports obfuscation of Java class files that contain `record` or `permittedsubclasses` attributes which were introduced with the Java 16 and Java 17 `.class` file formats.
@@ -31,9 +37,8 @@ While yGuard does fully support obfuscating `invokedynamic` instructions and the
3137
## Compatibility to 3rd party JVM
3238

3339
Obfuscating `dynamic` and `invokedynamic` instructions is a task that is theoretically infeasible. An obfuscation program cannot determine the type and parameters of such instructions in a generic way.
34-
A trade-off solution for this is supporting known `MetaFactory` objects by their signature.
35-
The `JRE` makes this task quite trivial.
36-
`yGuard` supports the built-in `LambdaMetafactory` and `StringConcatFactory`.
40+
A trade-off solution for this is supporting known bootstrap method factories by their signature.
41+
`yGuard` supports Java's built-in `LambdaMetafactory`, `StringConcatFactory`, `SwitchBootstraps`, `Enum.EnumDesc`, and `ClassDesc` bootstrap method factory classes.
3742

3843
This trade-off however means `yGuard` offers only limited support for instruction sets based on `invokedynamic` or `dynamic`.
3944
In particular, supporting new `JVM` targets, such as Scala, might require manual work.
@@ -45,18 +50,21 @@ Below is a documentation on the design process involved in supporting the `Lambd
4550

4651
To check that JVM compatibility is ensured in new releases, we verified that there are no differences in the class file format in JVM >= 11.
4752
This can be checked in the documentation of the [class file format](https://docs.oracle.com/javase/specs/jvms/se13/html/jvms-4.html).
48-
The JRE ships two targets for the `invokedynamic` and `dynamic` instruction sets. These are:
53+
The JRE ships several targets for the `invokedynamic` and `dynamic` instruction sets. These are:
4954

50-
- `LambdaMetafactory`
51-
- `StringConcatFactory`
55+
- `LambdaMetafactory`,
56+
- `StringConcatFactory`,
57+
- `SwitchBootstraps`,
58+
- `Enum.EnumDesc`, and
59+
- `ClassDesc`
5260

53-
We can recognise these factories in the obfuscation and shrinking steps using their signature.
54-
Looking at the [documentation](https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/invoke/LambdaMetafactory.html) tells us that we should cover two signatures for `LambdaMetaFactory`:
61+
We can recognise these factories in the obfuscation steps using their signature.
62+
Looking at the [documentation](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/invoke/LambdaMetafactory.html) tells us that we should cover two signatures for `LambdaMetaFactory`:
5563

5664
- `java/lang/invoke/LambdaMetafactory#metafactory`
5765
- `java/lang/invoke/LambdaMetafactory#altMetafactory`
5866

59-
`yFiles` recognises these methods [during renaming](https://github.com/yWorks/yGuard/blob/master/retroguard/src/main/java/com/yworks/yguard/obf/classfile/ClassFile.java#L1189).
67+
`yGuard` recognises these methods [during renaming](https://github.com/yWorks/yGuard/blob/master/retroguard/src/main/java/com/yworks/yguard/obf/classfile/ClassFile.java#L1189).
6068
In order to obfuscate lambdas, these steps are performed:
6169

6270
- if an instance of `InvokeDynamicCpInfo` is found [while parsing the constant pool](https://github.com/yWorks/yGuard/blob/master/retroguard/src/main/java/com/yworks/yguard/obf/classfile/ClassFile.java#L1041), check its signature

docs/setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Depending on your build system, you will use [`AntRun`](http://maven.apache.org/
66
Download the bundle from the [Github release page](https://github.com/yWorks/yguard/releases/latest). After downloading and extracting the `jar` files, place them in a path near to your build script. You may use absolute paths, but our examples expect the jar file to lie in the same directory as your build file. Once extracted, you can use the `yguard` element like so:
77

88
```xml
9-
<property name="version" value="4.0.0"/>
9+
<property name="version" value="4.1.0"/>
1010

1111
<target name="yguard">
1212
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="${projectDir}/yguard-${version}.jar"/>
@@ -23,7 +23,7 @@ You can use `yGuard` directly from `Maven` central. Add the `yGuard` dependency
2323
<dependency>
2424
<groupId>com.yworks</groupId>
2525
<artifactId>yguard</artifactId>
26-
<version>4.0.0</version>
26+
<version>4.1.0</version>
2727
<scope>compile</scope>
2828
</dependency>
2929
```
@@ -64,7 +64,7 @@ repositories {
6464
}
6565
6666
dependencies {
67-
compileOnly 'com.yworks:yguard:4.0.0'
67+
compileOnly 'com.yworks:yguard:4.1.0'
6868
}
6969
7070
task yguard {

examples/annotation/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ configurations {
1111
}
1212

1313
dependencies {
14-
yguard 'com.yworks:yguard:4.0.0'
15-
compile 'com.yworks:annotation:4.0.0'
14+
yguard 'com.yworks:yguard:4.1.0'
15+
compile 'com.yworks:annotation:4.1.0'
1616
}
1717

1818
task obfuscate {

examples/annotation/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<property name="project.dir" value="${basedir}/../.."/>
33
<property name="source.dir" value="${basedir}/src"/>
44
<property name="target.dir" value="${basedir}/build"/>
5-
<property name="yguard.version" value="4.0.0"/>
5+
<property name="yguard.version" value="4.1.0"/>
66

77
<property name="project.name" value="annotation"/>
88
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/annotation/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<dependency>
1717
<groupId>com.yworks</groupId>
1818
<artifactId>yguard</artifactId>
19-
<version>4.0.0</version>
19+
<version>4.1.0</version>
2020
<scope>compile</scope>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.yworks</groupId>
2424
<artifactId>annotation</artifactId>
25-
<version>4.0.0</version>
25+
<version>4.1.0</version>
2626
</dependency>
2727
</dependencies>
2828
<build>

examples/application/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configurations {
2323
}
2424

2525
dependencies {
26-
yguard 'com.yworks:yguard:4.0.0'
26+
yguard 'com.yworks:yguard:4.1.0'
2727
}
2828

2929
task obfuscate {

examples/application/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<property name="project.dir" value="${basedir}/../.."/>
33
<property name="source.dir" value="${basedir}/src"/>
44
<property name="target.dir" value="${basedir}/build"/>
5-
<property name="yguard.version" value="4.0.0"/>
5+
<property name="yguard.version" value="4.1.0"/>
66

77
<property name="project.name" value="application"/>
88
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.yworks</groupId>
1818
<artifactId>yguard</artifactId>
19-
<version>4.0.0</version>
19+
<version>4.1.0</version>
2020
<scope>compile</scope>
2121
</dependency>
2222
</dependencies>

examples/external_library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ configurations {
3030
}
3131

3232
dependencies {
33-
yguard 'com.yworks:yguard:4.0.0'
33+
yguard 'com.yworks:yguard:4.1.0'
3434
gson 'com.google.code.gson:gson:2.8.9'
3535
implementation configurations.gson.dependencies
3636
}

examples/external_library/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<property name="libraryDir" value="${basedir}/lib"/>
44
<property name="source.dir" value="${basedir}/src"/>
55
<property name="target.dir" value="${basedir}/build"/>
6-
<property name="yguard.version" value="4.0.0"/>
6+
<property name="yguard.version" value="4.1.0"/>
77

88
<property name="project.name" value="external_library"/>
99
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/external_library/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.yworks</groupId>
1818
<artifactId>yguard</artifactId>
19-
<version>4.0.0</version>
19+
<version>4.1.0</version>
2020
<scope>compile</scope>
2121
</dependency>
2222
<dependency>

examples/fxml/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ configurations {
3333
}
3434

3535
dependencies {
36-
yguard 'com.yworks:yguard:4.0.0'
36+
yguard 'com.yworks:yguard:4.1.0'
3737
}
3838

3939
task obfuscate {

examples/fxml/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<property name="project.dir" value="${basedir}/../.."/>
33
<property name="source.dir" value="${basedir}/src"/>
44
<property name="target.dir" value="${basedir}/build"/>
5-
<property name="yguard.version" value="4.0.0"/>
5+
<property name="yguard.version" value="4.1.0"/>
66

77
<property name="project.name" value="fxml"/>
88
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/fxml/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>com.yworks</groupId>
2121
<artifactId>yguard</artifactId>
22-
<version>4.0.0</version>
22+
<version>4.1.0</version>
2323
<scope>compile</scope>
2424
</dependency>
2525
<dependency>

examples/library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ configurations {
1111
}
1212

1313
dependencies {
14-
yguard 'com.yworks:yguard:4.0.0'
14+
yguard 'com.yworks:yguard:4.1.0'
1515
}
1616

1717
task obfuscate {

examples/library/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<property name="project.dir" value="${basedir}/../.."/>
33
<property name="source.dir" value="${basedir}/src"/>
44
<property name="target.dir" value="${basedir}/build"/>
5-
<property name="yguard.version" value="4.0.0"/>
5+
<property name="yguard.version" value="4.1.0"/>
66

77
<property name="project.name" value="library"/>
88
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/library/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>com.yworks</groupId>
1919
<artifactId>yguard</artifactId>
20-
<version>4.0.0</version>
20+
<version>4.1.0</version>
2121
<scope>compile</scope>
2222
</dependency>
2323
</dependencies>

examples/processing/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ configurations {
1414

1515
dependencies {
1616
implementation('org.springframework.boot:spring-boot-starter')
17-
yguard 'com.yworks:yguard:4.0.0'
17+
yguard 'com.yworks:yguard:4.1.0'
1818
}
1919

2020
task obfuscate {

examples/processing/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<property name="source.dir" value="${basedir}/src"/>
2323
<property name="target.dir" value="${basedir}/build"/>
2424
<property name="bundleDir" value="${target.dir}/jar"/>
25-
<property name="yguard.version" value="4.0.0"/>
25+
<property name="yguard.version" value="4.1.0"/>
2626

2727
<property name="project.name" value="processing"/>
2828
<property name="project.jar.unobf" value="${bundleDir}/${project.name}_unobf.jar"/>

examples/processing/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<dependency>
2626
<groupId>com.yworks</groupId>
2727
<artifactId>yguard</artifactId>
28-
<version>4.0.0</version>
28+
<version>4.1.0</version>
2929
<!--
3030
prevent the spring boot plug-in from bundling yGuard and its
3131
dependencies into the project jar / project build artefact

examples/resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configurations {
2323
}
2424

2525
dependencies {
26-
yguard 'com.yworks:yguard:4.0.0'
26+
yguard 'com.yworks:yguard:4.1.0'
2727
}
2828

2929
task obfuscate {

examples/resources/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<property name="project.dir" value="${basedir}/../.."/>
33
<property name="source.dir" value="${basedir}/src"/>
44
<property name="target.dir" value="${basedir}/build"/>
5-
<property name="yguard.version" value="4.0.0"/>
5+
<property name="yguard.version" value="4.1.0"/>
66

77
<property name="project.name" value="resources"/>
88
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/resources/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.yworks</groupId>
1818
<artifactId>yguard</artifactId>
19-
<version>4.0.0</version>
19+
<version>4.1.0</version>
2020
<scope>compile</scope>
2121
</dependency>
2222
</dependencies>

examples/serializable_exclusion/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configurations {
2323
}
2424

2525
dependencies {
26-
yguard 'com.yworks:yguard:4.0.0'
26+
yguard 'com.yworks:yguard:4.1.0'
2727
}
2828

2929
task obfuscate {

examples/serializable_exclusion/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<property name="project.dir" value="${basedir}/../.."/>
33
<property name="source.dir" value="${basedir}/src"/>
44
<property name="target.dir" value="${basedir}/build"/>
5-
<property name="yguard.version" value="4.0.0"/>
5+
<property name="yguard.version" value="4.1.0"/>
66

77
<property name="project.name" value="serializable_exclusion"/>
88
<property name="project.jar.unobf" value="${target.dir}/jar/${project.name}_unobf.jar"/>

examples/serializable_exclusion/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>com.yworks</groupId>
2020
<artifactId>yguard</artifactId>
21-
<version>4.0.0</version>
21+
<version>4.1.0</version>
2222
<scope>compile</scope>
2323
</dependency>
2424
</dependencies>

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_MAJOR=4.0
2-
VERSION_MINOR=1-SNAPSHOT
1+
VERSION_MAJOR=4.1
2+
VERSION_MINOR=0
33

44
POM_DESCRIPTION=The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts
55
POM_URL=https://github.com/yWorks/yGuard

0 commit comments

Comments
 (0)