From f19cee8f307b05d6fcb7b0950c73cad2b326dc54 Mon Sep 17 00:00:00 2001 From: Luna712 <142361265+Luna712@users.noreply.github.com> Date: Mon, 13 Apr 2026 20:18:10 -0600 Subject: [PATCH] Always use `exitProcess()` to exit the app Even on phones, when the app enters safe mode and the user clicks the back button to exit, it does not exit safe mode upon restarting if the "confirm exit" setting is enabled and they exit from the dialog. Always using `exitProcess()` fixes this. --- .../main/java/com/lagradost/cloudstream3/MainActivity.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 071ce6c897b..c43e5950f2b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -674,9 +674,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa val confirmBeforeExit = settingsManager.getInt(getString(R.string.confirm_exit_key), -1) if (confirmBeforeExit == 1 || (confirmBeforeExit == -1 && isLayout(PHONE))) { - // finish() causes a bug on some TVs where player - // may keep playing after closing the app. - if (isLayout(TV)) exitProcess(0) else finish() + exitProcess(0) return } @@ -692,9 +690,8 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa putInt(getString(R.string.confirm_exit_key), 1) } } - // finish() causes a bug on some TVs where player - // may keep playing after closing the app. - if (isLayout(TV)) exitProcess(0) else finish() + + exitProcess(0) } builder.show().setDefaultFocus()