Move setenv from engine to split library to allow lazy engine library loading
This commit is contained in:
parent
af63c6fd5b
commit
66eacf4839
4 changed files with 45 additions and 1 deletions
|
@ -37,7 +37,7 @@ APP_ABI := x86 armeabi armeabi-v7a-hard
|
|||
# ARMv6 and ARMv5 xash3d builds use softfp only and compatible only with softfp mods
|
||||
# Build both armeabi-v7a-hard and armeabi-v7a supported only for mods, not for engine
|
||||
|
||||
APP_MODULES := xash menu client server NanoGL
|
||||
APP_MODULES := xash menu client server NanoGL jnisetenv
|
||||
ifeq ($(XASH_SDL),1)
|
||||
APP_MODULES += SDL2
|
||||
endif
|
||||
|
|
13
jni/src/jnisetenv/Android.mk
Normal file
13
jni/src/jnisetenv/Android.mk
Normal file
|
@ -0,0 +1,13 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := jnisetenv
|
||||
|
||||
APP_PLATFORM := android-12
|
||||
|
||||
include $(XASH3D_CONFIG)
|
||||
|
||||
LOCAL_SRC_FILES := setenv.c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
26
jni/src/jnisetenv/setenv.c
Normal file
26
jni/src/jnisetenv/setenv.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
setenv.c -- a jni wrapper for setenv() call for XashActivity
|
||||
Copyright (C) 2016 a1batross
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
JAVA_EXPORT int Java_in_celest_xash3d_XashActivity_setenv( JNIEnv* env, jclass clazz, jstring key, jstring value, jboolean overwrite )
|
||||
{
|
||||
char* k = (char *) (*env)->GetStringUTFChars(env, key, NULL);
|
||||
char* v = (char *) (*env)->GetStringUTFChars(env, value, NULL);
|
||||
int err = setenv(k, v, overwrite);
|
||||
(*env)->ReleaseStringUTFChars(env, key, k);
|
||||
(*env)->ReleaseStringUTFChars(env, value, v);
|
||||
return err;
|
||||
}
|
|
@ -75,6 +75,11 @@ public class XashActivity extends Activity {
|
|||
private static String SIG = "DMsE8f5hlR7211D8uehbFpbA0n8=";
|
||||
private static String SIG_TEST = ""; // a1ba: mittorn, add your signature later
|
||||
|
||||
// Load the .so
|
||||
static {
|
||||
System.loadLibrary("jnisetenv");
|
||||
}
|
||||
|
||||
// Shared between this activity and LauncherActivity
|
||||
public static boolean dumbAntiPDALifeCheck( Context context )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue