From 0293eb5c5189432e37c8a671681e9cac323ce4ae Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 8 Jun 2019 01:44:02 -0700 Subject: [PATCH] Never refetch magisk version dynamically --- .../data/repository/MagiskRepository.kt | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt b/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt index 7987091d5..146b5f291 100644 --- a/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt @@ -63,16 +63,6 @@ class MagiskRepository( Config.uninstallerLink = it.uninstaller.link } - - fun fetchMagiskVersion(): Single = Single.zip( - fetchMagiskVersionName(), - fetchMagiskVersionCode(), - BiFunction { versionName, versionCode -> - Version(versionName, versionCode) - } - ) - - fun fetchApps() = Single.fromCallable { packageManager.getInstalledApplications(0) } .flattenAsFlowable { it } @@ -91,16 +81,6 @@ class MagiskRepository( .map { HideTarget(it) } .toList() - private fun fetchMagiskVersionName() = "magisk -v".suRaw() - .map { it.first() } - .map { it.substring(0 until it.indexOf(":")) } - .onErrorReturn { "Unknown" } - - private fun fetchMagiskVersionCode() = "magisk -V".suRaw() - .map { it.first() } - .map { it.toIntOrNull() ?: -1 } - .onErrorReturn { -1 } - fun toggleHide(isEnabled: Boolean, packageName: String, process: String) = "magiskhide --%s %s %s".format(isEnabled.state, packageName, process).su().ignoreElement()