-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·54 lines (46 loc) · 1.86 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
if ! [ -e bin ]; then
mkdir bin
chmod a+w+r+x bin
fi
. ./setenv.sh
./clear.sh
$HRB_BIN/harbour src/main.prg -q -i$HRB_INC -i$HDROIDGUI/src/include -i$HRB_INC -ojni/
if [ "$?" -eq 0 ]
then
export NDK_LIBS_OUT=lib
export SRC_FILES=main.c
$NDK_HOME/prebuilt/linux-x86_64/bin/make -f $NDK_HOME/build/core/build-local.mk "$@" >a1.out 2>a2.out
if [ "$?" -eq 0 ]
then
echo "compile java sources"
$BUILD_TOOLS/aapt package -f -m -S res -J src -M AndroidManifest.xml -I $ANDROID_JAR
javac -d obj -cp $ANDROID_JAR:$HDROIDGUI/hdroidgui.jar -sourcepath src src/$PACKAGE_PATH/*.java
if [ "$?" -eq 0 ]
then
echo "convert to .dex"
$BUILD_TOOLS/dx --dex --output=bin/classes.dex obj $HDROIDGUI/libs
if [ "$?" -eq 0 ]
then
$BUILD_TOOLS/aapt package -f -M AndroidManifest.xml -S res -I $ANDROID_JAR -F bin/$APPNAME.unsigned.apk bin
$BUILD_TOOLS/aapt add $DEV_HOME/bin/$APPNAME.unsigned.apk lib/$NDK_TARGET/libharbour.so
if [ "$?" -eq 0 ]
then
$BUILD_TOOLS/aapt add $DEV_HOME/bin/$APPNAME.unsigned.apk lib/$NDK_TARGET/libh4droid.so
$BUILD_TOOLS/aapt add bin/$APPNAME.unsigned.apk assets/main.hrb
echo "sign APK"
keytool -genkey -v -keystore myrelease.keystore -alias key2 -keyalg RSA -keysize 2048 -validity 10000 -storepass passdbf -keypass passdbf -dname "CN=Alex K, O=Harbour, C=RU"
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore myrelease.keystore -storepass passdbf -keypass passdbf -signedjar bin/$APPNAME.signed.apk bin/$APPNAME.unsigned.apk key2
$BUILD_TOOLS/zipalign -v 4 bin/$APPNAME.signed.apk bin/$APPNAME.apk
fi
else
echo "error creating dex file"
fi
else
echo "java sources compiling error"
fi
else
echo "C sources compiling error"
fi
fi
read -n1 -r -p "Press any key to continue..."