From aca86e33448b21ff1923c7ea05801da5a56b15ed Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Wed, 1 May 2024 23:03:09 +0200 Subject: [PATCH] Add and use `$SOURCE_FOLDER` and `$APP_NAME` --- datasets/android/compile.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/datasets/android/compile.sh b/datasets/android/compile.sh index 16ca773..2316939 100755 --- a/datasets/android/compile.sh +++ b/datasets/android/compile.sh @@ -2,24 +2,28 @@ SDK_FOLDER=/usr/lib/android-sdk PLATFORM=$SDK_FOLDER/platforms/android-33 BUILD_TOOLS=$SDK_FOLDER/build-tools/30.0.3 +SOURCE_FOLDER=net/hanshq/hello +APP_NAME=Hello + mkdir -p build/gen build/apk "$BUILD_TOOLS/aapt" package -f -m -J build/gen/ -S res \ -M AndroidManifest.xml -I "$PLATFORM/android.jar" + javac --release 11 -classpath "$PLATFORM/android.jar" -d build/obj \ - build/gen/net/hanshq/hello/R.java java/net/hanshq/hello/MainActivity.java + build/gen/$SOURCE_FOLDER/R.java java/$SOURCE_FOLDER/MainActivity.java "$BUILD_TOOLS/d8" --release --lib "$PLATFORM/android.jar" \ - --output build/apk/ build/obj/net/hanshq/hello/*.class + --output build/apk/ build/obj/$SOURCE_FOLDER/*.class "$BUILD_TOOLS/aapt" package -f -M AndroidManifest.xml -S res/ \ -I "$PLATFORM/android.jar" \ - -F build/Hello.unsigned.apk build/apk/ + -F build/$APP_NAME.unsigned.apk build/apk/ "$BUILD_TOOLS/zipalign" -f -p 4 \ - build/Hello.unsigned.apk build/Hello.aligned.apk + build/$APP_NAME.unsigned.apk build/$APP_NAME.aligned.apk "$BUILD_TOOLS/apksigner" sign --ks keystore.jks \ --ks-key-alias androidkey --ks-pass pass:android \ - --key-pass pass:android --out build/Hello.apk \ - build/Hello.aligned.apk + --key-pass pass:android --out build/$APP_NAME.apk \ + build/$APP_NAME.aligned.apk