Skip to content

Commit b065ef4

Browse files
committed
feat: improve (un)install stdout logging
- handle {Root,Adb}InstallerResult in InstallCommand & UninstallCommand. this is a non-functional change, only aiming to improve the logged feedback to the user - fixes #362
1 parent 1717cc6 commit b065ef4

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/main/kotlin/app/revanced/cli/command/utility/InstallCommand.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,19 @@ internal object InstallCommand : Runnable {
4444
}.install(Installer.Apk(apk, packageName))
4545
} catch (e: Exception) {
4646
logger.severe(e.toString())
47+
return
4748
}
4849

4950
when (result) {
51+
RootInstallerResult.SUCCESS ->
52+
logger.info("Mounted the APK file")
5053
RootInstallerResult.FAILURE ->
5154
logger.severe("Failed to mount the APK file")
55+
AdbInstallerResult.Success ->
56+
logger.info("Installed the APK file")
5257
is AdbInstallerResult.Failure ->
5358
logger.severe(result.exception.toString())
54-
else ->
55-
logger.info("Installed the APK file")
59+
else -> logger.severe("Unknown installation result")
5660
}
5761
}
5862

src/main/kotlin/app/revanced/cli/command/utility/UninstallCommand.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ internal object UninstallCommand : Runnable {
4848
}.uninstall(packageName)
4949
} catch (e: Exception) {
5050
logger.severe(e.toString())
51+
return
5152
}
5253

5354
when (result) {
55+
RootInstallerResult.SUCCESS ->
56+
logger.info("Unmounted the patched APK file")
5457
RootInstallerResult.FAILURE ->
5558
logger.severe("Failed to unmount the patched APK file")
59+
AdbInstallerResult.Success ->
60+
logger.info("Uninstalled the patched APK file")
5661
is AdbInstallerResult.Failure ->
5762
logger.severe(result.exception.toString())
58-
else -> logger.info("Uninstalled the patched APK file")
63+
else -> logger.severe("Unknown uninstallation result")
5964
}
6065
}
6166

0 commit comments

Comments
 (0)