Closed SirSAC closed 2 years ago
Is there any specific error message when running on Android?
no, just the syscall.BindToDevice return non nil value (err), i have root on my phone with Magisk and i have busybox and extras, i have Android 9 close to stock rom, my phone support aarch64 (ARM v8-A).
so, you have any idea how we can try to make compatible with Android?
Didn't get a chance to work on this yet. How are you compiling for Android? I think GOOS
must be set to android
rather than linux
.
yes, i did it as GOOS=android
and GOARCH=arm64
because my phone have 64-bit processor (ARM-v8) and is rooted with Magisk but not work on the syscall.BindToDevice
as work on computer Linux, on net.DialTCP
not work at all on Android, i try with different methods and commands to can be working on Android but at this moment i not have positive results, if i have one i will tell you that.
By the way, i found an issue about on how Linux works on firewall thing that make this program to be stuck on only one network and it can be fixed by running this command sudo sysctl --write net.ipv4.conf.all.rp_filter="0"
, add it below of setcap
command.
Cya later, have a nice day and good luck with Android things, im waiting you about Android issue if you have any results or doubts.
Tested go-dispatch-proxy on an Android emulator and it's working fine. It's for x86 though not ARM. Traffic is dispatched across two interfaces.
Command used to compile (Requires Android NDK)
$ CGO_ENABLED=1 CC=~/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android28-clang GOOS=android GOARCH=386 go build
$ CGO_ENABLED=1 CC=~/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang GOOS=android GOARCH=arm64 go build
The ARM64 version hasn't been tested. Binaries attached.
go-dispatch-proxy-android-x86.zip go-dispatch-proxy-android-arm64.zip
I will test it now and i will tell you if is working or not.
Nope, on arm64 or on arm in general not work, the error message is:
[WARN] 23.239.16.110:443 -> 10.24.161.221:0 {dial tcp4 10.24.161.221:0->23.239.16.110:443: connect: software caused connection abort}
[WARN] 23.239.16.110:443 -> 192.168.1.3:0 {dial tcp4 192.168.1.3:0->23.239.16.110:443: connect: software caused connection abort}
and this is repeated for any address.
Are you running it with root privileges?
Yes, with su -c ./go-dispatch-proxy
I think is the problem is ARM not code, but im not sure.
I have setcap
too by termux and not work too with this.
Can you test if it works on an Android emulator? Here there were no such errors when I tested it on Android Studio emulator.
btw, golang have builtin android compiler, so, is not necessary to an external compiler.
I tested on my phone that is android 9 (Pie) AOSP and is rooted with Magisk.
Can you test if it works on an Android emulator? Here there were no such errors when I tested it on Android Studio emulator.
My PC is low end and i not think so, my CPU is E8200 and 4 GB of RAM of DDR2.
You said you not tested for ARM64 but tested the x86 on emulator.
Can give me the link of website of iso or img for x86 Android?
golang have builtin android compiler, so, is not necessary to an external compile
About this. AFAIK Setting GOOS=android
does require external compiler. It's mentioned in https://golang.org/misc/android/README
you not tested for ARM64 but tested the x86 on emulator
Yep, Just tested the x86 version
Can give me the link of website of iso or img for x86 Android?
Thanks, i compiled the other programs for Android on ARM64 and i not have any problems with builtin compiler.
Do not forget to mention this command for some Linux systems that have an conflict with this program.
Command that can fix this is sudo sysctl --write net.ipv4.conf.all.rp_filter=0
Ubuntu or Debian based systems have this conflict in general.
Hello again, did you find an workaround for Android on ARM processors? On the Android with x86 processors i not see any problems.
Hello again, i fixed the problem on Android, the real problem was ARM not the system, so ARM thinks different and need to have IP address instead of site or web address. Thanks anticipated for trying to help me.
Hi, im Alex and i have your open source project that i work on it for more options, more stable and complex but in sametime simple and light, the problem is syscall.BindToDevice not work on Android but wikipedia saids is Linux too, thats normal or needs different code for this system? PS: I love your work man, i very appreciate and thanks for open source and MIT license, when i will have some money i will donate to you.