Browse Source

fix JNI string release before executing C++ functions, update gradle to 7.1.3

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/44/head
R4SAS 3 years ago
parent
commit
578a97f549
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 4
      app/jni/i2pd_android.cpp
  2. 2
      app/src/main/java/org/purplei2p/i2pd/DaemonWrapper.java
  3. 2
      build.gradle

4
app/jni/i2pd_android.cpp

@ -91,8 +91,8 @@ JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_onNetworkStateChanged @@ -91,8 +91,8 @@ JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_onNetworkStateChanged
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setDataDir
(JNIEnv *env, jclass clazz, jstring jdataDir) {
auto dataDir = env->GetStringUTFChars(jdataDir, NULL);
env->ReleaseStringUTFChars(jdataDir, dataDir);
i2p::android::SetDataDir(dataDir);
env->ReleaseStringUTFChars(jdataDir, dataDir);
}
JNIEXPORT jint JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getTransitTunnelsCount
@ -111,8 +111,8 @@ JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getWebConsAddr @@ -111,8 +111,8 @@ JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getWebConsAddr
JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setLanguage
(JNIEnv *env, jclass clazz, jstring jlanguage) {
auto language = env->GetStringUTFChars(jlanguage, NULL);
env->ReleaseStringUTFChars(jlanguage, language);
i2p::android::SetLanguage(language);
env->ReleaseStringUTFChars(jlanguage, language);
}
JNIEXPORT jboolean JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getHTTPProxyState

2
app/src/main/java/org/purplei2p/i2pd/DaemonWrapper.java

@ -29,7 +29,7 @@ public class DaemonWrapper { @@ -29,7 +29,7 @@ public class DaemonWrapper {
private static final String TAG = "i2pd";
private final AssetManager assetManager;
private final ConnectivityManager connectivityManager;
private String i2pdpath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd/";
private String i2pdpath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd";
private boolean assetsCopied;
private static final String appLocale = Locale.getDefault().getDisplayLanguage(Locale.ENGLISH).toLowerCase(); // lower-case system language (like "english")

2
build.gradle

@ -4,7 +4,7 @@ buildscript { @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:7.1.3'
}
}

Loading…
Cancel
Save