mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-04-30 22:54:27 +02:00

This commit removes the subproject ReVanced Library and moves it to another repository. A monorepo turned out to be difficult to work with.
36 lines
1.2 KiB
Kotlin
36 lines
1.2 KiB
Kotlin
package app.revanced.cli.command.utility
|
|
|
|
import app.revanced.library.adb.AdbManager
|
|
import picocli.CommandLine.*
|
|
import picocli.CommandLine.Help.Visibility.ALWAYS
|
|
import java.util.logging.Logger
|
|
|
|
|
|
@Command(
|
|
name = "uninstall",
|
|
description = ["Uninstall a patched app from the devices with the supplied ADB device serials"]
|
|
)
|
|
internal object UninstallCommand : Runnable {
|
|
private val logger = Logger.getLogger(UninstallCommand::class.java.name)
|
|
|
|
@Parameters(description = ["ADB device serials"], arity = "1..*")
|
|
private lateinit var deviceSerials: Array<String>
|
|
|
|
@Option(names = ["-p", "--package-name"], description = ["Package name of the app to uninstall"], required = true)
|
|
private lateinit var packageName: String
|
|
|
|
@Option(
|
|
names = ["-u", "--unmount"],
|
|
description = ["Uninstall by unmounting the patched APK file"],
|
|
showDefaultValue = ALWAYS
|
|
)
|
|
private var unmount: Boolean = false
|
|
|
|
override fun run() = deviceSerials.forEach { deviceSerial ->
|
|
try {
|
|
AdbManager.getAdbManager(deviceSerial, unmount).uninstall(packageName)
|
|
} catch (e: AdbManager.DeviceNotFoundException) {
|
|
logger.severe(e.toString())
|
|
}
|
|
}
|
|
} |