From a45b671961d522497ca82bcfb36a7cebed0ac21e Mon Sep 17 00:00:00 2001 From: AndnixSH <40742924+AndnixSH@users.noreply.github.com> Date: Mon, 8 May 2023 10:39:47 +0200 Subject: [PATCH] Fixed attempting to install APK even it's disabled --- APKToolGUI/Forms/FormMain.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/APKToolGUI/Forms/FormMain.cs b/APKToolGUI/Forms/FormMain.cs index 5fee1f0..df85fab 100644 --- a/APKToolGUI/Forms/FormMain.cs +++ b/APKToolGUI/Forms/FormMain.cs @@ -1001,18 +1001,21 @@ await Task.Factory.StartNew(() => } string device = selAdbDeviceLbl.Text; - if (!String.IsNullOrEmpty(device) && Settings.Default.Sign_InstallApkAfterSign) + if (Settings.Default.Sign_InstallApkAfterSign) { - ToStatus(Language.InstallingApk, Resources.waiting); - ToLog(ApktoolEventType.Infomation, "=====[ " + Language.InstallingApk + " ]====="); + if (!String.IsNullOrEmpty(device)) + { + ToStatus(Language.InstallingApk, Resources.waiting); + ToLog(ApktoolEventType.Infomation, "=====[ " + Language.InstallingApk + " ]====="); - if (adb.Install(device, outputFile) == 0) - ToLog(ApktoolEventType.None, Language.InstallApkSuccessful); + if (adb.Install(device, outputFile) == 0) + ToLog(ApktoolEventType.None, Language.InstallApkSuccessful); + else + ToLog(ApktoolEventType.Error, Language.InstallApkFailed); + } else - ToLog(ApktoolEventType.Error, Language.InstallApkFailed); ; + ToLog(ApktoolEventType.Error, String.Format(Language.DeviceNotSelected, outputFile)); } - else - ToLog(ApktoolEventType.Error, String.Format(Language.DeviceNotSelected, outputFile)); } else ToLog(ApktoolEventType.Error, Language.ErrorSigning);