From b7d5a8c69b2fa3ddbf637915a9d9b9eb76e1d2fa Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 2 Apr 2016 20:26:17 +0000 Subject: [PATCH] Android project for gravgun mod --- android/AndroidManifest.xml | 20 ++++ android/build-manual.sh | 13 +++ android/build.sh | 6 ++ android/build.xml | 92 ++++++++++++++++++ android/jni/Android.mk | 6 ++ android/jni/Application.mk | 11 +++ android/jni/mod_config.mk | 14 +++ android/jni/server | 1 + android/project.properties | 11 +++ android/res/drawable/gravgun.png | Bin 0 -> 4402 bytes .../in/celest/xash3d/LauncherActivity.java | 73 ++++++++++++++ 11 files changed, 247 insertions(+) create mode 100644 android/AndroidManifest.xml create mode 100644 android/build-manual.sh create mode 100755 android/build.sh create mode 100644 android/build.xml create mode 100644 android/jni/Android.mk create mode 100644 android/jni/Application.mk create mode 100644 android/jni/mod_config.mk create mode 120000 android/jni/server create mode 100644 android/project.properties create mode 100644 android/res/drawable/gravgun.png create mode 100644 android/src/in/celest/xash3d/LauncherActivity.java diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml new file mode 100644 index 00000000..7b9dc7cf --- /dev/null +++ b/android/AndroidManifest.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/android/build-manual.sh b/android/build-manual.sh new file mode 100644 index 00000000..34b828b2 --- /dev/null +++ b/android/build-manual.sh @@ -0,0 +1,13 @@ +ANDROID_JAR=../android-13.jar +AAPT=./../aapt +DX=./../dx +APKBUILDER=./../apkbuilder +NAME=mod +mkdir bin +mkdir bin/classes +$AAPT package -M AndroidManifest.xml -m -S res -I $ANDROID_JAR +$JAVA_HOME/bin/javac -d bin/classes -s bin/classes -cp $ANDROID_JAR src/in/celest/xash3d/LauncherActivity.java +$DX --dex --output=bin/classes.dex bin/classes/ +$AAPT package -f -M AndroidManifest.xml -S res -I $ANDROID_JAR -F bin/$NAME.apk.unaligned +$APKBUILDER bin/$NAME.apk -u -nf libs/ -rj libs -f bin/classes.dex -z bin/$NAME.apk.unaligned +#java -jar /mnt/app/apktool/signapk.jar /mnt/app/apktool/testkey.x509.pem /mnt/app/apktool/testkey.pk8 bin/$NAME.apk bin/$NAME-signed.apk diff --git a/android/build.sh b/android/build.sh new file mode 100755 index 00000000..28b24e57 --- /dev/null +++ b/android/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +ndk-build NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1 V=1 -j5 APP_CFLAGS="-w" +ant debug +#jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../myks.keystore bin/mod-unsigned.apk xashdroid -tsa https://timestamp.geotrust.com/tsa +#zipalign 4 bin/cs16-client-unsigned.apk bin/mod.apk diff --git a/android/build.xml b/android/build.xml new file mode 100644 index 00000000..88f6fb88 --- /dev/null +++ b/android/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/jni/Android.mk b/android/jni/Android.mk new file mode 100644 index 00000000..79964494 --- /dev/null +++ b/android/jni/Android.mk @@ -0,0 +1,6 @@ +override TARGET_arm_release_CFLAGS := +override TARGET_thumb_release_CFLAGS := +override TARGET_arm_debug_CFLAGS := +override TARGET_thumb_debug_CFLAGS := +override TARGET_CFLAGS := +include $(call all-subdir-makefiles) diff --git a/android/jni/Application.mk b/android/jni/Application.mk new file mode 100644 index 00000000..7322d629 --- /dev/null +++ b/android/jni/Application.mk @@ -0,0 +1,11 @@ +CFLAGS_OPT := -O3 -fomit-frame-pointer -ggdb -funsafe-math-optimizations -ftree-vectorize -fgraphite-identity -floop-interchange -floop-block -funsafe-loop-optimizations -finline-limit=1024 +CFLAGS_OPT_ARM := -mthumb -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -DVECTORIZE_SINCOS +CFLAGS_OPT_ARMv5 :=-march=armv6 -mfpu=vfp -marm -pipe +CFLAGS_OPT_X86 := -mtune=atom -march=atom -mssse3 -mfpmath=sse -funroll-loops -pipe -DVECTORIZE_SINCOS +CFLAGS_HARDFP := -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -mfloat-abi=hard -DLOAD_HARDFP -DSOFTFP_LINK +APPLICATIONMK_PATH = $(call my-dir) + +XASH3D_CONFIG := $(APPLICATIONMK_PATH)/mod_config.mk + +APP_ABI := x86 armeabi-v7a-hard armeabi +APP_MODULES := server diff --git a/android/jni/mod_config.mk b/android/jni/mod_config.mk new file mode 100644 index 00000000..5c0dc6bf --- /dev/null +++ b/android/jni/mod_config.mk @@ -0,0 +1,14 @@ +LOCAL_CFLAGS += $(CFLAGS_OPT) +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) +LOCAL_CFLAGS += $(CFLAGS_OPT_ARM) $(CFLAGS_HARDFP) +endif +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) +LOCAL_CFLAGS += $(CFLAGS_OPT_ARM) -mfloat-abi=softfp +endif +ifeq ($(TARGET_ARCH_ABI),armeabi) +LOCAL_CFLAGS += $(CFLAGS_OPT_ARMv5) +endif +ifeq ($(TARGET_ARCH_ABI),x86) +LOCAL_CFLAGS += $(CFLAGS_OPT_X86) +endif + diff --git a/android/jni/server b/android/jni/server new file mode 120000 index 00000000..e8dd6263 --- /dev/null +++ b/android/jni/server @@ -0,0 +1 @@ +../../dlls \ No newline at end of file diff --git a/android/project.properties b/android/project.properties new file mode 100644 index 00000000..4513a1e4 --- /dev/null +++ b/android/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-3 diff --git a/android/res/drawable/gravgun.png b/android/res/drawable/gravgun.png new file mode 100644 index 0000000000000000000000000000000000000000..184e83e9fa921a5db7714d4f3ea9d0337729b3c5 GIT binary patch literal 4402 zcmV-25zX$2P)$Oa0@q@|gp z(jH+~MAoIQpzCoLMb9o&k7wa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