mirror of
https://github.com/Guardsquare/proguard.git
synced 2026-03-13 09:50:34 +08:00
Update ProGuardCORE dependency to 8.0.0
Updates ProGuard to support Kotlin 1.5 Builds with ProGuardCore 8.0.0
This commit is contained in:
@@ -28,12 +28,12 @@ dependencies {
|
||||
api "com.guardsquare:proguard-core:${proguardCoreVersion}"
|
||||
implementation "com.google.code.gson:gson:${gsonVersion}"
|
||||
|
||||
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.32"
|
||||
testImplementation "org.jetbrains.kotlin:kotlin-reflect:1.4.32"
|
||||
testImplementation 'com.github.tschuchortdev:kotlin-compile-testing:1.3.0'
|
||||
testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.5.0' // for kotest framework
|
||||
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.5.0' // for kotest core jvm assertions
|
||||
testImplementation 'io.kotest:kotest-property-jvm:4.5.0' // for kotest property test
|
||||
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.20"
|
||||
testImplementation "org.jetbrains.kotlin:kotlin-reflect:1.5.20"
|
||||
testImplementation 'com.github.tschuchortdev:kotlin-compile-testing:1.4.2'
|
||||
testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.6.0' // for kotest framework
|
||||
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.6.0' // for kotest core jvm assertions
|
||||
testImplementation 'io.kotest:kotest-property-jvm:4.6.0' // for kotest property test
|
||||
testImplementation "io.mockk:mockk:1.12.0" // for mocking
|
||||
|
||||
// For assembling ProGuard assembler snippets
|
||||
|
||||
@@ -533,7 +533,7 @@ public class Obfuscator
|
||||
// Ensure object classes have the INSTANCE field.
|
||||
new KotlinObjectFixer(),
|
||||
|
||||
new AllFunctionsVisitor(
|
||||
new AllFunctionVisitor(
|
||||
// Ensure that all default interface implementations of methods have the same names.
|
||||
new KotlinDefaultImplsMethodNameEqualizer(),
|
||||
// Ensure all $default methods match their counterpart but with a $default suffix.
|
||||
@@ -621,7 +621,7 @@ public class Obfuscator
|
||||
// Apply new names to Kotlin properties.
|
||||
programClassPool.classesAccept(
|
||||
new ReferencedKotlinMetadataVisitor(
|
||||
new AllKotlinPropertiesVisitor(
|
||||
new AllPropertyVisitor(
|
||||
new KotlinPropertyRenamer())));
|
||||
}
|
||||
|
||||
|
||||
@@ -112,9 +112,6 @@ public class KotlinValueParameterNameShrinker
|
||||
{
|
||||
private int parameterNumber = 0;
|
||||
|
||||
@Override
|
||||
public void onNewFunctionStart() { }
|
||||
|
||||
@Override
|
||||
public void visitAnyValueParameter(Clazz clazz, KotlinValueParameterMetadata kotlinValueParameterMetadata)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ implements KotlinMetadataVisitor,
|
||||
{
|
||||
kotlinDeclarationContainerMetadata.functionsAccept(clazz, this);
|
||||
kotlinDeclarationContainerMetadata.accept(clazz,
|
||||
new AllKotlinPropertiesVisitor(this));
|
||||
new AllPropertyVisitor(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1943,8 +1943,7 @@ implements ClassVisitor,
|
||||
// Implementations for KotlinAnnotationVisitor.
|
||||
|
||||
@Override
|
||||
public void visitAnyAnnotation(Clazz clazz,
|
||||
KotlinMetadataAnnotation annotation)
|
||||
public void visitAnyAnnotation(Clazz clazz, KotlinAnnotatable annotatable, KotlinAnnotation annotation)
|
||||
{
|
||||
if (!isUsed(annotation))
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ extends AbstractKotlinMetadataConstraint
|
||||
@Override
|
||||
public void visitAnyKotlinMetadata(Clazz clazz, KotlinMetadata kotlinMetadata)
|
||||
{
|
||||
kotlinMetadata.accept(clazz, new AllConstructorsVisitor(this));
|
||||
kotlinMetadata.accept(clazz, new AllConstructorVisitor(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ extends AbstractKotlinMetadataConstraint
|
||||
@Override
|
||||
public void visitAnyKotlinMetadata(Clazz clazz, KotlinMetadata kotlinMetadata)
|
||||
{
|
||||
kotlinMetadata.accept(clazz, new AllFunctionsVisitor(this));
|
||||
kotlinMetadata.accept(clazz, new AllFunctionVisitor(this));
|
||||
}
|
||||
|
||||
// Implementations for KotlinFunctionVisitor.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ProGuard -- shrinking, optimization, obfuscation, and preverification
|
||||
* of Java bytecode.
|
||||
*
|
||||
* Copyright (c) 2002-2020 Guardsquare NV
|
||||
* Copyright (c) 2002-2021 Guardsquare NV
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
@@ -30,10 +30,11 @@ import proguard.util.kotlin.asserter.AssertUtil;
|
||||
*/
|
||||
public class KmAnnotationIntegrity
|
||||
extends AbstractKotlinMetadataConstraint
|
||||
implements KotlinTypeVisitor,
|
||||
KotlinTypeAliasVisitor,
|
||||
KotlinTypeParameterVisitor,
|
||||
KotlinAnnotationVisitor
|
||||
implements KotlinTypeVisitor,
|
||||
KotlinTypeAliasVisitor,
|
||||
KotlinTypeParameterVisitor,
|
||||
KotlinAnnotationVisitor,
|
||||
KotlinAnnotationArgumentVisitor
|
||||
{
|
||||
|
||||
private AssertUtil util;
|
||||
@@ -77,12 +78,52 @@ extends AbstractKotlinMetadataConstraint
|
||||
kotlinTypeParameterMetadata.annotationsAccept(clazz, this);
|
||||
}
|
||||
|
||||
// Implementations for KotlinAnnotationVisitor.
|
||||
@Override
|
||||
public void visitAnyAnnotation(Clazz clazz, KotlinMetadataAnnotation antn)
|
||||
public void visitAnyAnnotation(Clazz clazz,
|
||||
KotlinAnnotatable annotatable,
|
||||
KotlinAnnotation antn)
|
||||
{
|
||||
|
||||
// TODO: there's an annotation added by the compiler, ParameterName, but it's not in the
|
||||
// class pool - should this be a dummy class, are there more?
|
||||
// util.reportIfClassDangling("annotation class", antn.referencedAnnotationClass);
|
||||
|
||||
util.reportIfNullReference("annotation class", antn.referencedAnnotationClass);
|
||||
antn.referencedArgumentMethods
|
||||
.values()
|
||||
.forEach(annotation -> util.reportIfNullReference("annotation method", annotation));
|
||||
antn.argumentsAccept(clazz, annotatable, this);
|
||||
}
|
||||
|
||||
// Implementations for KotlinAnnotationArgumentVisitor.
|
||||
@Override
|
||||
public void visitAnyArgument(Clazz clazz,
|
||||
KotlinAnnotatable annotatable,
|
||||
KotlinAnnotation annotation,
|
||||
KotlinAnnotationArgument argument,
|
||||
KotlinAnnotationArgument.Value value)
|
||||
{
|
||||
util.reportIfNullReference("annotation method", argument.referencedAnnotationMethod);
|
||||
util.reportIfNullReference("annotation class", argument.referencedAnnotationMethodClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitClassArgument(Clazz clazz,
|
||||
KotlinAnnotatable annotatable,
|
||||
KotlinAnnotation annotation,
|
||||
KotlinAnnotationArgument argument,
|
||||
KotlinAnnotationArgument.ClassValue value)
|
||||
{
|
||||
visitAnyArgument(clazz, annotatable, annotation, argument, value);
|
||||
util.reportIfNullReference("annotation argument class referenced", value.referencedClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitEnumArgument(Clazz clazz,
|
||||
KotlinAnnotatable annotatable,
|
||||
KotlinAnnotation annotation,
|
||||
KotlinAnnotationArgument argument,
|
||||
KotlinAnnotationArgument.EnumValue value)
|
||||
{
|
||||
visitAnyArgument(clazz, annotatable, annotation, argument, value);
|
||||
util.reportIfNullReference("annotation argument enum referenced", value.referencedClass);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ extends AbstractKotlinMetadataConstraint
|
||||
@Override
|
||||
public void visitAnyKotlinMetadata(Clazz clazz, KotlinMetadata kotlinMetadata)
|
||||
{
|
||||
kotlinMetadata.accept(clazz, new AllKotlinPropertiesVisitor(this));
|
||||
kotlinMetadata.accept(clazz, new AllPropertyVisitor(this));
|
||||
}
|
||||
|
||||
// Implementations for KotlinPropertyVisitor.
|
||||
|
||||
@@ -40,7 +40,7 @@ import proguard.classfile.kotlin.KotlinFileFacadeKindMetadata
|
||||
import proguard.classfile.kotlin.KotlinMetadata
|
||||
import proguard.classfile.kotlin.KotlinSyntheticClassKindMetadata
|
||||
import proguard.classfile.kotlin.reflect.visitor.CallableReferenceInfoVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllKotlinPropertiesVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllPropertyVisitor
|
||||
import proguard.classfile.kotlin.visitor.KotlinMetadataVisitor
|
||||
import proguard.classfile.kotlin.visitor.ReferencedKotlinMetadataVisitor
|
||||
import proguard.classfile.util.ClassRenamer
|
||||
@@ -148,7 +148,7 @@ class KotlinCallableReferenceFixerTest : FreeSpec({
|
||||
}
|
||||
),
|
||||
ReferencedKotlinMetadataVisitor(
|
||||
AllKotlinPropertiesVisitor
|
||||
AllPropertyVisitor
|
||||
{ _, _, property ->
|
||||
if (property.name == "original") property.name = "obfuscated"
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ import proguard.classfile.kotlin.KotlinClassKindMetadata
|
||||
import proguard.classfile.kotlin.KotlinConstructorMetadata
|
||||
import proguard.classfile.kotlin.KotlinFunctionMetadata
|
||||
import proguard.classfile.kotlin.KotlinPropertyMetadata
|
||||
import proguard.classfile.kotlin.visitor.AllConstructorsVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllFunctionsVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllKotlinPropertiesVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllConstructorVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllFunctionVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllPropertyVisitor
|
||||
import proguard.classfile.kotlin.visitor.AllValueParameterVisitor
|
||||
import proguard.classfile.kotlin.visitor.KotlinValueParameterVisitor
|
||||
import testutils.ClassPoolBuilder
|
||||
@@ -75,7 +75,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllConstructorsVisitor(
|
||||
AllConstructorVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -111,7 +111,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllConstructorsVisitor(
|
||||
AllConstructorVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -150,7 +150,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllConstructorsVisitor(
|
||||
AllConstructorVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -188,7 +188,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllFunctionsVisitor(
|
||||
AllFunctionVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -224,7 +224,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllFunctionsVisitor(
|
||||
AllFunctionVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -263,7 +263,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllFunctionsVisitor(
|
||||
AllFunctionVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -301,7 +301,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllKotlinPropertiesVisitor(
|
||||
AllPropertyVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
@@ -329,7 +329,7 @@ class KotlinValueParameterNameShrinkerTest : FreeSpec({
|
||||
clazz.kotlinMetadataAccept(KotlinValueParameterNameShrinker())
|
||||
|
||||
clazz.kotlinMetadataAccept(
|
||||
AllKotlinPropertiesVisitor(
|
||||
AllPropertyVisitor(
|
||||
AllValueParameterVisitor(
|
||||
valueParameterVisitor
|
||||
)
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
## Version 7.2-beta1
|
||||
|
||||
### Java Support
|
||||
|
||||
New Java versions are released every 6 months.
|
||||
To allow ProGuard to continue to optimize, obfuscate and shrink Java class files ProGuard now supports all Java versions including Java 17.
|
||||
|
||||
- Add support for Java 17. (`PGD-132`)
|
||||
|
||||
|
||||
### Kotlin Support
|
||||
|
||||
New Kotlin versions are released every 6 months.
|
||||
To allow ProGuard to continue to optimize, obfuscate and shrink Kotlin generated class files and their corresponding metadata ProGuard now supports Kotlin reading Kotlin classes from version 1.0 to 1.5 and writing Kotlin metadata with version 1.4 (readable by Kotlin reflection library / compiler 1.3 - 1.5).
|
||||
|
||||
- Add support for processing Kotlin 1.5 metadata. (`T5036`)
|
||||
|
||||
## Version 7.1.1
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
@@ -48,11 +48,11 @@ dependencies {
|
||||
exclude module: 'proguard-gradle'
|
||||
exclude module: 'proguard-base'
|
||||
}
|
||||
testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.4.3' // for kotest framework
|
||||
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.4.3' // for kotest core jvm assertions
|
||||
testImplementation 'io.kotest:kotest-property-jvm:4.4.3' // for kotest property test
|
||||
testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.6.0' // for kotest framework
|
||||
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.6.0' // for kotest core jvm assertions
|
||||
testImplementation 'io.kotest:kotest-property-jvm:4.6.0' // for kotest property test
|
||||
|
||||
testImplementation "io.mockk:mockk:1.9.3"
|
||||
testImplementation "io.mockk:mockk:1.12.0"
|
||||
testImplementation "commons-io:commons-io:2.8.0"
|
||||
|
||||
fatJar project(":base")
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
proguardVersion = 7.2.0-beta1
|
||||
|
||||
# The version of ProGuardCORE that sub-projects are built with
|
||||
proguardCoreVersion = 7.1.1
|
||||
proguardCoreVersion = 8.0.0
|
||||
gsonVersion = 2.8.5
|
||||
kotlinVersion = 1.3.72
|
||||
kotlinxMetadataVersion = 0.1.0
|
||||
kotlinVersion = 1.5.20
|
||||
kotlinxMetadataVersion = 0.2.0
|
||||
target = 1.8
|
||||
|
||||
# Optionally compile the WTK plugin.
|
||||
|
||||
Reference in New Issue
Block a user