From 826c804d2273d74513fc8e6dc6ae10ae4a296c4d Mon Sep 17 00:00:00 2001 From: Jan Peter Stotz Date: Fri, 12 Jul 2024 18:11:55 +0200 Subject: [PATCH] Quark: fix automated installation and check exit code of executed external commands --- .../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) {