Index: libadblockplus-android/jni/JniFilterEngine.cpp |
diff --git a/libadblockplus-android/jni/JniFilterEngine.cpp b/libadblockplus-android/jni/JniFilterEngine.cpp |
index 1f59aac630f338d3a92483dddde2b57cc2018b3f..a1d25bf3e2eaafa70c33cc8f30d21961526d6271 100644 |
--- a/libadblockplus-android/jni/JniFilterEngine.cpp |
+++ b/libadblockplus-android/jni/JniFilterEngine.cpp |
@@ -499,6 +499,16 @@ static void JNICALL JniUpdateFiltersAsync(JNIEnv* env, jclass clazz, jlong jniPl |
}); |
} |
+static jlong JNICALL JniGetFilterEnginePtr(JNIEnv* env, jclass clazz, jlong ptr) |
+{ |
+ try |
+ { |
+ AdblockPlus::FilterEngine& engine = GetFilterEngineRef(ptr); |
+ return (jlong)&engine; |
+ } |
+ CATCH_THROW_AND_RETURN(env, 0); |
+} |
+ |
static JNINativeMethod methods[] = |
{ |
{ (char*)"isFirstRun", (char*)"(J)Z", (void*)JniIsFirstRun }, |
@@ -528,7 +538,8 @@ static JNINativeMethod methods[] = |
{ (char*)"setAcceptableAdsEnabled", (char*)"(JZ)V", (void*)JniSetAcceptableAdsEnabled }, |
{ (char*)"isAcceptableAdsEnabled", (char*)"(J)Z", (void*)JniIsAcceptableAdsEnabled }, |
{ (char*)"getAcceptableAdsSubscriptionURL", (char*)"(J)Ljava/lang/String;", (void*)JniGetAcceptableAdsSubscriptionURL }, |
- { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpdateFiltersAsync } |
+ { (char*)"updateFiltersAsync", (char*)"(JLjava/lang/String;)V", (void*)JniUpdateFiltersAsync }, |
+ { (char*)"getFilterEnginePtr", (char*)"(J)J", (void*)JniGetFilterEnginePtr } |
}; |
extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_libadblockplus_FilterEngine_registerNatives(JNIEnv *env, jclass clazz) |