Update libsu

This commit is contained in:
topjohnwu
2022-05-03 01:25:26 -07:00
parent ff340ce3d8
commit cc79a96fa3
13 changed files with 63 additions and 66 deletions
@@ -21,14 +21,13 @@ import com.topjohnwu.magisk.databinding.set
import com.topjohnwu.magisk.events.SnackbarEvent
import com.topjohnwu.magisk.ktx.*
import com.topjohnwu.superuser.CallbackList
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class FlashViewModel : BaseViewModel() {
@get:Bindable
var showReboot = Shell.rootAccess()
var showReboot = Info.isRooted
set(value) = set(value, field, { field = it }, BR.showReboot)
private val _subtitle = MutableLiveData(R.string.flashing)
@@ -6,11 +6,11 @@ import android.widget.ImageView
import android.widget.TextView
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.arch.BaseFragment
import com.topjohnwu.magisk.core.Info
import com.topjohnwu.magisk.core.download.DownloadService
import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding
import com.topjohnwu.magisk.di.viewModel
import com.topjohnwu.magisk.events.RebootEvent
import com.topjohnwu.superuser.Shell
class HomeFragment : BaseFragment<FragmentHomeMd2Binding>() {
@@ -56,7 +56,7 @@ class HomeFragment : BaseFragment<FragmentHomeMd2Binding>() {
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.menu_home_md2, menu)
if (!Shell.rootAccess())
if (!Info.isRooted)
menu.removeItem(R.id.action_reboot)
}
@@ -18,7 +18,6 @@ import com.topjohnwu.magisk.di.ServiceLocator
import com.topjohnwu.magisk.events.MagiskInstallFileEvent
import com.topjohnwu.magisk.events.dialog.SecondSlotWarningDialog
import com.topjohnwu.magisk.ui.flash.FlashFragment
import com.topjohnwu.superuser.Shell
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import timber.log.Timber
@@ -29,7 +28,7 @@ class InstallViewModel(
svc: NetworkService
) : BaseViewModel() {
val isRooted = Shell.rootAccess()
val isRooted get() = Info.isRooted
val hideVbmeta = Info.vbmeta || Info.isSamsung || Info.isAB
val skipOptions = Info.isEmulator || (Info.isSAR && !Info.isFDE && hideVbmeta && Info.ramdisk)
val noSecondSlot = !isRooted || !Info.isAB || Info.isEmulator