staf621 / ki4a

Ki4a lets you tunnel your android's traffic over SSH in a very easy way.
Apache License 2.0
87 stars 52 forks source link

E/ki4a: Unable to connect to localSocksFile [/data/data/com.spotvpn.ssh/ki4a/tunfd_file] #28

Open engwafaajame opened 5 years ago

engwafaajame commented 5 years ago

E/ki4a: Unable to connect to localSocksFile [/data/data/com.spotvpn.ssh/ki4a/tunfd_file]

staf621 commented 5 years ago

Hi,

Yes, this is an known issue when you rename the project name. Some binaries may point to a different binary path. Please send me an email and I can help you to work around the issue.

Sorry for the inconvenience.

engwafaajame commented 5 years ago

ok I will send for you can you give me your email to contact with you to solve the problem

engwafaajame commented 5 years ago

can you give me your email

staf621 commented 5 years ago

Oh, sorry, forgot to mention it, staf621@gmail.com

engwafaajame commented 5 years ago

I sent for you via email

IHNEL commented 5 years ago

similar #27

engwafaajame commented 5 years ago

thank you very much for helping me to solve the problem

chihung93 commented 5 years ago

@staf621 : I have the same problem when change package name/ application Id. => so can you check your email for helping me to resolve this problem? Thanks

mohsensaremi commented 4 years ago

same issue did anyone solve this problem?

IHNEL commented 4 years ago

@staf621 Could you please publish the C-source files?

mohsensaremi commented 4 years ago

after some work on this repo I found that the problem is with tun2socks file https://github.com/staf621/ki4a/blob/master/src/main/assets/ki4a/arm/tun2socks https://github.com/staf621/ki4a/blob/master/src/main/assets/ki4a/arm_nopie/tun2socks https://github.com/staf621/ki4a/blob/master/src/main/assets/ki4a/x86/tun2socks

@IHNEL the C source files are from some project called badvpn https://github.com/ambrop72/badvpn/tree/master/tun2socks

but the problem is @staf621 have changed this source code and add some extra feature to tun2socks and hard coded the package name in it. I think the only way is decompile this file and change the package name do you know how we can decompile this file?

mohsensaremi commented 4 years ago

@IHNEL I found something else I think the tun2socks have been built from this repo https://github.com/shadowsocks/badvpn

see the following file https://github.com/shadowsocks/badvpn/blob/shadowsocks-android/tun2socks/tun2socks.c you can find configs about dnsgw and pid and some if statement that check __ANDROID__

I think this is the file we need to modify tell me if you have progress on it

IHNEL commented 4 years ago

@mohsensaremi Thank you very much for sharing, I would like to give a try on compiling those libraries. Do you have any reference documents where I can learn how to compile it? Sorry I'm pure Android developer, who didn't implement any C-libraries like this.

mohsensaremi commented 4 years ago

@IHNEL yes I compiled the shadowsocks/badvpn and get tun2socks executable file. but it didnt work :(( I tell you what I did so you can try to fix it

  1. clone the repository with git

    git clone --recursive https://github.com/shadowsocks/badvpn.git

    --recursive is for getting submodules

  2. go to jni directory

    cd core/src/main/jni
  3. edit Application.mk

    APP_ABI := armeabi-v7a
    APP_PLATFORM := android-21

    I build for android arm. you can change the APP_ABI for your specific arch

  4. compile the code

    ndk-build

after successful build, you can find executable files in core/src/main/libs/armeabi-v7a

you can rename libtun2socks.so to tun2socks and replace it with this project tun2socks file.

this executable file accept another argument --sock-path. you should pass your desired path to this argument example:

tun2socks ***other arguments*** --sock-path /data/data/com.spotvpn.ssh/ki4a/tunfd_file

after that the tunfd_file will be created but I got this error from logs:

java.io.IOException: Connection refused

tell me if you find any solution