diff --git a/app/src/main/java/com/topjohnwu/magisk/core/tasks/HideAPK.kt b/app/src/main/java/com/topjohnwu/magisk/core/tasks/HideAPK.kt index 43ede587e..689731623 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/tasks/HideAPK.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/tasks/HideAPK.kt @@ -106,7 +106,9 @@ object HideAPK { svc.fetchFile(Info.remote.stub.link).byteStream().writeTo(stub) } catch (e: IOException) { Timber.e(e) - return false + stub.createNewFile() + val cmd = "\$MAGISKBIN/magiskinit -x manager ${stub.path}" + if (!Shell.su(cmd).exec().isSuccess) return false } // Generate a new random package name and signature diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt index bdc0697aa..ca9f5b4e4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt @@ -100,10 +100,6 @@ object Hide : BaseSettingsItem.Input() { override fun getView(context: Context) = DialogSettingsAppNameBinding .inflate(LayoutInflater.from(context)).also { it.data = this }.root - - override fun refresh() { - isEnabled = Info.remote.stub.versionCode > 0 - } } object Restore : BaseSettingsItem.Blank() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt index a6be14181..92b344295 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt @@ -56,10 +56,7 @@ class SettingsViewModel : BaseViewModel(), BaseSettingsItem.Callback { )) if (Info.env.isActive) { if (Const.USER_ID == 0) { - if (hidden) - list.add(Restore) - else if (Info.isConnected.get()) - list.add(Hide) + if (hidden) list.add(Restore) else list.add(Hide) } }