All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Process files in the order they appear in the respective input archives or directories. This fixes a regression that was introduced with directory support in version 3.0.0.
- Fixed
UnsupportedOperationException
that occurred for Java 17 class files when excluding classes from obfuscation using theextends
orimplements
attributes of therename.keep.class
element in the yGuard ANT task.
- Added support for obfuscating Java 21 class files.
- Updated and improved examples.
- Stand-alone package names in resource files are no longer adjusted when using
replaceContentPolicy
strict
.
- Added
replaceContentPolicy
andreplacePathPolicy
configuration options for adjusting resource files. With these policies it is possible to choose between the lenient behavior from yGuard 3.x and the strict behavior from yGuard 2.x.
- Fixed treatment of NestHost and NestMembers attributes when shrinking.
- Updated gson dependency in examples from 2.8.6 to 2.8.9
- Added support for obfuscating Java 17 sealed classes.
- Added support for obfuscating Java 17 class files.
- Added support for obfuscating Java 16 records.
- Added support for obfuscating Java 16 class files.
- Added support for obfuscating multi-release jars. (Shrinking multi-release jars is not supported.)
- Improved support for type annotations.
- Fixed digests for resource files.
- Ensured all opened streams are properly closed.
- Added testimonials
- Added class constant for Kotlin (Kotlin support)
- Added directory support for reading archives from directories
- Added subclassing capabilities to further extend yGuard
- Removed ability to read archives from URL
- Parse
exposed
section of log files as well - Added compatability fixes to increment to Java 14
- Fixed major bug with interface inheritance
- Fixed Windows being unable to run yGuard because of file system issues
- Replaced internal dependency graph from a Guava-dependant implementation to a standalone implementation
- Removed artificial split of retroguard and yGuard and unify the project under a single MIT license
2.10.0 2020-05-22
- Added support for
invokedynamic
instructions to YShrink - Added support for
default
methods in interfaces to YShrink - Added more documentation to YShrink for future maintenance
- Use mkdocs instead of Jekyll. Bundle docs in the upcoming releases.
- Support
ASM7
and Java 13 in both YShrink and YGuard
- Use an empty manifest in
JarWriter
where the shrinker would previously crash when no manifest was present - Use Gradle wrapper with Gradle version 5.6.4 for reproducible builds
2.9.2 - 2019-12-09
- Added scramble to the element, introducing randomized mapping
- Add documentation about default values
- Added @Inherited annotation to
com.yworks.util.annotation.Obfuscation
- Do not use
setComment
when comment is actuallynull
. Achieves Android compatibility.
2.9.1 - 2019-11-18
- Use a Jekyll-based documentation instead of our own HTML
- Added example projects for Gradle, Maven and Ant
- Added installation instructions for Gradle, Maven and Ant
- Published packages on Maven Central
2.9.0 - 2019-10-17
- Replaced legacy build system with Gradle.
- Added
retroguard
dependency (LGPL-licensed)
2.8.0 - 2019-10-02
- Replaced
y.base.Edge
,y.base.Node
andy.base.Graph
with a custom wrapper around Guava - Removed parts licensed under
LGPL
into a dedicated library, which is linked statically. - Relicensed the project under
MIT
- Fixed
UnsupportedOperationException
that occurred for Java 11 class files when excluding classes from obfuscation using theextends
orimplements
attributes of therename.keep.class
element in the yGuard ANT task. - Fixed yGuard's
language-conformity
modeillegal
to no longer produce unqualified names that contain dots or spaces.
- Added support for the
MethodParameters
attribute, which was introduced with the Java 8.class
file format.
- Fixed
ClassCastException
that occurred when obfuscating Java 11 class files withString
concatentation. - Fixed
IllegalArgumentException
that occurred when excluding classes from obfuscation using theextends
orimplements
attributes of therename.keep.class
element in the yGuard ANT task.
- Added basic Java 11 class file support.
- Added Java 9 and Java 10 class file support.
- Added support for stacktraces with module prefixes.
- Added support for stacktraces with obfuscation prefixes.
- Improved translation of overloaded methods.
- Added support for Java 8 Type Annotations.
- The
implements
attribute now considers types in<externalclasses>
as well when determining the interfaces implemented by a given class.
- Fixed incorrect obfuscation of
invokedynamic
instructions leading to AbstractMethodErrors of class files which had their constant pool entry order permutated for some reason (for example by the JarJar plugin for maven).
- Changed the class file version of the yGuard library, so yGuard can be run with Java 7 again.
- Fixed
IllegalArgumentException: "Invalid fully qualified name (b)"
that occurred when referencing or attempting to obfuscate classes that start with a dollar ('$') sign.
- Fixed
IllegalArgumentException
caused by Java 8 compatibility problems that arose in certain situations, for example when using hierarchy based keep instructions.
- Fixed incorrect obfuscation of
invokedynamic
instructions leading toAbstractMethodError
when using default methods.
- Added support for renaming
META-INF/services
entries if the entry corresponds to a type that is obfuscated.
- Fixed a bug that caused the stacktrace deobfuscation tool to ignore class name mappings that started with one or more $ characters.
- Fixed broken binary class file of the attached
com.yworks.util.annotation.Obfuscation
annotation inObfuscationAnnotation.jar
.
- Added support for controlling obfuscation exclusion via annotations.
- Improved Java 7 support. yGuard does now support
invokedynamic
in the obfuscation process.
- Fixed a regexp that could cause yGuard to parse manifest files for a very long time.
- Added basic Java 7 class file support
- Fixed a bug that caused yGuard to introduce invalid signatures for typed classes with inner classes.
- Fixed a bug that caused yGuard to erroneously exclude all classes from obfuscation when an
implements
attribute was used for a<class>
element without an additionalname
orexpose
attribute. - Fixed a bug that caused the shrinker to ignore the
<attribute>
element if the default shrinking settings were used (i.e. if no<keep>
element was defined).
- Fixed a bug that caused the shrinker to remove the static initializer of a non-static inner class, when only fields of the inner class were referenced (e.g. compiler-generated switch map tables for enums).
- yGuard won't try to initialize external classes needed for resolving anymore.
- The default behavior of the shrinker was changed to keep any referenced runtime visible annotation and parameter annotation attributes.
- Fixed a bug that caused the shrinker to remove the enclosing method of anonymous inner classes declared as entry points.
- The shrinker will now correctly adhere to the "lineNumberTable", "runtimeVisibleParameterAnnotations" etc. attributes of the
<keep>
element. - Fixed a bug that caused the shrinker to remove referenced Annotation elements from Annotation interfaces.
- yGuard now won't rename or remove the package-info class.
- Fixed possible "Illegal group reference" Exception in yGuard's parse tool.
- The shrinker will now keep classes that are used as field types of referenced fields.
- The shrinker will now correctly keep method attributes of methods that are kept as stubs.
- yGuard is now fully JDK-1.6 compatible.
- The yGuard task now supports a way of specifying a set of jars that should be obfuscated at the same time using simple patternset syntax.
- yGuard now uses the same technique for all elements in the MANIFEST file to adjust fully qualified class name strings.
- It is now possible to tell yGuard not to obfuscate specific package names.
- yGuard can now be given a list of digest algorithms that will be used to create the digests in the manifest.
- yGuard now issues a warning if the package or class or method name of a native method is obfuscated.
- Added
overloadEnabled
property
- Fixed a bug that caused yGuard to throw a
NullPointerException
if aattribute
element contained no nestedpatternset
. - Fixed a bug that caused yGuard to use multiple logging instances if a yGuard task was executed multiple times.
- Fixed LineNumberTable and SourceFile elements
- Fixed a bug that broke the nested
map
element of therename
element.
- Fixed a bug that caused yGuard to fail during class file parsing if a method signature contained an inner class of a parameterized class.
- yGuard will not complain about the Java 1.5 attributes
Bridge
,Enum
andVarargs
as "unknown attributes" anymore. - Fixed a bug that caused all classnames to be kept from renaming if the
extends
attribute was used in combination with theclasses
attribute.
- Fixed an inconsistency between the interpretation of the Ant syntax in the
rename
andshrink
elements. Now, both elements applypatternset
elements in nestedmethod
andfield
elements to class names, just as stated in the yGuard documentation.
- If the
classes
attribute of theclass
element is not set or set to "none", the shrinking engine will now include the classes that match based on the givenname
attribute or nestedpatternset
, effectively ignoring the classes attribute.
- New elaborate code shrinking functionality.
- More powerful ant syntax:
extends/implements
attributes for theclass
element. - yGuard now needs Java2 SDK 1.4.x or greater to function properly.
- General Ant syntax changes due to the introduction of the new
yguard
,shrink
andrename
elements.
- Fixed bad treatment of the new enclosing method feature in Tiger which sometimes led to AbstractMethodErrors at runtime.
- Fixed bad annotation handling for non-trivial annotations. Annotations had not been parsed and handled correctly, which could lead to either errors during obfuscation or Errors at runtime.
- Improved obfuscation logic for enumerations. Now the two static methods valueOf(String) and values() don't have to be exposed manually anymore.
- Fixed a bug that made yGuard ignore some of the attributes in the expose section ("sourcefile" and "linenumbertable").
- Fixed a rare but severe bug that accidentally removed method attributes and sometimes led to
ArrayIndexOutOfBoundsExceptions
during the obfuscation.
- Added JDK 1.5 (a.k.a Java 5.0 code-named Tiger) compatibility. yGuard can now deal correctly with the new JDK and Java features: generics, var-args, enumerations, annotations, new
.class
bytecode construct, signatures, local variable type table, enclosing method information. - Implemented the ability to obfuscate/scramble/shrink line number information. This makes it possible to more easily debug stacktraces without exposing line number information in the obfuscated version of the application.
- Implemented the ability to obfuscate the source file information. This is necessary in order to view line number information in stack traces. It is now possible to reassign the source file attribute inside class files so that the original source file name is not exposed in the obfuscated application.
- Added the ability to determine on a per-class basis what attributes to expose or obfuscate. This includes line number information (with optional scrambling/compression or removal), source file attributes, deprecation attributes, etc. This makes it easy to obfuscate parts of your application while keeping the public API untouched and debug information for third party jars intact.
- Improved the stacktrace deobfuscation tool. It can now unscramble line number information from stacktraces, features a more polished view of the mapping rules and deobfuscates stacktraces more reliably if the stacktraces are ambiguous.
- yGuard now helps in the detection of duplicate class files in source jars. In pedantic mode yGuard will terminate if duplicate classes are detected in different source jars. yGuard's obfuscate task will always fail if mutliple class files containing a definition for the same jar are detected. The log file displays useful information for finding the duplicate entries.
- Improved xml log file output for Unicode characters.
- Fixed a name clash problem that occurred when already obfuscated code was being obfuscated again using different settings.
- Fixed a resolution problem concerning interfaces from external classpaths.
- Improved name generation. yGuard will now generate legal identifiers (with respect to
Character.isJavaIdentifierStart()
andCharacter.isJavaIdentifierPart(char)
andCharacter.isIdentifierIgnorable(char))
and should therefor produce jars that should verify correctly even on older jdks if yGuard is run using newer jdks. - Made the log file viewer output more consistent with inner class names that were being mapped during obfuscation versus those who remained fixed.
- Jar file entries are now being sorted prior to being written to the jar.
- Improved handling of external classes.
- Fixed a problem concerning the adjust elements throwing a RuntimeException in the pattern matching code.
- Fixed a problem where the wrong set of files was affected in the adjust section.
- yGuard now treats the COMPATIBLE flag for the language conformity different. Field names and class names are now made up of lower ascii-only chars.
- Improved the optional keeping of "Deprecated" tags. Somehow they still seem to get lost under certain conditions. Any feedback on this topic is welcomed.
- Due to a compile time dependency, yGuard could not be used with jdk 1.3.x anymore even if the automatic resource adjustment feature was not used. This has now been made possible again.
- Fixed a rare problem that broke obfuscated code using static method invocations and static field references.
- There was a bug in the log file viewer (
java -jar yguard.jar [logfile.xml[.gz]]
) that made it crash under very rare circumstances. - Implemented a workaround for an Ant incompatibility problem, which resulted in yGuard behaving differently on different platforms and in conjunction with different Ant versions.
- yGuard will now generate (empty) directory entries in the resulting jar files for each non-empty directory.
- Added automatic text file and property file renaming mechanism. yGuard can now be configured to rename
.properties
files according to the obfuscation. - It is now possible to process text files and replace occurances of class names with their obfuscated versions.
- One can now specify whether resource files should be kept in their original directory while at the same time the classes residing in the respective directory can be fully obfuscated to another package.
- yGuard can now automatically create gzipped (.gz) logfiles and work directly on compressed logfiles. This reduces the size of the logfiles drastically.
- It is now possible to simply specify a list of attributes, that should not be removed by yGuard (for example
Deprecated
) using the expose-attributes property. - yGuard has a new name generation method (
language-conformity = compatible
), that creates jar file that can be successfully unzipped to the windows filesystem. - In order to avoid namespace clashes, one can now easily specify a prefix for completeley obfuscated package hierarchies using the
obfuscation-prefix
property. - Enhanced documentation (DTD, examples, and new features description).
- Innerclasses making use of the .class construct should now always be correctly obfuscated using the replaceClassNameStrings feature.
- The
patch
element had a bug concerning field name mappings, which is now resolved. - yGuard now tests whether a newly obfuscated name already exists in external jars and automatically generates names, that should not clash.
- yGuard should now work together with Ant version 1.6 (there was an undocumented change in the API of Ant).
- Added support for external libraries. This allows yGuard to obfuscate jars that have external dependencies more easily and using stronger obfuscation. It is now possible to specify dependencies using Ant classpath elements. yGuard then uses information found in these jars to resolve external dependencies.
- Improved error handling and task and logfile output. yGuard will now produce fewer unreasonable warnings. During the obfuscation run yGuard will give more detailed warnings and hints when unobfuscatable classes are detected.
- Added property error-checking which can be set to pedantic. In this case yGuard will not issue warnings but a build will fail instead of issueing simple warnings. This helps in finding problems.
- Fixed a minor issue. The documentation stated, that:
<class classes="protected"/>
behaved like<class classes="protected"> <patternset> <include name="**.*"/> </patternset> </class>
but in the implementation<include name="*"/>
had been applied. This has now been fixed to<include name="**.*"/>
. - Fixed some bugs in the documentation.
- Added support for different naming schemes. These schemes result in smaller jar files, better obfuscation and lead to jar files, which cannot be unpacked to normal filesystems.
- Fixed two JBuilder incompatibilities. Innerclasses created by JBuilder do not prevent yGuard from working anymore and (correct) innerclasses created by yGuard do not crash JBuilder anymore (which btw. is a bug in JB).
- yGuard can now automatically obfuscate code of the form
Class.forName("com.mycompany.myapp.MyClass");
so that these classes can now be obfuscated by name, too.
- Implemented a fix for the problem, where the
ClassName.class
code construct prevented classes from being obfuscated entirely. - Fixed two bugs concerning the handling of manifest files.
- Fixed a bug concerning the handling of the
Main-Class
attribute of manifest files.
- Improved the serialization of the obfuscation map to the xml file, which can now be parsed back in by the included tool even for complicated naming schemes.
- Refactored the creation of the final jar files. The current implementation leads to more standard conform jar files.
- The
Main-Class
attribute of the Manifest files will now be translated to the obfuscated name, if the main class is not exposed.
- Implemented more robust handling of Manifest files. Implementation now makes use of
java.util.jar.Manifest
. - The
conserveManifest
attribute of the obfuscate task now conserves the manifest in a better way.