mirror of https://github.com/M66B/NetGuard.git
Native exception handling
This commit is contained in:
parent
5ebbf82ef3
commit
1dca134061
|
@ -98,6 +98,7 @@
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/objectFiles" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/objectFiles" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||||
|
|
|
@ -726,7 +726,6 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
||||||
|
|
||||||
// Called from native code
|
// Called from native code
|
||||||
private void logPacket(int version, String saddr, int sport, String daddr, int dport, int protocol, String flags, int uid) {
|
private void logPacket(int version, String saddr, int sport, String daddr, int dport, int protocol, String flags, int uid) {
|
||||||
try {
|
|
||||||
new DatabaseHelper(SinkholeService.this).insertLog(
|
new DatabaseHelper(SinkholeService.this).insertLog(
|
||||||
version,
|
version,
|
||||||
daddr,
|
daddr,
|
||||||
|
@ -736,9 +735,6 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
||||||
uid,
|
uid,
|
||||||
(last_connected ? last_metered ? 2 : 1 : 0),
|
(last_connected ? last_metered ? 2 : 1 : 0),
|
||||||
last_interactive).close();
|
last_interactive).close();
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopReceiving() {
|
private void stopReceiving() {
|
||||||
|
|
|
@ -155,6 +155,13 @@ void decode(JNIEnv *env, jobject instance, jbyte *buffer, int length) {
|
||||||
(*env)->DeleteLocalRef(env, jsource);
|
(*env)->DeleteLocalRef(env, jsource);
|
||||||
(*env)->DeleteLocalRef(env, jdest);
|
(*env)->DeleteLocalRef(env, jdest);
|
||||||
(*env)->DeleteLocalRef(env, jflags);
|
(*env)->DeleteLocalRef(env, jflags);
|
||||||
|
|
||||||
|
jthrowable ex = (*env)->ExceptionOccurred(env);
|
||||||
|
if (ex) {
|
||||||
|
(*env)->ExceptionDescribe(env);
|
||||||
|
(*env)->ExceptionClear(env);
|
||||||
|
(*env)->DeleteLocalRef(env, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue