From 32e645850d4cc74aa708984da03ae1606e696d20 Mon Sep 17 00:00:00 2001 From: Lucaskyy Date: Sat, 9 Apr 2022 20:33:22 +0200 Subject: [PATCH] refactor: bump multidexlib2 to 2.5.2.r2 BREAKING CHANGE: Method signature of Patcher#save() was changed to comply with the changes of multidexlib2. --- build.gradle.kts | 6 +++++- src/main/kotlin/app/revanced/patcher/Patcher.kt | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e678d1d..65c65d6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,6 +12,10 @@ repositories { maven { url = uri("https://maven.pkg.github.com/ReVancedTeam/multidexlib2") credentials { + // DO NOT set these variables in the project's gradle.properties. + // Instead, you should set them in: + // Windows: %homepath%\.gradle\gradle.properties + // Linux: ~/.gradle/gradle.properties username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") // DO NOT CHANGE! password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") // DO NOT CHANGE! } @@ -21,7 +25,7 @@ repositories { dependencies { implementation(kotlin("stdlib")) - implementation("app.revanced:multidexlib2:2.5.2") + implementation("app.revanced:multidexlib2:2.5.2.r2") @Suppress("GradlePackageUpdate") implementation("org.smali:smali:2.5.2") diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index d3b8910..533f89f 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -56,7 +56,7 @@ class Patcher( /** * Save the patched dex file. */ - fun save(): List { + fun save(): Map { val newDexFile = object : DexFile { override fun getClasses(): Set { // this is a slow workaround for now @@ -76,14 +76,14 @@ class Patcher( } } - val list = mutableListOf() + val output = mutableMapOf() MultiDexIO.writeDexFile( true, -1, // core count - list, NAMER, newDexFile, + output, NAMER, newDexFile, DexIO.DEFAULT_MAX_DEX_POOL_SIZE, null ) - return list + return output } /**