From 78f5220882178a3d827d864e20241318675123d9 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:12:15 -0700 Subject: [PATCH] fix(PatchingModel): properly launch installation --- .../ui/screens/patching/PatchingScreenModel.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/aliucord/manager/ui/screens/patching/PatchingScreenModel.kt b/app/src/main/kotlin/com/aliucord/manager/ui/screens/patching/PatchingScreenModel.kt index 1e742a6..fe37b5d 100644 --- a/app/src/main/kotlin/com/aliucord/manager/ui/screens/patching/PatchingScreenModel.kt +++ b/app/src/main/kotlin/com/aliucord/manager/ui/screens/patching/PatchingScreenModel.kt @@ -64,9 +64,14 @@ class PatchingScreenModel( if (state.value !is PatchingScreenState.Success) return - Intent(options.packageName) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - .also(application::startActivity) + val launchIntent = application.packageManager + .getLaunchIntentForPackage(options.packageName) + + if (launchIntent != null) { + application.startActivity(launchIntent) + } else { + application.showToast(R.string.launch_aliucord_fail) + } } fun copyDebugToClipboard() {