From 1be6a3c6d85dac1780109f959d37a61b79919041 Mon Sep 17 00:00:00 2001 From: hev Date: Tue, 19 Nov 2024 22:29:54 +0800 Subject: [PATCH] HevJNI: Declare CLSNAME to allow overriding the class name. --- src/hev-jni.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hev-jni.c b/src/hev-jni.c index 1a6cc7352..68a75eee8 100644 --- a/src/hev-jni.c +++ b/src/hev-jni.c @@ -25,6 +25,9 @@ #ifndef PKGNAME #define PKGNAME hev/socks5 #endif +#ifndef CLSNAME +#define CLSNAME Socks5Service +#endif /* clang-format on */ #define STR(s) STR_ARG (s) @@ -70,7 +73,7 @@ JNI_OnLoad (JavaVM *vm, void *reserved) return 0; } - klass = (*env)->FindClass (env, STR (PKGNAME) "/Socks5Service"); + klass = (*env)->FindClass (env, STR (PKGNAME) "/" STR (CLSNAME)); (*env)->RegisterNatives (env, klass, native_methods, N_ELEMENTS (native_methods)); (*env)->DeleteLocalRef (env, klass);