Skip to content

Commit

Permalink
add shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
reyuki committed Feb 17, 2024
1 parent 5044dc8 commit e30ae75
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Cek apakah jumlah parameter kurang dari 1
if [ $# -lt 1 ]; then
echo "Menu:"
echo "- build"
echo "- clean"
exit 1
fi

# Cek nilai parameter pertama
case $1 in
build)
echo "Building..."
SDK="$HOME/Android/Sdk/platforms/android-34/android.jar"
aapt2 link --manifest AndroidManifest.xml -I $SDK -o samplebuild.apk
javac -classpath $SDK -source 17 -target 17 src/dom/domain/*.java
d8 src/dom/domain/SayingHello.class --lib $SDK
zip -uj samplebuild.apk classes.dex
zipalign -p -f -v 4 samplebuild.apk aligned.apk
apksigner sign --ks debug.keystore --ks-pass pass:android --out hello.apk aligned.apk
;;
clean)
echo "Cleaning up..."
rm -fv *.apk src/dom/domain/*.class classes.dex
;;
*)
echo "Invalid parameter"
;;
esac

0 comments on commit e30ae75

Please sign in to comment.