Proguard Core Versions Save

Library to read, write, analyze, and process java bytecode

v9.1.2

2 weeks ago

Java support

  • Update maximum supported Java class version to 66.65535 (Java 22). (#127)

API changes

  • Remove deprecated ReferenceValueFactory, ParticularReferenceValueFactory should be used instead.
  • Deprecate methods in ValueFactory taking an Object as parameter. The alternatives using ParticularObject should be used instead.

Improved

  • Add support for selective parameter reconstruction to define which methods should have their calls evaluated.
  • Refactor ExecutingInvocationUnit to be customizable using executors. Improve checking whether method instance should be replaced in stack and variables.
  • Support execution of methods that operate on 1D arrays of all primitive and reference types with ReflectionExecutor.
  • Use runtime type instead of static type when possible in ExecutingInvocationUnit.
  • Introduce ParticularObject as the value tracked by ParticularReferenceValue. This makes explicit which kind of values can be tracked during the analysis, and introduces the possibility of tracking a model of the values that differ from the actual tracked object.

Bug fixes

  • Improve Kotlin MultiFileFacade metadata assertions to detect uninitialized references.
  • Fix handling of category 2 values in JvmValueTransferRelation to work correctly with ExecutingInvocationUnit.
  • Fix concurrency problems in CallGraph and ValueFactory ids.
  • Fix a bug in ReturnClassExtractor returning the last parameter type instead of null for primitive return values.
  • Fix ExecutorMethodSignatureMatcher trying to mutate an immutable map.
  • Fix TypedReferenceValue.cast() not handling null values correctly.

v9.1.1

4 months ago

Version 9.1.1

Bugfixes

  • Enable fix previously behind system property: fix TypedReferenceValue.generalize() not setting mayBeExtension to true when generalizing to common parent type.
  • Avoid printing PartialEvaluator messages when an ExcessiveComplexityException occurs.
  • Fix incorrect writing of flags for type parameters with name annotations.
  • Fix incorrect writing of flags for reified type parameters.
  • Fix model for types and type parameters, removing the incorrect HAS_ANNOTATION common flag.

Improved

  • Enable new PartialEvaluator error message format by default.
  • Add the ability to implement a custom renaming strategy for ClassReferenceFixer.
  • Add new MaxStackSizeComputer to compute the maximum stack size of a code attribute which is more memory efficient than the existing StackSizeComputer.
  • Add IdentifiedArrayReferenceValue.generalize() to maintain ID when applied to two instances with same ID.

v9.1.0

7 months ago

Version 9.1

New

  • Added PartialEvaluator JSON output for use with the new proguard-core-visualizer tool.
  • Improve PartialEvaluator error messages when enabled with PartialEvaluator.Builder.setPrettyPrinting().

Improved

Bug fixes

  • Fix UnsupportedOperationException when trying to shrink Kotlin metadata from a lambda function.

API Changes

  • No longer consider Record attributes empty when they have no components in NonEmptyAttributeFilter. (#118)
  • Add new ProguardCoreException subclasses with more specific meanings.

v9.0.10

9 months ago

Improved

  • TaintSink can now be configured with a predicate to filter on which TaintSources trigger it.
  • Improve performance of DynamicClassReferenceInitializer.
  • Improve performance of DynamicClassMemberReferenceInitializer.

API changes

  • The constructors in JvmInvokeTaintSink are now deprecated, JvmInvokeTaintSink#Builder should be used instead.
  • MultiTypedReferenceValue.generalize() now removes the null type from the set of potential types, and sets maybeNull on the other types instead.

v9.0.9

10 months ago

Kotlin support

  • Add support for processing Kotlin 1.9 metadata.
  • Update kotlinx metadata dependency to version 0.6.0.

Java support

  • Update maximum supported Java class version to 65.65535 (Java 21).

Improved

  • Added support for adding line numbers in the CodeAttributeEditor.
  • Improve performance of ClassReferenceInitializer when initializing Kotlin type aliases.
  • Improve performance of ClassPool.removeClass.
  • Allow more configuration of ExecutingInvocationUnit by using ExecutingInvocationUnit.Builder.
  • Add a mode to ExecutingInvocationUnit to approximate reference of types not supported for the execution via reflection.
  • Implement Autocloseable in DataEntryWriter interface.
  • JvmTransferRelation does not store anymore static variables with default value, reducing the dataflow analysis state space.

Bug fixes

  • Use program location as hash code for JvmAbstractState to allow correct use with hash sets.
  • Fix a bug in JvmTransferRelation handling arithmetic instructions returning category 2 values incorrectly.
  • Fix delegation of proguard.evaluation.value.ParticularValueFactory#createReferenceValueNull().

API changes

  • The key used for fields in JvmAbstractState has been updated to include the field type to disambiguate between overloaded fields.
  • Replace allNodes field in proguard.analysis.cpa.defaults.Cfa with getAllNodes method to save memory.
  • Constructor for ExecutingInvocationUnit is deprecated, use ExecutingInvocationUnit.Builder instead.

v9.0.8

1 year ago

Improved

  • Increase proguard.classfile.VersionConstants.MAX_SUPPORTED_VERSION to 64.65535 (Java 20 + preview enabled).
  • Fix tracking of IdentifiedReferenceValue IDs.
  • Add new Kotlin visitor SAM interfaces: KotlinClassVisitor, KotlinFileFacadeVisitor, KotlinMultiFileFacadeVisitor, KotlinMultiFilePartVisitor, KotlinSyntheticClassVisitor.

API changes

  • JvmTransferRelation has been refactored to model IINC in a separate computeIncrement method.
  • The ProcessingFlag.DONT_PROCESS_KOTLIN_MODULE value was changed from 0x00002000 to 0x00008000.
  • Remove fromClassPool suffixes in CfaUtil methods.
  • Refactor CodeLocation to only take the signature and offset into consideration.
  • IdentifiedReferenceValue id field changed from int to Object.
  • ParticularValueFactory.ReferenceFactory replaced by ParticularReferenceValueFactory.
  • Add ValueFactory.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean maybeNull, Clazz creationClass, Method creationMethod, int creationOffset) to allow creating references identified by their creation site.
  • Add JvmCfaReferenceValueFactory to create references identified by the JvmCfaNode creation site.

Upgrade considerations

Identified and particular references can now be identified by any Object instead of a simple int. However, this means that code which compared the IDs may need to be modified. For example, the following code should be changed:

    public static boolean equal(IdentifiedReferenceValue a, IdentifiedReferenceValue b) {
        return a.id == b.id;
    }

It should use the equals method instead.

    public static boolean equal(IdentifiedReferenceValue a, IdentifiedReferenceValue b) {
        return a.id.equals(b.id);
    }

The ParticularReferenceValueFactory identifies references with integers by default:

ValueFactory valueFactory = new ParticularReferenceFactory(new ParticularReferenceValueFactory());
Value a = valueFactory.createReferenceValue("Ljava/lang/String;", clazz, false, false);
// a.id will be an integer.

Any Object can be used as an ID using the createReferenceValueForId method:

String objectId = "myId";
ValueFactory valueFactory = new ParticularReferenceFactory(new ParticularReferenceValueFactory());
Value a = valueFactory.createReferenceValueForId("Ljava/lang/String;", clazz, false, false, objectId);
// a.id will be objectId

v9.0.7

1 year ago

Improved

  • Don't report warnings for missing Kotlin default implementation classes when initializing with ClassReferenceInitializer.
  • Only link matching methods in Kotlin file facades with MethodLinker.
  • Extend the LimitedHashMap parameterization with an element exclusion selector.
  • Add the possibility to add a predicate to taint sources and sinks for selective response to calls.

Bug fixes

  • Fix the reduce operator producing a wrong JvmAbstractState for the composite taint analysis.
  • Fix potential expected Precise Reference runtime verifier error.
  • Don't report warnings for missing Kotlin default implementation classes when initiazing with ClassReferenceInitializer.

API Improvements

  • Add KotlinMetadataAsserter to check the integrity of Kotlin metadata.
  • Add JvmReturnTaintSink to support return instruction sinks in taint analysis.
  • Use method signatures instead of fully qualified names in taint sources and sinks.

API changes

  • JvmTaintSink has been generalized, use JvmInvokeTaintSink to have the old functionalities.

v9.0.6

1 year ago

Improved

  • Add support for limiting the size of the CPA tree heap model with LimitedHashMaps.

Bug fixes

  • Fix ldc_w method in the InstructionSequenceBuilder generating a ldc instruction instead of a ldc_w.

API Improvements

  • Add referencedDefaultMethodAccept to KotlinFunctionMetadata model.

v9.0.5

1 year ago

Version 9.0.5

Improved

  • Replace proguard-assembler dependency in test fixtures with Maven Central version.

Bug fixes

  • Do not add interprocedural CFA edges for methods missing intraprocedural CFA.

v9.0.4

1 year ago

Version 9.0.4

Improved

  • Allow class sub-hierarchy re-initialization for the optimized implementation of ClassSubHierarchyInitializer.
  • Enable providing distinct abort operators for the main and trace reconstruction CPAs.
  • Add a heap model for taint CPA supporting tainting of whole objects.
  • Call API: Add a few utilities and fix inconsistent call argument count getter behavior.
  • Only change the Kotlin metadata version if the original version is unsupported.
  • Add support for Kotlin context receivers in Kotlin metadata.
  • Add support for reading & writing Kotlin 1.8 metadata.

API Improvements

  • Add referencedDefaultImplementationMethodAccept to KotlinFunctionMetadata model class.
  • Deprecated referencedMethodAccept(Clazz, MemberVisitor) in favour of referencedMethodAccept(MemberVisitor) in KotlinFunctionMetadata model class.
  • Add TransformedStringMatcher.
  • Add ClassFeatureNameCollector.
  • Add var-arg constructor to ClassPath.
  • Add DataEntryClassInfoFilter.
  • Add NamedDataEntry.
  • Refactor CodeLocation#getClassName as getExternalClassName to comply with the types naming convention.

Bug fixes

  • Fix side effect on DetailedArrayReferenceValue modifying values at previous offsets on array store instructions during PartialEvaluator execution.
  • Fix JvmTransferRelation to produce a successor in case of missing interprocedural call edge (e.g., in case of incomplete call resolution).
  • Fix call resolution for invokedynamic (issue #63). There might now be calls with incomplete target information. By default, these calls will not be distributed to visitors, but this can be enabled by setting the skipIncompleteCalls option in the call resolver.
  • Fix leading $ being stripped from inner classes by the ClassReferenceFixer. This prevents classes with names like Foo$$Bar incorrectly having their simple name changed from $Bar to Bar.