mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-10 21:36:17 +00:00
fix: Detect if app is installed by fixing inversion
This commit is contained in:
@@ -122,13 +122,12 @@ abstract class RootInstaller internal constructor(
|
|||||||
* @throws FailedToFindInstalledPackageException If the package is not installed.
|
* @throws FailedToFindInstalledPackageException If the package is not installed.
|
||||||
*/
|
*/
|
||||||
private fun String.assertInstalled() {
|
private fun String.assertInstalled() {
|
||||||
if (INSTALLED_APK_PATH(this)().output.isNotEmpty()) {
|
if (INSTALLED_APK_PATH(this)().output.isEmpty()) {
|
||||||
throw FailedToFindInstalledPackageException(this)
|
throw FailedToFindInstalledPackageException(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) :
|
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) : Exception("Failed to find installed package \"$packageName\" because no activity was found")
|
||||||
Exception("Failed to find installed package \"$packageName\" because no activity was found")
|
|
||||||
|
|
||||||
internal class PackageNameRequiredException internal constructor() : Exception("Package name is required")
|
internal class PackageNameRequiredException internal constructor() : Exception("Package name is required")
|
||||||
internal class NoRootPermissionException internal constructor() : Exception("No root permission")
|
internal class NoRootPermissionException internal constructor() : Exception("No root permission")
|
||||||
|
|||||||
Reference in New Issue
Block a user