Skip to content

Commit

Permalink
fix: Detect if app is installed by fixing inversion
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Nov 11, 2024
1 parent cace517 commit 649f06b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 649f06b

Please sign in to comment.