From bea5308ab7bf42aca8ef9ed04a82f558804af079 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Thu, 11 Apr 2019 18:03:22 +0200 Subject: [PATCH] Updated locations of nearly all files This has been done in preparations for rewrite to kotlin and upcoming design changes. Nothing should be broken but use caution. --- app/proguard-rules.pro | 7 ++- app/src/main/java/a/b.java | 2 +- app/src/main/java/a/c.java | 2 +- app/src/main/java/a/f.java | 2 +- app/src/main/java/a/g.java | 2 +- app/src/main/java/a/h.java | 2 +- app/src/main/java/a/j.java | 2 +- app/src/main/java/a/m.java | 2 +- app/src/main/java/a/w.java | 2 +- .../main/java/com/topjohnwu/magisk/App.java | 14 ++--- .../java/com/topjohnwu/magisk/ClassMap.java | 10 ++-- .../magisk/{ => data}/database/MagiskDB.java | 6 +-- .../database/RepoDatabaseHelper.java | 4 +- .../adapters/ApplicationAdapter.java | 17 +++--- .../{ => model}/adapters/ModulesAdapter.java | 11 ++-- .../{ => model}/adapters/PolicyAdapter.java | 25 +++++---- .../{ => model}/adapters/ReposAdapter.java | 19 ++++--- .../adapters/SectionedAdapter.java | 2 +- .../adapters/StringListAdapter.java | 6 +-- .../{ => model}/adapters/SuLogAdapter.java | 11 ++-- .../adapters/TabFragmentAdapter.java | 8 +-- .../download}/DownloadModuleService.java | 17 +++--- .../entity}/BaseModule.java | 6 +-- .../{container => model/entity}/Module.java | 4 +- .../{container => model/entity}/Policy.java | 6 +-- .../{container => model/entity}/Repo.java | 2 +- .../entity}/SuLogEntry.java | 2 +- .../receiver}/GeneralReceiver.java | 8 +-- .../update}/UpdateCheckService.java | 11 ++-- .../worker}/DelegateWorker.java | 14 ++--- .../topjohnwu/magisk/tasks/UpdateRepos.java | 2 +- .../magisk/{ => ui}/MainActivity.java | 33 ++++++------ .../magisk/{ => ui}/SplashActivity.java | 19 ++++--- .../{components => ui/base}/BaseActivity.java | 16 +++--- .../{components => ui/base}/BaseFragment.java | 5 +- .../base}/BasePreferenceFragment.java | 10 ++-- .../magisk/{ => ui/flash}/FlashActivity.java | 17 +++--- .../hide}/MagiskHideFragment.java | 15 +++--- .../home}/MagiskFragment.java | 53 +++++++++---------- .../{fragments => ui/log}/LogFragment.java | 11 ++-- .../log}/MagiskLogFragment.java | 15 +++--- .../{fragments => ui/log}/SuLogFragment.java | 11 ++-- .../module}/ModulesFragment.java | 19 ++++--- .../module}/ReposFragment.java | 17 +++--- .../settings}/SettingsFragment.java | 20 +++---- .../superuser}/SuperuserFragment.java | 13 +++-- .../{ => ui/surequest}/SuRequestActivity.java | 15 +++--- .../topjohnwu/magisk/utils/DownloadApp.java | 4 +- .../com/topjohnwu/magisk/utils/PatchAPK.java | 8 +-- .../com/topjohnwu/magisk/utils/SuLogger.java | 4 +- .../com/topjohnwu/magisk/utils/Utils.java | 17 +++--- .../{container => utils}/ValueSortedMap.java | 6 +-- .../ArrowExpandable.java | 2 +- .../{uicomponents => view}/Expandable.java | 2 +- .../ExpandableViewHolder.java | 2 +- .../MarkDownWindow.java | 5 +- .../{uicomponents => view}/Notifications.java | 14 ++--- .../ProgressNotification.java | 6 +-- .../{uicomponents => view}/SafetyNet.java | 9 ++-- .../{uicomponents => view}/Shortcuts.java | 8 +-- .../{uicomponents => view}/SnackbarMaker.java | 6 +-- .../UpdateCardHolder.java | 2 +- .../{ => view}/dialogs/CustomAlertDialog.java | 7 ++- .../{ => view}/dialogs/EnvFixDialog.java | 6 +-- .../dialogs/FingerprintAuthDialog.java | 8 +-- .../dialogs/InstallMethodDialog.java | 14 ++--- .../dialogs/MagiskInstallDialog.java | 6 +-- .../dialogs/ManagerInstallDialog.java | 8 +-- .../{ => view}/dialogs/UninstallDialog.java | 10 ++-- 69 files changed, 338 insertions(+), 333 deletions(-) rename app/src/main/java/com/topjohnwu/magisk/{ => data}/database/MagiskDB.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{ => data}/database/RepoDatabaseHelper.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/ApplicationAdapter.java (99%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/ModulesAdapter.java (96%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/PolicyAdapter.java (93%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/ReposAdapter.java (95%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/SectionedAdapter.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/StringListAdapter.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/SuLogAdapter.java (96%) rename app/src/main/java/com/topjohnwu/magisk/{ => model}/adapters/TabFragmentAdapter.java (95%) rename app/src/main/java/com/topjohnwu/magisk/{components => model/download}/DownloadModuleService.java (94%) rename app/src/main/java/com/topjohnwu/magisk/{container => model/entity}/BaseModule.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{container => model/entity}/Module.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{container => model/entity}/Policy.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{container => model/entity}/Repo.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{container => model/entity}/SuLogEntry.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{components => model/receiver}/GeneralReceiver.java (94%) rename app/src/main/java/com/topjohnwu/magisk/{components => model/update}/UpdateCheckService.java (85%) rename app/src/main/java/com/topjohnwu/magisk/{components => model/worker}/DelegateWorker.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{ => ui}/MainActivity.java (91%) rename app/src/main/java/com/topjohnwu/magisk/{ => ui}/SplashActivity.java (87%) rename app/src/main/java/com/topjohnwu/magisk/{components => ui/base}/BaseActivity.java (99%) rename app/src/main/java/com/topjohnwu/magisk/{components => ui/base}/BaseFragment.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{components => ui/base}/BasePreferenceFragment.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{ => ui/flash}/FlashActivity.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/hide}/MagiskHideFragment.java (95%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/home}/MagiskFragment.java (93%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/log}/LogFragment.java (87%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/log}/MagiskLogFragment.java (95%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/log}/SuLogFragment.java (93%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/module}/ModulesFragment.java (94%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/module}/ReposFragment.java (95%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/settings}/SettingsFragment.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{fragments => ui/superuser}/SuperuserFragment.java (89%) rename app/src/main/java/com/topjohnwu/magisk/{ => ui/surequest}/SuRequestActivity.java (96%) rename app/src/main/java/com/topjohnwu/magisk/{container => utils}/ValueSortedMap.java (95%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/ArrowExpandable.java (96%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/Expandable.java (94%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/ExpandableViewHolder.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/MarkDownWindow.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/Notifications.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/ProgressNotification.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/SafetyNet.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/Shortcuts.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/SnackbarMaker.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{uicomponents => view}/UpdateCardHolder.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/CustomAlertDialog.java (99%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/EnvFixDialog.java (97%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/FingerprintAuthDialog.java (98%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/InstallMethodDialog.java (93%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/MagiskInstallDialog.java (92%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/ManagerInstallDialog.java (91%) rename app/src/main/java/com/topjohnwu/magisk/{ => view}/dialogs/UninstallDialog.java (93%) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index d6b2bb835..00ff344e1 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -30,7 +30,7 @@ } # DelegateWorker --keep,allowobfuscation class * extends com.topjohnwu.magisk.components.DelegateWorker +-keep,allowobfuscation class * extends com.topjohnwu.magisk.model.worker.DelegateWorker # BootSigner -keepclassmembers class com.topjohnwu.signing.BootSigner { *; } @@ -49,3 +49,8 @@ # Excessive obfuscation -repackageclasses 'a' -allowaccessmodification + +# QOL +-dontnote ** +-dontwarn com.caverock.androidsvg.** +-dontwarn ru.noties.markwon.** diff --git a/app/src/main/java/a/b.java b/app/src/main/java/a/b.java index 0e0409f89..db9475e9c 100644 --- a/app/src/main/java/a/b.java +++ b/app/src/main/java/a/b.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.MainActivity; +import com.topjohnwu.magisk.ui.MainActivity; public class b extends MainActivity { /* stub */ diff --git a/app/src/main/java/a/c.java b/app/src/main/java/a/c.java index 5e7bea238..73073ef6a 100644 --- a/app/src/main/java/a/c.java +++ b/app/src/main/java/a/c.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.SplashActivity; +import com.topjohnwu.magisk.ui.SplashActivity; public class c extends SplashActivity { /* stub */ diff --git a/app/src/main/java/a/f.java b/app/src/main/java/a/f.java index a40a5c70f..08d136b28 100644 --- a/app/src/main/java/a/f.java +++ b/app/src/main/java/a/f.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.FlashActivity; +import com.topjohnwu.magisk.ui.flash.FlashActivity; public class f extends FlashActivity { /* stub */ diff --git a/app/src/main/java/a/g.java b/app/src/main/java/a/g.java index 13771c547..ceaf4ff41 100644 --- a/app/src/main/java/a/g.java +++ b/app/src/main/java/a/g.java @@ -2,7 +2,7 @@ package a; import android.content.Context; -import com.topjohnwu.magisk.components.UpdateCheckService; +import com.topjohnwu.magisk.model.update.UpdateCheckService; import androidx.annotation.NonNull; import androidx.work.WorkerParameters; diff --git a/app/src/main/java/a/h.java b/app/src/main/java/a/h.java index 5b8709277..0be3819f7 100644 --- a/app/src/main/java/a/h.java +++ b/app/src/main/java/a/h.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.components.GeneralReceiver; +import com.topjohnwu.magisk.model.receiver.GeneralReceiver; public class h extends GeneralReceiver { /* stub */ diff --git a/app/src/main/java/a/j.java b/app/src/main/java/a/j.java index bdf1407cb..937100012 100644 --- a/app/src/main/java/a/j.java +++ b/app/src/main/java/a/j.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.components.DownloadModuleService; +import com.topjohnwu.magisk.model.download.DownloadModuleService; public class j extends DownloadModuleService { /* stub */ diff --git a/app/src/main/java/a/m.java b/app/src/main/java/a/m.java index d879fcd72..3d727085d 100644 --- a/app/src/main/java/a/m.java +++ b/app/src/main/java/a/m.java @@ -1,6 +1,6 @@ package a; -import com.topjohnwu.magisk.SuRequestActivity; +import com.topjohnwu.magisk.ui.surequest.SuRequestActivity; public class m extends SuRequestActivity { /* stub */ diff --git a/app/src/main/java/a/w.java b/app/src/main/java/a/w.java index 7be9efa37..e5a2fd89a 100644 --- a/app/src/main/java/a/w.java +++ b/app/src/main/java/a/w.java @@ -2,7 +2,7 @@ package a; import android.content.Context; -import com.topjohnwu.magisk.components.DelegateWorker; +import com.topjohnwu.magisk.model.worker.DelegateWorker; import java.lang.reflect.ParameterizedType; diff --git a/app/src/main/java/com/topjohnwu/magisk/App.java b/app/src/main/java/com/topjohnwu/magisk/App.java index 14284d949..179419249 100644 --- a/app/src/main/java/com/topjohnwu/magisk/App.java +++ b/app/src/main/java/com/topjohnwu/magisk/App.java @@ -10,13 +10,9 @@ import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AppCompatDelegate; - -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.database.MagiskDB; -import com.topjohnwu.magisk.database.RepoDatabaseHelper; +import com.topjohnwu.magisk.data.database.MagiskDB; +import com.topjohnwu.magisk.data.database.RepoDatabaseHelper; +import com.topjohnwu.magisk.ui.base.BaseActivity; import com.topjohnwu.magisk.utils.LocaleManager; import com.topjohnwu.magisk.utils.RootUtils; import com.topjohnwu.net.Networking; @@ -24,6 +20,10 @@ import com.topjohnwu.superuser.Shell; import java.util.concurrent.ThreadPoolExecutor; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatDelegate; + public class App extends Application implements Application.ActivityLifecycleCallbacks { public static App self; diff --git a/app/src/main/java/com/topjohnwu/magisk/ClassMap.java b/app/src/main/java/com/topjohnwu/magisk/ClassMap.java index 5bd8ace31..4013d5918 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ClassMap.java +++ b/app/src/main/java/com/topjohnwu/magisk/ClassMap.java @@ -1,8 +1,12 @@ package com.topjohnwu.magisk; -import com.topjohnwu.magisk.components.DownloadModuleService; -import com.topjohnwu.magisk.components.GeneralReceiver; -import com.topjohnwu.magisk.components.UpdateCheckService; +import com.topjohnwu.magisk.model.download.DownloadModuleService; +import com.topjohnwu.magisk.model.receiver.GeneralReceiver; +import com.topjohnwu.magisk.model.update.UpdateCheckService; +import com.topjohnwu.magisk.ui.MainActivity; +import com.topjohnwu.magisk.ui.SplashActivity; +import com.topjohnwu.magisk.ui.flash.FlashActivity; +import com.topjohnwu.magisk.ui.surequest.SuRequestActivity; import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/com/topjohnwu/magisk/database/MagiskDB.java b/app/src/main/java/com/topjohnwu/magisk/data/database/MagiskDB.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/database/MagiskDB.java rename to app/src/main/java/com/topjohnwu/magisk/data/database/MagiskDB.java index 69a3ee383..96b703cd1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/database/MagiskDB.java +++ b/app/src/main/java/com/topjohnwu/magisk/data/database/MagiskDB.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.database; +package com.topjohnwu.magisk.data.database; import android.content.ContentValues; import android.content.Context; @@ -7,8 +7,8 @@ import android.text.TextUtils; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.container.Policy; -import com.topjohnwu.magisk.container.SuLogEntry; +import com.topjohnwu.magisk.model.entity.Policy; +import com.topjohnwu.magisk.model.entity.SuLogEntry; import com.topjohnwu.magisk.utils.LocaleManager; import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.superuser.Shell; diff --git a/app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java b/app/src/main/java/com/topjohnwu/magisk/data/database/RepoDatabaseHelper.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java rename to app/src/main/java/com/topjohnwu/magisk/data/database/RepoDatabaseHelper.java index 852a2e887..8bb2bd369 100644 --- a/app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java +++ b/app/src/main/java/com/topjohnwu/magisk/data/database/RepoDatabaseHelper.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.database; +package com.topjohnwu.magisk.data.database; import android.content.Context; import android.database.Cursor; @@ -6,7 +6,7 @@ import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import com.topjohnwu.magisk.Config; -import com.topjohnwu.magisk.container.Repo; +import com.topjohnwu.magisk.model.entity.Repo; import java.util.HashSet; import java.util.Set; diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/ApplicationAdapter.java similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/ApplicationAdapter.java index 8c6363e3f..6c7d86eeb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/ApplicationAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.content.Context; import android.content.pm.ApplicationInfo; @@ -13,20 +13,14 @@ import android.widget.CheckBox; import android.widget.ImageView; import android.widget.TextView; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.WorkerThread; -import androidx.collection.ArraySet; -import androidx.recyclerview.widget.RecyclerView; - import com.buildware.widget.indeterm.IndeterminateCheckBox; import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.uicomponents.ArrowExpandable; -import com.topjohnwu.magisk.uicomponents.Expandable; import com.topjohnwu.magisk.utils.Event; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.ArrowExpandable; +import com.topjohnwu.magisk.view.Expandable; import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.internal.UiThreadHandler; @@ -35,6 +29,11 @@ import java.util.Comparator; import java.util.List; import java.util.Set; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.WorkerThread; +import androidx.collection.ArraySet; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import java9.util.Comparators; import java9.util.Lists; diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/ModulesAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/ModulesAdapter.java similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/adapters/ModulesAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/ModulesAdapter.java index 604cba6f5..e82481ffa 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ModulesAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/ModulesAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.content.Context; import android.text.TextUtils; @@ -9,17 +9,16 @@ import android.widget.CheckBox; import android.widget.ImageView; import android.widget.TextView; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; - import com.google.android.material.snackbar.Snackbar; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.container.Module; -import com.topjohnwu.magisk.uicomponents.SnackbarMaker; +import com.topjohnwu.magisk.model.entity.Module; +import com.topjohnwu.magisk.view.SnackbarMaker; import com.topjohnwu.superuser.Shell; import java.util.List; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; public class ModulesAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/PolicyAdapter.java similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/PolicyAdapter.java index 72fdcba1a..6b285dcc7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/PolicyAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.app.Activity; import android.content.DialogInterface; @@ -9,24 +9,23 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; -import androidx.annotation.NonNull; -import androidx.appcompat.widget.SwitchCompat; -import androidx.recyclerview.widget.RecyclerView; - import com.google.android.material.snackbar.Snackbar; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.container.Policy; -import com.topjohnwu.magisk.database.MagiskDB; -import com.topjohnwu.magisk.dialogs.CustomAlertDialog; -import com.topjohnwu.magisk.dialogs.FingerprintAuthDialog; -import com.topjohnwu.magisk.uicomponents.ArrowExpandable; -import com.topjohnwu.magisk.uicomponents.Expandable; -import com.topjohnwu.magisk.uicomponents.ExpandableViewHolder; -import com.topjohnwu.magisk.uicomponents.SnackbarMaker; +import com.topjohnwu.magisk.data.database.MagiskDB; +import com.topjohnwu.magisk.model.entity.Policy; import com.topjohnwu.magisk.utils.FingerprintHelper; +import com.topjohnwu.magisk.view.ArrowExpandable; +import com.topjohnwu.magisk.view.Expandable; +import com.topjohnwu.magisk.view.ExpandableViewHolder; +import com.topjohnwu.magisk.view.SnackbarMaker; +import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog; +import com.topjohnwu.magisk.view.dialogs.FingerprintAuthDialog; import java.util.List; +import androidx.annotation.NonNull; +import androidx.appcompat.widget.SwitchCompat; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; public class PolicyAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/ReposAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/ReposAdapter.java similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/adapters/ReposAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/ReposAdapter.java index 764fd3f63..162b809fb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ReposAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/ReposAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.content.Context; import android.content.Intent; @@ -13,25 +13,24 @@ import android.widget.ImageView; import android.widget.SearchView; import android.widget.TextView; -import androidx.recyclerview.widget.RecyclerView; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.components.DownloadModuleService; -import com.topjohnwu.magisk.container.Module; -import com.topjohnwu.magisk.container.Repo; -import com.topjohnwu.magisk.database.RepoDatabaseHelper; -import com.topjohnwu.magisk.dialogs.CustomAlertDialog; -import com.topjohnwu.magisk.uicomponents.MarkDownWindow; +import com.topjohnwu.magisk.data.database.RepoDatabaseHelper; +import com.topjohnwu.magisk.model.download.DownloadModuleService; +import com.topjohnwu.magisk.model.entity.Module; +import com.topjohnwu.magisk.model.entity.Repo; +import com.topjohnwu.magisk.ui.base.BaseActivity; import com.topjohnwu.magisk.utils.Event; +import com.topjohnwu.magisk.view.MarkDownWindow; +import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import java9.util.stream.StreamSupport; diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/SectionedAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/SectionedAdapter.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/adapters/SectionedAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/SectionedAdapter.java index de181cc19..e04ec20c7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/SectionedAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/SectionedAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.view.ViewGroup; diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/StringListAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/StringListAdapter.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/adapters/StringListAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/StringListAdapter.java index fb13c87bd..b76064220 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/StringListAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/StringListAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.app.Activity; import android.util.DisplayMetrics; @@ -7,13 +7,13 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import java.util.List; + import androidx.annotation.IdRes; import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import java.util.List; - public abstract class StringListAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/SuLogAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/SuLogAdapter.java similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/adapters/SuLogAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/SuLogAdapter.java index 84c0a3449..b1afdd51d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/SuLogAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/SuLogAdapter.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; import android.content.Context; import android.view.LayoutInflater; @@ -9,18 +9,17 @@ import android.view.animation.RotateAnimation; import android.widget.ImageView; import android.widget.TextView; -import androidx.recyclerview.widget.RecyclerView; - import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.container.SuLogEntry; -import com.topjohnwu.magisk.database.MagiskDB; -import com.topjohnwu.magisk.uicomponents.ExpandableViewHolder; +import com.topjohnwu.magisk.data.database.MagiskDB; +import com.topjohnwu.magisk.model.entity.SuLogEntry; +import com.topjohnwu.magisk.view.ExpandableViewHolder; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; public class SuLogAdapter extends SectionedAdapter { diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/TabFragmentAdapter.java b/app/src/main/java/com/topjohnwu/magisk/model/adapters/TabFragmentAdapter.java similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/adapters/TabFragmentAdapter.java rename to app/src/main/java/com/topjohnwu/magisk/model/adapters/TabFragmentAdapter.java index d0eea2be7..eddb897fb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/TabFragmentAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/adapters/TabFragmentAdapter.java @@ -1,13 +1,13 @@ -package com.topjohnwu.magisk.adapters; +package com.topjohnwu.magisk.model.adapters; +import java.util.ArrayList; +import java.util.List; + import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; -import java.util.ArrayList; -import java.util.List; - public class TabFragmentAdapter extends FragmentPagerAdapter { private List fragmentList; diff --git a/app/src/main/java/com/topjohnwu/magisk/components/DownloadModuleService.java b/app/src/main/java/com/topjohnwu/magisk/model/download/DownloadModuleService.java similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/components/DownloadModuleService.java rename to app/src/main/java/com/topjohnwu/magisk/model/download/DownloadModuleService.java index a17333cb8..8b1ce786a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/DownloadModuleService.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/download/DownloadModuleService.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.components; +package com.topjohnwu.magisk.model.download; import android.app.PendingIntent; import android.app.Service; @@ -6,15 +6,13 @@ import android.content.Intent; import android.net.Uri; import android.os.IBinder; -import androidx.annotation.Nullable; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.FlashActivity; -import com.topjohnwu.magisk.container.Repo; -import com.topjohnwu.magisk.uicomponents.Notifications; -import com.topjohnwu.magisk.uicomponents.ProgressNotification; +import com.topjohnwu.magisk.model.entity.Repo; +import com.topjohnwu.magisk.ui.flash.FlashActivity; +import com.topjohnwu.magisk.view.Notifications; +import com.topjohnwu.magisk.view.ProgressNotification; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.ShellUtils; @@ -25,12 +23,15 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; +import androidx.annotation.Nullable; + public class DownloadModuleService extends Service { private List notifications; @@ -136,7 +137,7 @@ public class DownloadModuleService extends Service { ShellUtils.pump(update_bin, zout); } zout.putNextEntry(new ZipEntry("META-INF/com/google/android/updater-script")); - zout.write("#MAGISK\n".getBytes("UTF-8")); + zout.write("#MAGISK\n".getBytes(StandardCharsets.UTF_8)); } int off = -1; diff --git a/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java b/app/src/main/java/com/topjohnwu/magisk/model/entity/BaseModule.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java rename to app/src/main/java/com/topjohnwu/magisk/model/entity/BaseModule.java index 259d1a985..20ccc4bec 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/BaseModule.java @@ -1,14 +1,14 @@ -package com.topjohnwu.magisk.container; +package com.topjohnwu.magisk.model.entity; import android.content.ContentValues; import android.database.Cursor; import android.os.Parcel; import android.os.Parcelable; -import androidx.annotation.NonNull; - import java.util.List; +import androidx.annotation.NonNull; + public abstract class BaseModule implements Comparable, Parcelable { private String mId, mName, mVersion, mAuthor, mDescription; diff --git a/app/src/main/java/com/topjohnwu/magisk/container/Module.java b/app/src/main/java/com/topjohnwu/magisk/model/entity/Module.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/container/Module.java rename to app/src/main/java/com/topjohnwu/magisk/model/entity/Module.java index 3c2cd032e..ed04b2830 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/Module.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/Module.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.container; +package com.topjohnwu.magisk.model.entity; import android.os.Parcel; import android.os.Parcelable; @@ -76,4 +76,4 @@ public class Module extends BaseModule { return mUpdated; } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/topjohnwu/magisk/container/Policy.java b/app/src/main/java/com/topjohnwu/magisk/model/entity/Policy.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/container/Policy.java rename to app/src/main/java/com/topjohnwu/magisk/model/entity/Policy.java index 6ff51f25a..10cc6dac6 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/Policy.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/Policy.java @@ -1,13 +1,13 @@ -package com.topjohnwu.magisk.container; +package com.topjohnwu.magisk.model.entity; import android.content.ContentValues; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; -import androidx.annotation.NonNull; - import com.topjohnwu.magisk.utils.Utils; +import androidx.annotation.NonNull; + public class Policy implements Comparable{ public static final int INTERACTIVE = 0; diff --git a/app/src/main/java/com/topjohnwu/magisk/container/Repo.java b/app/src/main/java/com/topjohnwu/magisk/model/entity/Repo.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/container/Repo.java rename to app/src/main/java/com/topjohnwu/magisk/model/entity/Repo.java index 63ffe197a..43f85f12e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/Repo.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/Repo.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.container; +package com.topjohnwu.magisk.model.entity; import android.content.ContentValues; import android.database.Cursor; diff --git a/app/src/main/java/com/topjohnwu/magisk/container/SuLogEntry.java b/app/src/main/java/com/topjohnwu/magisk/model/entity/SuLogEntry.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/container/SuLogEntry.java rename to app/src/main/java/com/topjohnwu/magisk/model/entity/SuLogEntry.java index 2638105f4..aa778d65e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/SuLogEntry.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/entity/SuLogEntry.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.container; +package com.topjohnwu.magisk.model.entity; import android.content.ContentValues; diff --git a/app/src/main/java/com/topjohnwu/magisk/components/GeneralReceiver.java b/app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.java similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/components/GeneralReceiver.java rename to app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.java index 40c103f35..dd71c7f09 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/GeneralReceiver.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.components; +package com.topjohnwu.magisk.model.receiver; import android.content.BroadcastReceiver; import android.content.Context; @@ -8,11 +8,11 @@ import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.SuRequestActivity; -import com.topjohnwu.magisk.uicomponents.Notifications; -import com.topjohnwu.magisk.uicomponents.Shortcuts; +import com.topjohnwu.magisk.ui.surequest.SuRequestActivity; import com.topjohnwu.magisk.utils.DownloadApp; import com.topjohnwu.magisk.utils.SuLogger; +import com.topjohnwu.magisk.view.Notifications; +import com.topjohnwu.magisk.view.Shortcuts; import com.topjohnwu.superuser.Shell; public class GeneralReceiver extends BroadcastReceiver { diff --git a/app/src/main/java/com/topjohnwu/magisk/components/UpdateCheckService.java b/app/src/main/java/com/topjohnwu/magisk/model/update/UpdateCheckService.java similarity index 85% rename from app/src/main/java/com/topjohnwu/magisk/components/UpdateCheckService.java rename to app/src/main/java/com/topjohnwu/magisk/model/update/UpdateCheckService.java index 79d6241a4..87c6544ef 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/UpdateCheckService.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/update/UpdateCheckService.java @@ -1,15 +1,16 @@ -package com.topjohnwu.magisk.components; - -import androidx.annotation.NonNull; -import androidx.work.ListenableWorker; +package com.topjohnwu.magisk.model.update; import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.BuildConfig; import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.model.worker.DelegateWorker; import com.topjohnwu.magisk.tasks.CheckUpdates; -import com.topjohnwu.magisk.uicomponents.Notifications; +import com.topjohnwu.magisk.view.Notifications; import com.topjohnwu.superuser.Shell; +import androidx.annotation.NonNull; +import androidx.work.ListenableWorker; + public class UpdateCheckService extends DelegateWorker { @NonNull diff --git a/app/src/main/java/com/topjohnwu/magisk/components/DelegateWorker.java b/app/src/main/java/com/topjohnwu/magisk/model/worker/DelegateWorker.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/components/DelegateWorker.java rename to app/src/main/java/com/topjohnwu/magisk/model/worker/DelegateWorker.java index 609cbb114..670e88d1c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/DelegateWorker.java +++ b/app/src/main/java/com/topjohnwu/magisk/model/worker/DelegateWorker.java @@ -1,9 +1,15 @@ -package com.topjohnwu.magisk.components; +package com.topjohnwu.magisk.model.worker; import android.content.Context; import android.net.Network; import android.net.Uri; +import com.google.common.util.concurrent.ListenableFuture; + +import java.util.List; +import java.util.Set; +import java.util.UUID; + import androidx.annotation.MainThread; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -11,12 +17,6 @@ import androidx.annotation.RequiresApi; import androidx.work.Data; import androidx.work.ListenableWorker; -import com.google.common.util.concurrent.ListenableFuture; - -import java.util.List; -import java.util.Set; -import java.util.UUID; - public abstract class DelegateWorker { private ListenableWorker worker; diff --git a/app/src/main/java/com/topjohnwu/magisk/tasks/UpdateRepos.java b/app/src/main/java/com/topjohnwu/magisk/tasks/UpdateRepos.java index d13dd6546..9d6e44571 100644 --- a/app/src/main/java/com/topjohnwu/magisk/tasks/UpdateRepos.java +++ b/app/src/main/java/com/topjohnwu/magisk/tasks/UpdateRepos.java @@ -6,7 +6,7 @@ import android.util.Pair; import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.container.Repo; +import com.topjohnwu.magisk.model.entity.Repo; import com.topjohnwu.magisk.utils.Event; import com.topjohnwu.magisk.utils.Logger; import com.topjohnwu.magisk.utils.Utils; diff --git a/app/src/main/java/com/topjohnwu/magisk/MainActivity.java b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.java similarity index 91% rename from app/src/main/java/com/topjohnwu/magisk/MainActivity.java rename to app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.java index f98f1977f..3da71cf37 100644 --- a/app/src/main/java/com/topjohnwu/magisk/MainActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk; +package com.topjohnwu.magisk.ui; import android.content.Intent; import android.os.Build; @@ -8,26 +8,29 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; +import com.google.android.material.navigation.NavigationView; +import com.topjohnwu.magisk.ClassMap; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.Const; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.ui.base.BaseActivity; +import com.topjohnwu.magisk.ui.hide.MagiskHideFragment; +import com.topjohnwu.magisk.ui.home.MagiskFragment; +import com.topjohnwu.magisk.ui.log.LogFragment; +import com.topjohnwu.magisk.ui.module.ModulesFragment; +import com.topjohnwu.magisk.ui.module.ReposFragment; +import com.topjohnwu.magisk.ui.settings.SettingsFragment; +import com.topjohnwu.magisk.ui.superuser.SuperuserFragment; +import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.net.Networking; +import com.topjohnwu.superuser.Shell; + import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.widget.Toolbar; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; - -import com.google.android.material.navigation.NavigationView; -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.fragments.LogFragment; -import com.topjohnwu.magisk.fragments.MagiskFragment; -import com.topjohnwu.magisk.fragments.MagiskHideFragment; -import com.topjohnwu.magisk.fragments.ModulesFragment; -import com.topjohnwu.magisk.fragments.ReposFragment; -import com.topjohnwu.magisk.fragments.SettingsFragment; -import com.topjohnwu.magisk.fragments.SuperuserFragment; -import com.topjohnwu.magisk.utils.Utils; -import com.topjohnwu.net.Networking; -import com.topjohnwu.superuser.Shell; - import butterknife.BindView; public class MainActivity extends BaseActivity diff --git a/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java b/app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.java similarity index 87% rename from app/src/main/java/com/topjohnwu/magisk/SplashActivity.java rename to app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.java index 91c3722af..ee0d8014d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.java @@ -1,23 +1,28 @@ -package com.topjohnwu.magisk; +package com.topjohnwu.magisk.ui; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.text.TextUtils; -import androidx.appcompat.app.AlertDialog; - -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.database.RepoDatabaseHelper; +import com.topjohnwu.magisk.BuildConfig; +import com.topjohnwu.magisk.ClassMap; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.Const; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.data.database.RepoDatabaseHelper; import com.topjohnwu.magisk.tasks.CheckUpdates; import com.topjohnwu.magisk.tasks.UpdateRepos; -import com.topjohnwu.magisk.uicomponents.Notifications; -import com.topjohnwu.magisk.uicomponents.Shortcuts; +import com.topjohnwu.magisk.ui.base.BaseActivity; import com.topjohnwu.magisk.utils.LocaleManager; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.Notifications; +import com.topjohnwu.magisk.view.Shortcuts; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; +import androidx.appcompat.app.AlertDialog; + public class SplashActivity extends BaseActivity { public static boolean DONE = false; diff --git a/app/src/main/java/com/topjohnwu/magisk/components/BaseActivity.java b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseActivity.java similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/components/BaseActivity.java rename to app/src/main/java/com/topjohnwu/magisk/ui/base/BaseActivity.java index 9db327987..ed42d5b10 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/BaseActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseActivity.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.components; +package com.topjohnwu.magisk.ui.base; import android.Manifest; import android.content.Context; @@ -11,6 +11,13 @@ import android.os.Bundle; import android.text.TextUtils; import android.view.WindowManager; +import com.topjohnwu.magisk.App; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.Const; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.utils.Event; +import com.topjohnwu.magisk.utils.LocaleManager; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StyleRes; @@ -19,13 +26,6 @@ import androidx.collection.SparseArrayCompat; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import com.topjohnwu.magisk.App; -import com.topjohnwu.magisk.Config; -import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.utils.Event; -import com.topjohnwu.magisk.utils.LocaleManager; - public abstract class BaseActivity extends AppCompatActivity implements Event.AutoListener { static int[] EMPTY_INT_ARRAY = new int[0]; diff --git a/app/src/main/java/com/topjohnwu/magisk/components/BaseFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseFragment.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/components/BaseFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/base/BaseFragment.java index fbaa8f71a..3594a4c19 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/BaseFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/base/BaseFragment.java @@ -1,12 +1,11 @@ -package com.topjohnwu.magisk.components; +package com.topjohnwu.magisk.ui.base; import android.content.Intent; -import androidx.fragment.app.Fragment; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.utils.Event; +import androidx.fragment.app.Fragment; import butterknife.Unbinder; public abstract class BaseFragment extends Fragment implements Event.AutoListener { diff --git a/app/src/main/java/com/topjohnwu/magisk/components/BasePreferenceFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/base/BasePreferenceFragment.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/components/BasePreferenceFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/base/BasePreferenceFragment.java index f6512518f..02e04ac3e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/components/BasePreferenceFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/base/BasePreferenceFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.components; +package com.topjohnwu.magisk.ui.base; import android.annotation.SuppressLint; import android.content.SharedPreferences; @@ -8,6 +8,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import com.topjohnwu.magisk.App; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.utils.Event; + import androidx.preference.Preference; import androidx.preference.PreferenceCategory; import androidx.preference.PreferenceFragmentCompat; @@ -16,10 +20,6 @@ import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceViewHolder; import androidx.recyclerview.widget.RecyclerView; -import com.topjohnwu.magisk.App; -import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.utils.Event; - public abstract class BasePreferenceFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener, Event.AutoListener { diff --git a/app/src/main/java/com/topjohnwu/magisk/FlashActivity.java b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashActivity.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/FlashActivity.java rename to app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashActivity.java index 974f2dfb4..741050e77 100644 --- a/app/src/main/java/com/topjohnwu/magisk/FlashActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashActivity.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk; +package com.topjohnwu.magisk.ui.flash; import android.content.Intent; import android.net.Uri; @@ -8,15 +8,12 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.Toast; -import androidx.annotation.NonNull; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.widget.Toolbar; -import androidx.recyclerview.widget.RecyclerView; - -import com.topjohnwu.magisk.adapters.StringListAdapter; -import com.topjohnwu.magisk.components.BaseActivity; +import com.topjohnwu.magisk.Const; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.model.adapters.StringListAdapter; import com.topjohnwu.magisk.tasks.FlashZip; import com.topjohnwu.magisk.tasks.MagiskInstaller; +import com.topjohnwu.magisk.ui.base.BaseActivity; import com.topjohnwu.magisk.utils.RootUtils; import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.superuser.CallbackList; @@ -32,6 +29,10 @@ import java.util.Collections; import java.util.List; import java.util.Locale; +import androidx.annotation.NonNull; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindColor; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/MagiskHideFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/hide/MagiskHideFragment.java similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/fragments/MagiskHideFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/hide/MagiskHideFragment.java index 1f31e27d2..c7f4c3356 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/MagiskHideFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/hide/MagiskHideFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.hide; import android.os.Bundle; import android.view.LayoutInflater; @@ -9,17 +9,16 @@ import android.view.View; import android.view.ViewGroup; import android.widget.SearchView; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.model.adapters.ApplicationAdapter; +import com.topjohnwu.magisk.ui.base.BaseFragment; +import com.topjohnwu.magisk.utils.Event; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; - -import com.topjohnwu.magisk.Config; -import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.ApplicationAdapter; -import com.topjohnwu.magisk.components.BaseFragment; -import com.topjohnwu.magisk.utils.Event; - import butterknife.BindView; public class MagiskHideFragment extends BaseFragment { diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/MagiskFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.java similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/fragments/MagiskFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.java index 455307d46..4a1864214 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/MagiskFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/MagiskFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.home; import android.net.Uri; import android.os.Bundle; @@ -9,6 +9,31 @@ import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; +import com.topjohnwu.magisk.BuildConfig; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.Const; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.tasks.CheckUpdates; +import com.topjohnwu.magisk.ui.MainActivity; +import com.topjohnwu.magisk.ui.base.BaseActivity; +import com.topjohnwu.magisk.ui.base.BaseFragment; +import com.topjohnwu.magisk.utils.Event; +import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.ArrowExpandable; +import com.topjohnwu.magisk.view.Expandable; +import com.topjohnwu.magisk.view.ExpandableViewHolder; +import com.topjohnwu.magisk.view.MarkDownWindow; +import com.topjohnwu.magisk.view.SafetyNet; +import com.topjohnwu.magisk.view.UpdateCardHolder; +import com.topjohnwu.magisk.view.dialogs.EnvFixDialog; +import com.topjohnwu.magisk.view.dialogs.MagiskInstallDialog; +import com.topjohnwu.magisk.view.dialogs.ManagerInstallDialog; +import com.topjohnwu.magisk.view.dialogs.UninstallDialog; +import com.topjohnwu.net.Networking; +import com.topjohnwu.superuser.Shell; + +import java.util.Locale; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.cardview.widget.CardView; @@ -18,32 +43,6 @@ import androidx.transition.Fade; import androidx.transition.Transition; import androidx.transition.TransitionManager; import androidx.transition.TransitionSet; - -import com.topjohnwu.magisk.BuildConfig; -import com.topjohnwu.magisk.Config; -import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.MainActivity; -import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.components.BaseFragment; -import com.topjohnwu.magisk.dialogs.EnvFixDialog; -import com.topjohnwu.magisk.dialogs.MagiskInstallDialog; -import com.topjohnwu.magisk.dialogs.ManagerInstallDialog; -import com.topjohnwu.magisk.dialogs.UninstallDialog; -import com.topjohnwu.magisk.tasks.CheckUpdates; -import com.topjohnwu.magisk.uicomponents.ArrowExpandable; -import com.topjohnwu.magisk.uicomponents.Expandable; -import com.topjohnwu.magisk.uicomponents.ExpandableViewHolder; -import com.topjohnwu.magisk.uicomponents.MarkDownWindow; -import com.topjohnwu.magisk.uicomponents.SafetyNet; -import com.topjohnwu.magisk.uicomponents.UpdateCardHolder; -import com.topjohnwu.magisk.utils.Event; -import com.topjohnwu.magisk.utils.Utils; -import com.topjohnwu.net.Networking; -import com.topjohnwu.superuser.Shell; - -import java.util.Locale; - import butterknife.BindColor; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/LogFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.java similarity index 87% rename from app/src/main/java/com/topjohnwu/magisk/fragments/LogFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.java index d068b3bb1..d684e1d6f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/LogFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/LogFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.log; import android.os.Build; @@ -7,14 +7,13 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import androidx.viewpager.widget.ViewPager; - import com.google.android.material.tabs.TabLayout; -import com.topjohnwu.magisk.MainActivity; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.TabFragmentAdapter; -import com.topjohnwu.magisk.components.BaseFragment; +import com.topjohnwu.magisk.model.adapters.TabFragmentAdapter; +import com.topjohnwu.magisk.ui.MainActivity; +import com.topjohnwu.magisk.ui.base.BaseFragment; +import androidx.viewpager.widget.ViewPager; import butterknife.BindView; public class LogFragment extends BaseFragment { diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/MagiskLogFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/log/MagiskLogFragment.java similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/fragments/MagiskLogFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/log/MagiskLogFragment.java index dee954f78..0e44c25e9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/MagiskLogFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/MagiskLogFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.log; import android.os.Bundle; import android.view.LayoutInflater; @@ -8,17 +8,13 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.RecyclerView; - import com.google.android.material.snackbar.Snackbar; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.StringListAdapter; -import com.topjohnwu.magisk.components.BaseFragment; -import com.topjohnwu.magisk.uicomponents.SnackbarMaker; +import com.topjohnwu.magisk.model.adapters.StringListAdapter; +import com.topjohnwu.magisk.ui.base.BaseFragment; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.SnackbarMaker; import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.internal.NOPList; @@ -27,6 +23,9 @@ import java.io.IOException; import java.util.Calendar; import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; public class MagiskLogFragment extends BaseFragment { diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/SuLogFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/log/SuLogFragment.java similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/fragments/SuLogFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/log/SuLogFragment.java index e22b415e6..9f6595d00 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/SuLogFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/log/SuLogFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.log; import android.os.Bundle; import android.view.LayoutInflater; @@ -9,13 +9,12 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.model.adapters.SuLogAdapter; +import com.topjohnwu.magisk.ui.base.BaseFragment; + import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; - -import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.SuLogAdapter; -import com.topjohnwu.magisk.components.BaseFragment; - import butterknife.BindView; public class SuLogFragment extends BaseFragment { diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/ModulesFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModulesFragment.java similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/fragments/ModulesFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/module/ModulesFragment.java index 06affa253..78d5989a7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/ModulesFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModulesFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.module; import android.app.Activity; import android.content.Intent; @@ -11,18 +11,13 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.RecyclerView; -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; - import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.FlashActivity; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.ModulesAdapter; -import com.topjohnwu.magisk.components.BaseFragment; -import com.topjohnwu.magisk.container.Module; +import com.topjohnwu.magisk.model.adapters.ModulesAdapter; +import com.topjohnwu.magisk.model.entity.Module; +import com.topjohnwu.magisk.ui.base.BaseFragment; +import com.topjohnwu.magisk.ui.flash.FlashActivity; import com.topjohnwu.magisk.utils.Event; import com.topjohnwu.magisk.utils.RootUtils; import com.topjohnwu.magisk.utils.Utils; @@ -32,6 +27,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/ReposFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/module/ReposFragment.java similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/fragments/ReposFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/module/ReposFragment.java index b45e2acf0..4c12fee70 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/ReposFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ReposFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.module; import android.app.AlertDialog; import android.os.Bundle; @@ -11,18 +11,17 @@ import android.view.ViewGroup; import android.widget.SearchView; import android.widget.TextView; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.model.adapters.ReposAdapter; +import com.topjohnwu.magisk.tasks.UpdateRepos; +import com.topjohnwu.magisk.ui.base.BaseFragment; +import com.topjohnwu.magisk.utils.Event; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; - -import com.topjohnwu.magisk.Config; -import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.ReposAdapter; -import com.topjohnwu.magisk.components.BaseFragment; -import com.topjohnwu.magisk.tasks.UpdateRepos; -import com.topjohnwu.magisk.utils.Event; - import butterknife.BindView; public class ReposFragment extends BaseFragment { diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/SettingsFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/fragments/SettingsFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java index 4902aa392..7938275b8 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/SettingsFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.settings; import android.content.SharedPreferences; import android.os.Build; @@ -8,26 +8,19 @@ import android.view.View; import android.widget.EditText; import android.widget.Toast; -import androidx.appcompat.app.AlertDialog; -import androidx.preference.ListPreference; -import androidx.preference.Preference; -import androidx.preference.PreferenceCategory; -import androidx.preference.PreferenceScreen; -import androidx.preference.SwitchPreferenceCompat; - import com.topjohnwu.magisk.BuildConfig; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.components.BasePreferenceFragment; -import com.topjohnwu.magisk.dialogs.FingerprintAuthDialog; import com.topjohnwu.magisk.tasks.CheckUpdates; +import com.topjohnwu.magisk.ui.base.BasePreferenceFragment; import com.topjohnwu.magisk.utils.DownloadApp; import com.topjohnwu.magisk.utils.Event; import com.topjohnwu.magisk.utils.FingerprintHelper; import com.topjohnwu.magisk.utils.LocaleManager; import com.topjohnwu.magisk.utils.PatchAPK; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.dialogs.FingerprintAuthDialog; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; @@ -35,6 +28,13 @@ import java.io.IOException; import java.util.Arrays; import java.util.Locale; +import androidx.appcompat.app.AlertDialog; +import androidx.preference.ListPreference; +import androidx.preference.Preference; +import androidx.preference.PreferenceCategory; +import androidx.preference.PreferenceScreen; +import androidx.preference.SwitchPreferenceCompat; + public class SettingsFragment extends BasePreferenceFragment { private ListPreference updateChannel, autoRes, suNotification, diff --git a/app/src/main/java/com/topjohnwu/magisk/fragments/SuperuserFragment.java b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.java similarity index 89% rename from app/src/main/java/com/topjohnwu/magisk/fragments/SuperuserFragment.java rename to app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.java index 26132abb7..2f5beaf7b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/fragments/SuperuserFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.fragments; +package com.topjohnwu.magisk.ui.superuser; import android.content.pm.PackageManager; import android.os.Bundle; @@ -7,16 +7,15 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.RecyclerView; - import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.adapters.PolicyAdapter; -import com.topjohnwu.magisk.components.BaseFragment; -import com.topjohnwu.magisk.container.Policy; +import com.topjohnwu.magisk.model.adapters.PolicyAdapter; +import com.topjohnwu.magisk.model.entity.Policy; +import com.topjohnwu.magisk.ui.base.BaseFragment; import java.util.List; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; public class SuperuserFragment extends BaseFragment { diff --git a/app/src/main/java/com/topjohnwu/magisk/SuRequestActivity.java b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.java similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/SuRequestActivity.java rename to app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.java index e5b482e47..481956be5 100644 --- a/app/src/main/java/com/topjohnwu/magisk/SuRequestActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestActivity.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk; +package com.topjohnwu.magisk.ui.surequest; import android.annotation.SuppressLint; import android.content.Intent; @@ -17,11 +17,12 @@ import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; -import androidx.annotation.Nullable; -import androidx.appcompat.content.res.AppCompatResources; - -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.container.Policy; +import com.topjohnwu.magisk.App; +import com.topjohnwu.magisk.BuildConfig; +import com.topjohnwu.magisk.Config; +import com.topjohnwu.magisk.R; +import com.topjohnwu.magisk.model.entity.Policy; +import com.topjohnwu.magisk.ui.base.BaseActivity; import com.topjohnwu.magisk.utils.FingerprintHelper; import com.topjohnwu.magisk.utils.SuConnector; import com.topjohnwu.magisk.utils.SuLogger; @@ -30,6 +31,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.content.res.AppCompatResources; import butterknife.BindView; import java9.lang.Iterables; diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/DownloadApp.java b/app/src/main/java/com/topjohnwu/magisk/utils/DownloadApp.java index 14f9329e4..39727e52d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/DownloadApp.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/DownloadApp.java @@ -7,8 +7,8 @@ import com.topjohnwu.magisk.BuildConfig; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.SplashActivity; -import com.topjohnwu.magisk.uicomponents.ProgressNotification; +import com.topjohnwu.magisk.ui.SplashActivity; +import com.topjohnwu.magisk.view.ProgressNotification; import com.topjohnwu.net.Networking; import com.topjohnwu.net.ResponseListener; import com.topjohnwu.superuser.Shell; diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.java b/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.java index d7f8eddf2..0d77c058a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.java @@ -3,16 +3,14 @@ package com.topjohnwu.magisk.utils; import android.content.ComponentName; import android.widget.Toast; -import androidx.core.app.NotificationCompat; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.BuildConfig; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.SplashActivity; -import com.topjohnwu.magisk.uicomponents.Notifications; +import com.topjohnwu.magisk.ui.SplashActivity; +import com.topjohnwu.magisk.view.Notifications; import com.topjohnwu.signing.JarMap; import com.topjohnwu.signing.SignAPK; import com.topjohnwu.superuser.Shell; @@ -29,6 +27,8 @@ import java.util.ArrayList; import java.util.List; import java.util.jar.JarEntry; +import androidx.core.app.NotificationCompat; + public class PatchAPK { public static final String LOWERALPHA = "abcdefghijklmnopqrstuvwxyz"; diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/SuLogger.java b/app/src/main/java/com/topjohnwu/magisk/utils/SuLogger.java index 0a41cedfe..888a65262 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/SuLogger.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/SuLogger.java @@ -9,8 +9,8 @@ import android.widget.Toast; import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.container.Policy; -import com.topjohnwu.magisk.container.SuLogEntry; +import com.topjohnwu.magisk.model.entity.Policy; +import com.topjohnwu.magisk.model.entity.SuLogEntry; import java.util.Date; diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java index 9cb213c7a..1cbcb06d5 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java @@ -12,21 +12,14 @@ import android.net.Uri; import android.provider.OpenableColumns; import android.widget.Toast; -import androidx.work.Constraints; -import androidx.work.ExistingPeriodicWorkPolicy; -import androidx.work.NetworkType; -import androidx.work.PeriodicWorkRequest; -import androidx.work.WorkManager; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.BuildConfig; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.components.UpdateCheckService; -import com.topjohnwu.magisk.container.Module; -import com.topjohnwu.magisk.container.ValueSortedMap; +import com.topjohnwu.magisk.model.entity.Module; +import com.topjohnwu.magisk.model.update.UpdateCheckService; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.internal.UiThreadHandler; @@ -37,6 +30,12 @@ import java.util.Locale; import java.util.Map; import java.util.concurrent.TimeUnit; +import androidx.work.Constraints; +import androidx.work.ExistingPeriodicWorkPolicy; +import androidx.work.NetworkType; +import androidx.work.PeriodicWorkRequest; +import androidx.work.WorkManager; + public class Utils { public static void toast(CharSequence msg, int duration) { diff --git a/app/src/main/java/com/topjohnwu/magisk/container/ValueSortedMap.java b/app/src/main/java/com/topjohnwu/magisk/utils/ValueSortedMap.java similarity index 95% rename from app/src/main/java/com/topjohnwu/magisk/container/ValueSortedMap.java rename to app/src/main/java/com/topjohnwu/magisk/utils/ValueSortedMap.java index 9f5047d75..babd8ba79 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/ValueSortedMap.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/ValueSortedMap.java @@ -1,6 +1,4 @@ -package com.topjohnwu.magisk.container; - -import androidx.annotation.NonNull; +package com.topjohnwu.magisk.utils; import java.util.ArrayList; import java.util.Collection; @@ -9,6 +7,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import androidx.annotation.NonNull; + public class ValueSortedMap> extends HashMap { private List sorted = new ArrayList<>(); diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/ArrowExpandable.java b/app/src/main/java/com/topjohnwu/magisk/view/ArrowExpandable.java similarity index 96% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/ArrowExpandable.java rename to app/src/main/java/com/topjohnwu/magisk/view/ArrowExpandable.java index c49d402cd..81478cddd 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/ArrowExpandable.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/ArrowExpandable.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.view.View; import android.view.animation.Animation; diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/Expandable.java b/app/src/main/java/com/topjohnwu/magisk/view/Expandable.java similarity index 94% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/Expandable.java rename to app/src/main/java/com/topjohnwu/magisk/view/Expandable.java index e854d929b..82471b66d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/Expandable.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/Expandable.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; public abstract class Expandable { diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/ExpandableViewHolder.java b/app/src/main/java/com/topjohnwu/magisk/view/ExpandableViewHolder.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/ExpandableViewHolder.java rename to app/src/main/java/com/topjohnwu/magisk/view/ExpandableViewHolder.java index 015ce3fdb..f27b96b31 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/ExpandableViewHolder.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/ExpandableViewHolder.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.animation.ValueAnimator; import android.view.View; diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/MarkDownWindow.java b/app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/MarkDownWindow.java rename to app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java index a161d916a..f7e3b3dae 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/MarkDownWindow.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java @@ -1,11 +1,9 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.app.Activity; import android.view.LayoutInflater; import android.view.View; -import androidx.appcompat.app.AlertDialog; - import com.topjohnwu.magisk.R; import com.topjohnwu.net.Networking; import com.topjohnwu.net.ResponseListener; @@ -13,6 +11,7 @@ import com.topjohnwu.net.ResponseListener; import java.io.InputStream; import java.util.Scanner; +import androidx.appcompat.app.AlertDialog; import ru.noties.markwon.Markwon; import ru.noties.markwon.html.HtmlPlugin; import ru.noties.markwon.image.ImagesPlugin; diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/Notifications.java b/app/src/main/java/com/topjohnwu/magisk/view/Notifications.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/Notifications.java rename to app/src/main/java/com/topjohnwu/magisk/view/Notifications.java index e90956f35..244c51b25 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/Notifications.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/Notifications.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -7,19 +7,19 @@ import android.content.Context; import android.content.Intent; import android.os.Build; -import androidx.core.app.NotificationCompat; -import androidx.core.app.NotificationManagerCompat; -import androidx.core.app.TaskStackBuilder; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.SplashActivity; -import com.topjohnwu.magisk.components.GeneralReceiver; +import com.topjohnwu.magisk.model.receiver.GeneralReceiver; +import com.topjohnwu.magisk.ui.SplashActivity; import com.topjohnwu.magisk.utils.Utils; +import androidx.core.app.NotificationCompat; +import androidx.core.app.NotificationManagerCompat; +import androidx.core.app.TaskStackBuilder; + public class Notifications { public static NotificationManagerCompat mgr = NotificationManagerCompat.from(App.self); diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/ProgressNotification.java b/app/src/main/java/com/topjohnwu/magisk/view/ProgressNotification.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/ProgressNotification.java rename to app/src/main/java/com/topjohnwu/magisk/view/ProgressNotification.java index 19b1ddcd7..a7ff7721d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/ProgressNotification.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/ProgressNotification.java @@ -1,17 +1,17 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.app.Notification; import android.app.PendingIntent; import android.content.Intent; import android.widget.Toast; -import androidx.core.app.NotificationCompat; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.net.DownloadProgressListener; +import androidx.core.app.NotificationCompat; + public class ProgressNotification implements DownloadProgressListener { private NotificationCompat.Builder builder; diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/SafetyNet.java b/app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/SafetyNet.java rename to app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java index 8b08d9674..8796bac8d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/SafetyNet.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.app.Activity; import android.content.Context; @@ -10,19 +10,18 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; -import androidx.annotation.StringRes; -import androidx.cardview.widget.CardView; - import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.dialogs.CustomAlertDialog; import com.topjohnwu.magisk.utils.ISafetyNetHelper; +import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; import java.io.File; +import androidx.annotation.StringRes; +import androidx.cardview.widget.CardView; import butterknife.BindColor; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/Shortcuts.java b/app/src/main/java/com/topjohnwu/magisk/view/Shortcuts.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/Shortcuts.java rename to app/src/main/java/com/topjohnwu/magisk/view/Shortcuts.java index a0c313556..ba841564c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/Shortcuts.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/Shortcuts.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.content.Context; import android.content.Intent; @@ -7,18 +7,18 @@ import android.content.pm.ShortcutManager; import android.graphics.drawable.Icon; import android.os.Build; -import androidx.annotation.RequiresApi; - import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.SplashActivity; +import com.topjohnwu.magisk.ui.SplashActivity; import com.topjohnwu.magisk.utils.Utils; import com.topjohnwu.superuser.Shell; import java.util.ArrayList; +import androidx.annotation.RequiresApi; + public class Shortcuts { public static void setup(Context context) { diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/SnackbarMaker.java b/app/src/main/java/com/topjohnwu/magisk/view/SnackbarMaker.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/SnackbarMaker.java rename to app/src/main/java/com/topjohnwu/magisk/view/SnackbarMaker.java index 431eb2221..dc0f1ca61 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/SnackbarMaker.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/SnackbarMaker.java @@ -1,16 +1,16 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.app.Activity; import android.net.Uri; import android.view.View; import android.widget.TextView; -import androidx.annotation.StringRes; - import com.google.android.material.snackbar.Snackbar; import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.utils.Utils; +import androidx.annotation.StringRes; + public class SnackbarMaker { public static Snackbar make(Activity activity, CharSequence text, int duration) { diff --git a/app/src/main/java/com/topjohnwu/magisk/uicomponents/UpdateCardHolder.java b/app/src/main/java/com/topjohnwu/magisk/view/UpdateCardHolder.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/uicomponents/UpdateCardHolder.java rename to app/src/main/java/com/topjohnwu/magisk/view/UpdateCardHolder.java index 03486deee..3e657e458 100644 --- a/app/src/main/java/com/topjohnwu/magisk/uicomponents/UpdateCardHolder.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/UpdateCardHolder.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.uicomponents; +package com.topjohnwu.magisk.view; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/CustomAlertDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/CustomAlertDialog.java similarity index 99% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/CustomAlertDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/CustomAlertDialog.java index e45ea5cdd..4c6919a33 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/CustomAlertDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/CustomAlertDialog.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.app.Activity; import android.content.DialogInterface; @@ -8,14 +8,13 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; +import com.topjohnwu.magisk.R; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; import androidx.annotation.StyleRes; import androidx.appcompat.app.AlertDialog; - -import com.topjohnwu.magisk.R; - import butterknife.BindView; public class CustomAlertDialog extends AlertDialog.Builder { diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/EnvFixDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/EnvFixDialog.java similarity index 97% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/EnvFixDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/EnvFixDialog.java index 9c7328bba..95e1364b6 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/EnvFixDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/EnvFixDialog.java @@ -1,11 +1,9 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.app.Activity; import android.app.ProgressDialog; import android.widget.Toast; -import androidx.annotation.NonNull; - import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.tasks.MagiskInstaller; import com.topjohnwu.magisk.utils.RootUtils; @@ -14,6 +12,8 @@ import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.internal.UiThreadHandler; import com.topjohnwu.superuser.io.SuFile; +import androidx.annotation.NonNull; + public class EnvFixDialog extends CustomAlertDialog { public EnvFixDialog(@NonNull Activity activity) { diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/FingerprintAuthDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/FingerprintAuthDialog.java similarity index 98% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/FingerprintAuthDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/FingerprintAuthDialog.java index 725e1f54d..d9f7642e2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/FingerprintAuthDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/FingerprintAuthDialog.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.annotation.TargetApi; import android.app.Activity; @@ -11,13 +11,13 @@ import android.os.Build; import android.view.Gravity; import android.widget.Toast; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; - import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.utils.FingerprintHelper; import com.topjohnwu.magisk.utils.Utils; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; + @TargetApi(Build.VERSION_CODES.M) public class FingerprintAuthDialog extends CustomAlertDialog { diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/InstallMethodDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/InstallMethodDialog.java similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/InstallMethodDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/InstallMethodDialog.java index 83c3acf7b..6b2970c1f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/InstallMethodDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/InstallMethodDialog.java @@ -1,26 +1,26 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.app.Activity; import android.content.Intent; import android.widget.Toast; -import androidx.appcompat.app.AlertDialog; - import com.google.android.material.snackbar.Snackbar; import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.FlashActivity; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.uicomponents.ProgressNotification; -import com.topjohnwu.magisk.uicomponents.SnackbarMaker; +import com.topjohnwu.magisk.ui.base.BaseActivity; +import com.topjohnwu.magisk.ui.flash.FlashActivity; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.ProgressNotification; +import com.topjohnwu.magisk.view.SnackbarMaker; import com.topjohnwu.net.Networking; import java.io.File; import java.util.List; +import androidx.appcompat.app.AlertDialog; + class InstallMethodDialog extends AlertDialog.Builder { InstallMethodDialog(BaseActivity activity, List options) { diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/MagiskInstallDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/MagiskInstallDialog.java similarity index 92% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/MagiskInstallDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/MagiskInstallDialog.java index 681aab0d3..64426c656 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/MagiskInstallDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/MagiskInstallDialog.java @@ -1,13 +1,13 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.net.Uri; import android.text.TextUtils; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.components.BaseActivity; -import com.topjohnwu.magisk.uicomponents.MarkDownWindow; +import com.topjohnwu.magisk.ui.base.BaseActivity; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.MarkDownWindow; import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.ShellUtils; diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/ManagerInstallDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/ManagerInstallDialog.java similarity index 91% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/ManagerInstallDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/ManagerInstallDialog.java index d13d5372f..debb76719 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/ManagerInstallDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/ManagerInstallDialog.java @@ -1,15 +1,15 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.app.Activity; import android.text.TextUtils; -import androidx.annotation.NonNull; - import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.uicomponents.MarkDownWindow; import com.topjohnwu.magisk.utils.DownloadApp; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.MarkDownWindow; + +import androidx.annotation.NonNull; public class ManagerInstallDialog extends CustomAlertDialog { diff --git a/app/src/main/java/com/topjohnwu/magisk/dialogs/UninstallDialog.java b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/UninstallDialog.java similarity index 93% rename from app/src/main/java/com/topjohnwu/magisk/dialogs/UninstallDialog.java rename to app/src/main/java/com/topjohnwu/magisk/view/dialogs/UninstallDialog.java index 8460e314f..4fae38407 100644 --- a/app/src/main/java/com/topjohnwu/magisk/dialogs/UninstallDialog.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/dialogs/UninstallDialog.java @@ -1,4 +1,4 @@ -package com.topjohnwu.magisk.dialogs; +package com.topjohnwu.magisk.view.dialogs; import android.app.Activity; import android.app.ProgressDialog; @@ -7,20 +7,20 @@ import android.net.Uri; import android.text.TextUtils; import android.widget.Toast; -import androidx.annotation.NonNull; - import com.topjohnwu.magisk.ClassMap; import com.topjohnwu.magisk.Config; import com.topjohnwu.magisk.Const; -import com.topjohnwu.magisk.FlashActivity; import com.topjohnwu.magisk.R; -import com.topjohnwu.magisk.uicomponents.ProgressNotification; +import com.topjohnwu.magisk.ui.flash.FlashActivity; import com.topjohnwu.magisk.utils.Utils; +import com.topjohnwu.magisk.view.ProgressNotification; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; import java.io.File; +import androidx.annotation.NonNull; + public class UninstallDialog extends CustomAlertDialog { public UninstallDialog(@NonNull Activity activity) {