diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt index d6bef312b..a3e1c9002 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import android.content.Intent import android.os.Bundle diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIComponent.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIComponent.kt similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIComponent.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/BaseUIComponent.kt index ba15ad186..90f2ebeb3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIComponent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIComponent.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import android.view.View import androidx.core.graphics.Insets diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIFragment.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIFragment.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt index 6c4dcfd69..ceea8cf07 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseUIFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import android.os.Bundle import android.view.KeyEvent diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt index a11b5780f..4e3a7eea3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseViewModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import android.Manifest import androidx.annotation.CallSuper diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/Helpers.kt b/app/src/main/java/com/topjohnwu/magisk/arch/Helpers.kt similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/Helpers.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/Helpers.kt index 4582007c8..a18d1822c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/Helpers.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/Helpers.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import androidx.databinding.ViewDataBinding import com.topjohnwu.magisk.databinding.ComparableRvItem diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/Queryable.kt b/app/src/main/java/com/topjohnwu/magisk/arch/Queryable.kt similarity index 90% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/Queryable.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/Queryable.kt index db64fbb18..9eb41dc50 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/Queryable.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/Queryable.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import android.os.Handler import androidx.core.os.postDelayed diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/base/ViewEvent.kt b/app/src/main/java/com/topjohnwu/magisk/arch/ViewEvent.kt similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/ui/base/ViewEvent.kt rename to app/src/main/java/com/topjohnwu/magisk/arch/ViewEvent.kt index 72cb2a4b1..e8ba8536e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/base/ViewEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/ViewEvent.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.ui.base +package com.topjohnwu.magisk.arch import android.content.Context import androidx.fragment.app.Fragment diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Config.kt b/app/src/main/java/com/topjohnwu/magisk/core/Config.kt index 88bd9c668..f92b2dc25 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Config.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Config.kt @@ -10,14 +10,14 @@ import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.core.magiskdb.SettingsDao import com.topjohnwu.magisk.core.magiskdb.StringDao import com.topjohnwu.magisk.core.utils.BiometricHelper -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.core.utils.refreshLocale +import com.topjohnwu.magisk.data.preference.PreferenceModel import com.topjohnwu.magisk.data.repository.DBConfig import com.topjohnwu.magisk.di.Protected import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.ktx.inject -import com.topjohnwu.magisk.model.preference.PreferenceModel import com.topjohnwu.magisk.ui.theme.Theme +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.io.SuFile import com.topjohnwu.superuser.io.SuFileInputStream diff --git a/app/src/main/java/com/topjohnwu/magisk/core/GeneralReceiver.kt b/app/src/main/java/com/topjohnwu/magisk/core/GeneralReceiver.kt index 701a2bc47..11d14f98f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/GeneralReceiver.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/GeneralReceiver.kt @@ -7,10 +7,10 @@ import com.topjohnwu.magisk.core.download.DownloadService import com.topjohnwu.magisk.core.magiskdb.PolicyDao import com.topjohnwu.magisk.core.model.ManagerJson import com.topjohnwu.magisk.core.su.SuCallbackHandler -import com.topjohnwu.magisk.core.view.Shortcuts import com.topjohnwu.magisk.ktx.reboot import com.topjohnwu.magisk.model.entity.internal.Configuration import com.topjohnwu.magisk.model.entity.internal.DownloadSubject +import com.topjohnwu.magisk.view.Shortcuts import com.topjohnwu.superuser.Shell import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/topjohnwu/magisk/core/Info.kt b/app/src/main/java/com/topjohnwu/magisk/core/Info.kt index 2bedcb94c..40fc2accf 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/Info.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/Info.kt @@ -3,9 +3,9 @@ package com.topjohnwu.magisk.core import androidx.databinding.ObservableBoolean import com.topjohnwu.magisk.DynAPK import com.topjohnwu.magisk.core.model.UpdateInfo -import com.topjohnwu.magisk.core.net.NetworkObserver import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.utils.CachedValue +import com.topjohnwu.magisk.utils.net.NetworkObserver import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.ShellUtils.fastCmd import com.topjohnwu.superuser.internal.UiThreadHandler diff --git a/app/src/main/java/com/topjohnwu/magisk/core/SplashActivity.kt b/app/src/main/java/com/topjohnwu/magisk/core/SplashActivity.kt index 12a74024e..a6f4f56b0 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/SplashActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/SplashActivity.kt @@ -5,11 +5,11 @@ import android.content.Context import android.os.Bundle import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.R -import com.topjohnwu.magisk.core.view.Notifications -import com.topjohnwu.magisk.core.view.Shortcuts import com.topjohnwu.magisk.data.network.GithubRawServices import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.model.navigation.Navigation +import com.topjohnwu.magisk.view.Notifications +import com.topjohnwu.magisk.view.Shortcuts import com.topjohnwu.superuser.Shell import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope diff --git a/app/src/main/java/com/topjohnwu/magisk/core/UpdateCheckService.kt b/app/src/main/java/com/topjohnwu/magisk/core/UpdateCheckService.kt index 4ff01280d..df2c2b360 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/UpdateCheckService.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/UpdateCheckService.kt @@ -3,8 +3,8 @@ package com.topjohnwu.magisk.core import android.content.Context import androidx.work.* import com.topjohnwu.magisk.BuildConfig -import com.topjohnwu.magisk.core.view.Notifications import com.topjohnwu.magisk.data.repository.MagiskRepository +import com.topjohnwu.magisk.view.Notifications import com.topjohnwu.superuser.Shell import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt b/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt index 8416db881..2f83a6b44 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/base/BaseActivity.kt @@ -12,7 +12,6 @@ import androidx.core.content.ContextCompat import com.topjohnwu.magisk.core.utils.currentLocale import com.topjohnwu.magisk.core.wrap import com.topjohnwu.magisk.ktx.set -import com.topjohnwu.magisk.model.permissions.PermissionRequestBuilder import kotlin.random.Random typealias RequestCallback = BaseActivity.(Int, Intent?) -> Unit diff --git a/app/src/main/java/com/topjohnwu/magisk/model/permissions/PermissionRequestBuilder.kt b/app/src/main/java/com/topjohnwu/magisk/core/base/PermissionRequestBuilder.kt similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/model/permissions/PermissionRequestBuilder.kt rename to app/src/main/java/com/topjohnwu/magisk/core/base/PermissionRequestBuilder.kt index 7aea7d587..d042368f3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/permissions/PermissionRequestBuilder.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/base/PermissionRequestBuilder.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.permissions +package com.topjohnwu.magisk.core.base typealias SimpleCallback = () -> Unit typealias PermissionRationaleCallback = (List) -> Unit @@ -37,4 +37,4 @@ class PermissionRequest( fun onFailure() = onFailureCallback() fun onShowRationale(permissions: List) = onShowRationaleCallback(permissions) -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/core/download/NotificationService.kt b/app/src/main/java/com/topjohnwu/magisk/core/download/NotificationService.kt index 03c02c479..cb0ed75aa 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/download/NotificationService.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/download/NotificationService.kt @@ -4,7 +4,7 @@ import android.app.Notification import android.content.Intent import android.os.IBinder import com.topjohnwu.magisk.core.base.BaseService -import com.topjohnwu.magisk.core.view.Notifications +import com.topjohnwu.magisk.view.Notifications import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel diff --git a/app/src/main/java/com/topjohnwu/magisk/core/download/RemoteFileService.kt b/app/src/main/java/com/topjohnwu/magisk/core/download/RemoteFileService.kt index 208aa5b82..c57145edf 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/download/RemoteFileService.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/download/RemoteFileService.kt @@ -7,13 +7,13 @@ import androidx.lifecycle.MutableLiveData import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.ForegroundTracker import com.topjohnwu.magisk.core.utils.ProgressInputStream -import com.topjohnwu.magisk.core.view.Notifications import com.topjohnwu.magisk.data.network.GithubRawServices import com.topjohnwu.magisk.ktx.checkSum import com.topjohnwu.magisk.ktx.writeTo import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Magisk import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Module +import com.topjohnwu.magisk.view.Notifications import kotlinx.coroutines.launch import okhttp3.ResponseBody import org.koin.android.ext.android.inject diff --git a/app/src/main/java/com/topjohnwu/magisk/core/su/SuCallbackHandler.kt b/app/src/main/java/com/topjohnwu/magisk/core/su/SuCallbackHandler.kt index 79514f9e1..3f948261a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/su/SuCallbackHandler.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/su/SuCallbackHandler.kt @@ -13,7 +13,6 @@ import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.intent import com.topjohnwu.magisk.core.model.MagiskPolicy import com.topjohnwu.magisk.core.model.toPolicy -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.core.wrap import com.topjohnwu.magisk.data.repository.LogRepository import com.topjohnwu.magisk.ktx.get @@ -21,6 +20,7 @@ import com.topjohnwu.magisk.ktx.startActivity import com.topjohnwu.magisk.ktx.startActivityWithRoot import com.topjohnwu.magisk.model.entity.toLog import com.topjohnwu.magisk.ui.surequest.SuRequestActivity +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.superuser.Shell import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt index 537aa90ee..2fb182d0a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/tasks/MagiskInstaller.kt @@ -12,13 +12,13 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Info -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.data.network.GithubRawServices import com.topjohnwu.magisk.di.Protected import com.topjohnwu.magisk.ktx.readUri import com.topjohnwu.magisk.ktx.reboot import com.topjohnwu.magisk.ktx.withStreams import com.topjohnwu.magisk.model.events.dialog.EnvFixDialog +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.signing.SignBoot import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.ShellUtils diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/PatchAPK.kt b/app/src/main/java/com/topjohnwu/magisk/core/utils/PatchAPK.kt index 0cb662d61..7c1e6fd4d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/PatchAPK.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/utils/PatchAPK.kt @@ -8,10 +8,11 @@ import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.isRunningAsStub -import com.topjohnwu.magisk.core.view.Notifications import com.topjohnwu.magisk.data.network.GithubRawServices import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.ktx.writeTo +import com.topjohnwu.magisk.utils.Utils +import com.topjohnwu.magisk.view.Notifications import com.topjohnwu.signing.JarMap import com.topjohnwu.signing.SignApk import com.topjohnwu.superuser.Shell diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/BooleanProperty.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/BooleanProperty.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/BooleanProperty.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/BooleanProperty.kt index 28779c028..3ac22fd02 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/BooleanProperty.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/BooleanProperty.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import androidx.core.content.edit import com.topjohnwu.magisk.ktx.trimEmptyToNull diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/FloatProperty.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/FloatProperty.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/FloatProperty.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/FloatProperty.kt index ba41fbdf8..aeef0de7c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/FloatProperty.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/FloatProperty.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import androidx.core.content.edit import com.topjohnwu.magisk.ktx.trimEmptyToNull diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/IntProperty.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/IntProperty.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/IntProperty.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/IntProperty.kt index 1122f6703..a22dade7b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/IntProperty.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/IntProperty.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import androidx.core.content.edit import com.topjohnwu.magisk.ktx.trimEmptyToNull diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/LongProperty.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/LongProperty.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/LongProperty.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/LongProperty.kt index 390eea788..f01239463 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/LongProperty.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/LongProperty.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import androidx.core.content.edit import com.topjohnwu.magisk.ktx.trimEmptyToNull diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/PreferenceModel.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/PreferenceModel.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/PreferenceModel.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/PreferenceModel.kt index 75c9bbdd2..3d45cf1e7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/PreferenceModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/PreferenceModel.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import android.content.Context import android.content.SharedPreferences diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/Property.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/Property.kt similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/Property.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/Property.kt index 0b2e07628..e1948df26 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/Property.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/Property.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import android.content.SharedPreferences @@ -18,4 +18,4 @@ abstract class Property { fun SharedPreferences.get(name: String, value: String) = getString(name, value) ?: value fun SharedPreferences.get(name: String, value: Set) = getStringSet(name, value) ?: value -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/StringProperty.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/StringProperty.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/StringProperty.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/StringProperty.kt index 5e6e464df..02d589b98 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/StringProperty.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/StringProperty.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import androidx.core.content.edit import com.topjohnwu.magisk.ktx.trimEmptyToNull diff --git a/app/src/main/java/com/topjohnwu/magisk/model/preference/StringSetProperty.kt b/app/src/main/java/com/topjohnwu/magisk/data/preference/StringSetProperty.kt similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/model/preference/StringSetProperty.kt rename to app/src/main/java/com/topjohnwu/magisk/data/preference/StringSetProperty.kt index 435cadc70..22fc6a8da 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/preference/StringSetProperty.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/preference/StringSetProperty.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.model.preference +package com.topjohnwu.magisk.data.preference import androidx.core.content.edit import com.topjohnwu.magisk.ktx.trimEmptyToNull diff --git a/app/src/main/java/com/topjohnwu/magisk/databinding/AdaptersGeneric.kt b/app/src/main/java/com/topjohnwu/magisk/databinding/AdaptersGeneric.kt deleted file mode 100644 index 63fc61199..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/databinding/AdaptersGeneric.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.topjohnwu.magisk.databinding - -import android.view.View -import android.widget.TextView -import androidx.core.view.isGone -import androidx.core.view.isInvisible -import androidx.databinding.BindingAdapter -import com.topjohnwu.magisk.ktx.coroutineScope -import com.topjohnwu.magisk.ktx.get -import io.noties.markwon.Markwon -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch - -@BindingAdapter("gone") -fun setGone(view: View, gone: Boolean) { - view.isGone = gone -} - -@BindingAdapter("invisible") -fun setInvisible(view: View, invisible: Boolean) { - view.isInvisible = invisible -} - -@BindingAdapter("goneUnless") -fun setGoneUnless(view: View, goneUnless: Boolean) { - setGone(view, goneUnless.not()) -} - -@BindingAdapter("invisibleUnless") -fun setInvisibleUnless(view: View, invisibleUnless: Boolean) { - setInvisible(view, invisibleUnless.not()) -} - -@BindingAdapter("markdownText") -fun setMarkdownText(tv: TextView, text: CharSequence) { - tv.coroutineScope.launch(Dispatchers.IO) { - val markwon = get() - markwon.setMarkdown(tv, text.toString()) - } -} diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt b/app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt similarity index 89% rename from app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt rename to app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt index dd68ba1f4..07edb5a1a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt +++ b/app/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.utils +package com.topjohnwu.magisk.databinding import android.animation.ValueAnimator import android.graphics.Paint @@ -9,6 +9,8 @@ import android.view.ViewGroup import android.widget.* import androidx.annotation.DrawableRes import androidx.appcompat.widget.Toolbar +import androidx.core.view.isGone +import androidx.core.view.isInvisible import androidx.core.view.updateLayoutParams import androidx.databinding.BindingAdapter import androidx.databinding.InverseBindingAdapter @@ -20,12 +22,42 @@ import com.google.android.material.card.MaterialCardView import com.google.android.material.chip.Chip import com.google.android.material.textfield.TextInputLayout import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.ktx.coroutineScope +import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.ktx.replaceRandomWithSpecial import com.topjohnwu.superuser.internal.UiThreadHandler import com.topjohnwu.widget.IndeterminateCheckBox +import io.noties.markwon.Markwon import kotlinx.coroutines.* import kotlin.math.roundToInt +@BindingAdapter("gone") +fun setGone(view: View, gone: Boolean) { + view.isGone = gone +} + +@BindingAdapter("invisible") +fun setInvisible(view: View, invisible: Boolean) { + view.isInvisible = invisible +} + +@BindingAdapter("goneUnless") +fun setGoneUnless(view: View, goneUnless: Boolean) { + setGone(view, goneUnless.not()) +} + +@BindingAdapter("invisibleUnless") +fun setInvisibleUnless(view: View, invisibleUnless: Boolean) { + setInvisible(view, invisibleUnless.not()) +} + +@BindingAdapter("markdownText") +fun setMarkdownText(tv: TextView, text: CharSequence) { + tv.coroutineScope.launch(Dispatchers.IO) { + val markwon = get() + markwon.setMarkdown(tv, text.toString()) + } +} @BindingAdapter("onNavigationClick") fun setOnNavigationClickedListener(view: Toolbar, listener: View.OnClickListener) { diff --git a/app/src/main/java/com/topjohnwu/magisk/model/binding/BindingAdapter.kt b/app/src/main/java/com/topjohnwu/magisk/databinding/RvBindingAdapter.kt similarity index 84% rename from app/src/main/java/com/topjohnwu/magisk/model/binding/BindingAdapter.kt rename to app/src/main/java/com/topjohnwu/magisk/databinding/RvBindingAdapter.kt index 4c4361317..b482273e4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/binding/BindingAdapter.kt +++ b/app/src/main/java/com/topjohnwu/magisk/databinding/RvBindingAdapter.kt @@ -1,12 +1,11 @@ -package com.topjohnwu.magisk.model.binding +package com.topjohnwu.magisk.databinding import androidx.databinding.ViewDataBinding import androidx.recyclerview.widget.RecyclerView -import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.model.entity.recycler.LenientRvItem import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter -class BindingAdapter > : BindingRecyclerViewAdapter() { +class RvBindingAdapter : BindingRecyclerViewAdapter() { private var recyclerView: RecyclerView? = null diff --git a/app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt b/app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt index 34b0b3327..8168db0ef 100644 --- a/app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt +++ b/app/src/main/java/com/topjohnwu/magisk/di/NetworkingModule.kt @@ -5,12 +5,12 @@ import android.os.Build import com.squareup.moshi.Moshi import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info -import com.topjohnwu.magisk.core.utils.MarkwonImagePlugin import com.topjohnwu.magisk.data.network.GithubApiServices import com.topjohnwu.magisk.data.network.GithubRawServices import com.topjohnwu.magisk.ktx.precomputedText import com.topjohnwu.magisk.net.Networking import com.topjohnwu.magisk.net.NoSSLv3SocketFactory +import com.topjohnwu.magisk.utils.MarkwonImagePlugin import io.noties.markwon.Markwon import io.noties.markwon.html.HtmlPlugin import okhttp3.Dns diff --git a/app/src/main/java/com/topjohnwu/magisk/ktx/XAndroid.kt b/app/src/main/java/com/topjohnwu/magisk/ktx/XAndroid.kt index 09f3815d0..3a512e612 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ktx/XAndroid.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ktx/XAndroid.kt @@ -47,9 +47,9 @@ import com.topjohnwu.magisk.FileProvider import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.ResMgr -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.core.utils.currentLocale import com.topjohnwu.magisk.utils.DynamicClassLoader +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.superuser.Shell import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt index 8172b0fa8..a5fb5d58d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/InstallExternalModuleEvent.kt @@ -6,10 +6,10 @@ import android.content.Intent import androidx.annotation.RequiresPermission import androidx.navigation.NavDirections import com.topjohnwu.magisk.MainDirections +import com.topjohnwu.magisk.arch.ActivityExecutor +import com.topjohnwu.magisk.arch.ViewEvent import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.base.BaseActivity -import com.topjohnwu.magisk.ui.base.ActivityExecutor -import com.topjohnwu.magisk.ui.base.ViewEvent class InstallExternalModuleEvent : ViewEvent(), ActivityExecutor { diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/OpenInappLinkEvent.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/OpenInappLinkEvent.kt index b23f49615..dcf8c3c32 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/OpenInappLinkEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/OpenInappLinkEvent.kt @@ -7,8 +7,8 @@ import androidx.annotation.AttrRes import androidx.browser.customtabs.CustomTabsIntent import androidx.core.net.toUri import com.topjohnwu.magisk.R -import com.topjohnwu.magisk.ui.base.ContextExecutor -import com.topjohnwu.magisk.ui.base.ViewEvent +import com.topjohnwu.magisk.arch.ContextExecutor +import com.topjohnwu.magisk.arch.ViewEvent data class OpenInappLinkEvent( private val link: String diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/SnackbarEvent.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/SnackbarEvent.kt index 910f1cbf5..ad5678299 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/SnackbarEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/SnackbarEvent.kt @@ -3,11 +3,11 @@ package com.topjohnwu.magisk.model.events import android.content.Context import androidx.annotation.StringRes import com.google.android.material.snackbar.Snackbar +import com.topjohnwu.magisk.arch.ActivityExecutor +import com.topjohnwu.magisk.arch.BaseUIActivity +import com.topjohnwu.magisk.arch.ViewEvent import com.topjohnwu.magisk.core.base.BaseActivity import com.topjohnwu.magisk.ktx.snackbar -import com.topjohnwu.magisk.ui.base.ActivityExecutor -import com.topjohnwu.magisk.ui.base.BaseUIActivity -import com.topjohnwu.magisk.ui.base.ViewEvent class SnackbarEvent private constructor( @StringRes private val messageRes: Int, diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt index 2f6dcca86..82cc44054 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt @@ -4,6 +4,10 @@ import android.app.Activity import android.content.Context import android.content.Intent import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.ActivityExecutor +import com.topjohnwu.magisk.arch.ContextExecutor +import com.topjohnwu.magisk.arch.ViewEvent +import com.topjohnwu.magisk.arch.ViewEventWithScope import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.base.BaseActivity import com.topjohnwu.magisk.core.model.module.Repo @@ -11,10 +15,6 @@ import com.topjohnwu.magisk.core.utils.SafetyNetHelper import com.topjohnwu.magisk.data.network.GithubRawServices import com.topjohnwu.magisk.ktx.DynamicClassLoader import com.topjohnwu.magisk.ktx.writeTo -import com.topjohnwu.magisk.ui.base.ActivityExecutor -import com.topjohnwu.magisk.ui.base.ContextExecutor -import com.topjohnwu.magisk.ui.base.ViewEvent -import com.topjohnwu.magisk.ui.base.ViewEventWithScope import com.topjohnwu.magisk.ui.safetynet.SafetyNetResult import com.topjohnwu.magisk.view.MagiskDialog import com.topjohnwu.magisk.view.MarkDownWindow diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/BiometricDialog.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/BiometricDialog.kt index dd4f81cc3..82b69df69 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/BiometricDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/BiometricDialog.kt @@ -1,9 +1,9 @@ package com.topjohnwu.magisk.model.events.dialog +import com.topjohnwu.magisk.arch.ActivityExecutor +import com.topjohnwu.magisk.arch.ViewEvent import com.topjohnwu.magisk.core.base.BaseActivity import com.topjohnwu.magisk.core.utils.BiometricHelper -import com.topjohnwu.magisk.ui.base.ActivityExecutor -import com.topjohnwu.magisk.ui.base.ViewEvent class BiometricDialog( builder: Builder.() -> Unit diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt index 6aca87d48..0698d34c9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DarkThemeDialog.kt @@ -3,9 +3,9 @@ package com.topjohnwu.magisk.model.events.dialog import android.app.Activity import androidx.appcompat.app.AppCompatDelegate import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.ActivityExecutor import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.base.BaseActivity -import com.topjohnwu.magisk.ui.base.ActivityExecutor import com.topjohnwu.magisk.view.MagiskDialog import java.lang.ref.WeakReference diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DialogEvent.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DialogEvent.kt index 9146e8452..995e30c82 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DialogEvent.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/DialogEvent.kt @@ -1,8 +1,8 @@ package com.topjohnwu.magisk.model.events.dialog import android.content.Context -import com.topjohnwu.magisk.ui.base.ContextExecutor -import com.topjohnwu.magisk.ui.base.ViewEvent +import com.topjohnwu.magisk.arch.ContextExecutor +import com.topjohnwu.magisk.arch.ViewEvent import com.topjohnwu.magisk.view.MagiskDialog abstract class DialogEvent : ViewEvent(), ContextExecutor { diff --git a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/UninstallDialog.kt b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/UninstallDialog.kt index 78745fb19..f1400cda4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/UninstallDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/events/dialog/UninstallDialog.kt @@ -4,9 +4,9 @@ import android.widget.Toast import com.topjohnwu.magisk.R import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.download.DownloadService -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.model.entity.internal.Configuration import com.topjohnwu.magisk.model.entity.internal.DownloadSubject +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.magisk.view.MagiskDialog import com.topjohnwu.superuser.Shell diff --git a/app/src/main/java/com/topjohnwu/magisk/model/navigation/NavigationWrapper.kt b/app/src/main/java/com/topjohnwu/magisk/model/navigation/NavigationWrapper.kt index f514b9275..5dd38cfde 100644 --- a/app/src/main/java/com/topjohnwu/magisk/model/navigation/NavigationWrapper.kt +++ b/app/src/main/java/com/topjohnwu/magisk/model/navigation/NavigationWrapper.kt @@ -1,10 +1,10 @@ package com.topjohnwu.magisk.model.navigation import androidx.navigation.NavDirections +import com.topjohnwu.magisk.arch.ActivityExecutor +import com.topjohnwu.magisk.arch.BaseUIActivity +import com.topjohnwu.magisk.arch.ViewEvent import com.topjohnwu.magisk.core.base.BaseActivity -import com.topjohnwu.magisk.ui.base.ActivityExecutor -import com.topjohnwu.magisk.ui.base.BaseUIActivity -import com.topjohnwu.magisk.ui.base.ViewEvent class NavigationWrapper( private val directions: NavDirections diff --git a/app/src/main/java/com/topjohnwu/magisk/model/observer/Observer.kt b/app/src/main/java/com/topjohnwu/magisk/model/observer/Observer.kt deleted file mode 100644 index 3f675dded..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/model/observer/Observer.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.topjohnwu.magisk.model.observer - -import androidx.databinding.Observable -import androidx.databinding.ObservableField -import java.io.Serializable - - -class Observer(vararg dependencies: Observable, private val observer: () -> T) : - ObservableField(*dependencies), Serializable { - - val value: T get() = observer() - - @Deprecated( - message = "Use KObservableField.value syntax from code", - replaceWith = ReplaceWith("value") - ) - override fun get(): T { - return value - } - - @Deprecated( - message = "Observer cannot be set", - level = DeprecationLevel.HIDDEN - ) - override fun set(newValue: T) { - } - - override fun toString(): String { - return "Observer(value=$value)" - } -} \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt index a8622afff..edf72d706 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt @@ -13,13 +13,13 @@ import androidx.navigation.NavDirections import com.google.android.material.card.MaterialCardView import com.topjohnwu.magisk.MainDirections import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIActivity +import com.topjohnwu.magisk.arch.BaseViewModel +import com.topjohnwu.magisk.arch.ReselectionTarget import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.databinding.ActivityMainMd2Binding import com.topjohnwu.magisk.ktx.startAnimations -import com.topjohnwu.magisk.ui.base.BaseUIActivity -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.ReselectionTarget import com.topjohnwu.magisk.ui.home.HomeFragmentDirections import com.topjohnwu.magisk.utils.HideBottomViewOnScrollBehavior import com.topjohnwu.magisk.utils.HideTopViewOnScrollBehavior diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt index 13da8c7b3..384539e8c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashFragment.kt @@ -9,12 +9,12 @@ import android.view.* import androidx.core.net.toUri import androidx.navigation.NavDeepLinkBuilder import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIActivity +import com.topjohnwu.magisk.arch.BaseUIFragment 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.ui.base.BaseUIActivity -import com.topjohnwu.magisk.ui.base.BaseUIFragment import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.core.parameter.parametersOf import java.io.File diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt index 0fdbf7943..29989f7c5 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt @@ -7,19 +7,19 @@ 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.arch.diffListOf +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.tasks.FlashZip import com.topjohnwu.magisk.core.tasks.MagiskInstaller -import com.topjohnwu.magisk.core.view.Notifications +import com.topjohnwu.magisk.databinding.RvBindingAdapter import com.topjohnwu.magisk.ktx.* -import com.topjohnwu.magisk.model.binding.BindingAdapter import com.topjohnwu.magisk.model.entity.recycler.ConsoleItem import com.topjohnwu.magisk.model.events.SnackbarEvent -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.diffListOf -import com.topjohnwu.magisk.ui.base.itemBindingOf import com.topjohnwu.magisk.utils.set +import com.topjohnwu.magisk.view.Notifications import com.topjohnwu.superuser.CallbackList import com.topjohnwu.superuser.Shell import kotlinx.coroutines.Dispatchers @@ -40,7 +40,7 @@ class FlashViewModel( var behaviorText = resources.getString(R.string.flashing) set(value) = set(value, field, { field = it }, BR.behaviorText) - val adapter = BindingAdapter() + val adapter = RvBindingAdapter() val items = diffListOf() val itemBinding = itemBindingOf() diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt index 43d9236ef..119bd803f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideFragment.kt @@ -10,9 +10,9 @@ import androidx.core.view.isVisible import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentHideMd2Binding import com.topjohnwu.magisk.ktx.hideKeyboard -import com.topjohnwu.magisk.ui.base.BaseUIFragment import com.topjohnwu.magisk.utils.MotionRevealHelper import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt index 293a373fe..7f106c4d8 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/hide/HideViewModel.kt @@ -4,6 +4,10 @@ import android.content.pm.ApplicationInfo import androidx.databinding.Bindable import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR +import com.topjohnwu.magisk.arch.BaseViewModel +import com.topjohnwu.magisk.arch.Queryable +import com.topjohnwu.magisk.arch.filterableListOf +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.utils.currentLocale import com.topjohnwu.magisk.data.repository.MagiskRepository @@ -13,10 +17,6 @@ import com.topjohnwu.magisk.model.entity.HideTarget import com.topjohnwu.magisk.model.entity.StatefulProcess import com.topjohnwu.magisk.model.entity.recycler.HideItem import com.topjohnwu.magisk.model.entity.recycler.HideProcessItem -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.Queryable -import com.topjohnwu.magisk.ui.base.filterableListOf -import com.topjohnwu.magisk.ui.base.itemBindingOf import com.topjohnwu.magisk.utils.set import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt index 8bc53b9da..acd648492 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt @@ -3,9 +3,9 @@ package com.topjohnwu.magisk.ui.home import android.os.Bundle import android.view.* import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding import com.topjohnwu.magisk.model.events.RebootEvent -import com.topjohnwu.magisk.ui.base.BaseUIFragment import com.topjohnwu.superuser.Shell import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index 7278e7416..f7d75ecb4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -5,6 +5,10 @@ import androidx.databinding.Bindable import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BuildConfig import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.ActivityExecutor +import com.topjohnwu.magisk.arch.BaseViewModel +import com.topjohnwu.magisk.arch.ViewEvent +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.base.BaseActivity @@ -21,10 +25,6 @@ import com.topjohnwu.magisk.model.events.OpenInappLinkEvent import com.topjohnwu.magisk.model.events.dialog.EnvFixDialog import com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog import com.topjohnwu.magisk.model.events.dialog.UninstallDialog -import com.topjohnwu.magisk.ui.base.ActivityExecutor -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.ViewEvent -import com.topjohnwu.magisk.ui.base.itemBindingOf import com.topjohnwu.magisk.utils.set import com.topjohnwu.superuser.Shell import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt index a65cc786f..f2f9af9a1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt @@ -3,9 +3,9 @@ package com.topjohnwu.magisk.ui.install import android.content.Intent import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding import com.topjohnwu.magisk.model.events.RequestFileEvent -import com.topjohnwu.magisk.ui.base.BaseUIFragment import org.koin.androidx.viewmodel.ext.android.viewModel class InstallFragment : BaseUIFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt index 327768e15..c3b5a51d4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt @@ -6,16 +6,16 @@ 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.Info import com.topjohnwu.magisk.core.download.DownloadService import com.topjohnwu.magisk.core.download.RemoteFileService -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.data.repository.StringRepository import com.topjohnwu.magisk.model.entity.internal.Configuration import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.events.RequestFileEvent import com.topjohnwu.magisk.model.events.dialog.SecondSlotWarningDialog -import com.topjohnwu.magisk.ui.base.BaseViewModel +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.magisk.utils.set import com.topjohnwu.superuser.Shell import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt index 8993b211a..0197c7944 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.kt @@ -7,9 +7,9 @@ import android.view.MenuItem import android.view.View import androidx.core.view.isVisible import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentLogMd2Binding import com.topjohnwu.magisk.ui.MainActivity -import com.topjohnwu.magisk.ui.base.BaseUIFragment import com.topjohnwu.magisk.utils.MotionRevealHelper import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt index 0d624302e..fae9cf8c2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogViewModel.kt @@ -4,15 +4,15 @@ 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.arch.diffListOf +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.data.repository.LogRepository import com.topjohnwu.magisk.model.entity.recycler.LogItem import com.topjohnwu.magisk.model.entity.recycler.TextItem import com.topjohnwu.magisk.model.events.SnackbarEvent -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.diffListOf -import com.topjohnwu.magisk.ui.base.itemBindingOf import com.topjohnwu.magisk.utils.set import com.topjohnwu.superuser.Shell import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt index 8140aec93..6bb5488d3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt @@ -9,13 +9,13 @@ import android.view.View import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment +import com.topjohnwu.magisk.arch.ReselectionTarget +import com.topjohnwu.magisk.arch.ViewEvent import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding import com.topjohnwu.magisk.ktx.hideKeyboard import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent import com.topjohnwu.magisk.ui.MainActivity -import com.topjohnwu.magisk.ui.base.BaseUIFragment -import com.topjohnwu.magisk.ui.base.ReselectionTarget -import com.topjohnwu.magisk.ui.base.ViewEvent import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener import com.topjohnwu.magisk.utils.MotionRevealHelper import org.koin.androidx.viewmodel.ext.android.viewModel diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt index 8cca9114a..c95812290 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt @@ -6,6 +6,7 @@ import androidx.lifecycle.Observer import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.* import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.download.RemoteFileService import com.topjohnwu.magisk.core.model.module.Module @@ -23,7 +24,6 @@ import com.topjohnwu.magisk.model.entity.recycler.SectionTitle import com.topjohnwu.magisk.model.events.InstallExternalModuleEvent import com.topjohnwu.magisk.model.events.OpenChangelogEvent import com.topjohnwu.magisk.model.events.dialog.ModuleInstallDialog -import com.topjohnwu.magisk.ui.base.* import com.topjohnwu.magisk.utils.EndlessRecyclerScrollListener import com.topjohnwu.magisk.utils.set import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt index e2524e5a5..033da6ef0 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetFragment.kt @@ -5,8 +5,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentSafetynetMd2Binding -import com.topjohnwu.magisk.ui.base.BaseUIFragment import org.koin.androidx.viewmodel.ext.android.viewModel class SafetynetFragment : BaseUIFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetViewModel.kt index 4ee467cf6..795b33368 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/safetynet/SafetynetViewModel.kt @@ -3,8 +3,8 @@ package com.topjohnwu.magisk.ui.safetynet import androidx.databinding.Bindable import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseViewModel import com.topjohnwu.magisk.model.events.CheckSafetyNetEvent -import com.topjohnwu.magisk.ui.base.BaseViewModel import com.topjohnwu.magisk.ui.safetynet.SafetyNetState.* import com.topjohnwu.magisk.utils.set import org.json.JSONObject diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt index e1156381b..707d55d80 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt @@ -3,9 +3,9 @@ package com.topjohnwu.magisk.ui.settings import android.os.Bundle import android.view.View import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentSettingsMd2Binding import com.topjohnwu.magisk.ktx.setOnViewReadyListener -import com.topjohnwu.magisk.ui.base.BaseUIFragment import org.koin.androidx.viewmodel.ext.android.viewModel class SettingsFragment : BaseUIFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt index bd9277818..485e7ef1e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsItems.kt @@ -13,7 +13,6 @@ import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.UpdateCheckService import com.topjohnwu.magisk.core.utils.BiometricHelper -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.core.utils.availableLocales import com.topjohnwu.magisk.core.utils.currentLocale import com.topjohnwu.magisk.databinding.DialogSettingsAppNameBinding @@ -21,6 +20,7 @@ import com.topjohnwu.magisk.databinding.DialogSettingsDownloadPathBinding import com.topjohnwu.magisk.databinding.DialogSettingsUpdateChannelBinding import com.topjohnwu.magisk.ktx.get import com.topjohnwu.magisk.model.entity.recycler.SettingsItem +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.magisk.utils.asTransitive import com.topjohnwu.magisk.utils.set import com.topjohnwu.superuser.Shell diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt index c5ef91c32..8a623a4dc 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsViewModel.kt @@ -6,21 +6,21 @@ import android.widget.Toast import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseViewModel +import com.topjohnwu.magisk.arch.adapterOf +import com.topjohnwu.magisk.arch.diffListOf +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.download.DownloadService import com.topjohnwu.magisk.core.utils.PatchAPK -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.data.database.RepoDao import com.topjohnwu.magisk.model.entity.internal.Configuration import com.topjohnwu.magisk.model.entity.internal.DownloadSubject import com.topjohnwu.magisk.model.entity.recycler.SettingsItem import com.topjohnwu.magisk.model.events.RecreateEvent import com.topjohnwu.magisk.model.events.dialog.BiometricDialog -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.adapterOf -import com.topjohnwu.magisk.ui.base.diffListOf -import com.topjohnwu.magisk.ui.base.itemBindingOf +import com.topjohnwu.magisk.utils.Utils import com.topjohnwu.superuser.Shell import kotlinx.coroutines.launch import org.koin.core.get diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt index 2dcb2d9a7..1a8900d0d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt @@ -1,8 +1,8 @@ package com.topjohnwu.magisk.ui.superuser import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding -import com.topjohnwu.magisk.ui.base.BaseUIFragment import org.koin.androidx.viewmodel.ext.android.viewModel class SuperuserFragment : BaseUIFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt index 30510e793..49fb5bc82 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt @@ -6,6 +6,10 @@ import androidx.databinding.ObservableArrayList import androidx.lifecycle.viewModelScope import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseViewModel +import com.topjohnwu.magisk.arch.adapterOf +import com.topjohnwu.magisk.arch.diffListOf +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.core.magiskdb.PolicyDao import com.topjohnwu.magisk.core.model.MagiskPolicy import com.topjohnwu.magisk.core.utils.BiometricHelper @@ -17,10 +21,6 @@ import com.topjohnwu.magisk.model.entity.recycler.TextItem import com.topjohnwu.magisk.model.events.SnackbarEvent import com.topjohnwu.magisk.model.events.dialog.BiometricDialog import com.topjohnwu.magisk.model.events.dialog.SuperuserRevokeDialog -import com.topjohnwu.magisk.ui.base.BaseViewModel -import com.topjohnwu.magisk.ui.base.adapterOf -import com.topjohnwu.magisk.ui.base.diffListOf -import com.topjohnwu.magisk.ui.base.itemBindingOf import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt index 8d090df89..a28572013 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.kt @@ -9,10 +9,10 @@ import android.view.Window import android.view.WindowManager import androidx.navigation.NavController import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIActivity import com.topjohnwu.magisk.core.su.SuCallbackHandler import com.topjohnwu.magisk.core.su.SuCallbackHandler.REQUEST import com.topjohnwu.magisk.databinding.ActivityRequestBinding -import com.topjohnwu.magisk.ui.base.BaseUIActivity import org.koin.androidx.viewmodel.ext.android.viewModel open class SuRequestActivity : BaseUIActivity() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt index f14a51da7..78b9f0092 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt @@ -10,6 +10,7 @@ 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.magiskdb.PolicyDao import com.topjohnwu.magisk.core.model.MagiskPolicy.Companion.ALLOW @@ -18,7 +19,6 @@ import com.topjohnwu.magisk.core.su.SuRequestHandler import com.topjohnwu.magisk.core.utils.BiometricHelper import com.topjohnwu.magisk.model.entity.recycler.SpinnerRvItem import com.topjohnwu.magisk.model.events.DieEvent -import com.topjohnwu.magisk.ui.base.BaseViewModel import com.topjohnwu.magisk.utils.set import com.topjohnwu.superuser.internal.UiThreadHandler import kotlinx.coroutines.launch diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt index eefaaac0d..da751fcdb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt @@ -1,8 +1,8 @@ package com.topjohnwu.magisk.ui.theme import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.BaseUIFragment import com.topjohnwu.magisk.databinding.FragmentThemeMd2Binding -import com.topjohnwu.magisk.ui.base.BaseUIFragment import org.koin.androidx.viewmodel.ext.android.viewModel class ThemeFragment : BaseUIFragment() { diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt index af064a006..664fd1575 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt @@ -1,9 +1,9 @@ package com.topjohnwu.magisk.ui.theme +import com.topjohnwu.magisk.arch.BaseViewModel import com.topjohnwu.magisk.model.entity.recycler.TappableHeadlineItem import com.topjohnwu.magisk.model.events.RecreateEvent import com.topjohnwu.magisk.model.events.dialog.DarkThemeDialog -import com.topjohnwu.magisk.ui.base.BaseViewModel class ThemeViewModel : BaseViewModel(), TappableHeadlineItem.Listener { diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/EndlessRecyclerScrollListener.kt b/app/src/main/java/com/topjohnwu/magisk/utils/EndlessRecyclerScrollListener.kt index 8577d0c8c..76aa0b97c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/EndlessRecyclerScrollListener.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/EndlessRecyclerScrollListener.kt @@ -4,7 +4,7 @@ import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.StaggeredGridLayoutManager -import com.topjohnwu.magisk.ui.base.ViewEvent +import com.topjohnwu.magisk.arch.ViewEvent class EndlessRecyclerScrollListener( private val layoutManager: RecyclerView.LayoutManager, diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/MarkwonImagePlugin.kt b/app/src/main/java/com/topjohnwu/magisk/utils/MarkwonImagePlugin.kt similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/core/utils/MarkwonImagePlugin.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/MarkwonImagePlugin.kt index e3d958d55..4a17582a7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/MarkwonImagePlugin.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/MarkwonImagePlugin.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.core.utils +package com.topjohnwu.magisk.utils import android.graphics.Bitmap import android.graphics.Canvas @@ -173,7 +173,8 @@ class MarkwonImagePlugin(okHttp: OkHttpClient) : AbstractMarkwonPlugin() { if (measured || canvasWidth == 0) return measured = true - val bound = SizeResolver.resolveImageSize(size, defaultBounds(), canvasWidth, paint.textSize) + val bound = + SizeResolver.resolveImageSize(size, defaultBounds(), canvasWidth, paint.textSize) draw.bounds = bound } diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/Utils.kt b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/core/utils/Utils.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/Utils.kt index 8757b23fc..622e14440 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/Utils.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.core.utils +package com.topjohnwu.magisk.utils import android.content.Context import android.content.Intent diff --git a/app/src/main/java/com/topjohnwu/magisk/core/net/Connectivity.kt b/app/src/main/java/com/topjohnwu/magisk/utils/net/Connectivity.kt similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/core/net/Connectivity.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/net/Connectivity.kt index 4c7c3f956..8d0a05d82 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/net/Connectivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/net/Connectivity.kt @@ -1,4 +1,6 @@ -package com.topjohnwu.magisk.core.net +@file:Suppress("DEPRECATION") + +package com.topjohnwu.magisk.utils.net import android.net.ConnectivityManager import android.net.Network diff --git a/app/src/main/java/com/topjohnwu/magisk/core/net/LollipopNetworkObserver.kt b/app/src/main/java/com/topjohnwu/magisk/utils/net/LollipopNetworkObserver.kt similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/core/net/LollipopNetworkObserver.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/net/LollipopNetworkObserver.kt index 93eb11ff2..112ded03b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/net/LollipopNetworkObserver.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/net/LollipopNetworkObserver.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.core.net +package com.topjohnwu.magisk.utils.net import android.annotation.TargetApi import android.content.Context diff --git a/app/src/main/java/com/topjohnwu/magisk/core/net/MarshmallowNetworkObserver.kt b/app/src/main/java/com/topjohnwu/magisk/utils/net/MarshmallowNetworkObserver.kt similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/core/net/MarshmallowNetworkObserver.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/net/MarshmallowNetworkObserver.kt index 809959c3b..8dba6d010 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/net/MarshmallowNetworkObserver.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/net/MarshmallowNetworkObserver.kt @@ -1,4 +1,6 @@ -package com.topjohnwu.magisk.core.net +@file:Suppress("DEPRECATION") + +package com.topjohnwu.magisk.utils.net import android.annotation.TargetApi import android.content.BroadcastReceiver diff --git a/app/src/main/java/com/topjohnwu/magisk/core/net/NetworkObserver.kt b/app/src/main/java/com/topjohnwu/magisk/utils/net/NetworkObserver.kt similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/core/net/NetworkObserver.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/net/NetworkObserver.kt index 1e6268fbc..68152ff3a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/net/NetworkObserver.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/net/NetworkObserver.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.core.net +package com.topjohnwu.magisk.utils.net import android.content.Context import android.net.ConnectivityManager diff --git a/app/src/main/java/com/topjohnwu/magisk/core/net/PreLollipopNetworkObserver.kt b/app/src/main/java/com/topjohnwu/magisk/utils/net/PreLollipopNetworkObserver.kt similarity index 92% rename from app/src/main/java/com/topjohnwu/magisk/core/net/PreLollipopNetworkObserver.kt rename to app/src/main/java/com/topjohnwu/magisk/utils/net/PreLollipopNetworkObserver.kt index 888db5a83..754f19931 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/net/PreLollipopNetworkObserver.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/net/PreLollipopNetworkObserver.kt @@ -1,4 +1,6 @@ -package com.topjohnwu.magisk.core.net +@file:Suppress("DEPRECATION") + +package com.topjohnwu.magisk.utils.net import android.content.BroadcastReceiver import android.content.Context diff --git a/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt b/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt index 6f96c7832..651ced126 100644 --- a/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt +++ b/app/src/main/java/com/topjohnwu/magisk/view/MagiskDialog.kt @@ -23,9 +23,9 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.topjohnwu.magisk.BR import com.topjohnwu.magisk.R +import com.topjohnwu.magisk.arch.itemBindingOf import com.topjohnwu.magisk.databinding.ComparableRvItem import com.topjohnwu.magisk.databinding.DialogMagiskBaseBinding -import com.topjohnwu.magisk.ui.base.itemBindingOf import com.topjohnwu.magisk.utils.ObservableHost import com.topjohnwu.magisk.utils.set import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapters diff --git a/app/src/main/java/com/topjohnwu/magisk/core/view/Notifications.kt b/app/src/main/java/com/topjohnwu/magisk/view/Notifications.kt similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/core/view/Notifications.kt rename to app/src/main/java/com/topjohnwu/magisk/view/Notifications.kt index fec42f689..cafb0bebd 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/view/Notifications.kt +++ b/app/src/main/java/com/topjohnwu/magisk/view/Notifications.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.core.view +package com.topjohnwu.magisk.view import android.app.Notification import android.app.NotificationChannel diff --git a/app/src/main/java/com/topjohnwu/magisk/core/view/Shortcuts.kt b/app/src/main/java/com/topjohnwu/magisk/view/Shortcuts.kt similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/core/view/Shortcuts.kt rename to app/src/main/java/com/topjohnwu/magisk/view/Shortcuts.kt index 9cff55379..17bb6b306 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/view/Shortcuts.kt +++ b/app/src/main/java/com/topjohnwu/magisk/view/Shortcuts.kt @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.core.view +package com.topjohnwu.magisk.view import android.content.Context import android.content.Intent @@ -15,8 +15,8 @@ import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.SplashActivity import com.topjohnwu.magisk.core.intent -import com.topjohnwu.magisk.core.utils.Utils import com.topjohnwu.magisk.ktx.getBitmap +import com.topjohnwu.magisk.utils.Utils object Shortcuts {