From af5c4d09c4ac16ad9429950a9bc9c9f0cf2d2360 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 6 Jul 2024 01:31:43 -0700 Subject: [PATCH] Re-enable nonTransitiveRClass --- .../topjohnwu/magisk/arch/BaseViewModel.kt | 2 +- .../magisk/dialog/DarkThemeDialog.kt | 11 +- .../topjohnwu/magisk/dialog/EnvFixDialog.kt | 2 +- .../magisk/dialog/LocalModuleInstallDialog.kt | 2 +- .../magisk/dialog/ManagerInstallDialog.kt | 2 +- .../topjohnwu/magisk/dialog/MarkDownDialog.kt | 3 +- .../dialog/OnlineModuleInstallDialog.kt | 2 +- .../magisk/dialog/SecondSlotWarningDialog.kt | 2 +- .../magisk/dialog/SuperuserRevokeDialog.kt | 2 +- .../magisk/dialog/UninstallDialog.kt | 2 +- .../com/topjohnwu/magisk/ui/MainActivity.kt | 21 ++-- .../com/topjohnwu/magisk/ui/SplashActivity.kt | 9 +- .../magisk/ui/deny/DenyListFragment.kt | 5 +- .../magisk/ui/flash/FlashFragment.kt | 9 +- .../topjohnwu/magisk/ui/home/DeveloperItem.kt | 21 ++-- .../topjohnwu/magisk/ui/home/HomeFragment.kt | 3 +- .../topjohnwu/magisk/ui/home/HomeViewModel.kt | 13 ++- .../magisk/ui/install/InstallFragment.kt | 3 +- .../magisk/ui/install/InstallViewModel.kt | 3 +- .../topjohnwu/magisk/ui/log/LogFragment.kt | 3 +- .../topjohnwu/magisk/ui/log/LogViewModel.kt | 2 +- .../topjohnwu/magisk/ui/log/SuLogRvItem.kt | 11 +- .../magisk/ui/module/ModuleFragment.kt | 3 +- .../magisk/ui/module/ModuleRvItem.kt | 7 +- .../magisk/ui/module/ModuleViewModel.kt | 3 +- .../magisk/ui/settings/SettingsFragment.kt | 3 +- .../magisk/ui/settings/SettingsItems.kt | 109 +++++++++--------- .../magisk/ui/settings/SettingsViewModel.kt | 2 +- .../magisk/ui/superuser/SuperuserFragment.kt | 3 +- .../magisk/ui/superuser/SuperuserViewModel.kt | 2 +- .../magisk/ui/surequest/SuRequestViewModel.kt | 2 +- .../magisk/ui/theme/ThemeFragment.kt | 3 +- .../magisk/view/TappableHeadlineItem.kt | 3 +- gradle.properties | 1 - 34 files changed, 147 insertions(+), 127 deletions(-) diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt index 5db8c8ac5..601777f22 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt @@ -10,7 +10,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel 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.events.BackPressEvent import com.topjohnwu.magisk.events.DialogBuilder diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/DarkThemeDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/DarkThemeDialog.kt index 63f1b7b27..68e951486 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/DarkThemeDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/DarkThemeDialog.kt @@ -7,26 +7,27 @@ import com.topjohnwu.magisk.arch.UIActivity import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.events.DialogBuilder import com.topjohnwu.magisk.view.MagiskDialog +import com.topjohnwu.magisk.core.R as CoreR class DarkThemeDialog : DialogBuilder { override fun build(dialog: MagiskDialog) { val activity = dialog.ownerActivity!! dialog.apply { - setTitle(R.string.settings_dark_mode_title) - setMessage(R.string.settings_dark_mode_message) + setTitle(CoreR.string.settings_dark_mode_title) + setMessage(CoreR.string.settings_dark_mode_message) setButton(MagiskDialog.ButtonType.POSITIVE) { - text = R.string.settings_dark_mode_light + text = CoreR.string.settings_dark_mode_light icon = R.drawable.ic_day onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_NO, activity) } } setButton(MagiskDialog.ButtonType.NEUTRAL) { - text = R.string.settings_dark_mode_system + text = CoreR.string.settings_dark_mode_system icon = R.drawable.ic_day_night onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, activity) } } setButton(MagiskDialog.ButtonType.NEGATIVE) { - text = R.string.settings_dark_mode_dark + text = CoreR.string.settings_dark_mode_dark icon = R.drawable.ic_night onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_YES, activity) } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/EnvFixDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/EnvFixDialog.kt index a7fc631e3..de52376ab 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/EnvFixDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/EnvFixDialog.kt @@ -1,9 +1,9 @@ package com.topjohnwu.magisk.dialog import androidx.lifecycle.lifecycleScope -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.BuildConfig import com.topjohnwu.magisk.core.Info +import com.topjohnwu.magisk.core.R import com.topjohnwu.magisk.core.tasks.MagiskInstaller import com.topjohnwu.magisk.events.DialogBuilder import com.topjohnwu.magisk.ui.home.HomeViewModel diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/LocalModuleInstallDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/LocalModuleInstallDialog.kt index cae990f52..44bbf3358 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/LocalModuleInstallDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/LocalModuleInstallDialog.kt @@ -2,8 +2,8 @@ package com.topjohnwu.magisk.dialog import android.net.Uri import com.topjohnwu.magisk.MainDirections -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.Const +import com.topjohnwu.magisk.core.R import com.topjohnwu.magisk.events.DialogBuilder import com.topjohnwu.magisk.ui.module.ModuleViewModel import com.topjohnwu.magisk.view.MagiskDialog diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/ManagerInstallDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/ManagerInstallDialog.kt index a02c040af..d861fa4bd 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/ManagerInstallDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/ManagerInstallDialog.kt @@ -1,7 +1,7 @@ package com.topjohnwu.magisk.dialog -import com.topjohnwu.magisk.R 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.ServiceLocator import com.topjohnwu.magisk.core.download.DownloadEngine diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/MarkDownDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/MarkDownDialog.kt index 0fe43b5b0..e3b0c81de 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/MarkDownDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/MarkDownDialog.kt @@ -13,6 +13,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import timber.log.Timber import java.io.IOException +import com.topjohnwu.magisk.core.R as CoreR abstract class MarkDownDialog : DialogBuilder { @@ -30,7 +31,7 @@ abstract class MarkDownDialog : DialogBuilder { ServiceLocator.markwon.setMarkdown(tv, text) } catch (e: IOException) { Timber.e(e) - tv.setText(R.string.download_file_error) + tv.setText(CoreR.string.download_file_error) } } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/OnlineModuleInstallDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/OnlineModuleInstallDialog.kt index c41ccae0c..2aa293977 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/OnlineModuleInstallDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/OnlineModuleInstallDialog.kt @@ -1,6 +1,6 @@ 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.download.DownloadEngine import com.topjohnwu.magisk.core.download.Subject diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SecondSlotWarningDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SecondSlotWarningDialog.kt index 3b4385a08..5529c4d98 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SecondSlotWarningDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SecondSlotWarningDialog.kt @@ -1,6 +1,6 @@ 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.view.MagiskDialog diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SuperuserRevokeDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SuperuserRevokeDialog.kt index 44b5687bd..ee30aef35 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SuperuserRevokeDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SuperuserRevokeDialog.kt @@ -1,6 +1,6 @@ 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.view.MagiskDialog diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/UninstallDialog.kt b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/UninstallDialog.kt index 1da85a696..c9968fbe5 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/dialog/UninstallDialog.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/dialog/UninstallDialog.kt @@ -3,8 +3,8 @@ package com.topjohnwu.magisk.dialog import android.app.ProgressDialog import android.content.Context import android.widget.Toast -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.NavigationActivity +import com.topjohnwu.magisk.core.R import com.topjohnwu.magisk.core.ktx.toast import com.topjohnwu.magisk.events.DialogBuilder import com.topjohnwu.magisk.ui.flash.FlashFragment diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt index cae384aeb..3be7c2da1 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt @@ -28,6 +28,7 @@ import com.topjohnwu.magisk.ui.home.HomeFragmentDirections import com.topjohnwu.magisk.view.MagiskDialog import com.topjohnwu.magisk.view.Shortcuts import java.io.File +import com.topjohnwu.magisk.core.R as CoreR class MainViewModel : BaseViewModel() @@ -167,8 +168,8 @@ class MainActivity : SplashActivity() { private fun showUnsupportedMessage() { if (Info.env.isUnsupported) { MagiskDialog(this).apply { - setTitle(R.string.unsupport_magisk_title) - setMessage(R.string.unsupport_magisk_msg, Const.Version.MIN_VERSION) + setTitle(CoreR.string.unsupport_magisk_title) + setMessage(CoreR.string.unsupport_magisk_msg, Const.Version.MIN_VERSION) setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok } setCancelable(false) }.show() @@ -179,8 +180,8 @@ class MainActivity : SplashActivity() { ?.filterNot { File("$it/magisk").exists() } ?.any { File("$it/su").exists() } == true) { MagiskDialog(this).apply { - setTitle(R.string.unsupport_general_title) - setMessage(R.string.unsupport_other_su_msg) + setTitle(CoreR.string.unsupport_general_title) + setMessage(CoreR.string.unsupport_other_su_msg) setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok } setCancelable(false) }.show() @@ -188,8 +189,8 @@ class MainActivity : SplashActivity() { if (applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0) { MagiskDialog(this).apply { - setTitle(R.string.unsupport_general_title) - setMessage(R.string.unsupport_system_app_msg) + setTitle(CoreR.string.unsupport_general_title) + setMessage(CoreR.string.unsupport_system_app_msg) setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok } setCancelable(false) }.show() @@ -197,8 +198,8 @@ class MainActivity : SplashActivity() { if (applicationInfo.flags and ApplicationInfo.FLAG_EXTERNAL_STORAGE != 0) { MagiskDialog(this).apply { - setTitle(R.string.unsupport_general_title) - setMessage(R.string.unsupport_external_storage_msg) + setTitle(CoreR.string.unsupport_general_title) + setMessage(CoreR.string.unsupport_external_storage_msg) setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok } setCancelable(false) }.show() @@ -211,8 +212,8 @@ class MainActivity : SplashActivity() { // Ask and show dialog Config.askedHome = true MagiskDialog(this).apply { - setTitle(R.string.add_shortcut_title) - setMessage(R.string.add_shortcut_msg) + setTitle(CoreR.string.add_shortcut_title) + setMessage(CoreR.string.add_shortcut_msg) setButton(MagiskDialog.ButtonType.NEGATIVE) { text = android.R.string.cancel } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt index 7dae89592..8693e54ef 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt @@ -34,6 +34,7 @@ import kotlinx.coroutines.launch import timber.log.Timber import java.io.File import java.io.IOException +import com.topjohnwu.magisk.core.R as CoreR @SuppressLint("CustomSplashScreen") abstract class SplashActivity : NavigationActivity() { @@ -82,14 +83,14 @@ abstract class SplashActivity : NavigationActivity(), MenuProvider { @@ -26,7 +27,7 @@ class DenyListFragment : BaseFragment(), MenuProvider { override fun onStart() { super.onStart() - activity?.setTitle(R.string.denylist) + activity?.setTitle(CoreR.string.denylist) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -58,7 +59,7 @@ class DenyListFragment : BaseFragment(), MenuProvider { override fun onCreateMenu(menu: Menu, inflater: MenuInflater) { inflater.inflate(R.menu.menu_deny_md2, menu) 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 { override fun onQueryTextSubmit(query: String?): Boolean { viewModel.query = query ?: "" diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt index 48dc0e481..b2e8cb8dd 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt @@ -21,6 +21,7 @@ import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.cmp import com.topjohnwu.magisk.databinding.FragmentFlashMd2Binding import com.topjohnwu.magisk.ui.MainActivity +import com.topjohnwu.magisk.core.R as CoreR class FlashFragment : BaseFragment(), MenuProvider { @@ -39,14 +40,14 @@ class FlashFragment : BaseFragment(), MenuProvider { override fun onStart() { super.onStart() - activity?.setTitle(R.string.flash_screen_title) + activity?.setTitle(CoreR.string.flash_screen_title) viewModel.state.observe(this) { activity?.supportActionBar?.setSubtitle( when (it) { - FlashViewModel.State.FLASHING -> R.string.flashing - FlashViewModel.State.SUCCESS -> R.string.done - FlashViewModel.State.FAILED -> R.string.failure + FlashViewModel.State.FLASHING -> CoreR.string.flashing + FlashViewModel.State.SUCCESS -> CoreR.string.done + FlashViewModel.State.FAILED -> CoreR.string.failure } ) if (it == FlashViewModel.State.SUCCESS && viewModel.showReboot) { diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt index caeab07b2..9da7c5095 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/DeveloperItem.kt @@ -3,6 +3,7 @@ package com.topjohnwu.magisk.ui.home import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.databinding.RvItem +import com.topjohnwu.magisk.core.R as CoreR interface Dev { val name: String @@ -84,8 +85,8 @@ sealed class IconLink : RvItem() { override val layoutRes get() = R.layout.item_icon_link abstract class PayPal : IconLink(), Dev { - override val icon get() = R.drawable.ic_paypal - override val title get() = R.string.paypal + override val icon get() = CoreR.drawable.ic_paypal + override val title get() = CoreR.string.paypal override val link get() = "https://paypal.me/$name" object Project : PayPal() { @@ -94,20 +95,20 @@ sealed class IconLink : RvItem() { } object Patreon : IconLink() { - override val icon get() = R.drawable.ic_patreon - override val title get() = R.string.patreon + override val icon get() = CoreR.drawable.ic_patreon + override val title get() = CoreR.string.patreon override val link get() = Const.Url.PATREON_URL } abstract class Twitter : IconLink(), Dev { - override val icon get() = R.drawable.ic_twitter - override val title get() = R.string.twitter + override val icon get() = CoreR.drawable.ic_twitter + override val title get() = CoreR.string.twitter override val link get() = "https://twitter.com/$name" } abstract class Github : IconLink() { - override val icon get() = R.drawable.ic_github - override val title get() = R.string.github + override val icon get() = CoreR.drawable.ic_github + override val title get() = CoreR.string.github abstract class User : Github(), Dev { override val link get() = "https://github.com/$name" @@ -119,8 +120,8 @@ sealed class IconLink : RvItem() { } abstract class Sponsor : IconLink(), Dev { - override val icon get() = R.drawable.ic_favorite - override val title get() = R.string.github + override val icon get() = CoreR.drawable.ic_favorite + override val title get() = CoreR.string.github override val link get() = "https://github.com/sponsors/$name" } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt index 0ea16ea2d..0c5a173aa 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt @@ -16,6 +16,7 @@ import com.topjohnwu.magisk.arch.viewModel import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.download.DownloadEngine import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding +import com.topjohnwu.magisk.core.R as CoreR class HomeFragment : BaseFragment(), MenuProvider { @@ -24,7 +25,7 @@ class HomeFragment : BaseFragment(), MenuProvider { override fun onStart() { super.onStart() - activity?.setTitle(R.string.section_home) + activity?.setTitle(CoreR.string.section_home) DownloadEngine.observeProgress(this, viewModel::onProgressUpdate) } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index 176c3523f..f46f09ad2 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -30,6 +30,7 @@ import com.topjohnwu.magisk.events.SnackbarEvent import com.topjohnwu.magisk.utils.asText import com.topjohnwu.superuser.Shell import kotlin.math.roundToInt +import com.topjohnwu.magisk.core.R as CoreR class HomeViewModel( private val svc: NetworkService @@ -65,11 +66,11 @@ class HomeViewModel( if (isActive) ("$versionString ($versionCode)" + if (isDebug) " (D)" else "").asText() else - R.string.not_available.asText() + CoreR.string.not_available.asText() } @get:Bindable - var managerRemoteVersion = R.string.loading.asText() + var managerRemoteVersion = CoreR.string.loading.asText() set(value) = set(value, field, { field = it }, BR.managerRemoteVersion) val managerInstalledVersion @@ -102,7 +103,7 @@ class HomeViewModel( if (isDebug) " (D)" else "").asText() } ?: run { appState = State.INVALID - managerRemoteVersion = R.string.not_available.asText() + managerRemoteVersion = CoreR.string.not_available.asText() } ensureEnv() } @@ -121,7 +122,7 @@ class HomeViewModel( try { context.startActivity(intent) } 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() @@ -129,8 +130,8 @@ class HomeViewModel( fun onDeletePressed() = UninstallDialog().show() fun onManagerPressed() = when (appState) { - State.LOADING -> SnackbarEvent(R.string.loading).publish() - State.INVALID -> SnackbarEvent(R.string.no_connection).publish() + State.LOADING -> SnackbarEvent(CoreR.string.loading).publish() + State.INVALID -> SnackbarEvent(CoreR.string.no_connection).publish() else -> withExternalRW { withInstallPermission { ManagerInstallDialog().show() diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt index e2ad408d3..2b7307d61 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt @@ -4,6 +4,7 @@ import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.BaseFragment import com.topjohnwu.magisk.arch.viewModel import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding +import com.topjohnwu.magisk.core.R as CoreR class InstallFragment : BaseFragment() { @@ -12,6 +13,6 @@ class InstallFragment : BaseFragment() { override fun onStart() { super.onStart() - requireActivity().setTitle(R.string.install) + requireActivity().setTitle(CoreR.string.install) } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt index 832cf806d..cd1a50a92 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt @@ -33,6 +33,7 @@ import kotlinx.parcelize.Parcelize import timber.log.Timber import java.io.File import java.io.IOException +import com.topjohnwu.magisk.core.R as CoreR class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel() { @@ -121,7 +122,7 @@ class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel() @Parcelize class UriCallback : ContentResultCallback { 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) { uri.value = result diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt index da2bef5a3..963768b9e 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt @@ -16,6 +16,7 @@ import com.topjohnwu.magisk.utils.MotionRevealHelper import rikka.recyclerview.addEdgeSpacing import rikka.recyclerview.addItemSpacing import rikka.recyclerview.fixEdgeEffect +import com.topjohnwu.magisk.core.R as CoreR class LogFragment : BaseFragment(), MenuProvider { @@ -41,7 +42,7 @@ class LogFragment : BaseFragment(), MenuProvider { override fun onStart() { super.onStart() - activity?.setTitle(R.string.logs) + activity?.setTitle(CoreR.string.logs) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt index fdb1edce1..928a6f823 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt @@ -4,10 +4,10 @@ import android.system.Os import androidx.databinding.Bindable import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.AsyncLoadViewModel import com.topjohnwu.magisk.core.BuildConfig 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.toTime import com.topjohnwu.magisk.core.repository.LogRepository diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/SuLogRvItem.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/SuLogRvItem.kt index 65d1c51c2..35ac99b8f 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/SuLogRvItem.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/SuLogRvItem.kt @@ -10,6 +10,7 @@ import com.topjohnwu.magisk.core.model.su.SuLog import com.topjohnwu.magisk.databinding.DiffItem import com.topjohnwu.magisk.databinding.ObservableRvItem import com.topjohnwu.magisk.databinding.set +import com.topjohnwu.magisk.core.R as CoreR class SuLogRvItem(val log: SuLog) : ObservableRvItem(), DiffItem { @@ -31,20 +32,20 @@ class SuLogRvItem(val log: SuLog) : ObservableRvItem(), DiffItem { val res = AppContext.resources val sb = StringBuilder() val date = log.time.toTime(timeDateFormat) - val toUid = res.getString(R.string.target_uid, log.toUid) - val fromPid = res.getString(R.string.pid, log.fromPid) + val toUid = res.getString(CoreR.string.target_uid, log.toUid) + val fromPid = res.getString(CoreR.string.pid, log.fromPid) sb.append("$date\n$toUid $fromPid") if (log.target != -1) { 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") } 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") } 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${log.command}") diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt index 8c8ea9fdb..c2e7b3ff5 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt @@ -11,6 +11,7 @@ import rikka.recyclerview.addEdgeSpacing import rikka.recyclerview.addInvalidateItemDecorationsObserver import rikka.recyclerview.addItemSpacing import rikka.recyclerview.fixEdgeEffect +import com.topjohnwu.magisk.core.R as CoreR class ModuleFragment : BaseFragment() { @@ -19,7 +20,7 @@ class ModuleFragment : BaseFragment() { override fun onStart() { super.onStart() - activity?.title = resources.getString(R.string.modules) + activity?.title = resources.getString(CoreR.string.modules) viewModel.data.observe(this) { it ?: return@observe val displayName = runCatching { it.displayName }.getOrNull() ?: return@observe diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt index 95d3d5ecc..a0c6d4535 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleRvItem.kt @@ -12,6 +12,7 @@ import com.topjohnwu.magisk.databinding.RvItem import com.topjohnwu.magisk.databinding.set import com.topjohnwu.magisk.utils.TextHolder import com.topjohnwu.magisk.utils.asText +import com.topjohnwu.magisk.core.R as CoreR object InstallModule : RvItem(), DiffItem { override val layoutRes = R.layout.item_module_download @@ -36,9 +37,9 @@ class LocalModuleRvItem( (!Info.isZygiskEnabled && isZygisk) noticeText = when { - zygiskUnloaded -> R.string.zygisk_module_unloaded.asText() - isRiru -> R.string.suspend_text_riru.asText(R.string.zygisk.asText()) - else -> R.string.suspend_text_zygisk.asText(R.string.zygisk.asText()) + zygiskUnloaded -> CoreR.string.zygisk_module_unloaded.asText() + isRiru -> CoreR.string.suspend_text_riru.asText(CoreR.string.zygisk.asText()) + else -> CoreR.string.suspend_text_zygisk.asText(CoreR.string.zygisk.asText()) } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt index b2379d9a4..4ee7c9369 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt @@ -22,6 +22,7 @@ import com.topjohnwu.magisk.events.SnackbarEvent import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.parcelize.Parcelize +import com.topjohnwu.magisk.core.R as CoreR class ModuleViewModel : AsyncLoadViewModel() { @@ -77,7 +78,7 @@ class ModuleViewModel : AsyncLoadViewModel() { if (item != null && Info.isConnected.value == true) { withExternalRW { OnlineModuleInstallDialog(item).show() } } else { - SnackbarEvent(R.string.no_connection).publish() + SnackbarEvent(CoreR.string.no_connection).publish() } fun installPressed() = withExternalRW { diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt index a41f7b72f..0a92a94dd 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt @@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding import rikka.recyclerview.addEdgeSpacing import rikka.recyclerview.addItemSpacing import rikka.recyclerview.fixEdgeEffect +import com.topjohnwu.magisk.core.R as CoreR class SettingsFragment : BaseFragment() { @@ -19,7 +20,7 @@ class SettingsFragment : BaseFragment() { override fun onStart() { super.onStart() - activity?.title = resources.getString(R.string.settings) + activity?.title = resources.getString(CoreR.string.settings) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt index 9f9908fe3..b18b712a3 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt @@ -26,11 +26,12 @@ import com.topjohnwu.magisk.view.MagiskDialog import com.topjohnwu.superuser.Shell import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch +import com.topjohnwu.magisk.core.R as CoreR // --- Customization object Customization : BaseSettingsItem.Section() { - override val title = R.string.settings_customization.asText() + override val title = CoreR.string.settings_customization.asText() } object Language : BaseSettingsItem.Selector() { @@ -41,7 +42,7 @@ object Language : BaseSettingsItem.Selector() { Config.locale = entryValues[value] } - override val title = R.string.language.asText() + override val title = CoreR.string.language.asText() private var entries = emptyArray() private var entryValues = emptyArray() @@ -70,18 +71,18 @@ object Language : BaseSettingsItem.Selector() { object Theme : BaseSettingsItem.Blank() { override val icon = R.drawable.ic_paint - override val title = R.string.section_theme.asText() + override val title = CoreR.string.section_theme.asText() } // --- App 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() { - override val title = R.string.settings_hide_app_title.asText() - override val description = R.string.settings_hide_app_summary.asText() + override val title = CoreR.string.settings_hide_app_title.asText() + override val description = CoreR.string.settings_hide_app_summary.asText() override var value = "" override val inputResult @@ -103,14 +104,14 @@ object Hide : BaseSettingsItem.Input() { } object Restore : BaseSettingsItem.Blank() { - override val title = R.string.settings_restore_app_title.asText() - override val description = R.string.settings_restore_app_summary.asText() + override val title = CoreR.string.settings_restore_app_title.asText() + override val description = CoreR.string.settings_restore_app_summary.asText() override fun onPressed(view: View, handler: Handler) { handler.onItemPressed(view, this) { MagiskDialog(view.activity).apply { - setTitle(R.string.settings_restore_app_title) - setMessage(R.string.restore_app_confirmation) + setTitle(CoreR.string.settings_restore_app_title) + setMessage(CoreR.string.restore_app_confirmation) setButton(MagiskDialog.ButtonType.POSITIVE) { text = android.R.string.ok onClick { @@ -128,8 +129,8 @@ object Restore : BaseSettingsItem.Blank() { } object AddShortcut : BaseSettingsItem.Blank() { - override val title = R.string.add_shortcut_title.asText() - override val description = R.string.setting_add_shortcut_summary.asText() + override val title = CoreR.string.add_shortcut_title.asText() + override val description = CoreR.string.setting_add_shortcut_summary.asText() } object DownloadPath : BaseSettingsItem.Input() { @@ -140,7 +141,7 @@ object DownloadPath : BaseSettingsItem.Input() { 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 var inputResult: String = value @@ -161,9 +162,9 @@ object UpdateChannel : BaseSettingsItem.Selector() { 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 { return super.entries(res).let { if (!Const.APP_IS_CANARY && !BuildConfig.DEBUG) @@ -174,7 +175,7 @@ object UpdateChannel : BaseSettingsItem.Selector() { } 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 var value get() = Config.customChannelUrl @@ -196,39 +197,39 @@ object UpdateChannelUrl : BaseSettingsItem.Input() { } object UpdateChecker : BaseSettingsItem.Toggle() { - override val title = R.string.settings_check_update_title.asText() - override val description = R.string.settings_check_update_summary.asText() + override val title = CoreR.string.settings_check_update_title.asText() + override val description = CoreR.string.settings_check_update_summary.asText() override var value by Config::checkUpdate } object DoHToggle : BaseSettingsItem.Toggle() { - override val title = R.string.settings_doh_title.asText() - override val description = R.string.settings_doh_description.asText() + override val title = CoreR.string.settings_doh_title.asText() + override val description = CoreR.string.settings_doh_description.asText() override var value by Config::doh } object SystemlessHosts : BaseSettingsItem.Blank() { - override val title = R.string.settings_hosts_title.asText() - override val description = R.string.settings_hosts_summary.asText() + override val title = CoreR.string.settings_hosts_title.asText() + override val description = CoreR.string.settings_hosts_summary.asText() } object RandNameToggle : BaseSettingsItem.Toggle() { - override val title = R.string.settings_random_name_title.asText() - override val description = R.string.settings_random_name_description.asText() + override val title = CoreR.string.settings_random_name_title.asText() + override val description = CoreR.string.settings_random_name_description.asText() override var value by Config::randName } // --- Magisk object Magisk : BaseSettingsItem.Section() { - override val title = R.string.magisk.asText() + override val title = CoreR.string.magisk.asText() } object Zygisk : BaseSettingsItem.Toggle() { - override val title = R.string.zygisk.asText() + override val title = CoreR.string.zygisk.asText() override val description get() = - if (mismatch) R.string.reboot_apply_change.asText() - else R.string.settings_zygisk_summary.asText() + if (mismatch) CoreR.string.reboot_apply_change.asText() + else CoreR.string.settings_zygisk_summary.asText() override var value get() = Config.zygisk set(value) { @@ -239,8 +240,8 @@ object Zygisk : BaseSettingsItem.Toggle() { } object DenyList : BaseSettingsItem.Toggle() { - override val title = R.string.settings_denylist_title.asText() - override val description get() = R.string.settings_denylist_summary.asText() + override val title = CoreR.string.settings_denylist_title.asText() + override val description get() = CoreR.string.settings_denylist_summary.asText() override var value = Config.denyList set(value) { @@ -258,45 +259,45 @@ object DenyList : BaseSettingsItem.Toggle() { } object DenyListConfig : BaseSettingsItem.Blank() { - override val title = R.string.settings_denylist_config_title.asText() - override val description = R.string.settings_denylist_config_summary.asText() + override val title = CoreR.string.settings_denylist_config_title.asText() + override val description = CoreR.string.settings_denylist_config_summary.asText() } // --- Superuser object Tapjack : BaseSettingsItem.Toggle() { - override val title = R.string.settings_su_tapjack_title.asText() - override val description = R.string.settings_su_tapjack_summary.asText() + override val title = CoreR.string.settings_su_tapjack_title.asText() + override val description = CoreR.string.settings_su_tapjack_summary.asText() override var value by Config::suTapjack } object Authentication : BaseSettingsItem.Toggle() { - override val title = R.string.settings_su_auth_title.asText() - override var description = R.string.settings_su_auth_summary.asText() + override val title = CoreR.string.settings_su_auth_title.asText() + override var description = CoreR.string.settings_su_auth_summary.asText() override var value by Config::suAuth override fun refresh() { isEnabled = Info.isDeviceSecure if (!isEnabled) { - description = R.string.settings_su_auth_insecure.asText() + description = CoreR.string.settings_su_auth_insecure.asText() } } } object Superuser : BaseSettingsItem.Section() { - override val title = R.string.superuser.asText() + override val title = CoreR.string.superuser.asText() } object AccessMode : BaseSettingsItem.Selector() { - override val title = R.string.superuser_access.asText() - override val entryRes = R.array.su_access + override val title = CoreR.string.superuser_access.asText() + override val entryRes = CoreR.array.su_access override var value by Config::rootMode } object MultiuserMode : BaseSettingsItem.Selector() { - override val title = R.string.multiuser_mode.asText() - override val entryRes = R.array.multiuser_mode - override val descriptionRes = R.array.multiuser_summary + override val title = CoreR.string.multiuser_mode.asText() + override val entryRes = CoreR.array.multiuser_mode + override val descriptionRes = CoreR.array.multiuser_summary override var value by Config::suMultiuserMode override fun refresh() { @@ -305,21 +306,21 @@ object MultiuserMode : BaseSettingsItem.Selector() { } object MountNamespaceMode : BaseSettingsItem.Selector() { - override val title = R.string.mount_namespace_mode.asText() - override val entryRes = R.array.namespace - override val descriptionRes = R.array.namespace_summary + override val title = CoreR.string.mount_namespace_mode.asText() + override val entryRes = CoreR.array.namespace + override val descriptionRes = CoreR.array.namespace_summary override var value by Config::suMntNamespaceMode } object AutomaticResponse : BaseSettingsItem.Selector() { - override val title = R.string.auto_response.asText() - override val entryRes = R.array.auto_response + override val title = CoreR.string.auto_response.asText() + override val entryRes = CoreR.array.auto_response override var value by Config::suAutoResponse } object RequestTimeout : BaseSettingsItem.Selector() { - override val title = R.string.request_timeout.asText() - override val entryRes = R.array.request_timeout + override val title = CoreR.string.request_timeout.asText() + override val entryRes = CoreR.array.request_timeout private val entryValues = listOf(10, 15, 20, 30, 45, 60) override var value = entryValues.indexOfFirst { it == Config.suDefaultTimeout } @@ -330,14 +331,14 @@ object RequestTimeout : BaseSettingsItem.Selector() { } object SUNotification : BaseSettingsItem.Selector() { - override val title = R.string.superuser_notification.asText() - override val entryRes = R.array.su_notification + override val title = CoreR.string.superuser_notification.asText() + override val entryRes = CoreR.array.su_notification override var value by Config::suNotification } object Reauthenticate : BaseSettingsItem.Toggle() { - override val title = R.string.settings_su_reauth_title.asText() - override val description = R.string.settings_su_reauth_summary.asText() + override val title = CoreR.string.settings_su_reauth_title.asText() + override val description = CoreR.string.settings_su_reauth_summary.asText() override var value by Config::suReAuth override fun refresh() { diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt index 255d318b8..3bc0c443b 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt @@ -6,11 +6,11 @@ import android.widget.Toast import androidx.core.content.pm.ShortcutManagerCompat import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.BaseViewModel import com.topjohnwu.magisk.core.BuildConfig import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info +import com.topjohnwu.magisk.core.R import com.topjohnwu.magisk.core.di.AppContext import com.topjohnwu.magisk.core.isRunningAsStub import com.topjohnwu.magisk.core.ktx.activity diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt index 832ecc252..6ba346dc1 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt @@ -9,6 +9,7 @@ import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding import rikka.recyclerview.addEdgeSpacing import rikka.recyclerview.addItemSpacing import rikka.recyclerview.fixEdgeEffect +import com.topjohnwu.magisk.core.R as CoreR class SuperuserFragment : BaseFragment() { @@ -17,7 +18,7 @@ class SuperuserFragment : BaseFragment() { override fun onStart() { super.onStart() - activity?.title = resources.getString(R.string.superuser) + activity?.title = resources.getString(CoreR.string.superuser) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt index 9e4663eb9..4b9e8513d 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt @@ -8,10 +8,10 @@ import androidx.databinding.Bindable import androidx.databinding.ObservableArrayList import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.AsyncLoadViewModel import com.topjohnwu.magisk.core.Config 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.di.AppContext import com.topjohnwu.magisk.core.ktx.getLabel diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt index d3825a3f7..9ce2026cf 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt @@ -17,9 +17,9 @@ import android.widget.Toast import androidx.databinding.Bindable import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR -import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.BaseViewModel 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.di.AppContext import com.topjohnwu.magisk.core.ktx.getLabel diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt index c8363aa89..f66aad6bc 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt @@ -12,6 +12,7 @@ import com.topjohnwu.magisk.arch.BaseFragment import com.topjohnwu.magisk.arch.viewModel import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding import com.topjohnwu.magisk.databinding.ItemThemeBindingImpl +import com.topjohnwu.magisk.core.R as CoreR class ThemeFragment : BaseFragment() { @@ -61,7 +62,7 @@ class ThemeFragment : BaseFragment() { override fun onStart() { super.onStart() - activity?.title = getString(R.string.section_theme) + activity?.title = getString(CoreR.string.section_theme) } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/view/TappableHeadlineItem.kt b/app/apk/src/main/java/com/topjohnwu/magisk/view/TappableHeadlineItem.kt index bf8aab393..4fbd6d967 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/view/TappableHeadlineItem.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/view/TappableHeadlineItem.kt @@ -3,6 +3,7 @@ package com.topjohnwu.magisk.view import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.DiffItem import com.topjohnwu.magisk.databinding.RvItem +import com.topjohnwu.magisk.core.R as CoreR sealed class TappableHeadlineItem : RvItem(), DiffItem { @@ -22,7 +23,7 @@ sealed class TappableHeadlineItem : RvItem(), DiffItem { // --- objects 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 } diff --git a/gradle.properties b/gradle.properties index 9a9a9de3d..2dd51f0ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,6 @@ org.gradle.caching=true android.useAndroidX=true android.injected.testOnly=false android.nonFinalResIds=false -android.nonTransitiveRClass=false # Magisk magisk.stubVersion=39