From 5383238f197ce511976dbfa7c4da4b954a23afb1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Date: Sun, 4 Nov 2018 20:43:09 +0000 Subject: [PATCH] add new mod-sample --- android/AndroidManifest.xml | 22 ++ android/assets/.gitkeep | 0 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/ic_launcher.png | Bin 0 -> 13470 bytes .../in/celest/xash3d/LauncherActivity.java | 234 ++++++++++++++++++ 12 files changed, 410 insertions(+) create mode 100755 android/AndroidManifest.xml create mode 100644 android/assets/.gitkeep create mode 100755 android/build-manual.sh create mode 100755 android/build.sh create mode 100755 android/build.xml create mode 100755 android/jni/Android.mk create mode 100755 android/jni/Application.mk create mode 100755 android/jni/mod_config.mk create mode 120000 android/jni/server create mode 100755 android/project.properties create mode 100644 android/res/drawable/ic_launcher.png create mode 100755 android/src/in/celest/xash3d/LauncherActivity.java diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml new file mode 100755 index 00000000..300f8c9a --- /dev/null +++ b/android/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/android/assets/.gitkeep b/android/assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/android/build-manual.sh b/android/build-manual.sh new file mode 100755 index 00000000..2c05b65a --- /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/ +/mnt/app/apktool/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..75aad3db --- /dev/null +++ b/android/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh +TMPDIR=/home/build/tmp +python makepak.py pak/ assets/extras.pak +ndk-build -j2 $1 && ant debug + +#ndk-build -j2 APP_ABI="armeabi-v7a-hard" && ant debug diff --git a/android/build.xml b/android/build.xml new file mode 100755 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 100755 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 100755 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 100755 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..48ddb50b --- /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 100755 index 00000000..f6166bdd --- /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-21 diff --git a/android/res/drawable/ic_launcher.png b/android/res/drawable/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..c74e99b39573335eb77f7542f3d45fb702b569cf GIT binary patch literal 13470 zcmV;PG-1n$P)6kTSRq6MUFg?*OeYC zJhzonT}r7orPKkX)FGwRex=loAPBbRa=9aK2HnKzeld|qOp;Pw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5vTath8YTlY5Mx$VHH#7kAFw6oT-HSF zr&oiT0Y^5&)|J>hkB~iXaI81MURUFQFF58Xyo6xo>nC{aK<5yV=}Fz)ulwtiITJD* zIq8R9MlswMLf|@XDL1cadIbK}OP}e6fu>13FSG#)g<*v1DTvCR>8dI~(A(RC>$;@V z)fk43lp48Qj@sJVa9C_1Pa>YciR?j7Pc}l17$g#L;_-0QzT-H1`}%sX?&`{n{3p%J zwu!*Qz)}HBk}0O8Q!I~}e84xE{)Gm-Aj7erXE@j!V|yUk?)mI@e2&{b9hOZ87Tq|* z6gWZ^q9U@F6JE-qhZB^1>SFY%>l&Wtm$ey*GFw3C4k9p3qojsnF|(x7T-U+2YFk#Ay6P+SUG#ntQ(&D z%Zj$a2&@gmfF9u2k&anXP#(h9=#>IL5Ts;4-?#)1tqXX()8RGWW2fbC$g()%`HA*v26!U*Ql+n#kOn`iFjBK zDAhUwJkML1%jfUt?&^MFBt+Fl!GL|heLiYqPPsLmo-^ra-qUk|PPgN;FVo9$Cx}7DK#9|!O9n+%2#N6>Kp2jLg2a{Qiij&ecvxA zcsiL%eRl8OeP6H&)`1bv6?p@rf+k5#zp$yM>b#n|{loDg* zn4&?T9>wBD(XUrZ;YGz8P1Ep$pkF&}5!{$*+6be?! z11fqMw(Xz-MLZcNnM~qFAY9LNF``H`9OLYljJD%A)Ya8t#!R}qyCb6= 21 ) + super.setTheme( 0x01030224 ); + else super.setTheme( 0x01030005 ); + + // Build layout + LinearLayout launcher = new LinearLayout(this); + launcher.setOrientation(LinearLayout.VERTICAL); + launcher.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); + + launcher.setBackgroundColor(0xFF252525); + TextView launcherTitle = new TextView(this); + LayoutParams titleparams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); + /* тут*/titleparams.setMargins(5,15,5,1);//размеры верхнего layout + LayoutParams buttonparams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); + buttonparams.setMargins(10,20,10,20);//размеры строки для ввода аргументов + launcherTitle.setLayoutParams(titleparams); + launcherTitle.setText("Crack-Life: Campaign Mode"); + launcherTitle.setGravity(1); + //launcherTitle.setTextColor(0xFF4db017); + launcherTitle.setTextAppearance(this, android.R.attr.textAppearanceMedium); + launcherTitle.setTextSize(25); + launcherTitle.setBackgroundColor(0xFF555555); + /*launcherTitle.setCompoundDrawablePadding(10); + try + { + launcherTitle.setCompoundDrawablesWithIntrinsicBounds(getApplicationContext().getPackageManager().getApplicationIcon(getPackageName()),null,null,null); + launcherTitle.setPadding(9,9,6,0); + } + catch(Exception e) + { + launcherTitle.setPadding(60,6,6,6); + }*/ + launcher.addView(launcherTitle); + LinearLayout launcherBody = new LinearLayout(this); + launcherBody.setOrientation(LinearLayout.VERTICAL); + launcherBody.setLayoutParams(titleparams); + launcherBody.setBackgroundColor(0xFF454545); + LinearLayout launcherBorder = new LinearLayout(this); + launcherBorder.setLayoutParams(titleparams); + launcherBorder.setBackgroundColor(0xFF555555); + launcherBorder.setOrientation(LinearLayout.VERTICAL); + + LinearLayout launcherBorder2 = new LinearLayout(this); + launcherBorder2.setLayoutParams(titleparams); + launcherBorder2.setOrientation(LinearLayout.VERTICAL); + launcherBorder2.setBackgroundColor(0xFF353535); + launcherBorder2.addView(launcherBody); + launcherBorder2.setPadding(10,0,10,10); + launcherBorder.addView(launcherBorder2); + launcherBorder.setPadding(10,0,10,20); + launcher.addView(launcherBorder); + + TextView titleView = new TextView(this); + titleView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + titleView.setText("Command-line arguments"); + titleView.setTextAppearance(this, android.R.attr.textAppearanceLarge); + + cmdArgs = new EditText(this); + cmdArgs.setLayoutParams(buttonparams); + cmdArgs.setSingleLine(true); + + if(sdk < 21) + { + cmdArgs.setBackgroundColor(0xFF353535); + cmdArgs.setTextColor(0xFF333333); + cmdArgs.setPadding(5,5,5,5); + } + + RelativeLayout panel = new RelativeLayout(this); + panel.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); + + Button startButton = new Button(this); + + // Set launch button title here + startButton.setText(styleButtonString("Launch " + "Campaign Mode" + "!")); + RelativeLayout.LayoutParams buttonParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); + buttonParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); + startButton.setLayoutParams(buttonParams); + if(sdk < 21) + { + startButton.getBackground().setAlpha(96); + startButton.getBackground().invalidateSelf(); + startButton.setTextColor(0xFFFFFFFF); + startButton.setTextAppearance(this, android.R.attr.textAppearanceLarge); + startButton.setTextSize(20); + } + startButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startXash(v); + } + }); + launcherBody.addView(titleView); + launcherBody.addView(cmdArgs); + + // Add other options here + + panel.addView(startButton); + launcher.addView(panel); + setContentView(launcher); + mPref = getSharedPreferences("mod", 0); + cmdArgs.setText(mPref.getString("argv","-dev 3 -log")); + + //ExtractAssets.extractPAK(this, false); + } + + private Intent prepareIntent(Intent i) + { + String argv = cmdArgs.getText().toString(); + i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + + SharedPreferences.Editor editor = mPref.edit(); + + editor.putString("argv", argv); + editor.commit(); + + // Command-line arguments + // if not passed, uses arguments from xash3d package + // Uncoment this if you are using client from other package + /* + String libserver = getFilesDir().getAbsolutePath().replace("/files","/lib/libserver_hardfp.so"); + if( !(new File(libserver).exists()) ) + libserver = getFilesDir().getAbsolutePath().replace("/files","/lib/libserver.so"); + argv = "-dll "+ libserver + " " + argv; + */ + if(argv.length() != 0) + i.putExtra("argv", argv); + + // default gamedir + // may be overriden by -game command-line option + // Uncomment to set gamedir here + i.putExtra("gamedir", "clcampaign"); + + // default library package + // if you are using client from other package (not from half-life), + // replace following line by: + /*i.putExtra("gamelibdir", "/data/data//lib");*/ + i.putExtra("gamelibdir", getFilesDir().getAbsolutePath().replace("/files","/lib")); + //i.putExtra("pakfile", getFilesDir().getAbsolutePath() + "/extras.pak"); + + // you may pass extra enviroment variables to game + // it is availiable from game code with getenv() function + /* + String envp[] = + { + "VAR1", "value1", + "VAR2", "value2" + }; + i.putExtra("env", envp); + */ + + return i; + } + + public void startXash(View view) + { + try + { + Intent intent = new Intent(); + intent.setAction("in.celest.xash3d.START"); + intent = prepareIntent(intent); + startActivity(intent); + return; + } + catch(Exception e){} + // some samsung devices have + // completely broken intent resolver + // so try specify exact component here + try + { + Intent intent = new Intent(); + intent.setComponent(new ComponentName("in.celest.xash3d.hl.test", "in.celest.xash3d.XashActivity")); + intent = prepareIntent(intent); + startActivity(intent); + return; + } + catch(Exception e){} + try + { + Intent intent = new Intent(); + intent.setComponent(new ComponentName("in.celest.xash3d.hl", "in.celest.xash3d.XashActivity")); + intent = prepareIntent(intent); + startActivity(intent); + return; + } + catch(Exception e){} + new AlertDialog.Builder(this) + .setTitle("Error") + .setMessage("Failed to start Xash3D FWGS engine\nIs it installed?") + .setCancelable(false) + .setPositiveButton("Ok", new DialogInterface.OnClickListener() + { + public void onClick(DialogInterface i, int w){ + LauncherActivity.this.finish(); + } + }).show(); + } +}