Fix handling of non-integer ANDROID_PLATFORM

ANDROID_PLATFORM is not always an integer; it can also be a value like
"36.1". Handle such cases properly.

This fixes the following error:

    server/build_without_gradle.sh: line 89:
    [[: 36.1: syntax error: invalid arithmetic operator (error token is ".1")

PR #6408 <https://github.com/Genymobile/scrcpy/pull/6408>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
Yan
2025-10-05 22:53:22 +02:00
committed by Romain Vimont
parent eee3f24739
commit f3d4fde15b

View File

@@ -86,7 +86,7 @@ javac -encoding UTF-8 -bootclasspath "$ANDROID_JAR" \
echo "Dexing..." echo "Dexing..."
cd "$CLASSES_DIR" cd "$CLASSES_DIR"
if [[ $PLATFORM -lt 31 ]] if [[ "${PLATFORM%%.*}" -lt 31 ]]
then then
# use dx # use dx
"$BUILD_TOOLS_DIR/dx" --dex --output "$BUILD_DIR/classes.dex" \ "$BUILD_TOOLS_DIR/dx" --dex --output "$BUILD_DIR/classes.dex" \