Merge branch 'master' of git://git.torproject.org/n8fr8/orbot

This commit is contained in:
Sathyanarayanan Gunasekaran 2011-11-04 01:21:50 +05:30
commit 821b911db3
59 changed files with 664 additions and 509 deletions

View File

@ -4,5 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="lib" path="libs/jtorctrl.jar"/>
<classpathentry kind="lib" path="libs/whispercore.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.torproject.android" android:versionName="0.2.3.1-orbot-alpha-1.0.5.3" android:versionCode="16">
package="org.torproject.android" android:versionName="0.2.3.7-alpha-orbot-1.0.6-RC3" android:versionCode="19">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application android:theme="@style/DefaultTheme" android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="false">
<application android:theme="@style/DefaultTheme" android:icon="@drawable/icon"
android:label="@string/app_name" android:debuggable="false">
<activity android:name=".Orbot"
android:theme="@android:style/Theme.NoTitleBar">
@ -29,13 +30,13 @@
</intent-filter>
</activity>
<activity android:name=".LotsaText"/>
<activity android:name=".Permissions"/>
<activity android:name=".TipsAndTricks"/>
<activity android:name=".ConfigureTransProxy"/>
<activity android:name=".SettingsPreferences" android:label="@string/app_name"/>
<activity android:name=".AppManager" android:label="@string/app_name"/>
<activity android:name=".WizardActivity" android:label="@string/app_name"/>
<activity android:name=".wizard.LotsaText"/>
<activity android:name=".wizard.Permissions"/>
<activity android:name=".wizard.TipsAndTricks"/>
<activity android:name=".wizard.ConfigureTransProxy"/>
<activity android:name=".settings.SettingsPreferences" android:label="@string/app_name"/>
<activity android:name=".settings.AppManager" android:label="@string/app_name"/>
<service android:enabled="true"
android:name=".service.TorService"

View File

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.torproject.android" android:versionName="0.2.2.25-orbot-alpha-1.0.5.20110503a-dev-debug"
android:versionCode="13">
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name=".Orbot"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="org.torproject.android.REQUEST_HS_PORT" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="org.torproject.android.START_TOR" />
</intent-filter>
</activity>
<activity android:name=".SettingsPreferences" android:label="@string/app_name"/>
<activity android:name=".AppManager" android:label="@string/app_name"/>
<activity android:name=".WizardActivity" android:label="@string/app_name"/>
<!-- <service android:name=".service.TorService" android:process=":remote"> -->
<service android:name=".service.TorService">
<intent-filter>
<action android:name="org.torproject.android.service.ITorService" />
<action android:name="org.torproject.android.service.TOR_SERVICE" />
</intent-filter>
</service>
<!--
<receiver android:name=".OnBootReceiver">
<intent-filter>
<action
android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
-->
</application>
<uses-sdk android:minSdkVersion="4"/>
</manifest>

View File

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.torproject.android" android:versionName="0.2.2.25-orbot-alpha-1.0.5.20110503a" android:versionCode="13">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name=".Orbot"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="org.torproject.android.REQUEST_HS_PORT" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="org.torproject.android.START_TOR" />
</intent-filter>
</activity>
<activity android:name=".SettingsPreferences" android:label="@string/app_name"/>
<activity android:name=".AppManager" android:label="@string/app_name"/>
<activity android:name=".WizardActivity" android:label="@string/app_name"/>
<service android:enabled="true"
android:name=".service.TorService"
android:exported="false"
>
<intent-filter>
<action android:name="org.torproject.android.service.ITorService" />
<action android:name="org.torproject.android.service.TOR_SERVICE" />
</intent-filter>
</service>
<receiver android:name=".OnBootReceiver">
<intent-filter>
<action
android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="4"/>
</manifest>

15
BUILD
View File

@ -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

BIN
libs/whispercore.jar Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 40 KiB

BIN
res/drawable/error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
res/drawable/icon_orweb.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -80,7 +80,7 @@
android:paddingLeft="15px"
android:textStyle="bold"
android:textColor="#00ff00" />
<TextView android:text="Tor v0.2.2.25: https://www.torproject.org"
<TextView android:text="Tor v0.2.3.6-alpha: https://www.torproject.org"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:autoLink="web"

View File

@ -1,9 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:duplicateParentState="false">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:duplicateParentState="false">
<!--
<TextView android:text="Select apps to use with Tor:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:padding="3px" />
<ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/applistview"></ListView>
</LinearLayout>
android:padding="3px"
android:layout_above="@+id/applistview"
/>
-->
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/btnsave"
android:text="@string/button_close" android:layout_alignParentBottom="true" />
<ListView android:layout_above="@id/btnsave" android:layout_alignParentTop="true" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/applistview"></ListView>
</RelativeLayout>

View File

@ -7,23 +7,36 @@
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="70sp"
android:id="@+id/relativeLayout1"
android:layout_gravity="center_horizontal"
android:background="#000000">
<TextView android:textSize="10pt"
android:layout_gravity="center_vertical|center_horizontal"
android:background="#000000"
>
<ImageView
android:src="@drawable/icon"
android:id="@+id/orbot_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="20sp" >
</ImageView>
<TextView
android:textColor="#FFFFFF"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:textSize="10pt"
android:layout_toRightOf="@id/orbot_image"
android:gravity="center_vertical"
android:layout_height="fill_parent"
android:id="@+id/WizardTextTitle"
android:layout_width="wrap_content"
android:fadingEdge="vertical"
android:text="TITLE"
android:singleLine="true"
android:padding="20px" android:layout_centerInParent="true">
android:layout_centerInParent="true"
android:paddingLeft="5sp"
>
</TextView>
</RelativeLayout>
<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
<TableRow android:layout_margin="10dip" android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent">
@ -37,9 +50,9 @@
>
<LinearLayout android:background="#575757" android:layout_width="wrap_content" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody1" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text" android:padding="20dip"></TextView>
<Button android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:gravity="center" android:text="Grant Permission" android:id="@+id/grantPermissions" android:layout_gravity="center"></Button>
<TextView android:layout_width="wrap_content" android:visibility="gone" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody2" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text" android:padding="20dip"></TextView>
<CheckBox android:id="@+id/checkBox" android:layout_gravity="center" android:text="@string/wizard_permissions_consent" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center" android:visibility="visible"></CheckBox>
<Button android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:gravity="center" android:text="@string/button_grant_superuser" android:id="@+id/grantPermissions" android:layout_gravity="center"></Button>
<TextView android:layout_width="wrap_content" android:layout_gravity="left" android:visibility="gone" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody2" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text" android:padding="20dip"></TextView>
<CheckBox android:id="@+id/checkBox" android:layout_gravity="left" android:text="@string/wizard_permissions_consent" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center" android:visibility="visible"></CheckBox>
</LinearLayout>
</ScrollView>

View File

@ -5,22 +5,36 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="70sp"
android:id="@+id/relativeLayout1"
android:layout_gravity="center_horizontal"
android:background="#000000">
<TextView android:textSize="10pt"
android:layout_gravity="center_vertical|center_horizontal"
android:background="#000000"
>
<ImageView
android:src="@drawable/warning"
android:id="@+id/orbot_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="20sp" >
</ImageView>
<TextView
android:textColor="#FFFFFF"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:textSize="10pt"
android:layout_toRightOf="@id/orbot_image"
android:gravity="center_vertical"
android:layout_height="fill_parent"
android:id="@+id/WizardTextTitle"
android:layout_width="wrap_content"
android:fadingEdge="vertical"
android:text="TITLE"
android:singleLine="true"
android:padding="20px" android:layout_centerInParent="true">
android:layout_centerInParent="true"
android:paddingLeft="5sp"
>
</TextView>
</RelativeLayout>
<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
@ -43,12 +57,15 @@
>
<TextView android:text="@string/wizard_tips_msg" android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody1" android:padding="20dip"></TextView>
<Button android:text="@string/wizard_tips_orweb" android:layout_gravity="left" android:drawableLeft="@drawable/icon_orweb" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallOrweb" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<Button android:text="@string/wizard_tips_gibberbot" android:layout_gravity="left" android:drawableLeft="@drawable/ic_launcher_gibberbot" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallGibberbot" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<!--
<Button android:text="@string/wizard_tips_firefox" android:layout_gravity="left" android:drawableLeft="@drawable/icon_firefox" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallFirefox" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<Button android:text="@string/wizard_tips_proxymob" android:layout_marginTop="10px" android:drawableLeft="@drawable/proxymob" android:id="@+id/WizardRootButtonInstallProxyMob" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-->
</LinearLayout>
</ScrollView>

View File

@ -8,9 +8,9 @@
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="70sp"
android:id="@+id/relativeLayout1"
android:layout_gravity="center_horizontal"
android:layout_gravity="center_vertical|center_horizontal"
android:background="#000000"
>
<ImageView
@ -19,29 +19,25 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="20px" android:layout_marginLeft="10dip" android:layout_marginTop="8dip">
android:paddingLeft="20sp" >
</ImageView>
<TextView
android:textColor="#FFFFFF"
android:textSize="10pt"
android:layout_toRightOf="@id/orbot_image"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/WizardTextTitle"
android:layout_width="wrap_content"
android:fadingEdge="vertical"
android:text="TITLE"
android:singleLine="true"
android:layout_centerInParent="true"
android:paddingLeft="5px"
android:padding="20px"
android:paddingLeft="5sp"
>
</TextView>
</RelativeLayout>
<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content" >
<TableRow android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="10dip">

BIN
res/raw/geoip.zip Normal file

Binary file not shown.

BIN
res/raw/tor.zip Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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
DNSListenAddress 127.0.0.1
DNSPort 5400

14
res/raw/torrctether Normal file
View File

@ -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

View File

@ -14,11 +14,6 @@
<string name="status_disabled">"تم إيقاف اوربوت</string>
<string name="status_shutting_down">جاري إغلاق اوربوت</string>
<string name="tor_process_connecting">بدء تور...</string>
<string name="tor_process_connecting_step2">ضبط التحكم...</string>
<string name="tor_process_connecting_step3">مكتمل.</string>
<string name="tor_process_connecting_step4">انتظار.</string>
<string name="not_anonymous_yet">تحذير: حركة مرورك ليست خفية الى الآن! من فضلك قم بتكوين التطبيقات الخاصة بك لإستخدام HTTP proxy 127.0.0.1:8118 أو SOCK4A أو SOKS5 127.0.0.1:9050</string>
<string name="menu_home">الصفحة الرئيسية</string>
<string name="menu_browse">تصفّح</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">Orbot està desactivat</string>
<string name="status_shutting_down">Orbot s\'està aturant</string>
<string name="tor_process_connecting">Iniciant Tor...</string>
<string name="tor_process_connecting_step2">Preparant el control...</string>
<string name="tor_process_connecting_step3">acomplert.</string>
<string name="tor_process_connecting_step4">esperant.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Lloc d\'inici</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">"Orbot ist deaktiviert</string>
<string name="status_shutting_down">Orbot wird beendet</string>
<string name="tor_process_connecting">Starte Tor...</string>
<string name="tor_process_connecting_step2">Baue Kontrollverbindung auf...</string>
<string name="tor_process_connecting_step3">erfolgreich abgeschlossen.</string>
<string name="tor_process_connecting_step4">warte.</string>
<string name="not_anonymous_yet">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.</string>
<string name="menu_home">Home</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">"Orbot está desactivado</string>
<string name="status_shutting_down">Orbot se está cerrando</string>
<string name="tor_process_connecting">Iniciando Tor...</string>
<string name="tor_process_connecting_step2">Configurción de control...</string>
<string name="tor_process_connecting_step3">completo.</string>
<string name="tor_process_connecting_step4">esperando.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Principal</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">اوربات غیرفعال شده است.</string>
<string name="status_shutting_down">اوربات در حال بسته شدن است.</string>
<string name="tor_process_connecting">شروع تُر ...</string>
<string name="tor_process_connecting_step2">راه اندازی نظارت...</string>
<string name="tor_process_connecting_step3">كامل شد.</string>
<string name="tor_process_connecting_step4">در انتظار.</string>
<string name="not_anonymous_yet">هشدار: فعالیت شما هنوز "گمنام" نیست! لطفن اپلیکیشن خود را تنظیم کنید تا از HTTP پروکسی 127.0.0.1:8118 و یا SOCKS4A و یا SOCKS5 پروکسی 127.0.01:9050 استفاده کند.</string>
<string name="menu_home">خانه</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">"Орбот е дезактивиран</string>
<string name="status_shutting_down">Орбот се исклучува</string>
<string name="tor_process_connecting">Вклучување на Тор...</string>
<string name="tor_process_connecting_step2">Воспоставување контрола...</string>
<string name="tor_process_connecting_step3">готово.</string>
<string name="tor_process_connecting_step4">чекање.</string>
<string name="not_anonymous_yet">ВНИМАНИЕ: Вашиот сообраќај сеуште не е анонимен! Треба да ги конфигурирате Вашите апликации да го користат проксито за HTTP, 127.0.0.1:8118, или проксито за SOCKS4A или SOCKS5, 127.0.0.1:9050</string>
<string name="menu_home">Дома</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">"Orbot er deaktivert</string>
<string name="status_shutting_down">Orbot skrur seg av</string>
<string name="tor_process_connecting">Starter Tor...</string>
<string name="tor_process_connecting_step2">autentiserer kontrolltilkobling...</string>
<string name="tor_process_connecting_step3">ferdig.</string>
<string name="tor_process_connecting_step4">venter.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Hjem</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">Orbot is uitgeschakeld</string>
<string name="status_shutting_down">Orbot is aan het afsluiten</string>
<string name="tor_process_connecting">Bezig met opstarten van Tor...</string>
<string name="tor_process_connecting_step2">Bezig met instellen aansturing</string>
<string name="tor_process_connecting_step3">klaar.</string>
<string name="tor_process_connecting_step4">aan het wachten.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Thuis</string>

View File

@ -14,11 +14,6 @@
<string name="status_disabled">Orbot wyłączony</string>
<string name="status_shutting_down">Orbot wyłącza się</string>
<string name="tor_process_connecting">Tor startuje...</string>
<string name="tor_process_connecting_step2">Ustawianie sterowania...</string>
<string name="tor_process_connecting_step3">zakończono.</string>
<string name="tor_process_connecting_step4">oczekiwanie.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Start</string>
<string name="menu_browse">Przeglądaj</string>

View File

@ -13,10 +13,6 @@
<string name="status_disabled">"Orbot está Desactivado</string>
<string name="status_shutting_down">Orbot a encerrar</string>
<string name="tor_process_connecting">A iniciar Tor...</string>
<string name="tor_process_connecting_step2">a autenticar a ligação de controlo...</string>
<string name="tor_process_connecting_step3">completo.</string>
<string name="tor_process_connecting_step4">a aguardar.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Início</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">"Orbot Отключен</string>
<string name="status_shutting_down">Orbot выключается</string>
<string name="tor_process_connecting">Запуск Tor...</string>
<string name="tor_process_connecting_step2">Настройка управления...</string>
<string name="tor_process_connecting_step3">готово.</string>
<string name="tor_process_connecting_step4">ожидание.</string>
<string name="not_anonymous_yet">ВНИМАНИЕ! Ваш поток данных еще не анонимен! Пожалуйста, настройте свои приложения на использование HTTP прокси 127.0.0.1:8118 или SOCKS4A или SOCKS5 прокси 127.0.0.1:9050</string>
<string name="menu_home">Домашняя страница</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">"Orbot är inaktiverad</string>
<string name="status_shutting_down">Orbot avslutas</string>
<string name="tor_process_connecting">Startar Tor...</string>
<string name="tor_process_connecting_step2">verifierar kontroll uppkopplingen...</string>
<string name="tor_process_connecting_step3">klar.</string>
<string name="tor_process_connecting_step4">väntar.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Hem</string>

View File

@ -14,10 +14,6 @@
<string name="status_disabled">Orbot 已停用</string>
<string name="status_shutting_down">Orbot 正在关闭</string>
<string name="tor_process_connecting">正在启动Tor....</string>
<string name="tor_process_connecting_step2">设置控制...</string>
<string name="tor_process_connecting_step3">完毕。</string>
<string name="tor_process_connecting_step4">等待中。</string>
<string name="not_anonymous_yet">警告: 您的通讯还不是匿名的! 请设置您的应用程序使用代理服务器 127.0.0.1:8118 或者 SOCKS4A 或者 SOCKS5 代理服务器 127.0.0.1:9050</string>
<string name="menu_home">首页</string>

View File

@ -14,10 +14,9 @@
<string name="status_disabled">"Orbot is Deactivated</string>
<string name="status_shutting_down">Orbot is shutting down</string>
<string name="tor_process_connecting">Starting Tor...</string>
<string name="tor_process_connecting_step2">Setting up control...</string>
<string name="tor_process_connecting_step3">complete.</string>
<string name="tor_process_connecting_step4">waiting.</string>
<string name="tor_process_starting">Starting Tor client...</string>
<string name="tor_process_complete">complete.</string>
<string name="tor_process_waiting">waiting.</string>
<string name="not_anonymous_yet">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:9050</string>
<string name="menu_home">Home</string>
@ -68,7 +67,7 @@
<string name="title_error">Application Error</string>
<string name="wizard_title">Welcome to Orbot</string>
<string name="wizard_title">Orbot</string>
<string name="wizard_btn_tell_me_more">About Orbot</string>
<string name="btn_next">Next</string>
@ -80,7 +79,6 @@
<!-- Welcome Wizard strings (DJH) -->
<string name="wizard_welcome_msg">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.</string>
<string name="wizard_details">Some Orbot Details</string>
<string name="wizard_details_msg">Orbot 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.</string>
<string name="wizard_permissions_root">Permission Granted</string>
@ -89,7 +87,7 @@
<string name="wizard_permissions_msg_stock"> 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! </string>
<string name="wizard_permissions_no_root">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.</string>
<string name="wizard_permissions_consent">I understand and would like to continue without root</string>
<string name="wizard_permissions_consent">I understand and would like to continue without Superuser</string>
<string name="wizard_permission_enable_root">Grant Root for Orbot</string>
<string name="wizard_configure">Configure Torification</string>
@ -99,9 +97,8 @@
<string name="wizard_tips_tricks">Orbot-enabled Apps</string>
<string name="wizard_tips_msg">We encourage you to download &amp; use apps that know how to connect directly to Orbot. Click on the buttons below to install.</string>
<string name="wizard_tips_msg">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.</string>
<string name="wizard_tips_otrchat">Gibberbot - Secure instant messaging client for Android</string>
<string name="wizard_tips_orweb">ORWEB (Android 1.x Only) - Browser designed for privacy &amp; for Orbot</string>
<string name="wizard_tips_proxy">Proxy Settings - Learn how to configure apps to work with Orbot</string>
<string name="wizard_proxy_help_info">Proxy Settings</string>
@ -112,16 +109,13 @@
</string>
<string name="wizard_final">Orbot is ready!</string>
<string name="wizard_final_msg">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!</string>
<string name="otrchat_apk_url">market://search?q=pname:info.guardianproject.otr.app.im</string>
<string name="orweb_apk_url">market://search?q=pname:nfo.guardianproject.browser</string>
<string name="wizard_final_msg">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!</string>
<!-- END Welcome Wizard strings (DJH) -->
<string name="connect_first_time"> 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.</string>
<string name="connect_first_time">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.</string>
<string name="tor_check">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.</string>
<string name="tor_check">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.</string>
<string name="pref_hs_group">Hidden Services</string>
@ -131,33 +125,39 @@
<string name="pref_start_boot_summary">Automatically start Orbot and connect Tor when your Android device boots</string>
<!-- New Wizard Strings -->
<!-- Title Screen -->
<string name="wizard_title_msg">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</string>
<string name="wizard_title_msg">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.</string>
<!-- Warning screen -->
<string name="wizard_warning_title">Warning</string>
<string name="wizard_warning_msg">Simply installing Orbot will not automatically anonymize your mobile traffic.\n\nPlease follow the following steps to get started</string>
<string name="wizard_warning_msg">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.</string>
<!-- Permissions screen -->
<string name="wizard_permissions_title">Permissions</string>
<string name="wizard_permissions_root_msg1">Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot</string>
<string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
<string name="wizard_permissions_msg">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</string>
<string name="wizard_permissions_root_msg1">You can optionally grant Orbot \'Superuser\' access to enable advanced features, such as Transparent Proxying.</string>
<string name="wizard_permissions_root_msg2">If you do not want to do this, please make sure to use apps made to work with Orbot</string>
<string name="wizard_permissions_no_root_msg">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</string>
<!-- TipsAndTricks screen -->
<string name="wizard_tips_title">Orbot configured Apps</string>
<string name="wizard_tips_gibberbot">Gibberbot - Secure instant messaging client for Android</string>
<string name="wizard_tips_title">Orbot-Enabled Apps</string>
<string name="wizard_tips_gibberbot">Gibberbot: Secure chat app with Off-the-Record Encryption</string>
<string name="gibberbot_apk_url">https://market.android.com/details?id=info.guardianproject.otr.app.im</string>
<string name="wizard_tips_orweb">Orweb: Privacy-enhanced browser that works through Tor</string>
<string name="orweb_apk_url">https://market.android.com/details?id=info.guardianproject.browser</string>
<!--
<string name="wizard_tips_firefox">Firefox - Android browser - To be used along with ProxyMob Add-on </string>
<string name="wizard_tips_proxymob">ProxyMob - Simple Firefox Add-on for setting HTTP, SOCKS and SSL proxy settings</string>
<string name="gibberbot_apk_url">https://market.android.com/details?id=info.guardianproject.otr.app.im</string>
<string name="firefox_apk_url">https://market.android.com/details?id=org.mozilla.firefox</string>
<string name="proxymob_url">https://addons.mozilla.org/mobile/downloads/latest/251558/type:attachment/addon-251558-latest.xpi?src=addon-detail</string>
-->
<!-- Transparent Proxy screen -->
<string name="wizard_transproxy_title">Transparent Proxy</string>
<string name="wizard_transproxy_msg">Transparent Proxying allows you to redirect client requests without any special configuration or knowledge at the client.</string>
<string name="wizard_transproxy_title">Transparent Proxying</string>
<string name="wizard_transproxy_msg">This allows your apps to automatically run through the Tor network without any configuration.</string>
<string name="wizard_transproxy_hint">(Check this box if you have no idea what we are talking about)</string>
<string name="wizard_transproxy_none">None</string>
<string name="pref_transparent_tethering_title">Tor Tethering</string>
<string name="pref_transparent_tethering_summary">Enable Tor Transparent Proxying for Wifi and USB Tethered Devices</string>
<string name="pref_transparent_tethering_summary">Enable Tor Transparent Proxying for Wifi and USB Tethered Devices (requires restart)</string>
<string name="button_grant_superuser">Request Superuser Access</string>
<string name="pref_select_apps">Select Apps</string>
<string name="pref_select_apps_summary">Choose Apps to Route Through Tor</string>
@ -167,4 +167,21 @@
<string name="pref_entrance_node">Entrance Nodes</string>
<string name="pref_entrance_node_summary">Fingerprints, nicks, countries and addresses for the first hop</string>
<string name="pref_entrance_node_dialog">Enter Entrance Nodes</string>
<string name="pref_use_whispercore">Use WhisperCore</string>
<string name="pref_use_whispercore_summary">Use the proprietary NetFilter APIs provided by WhisperSystems (required device with WhisperCore installed)</string>
<string name="pref_proxy_type_title">Proxy Type</string>
<string name="pref_proxy_type_summary">Protocol to use for proxy server: HTTP, HTTPS, Socks4, Socks5</string>
<string name="pref_proxy_type_dialog">Enter Proxy Type</string>
<string name="pref_proxy_host_title">Proxy Host</string>
<string name="pref_proxy_host_summary">Proxy server hostname</string>
<string name="pref_proxy_host_dialog">Enter Proxy Host</string>
<string name="pref_proxy_port_title">Proxy Port</string>
<string name="pref_proxy_port_summary">Proxy server port</string>
<string name="pref_proxy_port_dialog">Enter Proxy port</string>
</resources>

View File

@ -14,6 +14,14 @@ android:key="has_root"
android:title="@string/pref_has_root"
android:summary="@string/pref_has_root_summary"
android:enabled="true"/>
<!--
<CheckBoxPreference
android:defaultValue="false"
android:key="use_whispercore"
android:title="@string/pref_use_whispercore"
android:summary="@string/pref_use_whispercore_summary"
android:enabled="true"/>
-->
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_trans_proxy_group">
@ -137,6 +145,24 @@ android:dialogTitle="Enter ports"
<EditTextPreference android:key="pref_hs_hostname" android:summary="the addressable name for your hidden service (generated automatically)" android:title=".Onion Hostname"></EditTextPreference>
</PreferenceCategory>
<PreferenceCategory android:title="Proxy Service for Tor">
<EditTextPreference android:key="pref_proxy_type"
android:title="@string/pref_proxy_type_title"
android:summary="@string/pref_proxy_type_summary"
android:dialogTitle="@string/pref_proxy_type_dialog"
/>
<EditTextPreference android:key="pref_proxy_host"
android:title="@string/pref_proxy_host_title"
android:summary="@string/pref_proxy_host_summary"
android:dialogTitle="@string/pref_proxy_host_dialog"
/>
<EditTextPreference android:key="pref_proxy_port"
android:title="@string/pref_proxy_port_title"
android:summary="@string/pref_proxy_port_summary"
android:dialogTitle="@string/pref_proxy_port_dialog"
/>
</PreferenceCategory>
<PreferenceCategory android:title="Debug">
<CheckBoxPreference
android:key="pref_enable_logging"

View File

@ -6,14 +6,12 @@ package org.torproject.android;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import org.torproject.android.service.ITorService;
import org.torproject.android.service.ITorServiceCallback;
import org.torproject.android.service.TorServiceConstants;
import org.torproject.android.settings.ProcessSettingsAsyncTask;
import org.torproject.android.settings.SettingsPreferences;
import org.torproject.android.wizard.LotsaText;
import android.app.Activity;
import android.app.AlertDialog;
@ -35,13 +33,10 @@ import android.os.Message;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.ImageView;
import android.widget.TextView;
@ -59,7 +54,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
private MenuItem mItemOnOff = null; //the menu item which we toggle based on Orbot state
/* Some tracking bits */
private int torStatus = STATUS_READY; //latest status reported from the tor service
private int torStatus = TorServiceConstants.STATUS_OFF; //latest status reported from the tor service
// this is a value we get passed back from the TorService
/* Tor Service interaction */
@ -175,7 +170,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
{
}
else if (mService.getStatus() == STATUS_READY)
else if (mService.getStatus() == TorServiceConstants.STATUS_OFF)
{
if (mItemOnOff != null)
mItemOnOff.setTitle(R.string.menu_stop);
@ -573,7 +568,7 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
if (imgStatus != null)
{
if (torStatus == STATUS_ON)
if (torStatus == TorServiceConstants.STATUS_ON)
{
imgStatus.setImageResource(R.drawable.toron);
@ -584,8 +579,11 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants
lblStatus.setText(lblMsg);
if (torServiceMsg.length() > 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));
startTor();
}
else
{
stopTor();
}
createProgressDialog(getString(R.string.status_starting_up));
startTor();
}
catch (Exception e)
else
{
Log.d(TAG,"error onclick",e);
stopTor();
}
return true;
}
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:

View File

@ -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";
}

View File

@ -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;
try
{
InputStream is;
is = context.getResources().openRawResource(R.raw.tor);
streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, false, true);
is = context.getResources().openRawResource(R.raw.toraa);
streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, false);
is = context.getResources().openRawResource(R.raw.torrc);
streamToFile(is,installFolder, TORRC_ASSET_KEY, false, false);
is = context.getResources().openRawResource(R.raw.torab);
streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, true);
is = context.getResources().openRawResource(R.raw.torrctether);
streamToFile(is,installFolder, TORRC_TETHER_KEY, false, false);
is = context.getResources().openRawResource(R.raw.torac);
streamToFile(is,installFolder, TOR_BINARY_ASSET_KEY, true);
is = context.getResources().openRawResource(R.raw.privoxy);
streamToFile(is,installFolder, PRIVOXY_ASSET_KEY, false, false);
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);
}
catch (IOException ioe)
{
Log.e(TAG, "unable to install tor binaries from raw", ioe);
return 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);
}
}

View File

@ -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,6 +911,7 @@ 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 ();
@ -917,7 +919,6 @@ public class TorService extends Service implements TorServiceConstants, Runnable
}
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);

View File

@ -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
@ -28,6 +28,9 @@ 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";

View File

@ -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);
}
}

View File

@ -2,15 +2,15 @@ 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 {

View File

@ -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.
*/

View File

@ -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<cursor.getColumnCount();i++)
Log.w("TestApp", "Column: " + cursor.getColumnName(i) + " , value: " + cursor.getString(i));
} finally {
if (cursor != null)
cursor.close();
}
}
/*
To append a rule that dropped all UDP traffic to the end of the OUTPUT chain would look like this:
*/
public void append ()
{
Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI,
Netfilter.Filter.Chains.OUTPUT);
ContentValues values = new ContentValues();
values.put(Netfilter.Filter.TARGET, Netfilter.Targets.DROP);
values.put(Netfilter.Filter.PROTOCOL, Netfilter.Protocols.UDP);
context.getContentResolver().insert(uri, values);
}
/*
iptables rule indexes start at 1. To insert the same rule in the first position of the OUTPUT chain, rather than appending it to the end of the chain, would look like this:
*/
public void insert ()
{
Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI,
Netfilter.Filter.Chains.OUTPUT);
ContentValues values = new ContentValues();
values.put(Netfilter.Filter.TARGET, Netfilter.Targets.DROP);
values.put(Netfilter.Filter.PROTOCOL, Netfilter.Protocols.UDP);
values.put(Netfilter.Filter.ROW_ID, 1);
context.getContentResolver().insert(uri, values);
}
}

View File

@ -1,7 +1,7 @@
/* 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 java.util.Arrays;
import java.util.Comparator;
@ -9,6 +9,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import org.torproject.android.R;
import org.torproject.android.TorConstants;
import org.torproject.android.R.id;
import org.torproject.android.R.layout;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
@ -23,6 +28,7 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
@ -50,8 +56,6 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
mAppManager = this;
}
@ -61,6 +65,16 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
super.onResume();
listApps = (ListView)findViewById(R.id.applistview);
Button btnSave = (Button)findViewById(R.id.btnsave);
btnSave.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v) {
finish();
}
});
if (!appsLoaded)
loadApps();
}
@ -174,6 +188,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
List<ApplicationInfo> lAppInfo = pMgr.getInstalledApplications(0);
Iterator<ApplicationInfo> itAppInfo = lAppInfo.iterator();
apps = new TorifiedApp[lAppInfo.size()];

View File

@ -1,4 +1,4 @@
package org.torproject.android;
package org.torproject.android.settings;
import org.torproject.android.service.ITorService;

View File

@ -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);
}
}

View File

@ -1,4 +1,4 @@
package org.torproject.android;
package org.torproject.android.settings;
import android.graphics.drawable.Drawable;

View File

@ -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;
@ -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,14 +117,30 @@ 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);
}
}

View File

@ -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;

View File

@ -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);
boolean isRootPossible = TorServiceUtils.isRootPossible();
Editor pEdit = prefs.edit();
pEdit.putBoolean("has_root",hasRoot);
pEdit.commit();
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,6 +212,8 @@ 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);

View File

@ -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 {
}
}*/
}

View File

@ -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() {