Fix script to build without gradle

The PLATFORM variable is assigned either from $ANDROID_PLATFORM or gets
a default value (currently $PLATFORM_VERSION).

The check to use either dx (SDK < 31) or d8 (SDK >= 31) must be based on
the actual $PLATFORM, not the default $PLATFORM_VERSION.

Refs 52138fd921
Refs <57d30780dd/debian/patches/0002-Workaround-broken-script.patch>

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

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
yangfl 2021-12-02 20:49:35 +01:00 committed by Romain Vimont
parent 64a04b8d4a
commit ab00210b37

View file

@ -57,7 +57,7 @@ javac -bootclasspath "$ANDROID_JAR" -cp "$CLASSES_DIR" -d "$CLASSES_DIR" \
echo "Dexing..."
cd "$CLASSES_DIR"
if [[ $PLATFORM_VERSION -lt 31 ]]
if [[ $PLATFORM -lt 31 ]]
then
# use dx
"$ANDROID_HOME/build-tools/$BUILD_TOOLS/dx" --dex \