Skip to content

Commit

Permalink
refactor: bump multidexlib2 to 2.5.2.r2
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Method signature of Patcher#save() was changed to comply with the changes of multidexlib2.
  • Loading branch information
Sculas committed Apr 9, 2022
1 parent e45fc02 commit 32e6458
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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!
}
Expand All @@ -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")

Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/app/revanced/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Patcher(
/**
* Save the patched dex file.
*/
fun save(): List<MemoryDataStore> {
fun save(): Map<String, MemoryDataStore> {
val newDexFile = object : DexFile {
override fun getClasses(): Set<ClassDef> {
// this is a slow workaround for now
Expand All @@ -76,14 +76,14 @@ class Patcher(
}
}

val list = mutableListOf<MemoryDataStore>()
val output = mutableMapOf<String, MemoryDataStore>()
MultiDexIO.writeDexFile(
true, -1, // core count
list, NAMER, newDexFile,
output, NAMER, newDexFile,
DexIO.DEFAULT_MAX_DEX_POOL_SIZE,
null
)
return list
return output
}

/**
Expand Down

0 comments on commit 32e6458

Please sign in to comment.