Skip to content

Commit 8ee5b75

Browse files
authored
chore: Merge branch dev to main (#317)
2 parents c45ed69 + 9476f5a commit 8ee5b75

File tree

3 files changed

+35
-31
lines changed

3 files changed

+35
-31
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# [4.5.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0-dev.1) (2024-03-11)
2+
3+
4+
### Bug Fixes
5+
6+
* Show path for missing files instead of just the name ([f0f3e56](https://github.com/ReVanced/revanced-cli/commit/f0f3e5614b99b34391e0492177706f9c09781cad))
7+
* Sign APKs correctly ([5ff105c](https://github.com/ReVanced/revanced-cli/commit/5ff105cf6b3fac9cd12478efd10caf90d1ecf589))
8+
9+
10+
### Features
11+
12+
* Remove deprecated CLI options ([48a1a39](https://github.com/ReVanced/revanced-cli/commit/48a1a39b94dd9121c400d28e3e93dec3fc13e3be))
13+
114
## [4.4.2](https://github.com/ReVanced/revanced-cli/compare/v4.4.1...v4.4.2) (2024-03-10)
215

316
## [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)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.parallel = true
22
org.gradle.caching = true
33
kotlin.code.style = official
4-
version = 4.4.2
4+
version = 4.5.0-dev.1

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

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,6 @@ internal object PatchCommand : Runnable {
142142
)
143143
private var signer = "ReVanced"
144144

145-
@CommandLine.Option(
146-
names = ["-r", "--resource-cache"],
147-
description = ["Path to temporary resource cache directory."],
148-
)
149-
private var resourceCachePath: File? = null
150-
set(value) {
151-
logger.warning("The --resource-cache option is deprecated. Use --temporary-files-patch instead.")
152-
field = value
153-
temporaryFilesPath = value
154-
}
155-
156145
@CommandLine.Option(
157146
names = ["-t", "--temporary-files-path"],
158147
description = ["Path to temporary files directory."],
@@ -184,7 +173,7 @@ internal object PatchCommand : Runnable {
184173
if (!apk.exists()) {
185174
throw CommandLine.ParameterException(
186175
spec.commandLine(),
187-
"APK file ${apk.name} does not exist",
176+
"APK file ${apk.path} does not exist",
188177
)
189178
}
190179
this.apk = apk
@@ -197,7 +186,7 @@ internal object PatchCommand : Runnable {
197186
@Suppress("unused")
198187
private fun setIntegrations(integrations: Array<File>) {
199188
integrations.firstOrNull { !it.exists() }?.let {
200-
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist.")
189+
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.path} does not exist.")
201190
}
202191
this.integrations += integrations
203192
}
@@ -273,12 +262,13 @@ internal object PatchCommand : Runnable {
273262
}
274263

275264
// endregion
265+
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
276266
val (packageName, patcherResult) = Patcher(
277267
PatcherConfig(
278268
apk,
279-
temporaryFilesPath,
269+
patcherTemporaryFilesPath,
280270
aaptBinaryPath?.path,
281-
temporaryFilesPath.absolutePath,
271+
patcherTemporaryFilesPath.absolutePath,
282272
true,
283273
),
284274
).use { patcher ->
@@ -315,21 +305,22 @@ internal object PatchCommand : Runnable {
315305
}
316306

317307
// region Save
318-
319-
apk.copyTo(outputFilePath, overwrite = true)
320-
321-
patcherResult.applyTo(outputFilePath)
322-
323-
if (!mount) {
324-
outputFilePath.sign(
325-
ApkUtils.SigningOptions(
326-
keystoreFilePath,
327-
keyStorePassword,
328-
alias,
329-
password,
330-
signer,
331-
),
332-
)
308+
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
309+
patcherResult.applyTo(this)
310+
}.let {
311+
if (!mount) {
312+
sign(
313+
it,
314+
outputFilePath,
315+
ApkUtils.SigningOptions(
316+
keystoreFilePath,
317+
keyStorePassword,
318+
alias,
319+
password,
320+
signer,
321+
),
322+
)
323+
}
333324
}
334325

335326
logger.info("Saved to $outputFilePath")

0 commit comments

Comments
 (0)