From e0dbaec45cc1ea938b62b7928418b96b1a741f44 Mon Sep 17 00:00:00 2001 From: BryanGIG Date: Tue, 9 Jan 2024 16:50:24 +0700 Subject: [PATCH] Update: Check if shell already created --- .../main/java/com/dumper/android/core/MainActivity.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/com/dumper/android/core/MainActivity.kt b/app/src/main/java/com/dumper/android/core/MainActivity.kt index 264132c..d0355ed 100644 --- a/app/src/main/java/com/dumper/android/core/MainActivity.kt +++ b/app/src/main/java/com/dumper/android/core/MainActivity.kt @@ -64,6 +64,8 @@ class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + checkShell() + setContent { PADumperTheme { MainScreen(memory, console) @@ -80,6 +82,15 @@ class MainActivity : ComponentActivity() { } } + private fun checkShell() { + if (Shell.getCachedShell() == null) { + Intent(this, SplashActivity::class.java).also { + startActivity(it) + finish() + } + } + } + fun sendRequestAllProcess() { if (intent.getBooleanExtra("IS_ROOT", false)) { val message = Message.obtain(null, MSG_GET_PROCESS_LIST)