mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-04 01:12:54 +01:00
fix: Sign APKs correctly
This commit is contained in:
parent
f0f3e5614b
commit
5ff105cf6b
@ -262,12 +262,13 @@ internal object PatchCommand : Runnable {
|
||||
}
|
||||
|
||||
// endregion
|
||||
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
|
||||
val (packageName, patcherResult) = Patcher(
|
||||
PatcherConfig(
|
||||
apk,
|
||||
temporaryFilesPath,
|
||||
patcherTemporaryFilesPath,
|
||||
aaptBinaryPath?.path,
|
||||
temporaryFilesPath.absolutePath,
|
||||
patcherTemporaryFilesPath.absolutePath,
|
||||
true,
|
||||
),
|
||||
).use { patcher ->
|
||||
@ -304,21 +305,22 @@ internal object PatchCommand : Runnable {
|
||||
}
|
||||
|
||||
// region Save
|
||||
|
||||
apk.copyTo(outputFilePath, overwrite = true)
|
||||
|
||||
patcherResult.applyTo(outputFilePath)
|
||||
|
||||
if (!mount) {
|
||||
outputFilePath.sign(
|
||||
ApkUtils.SigningOptions(
|
||||
keystoreFilePath,
|
||||
keyStorePassword,
|
||||
alias,
|
||||
password,
|
||||
signer,
|
||||
),
|
||||
)
|
||||
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
|
||||
patcherResult.applyTo(this)
|
||||
}.let {
|
||||
if (!mount) {
|
||||
sign(
|
||||
it,
|
||||
outputFilePath,
|
||||
ApkUtils.SigningOptions(
|
||||
keystoreFilePath,
|
||||
keyStorePassword,
|
||||
alias,
|
||||
password,
|
||||
signer,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("Saved to $outputFilePath")
|
||||
|
Loading…
Reference in New Issue
Block a user