SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
20.29k stars 2.42k forks source link

What is the simplest way to launch sing-box in android? #2044

Closed dbsxdbsx closed 3 months ago

dbsxdbsx commented 3 months ago

I made a cross platform app using flutter with rust through FFI. To use sing-box, it is quite easy to just launch it through in command with rust code:

  let mut command = Command::new(cmd_root);
        command.args(cmd_args);
        let child = command.spawn().unwrap(); // occurs android permission denied issue

But for android, I found it is always banned due to the permission denied issue.

With Android device not rooted yet, I wonder what is the best way to use sing-box easily?
I do know there is flutter proxy like https://github.com/hiddify/hiddify-next and the official one using kotlin solely. But they are a little complex(seems both writing many kotlin code?) I didn't understand it all for the android part.

I wonder: 1, is the android VPN service must be launched before using sing-box 2, which path in android is ok to launch sing-box without permission issue for a non-root device?

nekohasekai commented 3 months ago

No, you have to learn them. Transparent proxy is a platform specific feature, using a cross-platform UI will only complicate things.