fix(android): remove quotes from ANDROID_HOME path in build-apk.bat

When ANDROID_HOME environment variable contains quotes (e.g., set with
quotes in system settings), the generated local.properties file would
have an invalid path like 'sdk.dir=C:/Android"'.

This fix strips any surrounding quotes from ANDROID_HOME before using
it to create local.properties, ensuring valid SDK path format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-31 23:43:51 -08:00
parent c5f52190ef
commit 8541c83bf5
1 changed files with 6 additions and 3 deletions

View File

@ -23,9 +23,12 @@ if not exist "local.properties" (
:: Check ANDROID_HOME environment variable first
if defined ANDROID_HOME (
if exist "!ANDROID_HOME!\platform-tools" (
echo sdk.dir=!ANDROID_HOME:\=/!> local.properties
echo [INFO] Created local.properties with ANDROID_HOME: !ANDROID_HOME!
:: Remove any surrounding quotes from ANDROID_HOME
set "ANDROID_HOME_CLEAN=!ANDROID_HOME:"=!"
if exist "!ANDROID_HOME_CLEAN!\platform-tools" (
set "SDK_PATH_CLEAN=!ANDROID_HOME_CLEAN:\=/!"
echo sdk.dir=!SDK_PATH_CLEAN!> local.properties
echo [INFO] Created local.properties with ANDROID_HOME: !ANDROID_HOME_CLEAN!
set SDK_FOUND=1
)
)