Compare commits

...

14 Commits
v7.7 ... v7.8

Author SHA1 Message Date
niccolo.piazzesi
869ce156b1 Update dependency, update samples, update release notes for 7.8 2025-10-07 13:34:28 +02:00
Fergal Whyte
124b33e473 Bump ProGuard to 7.8.0 and ProGuardCORE to 9.2.0 2025-10-07 13:34:16 +02:00
Robin Lefever
b8a62c8ca8 Bump Nexus publish plugin version 2025-08-25 11:53:54 +02:00
niccolo.piazzesi
886477806c Temporarily downgrade version in examples until release is properly done 2025-08-22 10:47:01 +02:00
Robin Lefever
7fc907d1fb Update ProGuardCORE version to support Kotlin 2.2 2025-08-22 06:48:58 +02:00
piazzesiNiccolo-GS
b10346ba32 Upgrade and cleanup ci configuration (#492) 2025-08-21 09:57:43 +02:00
Thomas Vochten
f2ced20be4 Fix ktlint issue in ClassUsageMarkerTest 2025-08-21 08:28:19 +02:00
huqiuser
35ea6d587f fix NullPointerException for Kotlin typealias of typealias of lambda (#490) 2025-08-20 16:25:40 +02:00
Eric Salemi
eea0ccbe8f Migrate to OSSRH staging API service 2025-08-20 08:18:34 +02:00
Joren Hannes
bee74a9963 Run kotlin linter 2025-08-13 14:56:39 +02:00
Oberon Swings
4b4aa93335 Fix retrace regex mentioned in the manual. 2025-08-13 14:56:37 +02:00
Nolij
4781f5898f Exclude annotation members from aggressive overloading (#453)
* Exclude annotation members from aggressive overloading
2025-08-11 09:15:43 +02:00
Jelle De Coninck
1f9a4a1b94 Remove AppSweep page from manual
Summary: Remove AppSweep page from manual and remove link from toolbar.
2025-06-13 15:52:18 +02:00
Blend Hamiti
40f9222bc3 Add mac finder files to gitignore 2025-05-02 16:28:52 +02:00
25 changed files with 136 additions and 43 deletions

View File

@@ -15,19 +15,21 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4
with:
path: proguard-main
- uses: actions/setup-java@v1
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 8
- uses: eskatos/gradle-command-action@v1
with:
build-root-directory: proguard-main/
wrapper-directory: proguard-main/
arguments: test :base:testAllJavaVersions :base:jacocoTestReport jar --info
- name: Setup gradle
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # version 4.4.2
- name: Test
run: ./gradlew test :base:testAllJavaVersions :base:jacocoTestReport jar --info
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3 # version 5.6.2
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ local.properties
/lib/
docs/html
.kotlin
.DS_Store

View File

@@ -108,7 +108,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.7.0'
classpath 'com.guardsquare:proguard-gradle:7.8.0'
}
}
```

View File

@@ -78,7 +78,8 @@ implements MemberVisitor
String descriptor = member.getDescriptor(clazz);
// Check whether we're allowed to do aggressive overloading
if (!allowAggressiveOverloading)
// Annotations are always excluded from aggressive overloading due to JVM limitations
if (!allowAggressiveOverloading || clazz.extendsOrImplements(ClassConstants.NAME_JAVA_LANG_ANNOTATION_ANNOTATION))
{
// Trim the return argument from the descriptor if not.
// Works for fields and methods alike.

View File

@@ -109,7 +109,8 @@ public class MemberNameConflictFixer implements MemberVisitor
String descriptor = member.getDescriptor(clazz);
// Check whether we're allowed to overload aggressively.
if (!allowAggressiveOverloading)
// Annotations are always excluded from aggressive overloading due to JVM limitations
if (!allowAggressiveOverloading || clazz.extendsOrImplements(ClassConstants.NAME_JAVA_LANG_ANNOTATION_ANNOTATION))
{
// Trim the return argument from the descriptor if not.
// Works for fields and methods alike.

View File

@@ -81,7 +81,8 @@ implements MemberVisitor
String descriptor = member.getDescriptor(clazz);
// Check whether we're allowed to overload aggressively.
if (!allowAggressiveOverloading)
// Annotations are always excluded from aggressive overloading due to JVM limitations
if (!allowAggressiveOverloading || clazz.extendsOrImplements(ClassConstants.NAME_JAVA_LANG_ANNOTATION_ANNOTATION))
{
// Trim the return argument from the descriptor if not.
// Works for fields and methods alike.

View File

@@ -1886,6 +1886,7 @@ implements ClassVisitor,
markAsUsed(kotlinPropertyMetadata.receiverType);
markAsUsed(kotlinPropertyMetadata.typeParameters);
markAsUsed(kotlinPropertyMetadata.setterParameters);
markAsUsed(kotlinPropertyMetadata.setterParameter);
markAsUsed(kotlinPropertyMetadata.type);
if (kotlinPropertyMetadata.flags.hasAnnotations &&
@@ -2068,7 +2069,10 @@ implements ClassVisitor,
else if (kotlinTypeMetadata.aliasName != null && !isUsed(kotlinTypeMetadata.referencedTypeAlias))
{
markAsUsed(kotlinTypeMetadata.referencedTypeAlias);
kotlinTypeMetadata.referencedTypeAlias.accept(null, null, this);
kotlinTypeMetadata.referencedTypeAlias.accept(
kotlinTypeMetadata.referencedTypeAlias.referencedDeclarationContainer.ownerReferencedClass,
kotlinTypeMetadata.referencedTypeAlias.referencedDeclarationContainer,
this);
}
markAsUsed(kotlinTypeMetadata.typeArguments);

View File

@@ -192,6 +192,7 @@ implements KotlinMetadataVisitor,
kotlinPropertyMetadata.setterSignature = null;
kotlinPropertyMetadata.referencedSetterMethod = null;
kotlinPropertyMetadata.flags.isVar = false;
kotlinPropertyMetadata.setterParameter = null;
kotlinPropertyMetadata.setterParameters.clear();
}

View File

@@ -0,0 +1,47 @@
package proguard.obfuscate
import io.kotest.core.spec.style.FreeSpec
import io.kotest.matchers.equals.shouldBeEqual
import proguard.classfile.ProgramClass
import proguard.testutils.ClassPoolBuilder
import proguard.testutils.JavaSource
import java.util.HashMap
class AnnotationTest : FreeSpec({
val (programClassPool, _) =
ClassPoolBuilder.fromSource(
JavaSource(
"Test.java",
"""
public @interface Test {
boolean testBoolean1() default false;
boolean testBoolean2() default true;
String testString1() default "";
}
""".trimIndent(),
),
)
val testClass = programClassPool.getClass("Test") as ProgramClass
"Annotation members should be excluded from aggressive overloading" {
val descriptorMap = HashMap<String, Map<String, String>>()
testClass.methodsAccept(
MemberObfuscator(
true,
SimpleNameFactory(),
descriptorMap,
),
)
descriptorMap shouldBeEqual
mapOf(
"()" to
mapOf(
"a" to "testBoolean1",
"b" to "testBoolean2",
"c" to "testString1",
),
)
}
})

View File

@@ -14,6 +14,8 @@ import proguard.classfile.Clazz
import proguard.classfile.Member
import proguard.classfile.attribute.annotation.visitor.AllElementValueVisitor
import proguard.classfile.attribute.visitor.AllAttributeVisitor
import proguard.classfile.kotlin.KotlinTypeAliasMetadata
import proguard.classfile.kotlin.visitor.AllTypeAliasVisitor
import proguard.classfile.kotlin.visitor.ReferencedKotlinMetadataVisitor
import proguard.classfile.util.EnumFieldReferenceInitializer
import proguard.classfile.visitor.AllMethodVisitor
@@ -266,4 +268,39 @@ class ClassUsageMarkerTest : StringSpec({
val fooInterface = programClassPool.getClass("test/Interface").findMethod("foo", null)
fooInterface should beMarkedWith(usageMarker)
}
"Given Kotlin `typealias` declarations where one aliases another" {
val (programClassPool, _) =
ClassPoolBuilder.fromSource(
KotlinSource(
"KotlinTypeAlias.kt",
"""
typealias P = () -> Unit
typealias A = P
""".trimIndent(),
),
kotlincArguments = listOf("-language-version=1.9"),
)
// Obtain the `typealias` declarations A and P
val typeAliasList = mutableListOf<KotlinTypeAliasMetadata>()
programClassPool.classesAccept(
ReferencedKotlinMetadataVisitor(
AllTypeAliasVisitor { _, _, kotlinTypeAliasMetadata ->
typeAliasList.add(kotlinTypeAliasMetadata)
},
),
)
// Ensure only `typealias` A and `typealias` P are present
typeAliasList.map { it.name }.toSet() shouldBe setOf("A", "P")
// Both `typealias` A and `typealias` P should be marked as used by usageMarker.
val usageMarker = SimpleUsageMarker()
val classUsageMarker = ClassUsageMarker(usageMarker)
programClassPool.classesAccept(classUsageMarker)
typeAliasList.forEach {
it should beMarkedWith(usageMarker)
}
}
})

View File

@@ -24,6 +24,7 @@ task buildDocumentation(type: Exec) {
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
username = findProperty('PROGUARD_STAGING_USERNAME')
password = findProperty('PROGUARD_STAGING_PASSWORD')
}

View File

@@ -1,4 +1,4 @@
Welcome to the manual for **ProGuard** version 7.7 ([what's new?](releasenotes.md)).
Welcome to the manual for **ProGuard** version 7.8.0 ([what's new?](releasenotes.md)).
ProGuard is an open-sourced Java class file shrinker, optimizer, obfuscator, and
preverifier. As a result, ProGuard processed applications and libraries are smaller and faster.

View File

@@ -1,3 +1,13 @@
## Version 7.8
### Kotlin support
- Add support for Kotlin 2.2.
### Java support
- Add support for Java 25. (#481)
## Version 7.7
### Java support

View File

@@ -1,8 +0,0 @@
# AppSweep
[AppSweep](https://appsweep.guardsquare.com/) is a free online app security testing tool that allows you to find and fix security
issues in your Android app's code and dependencies.
<center>
![](appsweep.png)
</center>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -51,7 +51,7 @@ The following options are supported:
de-obfuscate more general types of input than just stack traces. A relatively
simple expression like this works for basic stack trace formats:
(?:.*? at %c\.%m\(%s(?::%l)?\))|(?:(?:.*?[:"] +)?%c(?::.*)?)
(?:.*? at %c\.%m\(%s(?::%l)?\))|(?:(?:.*?[:\"] +)?%c(?::.*)?)
It for instance matches the following lines:

View File

@@ -91,7 +91,6 @@ nav:
- Tools:
- ReTrace: manual/tools/retrace.md
- Playground: manual/tools/playground.md
- AppSweep: manual/tools/appsweep.md
- Troubleshooting:
- Overview: manual/troubleshooting/troubleshooting.md
- Limitations: manual/troubleshooting/limitations.md

View File

@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.7.0'
classpath 'com.guardsquare:proguard-gradle:7.8.0'
}
}
@@ -31,16 +31,12 @@ test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
kotlin {
jvmToolchain(8)
}
application {
mainClass = 'AppKt'
mainClass.set('com.example.AppKt')
}
ext.baseCoordinates = "${project.name}-${project.version}"

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.7.0'
classpath 'com.guardsquare:proguard-gradle:7.8.0'
}
}

View File

@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath("com.guardsquare:proguard-gradle:7.7.0")
classpath("com.guardsquare:proguard-gradle:7.8.0")
}
}

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.7.0'
classpath 'com.guardsquare:proguard-gradle:7.8.0'
}
}

View File

@@ -1,9 +1,9 @@
proguardVersion = 7.7.0
proguardVersion = 7.8.0
# The version of ProGuardCORE that sub-projects are built with
proguardCoreVersion = 9.1.10
proguardCoreVersion = 9.2.0
gsonVersion = 2.11.0
kotlinVersion = 2.1.0
kotlinVersion = 2.2.0
target = 1.8
# Optionally compile the WTK plugin.

View File

@@ -5,7 +5,7 @@ pluginManagement {
useVersion '8.1.1'
}
if (requested.id.id == 'io.github.gradle-nexus.publish-plugin') {
useVersion '1.1.0'
useVersion '2.0.0'
}
}
}