Merge branch 'master' of github.com:M66B/NetGuard

This commit is contained in:
M66B 2018-01-10 06:19:39 +01:00
commit 9b27f8d120
2 changed files with 3 additions and 3 deletions

View File

@ -98,6 +98,7 @@ JNIEXPORT jlong JNICALL
Java_eu_faircode_netguard_ServiceSinkhole_jni_1init(
JNIEnv *env, jobject instance, jint sdk) {
struct context *ctx = calloc(1, sizeof(struct context));
ctx->sdk = sdk;
loglevel = ANDROID_LOG_WARN;
@ -408,7 +409,7 @@ void report_error(const struct arguments *args, jint error, const char *fmt, ...
static jmethodID midProtect = NULL;
int protect_socket(const struct arguments *args, int socket) {
if (args->sdk >= 21)
if (args->ctx->sdk >= 21)
return 0;
jclass cls = (*args->env)->GetObjectClass(args->env, args->instance);

View File

@ -73,14 +73,13 @@ struct context {
pthread_mutex_t lock;
int pipefds[2];
int stopping;
int tun;
int sdk;
struct ng_session *ng_session;
};
struct arguments {
JNIEnv *env;
jobject instance;
int sdk;
int tun;
jboolean fwd53;
jint rcode;