Skip to content

Commit 620876f

Browse files
committed
feat: Allow to only Sign the APK
1 parent 63b6350 commit 620876f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

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

+25-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ internal object PatchCommand : Runnable {
9090
}
9191
}
9292

93+
@CommandLine(
94+
names = ["-os", "--only-sign"],
95+
description = ["Only Sign the APK, without doing patches."],
96+
showDefaultValue = ALWAYS,
97+
)
98+
private var onlySign: Boolean = false
99+
93100
@CommandLine.Option(
94101
names = ["--exclusive"],
95102
description = ["Disable all patches except the ones enabled."],
@@ -273,7 +280,9 @@ internal object PatchCommand : Runnable {
273280
null
274281
}
275282

276-
// endregion
283+
if (!onlySign)
284+
{
285+
// endregion
277286

278287
// region Load patches
279288

@@ -348,6 +357,21 @@ internal object PatchCommand : Runnable {
348357
patchedApkFile.copyTo(outputFilePath, overwrite = true)
349358
}
350359
}
360+
}
361+
else
362+
{
363+
ApkUtils.signApk(
364+
apk,
365+
outputFilePath,
366+
signer,
367+
ApkUtils.KeyStoreDetails(
368+
keystoreFilePath,
369+
keyStorePassword,
370+
keyStoreEntryAlias,
371+
keyStoreEntryPassword,
372+
),
373+
)
374+
}
351375

352376
logger.info("Saved to $outputFilePath")
353377

0 commit comments

Comments
 (0)