Redesign is now the new norm

This commit is contained in:
topjohnwu 2020-01-13 00:43:09 +08:00
parent 1449486958
commit 3490ba0a56
90 changed files with 313 additions and 313 deletions

View File

@ -1,5 +1,5 @@
package a package a
import com.topjohnwu.magisk.redesign.MainActivity import com.topjohnwu.magisk.ui.MainActivity
class b : MainActivity() class b : MainActivity()

View File

@ -1,6 +1,6 @@
package a; package a;
import com.topjohnwu.magisk.ui.flash.FlashActivity; import com.topjohnwu.magisk.legacy.flash.FlashActivity;
public class f extends FlashActivity { public class f extends FlashActivity {
/* stub */ /* stub */

View File

@ -1,6 +1,6 @@
package a; package a;
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity; import com.topjohnwu.magisk.legacy.surequest.SuRequestActivity;
public class m extends SuRequestActivity { public class m extends SuRequestActivity {
/* stub */ /* stub */

View File

@ -13,7 +13,7 @@ import com.topjohnwu.magisk.di.Protected
import com.topjohnwu.magisk.extensions.get import com.topjohnwu.magisk.extensions.get
import com.topjohnwu.magisk.extensions.inject import com.topjohnwu.magisk.extensions.inject
import com.topjohnwu.magisk.model.preference.PreferenceModel import com.topjohnwu.magisk.model.preference.PreferenceModel
import com.topjohnwu.magisk.redesign.theme.Theme import com.topjohnwu.magisk.ui.theme.Theme
import com.topjohnwu.magisk.utils.BiometricHelper import com.topjohnwu.magisk.utils.BiometricHelper
import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.magisk.utils.Utils
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell

View File

@ -18,10 +18,10 @@ import com.topjohnwu.magisk.extensions.forceGetDeclaredField
import com.topjohnwu.magisk.model.download.DownloadService import com.topjohnwu.magisk.model.download.DownloadService
import com.topjohnwu.magisk.model.receiver.GeneralReceiver import com.topjohnwu.magisk.model.receiver.GeneralReceiver
import com.topjohnwu.magisk.model.update.UpdateCheckService import com.topjohnwu.magisk.model.update.UpdateCheckService
import com.topjohnwu.magisk.redesign.MainActivity import com.topjohnwu.magisk.ui.MainActivity
import com.topjohnwu.magisk.ui.SplashActivity import com.topjohnwu.magisk.ui.SplashActivity
import com.topjohnwu.magisk.ui.flash.FlashActivity import com.topjohnwu.magisk.legacy.flash.FlashActivity
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity import com.topjohnwu.magisk.legacy.surequest.SuRequestActivity
import com.topjohnwu.magisk.utils.refreshLocale import com.topjohnwu.magisk.utils.refreshLocale
import com.topjohnwu.magisk.utils.updateConfig import com.topjohnwu.magisk.utils.updateConfig

View File

@ -1,17 +1,17 @@
package com.topjohnwu.magisk.di package com.topjohnwu.magisk.di
import com.topjohnwu.magisk.redesign.MainViewModel import com.topjohnwu.magisk.ui.MainViewModel
import com.topjohnwu.magisk.redesign.flash.FlashViewModel import com.topjohnwu.magisk.ui.flash.FlashViewModel
import com.topjohnwu.magisk.redesign.hide.HideViewModel import com.topjohnwu.magisk.ui.hide.HideViewModel
import com.topjohnwu.magisk.redesign.home.HomeViewModel import com.topjohnwu.magisk.ui.home.HomeViewModel
import com.topjohnwu.magisk.redesign.install.InstallViewModel import com.topjohnwu.magisk.ui.install.InstallViewModel
import com.topjohnwu.magisk.redesign.log.LogViewModel import com.topjohnwu.magisk.ui.log.LogViewModel
import com.topjohnwu.magisk.redesign.module.ModuleViewModel import com.topjohnwu.magisk.ui.module.ModuleViewModel
import com.topjohnwu.magisk.redesign.request.RequestViewModel import com.topjohnwu.magisk.ui.request.RequestViewModel
import com.topjohnwu.magisk.redesign.safetynet.SafetynetViewModel import com.topjohnwu.magisk.ui.safetynet.SafetynetViewModel
import com.topjohnwu.magisk.redesign.settings.SettingsViewModel import com.topjohnwu.magisk.ui.settings.SettingsViewModel
import com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel import com.topjohnwu.magisk.ui.superuser.SuperuserViewModel
import com.topjohnwu.magisk.redesign.theme.ThemeViewModel import com.topjohnwu.magisk.ui.theme.ThemeViewModel
import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module import org.koin.dsl.module

View File

@ -1,8 +1,8 @@
package com.topjohnwu.magisk.di package com.topjohnwu.magisk.di
import android.net.Uri import android.net.Uri
import com.topjohnwu.magisk.ui.flash.FlashViewModel import com.topjohnwu.magisk.legacy.flash.FlashViewModel
import com.topjohnwu.magisk.ui.surequest.SuRequestViewModel import com.topjohnwu.magisk.legacy.surequest.SuRequestViewModel
import org.koin.androidx.viewmodel.dsl.viewModel import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module import org.koin.dsl.module

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.ui.flash package com.topjohnwu.magisk.legacy.flash
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent

View File

@ -0,0 +1,110 @@
package com.topjohnwu.magisk.legacy.flash
import android.Manifest.permission.READ_EXTERNAL_STORAGE
import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
import android.content.res.Resources
import android.net.Uri
import android.os.Handler
import androidx.core.os.postDelayed
import androidx.databinding.ObservableArrayList
import com.topjohnwu.magisk.BR
import com.topjohnwu.magisk.Config
import com.topjohnwu.magisk.Const
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.base.viewmodel.BaseViewModel
import com.topjohnwu.magisk.databinding.ComparableRvItem
import com.topjohnwu.magisk.extensions.*
import com.topjohnwu.magisk.model.entity.recycler.ConsoleRvItem
import com.topjohnwu.magisk.model.events.SnackbarEvent
import com.topjohnwu.magisk.model.flash.FlashResultListener
import com.topjohnwu.magisk.model.flash.Flashing
import com.topjohnwu.magisk.model.flash.Patching
import com.topjohnwu.magisk.utils.DiffObservableList
import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.superuser.Shell
import me.tatarka.bindingcollectionadapter2.ItemBinding
import java.io.File
import java.util.*
class FlashViewModel(
action: String,
installer: Uri,
uri: Uri,
private val resources: Resources
) : BaseViewModel(), FlashResultListener {
val canShowReboot = Shell.rootAccess()
val showRestartTitle = KObservableField(false)
val behaviorText = KObservableField(resources.getString(R.string.flashing))
val items = DiffObservableList(ComparableRvItem.callback)
val itemBinding = ItemBinding.of<ComparableRvItem<*>> { itemBinding, _, item ->
item.bind(itemBinding)
itemBinding.bindExtra(BR.viewModel, this@FlashViewModel)
}
private val outItems = ObservableArrayList<String>()
private val logItems = Collections.synchronizedList(mutableListOf<String>())
init {
outItems.sendUpdatesTo(items) { it.map { ConsoleRvItem(it) } }
outItems.copyNewInputInto(logItems)
state = State.LOADING
when (action) {
Const.Value.FLASH_ZIP -> Flashing
.Install(installer, outItems, logItems, this)
.exec()
Const.Value.UNINSTALL -> Flashing
.Uninstall(installer, outItems, logItems, this)
.exec()
Const.Value.FLASH_MAGISK -> Patching
.Direct(installer, outItems, logItems, this)
.exec()
Const.Value.FLASH_INACTIVE_SLOT -> Patching
.SecondSlot(installer, outItems, logItems, this)
.exec()
Const.Value.PATCH_FILE -> Patching
.File(installer, uri, outItems, logItems, this)
.exec()
}
}
override fun onResult(isSuccess: Boolean) {
state = if (isSuccess) State.LOADED else State.LOADING_FAILED
behaviorText.value = when {
isSuccess -> resources.getString(R.string.done)
else -> resources.getString(R.string.failure)
}
if (isSuccess) {
Handler().postDelayed(500) {
showRestartTitle.value = true
}
}
}
fun savePressed() = withPermissions(READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE)
.map { now }
.map { it.toTime(timeFormatStandard) }
.map { Const.MAGISK_INSTALL_LOG_FILENAME.format(it) }
.map { File(Config.downloadDirectory, it) }
.map { file ->
file.bufferedWriter().use { writer ->
logItems.forEach {
writer.write(it)
writer.newLine()
}
}
file.path
}
.subscribeK { SnackbarEvent(it).publish() }
.add()
fun restartPressed() = reboot()
fun backPressed() = back()
}

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.ui.surequest package com.topjohnwu.magisk.legacy.surequest
import android.content.Intent import android.content.Intent
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.ui.surequest package com.topjohnwu.magisk.legacy.surequest
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences

View File

@ -16,7 +16,7 @@ import com.topjohnwu.magisk.model.entity.internal.Configuration.*
import com.topjohnwu.magisk.model.entity.internal.Configuration.Flash.Secondary import com.topjohnwu.magisk.model.entity.internal.Configuration.Flash.Secondary
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.entity.internal.DownloadSubject
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.* import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.*
import com.topjohnwu.magisk.ui.flash.FlashActivity import com.topjohnwu.magisk.legacy.flash.FlashActivity
import com.topjohnwu.magisk.utils.APKInstall import com.topjohnwu.magisk.utils.APKInstall
import org.koin.core.get import org.koin.core.get
import java.io.File import java.io.File

View File

@ -10,7 +10,7 @@ import com.topjohnwu.magisk.extensions.toggle
import com.topjohnwu.magisk.model.entity.ProcessHideApp import com.topjohnwu.magisk.model.entity.ProcessHideApp
import com.topjohnwu.magisk.model.entity.StatefulProcess import com.topjohnwu.magisk.model.entity.StatefulProcess
import com.topjohnwu.magisk.model.observer.Observer import com.topjohnwu.magisk.model.observer.Observer
import com.topjohnwu.magisk.redesign.hide.HideViewModel import com.topjohnwu.magisk.ui.hide.HideViewModel
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import kotlin.math.roundToInt import kotlin.math.roundToInt

View File

@ -10,7 +10,7 @@ import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.databinding.ComparableRvItem
import com.topjohnwu.magisk.model.entity.module.Module import com.topjohnwu.magisk.model.entity.module.Module
import com.topjohnwu.magisk.model.entity.module.Repo import com.topjohnwu.magisk.model.entity.module.Repo
import com.topjohnwu.magisk.redesign.module.ModuleViewModel import com.topjohnwu.magisk.ui.module.ModuleViewModel
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
object SafeModeNotice : ComparableRvItem<SafeModeNotice>() { object SafeModeNotice : ComparableRvItem<SafeModeNotice>() {

View File

@ -6,7 +6,7 @@ import com.topjohnwu.magisk.databinding.ComparableRvItem
import com.topjohnwu.magisk.extensions.toggle import com.topjohnwu.magisk.extensions.toggle
import com.topjohnwu.magisk.model.entity.MagiskPolicy import com.topjohnwu.magisk.model.entity.MagiskPolicy
import com.topjohnwu.magisk.model.events.PolicyUpdateEvent import com.topjohnwu.magisk.model.events.PolicyUpdateEvent
import com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel import com.topjohnwu.magisk.ui.superuser.SuperuserViewModel
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
class PolicyItem(val item: MagiskPolicy, val icon: Drawable) : ComparableRvItem<PolicyItem>() { class PolicyItem(val item: MagiskPolicy, val icon: Drawable) : ComparableRvItem<PolicyItem>() {

View File

@ -2,7 +2,7 @@ package com.topjohnwu.magisk.model.entity.recycler
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.databinding.ComparableRvItem
import com.topjohnwu.magisk.redesign.theme.Theme import com.topjohnwu.magisk.ui.theme.Theme
class ThemeItem(val theme: Theme) : ComparableRvItem<ThemeItem>() { class ThemeItem(val theme: Theme) : ComparableRvItem<ThemeItem>() {

View File

@ -6,7 +6,7 @@ import android.content.Intent
import com.topjohnwu.magisk.Const import com.topjohnwu.magisk.Const
import com.topjohnwu.magisk.base.BaseActivity import com.topjohnwu.magisk.base.BaseActivity
import com.topjohnwu.magisk.intent import com.topjohnwu.magisk.intent
import com.topjohnwu.magisk.ui.flash.FlashActivity import com.topjohnwu.magisk.legacy.flash.FlashActivity
class InstallExternalModuleEvent : ViewEvent(), ActivityExecutor { class InstallExternalModuleEvent : ViewEvent(), ActivityExecutor {

View File

@ -7,7 +7,7 @@ import androidx.fragment.app.Fragment
import com.topjohnwu.magisk.base.BaseActivity import com.topjohnwu.magisk.base.BaseActivity
import com.topjohnwu.magisk.model.events.ActivityExecutor import com.topjohnwu.magisk.model.events.ActivityExecutor
import com.topjohnwu.magisk.model.events.ViewEvent import com.topjohnwu.magisk.model.events.ViewEvent
import com.topjohnwu.magisk.redesign.compat.CompatActivity import com.topjohnwu.magisk.ui.compat.CompatActivity
import kotlin.reflect.KClass import kotlin.reflect.KClass
@DslMarker @DslMarker

View File

@ -5,16 +5,16 @@ import android.content.Intent
import android.os.Build import android.os.Build
import com.topjohnwu.magisk.Const import com.topjohnwu.magisk.Const
import com.topjohnwu.magisk.intent import com.topjohnwu.magisk.intent
import com.topjohnwu.magisk.redesign.MainActivity import com.topjohnwu.magisk.ui.MainActivity
import com.topjohnwu.magisk.redesign.hide.HideFragment import com.topjohnwu.magisk.ui.hide.HideFragment
import com.topjohnwu.magisk.redesign.home.HomeFragment import com.topjohnwu.magisk.ui.home.HomeFragment
import com.topjohnwu.magisk.redesign.install.InstallFragment import com.topjohnwu.magisk.ui.install.InstallFragment
import com.topjohnwu.magisk.redesign.log.LogFragment import com.topjohnwu.magisk.ui.log.LogFragment
import com.topjohnwu.magisk.redesign.module.ModuleFragment import com.topjohnwu.magisk.ui.module.ModuleFragment
import com.topjohnwu.magisk.redesign.safetynet.SafetynetFragment import com.topjohnwu.magisk.ui.safetynet.SafetynetFragment
import com.topjohnwu.magisk.redesign.settings.SettingsFragment import com.topjohnwu.magisk.ui.settings.SettingsFragment
import com.topjohnwu.magisk.redesign.superuser.SuperuserFragment import com.topjohnwu.magisk.ui.superuser.SuperuserFragment
import com.topjohnwu.magisk.redesign.theme.ThemeFragment import com.topjohnwu.magisk.ui.theme.ThemeFragment
object Navigation { object Navigation {

View File

@ -1,5 +0,0 @@
package com.topjohnwu.magisk.redesign
import com.topjohnwu.magisk.redesign.compat.CompatViewModel
class MainViewModel : CompatViewModel()

View File

@ -1,5 +0,0 @@
package com.topjohnwu.magisk.redesign.flash
import com.topjohnwu.magisk.redesign.compat.CompatViewModel
class FlashViewModel : CompatViewModel()

View File

@ -1,5 +0,0 @@
package com.topjohnwu.magisk.redesign.request
import com.topjohnwu.magisk.redesign.compat.CompatViewModel
class RequestViewModel : CompatViewModel()

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign package com.topjohnwu.magisk.ui
import android.os.Bundle import android.os.Bundle
import android.view.MenuItem import android.view.MenuItem
@ -17,11 +17,11 @@ import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ActivityMainMd2Binding import com.topjohnwu.magisk.databinding.ActivityMainMd2Binding
import com.topjohnwu.magisk.extensions.startAnimations import com.topjohnwu.magisk.extensions.startAnimations
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.magisk.redesign.compat.CompatActivity import com.topjohnwu.magisk.ui.compat.CompatActivity
import com.topjohnwu.magisk.redesign.compat.CompatNavigationDelegate import com.topjohnwu.magisk.ui.compat.CompatNavigationDelegate
import com.topjohnwu.magisk.redesign.home.HomeFragment import com.topjohnwu.magisk.ui.home.HomeFragment
import com.topjohnwu.magisk.redesign.module.ModuleFragment import com.topjohnwu.magisk.ui.module.ModuleFragment
import com.topjohnwu.magisk.redesign.superuser.SuperuserFragment import com.topjohnwu.magisk.ui.superuser.SuperuserFragment
import com.topjohnwu.magisk.utils.HideBottomViewOnScrollBehavior import com.topjohnwu.magisk.utils.HideBottomViewOnScrollBehavior
import com.topjohnwu.magisk.utils.HideTopViewOnScrollBehavior import com.topjohnwu.magisk.utils.HideTopViewOnScrollBehavior
import com.topjohnwu.magisk.utils.HideableBehavior import com.topjohnwu.magisk.utils.HideableBehavior

View File

@ -0,0 +1,5 @@
package com.topjohnwu.magisk.ui
import com.topjohnwu.magisk.ui.compat.CompatViewModel
class MainViewModel : CompatViewModel()

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign package com.topjohnwu.magisk.ui
interface ReselectionTarget { interface ReselectionTarget {

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
@ -17,7 +17,7 @@ import com.topjohnwu.magisk.model.events.SnackbarEvent
import com.topjohnwu.magisk.model.events.ViewEvent import com.topjohnwu.magisk.model.events.ViewEvent
import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent
import com.topjohnwu.magisk.model.navigation.Navigator import com.topjohnwu.magisk.model.navigation.Navigator
import com.topjohnwu.magisk.redesign.theme.Theme import com.topjohnwu.magisk.ui.theme.Theme
import kotlin.reflect.KClass import kotlin.reflect.KClass

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import android.view.View import android.view.View
import androidx.core.graphics.Insets import androidx.core.graphics.Insets

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import androidx.databinding.ViewDataBinding import androidx.databinding.ViewDataBinding
import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.databinding.ComparableRvItem

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
@ -8,7 +8,7 @@ import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.model.navigation.MagiskAnimBuilder import com.topjohnwu.magisk.model.navigation.MagiskAnimBuilder
import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent
import com.topjohnwu.magisk.model.navigation.Navigator import com.topjohnwu.magisk.model.navigation.Navigator
import com.topjohnwu.magisk.redesign.ReselectionTarget import com.topjohnwu.magisk.ui.ReselectionTarget
import timber.log.Timber import timber.log.Timber
class CompatNavigationDelegate<out Source>( class CompatNavigationDelegate<out Source>(

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import android.view.View import android.view.View
import androidx.core.graphics.Insets import androidx.core.graphics.Insets

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import androidx.annotation.CallSuper import androidx.annotation.CallSuper
import androidx.core.graphics.Insets import androidx.core.graphics.Insets

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.compat package com.topjohnwu.magisk.ui.compat
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper

View File

@ -1,8 +1,8 @@
package com.topjohnwu.magisk.redesign.flash package com.topjohnwu.magisk.ui.flash
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
class FlashFragment : CompatFragment<FlashViewModel, FragmentFlashMd2Binding>() { class FlashFragment : CompatFragment<FlashViewModel, FragmentFlashMd2Binding>() {

View File

@ -1,110 +1,5 @@
package com.topjohnwu.magisk.ui.flash package com.topjohnwu.magisk.ui.flash
import android.Manifest.permission.READ_EXTERNAL_STORAGE import com.topjohnwu.magisk.ui.compat.CompatViewModel
import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
import android.content.res.Resources
import android.net.Uri
import android.os.Handler
import androidx.core.os.postDelayed
import androidx.databinding.ObservableArrayList
import com.topjohnwu.magisk.BR
import com.topjohnwu.magisk.Config
import com.topjohnwu.magisk.Const
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.base.viewmodel.BaseViewModel
import com.topjohnwu.magisk.databinding.ComparableRvItem
import com.topjohnwu.magisk.extensions.*
import com.topjohnwu.magisk.model.entity.recycler.ConsoleRvItem
import com.topjohnwu.magisk.model.events.SnackbarEvent
import com.topjohnwu.magisk.model.flash.FlashResultListener
import com.topjohnwu.magisk.model.flash.Flashing
import com.topjohnwu.magisk.model.flash.Patching
import com.topjohnwu.magisk.utils.DiffObservableList
import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.superuser.Shell
import me.tatarka.bindingcollectionadapter2.ItemBinding
import java.io.File
import java.util.*
class FlashViewModel( class FlashViewModel : CompatViewModel()
action: String,
installer: Uri,
uri: Uri,
private val resources: Resources
) : BaseViewModel(), FlashResultListener {
val canShowReboot = Shell.rootAccess()
val showRestartTitle = KObservableField(false)
val behaviorText = KObservableField(resources.getString(R.string.flashing))
val items = DiffObservableList(ComparableRvItem.callback)
val itemBinding = ItemBinding.of<ComparableRvItem<*>> { itemBinding, _, item ->
item.bind(itemBinding)
itemBinding.bindExtra(BR.viewModel, this@FlashViewModel)
}
private val outItems = ObservableArrayList<String>()
private val logItems = Collections.synchronizedList(mutableListOf<String>())
init {
outItems.sendUpdatesTo(items) { it.map { ConsoleRvItem(it) } }
outItems.copyNewInputInto(logItems)
state = State.LOADING
when (action) {
Const.Value.FLASH_ZIP -> Flashing
.Install(installer, outItems, logItems, this)
.exec()
Const.Value.UNINSTALL -> Flashing
.Uninstall(installer, outItems, logItems, this)
.exec()
Const.Value.FLASH_MAGISK -> Patching
.Direct(installer, outItems, logItems, this)
.exec()
Const.Value.FLASH_INACTIVE_SLOT -> Patching
.SecondSlot(installer, outItems, logItems, this)
.exec()
Const.Value.PATCH_FILE -> Patching
.File(installer, uri, outItems, logItems, this)
.exec()
}
}
override fun onResult(isSuccess: Boolean) {
state = if (isSuccess) State.LOADED else State.LOADING_FAILED
behaviorText.value = when {
isSuccess -> resources.getString(R.string.done)
else -> resources.getString(R.string.failure)
}
if (isSuccess) {
Handler().postDelayed(500) {
showRestartTitle.value = true
}
}
}
fun savePressed() = withPermissions(READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE)
.map { now }
.map { it.toTime(timeFormatStandard) }
.map { Const.MAGISK_INSTALL_LOG_FILENAME.format(it) }
.map { File(Config.downloadDirectory, it) }
.map { file ->
file.bufferedWriter().use { writer ->
logItems.forEach {
writer.write(it)
writer.newLine()
}
}
file.path
}
.subscribeK { SnackbarEvent(it).publish() }
.add()
fun restartPressed() = reboot()
fun backPressed() = back()
}

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.hide package com.topjohnwu.magisk.ui.hide
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
@ -12,8 +12,8 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentHideMd2Binding import com.topjohnwu.magisk.databinding.FragmentHideMd2Binding
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import com.topjohnwu.magisk.redesign.compat.hideKeyboard import com.topjohnwu.magisk.ui.compat.hideKeyboard
import com.topjohnwu.magisk.utils.MotionRevealHelper import com.topjohnwu.magisk.utils.MotionRevealHelper
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.hide package com.topjohnwu.magisk.ui.hide
import android.content.pm.ApplicationInfo import android.content.pm.ApplicationInfo
import androidx.databinding.Bindable import androidx.databinding.Bindable
@ -12,10 +12,10 @@ import com.topjohnwu.magisk.model.entity.ProcessHideApp
import com.topjohnwu.magisk.model.entity.StatefulProcess import com.topjohnwu.magisk.model.entity.StatefulProcess
import com.topjohnwu.magisk.model.entity.recycler.HideItem import com.topjohnwu.magisk.model.entity.recycler.HideItem
import com.topjohnwu.magisk.model.entity.recycler.HideProcessItem import com.topjohnwu.magisk.model.entity.recycler.HideProcessItem
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.redesign.compat.Queryable import com.topjohnwu.magisk.ui.compat.Queryable
import com.topjohnwu.magisk.redesign.compat.filterableListOf import com.topjohnwu.magisk.ui.compat.filterableListOf
import com.topjohnwu.magisk.redesign.compat.itemBindingOf import com.topjohnwu.magisk.ui.compat.itemBindingOf
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.magisk.utils.currentLocale import com.topjohnwu.magisk.utils.currentLocale

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.home package com.topjohnwu.magisk.ui.home
import android.view.Menu import android.view.Menu
import android.view.MenuInflater import android.view.MenuInflater
@ -7,7 +7,7 @@ import androidx.core.graphics.Insets
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
class HomeFragment : CompatFragment<HomeViewModel, FragmentHomeMd2Binding>() { class HomeFragment : CompatFragment<HomeViewModel, FragmentHomeMd2Binding>() {

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.home package com.topjohnwu.magisk.ui.home
import android.Manifest import android.Manifest
import android.os.Build import android.os.Build
@ -22,8 +22,8 @@ import com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog
import com.topjohnwu.magisk.model.events.dialog.UninstallDialog import com.topjohnwu.magisk.model.events.dialog.UninstallDialog
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.magisk.model.observer.Observer import com.topjohnwu.magisk.model.observer.Observer
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.redesign.compat.itemBindingOf import com.topjohnwu.magisk.ui.compat.itemBindingOf
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell
import me.tatarka.bindingcollectionadapter2.BR import me.tatarka.bindingcollectionadapter2.BR

View File

@ -1,11 +1,11 @@
package com.topjohnwu.magisk.redesign.install package com.topjohnwu.magisk.ui.install
import android.content.Intent import android.content.Intent
import androidx.core.graphics.Insets import androidx.core.graphics.Insets
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding
import com.topjohnwu.magisk.model.events.RequestFileEvent import com.topjohnwu.magisk.model.events.RequestFileEvent
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
class InstallFragment : CompatFragment<InstallViewModel, FragmentInstallMd2Binding>() { class InstallFragment : CompatFragment<InstallViewModel, FragmentInstallMd2Binding>() {

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.install package com.topjohnwu.magisk.ui.install
import android.net.Uri import android.net.Uri
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
@ -8,7 +8,7 @@ import com.topjohnwu.magisk.model.download.RemoteFileService
import com.topjohnwu.magisk.model.entity.internal.Configuration import com.topjohnwu.magisk.model.entity.internal.Configuration
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.entity.internal.DownloadSubject
import com.topjohnwu.magisk.model.events.RequestFileEvent import com.topjohnwu.magisk.model.events.RequestFileEvent
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell
import com.topjohnwu.superuser.ShellUtils import com.topjohnwu.superuser.ShellUtils

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.log package com.topjohnwu.magisk.ui.log
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
@ -9,8 +9,8 @@ import androidx.core.graphics.Insets
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentLogMd2Binding import com.topjohnwu.magisk.databinding.FragmentLogMd2Binding
import com.topjohnwu.magisk.redesign.MainActivity import com.topjohnwu.magisk.ui.MainActivity
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import com.topjohnwu.magisk.utils.MotionRevealHelper import com.topjohnwu.magisk.utils.MotionRevealHelper
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.log package com.topjohnwu.magisk.ui.log
import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.BR
import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.Config
@ -12,9 +12,9 @@ import com.topjohnwu.magisk.model.entity.recycler.ConsoleItem
import com.topjohnwu.magisk.model.entity.recycler.LogItem import com.topjohnwu.magisk.model.entity.recycler.LogItem
import com.topjohnwu.magisk.model.entity.recycler.TextItem import com.topjohnwu.magisk.model.entity.recycler.TextItem
import com.topjohnwu.magisk.model.events.SnackbarEvent import com.topjohnwu.magisk.model.events.SnackbarEvent
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.redesign.compat.diffListOf import com.topjohnwu.magisk.ui.compat.diffListOf
import com.topjohnwu.magisk.redesign.compat.itemBindingOf import com.topjohnwu.magisk.ui.compat.itemBindingOf
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell
import io.reactivex.Completable import io.reactivex.Completable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.module package com.topjohnwu.magisk.ui.module
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
@ -14,10 +14,10 @@ import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding
import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent
import com.topjohnwu.magisk.model.events.ViewEvent import com.topjohnwu.magisk.model.events.ViewEvent
import com.topjohnwu.magisk.redesign.MainActivity import com.topjohnwu.magisk.ui.MainActivity
import com.topjohnwu.magisk.redesign.ReselectionTarget import com.topjohnwu.magisk.ui.ReselectionTarget
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import com.topjohnwu.magisk.redesign.compat.hideKeyboard import com.topjohnwu.magisk.ui.compat.hideKeyboard
import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener
import com.topjohnwu.magisk.utils.MotionRevealHelper import com.topjohnwu.magisk.utils.MotionRevealHelper
import com.topjohnwu.magisk.utils.PinchZoomTouchListener import com.topjohnwu.magisk.utils.PinchZoomTouchListener

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.module package com.topjohnwu.magisk.ui.module
import androidx.annotation.WorkerThread import androidx.annotation.WorkerThread
import androidx.databinding.Bindable import androidx.databinding.Bindable
@ -19,8 +19,8 @@ import com.topjohnwu.magisk.model.entity.recycler.*
import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent
import com.topjohnwu.magisk.model.events.OpenChangelogEvent import com.topjohnwu.magisk.model.events.OpenChangelogEvent
import com.topjohnwu.magisk.model.events.dialog.ModuleInstallDialog import com.topjohnwu.magisk.model.events.dialog.ModuleInstallDialog
import com.topjohnwu.magisk.redesign.compat.*
import com.topjohnwu.magisk.tasks.RepoUpdater import com.topjohnwu.magisk.tasks.RepoUpdater
import com.topjohnwu.magisk.ui.compat.*
import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.magisk.utils.currentLocale import com.topjohnwu.magisk.utils.currentLocale

View File

@ -1,8 +1,8 @@
package com.topjohnwu.magisk.redesign.request package com.topjohnwu.magisk.ui.request
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ActivityRequestMd2Binding import com.topjohnwu.magisk.databinding.ActivityRequestMd2Binding
import com.topjohnwu.magisk.redesign.compat.CompatActivity import com.topjohnwu.magisk.ui.compat.CompatActivity
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
class RequestActivity : CompatActivity<RequestViewModel, ActivityRequestMd2Binding>() { class RequestActivity : CompatActivity<RequestViewModel, ActivityRequestMd2Binding>() {

View File

@ -0,0 +1,5 @@
package com.topjohnwu.magisk.ui.request
import com.topjohnwu.magisk.ui.compat.CompatViewModel
class RequestViewModel : CompatViewModel()

View File

@ -1,8 +1,8 @@
package com.topjohnwu.magisk.redesign.safetynet package com.topjohnwu.magisk.ui.safetynet
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentSafetynetMd2Binding import com.topjohnwu.magisk.databinding.FragmentSafetynetMd2Binding
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
class SafetynetFragment : CompatFragment<SafetynetViewModel, FragmentSafetynetMd2Binding>() { class SafetynetFragment : CompatFragment<SafetynetViewModel, FragmentSafetynetMd2Binding>() {

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.safetynet package com.topjohnwu.magisk.ui.safetynet
import androidx.databinding.Bindable import androidx.databinding.Bindable
import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.BR
@ -6,8 +6,8 @@ import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.extensions.subscribeK import com.topjohnwu.magisk.extensions.subscribeK
import com.topjohnwu.magisk.model.events.SafetyNetResult import com.topjohnwu.magisk.model.events.SafetyNetResult
import com.topjohnwu.magisk.model.events.UpdateSafetyNetEvent import com.topjohnwu.magisk.model.events.UpdateSafetyNetEvent
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.redesign.safetynet.SafetyNetState.* import com.topjohnwu.magisk.ui.safetynet.SafetyNetState.*
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import com.topjohnwu.magisk.utils.RxBus import com.topjohnwu.magisk.utils.RxBus
import com.topjohnwu.magisk.utils.SafetyNetHelper import com.topjohnwu.magisk.utils.SafetyNetHelper

View File

@ -1,11 +1,11 @@
package com.topjohnwu.magisk.redesign.settings package com.topjohnwu.magisk.ui.settings
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.core.graphics.Insets import androidx.core.graphics.Insets
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import com.topjohnwu.magisk.utils.PinchZoomTouchListener import com.topjohnwu.magisk.utils.PinchZoomTouchListener
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.settings package com.topjohnwu.magisk.ui.settings
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.settings package com.topjohnwu.magisk.ui.settings
import android.Manifest import android.Manifest
import android.view.View import android.view.View
@ -15,10 +15,10 @@ import com.topjohnwu.magisk.model.events.PermissionEvent
import com.topjohnwu.magisk.model.events.RecreateEvent import com.topjohnwu.magisk.model.events.RecreateEvent
import com.topjohnwu.magisk.model.events.dialog.BiometricDialog import com.topjohnwu.magisk.model.events.dialog.BiometricDialog
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.redesign.compat.adapterOf import com.topjohnwu.magisk.ui.compat.adapterOf
import com.topjohnwu.magisk.redesign.compat.diffListOf import com.topjohnwu.magisk.ui.compat.diffListOf
import com.topjohnwu.magisk.redesign.compat.itemBindingOf import com.topjohnwu.magisk.ui.compat.itemBindingOf
import com.topjohnwu.magisk.utils.PatchAPK import com.topjohnwu.magisk.utils.PatchAPK
import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.magisk.utils.Utils
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.superuser package com.topjohnwu.magisk.ui.superuser
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
@ -9,7 +9,7 @@ import androidx.core.graphics.Insets
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import com.topjohnwu.magisk.utils.PinchZoomTouchListener import com.topjohnwu.magisk.utils.PinchZoomTouchListener
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.superuser package com.topjohnwu.magisk.ui.superuser
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.content.res.Resources import android.content.res.Resources
@ -19,10 +19,10 @@ import com.topjohnwu.magisk.model.events.SnackbarEvent
import com.topjohnwu.magisk.model.events.dialog.BiometricDialog import com.topjohnwu.magisk.model.events.dialog.BiometricDialog
import com.topjohnwu.magisk.model.events.dialog.SuperuserRevokeDialog import com.topjohnwu.magisk.model.events.dialog.SuperuserRevokeDialog
import com.topjohnwu.magisk.model.navigation.Navigation import com.topjohnwu.magisk.model.navigation.Navigation
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
import com.topjohnwu.magisk.redesign.compat.adapterOf import com.topjohnwu.magisk.ui.compat.adapterOf
import com.topjohnwu.magisk.redesign.compat.diffListOf import com.topjohnwu.magisk.ui.compat.diffListOf
import com.topjohnwu.magisk.redesign.compat.itemBindingOf import com.topjohnwu.magisk.ui.compat.itemBindingOf
import com.topjohnwu.magisk.utils.BiometricHelper import com.topjohnwu.magisk.utils.BiometricHelper
import com.topjohnwu.magisk.utils.currentLocale import com.topjohnwu.magisk.utils.currentLocale
import io.reactivex.Single import io.reactivex.Single

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk.redesign.theme package com.topjohnwu.magisk.ui.theme
import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.Config
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R

View File

@ -1,9 +1,9 @@
package com.topjohnwu.magisk.redesign.theme package com.topjohnwu.magisk.ui.theme
import androidx.core.graphics.Insets import androidx.core.graphics.Insets
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding
import com.topjohnwu.magisk.redesign.compat.CompatFragment import com.topjohnwu.magisk.ui.compat.CompatFragment
import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.androidx.viewmodel.ext.android.viewModel
class ThemeFragment : CompatFragment<ThemeViewModel, FragmentThemeMd2Binding>() { class ThemeFragment : CompatFragment<ThemeViewModel, FragmentThemeMd2Binding>() {

View File

@ -1,9 +1,9 @@
package com.topjohnwu.magisk.redesign.theme package com.topjohnwu.magisk.ui.theme
import com.topjohnwu.magisk.model.entity.recycler.TappableHeadlineItem import com.topjohnwu.magisk.model.entity.recycler.TappableHeadlineItem
import com.topjohnwu.magisk.model.events.RecreateEvent import com.topjohnwu.magisk.model.events.RecreateEvent
import com.topjohnwu.magisk.model.events.dialog.DarkThemeDialog import com.topjohnwu.magisk.model.events.dialog.DarkThemeDialog
import com.topjohnwu.magisk.redesign.compat.CompatViewModel import com.topjohnwu.magisk.ui.compat.CompatViewModel
class ThemeViewModel : CompatViewModel(), TappableHeadlineItem.Listener { class ThemeViewModel : CompatViewModel(), TappableHeadlineItem.Listener {

View File

@ -15,7 +15,7 @@ import com.topjohnwu.magisk.extensions.subscribeK
import com.topjohnwu.magisk.model.entity.MagiskPolicy import com.topjohnwu.magisk.model.entity.MagiskPolicy
import com.topjohnwu.magisk.model.entity.toLog import com.topjohnwu.magisk.model.entity.toLog
import com.topjohnwu.magisk.model.entity.toPolicy import com.topjohnwu.magisk.model.entity.toPolicy
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity import com.topjohnwu.magisk.legacy.surequest.SuRequestActivity
import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.Shell
import timber.log.Timber import timber.log.Timber

View File

@ -22,7 +22,7 @@ import com.topjohnwu.magisk.BR
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.databinding.ComparableRvItem
import com.topjohnwu.magisk.databinding.DialogMagiskBaseBinding import com.topjohnwu.magisk.databinding.DialogMagiskBaseBinding
import com.topjohnwu.magisk.redesign.compat.itemBindingOf import com.topjohnwu.magisk.ui.compat.itemBindingOf
import com.topjohnwu.magisk.utils.KObservableField import com.topjohnwu.magisk.utils.KObservableField
import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapters import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapters
import me.tatarka.bindingcollectionadapter2.ItemBinding import me.tatarka.bindingcollectionadapter2.ItemBinding

View File

@ -7,7 +7,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.ui.flash.FlashViewModel" /> type="com.topjohnwu.magisk.legacy.flash.FlashViewModel" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.MainViewModel" /> type="com.topjohnwu.magisk.ui.MainViewModel" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.ui.surequest.SuRequestViewModel" /> type="com.topjohnwu.magisk.legacy.surequest.SuRequestViewModel" />
</data> </data>

View File

@ -5,7 +5,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.request.RequestViewModel" /> type="com.topjohnwu.magisk.ui.request.RequestViewModel" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="data" name="data"
type="com.topjohnwu.magisk.redesign.settings.Hide" /> type="com.topjohnwu.magisk.ui.settings.Hide" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="data" name="data"
type="com.topjohnwu.magisk.redesign.settings.DownloadPath" /> type="com.topjohnwu.magisk.ui.settings.DownloadPath" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="data" name="data"
type="com.topjohnwu.magisk.redesign.settings.UpdateChannelUrl" /> type="com.topjohnwu.magisk.ui.settings.UpdateChannelUrl" />
</data> </data>

View File

@ -5,7 +5,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.flash.FlashViewModel" /> type="com.topjohnwu.magisk.ui.flash.FlashViewModel" />
</data> </data>

View File

@ -9,7 +9,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.hide.HideViewModel" /> type="com.topjohnwu.magisk.ui.hide.HideViewModel" />
</data> </data>

View File

@ -17,7 +17,7 @@
<import type="com.topjohnwu.magisk.BuildConfig" /> <import type="com.topjohnwu.magisk.BuildConfig" />
<import type="com.topjohnwu.magisk.redesign.home.MagiskState" /> <import type="com.topjohnwu.magisk.ui.home.MagiskState" />
<import type="com.topjohnwu.magisk.extensions.XAndroidKt" /> <import type="com.topjohnwu.magisk.extensions.XAndroidKt" />
@ -25,7 +25,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.home.HomeViewModel" /> type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.install.InstallViewModel" /> type="com.topjohnwu.magisk.ui.install.InstallViewModel" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.log.LogViewModel" /> type="com.topjohnwu.magisk.ui.log.LogViewModel" />
</data> </data>

View File

@ -11,7 +11,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" /> type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
</data> </data>

View File

@ -12,7 +12,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.safetynet.SafetynetViewModel" /> type="com.topjohnwu.magisk.ui.safetynet.SafetynetViewModel" />
</data> </data>

View File

@ -9,7 +9,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.settings.SettingsViewModel" /> type="com.topjohnwu.magisk.ui.settings.SettingsViewModel" />
</data> </data>

View File

@ -9,7 +9,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel" /> type="com.topjohnwu.magisk.ui.superuser.SuperuserViewModel" />
</data> </data>

View File

@ -4,11 +4,11 @@
<data> <data>
<import type="com.topjohnwu.magisk.redesign.theme.Theme" /> <import type="com.topjohnwu.magisk.ui.theme.Theme" />
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.theme.ThemeViewModel" /> type="com.topjohnwu.magisk.ui.theme.ThemeViewModel" />
</data> </data>

View File

@ -9,7 +9,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.hide.HideViewModel" /> type="com.topjohnwu.magisk.ui.hide.HideViewModel" />
</data> </data>

View File

@ -7,7 +7,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.log.LogViewModel" /> type="com.topjohnwu.magisk.ui.log.LogViewModel" />
</data> </data>

View File

@ -9,7 +9,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" /> type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
</data> </data>

View File

@ -11,7 +11,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.home.HomeViewModel" /> type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
</data> </data>

View File

@ -11,7 +11,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.home.HomeViewModel" /> type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
</data> </data>

View File

@ -13,7 +13,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.hide.HideViewModel" /> type="com.topjohnwu.magisk.ui.hide.HideViewModel" />
</data> </data>

View File

@ -11,7 +11,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.hide.HideViewModel" /> type="com.topjohnwu.magisk.ui.hide.HideViewModel" />
</data> </data>

View File

@ -13,7 +13,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.log.LogViewModel" /> type="com.topjohnwu.magisk.ui.log.LogViewModel" />
</data> </data>

View File

@ -10,7 +10,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" /> type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
</data> </data>

View File

@ -15,7 +15,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" /> type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
</data> </data>

View File

@ -11,7 +11,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.superuser.SuperuserViewModel" /> type="com.topjohnwu.magisk.ui.superuser.SuperuserViewModel" />
</data> </data>

View File

@ -13,7 +13,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" /> type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
</data> </data>

View File

@ -11,7 +11,7 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" /> type="com.topjohnwu.magisk.ui.module.ModuleViewModel" />
</data> </data>

View File

@ -7,11 +7,11 @@
<variable <variable
name="viewModel" name="viewModel"
type="com.topjohnwu.magisk.redesign.theme.ThemeViewModel" /> type="com.topjohnwu.magisk.ui.theme.ThemeViewModel" />
<variable <variable
name="theme" name="theme"
type="com.topjohnwu.magisk.redesign.theme.Theme" /> type="com.topjohnwu.magisk.ui.theme.Theme" />
</data> </data>