From 366225f9bee25941c368080d90e9d72ab9f0c780 Mon Sep 17 00:00:00 2001 From: Jan S Date: Fri, 12 Jul 2024 19:39:17 +0200 Subject: [PATCH] fix(quark): fix automated installation and check exit code of executed external commands (#2119)(PR #2216) --- .../src/main/java/jadx/gui/plugins/quark/QuarkManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jadx-gui/src/main/java/jadx/gui/plugins/quark/QuarkManager.java b/jadx-gui/src/main/java/jadx/gui/plugins/quark/QuarkManager.java index 59f534fcbaf..6b864dd9311 100644 --- a/jadx-gui/src/main/java/jadx/gui/plugins/quark/QuarkManager.java +++ b/jadx-gui/src/main/java/jadx/gui/plugins/quark/QuarkManager.java @@ -151,6 +151,7 @@ private void installQuark() { List cmd = new ArrayList<>(); cmd.add(getCommand("pip3")); cmd.add("install"); + cmd.add("setuptools"); cmd.add("quark-engine"); cmd.add("--upgrade"); try { @@ -213,6 +214,10 @@ private void runCommand(List cmd) throws Exception { } finally { process.waitFor(); } + if (process.exitValue() != 0) { + throw new RuntimeException("Execution failed (exit code " + process.exitValue() + ") - command " + + String.join(" ", cmd) + "\nPlease see command log output what was going wrong."); + } } private boolean checkCommand(String... cmd) {