diff --git a/dist/index.js b/dist/index.js index 4f212e0..677f9c0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8591,9 +8591,9 @@ function findPreinstalledSdkManager() { 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); + result.isCorrectVersion = fs + .readFileSync(propertiesFile, 'utf8') + .includes(`Pkg.Revision=${CMDLINE_TOOLS_VERSION}`); } return result; } diff --git a/src/main.ts b/src/main.ts index 14d5dbb..e8f0f6b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,6 +48,17 @@ 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)) { + result.isCorrectVersion = fs + .readFileSync(propertiesFile, 'utf8') + .includes(`Pkg.Revision=${CMDLINE_TOOLS_VERSION}`) + } return result } result.exePath = ''