From c1ac9c4be42eb0c7c1466edc7695a84b5dabccfb Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Aug 2022 15:00:44 +0300 Subject: [PATCH] Read version of cmdline-tools/latest, if version is correct - use it --- dist/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/index.js b/dist/index.js index 6eec7bc..4f212e0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8589,6 +8589,12 @@ function findPreinstalledSdkManager() { result.exePath = getSdkManagerPath('latest'); result.isFound = fs.existsSync(result.exePath); if (result.isFound) { + const propertiesFile = path.join(ANDROID_SDK_ROOT, 'cmdline-tools', 'latest', 'source.properties'); + if (fs.existsSync(propertiesFile)) { + const correctRevisionString = `Pkg.Revision=${CMDLINE_TOOLS_VERSION}`; + console.log(correctRevisionString); + result.isCorrectVersion = fs.readFileSync(propertiesFile, 'utf8').includes(correctRevisionString); + } return result; } result.exePath = '';