summaryrefslogtreecommitdiffstats
path: root/android/buildapk.sh
blob: 340438721ae8a597199ae10c3db2f34b2c2a575f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

BUILDDIR=$1
APK=$2
SDKV=$3

[ -z $ANDROID_SDK_PATH ] && exit 1
[ -z $BUILDDIR ] && exit 1
[ -d $BUILDDIR ] || exit 1

# need to cd into the bin dir and create a symlink to the libraries
# so that aapt puts the libraries with the correct prefix into the apk
cd $BUILDDIR/bin
ln -nfs $BUILDDIR/libs lib
cp resources.ap_ $APK
$ANDROID_SDK_PATH/build-tools/$SDKV/aapt add $APK classes.dex > /dev/null
$ANDROID_SDK_PATH/build-tools/$SDKV/aapt add $APK lib/*/* > /dev/null

exit 0