Replies: 2 comments 2 replies
-
class SimpleVpnService: VpnService() {
...
private external fun setProtectSocketCallback(name: String)
...
fun protectSocket(fd: Int): Boolean {
return protect(fd)
}
...
setProtectSocketCallback("protectSocket")
|
Beta Was this translation helpful? Give feedback.
2 replies
-
我这里引入报这个错误 leaf::mobile::callback::android::set_protect_socket_callback(class_g, name); leaf::mobile::callback::android::set_jvm(vm); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
/// Example:
///
/// Note: the protect method could be identified as unused code on the Android
/// side and stripped by ProGuard, you may need to add a keep rule to let
/// ProGuard knows we need the code, e.g.:
///
/// -keep class com.leaf.and.aleaf.** { *; }
///
/// // Sets a callback method to protect sockets.
/// //
/// // Expects a method with the given name and signature
(I)Z
./// #[allow(non_snake_case)]
/// #[no_mangle]
/// pub unsafe extern "system" fn Java_com_leaf_and_aleaf_SimpleVpnService_setProtectSocketCallback(
看了文档 但是还是不知道怎么实现
Beta Was this translation helpful? Give feedback.
All reactions