Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working #47

Closed
sssemil opened this issue Sep 12, 2015 · 23 comments
Closed

Not working #47

sssemil opened this issue Sep 12, 2015 · 23 comments

Comments

@sssemil
Copy link
Contributor

sssemil commented Sep 12, 2015

This thing is not working at all(tried on One PlusOne with Android 5.1.1 and on emulator with Android 5.1). It's not creating any tun0 interface and it's impossible to connect to any hyperboria sites(even after manually adding public nodes to cjdroute.conf).

P.S. it creates tun0 interface if you run it manually from terminal emulator or adb as root.

@benhylau
Copy link
Member

So I only got as far as mocking out the UI before going mia since the summer. Because of hyperboria/bugs#61 I am still not able to build the binary for ARM from my Mac. So this is all wip and I don't expect it to already be working :)

Thanks for the scripted build by the way, it's very helpful, although I still cannot build from Darwin.

@sssemil
Copy link
Contributor Author

sssemil commented Dec 28, 2015

Well, never had Darwin for testing :P

@sssemil
Copy link
Contributor Author

sssemil commented Dec 28, 2015

I can only suggest installing some Linux on a virtual machine

@benhylau
Copy link
Member

benhylau commented Jan 6, 2016

I got this working through the app as su. Something like:

Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("su");
DataOutputStream dos = new DataOutputStream(process.getOutputStream());
dos.writeBytes("/data/data/berlin.meshnet.cjdns/cjdroute < /data/data/berlin.meshnet.cjdns/files/cjdroute.conf" + "\n");
dos.flush();

If I don't run in a su shell then it crashes due to permission:

INFO cjdroute2.c:601 Cjdns armel linux
INFO cjdroute2.c:605 Checking for running instance...
DEBUG UDPAddrIface.c:294 Bound to address [0.0.0.0:57090]
DEBUG AdminClient.c:333 Connecting to [127.0.0.1:11234]

Pipe.c:441 uv_pipe_bind() failed [permission denied] for pipe [/data/local/tmp/cjdns_pipe_client-core-knzmzrszpflffd9mzyy81tdmd3gcqu]
Fatal signal 6 (SIGABRT) at 0x000008eb (code=-6), thread 2283 (cjdroute)

Looks like this isn't a good place to put these files since it's only accessible with root.

@lgierth @kpcyrd

@sssemil
Copy link
Contributor Author

sssemil commented Jan 6, 2016

If I run binary as root it kinda works(creates tun0 interface), but ping says that networks is unreachable :ь

@benhylau
Copy link
Member

benhylau commented Jan 6, 2016

You mean running it not through the app, but adb in and manually execute:

/data/data/berlin.meshnet.cjdns/cjdroute < /data/data/berlin.meshnet.cjdns/files/cjdroute.conf

Does your cjdroute.conf have peers?

@benhylau
Copy link
Member

benhylau commented Jan 6, 2016

^Forgot to mention my /data/data/berlin.meshnet.cjdns/files/cjdroute.conf is not the default generated one. I injected a set of peer credentials into that. With su I can actually reach nodes with ping6

@sssemil
Copy link
Contributor Author

sssemil commented Jan 6, 2016

Yeap, I have peers and I was using ping6. Maybe that's cus of my android version which is 5.1

@benhylau
Copy link
Member

benhylau commented Jan 6, 2016

Well... I am also running a different binary from the second point here: hyperboria/bugs#61 (comment)

The cjdroute process is actually running and still you cannot reach the network?

@sssemil
Copy link
Contributor Author

sssemil commented Jan 6, 2016

I've compiled it myself and it wasn't working. Where did you get another binary?

@benhylau
Copy link
Member

benhylau commented Jan 6, 2016

@prurigro builds them. He gave me a link to a build from a previous codebase, before the change that broke Android.

@sssemil
Copy link
Contributor Author

sssemil commented Jan 6, 2016

Could you please give me link to breaking changes?

@kpcyrd
Copy link
Member

kpcyrd commented Jan 6, 2016

@sssemil this is still work in progress and I'm not sure it has ever worked, yet. (I don't own an android device currently (donations welcome tho (but there are other people who could probably put this into better use)))

Network is unreachable is unrelated to the configuration of cjdroute, the message is from the kernel saying sending a packet to that IP failed because there's no route that matches this IP. That means the fc00::/8 route hasn't been set in the kernel's routing table (and there's also no default route for IPv6) so it doesn't know what to do with that packet. You can verify the route with ip -6 r, but I'm not sure if this is supported on android. The route is set implicitly by adding an IP with /8, so I suspect the IP hasn't been configured on the tun, if the tun has been created at all.

@benhylau requiring root is ok for me until we figure out another way to do things. You can remove the \n and flush if you close stdin after sending the command. I'd merge the PR if you want to prepare one. cc @lgierth

I've merged hyperboria/bugs#61 yesterday.

@sssemil
Copy link
Contributor Author

sssemil commented Jan 6, 2016

@kpcyrd
u0_a138@A0001:/ $ su
root@A0001:/ # cjdroute < /cjdroute.conf
1452072917 INFO cjdroute2.c:615 Cjdns armel linux +seccomp
1452072917 INFO cjdroute2.c:619 Checking for running instance...
1452072917 DEBUG UDPAddrIface.c:293 Bound to address [0.0.0.0:39686]
1452072917 DEBUG AdminClient.c:333 Connecting to [127.0.0.1:11234]
1452072917 DEBUG Pipe.c:134 Buffering a message
1452072917 DEBUG cjdroute2.c:664 Sent [140] bytes to core
1452072917 INFO RandomSeed.c:42 Attempting to seed random number generator
1452072917 INFO RandomSeed.c:50 Trying random seed [/dev/urandom] Success
1452072917 INFO RandomSeed.c:50 Trying random seed [/proc/sys/kernel/random/uuid (Linux)] Success
1452072917 INFO RandomSeed.c:64 Seeding random number generator succeeded with [2] sources
1452072917 INFO LibuvEntropyProvider.c:59 Taking clock samples every [1000]ms for random generator
1452072917 DEBUG Core.c:263 Getting pre-configuration from client
1452072917 DEBUG Pipe.c:231 Pipe [/data/local/tmp/cjdns_pipe_client-core-frv6pzcs34f68hpyfnh8usy2r3t2gv] established connection
1452072917 DEBUG Pipe.c:231 1452072917 DEBUG Pipe.c:253 Sending buffered message
Pipe [/data/local/tmp/cjdns_pipe_client-core-frv6pzcs34f68hpyfnh8usy2r3t2gv] established connection
1452072917 DEBUG Core.c:266 Finished getting pre-configuration from client
1452072917 DEBUG UDPAddrIface.c:254 Binding to address [127.0.0.1:11234]1452072917 DEBUG UDPAddrIface.c:293 Bound to address [127.0.0.1:11234]
1452072917 DEBUG UDPAddrIface.c:293 Bound to address [0.0.0.0:60177]
1452072917 DEBUG AdminClient.c:333 Connecting to [127.0.0.1:11234]
1452072917 INFO Configurator.c:135 Checking authorized password 0.
1452072917 INFO Configurator.c:159 Adding authorized password #[0] for user [default-login].
1452072917 INFO Configurator.c:374 Setting up all ETHInterfaces...
1452072917 DEBUG Configurator.c:539 Security_noforks()
1452072917 DEBUG Configurator.c:544 Security_setUser(uid:9999, keepNetAdmin:1)
1452072917 DEBUG Configurator.c:564 Security_setupComplete()
1452072917 DEBUG Configurator.c:648 Cjdns started in the background
127|root@A0001:/ # busybox ifconfig tun0
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: fc98:a906:8913:344f:2628:8029:29c7:cc69/8 Scope:Global
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1304 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@A0001:/ # ip -6 r
root@A0001:/ #

@benhylau
Copy link
Member

benhylau commented Jan 7, 2016

@sssemil Made a ticket hyperboria/bugs#93
@kpcyrd Will put in a PR

@benhylau
Copy link
Member

benhylau commented Jan 9, 2016

root@hammerhead:/data/data/berlin.meshnet.cjdns # setenforce 0
root@hammerhead:/data/data/berlin.meshnet.cjdns # getenforce                                                        │~/D/p/g/cjdns-android ❯❯❯
Permissive
root@hammerhead:/data/data/berlin.meshnet.cjdns # ./cjdroute < files/cjdroute.conf
  ...
root@hammerhead:/data/data/berlin.meshnet.cjdns # ps ax cjdroute                                                    │~/D/p/g/cjdns-android ❯❯❯
USER     PID   PPID  VSIZE  RSS     WCHAN    PC        NAME                                                         │~/D/p/g/cjdns-android ❯❯❯
nobody    3041  1     9752   1364  c02ae838 b6e16534 S /data/data/berlin.meshnet.cjdns/cjdroute

On the 4.4.4 Nexus S, the process is owned by root. But I can't get this 5.1.1 Nexus 5 to run cjdroute as root. SELinux related? http://android.stackexchange.com/questions/54577/how-can-i-change-selinux-from-enforcing-to-permissive-on-samsung-galaxy-note-3/75384#75384

@benhylau
Copy link
Member

benhylau commented Jan 9, 2016

On the 4.4.4 Nexus S:

126|root@crespo:/ # cat /proc/net/ipv6_route
fcaa5785a53790db6513bba987a012a7 80 00000000000000000000000000000000 00 fcaa5785a53790db6513bba987a012a7 00000000 00000003 00000006 01000001     tun0
  ...
root@crespo:/ # ip -6 r
fc00::/8 dev tun0  proto kernel  metric 256  mtu 1304
fe80::/64 dev wlan0  proto kernel  metric 256
fe80::/64 dev tun0  proto kernel  metric 256  mtu 1304

And the 5.1.1 Nexus 5, ipv6_route doesn't contain the fc00::/8 entry and ip -6 r shows nothing. I tried manually adding with ip -6 route add to get the latter in, but don't have write permission to add the entry in ipv6_route. Looks like cjdroute didn't fully configure the tun on 5.1.1.

@sssemil
Copy link
Contributor Author

sssemil commented Jan 9, 2016

Looks like we'll need to use android's API. Plus is that we can make it working without root. I think Orbot has it, so it's good place to look into. We can also try playing with user names.

@kylerchin
Copy link

It appears the app crashes on attempt to turn on cjdns. Opening the app is ok, but clicking the switch results in a crash. Tested on:
Verizon Samsung S6
Unlocked Samsung S3

@kylerchin
Copy link

I installed it from the app apk from own.darkcloud.ca:90/Android-Builds

@benhylau
Copy link
Member

Yes this is currently not working. Closest thing is on develop, but it has binaries missing. The source to generate the binaries need to be committed to cjdns repo still. Then I clean up the develop branch to generate a working build without root. @lgierth

@benhylau
Copy link
Member

benhylau commented Oct 7, 2016

The binaries can be built from cjdelisle/cjdns#971
Checkout https://github.com/hyperboria/android/tree/develop, drop in the binaries, connect your phone and ./install_debug.

@vikulin
Copy link

vikulin commented Aug 12, 2018

I'm getting license error:
root@gem-01:~/android# ./install_debug
./install_debug: 3: ./install_debug: ndk-build: not found
Starting Build
Settings evaluated using settings file '/master/settings.gradle'.
Projects loaded. Root project using build file '/root/android/build.gradle'.
Included projects: [root project 'android']
Evaluating root project 'android' using build file '/root/android/build.gradle'.
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-15/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-16/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-17/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-18/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-19/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-21/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-22/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-23/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-24/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_gdk-google-19/package.xml
Parsing /opt/android-sdk-linux/build-tools/28.0.2/package.xml
Parsing /opt/android-sdk-linux/docs/package.xml
Parsing /opt/android-sdk-linux/extras/android/m2repository/package.xml
Parsing /opt/android-sdk-linux/extras/google/auto/package.xml
Parsing /opt/android-sdk-linux/extras/google/google_play_services/package.xml
Parsing /opt/android-sdk-linux/extras/google/instantapps/package.xml
Parsing /opt/android-sdk-linux/extras/google/m2repository/package.xml
Parsing /opt/android-sdk-linux/extras/google/market_apk_expansion/package.xml
Parsing /opt/android-sdk-linux/extras/google/market_licensing/package.xml
Parsing /opt/android-sdk-linux/extras/google/simulators/package.xml
Parsing /opt/android-sdk-linux/extras/google/webdriver/package.xml
Parsing /opt/android-sdk-linux/platform-tools/package.xml
Parsing /opt/android-sdk-linux/platforms/android-10/package.xml
Parsing /opt/android-sdk-linux/platforms/android-11/package.xml
Parsing /opt/android-sdk-linux/platforms/android-12/package.xml
Parsing /opt/android-sdk-linux/platforms/android-13/package.xml
Parsing /opt/android-sdk-linux/platforms/android-14/package.xml
Parsing /opt/android-sdk-linux/platforms/android-15/package.xml
Parsing /opt/android-sdk-linux/platforms/android-16/package.xml
Parsing /opt/android-sdk-linux/platforms/android-17/package.xml
Parsing /opt/android-sdk-linux/platforms/android-18/package.xml
Parsing /opt/android-sdk-linux/platforms/android-19/package.xml
Parsing /opt/android-sdk-linux/platforms/android-20/package.xml
Parsing /opt/android-sdk-linux/platforms/android-21/package.xml
Parsing /opt/android-sdk-linux/platforms/android-22/package.xml
Parsing /opt/android-sdk-linux/platforms/android-23/package.xml
Parsing /opt/android-sdk-linux/platforms/android-24/package.xml
Parsing /opt/android-sdk-linux/platforms/android-25/package.xml
Parsing /opt/android-sdk-linux/platforms/android-26/package.xml
Parsing /opt/android-sdk-linux/platforms/android-27/package.xml
Parsing /opt/android-sdk-linux/platforms/android-28/package.xml
Parsing /opt/android-sdk-linux/platforms/android-7/package.xml
Parsing /opt/android-sdk-linux/platforms/android-8/package.xml
Parsing /opt/android-sdk-linux/platforms/android-9/package.xml
Parsing /opt/android-sdk-linux/tools/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-15/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-16/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-17/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-18/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-19/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-21/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-22/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-23/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-24/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_gdk-google-19/package.xml
Parsing /opt/android-sdk-linux/build-tools/28.0.2/package.xml
Parsing /opt/android-sdk-linux/docs/package.xml
Parsing /opt/android-sdk-linux/extras/android/m2repository/package.xml
Parsing /opt/android-sdk-linux/extras/google/auto/package.xml
Parsing /opt/android-sdk-linux/extras/google/google_play_services/package.xml
Parsing /opt/android-sdk-linux/extras/google/instantapps/package.xml
Parsing /opt/android-sdk-linux/extras/google/m2repository/package.xml
Parsing /opt/android-sdk-linux/extras/google/market_apk_expansion/package.xml
Parsing /opt/android-sdk-linux/extras/google/market_licensing/package.xml
Parsing /opt/android-sdk-linux/extras/google/simulators/package.xml
Parsing /opt/android-sdk-linux/extras/google/webdriver/package.xml
Parsing /opt/android-sdk-linux/platform-tools/package.xml
Parsing /opt/android-sdk-linux/platforms/android-10/package.xml
Parsing /opt/android-sdk-linux/platforms/android-11/package.xml
Parsing /opt/android-sdk-linux/platforms/android-12/package.xml
Parsing /opt/android-sdk-linux/platforms/android-13/package.xml
Parsing /opt/android-sdk-linux/platforms/android-14/package.xml
Parsing /opt/android-sdk-linux/platforms/android-15/package.xml
Parsing /opt/android-sdk-linux/platforms/android-16/package.xml
Parsing /opt/android-sdk-linux/platforms/android-17/package.xml
Parsing /opt/android-sdk-linux/platforms/android-18/package.xml
Parsing /opt/android-sdk-linux/platforms/android-19/package.xml
Parsing /opt/android-sdk-linux/platforms/android-20/package.xml
Parsing /opt/android-sdk-linux/platforms/android-21/package.xml
Parsing /opt/android-sdk-linux/platforms/android-22/package.xml
Parsing /opt/android-sdk-linux/platforms/android-23/package.xml
Parsing /opt/android-sdk-linux/platforms/android-24/package.xml
Parsing /opt/android-sdk-linux/platforms/android-25/package.xml
Parsing /opt/android-sdk-linux/platforms/android-26/package.xml
Parsing /opt/android-sdk-linux/platforms/android-27/package.xml
Parsing /opt/android-sdk-linux/platforms/android-28/package.xml
Parsing /opt/android-sdk-linux/platforms/android-7/package.xml
Parsing /opt/android-sdk-linux/platforms/android-8/package.xml
Parsing /opt/android-sdk-linux/platforms/android-9/package.xml
Parsing /opt/android-sdk-linux/tools/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-15/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-16/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-17/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-18/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-19/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-21/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-22/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-23/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_apis-google-24/package.xml
Parsing /opt/android-sdk-linux/add-ons/addon-google_gdk-google-19/package.xml
Parsing /opt/android-sdk-linux/build-tools/28.0.2/package.xml
Parsing /opt/android-sdk-linux/docs/package.xml
Parsing /opt/android-sdk-linux/extras/android/m2repository/package.xml
Parsing /opt/android-sdk-linux/extras/google/auto/package.xml
Parsing /opt/android-sdk-linux/extras/google/google_play_services/package.xml
Parsing /opt/android-sdk-linux/extras/google/instantapps/package.xml
Parsing /opt/android-sdk-linux/extras/google/m2repository/package.xml
Parsing /opt/android-sdk-linux/extras/google/market_apk_expansion/package.xml
Parsing /opt/android-sdk-linux/extras/google/market_licensing/package.xml
Parsing /opt/android-sdk-linux/extras/google/simulators/package.xml
Parsing /opt/android-sdk-linux/extras/google/webdriver/package.xml
Parsing /opt/android-sdk-linux/platform-tools/package.xml
Parsing /opt/android-sdk-linux/platforms/android-10/package.xml
Parsing /opt/android-sdk-linux/platforms/android-11/package.xml
Parsing /opt/android-sdk-linux/platforms/android-12/package.xml
Parsing /opt/android-sdk-linux/platforms/android-13/package.xml
Parsing /opt/android-sdk-linux/platforms/android-14/package.xml
Parsing /opt/android-sdk-linux/platforms/android-15/package.xml
Parsing /opt/android-sdk-linux/platforms/android-16/package.xml
Parsing /opt/android-sdk-linux/platforms/android-17/package.xml
Parsing /opt/android-sdk-linux/platforms/android-18/package.xml
Parsing /opt/android-sdk-linux/platforms/android-19/package.xml
Parsing /opt/android-sdk-linux/platforms/android-20/package.xml
Parsing /opt/android-sdk-linux/platforms/android-21/package.xml
Parsing /opt/android-sdk-linux/platforms/android-22/package.xml
Parsing /opt/android-sdk-linux/platforms/android-23/package.xml
Parsing /opt/android-sdk-linux/platforms/android-24/package.xml
Parsing /opt/android-sdk-linux/platforms/android-25/package.xml
Parsing /opt/android-sdk-linux/platforms/android-26/package.xml
Parsing /opt/android-sdk-linux/platforms/android-27/package.xml
Parsing /opt/android-sdk-linux/platforms/android-28/package.xml
Parsing /opt/android-sdk-linux/platforms/android-7/package.xml
Parsing /opt/android-sdk-linux/platforms/android-8/package.xml
Parsing /opt/android-sdk-linux/platforms/android-9/package.xml
Parsing /opt/android-sdk-linux/tools/package.xml

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.

You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 25.0.1].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 14.957 secs
Stopped 0 compiler daemon(s).
root@gem-01:~/android#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants