Giter VIP home page Giter VIP logo

tor-android's Introduction

Tor Android

This is native Android TorService built on the Tor shared library built for Android. The included libtor.so binaries can also be used directly as a tor daemon. Binaries are available on Maven Central:

dependencies {
    implementation 'info.guardianproject:tor-android:0.4.8.7'
    implementation 'info.guardianproject:jtorctl:0.4.5.7'
}

Tor protects your privacy on the internet by hiding the connection between your Internet address and the services you use. We believe Tor is reasonably secure, but please ensure you read the instructions and configure it properly. Learn more at https://torproject.org/

Tor Frequently Asked Questions:

How to Build

Please see: https://raw.githubusercontent.com/guardianproject/tor-android/master/BUILD

This can be built reproducibly using the included Vagrant VM setup. That will run with either libvirt or VirtualBox. The provisioning is based on the "release" job in .gitlab-ci.yml.

tor-android's People

Contributors

aelmahmoudy avatar ahf avatar akshatagrawal05 avatar akwizgran avatar amoghbl1 avatar arrase avatar bitmold avatar dixidroid avatar eighthave avatar goapunk avatar grote avatar gsathya avatar holywend avatar ioerror avatar kensan avatar mrphs avatar mvdan avatar n8fr8 avatar peebs avatar plnech avatar postessive avatar runasand avatar shahn avatar skewedzeppelin avatar suppsandrob avatar syphyr avatar uniqx avatar unpublished avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tor-android's Issues

Crashes when opening tabs

A favourite Tor user here.
I want to inform that I have been having crashes when opening tabs
My guess is around 12-15 tabs opened and running in the background whould automatically crash the app. My devie is a samsung galaxt Tab A. And Best wishes from my side to the Tor project

Tor 0.5.3.* support

When using to build tor 0.3.5.3-alpha I get the error cp: cannot stat 'tor/src/or/tor': No such file or directory (full trace below)

It looks like tor did some code restructure between 0.3.4 and 0.3.5 and dropped the src/or directory entirely, so the Makefile is going to need some updating to support this

  CC       src/test/fuzz/src_test_fuzz_fuzz_vrs-fuzzing_common.o
  CC       src/test/fuzz/src_test_fuzz_fuzz_vrs-fuzz_vrs.o
  CCLD     src/test/fuzz/fuzz-vrs
make[1]: Leaving directory '/home/dan/src/projects/tor-reproducer/tmp/tor-android/external/tor'
touch tor-build-stamp
test -d bin || mkdir bin
cp tor/src/or/tor bin
cp: cannot stat 'tor/src/or/tor': No such file or directory
Makefile:273: recipe for target 'tor' failed
make: *** [tor] Error 1
make: Leaving directory '/home/dan/src/projects/tor-reproducer/tmp/tor-android/external'
Traceback (most recent call last):
  File "./../build-tor.py", line 278, in <module>
    main()
  File "./../build-tor.py", line 30, in main
    build_android()
  File "./../build-tor.py", line 149, in build_android
    build_android_arch('tor_arm_pie.zip')
  File "./../build-tor.py", line 169, in build_android_arch
    check_call(['make', '-C', 'external', 'clean', 'tor'], cwd=REPO_DIR)
  File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-C', 'external', 'clean', 'tor']' returned non-zero exit status 2.

Sampleapp crashes due to missing dependencies

I'm having difficulties to integrate tor-android from maven into my app.

For the sake of simplicity I played with the sampletorapp to check if the issue can be reproduced and replaced implementation project(':tor-android-binary') with implementation 'info.guardianproject:tor-android:0.4.5.7' in build.gradle.
The app crashes with the following output:

java.lang.NoClassDefFoundError: Failed resolution of: Lnet/freehaven/tor/control/RawEventListener;
        at java.lang.Class.newInstance(Native Method)
        at android.app.AppComponentFactory.instantiateService(AppComponentFactory.java:129)
        at android.support.v4.app.CoreComponentFactory.instantiateService(CoreComponentFactory.java:68)
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4183)
        at android.app.ActivityThread.access$1500(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "net.freehaven.tor.control.RawEventListener" on path: DexPathList[[zip file "/data/app/~~PnwwXCcitagMUetlwWWkcA==/org.torproject.android.sample-2yWMWQCRC-zPckCJvGCRMQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~PnwwXCcitagMUetlwWWkcA==/org.torproject.android.sample-2yWMWQCRC-zPckCJvGCRMQ==/lib/x86, /data/app/~~PnwwXCcitagMUetlwWWkcA==/org.torproject.android.sample-2yWMWQCRC-zPckCJvGCRMQ==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

So it seems not all dependencies are shipped with the artifact on maven. If this is intended, then it would be great to adapt the documentation a little bit.

WEBM mime type error.

Hello i need to know does Tor (mobile) support WEBM format? If yes, then i want to know how to fix various "MIME type error" ("No video with supported format or MIME type found")
PS: I tried disabling NoScript. Error wasn't fixed.
PPS: I accidentally posted it on Orbot issues section, what im certainly sorry about.

Tor 0.4.7.10

There was a release of Tor: https://forum.torproject.net/t/urgent-stable-release-0-4-5-14-0-4-6-12-and-0-4-7-10/4270
https://gitlab.torproject.org/tpo/core/tor/-/raw/release-0.4.7/ReleaseNotes

The geoip issue fixed in 0.4.7.10 should be fine in Orbot because the IPFire database hasn't been updated since May: https://github.com/guardianproject/orbot/commits/master/libs/geoip.jar

But the update to 0.4.7.9 seems important on reducing the network load.

Also

Add a check for an integer underflow condition that might happen in cases where the system clock is stopped [...]

The "clock jump forward" message after doze may mean that bug is encountered too.

NullPointerException when accessing TorControlConnection too early

When a user of TorService starts and binds to the service, then (as documented) tries to use the TorControlConnection, it can happen that it hasn't been assigned and a NullPointerException is thrown. This is because the TorControlConnection gets only assigned in another thread after doing some extra work.

How is a user of the library supposed to know when the control connection becomes available? Are they expected to register a broadcast receiver and wait for the TorService.STATUS_ON event? That would be quite a cumbersome, but possible solution. If it is that, it should at least get documented.

crashes on Android 12 (via Orbot testing)

This happens after multiple starts/stops

2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: Build fingerprint: 'google/sunfish/sunfish:12/SQ1A.220105.002/7961164:user/release-keys'
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: Revision: 'MP1.0'
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: ABI: 'arm64'
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: Timestamp: 2022-01-25 21:15:50.697684507-0500
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: Process uptime: 0s
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: Cmdline: org.torproject.android
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: pid: 21801, tid: 21862, name: tor >>> org.torproject.android <<<
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: uid: 10455
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x0 0000000000000000 x1 0000000000005566 x2 0000000000000006 x3 000000725d05ce00
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x4 000000000000003a x5 000000000000003a x6 000000000000003a x7 0000000000000020
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x8 00000000000000f0 x9 7139403ff8c025c7 x10 0000000000000000 x11 ffffff80fffffbdf
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x12 0000000000000001 x13 0000000000000005 x14 0000000000000010 x15 0000000000000000
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x16 000000750a5b4050 x17 000000750a590eb0 x18 00000071ba428000 x19 0000000000005529
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x20 0000000000005566 x21 00000000ffffffff x22 0000000000000000 x23 b4000073e7725390
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x24 000000725d05e000 x25 0000000000000001 x26 0000000000000093 x27 000000725d05e000
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: x28 000000725d05d0d0 x29 000000725d05ce80
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: lr 000000750a543ba0 sp 000000725d05cde0 pc 000000750a543bcc pst 0000000000000000
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: backtrace:
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #00 pc 000000000004fbcc /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: ba489d4985c0cf173209da67405662f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #1 pc 00000000001729d4 /data/app/~~FGLHuPr8bpVsyssLk0uiTw==/org.torproject.android-iR0a20u8rDZP-64dyZpQaw==/lib/arm64/libtor.so (tor_raw_abort_+12)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #2 pc 000000000017bf58 /data/app/~~FGLHuPr8bpVsyssLk0uiTw==/org.torproject.android-iR0a20u8rDZP-64dyZpQaw==/lib/arm64/libtor.so (tor_abort_+12)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #3 pc 0000000000108448 /data/app/~~FGLHuPr8bpVsyssLk0uiTw==/org.torproject.android-iR0a20u8rDZP-64dyZpQaw==/lib/arm64/libtor.so (pubsub_install+156)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #4 pc 0000000000108558 /data/app/~~FGLHuPr8bpVsyssLk0uiTw==/org.torproject.android-iR0a20u8rDZP-64dyZpQaw==/lib/arm64/libtor.so (tor_run_main+152)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #5 pc 0000000000106a40 /data/app/~~FGLHuPr8bpVsyssLk0uiTw==/org.torproject.android-iR0a20u8rDZP-64dyZpQaw==/lib/arm64/libtor.so (Java_org_torproject_jni_TorService_runMain+36)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #6 pc 00000000002d7644 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #7 pc 00000000002cdd64 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #8 pc 00000000002f23d0 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+312) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #9 pc 00000000003ff868 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+820) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #10 pc 00000000003fe764 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1580) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #11 pc 00000000002c8514 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.202 21865-21865/? A/DEBUG: #12 pc 0000000000460988 /data/data/org.torproject.android/code_cache/.overlay/base.apk/classes.dex (org.torproject.jni.TorService.access$1100+0)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #13 pc 000000000027d748 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.13853912933990942413)+644) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #14 pc 000000000027c8f0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1176) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #15 pc 00000000002d7778 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #16 pc 0000000000209188 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #17 pc 0000000000460636 /data/data/org.torproject.android/code_cache/.overlay/base.apk/classes.dex (org.torproject.jni.TorService$3.run+582)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #18 pc 00000000002cdd64 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #19 pc 0000000000317fb0 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #20 pc 00000000003cc480 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValuesart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #21 pc 000000000045eff0 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: 23ca6f22eac639e14a961f5b93a456f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #22 pc 00000000000b1910 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: ba489d4985c0cf173209da67405662f9)
2022-01-25 21:15:51.203 21865-21865/? A/DEBUG: #23 pc 00000000000513f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ba489d4985c0cf173209da67405662f9)

HTTP protocol issue

It seems nothing starting with http:// works currently: I get a This is an HTTP CONNECT tunnel, not a full HTTP Proxy when using localhost:8118 proxy and This is a SOCKS Proxy, Not An HTTP Proxy when using localhost:9050 proxy.

This is especially troublesome when trying to access onion addresses as they mostly use http://.

Some examples: https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion works since it's HTTPS while http://darkfailenbsdla5mal2mxn2uz66od5vtzd5qozslagrfzachha3f3id.onion does not.

null pointer native crash

Pixel 4A with Android 12

2021-05-25 08:56:56.304 12029-12486/? A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20 in tid 12486 (Thread-5), pid 12029 (project.android)
2021-05-25 08:56:56.307 590-590/? E/SELinux: avc: denied { find } for pid=3919 uid=10216 name=tethering scontext=u:r:secure_ui_service_app:s0:c216,c256,c512,c768 tcontext=u:object_r:tethering_service:s0 tclass=service_manager permissive=0
2021-05-25 08:56:56.326 12496-12498/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.326 12503-12505/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.377 12496-12498/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.377 12503-12505/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.386 12523-12523/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-05-25 08:56:56.386 12523-12523/? A/DEBUG: Build fingerprint: 'google/sunfish/sunfish:11/RQ2A.210505.002/7246365:user/release-keys'
2021-05-25 08:56:56.386 12523-12523/? A/DEBUG: Revision: 'MP1.0'
2021-05-25 08:56:56.386 12523-12523/? A/DEBUG: ABI: 'arm64'
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: Timestamp: 2021-05-25 08:56:56-0400
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: pid: 12029, tid: 12486, name: Thread-5 >>> org.torproject.android <<<
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: uid: 10291
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: Cause: null pointer dereference
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x0 0000007bb3a79590 x1 0000000000000005 x2 0000007bb3a6df88 x3 00000000000000fa
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x4 0000000000000000 x5 0000000000000008 x6 000000ff01000000 x7 000002ff00000004
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x8 c85f574385a6316d x9 c85f574385a6316d x10 00000000000003e8 x11 0000000000e979a4
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x12 000000000000001c x13 000000446a1693b7 x14 0002e97c3ca33cd6 x15 000000003a182111
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x16 0000007bb3a76bc8 x17 0000007ee30e6614 x18 0000007ba6e60000 x19 0000007bb3a79590
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x20 0000007bb3a795a0 x21 0000000000000000 x22 0000007bb3a795d0 x23 0000007bb3a795a8
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x24 0000000000000000 x25 0000007bb3a6df36 x26 0000000000000001 x27 0000007bb3a795b0
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: x28 0000007bb3a6dea3 x29 0000007c41f4ade0
2021-05-25 08:56:56.387 12523-12523/? A/DEBUG: lr 0000007bb3a51824 sp 0000007c41f4adb0 pc 0000007bb3a521c4 pst 0000000060000000
2021-05-25 08:56:56.391 12029-12486/? A/libc: failed to wait for crash_dump helper: No child processes
2021-05-25 08:56:56.427 12503-12505/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.427 12496-12498/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.458 590-590/? E/SELinux: avc: denied { find } for pid=12119 uid=10224 name=tethering scontext=u:r:permissioncontroller_app:s0:c224,c256,c512,c768 tcontext=u:object_r:tethering_service:s0 tclass=service_manager permissive=0
2021-05-25 08:56:56.477 12503-12505/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.477 12496-12498/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.508 590-590/? E/SELinux: avc: denied { find } for pid=3919 uid=10216 name=tethering scontext=u:r:secure_ui_service_app:s0:c216,c256,c512,c768 tcontext=u:object_r:tethering_service:s0 tclass=service_manager permissive=0
2021-05-25 08:56:56.527 12503-12505/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.527 12496-12498/? E/pdnsd: tcp accept failed: Invalid argument
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: backtrace:
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #00 pc 000000000000b1c4 /data/app/~~fsyo3khQFi_gtmXWAliQMw==/org.torproject.android-go9EpdZaiN3v_oQIB3E_5w==/lib/arm64/libtun2socks.so (BuildId: b3c5cf844f30d1474254e39ea8e6ab73bac7c3e0)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #1 pc 000000000000a820 /data/app/~~fsyo3khQFi_gtmXWAliQMw==/org.torproject.android-go9EpdZaiN3v_oQIB3E_5w==/lib/arm64/libtun2socks.so (BReactor_Exec+980) (BuildId: b3c5cf844f30d1474254e39ea8e6ab73bac7c3e0)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #2 pc 00000000000204c4 /data/app/~~fsyo3khQFi_gtmXWAliQMw==/org.torproject.android-go9EpdZaiN3v_oQIB3E_5w==/lib/arm64/libtun2socks.so (Java_org_torproject_android_service_vpn_Tun2Socks_runTun2Socks+2888) (BuildId: b3c5cf844f30d1474254e39ea8e6ab73bac7c3e0)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #3 pc 000000000013ced4 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #4 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #5 pc 00000000001a8a94 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #6 pc 000000000031830c /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #7 pc 000000000030f6f8 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+696) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #8 pc 0000000000682688 /apex/com.android.art/lib64/libart.so (MterpInvokeStaticRange+412) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #9 pc 000000000012dc94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static_range+20) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #10 pc 00000000003bf3ea [anon:dalvik-classes.dex extracted in memory from /data/app/~~fsyo3khQFi_gtmXWAliQMw==/org.torproject.android-go9EpdZaiN3v_oQIB3E_5w==/base.apk] (org.torproject.android.service.vpn.Tun2Socks.Start+66)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #11 pc 0000000000682828 /apex/com.android.art/lib64/libart.so (MterpInvokeStaticRange+828) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #12 pc 000000000012dc94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static_range+20) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #13 pc 00000000003be528 [anon:dalvik-classes.dex extracted in memory from /data/app/~~fsyo3khQFi_gtmXWAliQMw==/org.torproject.android-go9EpdZaiN3v_oQIB3E_5w==/base.apk] (org.torproject.android.service.vpn.OrbotVpnManager$2.run+520)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #14 pc 0000000000305c34 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6432830707213048161)+268) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #15 pc 000000000066b1d8 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #16 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #17 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #18 pc 00000000001a8a78 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #19 pc 0000000000554c48 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValuesart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #20 pc 00000000005a3fe4 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: 77b7b03eb396b55618ca056e610f9c70)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #21 pc 00000000000afd4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 49090ae59e6ae37f8beae53c551820ad)
2021-05-25 08:56:56.694 12523-12523/? A/DEBUG: #22 pc 0000000000050288 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 49090ae59e6ae37f8beae53c551820ad)

Proxy server refused connection

When opening a link before connecting to tor connection fails and Proxy server refused connection error shows.

When opening tor with "search the web" widget the url bar shows, and when something entered after few seconds the same error appears.

The tor widget preview (before drag and dropping into your launcher has the firefox icon) when the widget is placed onto homescreen the icon turns into the tor icon

Suggested fixes for the proxy server error: check if the proxy is connected to tor or if orbot is running and if not show the commect to tor screen

Widget preview

Screen after opening tor with the widget

some timestamps are in javadoc and bundle.jar break reproducibility

The last thing breaking reproducible builds for the entire set of artifacts that are uploaded to Maven Central are timestamps in:

  • Javadoc HTML header
  • Javadoc search index JAR metadata
  • bundle.jar metadata
 $ diffoscope bundle.jar ../tor-android_release_0.4.6.8_1b4639dcb48b0f2ee5524d442cb0b8c205f02af8/tor-android-binary/build/outputs/aar/bundle.jar 
--- bundle.jar
+++ ../tor-android_release_0.4.6.8_1b4639dcb48b0f2ee5524d442cb0b8c205f02af8/tor-android-binary/build/outputs/aar/bundle.jar
├── zipinfo {}
│ @@ -1,9 +1,9 @@
│ -Zip file size: 11803786 bytes, number of entries: 7
│ --rw----     2.0 fat        0 bX defN 21-Dec-17 09:46 META-INF/
│ --rw----     2.0 fat       55 bl defN 21-Dec-17 09:46 META-INF/MANIFEST.MF
│ --rw----     2.0 fat   402773 bl defN 21-Dec-17 09:46 tor-android-0.4.6.8-javadoc.jar
│ --rw----     2.0 fat     6055 bl defN 21-Dec-17 09:46 tor-android-0.4.6.8-sources.jar
│ --rw----     2.0 fat 11441091 bl defN 21-Dec-17 09:45 tor-android-0.4.6.8.aar
│ --rw----     2.0 fat      882 bl defN 21-Dec-17 09:46 tor-android-0.4.6.8.buildinfo
│ --rw----     2.0 fat     2095 bl defN 21-Dec-17 09:46 tor-android-0.4.6.8.pom
│ -7 files, 11852951 bytes uncompressed, 11802780 bytes compressed:  0.4%
│ +Zip file size: 11803783 bytes, number of entries: 7
│ +-rw----     2.0 fat        0 bX defN 21-Dec-17 11:10 META-INF/
│ +-rw----     2.0 fat       55 bl defN 21-Dec-17 11:10 META-INF/MANIFEST.MF
│ +-rw----     2.0 fat   402771 bl defN 21-Dec-17 11:10 tor-android-0.4.6.8-javadoc.jar
│ +-rw----     2.0 fat     6055 bl defN 21-Dec-17 11:10 tor-android-0.4.6.8-sources.jar
│ +-rw----     2.0 fat 11441091 bl defN 21-Dec-17 11:10 tor-android-0.4.6.8.aar
│ +-rw----     2.0 fat      882 bl defN 21-Dec-17 11:10 tor-android-0.4.6.8.buildinfo
│ +-rw----     2.0 fat     2095 bl defN 21-Dec-17 11:10 tor-android-0.4.6.8.pom
│ +7 files, 11852949 bytes uncompressed, 11802777 bytes compressed:  0.4%
├── tor-android-0.4.6.8-javadoc.jar
│ ├── zipinfo {}
│ │ @@ -1,8 +1,8 @@
│ │ -Zip file size: 402773 bytes, number of entries: 64
│ │ +Zip file size: 402771 bytes, number of entries: 64
│ │  drwxr-xr-x  2.0 unx        0 b- defN 80-Feb-01 00:00 META-INF/
│ │  -rw-r--r--  2.0 unx       25 b- defN 80-Feb-01 00:00 META-INF/MANIFEST.MF
│ │  -rw-r--r--  2.0 unx     4821 b- defN 80-Feb-01 00:00 allclasses-index.html
│ │  -rw-r--r--  2.0 unx     1081 b- defN 80-Feb-01 00:00 allclasses.html
│ │  -rw-r--r--  2.0 unx     4762 b- defN 80-Feb-01 00:00 allpackages-index.html
│ │  -rw-r--r--  2.0 unx     8819 b- defN 80-Feb-01 00:00 constant-values.html
│ │  -rw-r--r--  2.0 unx     4252 b- defN 80-Feb-01 00:00 deprecated-list.html
│ │ @@ -59,8 +59,8 @@
│ │  -rw-r--r--  2.0 unx    11271 b- defN 80-Feb-01 00:00 org/torproject/jni/TorService.LocalBinder.html
│ │  -rw-r--r--  2.0 unx    35201 b- defN 80-Feb-01 00:00 org/torproject/jni/TorService.html
│ │  -rw-r--r--  2.0 unx     4911 b- defN 80-Feb-01 00:00 org/torproject/jni/package-summary.html
│ │  -rw-r--r--  2.0 unx     5211 b- defN 80-Feb-01 00:00 org/torproject/jni/package-tree.html
│ │  drwxr-xr-x  2.0 unx        0 b- defN 80-Feb-01 00:00 resources/
│ │  -rw-r--r--  2.0 unx      499 b- defN 80-Feb-01 00:00 resources/glass.png
│ │  -rw-r--r--  2.0 unx      394 b- defN 80-Feb-01 00:00 resources/x.png
│ │ -64 files, 1381552 bytes uncompressed, 394607 bytes compressed:  71.4%
│ │ +64 files, 1381552 bytes uncompressed, 394605 bytes compressed:  71.4%
│ ├── index.html
│ │ @@ -1,12 +1,12 @@
│ │  <!DOCTYPE HTML>
│ │  <!-- NewPage -->
│ │  <html lang="en">
│ │  <head>
│ │ -<!-- Generated by javadoc (11.0.12) on Fri Dec 17 09:46:04 UTC 2021 -->
│ │ +<!-- Generated by javadoc (11.0.12) on Fri Dec 17 11:10:28 UTC 2021 -->
│ │  <title>tor-android-binary API</title>
│ │  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
│ │  <script type="text/javascript">window.location.replace('org/torproject/jni/package-summary.html')</script>
│ │  <noscript>
│ │  <meta http-equiv="Refresh" content="0;org/torproject/jni/package-summary.html">
│ │  </noscript>
│ │  <link rel="canonical" href="org/torproject/jni/package-summary.html">
│ ├── member-search-index.zip
│ │┄ Archive contents identical but files differ, possibly due to different compression levels. Falling back to binary comparison.
│ │ ├── zipinfo {}
│ │ │ @@ -1,3 +1,3 @@
│ │ │  Zip file size: 517 bytes, number of entries: 1
│ │ │ --rw----     2.0 fat     1986 bl defN 21-Dec-17 09:46 member-search-index.json
│ │ │ +-rw----     2.0 fat     1986 bl defN 21-Dec-17 11:10 member-search-index.json
│ │ │  1 file, 1986 bytes uncompressed, 355 bytes compressed:  82.1%
│ │ ├── member-search-index.zip
│ │ │ @@ -1,8 +1,8 @@
│ │ │ -00000000: 504b 0304 1400 0808 0800 c24d 9153 0000  PK.........M.S..
│ │ │ +00000000: 504b 0304 1400 0808 0800 4e59 9153 0000  PK........NY.S..
│ │ │  00000010: 0000 0000 0000 0000 0000 1800 0000 6d65  ..............me
│ │ │  00000020: 6d62 6572 2d73 6561 7263 682d 696e 6465  mber-search-inde
│ │ │  00000030: 782e 6a73 6f6e ad55 4d4b c340 10fd 2b12  x.json.UMK.@..+.
│ │ │  00000040: 1022 845c 7af3 16d3 b416 3509 c92a 8248  .".\z.....5..*.H
│ │ │  00000050: 58d2 6ddc 9ace 94cd b428 e27f 77d3 ef4a  X.m......(..w..J
│ │ │  00000060: 3d38 e921 09bc 99f7 e62b bbf3 f2e5 cc9d  =8.!.....+......
│ │ │  00000070: 6b07 4de5 139a b9c1 a92a c99f 8276 3ca7  k.M......*...v<.
│ │ │ @@ -21,13 +21,13 @@
│ │ │  00000140: ef56 6cdd 3871 42a3 24f1 fe20 84be 6aec  .Vl.8qB.$.. ..j.
│ │ │  00000150: f03f 99ec 9ca4 a110 6733 b92b d5bb d09b  .?......g3.+....
│ │ │  00000160: d761 d147 8ea7 8bf7 f4fa e164 d26c 8f01  .a.G.......d.l..
│ │ │  00000170: 83bb bef1 8a64 30e8 408e f9dc d5d2 18c5  .....d0.@.......
│ │ │  00000180: c32e 0a49 9af2 1444 c062 ed80 f39d 97a7  ...I...D.b......
│ │ │  00000190: 28cb db25 b8de 5eaf 3f50 4b07 08ba edbf  (..%..^.?PK.....
│ │ │  000001a0: 8a63 0100 00c2 0700 0050 4b01 0214 0014  .c.......PK.....
│ │ │ -000001b0: 0008 0808 00c2 4d91 53ba edbf 8a63 0100  ......M.S....c..
│ │ │ +000001b0: 0008 0808 004e 5991 53ba edbf 8a63 0100  .....NY.S....c..
│ │ │  000001c0: 00c2 0700 0018 0000 0000 0000 0000 0000  ................
│ │ │  000001d0: 0000 0000 0000 006d 656d 6265 722d 7365  .......member-se
│ │ │  000001e0: 6172 6368 2d69 6e64 6578 2e6a 736f 6e50  arch-index.jsonP
│ │ │  000001f0: 4b05 0600 0000 0001 0001 0046 0000 00a9  K..........F....
│ │ │  00000200: 0100 0000 00                             .....
│ ├── package-search-index.zip
│ │┄ Archive contents identical but files differ, possibly due to different compression levels. Falling back to binary comparison.
│ │ ├── zipinfo {}
│ │ │ @@ -1,3 +1,3 @@
│ │ │  Zip file size: 234 bytes, number of entries: 1
│ │ │ --rw----     2.0 fat       80 bl defN 21-Dec-17 09:46 package-search-index.json
│ │ │ +-rw----     2.0 fat       80 bl defN 21-Dec-17 11:10 package-search-index.json
│ │ │  1 file, 80 bytes uncompressed, 70 bytes compressed:  12.5%
│ │ ├── package-search-index.zip
│ │ │ @@ -1,15 +1,15 @@
│ │ │ -00000000: 504b 0304 1400 0808 0800 c24d 9153 0000  PK.........M.S..
│ │ │ +00000000: 504b 0304 1400 0808 0800 4e59 9153 0000  PK........NY.S..
│ │ │  00000010: 0000 0000 0000 0000 0000 1900 0000 7061  ..............pa
│ │ │  00000020: 636b 6167 652d 7365 6172 6368 2d69 6e64  ckage-search-ind
│ │ │  00000030: 6578 2e6a 736f 6e8b ae56 ca51 b252 72cc  ex.json..V.Q.Rr.
│ │ │  00000040: c951 0848 4cce 4e4c 4f2d 56d2 512a 2d02  .Q.HL.NLO-V.Q*-.
│ │ │  00000050: 0926 e6e4 1440 c574 33f3 5252 2bf4 324a  .&[email protected]+.2J
│ │ │  00000060: 7273 946a 7520 7af2 8bd2 f54a f28b 0a8a  rs.ju z....J....
│ │ │  00000070: f2b3 5293 4bf4 b2f2 3295 6a63 0150 4b07  ..R.K...2.jc.PK.
│ │ │  00000080: 089d 2404 2046 0000 0050 0000 0050 4b01  ..$. F...P...PK.
│ │ │ -00000090: 0214 0014 0008 0808 00c2 4d91 539d 2404  ..........M.S.$.
│ │ │ +00000090: 0214 0014 0008 0808 004e 5991 539d 2404  .........NY.S.$.
│ │ │  000000a0: 2046 0000 0050 0000 0019 0000 0000 0000   F...P..........
│ │ │  000000b0: 0000 0000 0000 0000 0000 0070 6163 6b61  ...........packa
│ │ │  000000c0: 6765 2d73 6561 7263 682d 696e 6465 782e  ge-search-index.
│ │ │  000000d0: 6a73 6f6e 504b 0506 0000 0000 0100 0100  jsonPK..........
│ │ │  000000e0: 4700 0000 8d00 0000 0000                 G.........
│ ├── type-search-index.zip
│ │┄ Archive contents identical but files differ, possibly due to different compression levels. Falling back to binary comparison.
│ │ ├── zipinfo {}
│ │ │ @@ -1,3 +1,3 @@
│ │ │  Zip file size: 256 bytes, number of entries: 1
│ │ │ --rw----     2.0 fat      151 bl defN 21-Dec-17 09:46 type-search-index.json
│ │ │ +-rw----     2.0 fat      151 bl defN 21-Dec-17 11:10 type-search-index.json
│ │ │  1 file, 151 bytes uncompressed, 98 bytes compressed:  35.1%
│ │ ├── type-search-index.zip
│ │ │ @@ -1,16 +1,16 @@
│ │ │ -00000000: 504b 0304 1400 0808 0800 c24d 9153 0000  PK.........M.S..
│ │ │ +00000000: 504b 0304 1400 0808 0800 4e59 9153 0000  PK........NY.S..
│ │ │  00000010: 0000 0000 0000 0000 0000 1600 0000 7479  ..............ty
│ │ │  00000020: 7065 2d73 6561 7263 682d 696e 6465 782e  pe-search-index.
│ │ │  00000030: 6a73 6f6e 95cb 410e 4030 1040 d1ab c8ac  json..A.@0.@....
│ │ │  00000040: e901 ecb0 b563 2716 4d4d a88c 8e4c 4b24  .....c'.MM...LK$
│ │ │  00000050: d2bb d338 81ed ff79 c30d 0425 5444 5943  ...8...y...%TDYC
│ │ │  00000060: da7b f490 c321 a969 22f3 a5c2 ba09 2fb5  .{...!.i"...../.
│ │ │  00000070: 848d 20e6 37ec ef65 9955 60d9 8557 3441  .. .7..e.U`..W4A
│ │ │  00000080: adce be30 b19e a543 39ad 41d5 b2d1 5427  ...0...C9.A...T'
│ │ │  00000090: 2c7f 1cc4 f101 504b 0708 2458 e4e8 6200  ,.....PK..$X..b.
│ │ │  000000a0: 0000 9700 0000 504b 0102 1400 1400 0808  ......PK........
│ │ │ -000000b0: 0800 c24d 9153 2458 e4e8 6200 0000 9700  ...M.S$X..b.....
│ │ │ +000000b0: 0800 4e59 9153 2458 e4e8 6200 0000 9700  ..NY.S$X..b.....
│ │ │  000000c0: 0000 1600 0000 0000 0000 0000 0000 0000  ................
│ │ │  000000d0: 0000 0000 7479 7065 2d73 6561 7263 682d  ....type-search-
│ │ │  000000e0: 696e 6465 782e 6a73 6f6e 504b 0506 0000  index.jsonPK....
│ │ │  000000f0: 0000 0100 0100 4400 0000 a600 0000 0000  ......D.........

commits missing from tor-android-0.4.7.10 tag

The latest tag for tor-android-0.4.7.10 does not seem to include any of the extra changes that are always applied to each tag.

879713c916 (4 months ago) (2 years, 10 months ago) add TorService.torFreeAll() method to clean up between restarts (Hans-Christoph Steiner)
c612f3cc22 (4 months ago) (10 months ago) Temporary workaround for a double close crash with fdsan. (Torsten Grote)
91ea47652c (4 months ago) (12 months ago) On Android, get_data_directory() should not use LOCALSTATEDIR (Hans-Christoph Steiner)
e33654d1ca (4 months ago) (12 months ago) do not use SHARE_DATADIR on Android (Hans-Christoph Steiner)
e74e5008f1 (4 months ago) (1 year, 5 months ago) gitlab-ci: add complete Android build and test run in emulator (Hans-Christoph Steiner)
ec3829f281 (4 months ago) (2 years, 10 months ago) gitlab-ci: add cppcheck job (Hans-Christoph Steiner)
fcd7e42559 (4 months ago) (3 years ago) hack to expose the ControlSocket UNIX socket in Java space (Hans-Christoph Steiner)
148e41c1cf (4 months ago) (2 years, 11 months ago) DO NOT MERGE comment out tests that fail on Android (Hans-Christoph Steiner)
a588dec23c (4 months ago) (2 years, 11 months ago) DO NOT MERGE tor's build system strips out TorService, unless its in an existing file (Hans-Christoph Steiner)
a07d344bcd (4 months ago) (2 years, 10 months ago) DO NOT MERGE disable check for strdup until JNI impl fixed (Hans-Christoph Steiner)
0c3fd81d3d (4 months ago) (3 years, 1 month ago) add Java Native Interface (JNI) API to support Android (Hans-Christoph Steiner)
05bb7f65ef (4 months ago) (2 years, 11 months ago) Override log_err/log_warn in connection, stdout/stderr don't work (Hans-Christoph Steiner)
0224529fa1 (4 months ago) (3 years ago) with --enable-android, fail with error if no host or cross-compiling (Hans-Christoph Steiner)
45f6783ecf (4 months ago) (3 years, 1 month ago) move Android build setup into --enable-android flag (Hans-Christoph Steiner)

Incorrect Shutdown Status Broadcasts

This doesn't break Orbot, and I think most integrating apps are merely concerned with starting Orbot + knowing it's running. But if you send an ACTION_STOP to TorService with tor-android 0.4.6.10 apps receiving it's status broadcasts will see:

  1. OFF
  2. STOPPING

and not the reverse. When this bug is fixed, Orbot can have a more elegant shutdown sequence.

Destroying TorService a second time causes crash

While how to stop TorService is not documented, one usually stops a bound service simply by unbinding from it.

This works fine the first time. But if I need to start and bind to TorService a second time, I reproducibly get a hard crash in libc when unbinding again:

    --------- beginning of crash
A/libc: fdsan: attempted to close file descriptor 91, expected to be unowned, actually owned by unique_fd 0x7b7962c254
A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 17309 (tor), pid 17187 (onshare.android)
2021-11-25 15:47:57.180 17543-17543/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
2021-11-25 15:47:57.181 711-711/? I/tombstoned: received crash request for pid 17527
2021-11-25 15:47:57.183 17543-17543/? I/crash_dump64: performing dump of process 17436 (target tid = 17527)

Removing of trackers: privacy issue

Currently it seems there is an implementation of 3 trackers

  • Adjust
  • Google Firebase Analytics
  • Mozilla Telemetry

See:
https://reports.exodus-privacy.eu.org/de/reports/268768
For app:
https://play.google.com/store/apps/details?id=org.torproject.torbrowser

Looking to the history report,
https://reports.exodus-privacy.eu.org/de/reports/search/org.torproject.torbrowser
it seems most of them were added during period of
August 2020 v68.12.0 (https://reports.exodus-privacy.eu.org/de/reports/144884)
and
November 2020 v10.0.3 (82.1.1-Release) (https://reports.exodus-privacy.eu.org/de/reports/152895)

Is there any chance to reduced these items?

Missing PKG_CONFIG_PATH

I just saw that PKG_CONFIG_PATH="$(EXTERNAL_ROOT)/lib/pkgconfig" is missing in the call to Tor's configure for lzma and zstd to be picked up, looks like I forgot that, sorry! Apart form that Tor browser doesn't seem to use lzma or zstd, so maybe we just follow their example and remove it for now. Thish might make it easier to compile it against the latest NDK as well.

Can't build on Ubuntu/Debian with NDK 16

Hi,

thanks for your work on orbot/tor-android!

Tested on Ubuntu 16.04.3 LTS (4.4.0-103-generic x86_x64) and Debian 9 (4.9.0-4-amd64 x86_64)
Android Studio Version: 3.0.1
Android NDK Version: 16.1.4479499
Android SDK Platform Tools Version: 27.0.0
Android SDK Tools: 26.1.1
Installed APIs: 16, 23, 27
Installed packages: ant autotools-dev automake autogen autoconf libtool gettext-base autopoint

When running APP_ABI=armeabi make -C external or APP_ABI=x86 make -C external compiling of xz fails with the error

ISO C99... unsupported
configure: error: No C99 compiler was found.

When removing lzma (xz) it will fail while compiling zstd with the error

In file included from common/entropy_common.c:38:0:
common/mem.h:22:37: fatal error: string.h: No such file or directory
 #include <string.h>     /* memcpy */

When removing zstd it will fail while compiling openssl with the error

In file included from cryptlib.c:117:0:
cryptlib.h:62:21: fatal error: stdlib.h: No such file or directory
 # include <stdlib.h>

I was able to get xz, zstd and openssl to compile correctly by making my own NDK toolchains

$ANDROID_NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=android-16 --install-dir=./external/android-16-arch-arm-toolchain --arch=arm
$ANDROID_NDK_HOME/build/tools/make-standalone-toolchain.sh --platform=android-16 --install-dir=./external/android-16-arch-x86-toolchain --arch=x86

and instructing the Makefile to use them by replacing

NDK_SYSROOT=[..]

with

NDK_TOOLCHAIN_CUSTOM=$(EXTERNAL_ROOT)/android-$(NDK_PLATFORM_LEVEL)-arch-$(NDK_ABI)-toolchain
NDK_SYSROOT=$(NDK_TOOLCHAIN_CUSTOM)/sysroot

and

NDK_TOOLCHAIN_BASE=[..]

with

NDK_TOOLCHAIN_BASE=$(NDK_TOOLCHAIN_CUSTOM)

However then configuring of Tor fails with the error

checking for libevent directory... configure: WARNING: Could not find a linkable libevent.  If you have it installed somewhere unusual, you can specify an explicit path using --with-libevent-dir

The external/lib directory exists and contains the libevent.a file. I'm not sure how to debug this further so any help would be appreciated. If I can provide more informations please let me know.

Best regards

some build paths are still included in the binaries

When build paths are included in the binaries, reproducible builds requires a specific setup where all of the paths are the same. We do not need to have any build paths in the binaries, they should be removed whenever possible. Here are some example fixes:

This example diffoscope output shows a number of build paths:
build-paths-example-diff.zip

These are the build paths that I know that still need fixing:

Android NDK

Screenshot from 2021-06-23 11-05-34

tor default config paths

Screenshot from 2021-06-23 11-10-44

Update Tor

Any plans to update to the latest Tor version?

Where is the JNI's implementation?

I have been browsing the codebase the last few weeks to see how you build tor and I have been seeing that the tor source code used for building is pretty old (last update was +3 years ago?!).

But as the same time I see commits says like "upgrade to" commit once every while , last one was by @eighthave.
It seems insane cause its just the same code, isn't?

Also I was expecting to find to find some jni implemention in tor source code, for example, for run_main like jni_com_example_tor_main but I couldn't find it either...

So, where can I find the JNI implementations?
Thanks in advance!

Tor Executable Resolver

It would be nice to have a resolver that will determine the install location of the tor executable, prior to the setup and installation. This is useful because it would allow other libraries to initialize based on that configuration info, prior to needing to do a tor resource install.

potential Nullpointer Exception when calling getPortFromGetInfo

This line potentially returns null

, which subsequently results in a NullPointerException.

It could be caught, e.g. in line

} catch (IOException | ArrayIndexOutOfBoundsException | InterruptedException e) {

The fix has been tested so far in this project: https://0xacab.org/leap/android_libs/tor-android/-/blob/main/tor-android-binary/src/main/java/org/torproject/jni/TorService.java#L381

crash on Android TV armeabi-v7a

07-14 09:29:46.105 6003 6121 E AndroidRuntime: FATAL EXCEPTION: tor
07-14 09:29:46.105 6003 6121 E AndroidRuntime: Process: org.torproject.android.tv, PID: 6003
07-14 09:29:46.105 6003 6121 E AndroidRuntime: java.lang.NoSuchFieldError: no "J" field "torConfiguration" in class "Lorg/torproject/jni/TorService;" or its superclasses
07-14 09:29:46.105 6003 6121 E AndroidRuntime: at org.torproject.jni.TorService.createTorConfiguration(Native Method)
07-14 09:29:46.105 6003 6121 E AndroidRuntime: at org.torproject.jni.TorService.n(Unknown Source:0)
07-14 09:29:46.105 6003 6121 E AndroidRuntime: at org.torproject.jni.TorService$c.run(Unknown Source:38)
07-14 09:29:46.108 3250 4371 W ActivityManager: Force finishing activity org.torproject.android.tv/.TeeveeMainActivity
07-14 09:29:46.162 3250 5985 I WindowManager: WIN DEATH: Window{55ebf3f u0 org.torproject.android.tv/org.torproject.android.tv.TeeveeMainActivity}
07-14 09:29:46.163 3250 3685 I ActivityManager: Process org.torproject.android.tv (pid 6003) has died: fore TOP

crashes on slow devices when obtaining the control socket's file descriptor

Testing with an ancient Samsung Galaxy S (!), I saw nullpointer exceptions, when attempting to obtain the filedescriptor of the control socket

 FileDescriptor controlSocketFd = prepareFileDescriptor(getControlSocket(TorService.this).getAbsolutePath());

I haven't tested that fix #76, but what I did is to iterate over that line with a little delay. It's not well designed, but it fixed my real-world problem and reduced the crash rate.

Feel free to close this issue, might just be an idea.

misunderstanding with arm64 binary

downloaded from https://github.com/n8fr8/tor-android/blob/master/tor-android-binary/src/main/libs/arm64-v8a/tor.so

$ readelf -h Downloads/tor.so
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x87084
  Start of program headers:          52 (bytes into file)
  Start of section headers:          7773456 (bytes into file)
  Flags:                             0x5000200, Version5 EABI, soft-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         9
  Size of section headers:           40 (bytes)
  Number of section headers:         29
  Section header string table index: 26

can you provide an arm64 binary, pls?

add control port buffer so setEvents() can be called anytime

I just had an idea that I think will cover this issue, be relatively easy to implement, and replace this pull request:

  • accept setEvents() calls any time
  • if the control port is not active, cache the value of last setEvents() call
  • after TorService receives the first CIRC event, send the cached setEvents() value
  • further setEvents() calls are sent directly to the control port
  • this buffer should probably be a queue that stores all recieved messages in order and replays them
  • when TorService sends STOPPING and OFF, the queue should be cleared.

This should allow setEvents() calls to work any time.

@n8fr8 @bitmold Should it queue events when it is OFF? Or only when STARTING?

Access to the Tor ControlPort

Hi, I am trying to make tor-android work together with another application (lnd) which requires access to the control port in order to spin up an onion service.

Going through the source code of TorService, it's not entirely clear to me if it's possible to gain access ControlPort in some capacity. Basically I would like to give lnd the port together with some authentication method, just like you would with the normal Tor daemon on a PC.

libevent submodule points to non-existent commit

Fetching this repository fails in our build pipeline:

error: Server does not allow request for unadvertised object 25d588c12684ee17acee4460be788c1f6f85d48a
Fetched in submodule path 'external/libevent', but it did not contain 25d588c12684ee17acee4460be788c1f6f85d48a. Direct fetching of that commit failed.

java.net.socketexception

I am facing socket exception while connectiong to network through proxy.please guide me if any one has solution for same

sampleapp can not run

I am trying out tor on android, since im new and got not sure where to start, so I go for the sampleapp, but it does not run as I expected

Gradle sync issue

image

then I solve it with comment out the gradle-wrapper.properties

#distributionSha256Sum=336b6898b491f6334502d8074a6b8c2d73ed83b92123106bd4bf837f04111043

but then when I sync and run it again now its showing blank webView

image

and got this on the Run terminal

image

E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 340)
W/GmsClient: IGmsServiceBroker.getService failed
    android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died, but this could also be caused by running out of binder buffe
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(BinderProxy.java:584)
        at rF.b(chromium-TrichromeWebViewGoogle6432.apk-stable-495157434:288)
        at com.google.android.gms.common.internal.BaseGmsClient.p(chromium-TrichromeWebViewGoogle6432.apk-stable-495157434:53)
        at WB.run(chromium-TrichromeWebViewGoogle6432.apk-stable-495157434:1849)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at Bq0.dispatchMessage(chromium-TrichromeWebViewGoogle6432.apk-stable-495157434:223)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.os.HandlerThread.run(HandlerThread.java:67)

any idea what might cause this? and how to fix?

Enable `TorService` to be run as foreground service

The issue with context.startService is that apparently Tor process gets killed in a few minutes once app is sent to background, as described here: akumaigorodski/wallet#122 and this appears to be a normal behavior on Android.

The only bulletproof fix is using startForegroundService instead, but it requires some changes in TorService class, as described here: https://stackoverflow.com/questions/44425584/context-startforegroundservice-did-not-then-call-service-startforeground, otherwise an exception is thrown soon after TorService is started in foreground.

tor.so missing from nativeLibraryDir when app is installed through app bundle with non-debuggable config.

tor.so does not exist in the native library folder when the depending Android app is installed through an app bundle prepared with a config with setting debuggable false. AndroidManifest.xml has the property android:extractNativeLibs="true". Issue happens with either debug or release config with the property debuggable false. It causes TorNativeLoader to fail with message Unable to find file in apk:lib/armeabi-v7a/tor.

ABI splitting is enabled by default, but I explicitly enable it with:

bundle {
  abi {
    enableSplit = true
  }
}

gradle.properties also has the property android.bundle.enableUncompressedNativeLibs=false.

stuck on "waiting for lock"

tor 0.4.6.8

integrated with Orbot, on various cycles of start/stop, I can generate this error:

2021-12-21 12:48:02.856 7322-7622/org.torproject.android W/System.err: java.io.IOException: /data/user/0/org.torproject.android/app_TorService/data/ControlSocket open: Connection refused
2021-12-21 12:48:02.856 7322-7622/org.torproject.android W/System.err: at org.torproject.jni.TorService.prepareFileDescriptor(Native Method)
2021-12-21 12:48:02.856 7322-7622/org.torproject.android W/System.err: at org.torproject.jni.TorService.access$300(TorService.java:43)
2021-12-21 12:48:02.856 7322-7622/org.torproject.android W/System.err: at org.torproject.jni.TorService$2.run(TorService.java:267)

after that happens, I can no longer start tor, because it doesn't proceed past this error:
2021-12-21 12:49:09.738 7322-7718/org.torproject.android I/TorService: Waiting for lock

even if unbind, and stop the OrbotService it still happens. Only a force stop of the app resolved the issue.

document how to use TorService with foreground priority via binding

Android gives "foreground" priority to the activity that is currently visible. Things that are at the foreground priority are the last to be killed. With Service instances, it is possible to set the service to be permanently at the "foreground" priority as long as there is a permanent notification. It is also possible for a Service to get foreground priority if the currently active screen is bound to the Service using BIND_IMPORTANT.

NPE in TorResourceInstaller.installResources Path

The code will throw an NPE if TorNativeLoader.initNativeLibs can't find a file. TorNativeLoader returns a null and then TorResourceInstaller attempts to make this null value an executable.

StackTrace
04-01 04:25:17.306 13309 13372 E TorNativeLoader: Unable to find file in apk:lib/armeabi-v7a/tor
04-01 04:25:17.307 13309 13372 E Orbot : Error installing Tor binaries
04-01 04:25:17.307 13309 13372 E Orbot : java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.setReadable(boolean)' on a null object reference
04-01 04:25:17.307 13309 13372 E Orbot : at org.torproject.android.binary.TorResourceInstaller.setExecutable(TorResourceInstaller.java:227)
04-01 04:25:17.307 13309 13372 E Orbot : at org.torproject.android.binary.TorResourceInstaller.installResources(TorResourceInstaller.java:122)

experiments in making a smaller binary

There are a number of approaches towards making compiled binaries smaller. This issue is mostly a place for me to catalog my experiments. Here's the current size:

$ for f in Orbot-16.1.2-RC-2-tor-0.4.1.5-rc-fullperm-*.apk; do unzip -l $f | grep tor.so; done
  7764656  1980-00-00 00:00   lib/arm64-v8a/tor.so
  7194768  1980-00-00 00:00   lib/armeabi-v7a/tor.so
  7478968  1980-00-00 00:00   lib/x86_64/tor.so
  8380440  1980-00-00 00:00   lib/x86/tor.so

Tor static binary

Hi,
I would like to report an issue when cross-compiling the Tor binary with the --with-openssl-dir option, which is mandatory when the --enable-static option is enabled.

There is a problem within the external/tor/configure.ac which prevents the openssl library to be correctly detected. I don't know whether to open the issue here or directly in the Tor repository, but as 99% of users here are cross-compiling from an x86 host, maybe it makes more sense to open the issue here.

The issue is in the line 937 :

[if (getenv("THIS_SHOULDNT_BE_SET_X201803")) SSL_CIPHER_get_id((void *)0);], [],

This test wouldn't work when cross-compiling, as the arm64 openssl library would fail to load on the x86 host, and thus making the ./configure fail.

Removing the test by replacing the line by :

[;], [],

Make it works, and then Tor can be cross-compiled successfully with the static mode enabled.

Thank you

add ClientTransportPlugin Interface

I'm currently integrating IPtProxy into a fork of tor-android, so that I can easily run tor over snowflake using tor-android.
I wonder if it is of interest for this project to contribute back these little changes.

Instead of adding the IPtProxy to tor-android, I chose to add an interface containing start(), stop() and getTorrc(). Library users can implement this interface to inject a ClientTransportPlugin, to start the ClientTransportPlugin before tor starts, to stop it accordingly and to define the necessary torrc string.

All that is still WIP, but you can have a look at https://0xacab.org/leap/android_libs/tor-android/-/blob/main/tor-android-binary/src/main/java/org/torproject/jni/TorService.java and https://0xacab.org/leap/android_libs/tor-android/-/blob/main/tor-android-binary/src/main/java/org/torproject/jni/ClientTransportPluginInterface.java

Feel free to close this ticket if you think it's not worth a PR.

fatal error: 'systemd/sd-daemon.h' file not found

When building tor using the build script it shows this error on every distro even though systemd is installed
fatal error: 'systemd/sd-daemon.h' file not found

CC src/app/main/tor_main.o CC src/app/config/config.o src/app/config/config.c:173:10: fatal error: 'systemd/sd-daemon.h' file not found #include <systemd/sd-daemon.h> ^~~~~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [Makefile:11359: src/app/config/config.o] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.