fix: Sign APKs correctly

This commit is contained in:
oSumAtrIX 2024-03-11 10:05:32 +01:00
parent f0f3e5614b
commit 5ff105cf6b
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -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,13 +305,13 @@ internal object PatchCommand : Runnable {
}
// region Save
apk.copyTo(outputFilePath, overwrite = true)
patcherResult.applyTo(outputFilePath)
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
patcherResult.applyTo(this)
}.let {
if (!mount) {
outputFilePath.sign(
sign(
it,
outputFilePath,
ApkUtils.SigningOptions(
keystoreFilePath,
keyStorePassword,
@ -320,6 +321,7 @@ internal object PatchCommand : Runnable {
),
)
}
}
logger.info("Saved to $outputFilePath")