mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-29 22:21:06 +00:00
refactor
This commit is contained in:
@@ -292,7 +292,7 @@ internal object PatchCommand : Runnable {
|
|||||||
|
|
||||||
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
|
val patcherTemporaryFilesPath = temporaryFilesPath.resolve("patcher")
|
||||||
|
|
||||||
lateinit var capturedPackageName: String
|
lateinit var _packageName: String
|
||||||
|
|
||||||
val patch = patcher(
|
val patch = patcher(
|
||||||
apk,
|
apk,
|
||||||
@@ -300,7 +300,7 @@ internal object PatchCommand : Runnable {
|
|||||||
aaptBinaryPath,
|
aaptBinaryPath,
|
||||||
patcherTemporaryFilesPath.absolutePath,
|
patcherTemporaryFilesPath.absolutePath,
|
||||||
) { packageName, versionName ->
|
) { packageName, versionName ->
|
||||||
capturedPackageName = packageName
|
_packageName = packageName
|
||||||
|
|
||||||
val filteredPatches = patches.filterPatchSelection(packageName, versionName)
|
val filteredPatches = patches.filterPatchSelection(packageName, versionName)
|
||||||
|
|
||||||
@@ -359,7 +359,7 @@ internal object PatchCommand : Runnable {
|
|||||||
|
|
||||||
installation?.deviceSerial?.let {
|
installation?.deviceSerial?.let {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
when (val result = installer!!.install(Installer.Apk(outputFilePath, capturedPackageName))) {
|
when (val result = installer!!.install(Installer.Apk(outputFilePath, _packageName))) {
|
||||||
RootInstallerResult.FAILURE -> logger.severe("Failed to mount the patched APK file")
|
RootInstallerResult.FAILURE -> logger.severe("Failed to mount the patched APK file")
|
||||||
is AdbInstallerResult.Failure -> logger.severe(result.exception.toString())
|
is AdbInstallerResult.Failure -> logger.severe(result.exception.toString())
|
||||||
else -> logger.info("Installed the patched APK file")
|
else -> logger.info("Installed the patched APK file")
|
||||||
|
|||||||
Reference in New Issue
Block a user