2017-03-24 23:03:00 +01:00
ANDROID_JAR = ../android-14_.jar
2015-07-26 18:26:07 +02:00
AAPT = ./../aapt
DX = ./../dx
APKBUILDER = ./../apkbuilder
mkdir gen
2016-08-11 22:18:08 +02:00
mkdir -p bin/classes
JAVAC = $JAVA_HOME /bin/javac
if [ -z " $JAVA_HOME " ] ; then
export JAVAC = $( which javac)
fi
: ${ OUTPUT : = $1 }
: ${ OUTPUT : =bin/xash3d-signed.apk }
2015-08-20 07:28:00 +02:00
sh gen-version.sh test build
2016-09-10 22:25:17 +02:00
sh gen-config.sh test
2015-12-20 12:39:19 +01:00
rm assets/extras.pak
2015-12-20 12:19:32 +01:00
python2.7 makepak.py xash-extras assets/extras.pak
2015-07-26 18:26:07 +02:00
$AAPT package -m -J gen/ --rename-manifest-package in.celest.xash3d.hl -M AndroidManifest.xml -S test/res -I $ANDROID_JAR
2016-08-12 23:40:08 +02:00
echo "package in.celest.xash3d.hl;public final class BuildConfig {public final static boolean DEBUG = true;}" > gen/in/celest/xash3d/hl/BuildConfig.java
$JAVAC -d bin/classes -s bin/classes -cp $ANDROID_JAR gen/in/celest/xash3d/hl/* src/in/celest/xash3d/*.java
2015-12-20 11:39:56 +01:00
$DX --dex --output= bin/classes.dex bin/classes/
2016-08-11 22:18:08 +02:00
$AAPT package -f -M test/AndroidManifest.xml -S test/res -I $ANDROID_JAR -F bin/xash3d.apk.unaligned
2015-07-26 18:26:07 +02:00
zip bin/xash3d.apk.unaligned assets/*
$APKBUILDER bin/xash3d.apk -u -nf libs/ -rj libs -f bin/classes.dex -z bin/xash3d.apk.unaligned
2016-08-11 22:18:08 +02:00
java -jar /mnt/app/apktool/signapk.jar /mnt/app/apktool/testkey.x509.pem /mnt/app/apktool/testkey.pk8 bin/xash3d.apk $OUTPUT