Skip to content

Commit 3984c8a

Browse files
committed
perf: --rip-lib and --unsigned
1 parent 63b6350 commit 3984c8a

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

build.gradle.kts

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ repositories {
2525
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
2626
}
2727
}
28+
maven {
29+
// A repository must be speficied for some reason. "registry" is a dummy.
30+
url = uri("https://maven.pkg.github.com/E85Addict/registry")
31+
credentials {
32+
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
33+
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
34+
}
35+
}
2836
}
2937

3038
dependencies {
@@ -63,6 +71,7 @@ tasks {
6371
exclude(dependency("org.jetbrains.kotlin:.*"))
6472
exclude(dependency("org.bouncycastle:.*"))
6573
exclude(dependency("app.revanced:.*"))
74+
exclude(dependency("e85.app.revanced:.*"))
6675
}
6776
}
6877

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotl
1111
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx" }
1212
picocli = { module = "info.picocli:picocli", version.ref = "picocli" }
1313
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
14-
revanced-library = { module = "app.revanced:revanced-library-jvm", version.ref = "revanced-library" }
14+
revanced-library = { module = "e85.app.revanced:revanced-library-jvm", version.ref = "revanced-library" }
1515

1616
[plugins]
1717
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }

src/main/kotlin/app/revanced/cli/command/PatchCommand.kt

+13-2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ internal object PatchCommand : Runnable {
174174

175175
private var aaptBinaryPath: File? = null
176176

177+
@CommandLine.Option(
178+
names = ["--unsigned"],
179+
description = ["Disable signing of the final apk."],
180+
)
181+
private var unsigned: Boolean = false
182+
@CommandLine.Option(
183+
names = ["--rip-lib"],
184+
description = ["Rip native libs from APK (x86_64 etc.)"],
185+
)
186+
private var ripLibs = arrayOf<String>()
187+
177188
@CommandLine.Option(
178189
names = ["--purge"],
179190
description = ["Purge temporary files directory after patching."],
@@ -330,9 +341,9 @@ internal object PatchCommand : Runnable {
330341
// region Save.
331342

332343
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
333-
patcherResult.applyTo(this)
344+
patcherResult.applyTo(this, ripLibs)
334345
}.let { patchedApkFile ->
335-
if (!mount) {
346+
if (!mount && !unsigned) {
336347
ApkUtils.signApk(
337348
patchedApkFile,
338349
outputFilePath,

0 commit comments

Comments
 (0)