Skip to content

Releases: Guardsquare/proguard-core

9.0.8

03 Mar 15:40
16a0462
Compare
Choose a tag to compare

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

9.0.7

09 Jan 15:19
Compare
Choose a tag to compare

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.

9.0.6

16 Nov 15:51
Compare
Choose a tag to compare

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.

9.0.5

12 Oct 16:26
Compare
Choose a tag to compare

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.

9.0.4

04 Oct 12:32
Compare
Choose a tag to compare

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.

9.0.3

11 Aug 15:54
Compare
Choose a tag to compare

Java support

  • Update maximum supported Java class version to 63.65535 (Java 19 ea). (PGD-247)

Improved

  • Add utility to produce dot-graphs for control flow automatons (CfaUtil.toDot(cfa), example VisualizeCfa).
  • Add support for heap slicing on call sites and heap reconstruction on return sites in dataflow analysis heap tree model. (T17091)
  • Add support for differential map representation to be used in the data flow analysis. (T17090)

API Improvements

  • Split ProgramLocationDependentTransferRelation into forward and backward variants.
  • Add ClassPoolClassLoader utility for loading ProGuardCORE classes.

9.0.2

06 Jul 08:44
Compare
Choose a tag to compare

Improvements to Kotlin metadata initialization

Several improvements to Kotlin metadata initialization now allow building the Kotlin metadata model for library classes (LibraryClass):

  • KotlinMetadataInitializer provides a new public method initialize(Clazz, int, int[], String[], String[], int, String, String) to initialize
    the Kotlin metadata model for a given class.
  • ClassReader can now build the Kotlin metadata model by setting includeKotlinMetadata to true.
  • LibraryClassReader can now read the Kotlin metadata annotation and provide the components to a consumer.
  • An UnsupportedKotlinMetadata type is now assigned by the KotlinMetadataInitializer if the Kotlin metadata model
    could not be initialized correctly.

9.0.1

03 Jun 17:40
Compare
Choose a tag to compare

Improved

  • ExecutingInvocationUnit now loads values from static final fields.
  • Initialize Kotlin lambda method references when the JVM method name is <anonymous>. (T16483)
  • Add the possibility of limiting the number of CodeAttributes contributing into CFA.
  • Add the possibility of limiting the number of CodeAttributes considered by the CallResolver.

Bug fixes

  • Fix wrong handling of array types in ExecutingIvocationUnit and ParticularReferenceValue.
  • ParticularReferenceValue sanity checks now take inheritance into consideration, improving call analysis. (T15197)
  • Prevent missing semicolon leading to an infinite loop in ClassUtil#internalMethodParameterCount.
  • Make category 2 CPA taint sources affect only the most significant byte abstract state.
  • Fix inconsistent usage of type names in the context of the PartialEvaluator that could result in
    trying to create an internal type string from a string that was already an internal type. (T15513)
  • Fix initialization of Kotlin callable references when using -Xno-optimized-callable-references compiler option. (T16486)

Upgrade considerations

TYPE NAME CONVENTION

PGC has different representation for type string variables:

  • External class name: com.guardsquare.SomeClass
  • Internal class name: com/guardsquare/SomeClass
  • Internal type (or just type): Lcom/guardsquare/SomeClass; (for arrays e.g. [I, [Ljava/lang/Object;)
  • Internal class type: com/guardsquare/SomeClass (for arrays this is their internal type e.g. [I, [Ljava/lang/Object;)

See proguard.classfile.util.ClassUtil for useful methods to convert between the different representations.

Since internal class name and type were used ambiguously, from version 9.0.1 the internal type is used
consistently whenever we have a variable named type.

Since this was not the case, this update might cause some type variables switching from the internal class name
notation to the internal type notation, potentially breaking some logic if types are used by an external
application using proguard-core.

9.0.0

13 Apr 08:40
Compare
Choose a tag to compare

Configurable program analysis (CPA)

CPA is a formalism for data flow analysis allowing seamless composition of various analyses and model checking techniques. Thus, it adds a framework for systematic development and extension of static analyses in a uniform structured way.

Taint analysis is the first ProGuardCORE CPA. Its goal is to detect data flow between source and sink method calls, which is useful for detecting bugs and security flaws.

The Taint Analysis manual page provides more information.

  • Add configurable program analysis (CPA) for interprocedural data flow analysis development.
  • Add taint analysis.

Bug fixes

  • Prevent linking a final method with a shadowing method in a subclass. (T14726)
  • Force Call#getArgumentCount() to be correct even if the actual argument values
    could not be calculated or have been cleared. (TT14632)
  • Reset ExecutingInvocationUnit parameters array even when an exception happens.

8.0.7

18 Feb 11:02
Compare
Choose a tag to compare

Version 8.0.7

Java support

  • Update maximum supported Java class version to 62.65535 (Java 18 ea). (T13973)

Kotlin support

  • Update kotlinx.metadata dependency to version 0.4.1
  • Add support for Kotlin property synthetic delegate methods. (T14060)
  • Add ability to pass KotlinMetadataVersion to KotlinMetadataWriter / KotlinModuleWriter.