diff --git a/.classpath b/.classpath
index 44abe8e8..1182977f 100644
--- a/.classpath
+++ b/.classpath
@@ -4,5 +4,6 @@
+
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 781581d0..365d3f9a 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,11 +1,12 @@
+ package="org.torproject.android" android:versionName="0.2.3.7-alpha-orbot-1.0.6-RC3" android:versionCode="19">
-
+
@@ -29,13 +30,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AndroidManifest.xml.production b/AndroidManifest.xml.production
deleted file mode 100644
index 56fc2285..00000000
--- a/AndroidManifest.xml.production
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/BUILD b/BUILD
index b22aec4e..c4795ca2 100644
--- a/BUILD
+++ b/BUILD
@@ -22,13 +22,15 @@ on Debian Lenny:
ruby subversion
update-java-alternatives -s java-1.5.0-sun
- curl http://android.git.kernel.org/repo >~/bin/repo
+ mkdir ~/bin
+ PATH=~/bin:$PATH
+ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir ~/mydroid
cd ~/mydroid
- repo init -u git://android.git.kernel.org/platform/manifest.git
+ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
repo sync
# Paste in key from http://source.android.com/download next...
@@ -55,7 +57,7 @@ We need to set to environment variables for droid-gcc:
export DROID_ROOT=~/mydroid/
export DROID_TARGET=generic
-Fetch and build Privoxy:
+Fetch and build Privoxy:c
cd ~/mydroid/external/privoxy
wget http://sourceforge.net/projects/ijbswa/files/Sources/3.0.12%20%28stable%29/privoxy-3.0.12-stable-src.tar.gz/download
tar xzvf privoxy-3.0.12-stable-src.tar.gz
@@ -64,19 +66,18 @@ Fetch and build Privoxy:
autoconf
#need to disable setpgrp check in configure
export ac_cv_func_setpgrp_void=yes
- #replace FOO with your actual username
- CC=droid-gcc LD=droid-ld CPPFLAGS="-I/home/FOO/mydroid/external/zlib/" ./configure --host=arm-none-linux-gnueabi
+ CC=droid-gcc LD=droid-ld CPPFLAGS="-I$DROID_ROOT/external/zlib/" ./configure --host=arm-none-linux-gnueabi
#don't mind the "unrecognized option '-pthread'" error message that you'll see when you run make
make
Fetch and build libevent:
cd ~/mydroid/external/libevent
- svn co https://levent.svn.sourceforge.net/svnroot/levent/tags/release-1.4.12-stable/libevent/ .
+ svn co https://levent.svn.sourceforge.net/svnroot/levent/tags/release-1.4.13-stable/libevent/ .
export LIBEVENTDIR=`cd $DROID_ROOT/external/libevent && pwd`
./autogen.sh
# Put the contents of http://pastebin.ca/1577207 in /tmp/libevent-patch
- patch < /tmp/libevent-patch
+ # path no longer needed: patch < /tmp/libevent-patch
CC=droid-gcc LD=droid-ld ./configure --host=arm-none-linux-gnueabi
make
diff --git a/libs/whispercore.jar b/libs/whispercore.jar
new file mode 100644
index 00000000..914e0338
Binary files /dev/null and b/libs/whispercore.jar differ
diff --git a/res/drawable/background.jpg b/res/drawable/background.jpg
deleted file mode 100644
index 2281f577..00000000
Binary files a/res/drawable/background.jpg and /dev/null differ
diff --git a/res/drawable/bgtitanium.jpg b/res/drawable/bgtitanium.jpg
index 14556292..1047e4cf 100755
Binary files a/res/drawable/bgtitanium.jpg and b/res/drawable/bgtitanium.jpg differ
diff --git a/res/drawable/error.png b/res/drawable/error.png
new file mode 100644
index 00000000..42dc6d66
Binary files /dev/null and b/res/drawable/error.png differ
diff --git a/res/drawable/ic_launcher_gibberbot.png b/res/drawable/ic_launcher_gibberbot.png
index e4099106..24835a26 100644
Binary files a/res/drawable/ic_launcher_gibberbot.png and b/res/drawable/ic_launcher_gibberbot.png differ
diff --git a/res/drawable/icon_orweb.png b/res/drawable/icon_orweb.png
new file mode 100755
index 00000000..679986f3
Binary files /dev/null and b/res/drawable/icon_orweb.png differ
diff --git a/res/drawable/tor.png b/res/drawable/tor.png
index ace86314..0d63dd97 100644
Binary files a/res/drawable/tor.png and b/res/drawable/tor.png differ
diff --git a/res/drawable/warning.png b/res/drawable/warning.png
index 42dc6d66..f5371dce 100644
Binary files a/res/drawable/warning.png and b/res/drawable/warning.png differ
diff --git a/res/layout/layout_about.xml b/res/layout/layout_about.xml
index f81a940d..0e0be56e 100644
--- a/res/layout/layout_about.xml
+++ b/res/layout/layout_about.xml
@@ -80,7 +80,7 @@
android:paddingLeft="15px"
android:textStyle="bold"
android:textColor="#00ff00" />
-
-
+
+
+
+
+
+
+
+
diff --git a/res/layout/layout_wizard_permissions.xml b/res/layout/layout_wizard_permissions.xml
index 1ba5fec1..1327f151 100644
--- a/res/layout/layout_wizard_permissions.xml
+++ b/res/layout/layout_wizard_permissions.xml
@@ -7,23 +7,36 @@
-
-
+
+
+
+ android:layout_centerInParent="true"
+ android:paddingLeft="5sp"
+ >
-
+
+
@@ -37,9 +50,9 @@
>
-
-
-
+
+
+
diff --git a/res/layout/layout_wizard_tips.xml b/res/layout/layout_wizard_tips.xml
index 17ddb88d..0a7f07b2 100644
--- a/res/layout/layout_wizard_tips.xml
+++ b/res/layout/layout_wizard_tips.xml
@@ -5,24 +5,38 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent">
+
-
+
+
+
+ android:layout_centerInParent="true"
+ android:paddingLeft="5sp"
+ >
-
+
@@ -43,12 +57,15 @@
>
+
+
+
diff --git a/res/layout/scrollingtext_buttons_view.xml b/res/layout/scrollingtext_buttons_view.xml
index df599220..815f8642 100644
--- a/res/layout/scrollingtext_buttons_view.xml
+++ b/res/layout/scrollingtext_buttons_view.xml
@@ -8,9 +8,9 @@
+ android:paddingLeft="20sp" >
-
+
+
diff --git a/res/raw/geoip.zip b/res/raw/geoip.zip
new file mode 100644
index 00000000..e3f1d8f6
Binary files /dev/null and b/res/raw/geoip.zip differ
diff --git a/res/raw/tor.zip b/res/raw/tor.zip
new file mode 100644
index 00000000..6ad8f333
Binary files /dev/null and b/res/raw/tor.zip differ
diff --git a/res/raw/toraa b/res/raw/toraa
deleted file mode 100644
index e8aac1ad..00000000
Binary files a/res/raw/toraa and /dev/null differ
diff --git a/res/raw/torab b/res/raw/torab
deleted file mode 100644
index c3bca22e..00000000
Binary files a/res/raw/torab and /dev/null differ
diff --git a/res/raw/torac b/res/raw/torac
deleted file mode 100644
index f04ee681..00000000
Binary files a/res/raw/torac and /dev/null differ
diff --git a/res/raw/torad b/res/raw/torad
deleted file mode 100644
index ac4fb03a..00000000
Binary files a/res/raw/torad and /dev/null differ
diff --git a/res/raw/torrc b/res/raw/torrc
index d1cd7fd3..f3d79d2f 100644
--- a/res/raw/torrc
+++ b/res/raw/torrc
@@ -1,14 +1,14 @@
SocksPort 9050
SafeSocks 1
Log notice stdout
+ControlListenAddress 127.0.0.1
ControlPort 9051
CookieAuthentication 1
RelayBandwidthRate 20 KBytes
RelayBandwidthBurst 20 KBytes
UseBridges 0
AutomapHostsOnResolve 1
-TransListenAddress 0.0.0.0
+TransListenAddress 127.0.0.1
TransPort 9040
-DNSListenAddress 0.0.0.0
-DNSPort 5400
-
+DNSListenAddress 127.0.0.1
+DNSPort 5400
\ No newline at end of file
diff --git a/res/raw/torrctether b/res/raw/torrctether
new file mode 100644
index 00000000..3edb5c81
--- /dev/null
+++ b/res/raw/torrctether
@@ -0,0 +1,14 @@
+SocksPort 9050
+SafeSocks 1
+Log notice stdout
+ControlListenAddress 127.0.0.1
+ControlPort 9051
+CookieAuthentication 1
+RelayBandwidthRate 20 KBytes
+RelayBandwidthBurst 20 KBytes
+UseBridges 0
+AutomapHostsOnResolve 1
+TransListenAddress 0.0.0.0
+TransPort 9040
+DNSListenAddress 0.0.0.0
+DNSPort 5400
\ No newline at end of file
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index a4e22a2d..621fc3d7 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -14,11 +14,6 @@
"تم إيقاف اوربوتجاري إغلاق اوربوت
-بدء تور...
-ضبط التحكم...
-مكتمل.
-انتظار.
-
تحذير: حركة مرورك ليست خفية الى الآن! من فضلك قم بتكوين التطبيقات الخاصة بك لإستخدام HTTP proxy 127.0.0.1:8118 أو SOCK4A أو SOKS5 127.0.0.1:9050الصفحة الرئيسيةتصفّح
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index c6d6321b..e863ec98 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -14,10 +14,6 @@
Orbot està desactivatOrbot s\'està aturant
-Iniciant Tor...
-Preparant el control...
-acomplert.
-esperant.ATENCIÓ : El trànsit de la teva connexió ja no es anònim! Siusplau, configura les teves aplicacions per a usar HTTP proxy 127.0.0.1:8118, per SOCKS4A o SOCKS5 proxy 127.0.0.1:9050Lloc d\'inici
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 039062b1..2d5a5663 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -14,10 +14,6 @@
"Orbot ist deaktiviertOrbot wird beendet
-Starte Tor...
-Baue Kontrollverbindung auf...
-erfolgreich abgeschlossen.
-warte.WARNUNG: Die Verbindung ist noch nicht anonymisiert! Bitte stellen Sie Ihre Programme so ein, dass sie entwederden HTTP proxy 127.0.0.1:8118, SOCKS4A oder SOCKS proxy 127.0.0.1:9050 nutzen.Home
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 9b9768de..c588f1c7 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -14,10 +14,6 @@
"Orbot está desactivadoOrbot se está cerrando
-Iniciando Tor...
-Configurción de control...
-completo.
-esperando.ADVERTENCIA: ¡Su tráfico no es anónimo aún! Por favor, configure sus aplicaciones para usar el Proxy HTTP 127.0.0.1:8118, el SOCKS4A o el Proxy SOCKS5 127.0.0.1:9050Principal
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index cd52e7db..466b02a2 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -14,10 +14,6 @@
اوربات غیرفعال شده است.اوربات در حال بسته شدن است.
-شروع تُر ...
-راه اندازی نظارت...
-كامل شد.
-در انتظار.هشدار: فعالیت شما هنوز "گمنام" نیست! لطفن اپلیکیشن خود را تنظیم کنید تا از HTTP پروکسی 127.0.0.1:8118 و یا SOCKS4A و یا SOCKS5 پروکسی 127.0.01:9050 استفاده کند.خانه
diff --git a/res/values-mk/strings.xml b/res/values-mk/strings.xml
index 4d1454d9..c4bf305a 100644
--- a/res/values-mk/strings.xml
+++ b/res/values-mk/strings.xml
@@ -14,10 +14,6 @@
"Орбот е дезактивиранОрбот се исклучува
-Вклучување на Тор...
-Воспоставување контрола...
-готово.
-чекање.ВНИМАНИЕ: Вашиот сообраќај сеуште не е анонимен! Треба да ги конфигурирате Вашите апликации да го користат проксито за HTTP, 127.0.0.1:8118, или проксито за SOCKS4A или SOCKS5, 127.0.0.1:9050Дома
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index 1bc5d654..5059bf7e 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -14,10 +14,6 @@
"Orbot er deaktivertOrbot skrur seg av
-Starter Tor...
-autentiserer kontrolltilkobling...
-ferdig.
-venter.ADVARSEL: Trafikken din er ikke anonym helt enda! Vær vennlig og konfigurer applikasjonene dine til å bruke HTTP proxy 127.0.0.1:8118 eller SOCKS4A eller SOCKS5 proxy 127.0.0.1:9050Hjem
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 1d4dfb4d..28b27fe2 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -14,10 +14,6 @@
Orbot is uitgeschakeldOrbot is aan het afsluiten
-Bezig met opstarten van Tor...
-Bezig met instellen aansturing
-klaar.
-aan het wachten.WAARSCHUWING: Uw verkeer is nog niet anononiem! Stel uw programma\'s alstublieft in dat ze gebruik maken van HTTP proxy 127.0.0.1:8118 of SOCKS4A of SOCKS5 proxy 127.0.0.1:9050Thuis
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 7b42d3f3..5925f29e 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -14,11 +14,6 @@
Orbot wyłączonyOrbot wyłącza się
-Tor startuje...
-Ustawianie sterowania...
-zakończono.
-oczekiwanie.
-
UWAGA: Twoja komunikacja nie jest jeszcze anonimowa! Proszę skonfiguruj aplikacje aby używały serwera proxy HTTP 127.0.0.1:8118 lub SOCKS4A lub SOCKS5 127.0.0.1:9050StartPrzeglądaj
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 7925730e..d82dac31 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -13,10 +13,6 @@
"Orbot está DesactivadoOrbot a encerrar
-A iniciar Tor...
-a autenticar a ligação de controlo...
-completo.
-a aguardar.ATENÇÃO: A sua ligação ainda não é anónima! Por favor configure as suas aplicações para utilizarem o proxy HTTP 127.0.0.1:8118 ou o proxy SOCKS4A ou SOCKS5 127.0.0.1:9050Início
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 1b66df49..67057b5e 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -14,10 +14,6 @@
"Orbot ОтключенOrbot выключается
-Запуск Tor...
-Настройка управления...
-готово.
-ожидание.ВНИМАНИЕ! Ваш поток данных еще не анонимен! Пожалуйста, настройте свои приложения на использование HTTP прокси 127.0.0.1:8118 или SOCKS4A или SOCKS5 прокси 127.0.0.1:9050Домашняя страница
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index 5d5be5b8..97b69253 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -14,10 +14,6 @@
"Orbot är inaktiveradOrbot avslutas
-Startar Tor...
-verifierar kontroll uppkopplingen...
-klar.
-väntar.VARNING: Din trafik är inte anonym än! Vänligen konfigurera dina apps att använda HTTP proxy 127.0.0.1:8118 eller SOCKS4A/5 proxy 127.0.0.1:9050Hem
diff --git a/res/values-zh/strings.xml b/res/values-zh/strings.xml
index 0354e0d4..ebf38ada 100644
--- a/res/values-zh/strings.xml
+++ b/res/values-zh/strings.xml
@@ -14,10 +14,6 @@
Orbot 已停用Orbot 正在关闭
-正在启动Tor....
-设置控制...
-完毕。
-等待中。警告: 您的通讯还不是匿名的! 请设置您的应用程序使用代理服务器 127.0.0.1:8118 或者 SOCKS4A 或者 SOCKS5 代理服务器 127.0.0.1:9050首页
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d9befc47..a060d55c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -14,10 +14,9 @@
"Orbot is DeactivatedOrbot is shutting down
-Starting Tor...
-Setting up control...
-complete.
-waiting.
+Starting Tor client...
+complete.
+waiting.WARNING: Your traffic is not anonymous yet! Please configure your applications to use HTTP proxy 127.0.0.1:8118 or SOCKS4A or SOCKS5 proxy 127.0.0.1:9050Home
@@ -68,7 +67,7 @@
Application Error
-Welcome to Orbot
+OrbotAbout OrbotNext
@@ -80,7 +79,6 @@
- Orbot brings Tor to Android. Tor is free software and an open network that helps you defend against a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security known as traffic analysis.\n\n*WARNING:* Simply installing Orbot will _not_ magically anonymize your mobile traffic! This wizard will help you get started.Some Orbot DetailsOrbot is an open-source application that contains Tor, LibEvent and Privoxy. It provides a local HTTP proxy (8118) and a SOCKS proxy (9050) into the Tor network. Orbot also has the ability, on rooted device, to send all internet traffic through Tor.Permission Granted
@@ -89,7 +87,7 @@
While it is not required, Orbot can become a more powerful tool if your device has root access. Use the button below to grant Orbot superpowers! If you don\'t have root access or have no idea what we\'re talking about, just be sure to use apps made to work with Orbot.
- I understand and would like to continue without root
+ I understand and would like to continue without SuperuserGrant Root for OrbotConfigure Torification
@@ -99,9 +97,8 @@
Orbot-enabled Apps
- We encourage you to download & use apps that know how to connect directly to Orbot. Click on the buttons below to install.
+ The apps below were developed to work with Orbot. Click each button to install now, or you can find them later in the Android Market.Gibberbot - Secure instant messaging client for Android
- ORWEB (Android 1.x Only) - Browser designed for privacy & for OrbotProxy Settings - Learn how to configure apps to work with OrbotProxy Settings
@@ -112,16 +109,13 @@
Orbot is ready!
- Hundreds of thousands of people around the world use Tor for a wide variety of reasons: journalists and bloggers, human rights workers, law enforcement officers, soldiers, corporations, citizens of repressive regimes, and just ordinary citizens... and now you are ready to, as well!
-
- market://search?q=pname:info.guardianproject.otr.app.im
- market://search?q=pname:nfo.guardianproject.browser
+ Hundreds of thousands of people around the world use Tor for a wide variety of reasons.\n\nJournalists and bloggers, human rights defenders, law enforcement officers, soldiers, corporations, citizens of repressive regimes, and just ordinary citizens... and now you are ready to, as well!
- You\'ve successfully connected to the Tor network - but this does NOT mean your device is secure. You can use the \'Check\' option from the menu to test your browser. \n\nVisit us at https://guardianproject.info/apps/orbot or send an email to help@guardianproject.info to learn more.
+ You\'ve successfully connected to the Tor network - but this does NOT mean your device is secure. You can use the \'Check\' option from the menu to test your browser. \n\nVisit us at https://guardianproject.info/apps/orbot or send an email to help@guardianproject.info to learn more.
- This will open your default web browser to https://check.torproject.org in order to see if Orbot is probably configured and you are connected to Tor.
+ This will open your web browser to https://check.torproject.org in order to see if Orbot is probably configured and you are connected to Tor.Hidden Services
@@ -131,33 +125,39 @@
Automatically start Orbot and connect Tor when your Android device boots
- Orbot brings Tor to Android \n\nTor helps you defend against a form of network surveillance that threatens privacy, confidential business activity and relationships, and state security known as traffic analysis
+ Orbot brings Tor to Android!\n\nTor helps you defend against content filtering, traffic analysis and network surveillance that threatens privacy, confidential information and personal relationships.\n\nThis wizard will help you configure Orbot and Tor on your device.Warning
- Simply installing Orbot will not automatically anonymize your mobile traffic.\n\nPlease follow the following steps to get started
+ Simply installing Orbot will not automatically anonymize your mobile traffic.\n\nYou must properly configure Orbot, your device and other apps to successfully use Tor.Permissions
- Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot
- If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot
- Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot
+ You can optionally grant Orbot \'Superuser\' access to enable advanced features, such as Transparent Proxying.
+ If you do not want to do this, please make sure to use apps made to work with Orbot
+ Your device is running in standard mode, and does not support root or \'Superuser\' access.\n\nIn order to you to benefit from Tor, you will need to use apps built to work with Orbot, or that support HTTP or SOCKS proxy settings.\n\n
- Orbot configured Apps
- Gibberbot - Secure instant messaging client for Android
+ Orbot-Enabled Apps
+ Gibberbot: Secure chat app with Off-the-Record Encryption
+ https://market.android.com/details?id=info.guardianproject.otr.app.im
+
+ Orweb: Privacy-enhanced browser that works through Tor
+ https://market.android.com/details?id=info.guardianproject.browser
+
+
- Transparent Proxy
- Transparent Proxying allows you to redirect client requests without any special configuration or knowledge at the client.
+ Transparent Proxying
+ This allows your apps to automatically run through the Tor network without any configuration.(Check this box if you have no idea what we are talking about)NoneTor Tethering
- Enable Tor Transparent Proxying for Wifi and USB Tethered Devices
-
+ Enable Tor Transparent Proxying for Wifi and USB Tethered Devices (requires restart)
+Request Superuser AccessSelect AppsChoose Apps to Route Through Tor
@@ -167,4 +167,21 @@
Entrance NodesFingerprints, nicks, countries and addresses for the first hopEnter Entrance Nodes
+
+Use WhisperCore
+Use the proprietary NetFilter APIs provided by WhisperSystems (required device with WhisperCore installed)
+
+
+Proxy Type
+Protocol to use for proxy server: HTTP, HTTPS, Socks4, Socks5
+Enter Proxy Type
+
+Proxy Host
+Proxy server hostname
+Enter Proxy Host
+
+Proxy Port
+Proxy server port
+Enter Proxy port
+
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index a6c0f678..6665cfd0 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -14,6 +14,14 @@ android:key="has_root"
android:title="@string/pref_has_root"
android:summary="@string/pref_has_root_summary"
android:enabled="true"/>
+
@@ -137,6 +145,24 @@ android:dialogTitle="Enter ports"
+
+
+
+
+
+
0)
- showAlert("Update", torServiceMsg, false);
+ if (torServiceMsg != null && torServiceMsg.length() > 0)
+ {
+ // showAlert("Update", torServiceMsg, false);
+ lblStatus.setText(torServiceMsg);
+ }
boolean showFirstTime = prefs.getBoolean("connect_first_time",true);
@@ -607,7 +605,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
}
- else if (torStatus == STATUS_CONNECTING)
+ else if (torStatus == TorServiceConstants.STATUS_CONNECTING)
{
imgStatus.setImageResource(R.drawable.torstarting);
@@ -619,18 +617,6 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
mItemOnOff.setTitle(R.string.menu_stop);
}
- else if (torStatus == STATUS_OFF)
- {
- imgStatus.setImageResource(R.drawable.toroff);
-
-
- hideProgressDialog();
-
- lblStatus.setText(getString(R.string.status_shutting_down));
-
- if (mItemOnOff != null)
- mItemOnOff.setTitle(R.string.menu_start);
- }
else
{
@@ -704,34 +690,30 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
public boolean onLongClick(View view) {
- try
+ try
+ {
+
+ if (mService != null && mService.getStatus() == TorServiceConstants.STATUS_OFF)
{
- if (mService == null)
- {
-
- }
- else if (mService.getStatus() == STATUS_READY)
- {
-
- createProgressDialog(getString(R.string.status_starting_up));
+ createProgressDialog(getString(R.string.status_starting_up));
- startTor();
- }
- else
- {
-
- stopTor();
-
- }
-
+ startTor();
}
- catch (Exception e)
+ else
{
- Log.d(TAG,"error onclick",e);
- }
- return true;
+ stopTor();
+
+ }
+
+ }
+ catch (Exception e)
+ {
+ Log.d(TAG,"error onclick",e);
+ }
+
+ return true;
}
@@ -775,13 +757,21 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
// this is what takes messages or values from the callback threads or other non-mainUI threads
//and passes them back into the main UI thread for display to the user
private Handler mHandler = new Handler() {
+
+ private String lastServiceMsg = null;
+
public void handleMessage(Message msg) {
switch (msg.what) {
case TorServiceConstants.STATUS_MSG:
String torServiceMsg = (String)msg.getData().getString(HANDLER_TOR_MSG);
- updateStatus(torServiceMsg);
+ if (lastServiceMsg == null || !lastServiceMsg.equals(torServiceMsg))
+ {
+ updateStatus(torServiceMsg);
+
+ lastServiceMsg = torServiceMsg;
+ }
break;
case TorServiceConstants.LOG_MSG:
diff --git a/src/org/torproject/android/TorConstants.java b/src/org/torproject/android/TorConstants.java
index 56eb5d52..38bb0d2d 100644
--- a/src/org/torproject/android/TorConstants.java
+++ b/src/org/torproject/android/TorConstants.java
@@ -16,11 +16,6 @@ public interface TorConstants {
//path to check Tor against
public final static String URL_TOR_CHECK = "https://check.torproject.org";
- public final static int STATUS_OFF = -1;
- public final static int STATUS_READY = 0;
- public final static int STATUS_ON = 1;
- public final static int STATUS_CONNECTING = 2;
-
public final static String NEWLINE = "\n";
@@ -45,6 +40,8 @@ public interface TorConstants {
public final static String PREF_TRANSPARENT = "pref_transparent";
public final static String PREF_TRANSPARENT_ALL = "pref_transparent_all";
+ public final static String PREF_HAS_ROOT = "has_root";
+
}
diff --git a/src/org/torproject/android/service/TorBinaryInstaller.java b/src/org/torproject/android/service/TorBinaryInstaller.java
index ba6ab3fa..a3b1995e 100644
--- a/src/org/torproject/android/service/TorBinaryInstaller.java
+++ b/src/org/torproject/android/service/TorBinaryInstaller.java
@@ -9,10 +9,15 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
import org.torproject.android.R;
+import org.torproject.android.TorConstants;
import android.content.Context;
import android.util.Log;
@@ -34,43 +39,28 @@ public class TorBinaryInstaller implements TorServiceConstants {
/*
* Extract the Tor binary from the APK file using ZIP
*/
- public boolean installFromRaw ()
+ public boolean installFromRaw () throws IOException
{
- boolean result = false;
+ InputStream is;
+
+ is = context.getResources().openRawResource(R.raw.tor);
+ streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, false, true);
- try
- {
- InputStream is;
-
- is = context.getResources().openRawResource(R.raw.toraa);
- streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, false);
-
- is = context.getResources().openRawResource(R.raw.torab);
- streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, true);
-
- is = context.getResources().openRawResource(R.raw.torac);
- streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, true);
-
- is = context.getResources().openRawResource(R.raw.torad);
- streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, true);
-
- is = context.getResources().openRawResource(R.raw.torrc);
- streamToFile(is,installFolder, TORRC_ASSET_KEY, false);
-
- is = context.getResources().openRawResource(R.raw.privoxy);
- streamToFile(is,installFolder, PRIVOXY_ASSET_KEY, false);
-
- is = context.getResources().openRawResource(R.raw.privoxy_config);
- streamToFile(is,installFolder, PRIVOXYCONFIG_ASSET_KEY, false);
+ is = context.getResources().openRawResource(R.raw.torrc);
+ streamToFile(is,installFolder, TORRC_ASSET_KEY, false, false);
- }
- catch (IOException ioe)
- {
- Log.e(TAG, "unable to install tor binaries from raw", ioe);
- return false;
- }
-
+ is = context.getResources().openRawResource(R.raw.torrctether);
+ streamToFile(is,installFolder, TORRC_TETHER_KEY, false, false);
+
+ is = context.getResources().openRawResource(R.raw.privoxy);
+ streamToFile(is,installFolder, PRIVOXY_ASSET_KEY, false, false);
+
+ is = context.getResources().openRawResource(R.raw.privoxy_config);
+ streamToFile(is,installFolder, PRIVOXYCONFIG_ASSET_KEY, false, false);
+
+ is = context.getResources().openRawResource(R.raw.geoip);
+ streamToFile(is,installFolder, GEOIP_ASSET_KEY, false, true);
return true;
}
@@ -79,7 +69,7 @@ public class TorBinaryInstaller implements TorServiceConstants {
/*
* Write the inputstream contents to the file
*/
- private static boolean streamToFile(InputStream stm, File folder, String targetFilename, boolean append) throws IOException
+ private static boolean streamToFile(InputStream stm, File folder, String targetFilename, boolean append, boolean zip) throws IOException
{
byte[] buffer = new byte[FILE_WRITE_BUFFER_SIZE];
@@ -88,7 +78,15 @@ public class TorBinaryInstaller implements TorServiceConstants {
File outFile = new File(folder, targetFilename);
- FileOutputStream stmOut = new FileOutputStream(outFile, append);
+ OutputStream stmOut = new FileOutputStream(outFile, append);
+
+ if (zip)
+ {
+ ZipInputStream zis = new ZipInputStream(stm);
+ ZipEntry ze = zis.getNextEntry();
+ stm = zis;
+
+ }
while ((bytecount = stm.read(buffer)) > 0)
@@ -132,7 +130,7 @@ public class TorBinaryInstaller implements TorServiceConstants {
} catch (IOException ex) {
- Log.e(TAG, "error copying binary", ex);
+ Log.e(TorConstants.TAG, "error copying binary", ex);
}
}
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index 68fe6e2d..6af973b3 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -17,12 +17,12 @@ import net.freehaven.tor.control.ConfigEntry;
import net.freehaven.tor.control.EventHandler;
import net.freehaven.tor.control.TorControlConnection;
-import org.torproject.android.AppManager;
import org.torproject.android.Orbot;
-import org.torproject.android.ProcessSettingsAsyncTask;
import org.torproject.android.R;
import org.torproject.android.TorConstants;
import org.torproject.android.Utils;
+import org.torproject.android.settings.AppManager;
+import org.torproject.android.settings.ProcessSettingsAsyncTask;
import android.app.AlertDialog;
import android.app.Notification;
@@ -40,7 +40,7 @@ import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.util.Log;
-public class TorService extends Service implements TorServiceConstants, Runnable, EventHandler
+public class TorService extends Service implements TorServiceConstants, TorConstants, Runnable, EventHandler
{
public static boolean ENABLE_DEBUG_LOG = true;
@@ -516,24 +516,14 @@ public class TorService extends Service implements TorServiceConstants, Runnable
private boolean setupTransProxy (boolean activate) throws Exception
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
- boolean hasRoot;
-
- if (prefs.contains("has_root"))
- {
- hasRoot = prefs.getBoolean("has_root",false);
- }
- else
- {
- hasRoot = TorServiceUtils.checkRootAccess();
- Editor pEdit = prefs.edit();
- pEdit.putBoolean("has_root",hasRoot);
- pEdit.commit();
- }
+
+ boolean hasRoot = prefs.getBoolean(PREF_HAS_ROOT,false);
if (!hasRoot)
- return false;
-
- if (activate)
+ {
+
+ }
+ else if (activate)
{
boolean enableTransparentProxy = prefs.getBoolean("pref_transparent", false);
@@ -592,6 +582,10 @@ public class TorService extends Service implements TorServiceConstants, Runnable
showAlert("Status", "TransProxy enabled for Tethering!");
TorTransProxy.enableTetheringRules(this);
+
+ // mBinder.updateConfiguration("TransListenAddress", "0.0.0.0", false);
+ // mBinder.updateConfiguration("DNSListenAddress", "0.0.0.0", false);
+
}
}
else
@@ -627,6 +621,14 @@ public class TorService extends Service implements TorServiceConstants, Runnable
String torrcPath = new File(appBinHome, TORRC_ASSET_KEY).getAbsolutePath();
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean transProxyTethering = prefs.getBoolean("pref_transparent_tethering", false);
+
+ if (transProxyTethering)
+ {
+ torrcPath = new File(appBinHome, TORRC_TETHER_KEY).getAbsolutePath();
+ }
+
String[] torCmd = {torBinaryPath + " DataDirectory " + appDataHome.getAbsolutePath() + " -f " + torrcPath + " || exit\n"};
boolean runAsRootFalse = false;
@@ -748,7 +750,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
{
logNotice( "Connecting to control port: " + TOR_CONTROL_PORT);
- String baseMessage = getString(R.string.tor_process_connecting);
+ String baseMessage = getString(R.string.tor_process_starting);
sendCallbackStatusMessage(baseMessage);
torConnSocket = new Socket(IP_LOCALHOST, TOR_CONTROL_PORT);
@@ -756,7 +758,6 @@ public class TorService extends Service implements TorServiceConstants, Runnable
// conn.authenticate(new byte[0]); // See section 3.2
- sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step2));
logNotice( "SUCCESS connected to control port");
@@ -772,7 +773,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
logNotice( "SUCCESS authenticated to control port");
- sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step2) + getString(R.string.tor_process_connecting_step3));
+ sendCallbackStatusMessage(getString(R.string.tor_process_starting) + ' ' + getString(R.string.tor_process_complete));
addEventHandler();
@@ -785,7 +786,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
conn = null;
Log.d(TAG,"Attempt: Error connecting to control port: " + ce.getLocalizedMessage(),ce);
- sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step4));
+ sendCallbackStatusMessage(getString(R.string.tor_process_waiting));
Thread.sleep(1000);
@@ -910,14 +911,14 @@ public class TorService extends Service implements TorServiceConstants, Runnable
if (msg.indexOf(TOR_CONTROL_PORT_MSG_BOOTSTRAP_DONE)!=-1)
{
currentStatus = STATUS_ON;
+ showToolbarNotification (getString(R.string.status_activated),NOTIFY_ID,R.drawable.tornotificationon);
getHiddenServiceHostname ();
}
-
-
- showToolbarNotification (getString(R.string.status_activated),NOTIFY_ID,R.drawable.tornotificationon);
+
+
sendCallbackStatusMessage (msg);
@@ -1273,7 +1274,6 @@ public class TorService extends Service implements TorServiceConstants, Runnable
private boolean applyPreferences () throws RemoteException
{
-
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
//ENABLE_DEBUG_LOG = prefs.getBoolean("pref_enable_logging",false);
@@ -1285,9 +1285,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
//boolean autoUpdateBridges = prefs.getBoolean(TorConstants.PREF_BRIDGES_UPDATED, false);
boolean becomeRelay = prefs.getBoolean(TorConstants.PREF_OR, false);
-
boolean ReachableAddresses = prefs.getBoolean(TorConstants.PREF_REACHABLE_ADDRESSES,false);
-
boolean enableHiddenServices = prefs.getBoolean("pref_hs_enable", false);
boolean enableStrictNodes = prefs.getBoolean("pref_strict_nodes", false);
@@ -1295,6 +1293,18 @@ public class TorService extends Service implements TorServiceConstants, Runnable
String exitNodes = prefs.getString("pref_exit_nodes", null);
String excludeNodes = prefs.getString("pref_exclude_nodes", null);
+ String proxyType = prefs.getString("pref_proxy_type", null);
+ if (proxyType != null)
+ {
+ String proxyHost = prefs.getString("pref_proxy_host", null);
+ String proxyPort = prefs.getString("pref_proxy_port", null);
+
+ if (proxyHost != null && proxyPort != null)
+ {
+ mBinder.updateConfiguration(proxyType + "Proxy", proxyHost + ':' + proxyPort, false);
+ }
+ }
+
if (currentStatus == STATUS_ON)
{
//reset iptables rules in active mode
@@ -1309,6 +1319,8 @@ public class TorService extends Service implements TorServiceConstants, Runnable
}
}
+ File fileGeoIP = new File(appBinHome,"geoip");
+ mBinder.updateConfiguration("GeoIPFile", fileGeoIP.getAbsolutePath(), false);
mBinder.updateConfiguration("EntryNodes", entranceNodes, false);
mBinder.updateConfiguration("ExitNodes", exitNodes, false);
mBinder.updateConfiguration("ExcludeNodes", excludeNodes, false);
@@ -1431,7 +1443,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
mBinder.updateConfiguration("HiddenServiceDir","", false);
}
-
+
mBinder.saveConfiguration();
return true;
diff --git a/src/org/torproject/android/service/TorServiceConstants.java b/src/org/torproject/android/service/TorServiceConstants.java
index 4f58dde8..e47ed715 100644
--- a/src/org/torproject/android/service/TorServiceConstants.java
+++ b/src/org/torproject/android/service/TorServiceConstants.java
@@ -4,11 +4,9 @@ package org.torproject.android.service;
public interface TorServiceConstants {
- public final static String TAG = "ORBOT";
public final static String TOR_APP_USERNAME = "org.torproject.android";
- public final static String ASSETS_BASE = "assets/";
//home directory of Android application
@@ -17,6 +15,8 @@ public interface TorServiceConstants {
//torrc (tor config file)
public final static String TORRC_ASSET_KEY = "torrc";
+ public final static String TORRC_TETHER_KEY = "torrctether";
+
public final static String TOR_CONTROL_COOKIE = "control_auth_cookie";
//how to launch tor
@@ -27,7 +27,10 @@ public interface TorServiceConstants {
//privoxy.config
public final static String PRIVOXYCONFIG_ASSET_KEY = "privoxy.config";
-
+
+ //geoip data file asset key
+ public final static String GEOIP_ASSET_KEY = "geoip";
+
//various console cmds
public final static String SHELL_CMD_CHMOD = "chmod";
public final static String SHELL_CMD_KILL = "kill -9";
diff --git a/src/org/torproject/android/service/TorServiceUtils.java b/src/org/torproject/android/service/TorServiceUtils.java
index 657d525d..51d6378c 100644
--- a/src/org/torproject/android/service/TorServiceUtils.java
+++ b/src/org/torproject/android/service/TorServiceUtils.java
@@ -9,47 +9,15 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
+import org.torproject.android.TorConstants;
+
import android.util.Log;
public class TorServiceUtils implements TorServiceConstants {
- /**
- * Check if we have root access
- * @return boolean true if we have root
- */
- /*
- public static boolean checkRootAccess() {
-
-
- StringBuilder log = new StringBuilder();
-
- try {
-
- // Run an empty script just to check root access
- String[] cmd = {"exit 0"};
- int exitCode = TorServiceUtils.doShellCommand(cmd, log, true, true);
- if (exitCode == 0) {
-
- return true;
- }
-
- } catch (IOException e) {
- //this means that there is no root to be had (normally) so we won't log anything
- TorService.logException("Error checking for root access",e);
-
- }
- catch (Exception e) {
- TorService.logException("Error checking for root access",e);
- //this means that there is no root to be had (normally)
- }
-
- TorService.logMessage("Could not acquire root permissions");
- return false;
- }
- */
-
- public static boolean checkRootAccess(){
+ public static boolean isRootPossible()
+ {
StringBuilder log = new StringBuilder();
@@ -79,6 +47,8 @@ public class TorServiceUtils implements TorServiceConstants {
}
TorService.logMessage("Could not acquire root permissions");
+
+
return false;
}
@@ -102,7 +72,7 @@ public class TorServiceUtils implements TorServiceConstants {
}
catch (Exception e2)
{
- Log.w(TAG,"Unable to get proc id for: " + command,e2);
+ Log.w(TorConstants.TAG,"Unable to get proc id for: " + command,e2);
}
}
diff --git a/src/org/torproject/android/service/TorTransProxy.java b/src/org/torproject/android/service/TorTransProxy.java
index de8ea83c..2c1119a4 100644
--- a/src/org/torproject/android/service/TorTransProxy.java
+++ b/src/org/torproject/android/service/TorTransProxy.java
@@ -2,16 +2,16 @@ package org.torproject.android.service;
import java.io.File;
-import org.torproject.android.TorifiedApp;
+import org.torproject.android.TorConstants;
+import org.torproject.android.settings.TorifiedApp;
import android.content.Context;
import android.util.Log;
public class TorTransProxy implements TorServiceConstants {
- private final static String TAG = TorServiceConstants.TAG;
+ private final static String TAG = TorConstants.TAG;
-
public static int purgeIptables(Context context) throws Exception {
diff --git a/src/org/torproject/android/service/TorrcConfig.java b/src/org/torproject/android/service/TorrcConfig.java
new file mode 100644
index 00000000..92bfb9b9
--- /dev/null
+++ b/src/org/torproject/android/service/TorrcConfig.java
@@ -0,0 +1,33 @@
+package org.torproject.android.service;
+
+public class TorrcConfig {
+
+}
+
+/*
+ * GeoIPFile
+ */
+/*
+HTTPProxy host[:port]
+Tor will make all its directory requests through this host:port (or host:80 if port is not specified), rather than connecting directly to any directory servers.
+
+HTTPProxyAuthenticator username:password
+If defined, Tor will use this username:password for Basic HTTP proxy authentication, as in RFC 2617. This is currently the only form of HTTP proxy authentication that Tor supports; feel free to submit a patch if you want it to support others.
+
+HTTPSProxy host[:port]
+Tor will make all its OR (SSL) connections through this host:port (or host:443 if port is not specified), via HTTP CONNECT rather than connecting directly to servers. You may want to set FascistFirewall to restrict the set of ports you might try to connect to, if your HTTPS proxy only allows connecting to certain ports.
+
+HTTPSProxyAuthenticator username:password
+If defined, Tor will use this username:password for Basic HTTPS proxy authentication, as in RFC 2617. This is currently the only form of HTTPS proxy authentication that Tor supports; feel free to submit a patch if you want it to support others.
+
+Socks4Proxy host[:port]
+Tor will make all OR connections through the SOCKS 4 proxy at host:port (or host:1080 if port is not specified).
+
+Socks5Proxy host[:port]
+Tor will make all OR connections through the SOCKS 5 proxy at host:port (or host:1080 if port is not specified).
+
+Socks5ProxyUsername username
+
+Socks5ProxyPassword password
+If defined, authenticate to the SOCKS 5 server using username and password in accordance to RFC 1929. Both username and password must be between 1 and 255 characters.
+*/
\ No newline at end of file
diff --git a/src/org/torproject/android/service/WhisperManager.java b/src/org/torproject/android/service/WhisperManager.java
new file mode 100644
index 00000000..d858af33
--- /dev/null
+++ b/src/org/torproject/android/service/WhisperManager.java
@@ -0,0 +1,93 @@
+package org.torproject.android.service;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
+import android.util.Log;
+
+import com.whispersys.providers.Netfilter;
+
+/*
+ * Supports interaction with private APIs provided by WhisperSystems SDK
+ */
+public class WhisperManager {
+
+
+ Context context;
+
+
+ public boolean isWhisperCore ()
+ {
+ boolean result = false;
+
+ Cursor cursor = null;
+ Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI, Netfilter.Filter.Chains.OUTPUT);
+
+ try {
+ cursor = context.getContentResolver().query(uri, null, null, null, null);
+ cursor.moveToFirst();
+ result = true;
+ }
+ catch (Exception e)
+ {
+ result = false;
+ }
+
+ return result;
+ }
+ /*
+ * Usage
+ The Netfilter provider allows you to query, update, insert, or delete rules from a chain of a table. Callers must provide a CONTENT_URI which specifies the chain of the table they would like to query or modify.
+
+ To query and print the INPUT rules for the filter table, for instance, would look like this:
+ */
+
+ public void query ()
+ {
+ Cursor cursor = null;
+ Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI, Netfilter.Filter.Chains.OUTPUT);
+
+ try {
+ cursor = context.getContentResolver().query(uri, null, null, null, null);
+
+ while (cursor.moveToNext())
+ for (int i=0;i lAppInfo = pMgr.getInstalledApplications(0);
+
Iterator itAppInfo = lAppInfo.iterator();
apps = new TorifiedApp[lAppInfo.size()];
diff --git a/src/org/torproject/android/ProcessSettingsAsyncTask.java b/src/org/torproject/android/settings/ProcessSettingsAsyncTask.java
similarity index 93%
rename from src/org/torproject/android/ProcessSettingsAsyncTask.java
rename to src/org/torproject/android/settings/ProcessSettingsAsyncTask.java
index c4e88a7e..5e14709d 100644
--- a/src/org/torproject/android/ProcessSettingsAsyncTask.java
+++ b/src/org/torproject/android/settings/ProcessSettingsAsyncTask.java
@@ -1,4 +1,4 @@
-package org.torproject.android;
+package org.torproject.android.settings;
import org.torproject.android.service.ITorService;
diff --git a/src/org/torproject/android/SettingsPreferences.java b/src/org/torproject/android/settings/SettingsPreferences.java
similarity index 93%
rename from src/org/torproject/android/SettingsPreferences.java
rename to src/org/torproject/android/settings/SettingsPreferences.java
index 7cf90936..c3b5942e 100644
--- a/src/org/torproject/android/SettingsPreferences.java
+++ b/src/org/torproject/android/settings/SettingsPreferences.java
@@ -1,8 +1,10 @@
/* Copyright (c) 2009, Nathan Freitas, Orbot / The Guardian Project - http://openideals.com/guardian */
/* See LICENSE for licensing information */
-package org.torproject.android;
+package org.torproject.android.settings;
+import org.torproject.android.R;
+import org.torproject.android.R.xml;
import org.torproject.android.service.TorServiceUtils;
import org.torproject.android.service.TorTransProxy;
@@ -38,16 +40,12 @@ public class SettingsPreferences
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
- if (prefs.contains("has_root"))
+ hasRoot = prefs.getBoolean("has_root",false);
+
+ if (!hasRoot)
{
- hasRoot = prefs.getBoolean("has_root",false);
- }
- else
- {
- hasRoot = TorServiceUtils.checkRootAccess();
- Editor pEdit = prefs.edit();
- pEdit.putBoolean("has_root",hasRoot);
- pEdit.commit();
+ hasRoot = prefs.getBoolean("use_whispercore", false);
+
}
}
diff --git a/src/org/torproject/android/TorifiedApp.java b/src/org/torproject/android/settings/TorifiedApp.java
similarity index 97%
rename from src/org/torproject/android/TorifiedApp.java
rename to src/org/torproject/android/settings/TorifiedApp.java
index 9e659e75..4f7fb2d6 100644
--- a/src/org/torproject/android/TorifiedApp.java
+++ b/src/org/torproject/android/settings/TorifiedApp.java
@@ -1,4 +1,4 @@
-package org.torproject.android;
+package org.torproject.android.settings;
import android.graphics.drawable.Drawable;
diff --git a/src/org/torproject/android/ConfigureTransProxy.java b/src/org/torproject/android/wizard/ConfigureTransProxy.java
similarity index 70%
rename from src/org/torproject/android/ConfigureTransProxy.java
rename to src/org/torproject/android/wizard/ConfigureTransProxy.java
index d515aaed..a343e04a 100644
--- a/src/org/torproject/android/ConfigureTransProxy.java
+++ b/src/org/torproject/android/wizard/ConfigureTransProxy.java
@@ -1,4 +1,13 @@
-package org.torproject.android;
+package org.torproject.android.wizard;
+
+import org.torproject.android.Orbot;
+import org.torproject.android.R;
+import org.torproject.android.TorConstants;
+import org.torproject.android.R.drawable;
+import org.torproject.android.R.id;
+import org.torproject.android.R.layout;
+import org.torproject.android.R.string;
+import org.torproject.android.settings.AppManager;
import android.app.Activity;
import android.app.AlertDialog;
@@ -30,7 +39,7 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
{
super.onCreate(savedInstanceState);
context = this;
-
+
}
@Override
@@ -47,9 +56,41 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
protected void onResume() {
super.onResume();
+ setupUI();
+
+
}
+ private void setupUI ()
+ {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+
+ boolean transEnabled = prefs.getBoolean(PREF_TRANSPARENT, false);
+
+ if (transEnabled)
+ {
+ boolean transAllEnabled = prefs.getBoolean(PREF_TRANSPARENT_ALL, false);
+
+ if (transAllEnabled)
+ {
+ RadioButton rb0 = (RadioButton)findViewById(R.id.radio0);
+ rb0.setChecked(true);
+
+
+ }
+ else
+ {
+ RadioButton rb1 = (RadioButton)findViewById(R.id.radio1);
+ rb1.setChecked(true);
+
+ }
+
+ Button next = ((Button)findViewById(R.id.btnWizard2));
+ next.setEnabled(true);
+ }
+
+ }
private void stepSix(){
@@ -76,13 +117,29 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
//Dirty flag variable - improve logic
@Override
public void onClick(View v) {
- if( flag == 1 )
- context.startActivity(new Intent(context, AppManager.class));
-
- else
+
showWizardFinal();
}
});
+
+
+ RadioButton rb0 = (RadioButton)findViewById(R.id.radio0);
+ RadioButton rb1 = (RadioButton)findViewById(R.id.radio1);
+ RadioButton rb2 = (RadioButton)findViewById(R.id.radio2);
+
+ rb1.setOnClickListener(new OnClickListener()
+ {
+
+ @Override
+ public void onClick(View v) {
+
+ context.startActivity(new Intent(context, AppManager.class));
+
+
+
+ }
+
+ });
RadioGroup mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup);
mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener (){
@@ -92,14 +149,6 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
public void onCheckedChanged(RadioGroup group, int checkedId){
Button next = ((Button)findViewById(R.id.btnWizard2));
next.setEnabled(true);
- next.setOnClickListener(new View.OnClickListener() {
-
- @Override
- public void onClick(View v) {
-
- showWizardFinal();
- }
- });
RadioButton rb0 = (RadioButton)findViewById(R.id.radio0);
RadioButton rb1 = (RadioButton)findViewById(R.id.radio1);
@@ -120,23 +169,13 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
else if(rb1.isChecked())
{
- flag = 1;
+ flag++;
pEdit.putBoolean(PREF_TRANSPARENT, true);
pEdit.putBoolean(PREF_TRANSPARENT_ALL, false);
pEdit.putString("radiobutton","rb1");
pEdit.commit();
-
- next.setOnClickListener(new View.OnClickListener() {
-
- @Override
- public void onClick(View v) {
-
- context.startActivity(new Intent(context, AppManager.class));
-
-
- }
- });
+
}
else if(rb2.isChecked())
{
@@ -179,5 +218,16 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
+ }
+
+ @Override
+ protected void onRestoreInstanceState(Bundle savedInstanceState) {
+ super.onRestoreInstanceState(savedInstanceState);
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
}
}
\ No newline at end of file
diff --git a/src/org/torproject/android/LotsaText.java b/src/org/torproject/android/wizard/LotsaText.java
similarity index 92%
rename from src/org/torproject/android/LotsaText.java
rename to src/org/torproject/android/wizard/LotsaText.java
index 1b0656b6..1470a4bb 100644
--- a/src/org/torproject/android/LotsaText.java
+++ b/src/org/torproject/android/wizard/LotsaText.java
@@ -1,4 +1,11 @@
-package org.torproject.android;
+package org.torproject.android.wizard;
+
+import org.torproject.android.R;
+import org.torproject.android.TorConstants;
+import org.torproject.android.R.drawable;
+import org.torproject.android.R.id;
+import org.torproject.android.R.layout;
+import org.torproject.android.R.string;
import android.app.Activity;
import android.content.Context;
diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/wizard/Permissions.java
similarity index 86%
rename from src/org/torproject/android/Permissions.java
rename to src/org/torproject/android/wizard/Permissions.java
index 2ee4f7e3..f2c24a06 100644
--- a/src/org/torproject/android/Permissions.java
+++ b/src/org/torproject/android/wizard/Permissions.java
@@ -1,5 +1,11 @@
-package org.torproject.android;
+package org.torproject.android.wizard;
+import org.torproject.android.R;
+import org.torproject.android.TorConstants;
+import org.torproject.android.R.drawable;
+import org.torproject.android.R.id;
+import org.torproject.android.R.layout;
+import org.torproject.android.R.string;
import org.torproject.android.service.TorService;
import org.torproject.android.service.TorServiceUtils;
import org.torproject.android.service.TorTransProxy;
@@ -16,6 +22,7 @@ import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
+import android.widget.ImageView;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
@@ -50,14 +57,9 @@ public class Permissions extends Activity implements TorConstants {
private void stepThree(){
- boolean hasRoot = TorServiceUtils.checkRootAccess();
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
-
- Editor pEdit = prefs.edit();
- pEdit.putBoolean("has_root",hasRoot);
- pEdit.commit();
+ boolean isRootPossible = TorServiceUtils.isRootPossible();
- if (hasRoot)
+ if (isRootPossible)
{
stepFourRoot();
}
@@ -109,6 +111,9 @@ public class Permissions extends Activity implements TorConstants {
pEdit.putBoolean(PREF_TRANSPARENT, !isChecked);
pEdit.putBoolean(PREF_TRANSPARENT_ALL, !isChecked);
+ pEdit.putBoolean(PREF_HAS_ROOT, !isChecked);
+
+
pEdit.commit();
Button next = ((Button)findViewById(R.id.btnWizard2));
@@ -132,6 +137,18 @@ public class Permissions extends Activity implements TorConstants {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean hasRoot = prefs.getBoolean("has_root",false);
+
+ if (!hasRoot)
+ {
+
+ hasRoot = TorServiceUtils.isRootPossible();
+
+ Editor pEdit = prefs.edit();
+ pEdit.putBoolean(PREF_HAS_ROOT,hasRoot);
+ pEdit.commit();
+
+ }
+
if (hasRoot)
{
try {
@@ -182,9 +199,8 @@ public class Permissions extends Activity implements TorConstants {
private void stepFour(){
- Toast.makeText(context, "NON ROOT FUNC", Toast.LENGTH_SHORT).show();
String title = context.getString(R.string.wizard_permissions_title);
- String msg = context.getString(R.string.wizard_permissions_msg);
+ String msg = context.getString(R.string.wizard_permissions_no_root_msg);
TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
txtTitle.setText(title);
@@ -196,7 +212,9 @@ public class Permissions extends Activity implements TorConstants {
Button btn2 = ((Button)findViewById(R.id.btnWizard2));
btn2.setEnabled(true);
-
+ ImageView img = (ImageView) findViewById(R.id.orbot_image);
+ img.setImageResource(R.drawable.warning);
+
TextView txtBody2 = ((TextView)findViewById(R.id.WizardTextBody2));
txtBody2.setVisibility(TextView.GONE);
diff --git a/src/org/torproject/android/TipsAndTricks.java b/src/org/torproject/android/wizard/TipsAndTricks.java
similarity index 54%
rename from src/org/torproject/android/TipsAndTricks.java
rename to src/org/torproject/android/wizard/TipsAndTricks.java
index ebb5ad37..c46f2e48 100644
--- a/src/org/torproject/android/TipsAndTricks.java
+++ b/src/org/torproject/android/wizard/TipsAndTricks.java
@@ -1,25 +1,34 @@
-package org.torproject.android;
+package org.torproject.android.wizard;
+
+import org.torproject.android.Orbot;
+import org.torproject.android.R;
+import org.torproject.android.TorConstants;
+import org.torproject.android.R.drawable;
+import org.torproject.android.R.id;
+import org.torproject.android.R.layout;
+import org.torproject.android.R.string;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
+import android.widget.ImageView;
import android.widget.TextView;
public class TipsAndTricks extends Activity implements TorConstants {
- private Context context;
-
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- context = this;
}
@@ -42,10 +51,14 @@ public class TipsAndTricks extends Activity implements TorConstants {
void stepFive(){
- String title = context.getString(R.string.wizard_tips_title);
+ String title = getString(R.string.wizard_tips_title);
TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
txtTitle.setText(title);
+ ImageView img = (ImageView) findViewById(R.id.orbot_image);
+ img.setImageResource(R.drawable.icon);
+
+
Button btn1 = (Button)findViewById(R.id.WizardRootButtonInstallGibberbot);
btn1.setOnClickListener(new OnClickListener() {
@@ -53,36 +66,25 @@ public class TipsAndTricks extends Activity implements TorConstants {
@Override
public void onClick(View view) {
- String url = context.getString(R.string.gibberbot_apk_url);
- context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ String url = getString(R.string.gibberbot_apk_url);
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
});
- Button btn2 = (Button)findViewById(R.id.WizardRootButtonInstallFirefox);
+ Button btn2 = (Button)findViewById(R.id.WizardRootButtonInstallOrweb);
btn2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
- String url = context.getString(R.string.firefox_apk_url);
- context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ String url = getString(R.string.orweb_apk_url);
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
}
});
- Button btn3 = (Button)findViewById(R.id.WizardRootButtonInstallProxyMob);
-
- btn3.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View view) {
-
- String url = context.getString(R.string.proxymob_url);
- context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
- }
- });
Button back = ((Button)findViewById(R.id.btnWizard1));
Button next = ((Button)findViewById(R.id.btnWizard2));
@@ -106,6 +108,45 @@ public class TipsAndTricks extends Activity implements TorConstants {
}
+ private void showWizardFinal ()
+ {
+ setContentView(R.layout.scrollingtext_buttons_view);
+ String title = getString(R.string.wizard_final);
+ String msg = getString(R.string.wizard_final_msg);
+
+ TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
+ txtTitle.setText(title);
+
+ TextView txtBody = ((TextView)findViewById(R.id.WizardTextBody));
+ txtBody.setText(msg);
+
+ Button btn1 = ((Button)findViewById(R.id.btnWizard1));
+ Button btn2 = ((Button)findViewById(R.id.btnWizard2));
+ ImageView img = (ImageView) findViewById(R.id.orbot_image);
+
+ btn2.setText(getString(R.string.btn_finish));
+ btn1.setVisibility(Button.VISIBLE);
+ img.setImageResource(R.drawable.icon);
+
+ btn1.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1);
+
+ }
+ });
+
+ btn2.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(getBaseContext(), Orbot.class));
+
+ }
+ });
+ }
+ /*
private void showWizardFinal ()
{
String title = null;
@@ -135,5 +176,5 @@ public class TipsAndTricks extends Activity implements TorConstants {
- }
+ }*/
}
\ No newline at end of file
diff --git a/src/org/torproject/android/WizardHelper.java b/src/org/torproject/android/wizard/WizardHelper.java
similarity index 94%
rename from src/org/torproject/android/WizardHelper.java
rename to src/org/torproject/android/wizard/WizardHelper.java
index c85c50a0..18be47f6 100644
--- a/src/org/torproject/android/WizardHelper.java
+++ b/src/org/torproject/android/wizard/WizardHelper.java
@@ -1,5 +1,11 @@
-package org.torproject.android;
+package org.torproject.android.wizard;
+import org.torproject.android.R;
+import org.torproject.android.TorConstants;
+import org.torproject.android.R.drawable;
+import org.torproject.android.R.id;
+import org.torproject.android.R.layout;
+import org.torproject.android.R.string;
import org.torproject.android.service.TorService;
import org.torproject.android.service.TorServiceUtils;
import org.torproject.android.service.TorTransProxy;
@@ -88,16 +94,16 @@ public class WizardHelper implements TorConstants {
public void onClick(View view) {
- boolean hasRoot = TorServiceUtils.checkRootAccess();
+ boolean isRootPossible = TorServiceUtils.isRootPossible();
- if (hasRoot)
+ if (isRootPossible)
{
try {
int resp = TorTransProxy.testOwnerModule(context);
if (resp < 0)
{
- hasRoot = false;
+ isRootPossible = false;
Toast.makeText(context, "ERROR: IPTables OWNER module not available", Toast.LENGTH_LONG).show();
Log.i(TorService.TAG,"ERROR: IPTables OWNER module not available");
@@ -105,18 +111,21 @@ public class WizardHelper implements TorConstants {
} catch (Exception e) {
- hasRoot = false;
+ isRootPossible = false;
Log.d(TorService.TAG,"ERROR: IPTables OWNER module not available",e);
}
}
-
+
+ /*
+ * we shouldn't store root here, as this step is just chekcing to see if root is possible
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
Editor pEdit = prefs.edit();
pEdit.putBoolean("has_root",hasRoot);
pEdit.commit();
+ */
- if (hasRoot)
+ if (isRootPossible)
{
currentDialog.dismiss();
showWizardStep2Root();
@@ -228,7 +237,7 @@ public class WizardHelper implements TorConstants {
}
});
- Button btn2 = (Button)view.findViewById(R.id.WizardRootButtonInstallFirefox);
+ Button btn2 = (Button)view.findViewById(R.id.WizardRootButtonInstallOrweb);
btn2.setOnClickListener(new OnClickListener() {
@@ -241,6 +250,7 @@ public class WizardHelper implements TorConstants {
}
});
+ /*
Button btn3 = (Button)view.findViewById(R.id.WizardRootButtonInstallProxyMob);
btn3.setOnClickListener(new OnClickListener() {
@@ -252,7 +262,7 @@ public class WizardHelper implements TorConstants {
}
});
-
+ */
showCustomDialog(title, view,context.getString(R.string.btn_next),context.getString(R.string.btn_back),new DialogInterface.OnClickListener() {