Skip to content

Commit

Permalink
chore: Merge branch dev to main (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX authored Mar 11, 2024
2 parents c45ed69 + 9476f5a commit 8ee5b75
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# [4.5.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0-dev.1) (2024-03-11)


### Bug Fixes

* Show path for missing files instead of just the name ([f0f3e56](https://github.com/ReVanced/revanced-cli/commit/f0f3e5614b99b34391e0492177706f9c09781cad))
* Sign APKs correctly ([5ff105c](https://github.com/ReVanced/revanced-cli/commit/5ff105cf6b3fac9cd12478efd10caf90d1ecf589))


### Features

* Remove deprecated CLI options ([48a1a39](https://github.com/ReVanced/revanced-cli/commit/48a1a39b94dd9121c400d28e3e93dec3fc13e3be))

## [4.4.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2) (2024-03-10)

## [4.4.2-dev.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.2-dev.1...v4.4.2-dev.2) (2024-03-10)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 4.4.2
version = 4.5.0-dev.1
51 changes: 21 additions & 30 deletions src/main/kotlin/app/revanced/cli/command/PatchCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,6 @@ internal object PatchCommand : Runnable {
)
private var signer = "ReVanced"

@CommandLine.Option(
names = ["-r", "--resource-cache"],
description = ["Path to temporary resource cache directory."],
)
private var resourceCachePath: File? = null
set(value) {
logger.warning("The --resource-cache option is deprecated. Use --temporary-files-patch instead.")
field = value
temporaryFilesPath = value
}

@CommandLine.Option(
names = ["-t", "--temporary-files-path"],
description = ["Path to temporary files directory."],
Expand Down Expand Up @@ -184,7 +173,7 @@ internal object PatchCommand : Runnable {
if (!apk.exists()) {
throw CommandLine.ParameterException(
spec.commandLine(),
"APK file ${apk.name} does not exist",
"APK file ${apk.path} does not exist",
)
}
this.apk = apk
Expand All @@ -197,7 +186,7 @@ internal object PatchCommand : Runnable {
@Suppress("unused")
private fun setIntegrations(integrations: Array<File>) {
integrations.firstOrNull { !it.exists() }?.let {
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist.")
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.path} does not exist.")
}
this.integrations += integrations
}
Expand Down Expand Up @@ -273,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 ->
Expand Down Expand Up @@ -315,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")
Expand Down

0 comments on commit 8ee5b75

Please sign in to comment.