Skip to content

Commit

Permalink
Update: Check if shell already created
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanGIG committed Jan 9, 2024
1 parent 064a426 commit e0dbaec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/main/java/com/dumper/android/core/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
checkShell()

setContent {
PADumperTheme {
MainScreen(memory, console)
Expand All @@ -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)
Expand Down

0 comments on commit e0dbaec

Please sign in to comment.