mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 20:17:40 +00:00
Allow offline hide manager
This commit is contained in:
parent
591788c0df
commit
6635ea3e29
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user