mirror of
https://github.com/PurpleI2P/i2pd-android.git
synced 2025-01-08 22:07:57 +00:00
fix JNI string release before executing C++ functions, update gradle to 7.1.3
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
21a7200b34
commit
578a97f549
@ -91,8 +91,8 @@ JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_onNetworkStateChanged
|
|||||||
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setDataDir
|
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setDataDir
|
||||||
(JNIEnv *env, jclass clazz, jstring jdataDir) {
|
(JNIEnv *env, jclass clazz, jstring jdataDir) {
|
||||||
auto dataDir = env->GetStringUTFChars(jdataDir, NULL);
|
auto dataDir = env->GetStringUTFChars(jdataDir, NULL);
|
||||||
env->ReleaseStringUTFChars(jdataDir, dataDir);
|
|
||||||
i2p::android::SetDataDir(dataDir);
|
i2p::android::SetDataDir(dataDir);
|
||||||
|
env->ReleaseStringUTFChars(jdataDir, dataDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getTransitTunnelsCount
|
JNIEXPORT jint JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getTransitTunnelsCount
|
||||||
@ -111,8 +111,8 @@ JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getWebConsAddr
|
|||||||
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setLanguage
|
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setLanguage
|
||||||
(JNIEnv *env, jclass clazz, jstring jlanguage) {
|
(JNIEnv *env, jclass clazz, jstring jlanguage) {
|
||||||
auto language = env->GetStringUTFChars(jlanguage, NULL);
|
auto language = env->GetStringUTFChars(jlanguage, NULL);
|
||||||
env->ReleaseStringUTFChars(jlanguage, language);
|
|
||||||
i2p::android::SetLanguage(language);
|
i2p::android::SetLanguage(language);
|
||||||
|
env->ReleaseStringUTFChars(jlanguage, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getHTTPProxyState
|
JNIEXPORT jboolean JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getHTTPProxyState
|
||||||
|
@ -29,7 +29,7 @@ public class DaemonWrapper {
|
|||||||
private static final String TAG = "i2pd";
|
private static final String TAG = "i2pd";
|
||||||
private final AssetManager assetManager;
|
private final AssetManager assetManager;
|
||||||
private final ConnectivityManager connectivityManager;
|
private final ConnectivityManager connectivityManager;
|
||||||
private String i2pdpath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd/";
|
private String i2pdpath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd";
|
||||||
private boolean assetsCopied;
|
private boolean assetsCopied;
|
||||||
|
|
||||||
private static final String appLocale = Locale.getDefault().getDisplayLanguage(Locale.ENGLISH).toLowerCase(); // lower-case system language (like "english")
|
private static final String appLocale = Locale.getDefault().getDisplayLanguage(Locale.ENGLISH).toLowerCase(); // lower-case system language (like "english")
|
||||||
|
@ -4,7 +4,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user