[guardian-dev] Orbot hidden services

Michael Rogers michael at briarproject.org
Thu Apr 25 10:34:13 EDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A quick follow-up on this after some experimentation:

1. Instead of polling for the creation of the hostname file, it's
possible to use a FileObserver to watch for CLOSE_WRITE events. You
have to create the hostname file, then start the observer, then ask
Tor to create the hidden service. If you don't create the file first,
the observer receives an event with the undocumented event type 32768,
which I guess could be an error indication from inotify. I used a
CountDownLatch to wait for the observer to receive a CLOSE_WRITE
event. The same technique works for the control_auth_cookie file when
starting Tor.

2. You could reduce the Orbot APK size by about a megabyte by
stripping the Tor binary before zipping it (I used binutils-multiarch
on Debian).

3. You can check that android.os.Build.CPU_ABI starts with "armeabi"
to see whether the binary's suitable for the device. I guess it could
also be used to install an appropriate binary on first run.

4. Do you know whether jtorctl's TorControlConnection is thread-safe?
I've caught RuntimeExceptions when creating a connection in one method
and using it in another (possibly on a different thread). It also
seems to be dangerous to close the underlying socket - but I don't
want to leave it open. Any thoughts?

Cheers,
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJReT7kAAoJEBEET9GfxSfMvNMH/37cH4ujxTtJlTGdxNLqf/Ss
K7rwb5pRuxjPH14H05GhEZwW1ehhXGfoP33dpU35aeFM89EMyP9PH6qzuhSHkVpg
pzLrn2SaDWNmBnCjKthdKkfp7zfhw8YJtx+eqf6ifgmRiPcq3YtFd3CgieWJ3Hi1
gMYUw60uC8BUn3EwiZQgDZolc5CE57t6/AnYwfzCX0lDZqT51ZiddSkOHyPGgVOh
dG4qMb6Oxecac/mF8D9H3/JqO4+BWfgZbfwJQ06JSfkrama8ZzTmPgDEUKFfF+Il
+gLWuNC9IN+qz3VtnjskKUAfWoaZ89GvA1jfIZlS6vFUn1tr3J9gTDK7kJKQGHI=
=bOTV
-----END PGP SIGNATURE-----


More information about the Guardian-dev mailing list