From 076af7e86b029c51aed9e73a7e88dddd9e7d88d3 Mon Sep 17 00:00:00 2001 From: omgupta-iitk Date: Fri, 5 Jul 2024 10:12:07 +0530 Subject: [PATCH] fixed-critical --- .../src/processing/mode/android/AndroidSDK.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/processing/mode/src/processing/mode/android/AndroidSDK.java b/processing/mode/src/processing/mode/android/AndroidSDK.java index 155922e3..36e7423a 100644 --- a/processing/mode/src/processing/mode/android/AndroidSDK.java +++ b/processing/mode/src/processing/mode/android/AndroidSDK.java @@ -405,10 +405,19 @@ static public File getGoogleDriverFolder() { */ private static File findCliTool(final File toolDir, String toolName) throws BadSDKException { - File toolFile = Platform.isWindows() ? new File(toolDir, toolName + ".exe") : new File(toolDir, toolName); - if (!toolFile.exists()) { - throw new BadSDKException("Cannot find " + toolName + " in " + toolDir); - } + File toolFile; + if (Platform.isWindows()) { + toolFile = new File(toolDir, toolName + ".exe"); + if (!toolFile.exists()) { + toolFile = new File(toolDir, toolName + ".bat"); + } + } else { + toolFile = new File(toolDir, toolName); + } + + if (!toolFile.exists()) { + throw new BadSDKException("Cannot find " + toolName + " in " + toolDir); + } if (!Platform.isWindows()) { try {