mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-03 03:17:38 +00:00
Re-enable nonTransitiveRClass
This commit is contained in:
parent
872394cb58
commit
af5c4d09c4
@ -10,7 +10,7 @@ import androidx.lifecycle.LiveData
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.navigation.NavDirections
|
import androidx.navigation.NavDirections
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.databinding.ObservableHost
|
import com.topjohnwu.magisk.databinding.ObservableHost
|
||||||
import com.topjohnwu.magisk.events.BackPressEvent
|
import com.topjohnwu.magisk.events.BackPressEvent
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
|
@ -7,26 +7,27 @@ import com.topjohnwu.magisk.arch.UIActivity
|
|||||||
import com.topjohnwu.magisk.core.Config
|
import com.topjohnwu.magisk.core.Config
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class DarkThemeDialog : DialogBuilder {
|
class DarkThemeDialog : DialogBuilder {
|
||||||
|
|
||||||
override fun build(dialog: MagiskDialog) {
|
override fun build(dialog: MagiskDialog) {
|
||||||
val activity = dialog.ownerActivity!!
|
val activity = dialog.ownerActivity!!
|
||||||
dialog.apply {
|
dialog.apply {
|
||||||
setTitle(R.string.settings_dark_mode_title)
|
setTitle(CoreR.string.settings_dark_mode_title)
|
||||||
setMessage(R.string.settings_dark_mode_message)
|
setMessage(CoreR.string.settings_dark_mode_message)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||||
text = R.string.settings_dark_mode_light
|
text = CoreR.string.settings_dark_mode_light
|
||||||
icon = R.drawable.ic_day
|
icon = R.drawable.ic_day
|
||||||
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_NO, activity) }
|
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_NO, activity) }
|
||||||
}
|
}
|
||||||
setButton(MagiskDialog.ButtonType.NEUTRAL) {
|
setButton(MagiskDialog.ButtonType.NEUTRAL) {
|
||||||
text = R.string.settings_dark_mode_system
|
text = CoreR.string.settings_dark_mode_system
|
||||||
icon = R.drawable.ic_day_night
|
icon = R.drawable.ic_day_night
|
||||||
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, activity) }
|
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, activity) }
|
||||||
}
|
}
|
||||||
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
||||||
text = R.string.settings_dark_mode_dark
|
text = CoreR.string.settings_dark_mode_dark
|
||||||
icon = R.drawable.ic_night
|
icon = R.drawable.ic_night
|
||||||
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_YES, activity) }
|
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_YES, activity) }
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.core.BuildConfig
|
import com.topjohnwu.magisk.core.BuildConfig
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.tasks.MagiskInstaller
|
import com.topjohnwu.magisk.core.tasks.MagiskInstaller
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.ui.home.HomeViewModel
|
import com.topjohnwu.magisk.ui.home.HomeViewModel
|
||||||
|
@ -2,8 +2,8 @@ package com.topjohnwu.magisk.dialog
|
|||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import com.topjohnwu.magisk.MainDirections
|
import com.topjohnwu.magisk.MainDirections
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.core.Const
|
import com.topjohnwu.magisk.core.Const
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.ui.module.ModuleViewModel
|
import com.topjohnwu.magisk.ui.module.ModuleViewModel
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.di.AppContext
|
import com.topjohnwu.magisk.core.di.AppContext
|
||||||
import com.topjohnwu.magisk.core.di.ServiceLocator
|
import com.topjohnwu.magisk.core.di.ServiceLocator
|
||||||
import com.topjohnwu.magisk.core.download.DownloadEngine
|
import com.topjohnwu.magisk.core.download.DownloadEngine
|
||||||
|
@ -13,6 +13,7 @@ import kotlinx.coroutines.launch
|
|||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
abstract class MarkDownDialog : DialogBuilder {
|
abstract class MarkDownDialog : DialogBuilder {
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ abstract class MarkDownDialog : DialogBuilder {
|
|||||||
ServiceLocator.markwon.setMarkdown(tv, text)
|
ServiceLocator.markwon.setMarkdown(tv, text)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Timber.e(e)
|
Timber.e(e)
|
||||||
tv.setText(R.string.download_file_error)
|
tv.setText(CoreR.string.download_file_error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.di.ServiceLocator
|
import com.topjohnwu.magisk.core.di.ServiceLocator
|
||||||
import com.topjohnwu.magisk.core.download.DownloadEngine
|
import com.topjohnwu.magisk.core.download.DownloadEngine
|
||||||
import com.topjohnwu.magisk.core.download.Subject
|
import com.topjohnwu.magisk.core.download.Subject
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package com.topjohnwu.magisk.dialog
|
|||||||
import android.app.ProgressDialog
|
import android.app.ProgressDialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.arch.NavigationActivity
|
import com.topjohnwu.magisk.arch.NavigationActivity
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.ktx.toast
|
import com.topjohnwu.magisk.core.ktx.toast
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.ui.flash.FlashFragment
|
import com.topjohnwu.magisk.ui.flash.FlashFragment
|
||||||
|
@ -28,6 +28,7 @@ import com.topjohnwu.magisk.ui.home.HomeFragmentDirections
|
|||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
import com.topjohnwu.magisk.view.Shortcuts
|
import com.topjohnwu.magisk.view.Shortcuts
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class MainViewModel : BaseViewModel()
|
class MainViewModel : BaseViewModel()
|
||||||
|
|
||||||
@ -167,8 +168,8 @@ class MainActivity : SplashActivity<ActivityMainMd2Binding>() {
|
|||||||
private fun showUnsupportedMessage() {
|
private fun showUnsupportedMessage() {
|
||||||
if (Info.env.isUnsupported) {
|
if (Info.env.isUnsupported) {
|
||||||
MagiskDialog(this).apply {
|
MagiskDialog(this).apply {
|
||||||
setTitle(R.string.unsupport_magisk_title)
|
setTitle(CoreR.string.unsupport_magisk_title)
|
||||||
setMessage(R.string.unsupport_magisk_msg, Const.Version.MIN_VERSION)
|
setMessage(CoreR.string.unsupport_magisk_msg, Const.Version.MIN_VERSION)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
||||||
setCancelable(false)
|
setCancelable(false)
|
||||||
}.show()
|
}.show()
|
||||||
@ -179,8 +180,8 @@ class MainActivity : SplashActivity<ActivityMainMd2Binding>() {
|
|||||||
?.filterNot { File("$it/magisk").exists() }
|
?.filterNot { File("$it/magisk").exists() }
|
||||||
?.any { File("$it/su").exists() } == true) {
|
?.any { File("$it/su").exists() } == true) {
|
||||||
MagiskDialog(this).apply {
|
MagiskDialog(this).apply {
|
||||||
setTitle(R.string.unsupport_general_title)
|
setTitle(CoreR.string.unsupport_general_title)
|
||||||
setMessage(R.string.unsupport_other_su_msg)
|
setMessage(CoreR.string.unsupport_other_su_msg)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
||||||
setCancelable(false)
|
setCancelable(false)
|
||||||
}.show()
|
}.show()
|
||||||
@ -188,8 +189,8 @@ class MainActivity : SplashActivity<ActivityMainMd2Binding>() {
|
|||||||
|
|
||||||
if (applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0) {
|
if (applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0) {
|
||||||
MagiskDialog(this).apply {
|
MagiskDialog(this).apply {
|
||||||
setTitle(R.string.unsupport_general_title)
|
setTitle(CoreR.string.unsupport_general_title)
|
||||||
setMessage(R.string.unsupport_system_app_msg)
|
setMessage(CoreR.string.unsupport_system_app_msg)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
||||||
setCancelable(false)
|
setCancelable(false)
|
||||||
}.show()
|
}.show()
|
||||||
@ -197,8 +198,8 @@ class MainActivity : SplashActivity<ActivityMainMd2Binding>() {
|
|||||||
|
|
||||||
if (applicationInfo.flags and ApplicationInfo.FLAG_EXTERNAL_STORAGE != 0) {
|
if (applicationInfo.flags and ApplicationInfo.FLAG_EXTERNAL_STORAGE != 0) {
|
||||||
MagiskDialog(this).apply {
|
MagiskDialog(this).apply {
|
||||||
setTitle(R.string.unsupport_general_title)
|
setTitle(CoreR.string.unsupport_general_title)
|
||||||
setMessage(R.string.unsupport_external_storage_msg)
|
setMessage(CoreR.string.unsupport_external_storage_msg)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok }
|
||||||
setCancelable(false)
|
setCancelable(false)
|
||||||
}.show()
|
}.show()
|
||||||
@ -211,8 +212,8 @@ class MainActivity : SplashActivity<ActivityMainMd2Binding>() {
|
|||||||
// Ask and show dialog
|
// Ask and show dialog
|
||||||
Config.askedHome = true
|
Config.askedHome = true
|
||||||
MagiskDialog(this).apply {
|
MagiskDialog(this).apply {
|
||||||
setTitle(R.string.add_shortcut_title)
|
setTitle(CoreR.string.add_shortcut_title)
|
||||||
setMessage(R.string.add_shortcut_msg)
|
setMessage(CoreR.string.add_shortcut_msg)
|
||||||
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
||||||
text = android.R.string.cancel
|
text = android.R.string.cancel
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ import kotlinx.coroutines.launch
|
|||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
@SuppressLint("CustomSplashScreen")
|
@SuppressLint("CustomSplashScreen")
|
||||||
abstract class SplashActivity<Binding : ViewDataBinding> : NavigationActivity<Binding>() {
|
abstract class SplashActivity<Binding : ViewDataBinding> : NavigationActivity<Binding>() {
|
||||||
@ -82,14 +83,14 @@ abstract class SplashActivity<Binding : ViewDataBinding> : NavigationActivity<Bi
|
|||||||
@SuppressLint("InlinedApi")
|
@SuppressLint("InlinedApi")
|
||||||
private fun showInvalidStateMessage(): Unit = runOnUiThread {
|
private fun showInvalidStateMessage(): Unit = runOnUiThread {
|
||||||
MagiskDialog(this).apply {
|
MagiskDialog(this).apply {
|
||||||
setTitle(R.string.unsupport_nonroot_stub_title)
|
setTitle(CoreR.string.unsupport_nonroot_stub_title)
|
||||||
setMessage(R.string.unsupport_nonroot_stub_msg)
|
setMessage(CoreR.string.unsupport_nonroot_stub_msg)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||||
text = R.string.install
|
text = CoreR.string.install
|
||||||
onClick {
|
onClick {
|
||||||
withPermission(REQUEST_INSTALL_PACKAGES) {
|
withPermission(REQUEST_INSTALL_PACKAGES) {
|
||||||
if (!it) {
|
if (!it) {
|
||||||
toast(R.string.install_unknown_denied, Toast.LENGTH_SHORT)
|
toast(CoreR.string.install_unknown_denied, Toast.LENGTH_SHORT)
|
||||||
showInvalidStateMessage()
|
showInvalidStateMessage()
|
||||||
} else {
|
} else {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
|
@ -16,6 +16,7 @@ import com.topjohnwu.magisk.databinding.FragmentDenyMd2Binding
|
|||||||
import rikka.recyclerview.addEdgeSpacing
|
import rikka.recyclerview.addEdgeSpacing
|
||||||
import rikka.recyclerview.addItemSpacing
|
import rikka.recyclerview.addItemSpacing
|
||||||
import rikka.recyclerview.fixEdgeEffect
|
import rikka.recyclerview.fixEdgeEffect
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class DenyListFragment : BaseFragment<FragmentDenyMd2Binding>(), MenuProvider {
|
class DenyListFragment : BaseFragment<FragmentDenyMd2Binding>(), MenuProvider {
|
||||||
|
|
||||||
@ -26,7 +27,7 @@ class DenyListFragment : BaseFragment<FragmentDenyMd2Binding>(), MenuProvider {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
activity?.setTitle(R.string.denylist)
|
activity?.setTitle(CoreR.string.denylist)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
@ -58,7 +59,7 @@ class DenyListFragment : BaseFragment<FragmentDenyMd2Binding>(), MenuProvider {
|
|||||||
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
|
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) {
|
||||||
inflater.inflate(R.menu.menu_deny_md2, menu)
|
inflater.inflate(R.menu.menu_deny_md2, menu)
|
||||||
searchView = menu.findItem(R.id.action_search).actionView as SearchView
|
searchView = menu.findItem(R.id.action_search).actionView as SearchView
|
||||||
searchView.queryHint = searchView.context.getString(R.string.hide_filter_hint)
|
searchView.queryHint = searchView.context.getString(CoreR.string.hide_filter_hint)
|
||||||
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
||||||
override fun onQueryTextSubmit(query: String?): Boolean {
|
override fun onQueryTextSubmit(query: String?): Boolean {
|
||||||
viewModel.query = query ?: ""
|
viewModel.query = query ?: ""
|
||||||
|
@ -21,6 +21,7 @@ import com.topjohnwu.magisk.core.Const
|
|||||||
import com.topjohnwu.magisk.core.cmp
|
import com.topjohnwu.magisk.core.cmp
|
||||||
import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding
|
import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding
|
||||||
import com.topjohnwu.magisk.ui.MainActivity
|
import com.topjohnwu.magisk.ui.MainActivity
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class FlashFragment : BaseFragment<FragmentFlashMd2Binding>(), MenuProvider {
|
class FlashFragment : BaseFragment<FragmentFlashMd2Binding>(), MenuProvider {
|
||||||
|
|
||||||
@ -39,14 +40,14 @@ class FlashFragment : BaseFragment<FragmentFlashMd2Binding>(), MenuProvider {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
activity?.setTitle(R.string.flash_screen_title)
|
activity?.setTitle(CoreR.string.flash_screen_title)
|
||||||
|
|
||||||
viewModel.state.observe(this) {
|
viewModel.state.observe(this) {
|
||||||
activity?.supportActionBar?.setSubtitle(
|
activity?.supportActionBar?.setSubtitle(
|
||||||
when (it) {
|
when (it) {
|
||||||
FlashViewModel.State.FLASHING -> R.string.flashing
|
FlashViewModel.State.FLASHING -> CoreR.string.flashing
|
||||||
FlashViewModel.State.SUCCESS -> R.string.done
|
FlashViewModel.State.SUCCESS -> CoreR.string.done
|
||||||
FlashViewModel.State.FAILED -> R.string.failure
|
FlashViewModel.State.FAILED -> CoreR.string.failure
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (it == FlashViewModel.State.SUCCESS && viewModel.showReboot) {
|
if (it == FlashViewModel.State.SUCCESS && viewModel.showReboot) {
|
||||||
|
@ -3,6 +3,7 @@ package com.topjohnwu.magisk.ui.home
|
|||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.R
|
||||||
import com.topjohnwu.magisk.core.Const
|
import com.topjohnwu.magisk.core.Const
|
||||||
import com.topjohnwu.magisk.databinding.RvItem
|
import com.topjohnwu.magisk.databinding.RvItem
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
interface Dev {
|
interface Dev {
|
||||||
val name: String
|
val name: String
|
||||||
@ -84,8 +85,8 @@ sealed class IconLink : RvItem() {
|
|||||||
override val layoutRes get() = R.layout.item_icon_link
|
override val layoutRes get() = R.layout.item_icon_link
|
||||||
|
|
||||||
abstract class PayPal : IconLink(), Dev {
|
abstract class PayPal : IconLink(), Dev {
|
||||||
override val icon get() = R.drawable.ic_paypal
|
override val icon get() = CoreR.drawable.ic_paypal
|
||||||
override val title get() = R.string.paypal
|
override val title get() = CoreR.string.paypal
|
||||||
override val link get() = "https://paypal.me/$name"
|
override val link get() = "https://paypal.me/$name"
|
||||||
|
|
||||||
object Project : PayPal() {
|
object Project : PayPal() {
|
||||||
@ -94,20 +95,20 @@ sealed class IconLink : RvItem() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object Patreon : IconLink() {
|
object Patreon : IconLink() {
|
||||||
override val icon get() = R.drawable.ic_patreon
|
override val icon get() = CoreR.drawable.ic_patreon
|
||||||
override val title get() = R.string.patreon
|
override val title get() = CoreR.string.patreon
|
||||||
override val link get() = Const.Url.PATREON_URL
|
override val link get() = Const.Url.PATREON_URL
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class Twitter : IconLink(), Dev {
|
abstract class Twitter : IconLink(), Dev {
|
||||||
override val icon get() = R.drawable.ic_twitter
|
override val icon get() = CoreR.drawable.ic_twitter
|
||||||
override val title get() = R.string.twitter
|
override val title get() = CoreR.string.twitter
|
||||||
override val link get() = "https://twitter.com/$name"
|
override val link get() = "https://twitter.com/$name"
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class Github : IconLink() {
|
abstract class Github : IconLink() {
|
||||||
override val icon get() = R.drawable.ic_github
|
override val icon get() = CoreR.drawable.ic_github
|
||||||
override val title get() = R.string.github
|
override val title get() = CoreR.string.github
|
||||||
|
|
||||||
abstract class User : Github(), Dev {
|
abstract class User : Github(), Dev {
|
||||||
override val link get() = "https://github.com/$name"
|
override val link get() = "https://github.com/$name"
|
||||||
@ -119,8 +120,8 @@ sealed class IconLink : RvItem() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class Sponsor : IconLink(), Dev {
|
abstract class Sponsor : IconLink(), Dev {
|
||||||
override val icon get() = R.drawable.ic_favorite
|
override val icon get() = CoreR.drawable.ic_favorite
|
||||||
override val title get() = R.string.github
|
override val title get() = CoreR.string.github
|
||||||
override val link get() = "https://github.com/sponsors/$name"
|
override val link get() = "https://github.com/sponsors/$name"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import com.topjohnwu.magisk.arch.viewModel
|
|||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
import com.topjohnwu.magisk.core.download.DownloadEngine
|
import com.topjohnwu.magisk.core.download.DownloadEngine
|
||||||
import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding
|
import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class HomeFragment : BaseFragment<FragmentHomeMd2Binding>(), MenuProvider {
|
class HomeFragment : BaseFragment<FragmentHomeMd2Binding>(), MenuProvider {
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ class HomeFragment : BaseFragment<FragmentHomeMd2Binding>(), MenuProvider {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
activity?.setTitle(R.string.section_home)
|
activity?.setTitle(CoreR.string.section_home)
|
||||||
DownloadEngine.observeProgress(this, viewModel::onProgressUpdate)
|
DownloadEngine.observeProgress(this, viewModel::onProgressUpdate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import com.topjohnwu.magisk.events.SnackbarEvent
|
|||||||
import com.topjohnwu.magisk.utils.asText
|
import com.topjohnwu.magisk.utils.asText
|
||||||
import com.topjohnwu.superuser.Shell
|
import com.topjohnwu.superuser.Shell
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class HomeViewModel(
|
class HomeViewModel(
|
||||||
private val svc: NetworkService
|
private val svc: NetworkService
|
||||||
@ -65,11 +66,11 @@ class HomeViewModel(
|
|||||||
if (isActive)
|
if (isActive)
|
||||||
("$versionString ($versionCode)" + if (isDebug) " (D)" else "").asText()
|
("$versionString ($versionCode)" + if (isDebug) " (D)" else "").asText()
|
||||||
else
|
else
|
||||||
R.string.not_available.asText()
|
CoreR.string.not_available.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
@get:Bindable
|
@get:Bindable
|
||||||
var managerRemoteVersion = R.string.loading.asText()
|
var managerRemoteVersion = CoreR.string.loading.asText()
|
||||||
set(value) = set(value, field, { field = it }, BR.managerRemoteVersion)
|
set(value) = set(value, field, { field = it }, BR.managerRemoteVersion)
|
||||||
|
|
||||||
val managerInstalledVersion
|
val managerInstalledVersion
|
||||||
@ -102,7 +103,7 @@ class HomeViewModel(
|
|||||||
if (isDebug) " (D)" else "").asText()
|
if (isDebug) " (D)" else "").asText()
|
||||||
} ?: run {
|
} ?: run {
|
||||||
appState = State.INVALID
|
appState = State.INVALID
|
||||||
managerRemoteVersion = R.string.not_available.asText()
|
managerRemoteVersion = CoreR.string.not_available.asText()
|
||||||
}
|
}
|
||||||
ensureEnv()
|
ensureEnv()
|
||||||
}
|
}
|
||||||
@ -121,7 +122,7 @@ class HomeViewModel(
|
|||||||
try {
|
try {
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
} catch (e: ActivityNotFoundException) {
|
} catch (e: ActivityNotFoundException) {
|
||||||
context.toast(R.string.open_link_failed_toast, Toast.LENGTH_SHORT)
|
context.toast(CoreR.string.open_link_failed_toast, Toast.LENGTH_SHORT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.publish()
|
}.publish()
|
||||||
@ -129,8 +130,8 @@ class HomeViewModel(
|
|||||||
fun onDeletePressed() = UninstallDialog().show()
|
fun onDeletePressed() = UninstallDialog().show()
|
||||||
|
|
||||||
fun onManagerPressed() = when (appState) {
|
fun onManagerPressed() = when (appState) {
|
||||||
State.LOADING -> SnackbarEvent(R.string.loading).publish()
|
State.LOADING -> SnackbarEvent(CoreR.string.loading).publish()
|
||||||
State.INVALID -> SnackbarEvent(R.string.no_connection).publish()
|
State.INVALID -> SnackbarEvent(CoreR.string.no_connection).publish()
|
||||||
else -> withExternalRW {
|
else -> withExternalRW {
|
||||||
withInstallPermission {
|
withInstallPermission {
|
||||||
ManagerInstallDialog().show()
|
ManagerInstallDialog().show()
|
||||||
|
@ -4,6 +4,7 @@ import com.topjohnwu.magisk.R
|
|||||||
import com.topjohnwu.magisk.arch.BaseFragment
|
import com.topjohnwu.magisk.arch.BaseFragment
|
||||||
import com.topjohnwu.magisk.arch.viewModel
|
import com.topjohnwu.magisk.arch.viewModel
|
||||||
import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding
|
import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class InstallFragment : BaseFragment<FragmentInstallMd2Binding>() {
|
class InstallFragment : BaseFragment<FragmentInstallMd2Binding>() {
|
||||||
|
|
||||||
@ -12,6 +13,6 @@ class InstallFragment : BaseFragment<FragmentInstallMd2Binding>() {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
requireActivity().setTitle(R.string.install)
|
requireActivity().setTitle(CoreR.string.install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import kotlinx.parcelize.Parcelize
|
|||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel() {
|
class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel() {
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel()
|
|||||||
@Parcelize
|
@Parcelize
|
||||||
class UriCallback : ContentResultCallback {
|
class UriCallback : ContentResultCallback {
|
||||||
override fun onActivityLaunch() {
|
override fun onActivityLaunch() {
|
||||||
AppContext.toast(R.string.patch_file_msg, Toast.LENGTH_LONG)
|
AppContext.toast(CoreR.string.patch_file_msg, Toast.LENGTH_LONG)
|
||||||
}
|
}
|
||||||
override fun onActivityResult(result: Uri) {
|
override fun onActivityResult(result: Uri) {
|
||||||
uri.value = result
|
uri.value = result
|
||||||
|
@ -16,6 +16,7 @@ import com.topjohnwu.magisk.utils.MotionRevealHelper
|
|||||||
import rikka.recyclerview.addEdgeSpacing
|
import rikka.recyclerview.addEdgeSpacing
|
||||||
import rikka.recyclerview.addItemSpacing
|
import rikka.recyclerview.addItemSpacing
|
||||||
import rikka.recyclerview.fixEdgeEffect
|
import rikka.recyclerview.fixEdgeEffect
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class LogFragment : BaseFragment<FragmentLogMd2Binding>(), MenuProvider {
|
class LogFragment : BaseFragment<FragmentLogMd2Binding>(), MenuProvider {
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ class LogFragment : BaseFragment<FragmentLogMd2Binding>(), MenuProvider {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
activity?.setTitle(R.string.logs)
|
activity?.setTitle(CoreR.string.logs)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
@ -4,10 +4,10 @@ import android.system.Os
|
|||||||
import androidx.databinding.Bindable
|
import androidx.databinding.Bindable
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.topjohnwu.magisk.BR
|
import com.topjohnwu.magisk.BR
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.arch.AsyncLoadViewModel
|
import com.topjohnwu.magisk.arch.AsyncLoadViewModel
|
||||||
import com.topjohnwu.magisk.core.BuildConfig
|
import com.topjohnwu.magisk.core.BuildConfig
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.ktx.timeFormatStandard
|
import com.topjohnwu.magisk.core.ktx.timeFormatStandard
|
||||||
import com.topjohnwu.magisk.core.ktx.toTime
|
import com.topjohnwu.magisk.core.ktx.toTime
|
||||||
import com.topjohnwu.magisk.core.repository.LogRepository
|
import com.topjohnwu.magisk.core.repository.LogRepository
|
||||||
|
@ -10,6 +10,7 @@ import com.topjohnwu.magisk.core.model.su.SuLog
|
|||||||
import com.topjohnwu.magisk.databinding.DiffItem
|
import com.topjohnwu.magisk.databinding.DiffItem
|
||||||
import com.topjohnwu.magisk.databinding.ObservableRvItem
|
import com.topjohnwu.magisk.databinding.ObservableRvItem
|
||||||
import com.topjohnwu.magisk.databinding.set
|
import com.topjohnwu.magisk.databinding.set
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class SuLogRvItem(val log: SuLog) : ObservableRvItem(), DiffItem<SuLogRvItem> {
|
class SuLogRvItem(val log: SuLog) : ObservableRvItem(), DiffItem<SuLogRvItem> {
|
||||||
|
|
||||||
@ -31,20 +32,20 @@ class SuLogRvItem(val log: SuLog) : ObservableRvItem(), DiffItem<SuLogRvItem> {
|
|||||||
val res = AppContext.resources
|
val res = AppContext.resources
|
||||||
val sb = StringBuilder()
|
val sb = StringBuilder()
|
||||||
val date = log.time.toTime(timeDateFormat)
|
val date = log.time.toTime(timeDateFormat)
|
||||||
val toUid = res.getString(R.string.target_uid, log.toUid)
|
val toUid = res.getString(CoreR.string.target_uid, log.toUid)
|
||||||
val fromPid = res.getString(R.string.pid, log.fromPid)
|
val fromPid = res.getString(CoreR.string.pid, log.fromPid)
|
||||||
sb.append("$date\n$toUid $fromPid")
|
sb.append("$date\n$toUid $fromPid")
|
||||||
if (log.target != -1) {
|
if (log.target != -1) {
|
||||||
val pid = if (log.target == 0) "magiskd" else log.target.toString()
|
val pid = if (log.target == 0) "magiskd" else log.target.toString()
|
||||||
val target = res.getString(R.string.target_pid, pid)
|
val target = res.getString(CoreR.string.target_pid, pid)
|
||||||
sb.append(" $target")
|
sb.append(" $target")
|
||||||
}
|
}
|
||||||
if (log.context.isNotEmpty()) {
|
if (log.context.isNotEmpty()) {
|
||||||
val context = res.getString(R.string.selinux_context, log.context)
|
val context = res.getString(CoreR.string.selinux_context, log.context)
|
||||||
sb.append("\n$context")
|
sb.append("\n$context")
|
||||||
}
|
}
|
||||||
if (log.gids.isNotEmpty()) {
|
if (log.gids.isNotEmpty()) {
|
||||||
val gids = res.getString(R.string.supp_group, log.gids)
|
val gids = res.getString(CoreR.string.supp_group, log.gids)
|
||||||
sb.append("\n$gids")
|
sb.append("\n$gids")
|
||||||
}
|
}
|
||||||
sb.append("\n${log.command}")
|
sb.append("\n${log.command}")
|
||||||
|
@ -11,6 +11,7 @@ import rikka.recyclerview.addEdgeSpacing
|
|||||||
import rikka.recyclerview.addInvalidateItemDecorationsObserver
|
import rikka.recyclerview.addInvalidateItemDecorationsObserver
|
||||||
import rikka.recyclerview.addItemSpacing
|
import rikka.recyclerview.addItemSpacing
|
||||||
import rikka.recyclerview.fixEdgeEffect
|
import rikka.recyclerview.fixEdgeEffect
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class ModuleFragment : BaseFragment<FragmentModuleMd2Binding>() {
|
class ModuleFragment : BaseFragment<FragmentModuleMd2Binding>() {
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ class ModuleFragment : BaseFragment<FragmentModuleMd2Binding>() {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
activity?.title = resources.getString(R.string.modules)
|
activity?.title = resources.getString(CoreR.string.modules)
|
||||||
viewModel.data.observe(this) {
|
viewModel.data.observe(this) {
|
||||||
it ?: return@observe
|
it ?: return@observe
|
||||||
val displayName = runCatching { it.displayName }.getOrNull() ?: return@observe
|
val displayName = runCatching { it.displayName }.getOrNull() ?: return@observe
|
||||||
|
@ -12,6 +12,7 @@ import com.topjohnwu.magisk.databinding.RvItem
|
|||||||
import com.topjohnwu.magisk.databinding.set
|
import com.topjohnwu.magisk.databinding.set
|
||||||
import com.topjohnwu.magisk.utils.TextHolder
|
import com.topjohnwu.magisk.utils.TextHolder
|
||||||
import com.topjohnwu.magisk.utils.asText
|
import com.topjohnwu.magisk.utils.asText
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
object InstallModule : RvItem(), DiffItem<InstallModule> {
|
object InstallModule : RvItem(), DiffItem<InstallModule> {
|
||||||
override val layoutRes = R.layout.item_module_download
|
override val layoutRes = R.layout.item_module_download
|
||||||
@ -36,9 +37,9 @@ class LocalModuleRvItem(
|
|||||||
(!Info.isZygiskEnabled && isZygisk)
|
(!Info.isZygiskEnabled && isZygisk)
|
||||||
noticeText =
|
noticeText =
|
||||||
when {
|
when {
|
||||||
zygiskUnloaded -> R.string.zygisk_module_unloaded.asText()
|
zygiskUnloaded -> CoreR.string.zygisk_module_unloaded.asText()
|
||||||
isRiru -> R.string.suspend_text_riru.asText(R.string.zygisk.asText())
|
isRiru -> CoreR.string.suspend_text_riru.asText(CoreR.string.zygisk.asText())
|
||||||
else -> R.string.suspend_text_zygisk.asText(R.string.zygisk.asText())
|
else -> CoreR.string.suspend_text_zygisk.asText(CoreR.string.zygisk.asText())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import com.topjohnwu.magisk.events.SnackbarEvent
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class ModuleViewModel : AsyncLoadViewModel() {
|
class ModuleViewModel : AsyncLoadViewModel() {
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ class ModuleViewModel : AsyncLoadViewModel() {
|
|||||||
if (item != null && Info.isConnected.value == true) {
|
if (item != null && Info.isConnected.value == true) {
|
||||||
withExternalRW { OnlineModuleInstallDialog(item).show() }
|
withExternalRW { OnlineModuleInstallDialog(item).show() }
|
||||||
} else {
|
} else {
|
||||||
SnackbarEvent(R.string.no_connection).publish()
|
SnackbarEvent(CoreR.string.no_connection).publish()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun installPressed() = withExternalRW {
|
fun installPressed() = withExternalRW {
|
||||||
|
@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding
|
|||||||
import rikka.recyclerview.addEdgeSpacing
|
import rikka.recyclerview.addEdgeSpacing
|
||||||
import rikka.recyclerview.addItemSpacing
|
import rikka.recyclerview.addItemSpacing
|
||||||
import rikka.recyclerview.fixEdgeEffect
|
import rikka.recyclerview.fixEdgeEffect
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class SettingsFragment : BaseFragment<FragmentSettingsMd2Binding>() {
|
class SettingsFragment : BaseFragment<FragmentSettingsMd2Binding>() {
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ class SettingsFragment : BaseFragment<FragmentSettingsMd2Binding>() {
|
|||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
|
|
||||||
activity?.title = resources.getString(R.string.settings)
|
activity?.title = resources.getString(CoreR.string.settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
@ -26,11 +26,12 @@ import com.topjohnwu.magisk.view.MagiskDialog
|
|||||||
import com.topjohnwu.superuser.Shell
|
import com.topjohnwu.superuser.Shell
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
// --- Customization
|
// --- Customization
|
||||||
|
|
||||||
object Customization : BaseSettingsItem.Section() {
|
object Customization : BaseSettingsItem.Section() {
|
||||||
override val title = R.string.settings_customization.asText()
|
override val title = CoreR.string.settings_customization.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
object Language : BaseSettingsItem.Selector() {
|
object Language : BaseSettingsItem.Selector() {
|
||||||
@ -41,7 +42,7 @@ object Language : BaseSettingsItem.Selector() {
|
|||||||
Config.locale = entryValues[value]
|
Config.locale = entryValues[value]
|
||||||
}
|
}
|
||||||
|
|
||||||
override val title = R.string.language.asText()
|
override val title = CoreR.string.language.asText()
|
||||||
|
|
||||||
private var entries = emptyArray<String>()
|
private var entries = emptyArray<String>()
|
||||||
private var entryValues = emptyArray<String>()
|
private var entryValues = emptyArray<String>()
|
||||||
@ -70,18 +71,18 @@ object Language : BaseSettingsItem.Selector() {
|
|||||||
|
|
||||||
object Theme : BaseSettingsItem.Blank() {
|
object Theme : BaseSettingsItem.Blank() {
|
||||||
override val icon = R.drawable.ic_paint
|
override val icon = R.drawable.ic_paint
|
||||||
override val title = R.string.section_theme.asText()
|
override val title = CoreR.string.section_theme.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- App
|
// --- App
|
||||||
|
|
||||||
object AppSettings : BaseSettingsItem.Section() {
|
object AppSettings : BaseSettingsItem.Section() {
|
||||||
override val title = R.string.home_app_title.asText()
|
override val title = CoreR.string.home_app_title.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
object Hide : BaseSettingsItem.Input() {
|
object Hide : BaseSettingsItem.Input() {
|
||||||
override val title = R.string.settings_hide_app_title.asText()
|
override val title = CoreR.string.settings_hide_app_title.asText()
|
||||||
override val description = R.string.settings_hide_app_summary.asText()
|
override val description = CoreR.string.settings_hide_app_summary.asText()
|
||||||
override var value = ""
|
override var value = ""
|
||||||
|
|
||||||
override val inputResult
|
override val inputResult
|
||||||
@ -103,14 +104,14 @@ object Hide : BaseSettingsItem.Input() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object Restore : BaseSettingsItem.Blank() {
|
object Restore : BaseSettingsItem.Blank() {
|
||||||
override val title = R.string.settings_restore_app_title.asText()
|
override val title = CoreR.string.settings_restore_app_title.asText()
|
||||||
override val description = R.string.settings_restore_app_summary.asText()
|
override val description = CoreR.string.settings_restore_app_summary.asText()
|
||||||
|
|
||||||
override fun onPressed(view: View, handler: Handler) {
|
override fun onPressed(view: View, handler: Handler) {
|
||||||
handler.onItemPressed(view, this) {
|
handler.onItemPressed(view, this) {
|
||||||
MagiskDialog(view.activity).apply {
|
MagiskDialog(view.activity).apply {
|
||||||
setTitle(R.string.settings_restore_app_title)
|
setTitle(CoreR.string.settings_restore_app_title)
|
||||||
setMessage(R.string.restore_app_confirmation)
|
setMessage(CoreR.string.restore_app_confirmation)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||||
text = android.R.string.ok
|
text = android.R.string.ok
|
||||||
onClick {
|
onClick {
|
||||||
@ -128,8 +129,8 @@ object Restore : BaseSettingsItem.Blank() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object AddShortcut : BaseSettingsItem.Blank() {
|
object AddShortcut : BaseSettingsItem.Blank() {
|
||||||
override val title = R.string.add_shortcut_title.asText()
|
override val title = CoreR.string.add_shortcut_title.asText()
|
||||||
override val description = R.string.setting_add_shortcut_summary.asText()
|
override val description = CoreR.string.setting_add_shortcut_summary.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
object DownloadPath : BaseSettingsItem.Input() {
|
object DownloadPath : BaseSettingsItem.Input() {
|
||||||
@ -140,7 +141,7 @@ object DownloadPath : BaseSettingsItem.Input() {
|
|||||||
notifyPropertyChanged(BR.description)
|
notifyPropertyChanged(BR.description)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val title = R.string.settings_download_path_title.asText()
|
override val title = CoreR.string.settings_download_path_title.asText()
|
||||||
override val description get() = MediaStoreUtils.fullPath(value).asText()
|
override val description get() = MediaStoreUtils.fullPath(value).asText()
|
||||||
|
|
||||||
override var inputResult: String = value
|
override var inputResult: String = value
|
||||||
@ -161,9 +162,9 @@ object UpdateChannel : BaseSettingsItem.Selector() {
|
|||||||
Info.remote = Info.EMPTY_REMOTE
|
Info.remote = Info.EMPTY_REMOTE
|
||||||
}
|
}
|
||||||
|
|
||||||
override val title = R.string.settings_update_channel_title.asText()
|
override val title = CoreR.string.settings_update_channel_title.asText()
|
||||||
|
|
||||||
override val entryRes = R.array.update_channel
|
override val entryRes = CoreR.array.update_channel
|
||||||
override fun entries(res: Resources): Array<String> {
|
override fun entries(res: Resources): Array<String> {
|
||||||
return super.entries(res).let {
|
return super.entries(res).let {
|
||||||
if (!Const.APP_IS_CANARY && !BuildConfig.DEBUG)
|
if (!Const.APP_IS_CANARY && !BuildConfig.DEBUG)
|
||||||
@ -174,7 +175,7 @@ object UpdateChannel : BaseSettingsItem.Selector() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object UpdateChannelUrl : BaseSettingsItem.Input() {
|
object UpdateChannelUrl : BaseSettingsItem.Input() {
|
||||||
override val title = R.string.settings_update_custom.asText()
|
override val title = CoreR.string.settings_update_custom.asText()
|
||||||
override val description get() = value.asText()
|
override val description get() = value.asText()
|
||||||
override var value
|
override var value
|
||||||
get() = Config.customChannelUrl
|
get() = Config.customChannelUrl
|
||||||
@ -196,39 +197,39 @@ object UpdateChannelUrl : BaseSettingsItem.Input() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object UpdateChecker : BaseSettingsItem.Toggle() {
|
object UpdateChecker : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_check_update_title.asText()
|
override val title = CoreR.string.settings_check_update_title.asText()
|
||||||
override val description = R.string.settings_check_update_summary.asText()
|
override val description = CoreR.string.settings_check_update_summary.asText()
|
||||||
override var value by Config::checkUpdate
|
override var value by Config::checkUpdate
|
||||||
}
|
}
|
||||||
|
|
||||||
object DoHToggle : BaseSettingsItem.Toggle() {
|
object DoHToggle : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_doh_title.asText()
|
override val title = CoreR.string.settings_doh_title.asText()
|
||||||
override val description = R.string.settings_doh_description.asText()
|
override val description = CoreR.string.settings_doh_description.asText()
|
||||||
override var value by Config::doh
|
override var value by Config::doh
|
||||||
}
|
}
|
||||||
|
|
||||||
object SystemlessHosts : BaseSettingsItem.Blank() {
|
object SystemlessHosts : BaseSettingsItem.Blank() {
|
||||||
override val title = R.string.settings_hosts_title.asText()
|
override val title = CoreR.string.settings_hosts_title.asText()
|
||||||
override val description = R.string.settings_hosts_summary.asText()
|
override val description = CoreR.string.settings_hosts_summary.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
object RandNameToggle : BaseSettingsItem.Toggle() {
|
object RandNameToggle : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_random_name_title.asText()
|
override val title = CoreR.string.settings_random_name_title.asText()
|
||||||
override val description = R.string.settings_random_name_description.asText()
|
override val description = CoreR.string.settings_random_name_description.asText()
|
||||||
override var value by Config::randName
|
override var value by Config::randName
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Magisk
|
// --- Magisk
|
||||||
|
|
||||||
object Magisk : BaseSettingsItem.Section() {
|
object Magisk : BaseSettingsItem.Section() {
|
||||||
override val title = R.string.magisk.asText()
|
override val title = CoreR.string.magisk.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
object Zygisk : BaseSettingsItem.Toggle() {
|
object Zygisk : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.zygisk.asText()
|
override val title = CoreR.string.zygisk.asText()
|
||||||
override val description get() =
|
override val description get() =
|
||||||
if (mismatch) R.string.reboot_apply_change.asText()
|
if (mismatch) CoreR.string.reboot_apply_change.asText()
|
||||||
else R.string.settings_zygisk_summary.asText()
|
else CoreR.string.settings_zygisk_summary.asText()
|
||||||
override var value
|
override var value
|
||||||
get() = Config.zygisk
|
get() = Config.zygisk
|
||||||
set(value) {
|
set(value) {
|
||||||
@ -239,8 +240,8 @@ object Zygisk : BaseSettingsItem.Toggle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object DenyList : BaseSettingsItem.Toggle() {
|
object DenyList : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_denylist_title.asText()
|
override val title = CoreR.string.settings_denylist_title.asText()
|
||||||
override val description get() = R.string.settings_denylist_summary.asText()
|
override val description get() = CoreR.string.settings_denylist_summary.asText()
|
||||||
|
|
||||||
override var value = Config.denyList
|
override var value = Config.denyList
|
||||||
set(value) {
|
set(value) {
|
||||||
@ -258,45 +259,45 @@ object DenyList : BaseSettingsItem.Toggle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object DenyListConfig : BaseSettingsItem.Blank() {
|
object DenyListConfig : BaseSettingsItem.Blank() {
|
||||||
override val title = R.string.settings_denylist_config_title.asText()
|
override val title = CoreR.string.settings_denylist_config_title.asText()
|
||||||
override val description = R.string.settings_denylist_config_summary.asText()
|
override val description = CoreR.string.settings_denylist_config_summary.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Superuser
|
// --- Superuser
|
||||||
|
|
||||||
object Tapjack : BaseSettingsItem.Toggle() {
|
object Tapjack : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_su_tapjack_title.asText()
|
override val title = CoreR.string.settings_su_tapjack_title.asText()
|
||||||
override val description = R.string.settings_su_tapjack_summary.asText()
|
override val description = CoreR.string.settings_su_tapjack_summary.asText()
|
||||||
override var value by Config::suTapjack
|
override var value by Config::suTapjack
|
||||||
}
|
}
|
||||||
|
|
||||||
object Authentication : BaseSettingsItem.Toggle() {
|
object Authentication : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_su_auth_title.asText()
|
override val title = CoreR.string.settings_su_auth_title.asText()
|
||||||
override var description = R.string.settings_su_auth_summary.asText()
|
override var description = CoreR.string.settings_su_auth_summary.asText()
|
||||||
override var value by Config::suAuth
|
override var value by Config::suAuth
|
||||||
|
|
||||||
override fun refresh() {
|
override fun refresh() {
|
||||||
isEnabled = Info.isDeviceSecure
|
isEnabled = Info.isDeviceSecure
|
||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
description = R.string.settings_su_auth_insecure.asText()
|
description = CoreR.string.settings_su_auth_insecure.asText()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object Superuser : BaseSettingsItem.Section() {
|
object Superuser : BaseSettingsItem.Section() {
|
||||||
override val title = R.string.superuser.asText()
|
override val title = CoreR.string.superuser.asText()
|
||||||
}
|
}
|
||||||
|
|
||||||
object AccessMode : BaseSettingsItem.Selector() {
|
object AccessMode : BaseSettingsItem.Selector() {
|
||||||
override val title = R.string.superuser_access.asText()
|
override val title = CoreR.string.superuser_access.asText()
|
||||||
override val entryRes = R.array.su_access
|
override val entryRes = CoreR.array.su_access
|
||||||
override var value by Config::rootMode
|
override var value by Config::rootMode
|
||||||
}
|
}
|
||||||
|
|
||||||
object MultiuserMode : BaseSettingsItem.Selector() {
|
object MultiuserMode : BaseSettingsItem.Selector() {
|
||||||
override val title = R.string.multiuser_mode.asText()
|
override val title = CoreR.string.multiuser_mode.asText()
|
||||||
override val entryRes = R.array.multiuser_mode
|
override val entryRes = CoreR.array.multiuser_mode
|
||||||
override val descriptionRes = R.array.multiuser_summary
|
override val descriptionRes = CoreR.array.multiuser_summary
|
||||||
override var value by Config::suMultiuserMode
|
override var value by Config::suMultiuserMode
|
||||||
|
|
||||||
override fun refresh() {
|
override fun refresh() {
|
||||||
@ -305,21 +306,21 @@ object MultiuserMode : BaseSettingsItem.Selector() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object MountNamespaceMode : BaseSettingsItem.Selector() {
|
object MountNamespaceMode : BaseSettingsItem.Selector() {
|
||||||
override val title = R.string.mount_namespace_mode.asText()
|
override val title = CoreR.string.mount_namespace_mode.asText()
|
||||||
override val entryRes = R.array.namespace
|
override val entryRes = CoreR.array.namespace
|
||||||
override val descriptionRes = R.array.namespace_summary
|
override val descriptionRes = CoreR.array.namespace_summary
|
||||||
override var value by Config::suMntNamespaceMode
|
override var value by Config::suMntNamespaceMode
|
||||||
}
|
}
|
||||||
|
|
||||||
object AutomaticResponse : BaseSettingsItem.Selector() {
|
object AutomaticResponse : BaseSettingsItem.Selector() {
|
||||||
override val title = R.string.auto_response.asText()
|
override val title = CoreR.string.auto_response.asText()
|
||||||
override val entryRes = R.array.auto_response
|
override val entryRes = CoreR.array.auto_response
|
||||||
override var value by Config::suAutoResponse
|
override var value by Config::suAutoResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
object RequestTimeout : BaseSettingsItem.Selector() {
|
object RequestTimeout : BaseSettingsItem.Selector() {
|
||||||
override val title = R.string.request_timeout.asText()
|
override val title = CoreR.string.request_timeout.asText()
|
||||||
override val entryRes = R.array.request_timeout
|
override val entryRes = CoreR.array.request_timeout
|
||||||
|
|
||||||
private val entryValues = listOf(10, 15, 20, 30, 45, 60)
|
private val entryValues = listOf(10, 15, 20, 30, 45, 60)
|
||||||
override var value = entryValues.indexOfFirst { it == Config.suDefaultTimeout }
|
override var value = entryValues.indexOfFirst { it == Config.suDefaultTimeout }
|
||||||
@ -330,14 +331,14 @@ object RequestTimeout : BaseSettingsItem.Selector() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object SUNotification : BaseSettingsItem.Selector() {
|
object SUNotification : BaseSettingsItem.Selector() {
|
||||||
override val title = R.string.superuser_notification.asText()
|
override val title = CoreR.string.superuser_notification.asText()
|
||||||
override val entryRes = R.array.su_notification
|
override val entryRes = CoreR.array.su_notification
|
||||||
override var value by Config::suNotification
|
override var value by Config::suNotification
|
||||||
}
|
}
|
||||||
|
|
||||||
object Reauthenticate : BaseSettingsItem.Toggle() {
|
object Reauthenticate : BaseSettingsItem.Toggle() {
|
||||||
override val title = R.string.settings_su_reauth_title.asText()
|
override val title = CoreR.string.settings_su_reauth_title.asText()
|
||||||
override val description = R.string.settings_su_reauth_summary.asText()
|
override val description = CoreR.string.settings_su_reauth_summary.asText()
|
||||||
override var value by Config::suReAuth
|
override var value by Config::suReAuth
|
||||||
|
|
||||||
override fun refresh() {
|
override fun refresh() {
|
||||||
|
@ -6,11 +6,11 @@ import android.widget.Toast
|
|||||||
import androidx.core.content.pm.ShortcutManagerCompat
|
import androidx.core.content.pm.ShortcutManagerCompat
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.topjohnwu.magisk.BR
|
import com.topjohnwu.magisk.BR
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.arch.BaseViewModel
|
import com.topjohnwu.magisk.arch.BaseViewModel
|
||||||
import com.topjohnwu.magisk.core.BuildConfig
|
import com.topjohnwu.magisk.core.BuildConfig
|
||||||
import com.topjohnwu.magisk.core.Const
|
import com.topjohnwu.magisk.core.Const
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.di.AppContext
|
import com.topjohnwu.magisk.core.di.AppContext
|
||||||
import com.topjohnwu.magisk.core.isRunningAsStub
|
import com.topjohnwu.magisk.core.isRunningAsStub
|
||||||
import com.topjohnwu.magisk.core.ktx.activity
|
import com.topjohnwu.magisk.core.ktx.activity
|
||||||
|
@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding
|
|||||||
import rikka.recyclerview.addEdgeSpacing
|
import rikka.recyclerview.addEdgeSpacing
|
||||||
import rikka.recyclerview.addItemSpacing
|
import rikka.recyclerview.addItemSpacing
|
||||||
import rikka.recyclerview.fixEdgeEffect
|
import rikka.recyclerview.fixEdgeEffect
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class SuperuserFragment : BaseFragment<FragmentSuperuserMd2Binding>() {
|
class SuperuserFragment : BaseFragment<FragmentSuperuserMd2Binding>() {
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ class SuperuserFragment : BaseFragment<FragmentSuperuserMd2Binding>() {
|
|||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
activity?.title = resources.getString(R.string.superuser)
|
activity?.title = resources.getString(CoreR.string.superuser)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
@ -8,10 +8,10 @@ import androidx.databinding.Bindable
|
|||||||
import androidx.databinding.ObservableArrayList
|
import androidx.databinding.ObservableArrayList
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.topjohnwu.magisk.BR
|
import com.topjohnwu.magisk.BR
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.arch.AsyncLoadViewModel
|
import com.topjohnwu.magisk.arch.AsyncLoadViewModel
|
||||||
import com.topjohnwu.magisk.core.Config
|
import com.topjohnwu.magisk.core.Config
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.data.magiskdb.PolicyDao
|
import com.topjohnwu.magisk.core.data.magiskdb.PolicyDao
|
||||||
import com.topjohnwu.magisk.core.di.AppContext
|
import com.topjohnwu.magisk.core.di.AppContext
|
||||||
import com.topjohnwu.magisk.core.ktx.getLabel
|
import com.topjohnwu.magisk.core.ktx.getLabel
|
||||||
|
@ -17,9 +17,9 @@ import android.widget.Toast
|
|||||||
import androidx.databinding.Bindable
|
import androidx.databinding.Bindable
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.topjohnwu.magisk.BR
|
import com.topjohnwu.magisk.BR
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.arch.BaseViewModel
|
import com.topjohnwu.magisk.arch.BaseViewModel
|
||||||
import com.topjohnwu.magisk.core.Config
|
import com.topjohnwu.magisk.core.Config
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.data.magiskdb.PolicyDao
|
import com.topjohnwu.magisk.core.data.magiskdb.PolicyDao
|
||||||
import com.topjohnwu.magisk.core.di.AppContext
|
import com.topjohnwu.magisk.core.di.AppContext
|
||||||
import com.topjohnwu.magisk.core.ktx.getLabel
|
import com.topjohnwu.magisk.core.ktx.getLabel
|
||||||
|
@ -12,6 +12,7 @@ import com.topjohnwu.magisk.arch.BaseFragment
|
|||||||
import com.topjohnwu.magisk.arch.viewModel
|
import com.topjohnwu.magisk.arch.viewModel
|
||||||
import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding
|
import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding
|
||||||
import com.topjohnwu.magisk.databinding.ItemThemeBindingImpl
|
import com.topjohnwu.magisk.databinding.ItemThemeBindingImpl
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class ThemeFragment : BaseFragment<FragmentThemeMd2Binding>() {
|
class ThemeFragment : BaseFragment<FragmentThemeMd2Binding>() {
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ class ThemeFragment : BaseFragment<FragmentThemeMd2Binding>() {
|
|||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
|
|
||||||
activity?.title = getString(R.string.section_theme)
|
activity?.title = getString(CoreR.string.section_theme)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package com.topjohnwu.magisk.view
|
|||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.R
|
||||||
import com.topjohnwu.magisk.databinding.DiffItem
|
import com.topjohnwu.magisk.databinding.DiffItem
|
||||||
import com.topjohnwu.magisk.databinding.RvItem
|
import com.topjohnwu.magisk.databinding.RvItem
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
sealed class TappableHeadlineItem : RvItem(), DiffItem<TappableHeadlineItem> {
|
sealed class TappableHeadlineItem : RvItem(), DiffItem<TappableHeadlineItem> {
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ sealed class TappableHeadlineItem : RvItem(), DiffItem<TappableHeadlineItem> {
|
|||||||
// --- objects
|
// --- objects
|
||||||
|
|
||||||
object ThemeMode : TappableHeadlineItem() {
|
object ThemeMode : TappableHeadlineItem() {
|
||||||
override val title = R.string.settings_dark_mode_title
|
override val title = CoreR.string.settings_dark_mode_title
|
||||||
override val icon = R.drawable.ic_day_night
|
override val icon = R.drawable.ic_day_night
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ org.gradle.caching=true
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
android.nonFinalResIds=false
|
android.nonFinalResIds=false
|
||||||
android.nonTransitiveRClass=false
|
|
||||||
|
|
||||||
# Magisk
|
# Magisk
|
||||||
magisk.stubVersion=39
|
magisk.stubVersion=39
|
||||||
|
Loading…
x
Reference in New Issue
Block a user