leaf
leaf copied to clipboard
请问还有 Android 库构建文档吗?
请问,您安卓库构建成功了吗?
我在mac m1上构建成功了
@chekun Do you mind sharing how you did the build?
@shenshengkafei Sure, you can refer at https://github.com/chekun/aleaf/tree/master/app/src/main/rust/leaf-android ,that repo is old, but it surely applies to leaf current version.
@shenshengkafei Sure, you can refer at https://github.com/chekun/aleaf/tree/master/app/src/main/rust/leaf-android ,that repo is old, but it surely applies to leaf current version.
Thank you very much!
谢谢!
---原始邮件--- 发件人: @.> 发送时间: 2022年5月14日(周六) 中午11:32 收件人: @.>; 抄送: @.@.>; 主题: Re: [eycorsican/leaf] 请问还有 Android 库构建文档吗? (#230)
@shenshengkafei Sure, you can refer at https://github.com/chekun/aleaf/tree/master/app/src/main/rust/leaf-android ,that repo is old, but it surely applies to leaf current version.
Thank you very much!
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
@shenshengkafei @ChenDing2018
https://github.com/chekun/aleaf/blob/master/app/src/main/rust/leaf-android/src/lib.rs#L28 socket_protect_path
arg is removed in current leaf , you guys need modify the code a little bit.
我在mac m1上构建成功了
大佬, 请问有iOS的库没?这上面新的releases都没有iOS的了?
@594810899 https://github.com/eycorsican/leaf/blob/master/Makefile#L9 leaf.h 会一起生成的呀
clone项目,执行 make ios-opt
就行了
ios15 获取 tunFd 的方式要改,你google一下
@594810899 这个得你自己看一下日志吧,idevicesyslog -p PacketTunnel
大佬 请问socket_protect_path那要怎么修改啊 完全不懂rust,
大佬 请问socket_protect_path那要怎么修改啊 完全不懂rust,
我也不懂rust
大佬,我不想努力了,请问有编译好的so文件可以给我一份么。/(ㄒoㄒ)/~~
@chekun @594810899
大佬,我不想努力了,请问有编译好的so文件可以给我一份么。/(ㄒoㄒ)/~~
@chekun @594810899 我看你编译的安卓的,我是编译iOS的 ,你用不了啊
昂 谢谢大佬 我继续去掉头发了/(ㄒoㄒ)/~~
@foreverZou so
文件 发给你你也用不了,带包名的。
你看一下rust基础语法就可以了哈
@594810899 你把配置改成这样试试,这个配置我可以用的,用下面的看看是否可以正常上网
[General]
loglevel = trace
dns-server = 223.5.5.5, 114.114.114.114
tun-fd = REPLACE-ME-WITH-THE-FD
routing-domain-resolve = true
[Proxy]
Direct = direct
Reject = reject
[Rule]
Final = direct
你需要看日志 看发生了啥才能确定原因哦
我加你Q吧
Hello! Help! I've been trying to compile for Android for several days now and it doesn't work. Someone can help me with this?
Error: "no method named write_to_file
found for enum Result
in the current scope"
@Valew17
follow instructions with aleaf
demo project, it will definitely work.
@chekun let appGroup = "com.myncic.MyVpnProject.VPNTunneDemoA"
let conf = """ [General] loglevel = trace dns-server = 223.5.5.5, 114.114.114.114 tun-fd = REPLACE-ME-WITH-THE-FD routing-domain-resolve = true
[Proxy] Direct = direct Reject = trojan, 212.50.244.81, 6666, password=myncic_123456 [Rule] FINAL, direct """ 是这样的吗? 我用这个配置, 其它代码没变,还是访问不到外网
Hello! Did you manage to figure out what the problem is? Faced a similar situation.
编译出来了 但是连接不上 大佬救我/(ㄒoㄒ)/~~ @chekun
截图上不是写了ssl decrypt错误么
我的同事使用相同的配置成功了,所以我想会不会是我哪一步弄错了。请问安卓的site.dat文件需要放在哪里呀? @chekun
Hello! Excuse me for my English, it's not my native language. Can someone help me for money to collect libleafandroid.so the latest version and make the on and off function and what would it work stably on android? I really hope for your help.
@foreverZou 你同事成功了,很你同事的代码对比一下。
@Valew17 follow the steps on your forked aleaf project, it works with the latest version.
看报错信息哦,里面不光说了为啥错,还给你解决方案了
rustup target add aarch64-apple-ios
make ios-opt
试试
@Chen77777 嗯,这我就不是很清楚了,我是在m1上编译的,深层原因我也不太懂了,哈哈,看有没有大佬解答。
@Chen77777 不是哦,安卓,ios 我都在m1上成功啦
@Chen77777 是的,都是最新版编译的啦
@Chen77777 是的,都是最新版编译的啦
嗯嗯 那可能问题在编译环境上
Hello! Can someone share an example of this file https://github.com/chekun/aleaf/blob/master/app/src/main/java/com/leaf/example/aleaf/SimpleVpnService.kt ?
As I understand it does not work with the new version 0.6.0
https://github.com/chekun/aleaf/blob/master/app/src/main/rust/leaf-android/src/lib.rs#L28
socket_protect_path
arg is removed in current leaf , you guys need modify the code a little bit.
as i mentioned earlier, modify this file to match latest leaf api
@Valew17
https://github.com/chekun/aleaf/blob/master/app/src/main/rust/leaf-android/src/lib.rs#L28
socket_protect_path
arg is removed in current leaf , you guys need modify the code a little bit.as i mentioned earlier, modify this file to match latest leaf api
@Valew17
Did I remove the line "socket_protect_path: Some(protect_path)," or is that not enough? Everything compiled after that, in the logs I see that requests are coming, but the Internet on the Android device does not work. Please help me to figure out how to run the latest version.
@Valew17
before runLeaf ,do you set SOCKET_PROTECT_PATH
env variable? If not , set it before runLeaf.
The code is here https://github.com/eycorsican/leaf/blob/50703f8ad8e9cb238fa3a352d9a07af2b00b9e65/leaf/src/option/mod.rs#L189
comments says
/// Sets the RPC service endpoint for protecting outbound sockets on Android to
/// avoid infinite loop. The `path` is treated as a Unix domain socket endpoint.
/// The RPC service simply listens for incoming connections, reads an int32 on
/// each connection, treats it as the file descriptor to protect, writes back 0
/// on success.
@Valew17
before runLeaf ,do you set
SOCKET_PROTECT_PATH
env variable? If not , set it before runLeaf.The code is here
https://github.com/eycorsican/leaf/blob/50703f8ad8e9cb238fa3a352d9a07af2b00b9e65/leaf/src/option/mod.rs#L189
comments says
/// Sets the RPC service endpoint for protecting outbound sockets on Android to /// avoid infinite loop. The `path` is treated as a Unix domain socket endpoint. /// The RPC service simply listens for incoming connections, reads an int32 on /// each connection, treats it as the file descriptor to protect, writes back 0 /// on success.

Please help me a little more, I don't know the syntax of this language, like I'm passing a String, but it still swears when compiling.
i mean , in java , Os.setenv("SOCKET_PROTECT_PATH", protectPath, true)
i mean , in java ,
Os.setenv("SOCKET_PROTECT_PATH", protectPath, true)
Thanks a lot! It helps me!
夜神模拟器android7 运行aleaf代理失败,android9 就可以,有大佬遇见过吗?