From 649f06b19dd4d2a3f3216a0b3ea947b9fe0d475f Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 11 Nov 2024 23:29:43 +0100 Subject: [PATCH] fix: Detect if app is installed by fixing inversion --- .../revanced/library/installation/installer/RootInstaller.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commonMain/kotlin/app/revanced/library/installation/installer/RootInstaller.kt b/src/commonMain/kotlin/app/revanced/library/installation/installer/RootInstaller.kt index 9fd4fac..2a3514a 100644 --- a/src/commonMain/kotlin/app/revanced/library/installation/installer/RootInstaller.kt +++ b/src/commonMain/kotlin/app/revanced/library/installation/installer/RootInstaller.kt @@ -122,13 +122,12 @@ abstract class RootInstaller internal constructor( * @throws FailedToFindInstalledPackageException If the package is not installed. */ private fun String.assertInstalled() { - if (INSTALLED_APK_PATH(this)().output.isNotEmpty()) { + if (INSTALLED_APK_PATH(this)().output.isEmpty()) { throw FailedToFindInstalledPackageException(this) } } - internal class FailedToFindInstalledPackageException internal constructor(packageName: String) : - Exception("Failed to find installed package \"$packageName\" because no activity was found") + internal class FailedToFindInstalledPackageException internal constructor(packageName: String) : Exception("Failed to find installed package \"$packageName\" because no activity was found") internal class PackageNameRequiredException internal constructor() : Exception("Package name is required") internal class NoRootPermissionException internal constructor() : Exception("No root permission")