mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-31 03:41:20 +00:00
Bug fix for sdk initializer.
This commit is contained in:
parent
49d0e1905b
commit
4e62532919
2 changed files with 3 additions and 3 deletions
|
@ -98,6 +98,7 @@ JNIEXPORT jlong JNICALL
|
||||||
Java_eu_faircode_netguard_ServiceSinkhole_jni_1init(
|
Java_eu_faircode_netguard_ServiceSinkhole_jni_1init(
|
||||||
JNIEnv *env, jobject instance, jint sdk) {
|
JNIEnv *env, jobject instance, jint sdk) {
|
||||||
struct context *ctx = calloc(1, sizeof(struct context));
|
struct context *ctx = calloc(1, sizeof(struct context));
|
||||||
|
ctx->sdk = sdk;
|
||||||
|
|
||||||
loglevel = ANDROID_LOG_WARN;
|
loglevel = ANDROID_LOG_WARN;
|
||||||
|
|
||||||
|
@ -408,7 +409,7 @@ void report_error(const struct arguments *args, jint error, const char *fmt, ...
|
||||||
static jmethodID midProtect = NULL;
|
static jmethodID midProtect = NULL;
|
||||||
|
|
||||||
int protect_socket(const struct arguments *args, int socket) {
|
int protect_socket(const struct arguments *args, int socket) {
|
||||||
if (args->sdk >= 21)
|
if (args->ctx->sdk >= 21)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
jclass cls = (*args->env)->GetObjectClass(args->env, args->instance);
|
jclass cls = (*args->env)->GetObjectClass(args->env, args->instance);
|
||||||
|
|
|
@ -73,14 +73,13 @@ struct context {
|
||||||
pthread_mutex_t lock;
|
pthread_mutex_t lock;
|
||||||
int pipefds[2];
|
int pipefds[2];
|
||||||
int stopping;
|
int stopping;
|
||||||
int tun;
|
int sdk;
|
||||||
struct ng_session *ng_session;
|
struct ng_session *ng_session;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct arguments {
|
struct arguments {
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
jobject instance;
|
jobject instance;
|
||||||
int sdk;
|
|
||||||
int tun;
|
int tun;
|
||||||
jboolean fwd53;
|
jboolean fwd53;
|
||||||
jint rcode;
|
jint rcode;
|
||||||
|
|
Loading…
Reference in a new issue