From 26d938126f9ec9075cfe58efef5830f54a2b2118 Mon Sep 17 00:00:00 2001 From: arrase Date: Thu, 17 Nov 2016 02:27:48 +0100 Subject: [PATCH 01/98] New hidden services management screen and database --- app/build.gradle | 3 +- app/src/main/AndroidManifest.xml | 205 +++--- .../torproject/android/OrbotMainActivity.java | 5 + .../android/settings/SettingsPreferences.java | 20 +- .../android/ui/hs/HiddenServicesActivity.java | 76 +++ .../adapters/CursorRecyclerViewAdapter.java | 144 ++++ .../android/ui/hs/adapters/HSAdapter.java | 54 ++ .../android/ui/hs/database/HSDatabase.java | 33 + .../ui/hs/providers/HSContentProvider.java | 121 ++++ app/src/main/res/layout-v21/onion_item.xml | 25 + .../res/layout/activity_hidden_services.xml | 34 + .../res/layout/content_hidden_services.xml | 22 + app/src/main/res/menu/orbot_main.xml | 6 +- app/src/main/res/values-v21/styles.xml | 1 + app/src/main/res/values-w820dp/dimens.xml | 6 + app/src/main/res/values/dimens.xml | 22 +- app/src/main/res/values/strings.xml | 613 +++++++++--------- app/src/main/res/values/styles.xml | 6 + app/src/main/res/xml/preferences.xml | 11 - 19 files changed, 962 insertions(+), 445 deletions(-) create mode 100644 app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java create mode 100644 app/src/main/java/org/torproject/android/ui/hs/adapters/CursorRecyclerViewAdapter.java create mode 100644 app/src/main/java/org/torproject/android/ui/hs/adapters/HSAdapter.java create mode 100644 app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java create mode 100644 app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java create mode 100644 app/src/main/res/layout-v21/onion_item.xml create mode 100644 app/src/main/res/layout/activity_hidden_services.xml create mode 100644 app/src/main/res/layout/content_hidden_services.xml create mode 100644 app/src/main/res/values-v21/styles.xml create mode 100644 app/src/main/res/values-w820dp/dimens.xml diff --git a/app/build.gradle b/app/build.gradle index b9631646..54cbf5f8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,7 +28,8 @@ android { dependencies { compile project(':orbotservice') + compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:appcompat-v7:23.4.0' - + compile 'com.android.support:design:23.4.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 171567ec..57dc32d7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,137 +1,150 @@ - - - - - - - + --> - + + + - > - - + + + + + + android:launchMode="singleTop"> + - - + + + - - + + - + + - - - - - - - - - - - - - + + + + + + + + android:stopWithTask="false" /> + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + - - + + + + \ No newline at end of file diff --git a/app/src/main/java/org/torproject/android/OrbotMainActivity.java b/app/src/main/java/org/torproject/android/OrbotMainActivity.java index c43928e5..762ef8ea 100644 --- a/app/src/main/java/org/torproject/android/OrbotMainActivity.java +++ b/app/src/main/java/org/torproject/android/OrbotMainActivity.java @@ -23,6 +23,7 @@ import org.torproject.android.service.TorServiceConstants; import org.torproject.android.service.util.TorServiceUtils; import org.torproject.android.settings.SettingsPreferences; import org.torproject.android.ui.AppManager; +import org.torproject.android.ui.hs.HiddenServicesActivity; import org.torproject.android.ui.ImageProgressView; import org.torproject.android.ui.PromoAppsActivity; import org.torproject.android.ui.Rotate3dAnimation; @@ -478,6 +479,10 @@ public class OrbotMainActivity extends AppCompatActivity } } + } + else if (item.getItemId() == R.id.menu_hidden_services) + { + startActivity(new Intent(this, HiddenServicesActivity.class)); } return super.onOptionsItemSelected(item); diff --git a/app/src/main/java/org/torproject/android/settings/SettingsPreferences.java b/app/src/main/java/org/torproject/android/settings/SettingsPreferences.java index c14cb5a4..adacba72 100644 --- a/app/src/main/java/org/torproject/android/settings/SettingsPreferences.java +++ b/app/src/main/java/org/torproject/android/settings/SettingsPreferences.java @@ -37,9 +37,6 @@ public class SettingsPreferences private Preference prefTransProxyFlush = null; private Preference prefTransProxyApps = null; - private CheckBoxPreference prefHiddenServices = null; - private EditTextPreference prefHiddenServicesPorts; - private EditTextPreference prefHiddenServicesHostname; private CheckBoxPreference prefRequestRoot = null; private ListPreference prefLocale = null; @@ -104,22 +101,14 @@ public class SettingsPreferences prefTransProxyApps.setOnPreferenceClickListener(this); prefCBTransProxy.setOnPreferenceClickListener(this); prefcBTransProxyAll.setOnPreferenceClickListener(this); - prefHiddenServices = (CheckBoxPreference) findPreference("pref_hs_enable"); - prefHiddenServices.setOnPreferenceClickListener(this); - prefHiddenServicesHostname = (EditTextPreference) findPreference("pref_hs_hostname"); - - + prefCBTransProxy.setEnabled(prefRequestRoot.isChecked()); prefcBTransProxyAll.setEnabled(prefCBTransProxy.isChecked()); prefcbTransTethering.setEnabled(prefCBTransProxy.isChecked()); if (prefCBTransProxy.isChecked()) prefTransProxyApps.setEnabled((!prefcBTransProxyAll.isChecked())); - - prefHiddenServicesPorts = (EditTextPreference) findPreference("pref_hs_ports"); - prefHiddenServicesHostname.setEnabled(prefHiddenServices.isChecked()); - prefHiddenServicesPorts.setEnabled(prefHiddenServices.isChecked()); - + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { prefTransProxyApps.setEnabled(true); @@ -153,11 +142,6 @@ public class SettingsPreferences { startActivity(new Intent(this, AppManager.class)); - } - else if (preference == prefHiddenServices) - { - prefHiddenServicesPorts.setEnabled(prefHiddenServices.isChecked()); - prefHiddenServicesHostname.setEnabled(prefHiddenServices.isChecked()); } else { diff --git a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java new file mode 100644 index 00000000..85665fb6 --- /dev/null +++ b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java @@ -0,0 +1,76 @@ +package org.torproject.android.ui.hs; + +import android.content.ContentResolver; +import android.database.ContentObserver; +import android.os.Bundle; +import android.os.Handler; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.Toolbar; +import android.view.View; + +import org.torproject.android.R; +import org.torproject.android.ui.hs.adapters.HSAdapter; +import org.torproject.android.ui.hs.providers.HSContentProvider; + +public class HiddenServicesActivity extends AppCompatActivity { + private HSAdapter mHiddenServices; + private ContentResolver mCR; + private HSObserver mHSObserver; + private String[] mProjection = new String[]{ + HSContentProvider.HiddenService._ID, + HSContentProvider.HiddenService.NAME, + HSContentProvider.HiddenService.DOMAIN, + HSContentProvider.HiddenService.PORT}; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_hidden_services); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + + mCR = getContentResolver(); + // View adapter + mHiddenServices = new HSAdapter( + mCR.query( + HSContentProvider.CONTENT_URI, mProjection, null, null, null + )); + + mHSObserver = new HSObserver(new Handler()); + mCR.registerContentObserver(HSContentProvider.CONTENT_URI, true, mHSObserver); + + // Fill view + RecyclerView mRecyclerView = (RecyclerView) findViewById(R.id.onion_list); + mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); + mRecyclerView.setAdapter(mHiddenServices); + } + + class HSObserver extends ContentObserver { + public HSObserver(Handler handler) { + super(handler); + } + + @Override + public void onChange(boolean selfChange) { + // New data + mHiddenServices.changeCursor(mCR.query( + HSContentProvider.CONTENT_URI, mProjection, null, null, null + )); + } + + } + +} diff --git a/app/src/main/java/org/torproject/android/ui/hs/adapters/CursorRecyclerViewAdapter.java b/app/src/main/java/org/torproject/android/ui/hs/adapters/CursorRecyclerViewAdapter.java new file mode 100644 index 00000000..97984132 --- /dev/null +++ b/app/src/main/java/org/torproject/android/ui/hs/adapters/CursorRecyclerViewAdapter.java @@ -0,0 +1,144 @@ +package org.torproject.android.ui.hs.adapters; + +/* + * Copyright (C) 2014 skyfish.jy@gmail.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import android.database.Cursor; +import android.database.DataSetObserver; +import android.support.v7.widget.RecyclerView; + +/** + * Created by skyfishjy on 10/31/14. + */ + +public abstract class CursorRecyclerViewAdapter extends RecyclerView.Adapter { + + private Cursor mCursor; + + private boolean mDataValid; + + private int mRowIdColumn; + + private DataSetObserver mDataSetObserver; + + public CursorRecyclerViewAdapter(Cursor cursor) { + mCursor = cursor; + mDataValid = cursor != null; + mRowIdColumn = mDataValid ? mCursor.getColumnIndex("_id") : -1; + mDataSetObserver = new NotifyingDataSetObserver(); + if (mCursor != null) { + mCursor.registerDataSetObserver(mDataSetObserver); + } + } + + @Override + public int getItemCount() { + if (mDataValid && mCursor != null) { + return mCursor.getCount(); + } + return 0; + } + + @Override + public long getItemId(int position) { + if (mDataValid && mCursor != null && mCursor.moveToPosition(position)) { + return mCursor.getLong(mRowIdColumn); + } + return 0; + } + + @Override + public void setHasStableIds(boolean hasStableIds) { + super.setHasStableIds(true); + } + + public abstract void onBindViewHolder(VH viewHolder, Cursor cursor); + + @Override + public void onBindViewHolder(VH viewHolder, int position) { + if (!mDataValid) { + throw new IllegalStateException("this should only be called when the cursor is valid"); + } + if (!mCursor.moveToPosition(position)) { + throw new IllegalStateException("couldn't move cursor to position " + position); + } + onBindViewHolder(viewHolder, mCursor); + } + + /** + * Change the underlying cursor to a new cursor. If there is an existing cursor it will be + * closed. + */ + public void changeCursor(Cursor cursor) { + Cursor old = swapCursor(cursor); + if (old != null) { + old.close(); + } + } + + public void closeCursor() { + mCursor.unregisterDataSetObserver(mDataSetObserver); + mCursor.close(); + } + + /** + * Swap in a new Cursor, returning the old Cursor. Unlike + * {@link #changeCursor(Cursor)}, the returned old Cursor is not + * closed. + */ + private Cursor swapCursor(Cursor newCursor) { + if (newCursor == mCursor) { + return null; + } + final Cursor oldCursor = mCursor; + if (oldCursor != null && mDataSetObserver != null) { + oldCursor.unregisterDataSetObserver(mDataSetObserver); + } + mCursor = newCursor; + if (mCursor != null) { + if (mDataSetObserver != null) { + mCursor.registerDataSetObserver(mDataSetObserver); + } + mRowIdColumn = newCursor.getColumnIndexOrThrow("_id"); + mDataValid = true; + notifyDataSetChanged(); + } else { + mRowIdColumn = -1; + mDataValid = false; + notifyDataSetChanged(); + //There is no notifyDataSetInvalidated() method in RecyclerView.Adapter + } + return oldCursor; + } + + private class NotifyingDataSetObserver extends DataSetObserver { + @Override + public void onChanged() { + super.onChanged(); + mDataValid = true; + notifyDataSetChanged(); + } + + @Override + public void onInvalidated() { + super.onInvalidated(); + mDataValid = false; + notifyDataSetChanged(); + //There is no notifyDataSetInvalidated() method in RecyclerView.Adapter + } + } +} \ No newline at end of file diff --git a/app/src/main/java/org/torproject/android/ui/hs/adapters/HSAdapter.java b/app/src/main/java/org/torproject/android/ui/hs/adapters/HSAdapter.java new file mode 100644 index 00000000..66ecb22f --- /dev/null +++ b/app/src/main/java/org/torproject/android/ui/hs/adapters/HSAdapter.java @@ -0,0 +1,54 @@ +package org.torproject.android.ui.hs.adapters; + +import android.database.Cursor; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.torproject.android.R; +import org.torproject.android.ui.hs.providers.HSContentProvider; + +public class HSAdapter extends CursorRecyclerViewAdapter { + + public HSAdapter(Cursor cursor) { + super(cursor); + } + + @Override + public HSAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View v = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.onion_item, parent, false); + + ViewHolder vh = new ViewHolder(v); + + return vh; + } + + @Override + public void onBindViewHolder(ViewHolder viewHolder, Cursor cursor) { + viewHolder.id = cursor.getInt(cursor.getColumnIndex(HSContentProvider.HiddenService._ID)); + + String name_string = cursor.getString(cursor.getColumnIndex(HSContentProvider.HiddenService.NAME)); + Integer port = cursor.getInt(cursor.getColumnIndex(HSContentProvider.HiddenService.PORT)); + + viewHolder.name.setText(name_string + ": " + port.toString()); + + viewHolder.domain.setText( + cursor.getString(cursor.getColumnIndex(HSContentProvider.HiddenService.DOMAIN)) + ); + } + + class ViewHolder extends RecyclerView.ViewHolder { + TextView name; + TextView domain; + Integer id; + + ViewHolder(View itemView) { + super(itemView); + name = (TextView) itemView.findViewById(R.id.hs_name); + domain = (TextView) itemView.findViewById(R.id.hs_onion); + } + } +} diff --git a/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java b/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java new file mode 100644 index 00000000..9cbaacc0 --- /dev/null +++ b/app/src/main/java/org/torproject/android/ui/hs/database/HSDatabase.java @@ -0,0 +1,33 @@ +package org.torproject.android.ui.hs.database; + + +import android.content.Context; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; + +public class HSDatabase extends SQLiteOpenHelper { + + public static final String HS_DATA_TABLE_NAME = "hs_data"; + private static final int DATABASE_VERSION = 2; + private static final String DATABASE_NAME = "hidden_services"; + private static final String HS_DATA_TABLE_CREATE = + "CREATE TABLE " + HS_DATA_TABLE_NAME + " (" + + "_id INTEGER PRIMARY KEY AUTOINCREMENT, " + + "name TEXT, " + + "domain TEXT, " + + "port INTEGER);"; + + public HSDatabase(Context context) { + super(context, DATABASE_NAME, null, DATABASE_VERSION); + } + + @Override + public void onCreate(SQLiteDatabase db) { + db.execSQL(HS_DATA_TABLE_CREATE); + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + } +} + diff --git a/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java b/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java new file mode 100644 index 00000000..3714e64c --- /dev/null +++ b/app/src/main/java/org/torproject/android/ui/hs/providers/HSContentProvider.java @@ -0,0 +1,121 @@ +package org.torproject.android.ui.hs.providers; + +import android.content.ContentProvider; +import android.content.ContentUris; +import android.content.ContentValues; +import android.content.Context; +import android.content.UriMatcher; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.net.Uri; +import android.provider.BaseColumns; +import android.support.annotation.Nullable; + +import org.torproject.android.ui.hs.database.HSDatabase; + + +public class HSContentProvider extends ContentProvider { + private static final String AUTH = "org.torproject.android.ui.hs.providers"; + public static final Uri CONTENT_URI = + Uri.parse("content://" + AUTH + "/hs"); + //UriMatcher + private static final int ONIONS = 1; + private static final int ONION_ID = 2; + + private static final UriMatcher uriMatcher; + + //Inicializamos el UriMatcher + static { + uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); + uriMatcher.addURI(AUTH, "hs", ONIONS); + uriMatcher.addURI(AUTH, "hs/#", ONION_ID); + } + + private HSDatabase mServerDB; + private Context mContext; + + @Override + public boolean onCreate() { + mContext = getContext(); + mServerDB = new HSDatabase(mContext); + return true; + } + + @Nullable + @Override + public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { + //Si es una consulta a un ID concreto construimos el WHERE + String where = selection; + if (uriMatcher.match(uri) == ONION_ID) { + where = "_id=" + uri.getLastPathSegment(); + } + + SQLiteDatabase db = mServerDB.getReadableDatabase(); + + return db.query(HSDatabase.HS_DATA_TABLE_NAME, projection, where, + selectionArgs, null, null, sortOrder); + } + + @Nullable + @Override + public String getType(Uri uri) { + int match = uriMatcher.match(uri); + + switch (match) { + case ONIONS: + return "vnd.android.cursor.dir/vnd.torproject.onions"; + case ONION_ID: + return "vnd.android.cursor.item/vnd.torproject.onion"; + default: + return null; + } + } + + @Nullable + @Override + public Uri insert(Uri uri, ContentValues values) { + long regId; + + SQLiteDatabase db = mServerDB.getWritableDatabase(); + + regId = db.insert(HSDatabase.HS_DATA_TABLE_NAME, null, values); + + mContext.getContentResolver().notifyChange(CONTENT_URI, null); + + return ContentUris.withAppendedId(CONTENT_URI, regId); + } + + @Override + public int delete(Uri uri, String selection, String[] selectionArgs) { + + //Si es una consulta a un ID concreto construimos el WHERE + String where = selection; + if (uriMatcher.match(uri) == ONION_ID) { + where = "_id=" + uri.getLastPathSegment(); + } + + SQLiteDatabase db = mServerDB.getWritableDatabase(); + + Integer rows = db.delete(HSDatabase.HS_DATA_TABLE_NAME, where, selectionArgs); + + mContext.getContentResolver().notifyChange(CONTENT_URI, null); + + return rows; + + } + + @Override + public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { + return 0; + } + + public static final class HiddenService implements BaseColumns { + //Nombres de columnas + public static final String NAME = "name"; + public static final String PORT = "port"; + public static final String DOMAIN = "domain"; + + private HiddenService() { + } + } +} diff --git a/app/src/main/res/layout-v21/onion_item.xml b/app/src/main/res/layout-v21/onion_item.xml new file mode 100644 index 00000000..2d6aa054 --- /dev/null +++ b/app/src/main/res/layout-v21/onion_item.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_hidden_services.xml b/app/src/main/res/layout/activity_hidden_services.xml new file mode 100644 index 00000000..a2e86638 --- /dev/null +++ b/app/src/main/res/layout/activity_hidden_services.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/content_hidden_services.xml b/app/src/main/res/layout/content_hidden_services.xml new file mode 100644 index 00000000..ba760de1 --- /dev/null +++ b/app/src/main/res/layout/content_hidden_services.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/app/src/main/res/menu/orbot_main.xml b/app/src/main/res/menu/orbot_main.xml index 54d24937..179675ab 100644 --- a/app/src/main/res/menu/orbot_main.xml +++ b/app/src/main/res/menu/orbot_main.xml @@ -43,7 +43,11 @@ /> - + + + 64dp + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index f96195c8..c719a5be 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,5 +1,4 @@ - - - 65% + 65% - 320dp + 320dp - 320dp + 320dp - 80% + 80% - 100% + 100% 0dp 16dip - 0x02000000 + 0x02000000 + 0x02000000 @@ -148,7 +148,7 @@ - 95% + 95% 64dp @@ -358,4 +358,8 @@ -1px + + 16dp + 16dp + 16dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 26a7aeb7..bd93d6d8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,257 +1,251 @@ - Orbot - Orbot is a free proxy app that empowers other apps to use the internet more securely. Orbot uses Tor to encrypt your Internet traffic and then hides it by bouncing through a series of computers around the world. 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. - http://orbot/ - http://check.torproject.org - https://check.torproject.org - https://check.torproject.org/?TorButton=true - start and stop Tor - torproxyservice - Orbot is starting… - Connected to the Tor network - Orbot is deactivated - TorService is shutting down - 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:9050 - Home - Browse - Settings - Log - Help - VPN - Start - Stop - About - Get apps… - Download - Upload - Help - Close - About - Clear Log - Check - Exit - Scan BridgeQR - Share BridgeQR - - long press to start - - Transparent Proxying (Requires Root) - Transparent Proxying - Automatic Torifying of Apps - Tor Everything - Proxy traffic for all apps through Tor - Port Proxy Fallback - WARNING: Circumvents common ports (80, 443, etc). *USE ONLY* if \'All\' or \'App\' mode doesn\'t work. - Port List - List of ports to proxy. *USE ONLY* if \'All\' or \'App\' mode doesn\'t work - Enter ports to proxy - Request Root Access - Request root access for transparent proxying - Tor binaries successfully installed! - The Tor binary files were unable to be installed. Please check the log and notify tor-assistants@torproject.org - Application Error - Orbot - About Orbot - Next - Back - Finish - Okay - Cancel - - Some Orbot Details - Orbot is an open-source application that contains Tor, LibEvent and Polipo. 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 - Orbot Permissions - Excellent! We\'ve detected that you have root permissions enabled for Orbot. We will use this power wisely. - 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 Superuser - Grant Root for Orbot - Configure Torification - Orbot gives you the option to route all application traffic through Tor OR to choose your applications individually. - Proxy All Apps Through Tor - Select Individual Apps for Tor - Orbot-enabled Apps - The apps below were developed to work with Orbot. Click each button to install now, or you can find them later on Google Play, at GuardianProject.info website or via F-Droid.org. - ChatSecure - Secure instant messaging client for Android - Proxy Settings - Learn how to configure apps to work with Orbot - DuckDuckGo Search Engine app - Set Twitter proxy to host \"localhost\" and port 8118 - StoryMaker - Make a story and leave it to tor for security! - https://guardianproject.info/2012/05/02/orbot-your-twitter/ - Proxy Settings - If the Android app you are using can support the use of an HTTP or SOCKS proxy, then you can configure it to connect to Orbot and use Tor.\n\n\n The host settings is 127.0.0.1 or \"localhost\". For HTTP, the port setting is 8118. For SOCKS, the proxy is 9050. You should use SOCKS4A or SOCKS5 if possible.\n \n\n\n You can learn more about proxying on Android via the FAQ at: http://tinyurl.com/proxyandroid\n - Orbot is ready! - Millions 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! - Please configure Orbot before you can start using it! - - You\'ve successfully connected to the Tor network - but this does NOT mean your device is secure. You can use the \'Browser\' button to test your connection. \n\nVisit us at https://guardianproject.info/apps/orbot or send an email to help@guardianproject.info to learn more. - 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 Service Hosting - General - Start Orbot on Boot - Automatically start Orbot and connect Tor when your Android device boots - - - 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\nYou must properly configure Orbot, your device and other apps to successfully use Tor. - - Permissions - 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 does not appear to be rooted or provide root or \'Superuser\' access.\n\nPlease try the \'Apps\' mode on the main screen instead. - - Orbot-Enabled Apps - ChatSecure: Secure chat app with Off-the-Record Encryption - Orfox: Privacy-enhanced browser that works through Tor - Find all Guardian Project apps on Google Play - Find all Guardian Project apps on F-Droid - Find all Guardian Project apps on https://f-droid.org - - 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) - None - Tor Tethering - Enable Tor Transparent Proxying for Wifi and USB Tethered Devices (requires restart) - Request Superuser Access - Select Apps - Choose Apps to Route Through Tor - Node Configuration - These are advanced settings that can reduce your anonymity - Entrance Nodes - Fingerprints, nicks, countries and addresses for the first hop - Enter Entrance Nodes - Allow Background Starts - Let any app tell Orbot to start Tor and related services - - Proxy All - Proxy None - Invert Selection + Orbot + Orbot is a free proxy app that empowers other apps to use the internet more securely. Orbot uses Tor to encrypt your Internet traffic and then hides it by bouncing through a series of computers around the world. 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. + http://orbot/ + http://check.torproject.org + https://check.torproject.org + https://check.torproject.org/?TorButton=true + start and stop Tor + torproxyservice + Orbot is starting… + Connected to the Tor network + Orbot is deactivated + TorService is shutting down + 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:9050 + Home + Browse + Settings + Log + Help + VPN + Start + Stop + About + Get apps… + Download + Upload + Help + Close + About + Clear Log + Check + Exit + Scan BridgeQR + Share BridgeQR + - long press to start - + Transparent Proxying (Requires Root) + Transparent Proxying + Automatic Torifying of Apps + Tor Everything + Proxy traffic for all apps through Tor + Port Proxy Fallback + WARNING: Circumvents common ports (80, 443, etc). *USE ONLY* if \'All\' or \'App\' mode doesn\'t work. + Port List + List of ports to proxy. *USE ONLY* if \'All\' or \'App\' mode doesn\'t work + Enter ports to proxy + Request Root Access + Request root access for transparent proxying + Tor binaries successfully installed! + The Tor binary files were unable to be installed. Please check the log and notify tor-assistants@torproject.org + Application Error + Orbot + About Orbot + Next + Back + Finish + Okay + Cancel + + Some Orbot Details + Orbot is an open-source application that contains Tor, LibEvent and Polipo. 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 + Orbot Permissions + Excellent! We\'ve detected that you have root permissions enabled for Orbot. We will use this power wisely. + 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 Superuser + Grant Root for Orbot + Configure Torification + Orbot gives you the option to route all application traffic through Tor OR to choose your applications individually. + Proxy All Apps Through Tor + Select Individual Apps for Tor + Orbot-enabled Apps + The apps below were developed to work with Orbot. Click each button to install now, or you can find them later on Google Play, at GuardianProject.info website or via F-Droid.org. + ChatSecure - Secure instant messaging client for Android + Proxy Settings - Learn how to configure apps to work with Orbot + DuckDuckGo Search Engine app + Set Twitter proxy to host \"localhost\" and port 8118 + StoryMaker - Make a story and leave it to tor for security! + https://guardianproject.info/2012/05/02/orbot-your-twitter/ + Proxy Settings + If the Android app you are using can support the use of an HTTP or SOCKS proxy, then you can configure it to connect to Orbot and use Tor.\n\n\n The host settings is 127.0.0.1 or \"localhost\". For HTTP, the port setting is 8118. For SOCKS, the proxy is 9050. You should use SOCKS4A or SOCKS5 if possible.\n \n\n\n You can learn more about proxying on Android via the FAQ at: http://tinyurl.com/proxyandroid\n + Orbot is ready! + Millions 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! + Please configure Orbot before you can start using it! + + You\'ve successfully connected to the Tor network - but this does NOT mean your device is secure. You can use the \'Browser\' button to test your connection. \n\nVisit us at https://guardianproject.info/apps/orbot or send an email to help@guardianproject.info to learn more. + 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. + General + Start Orbot on Boot + Automatically start Orbot and connect Tor when your Android device boots + + + 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\nYou must properly configure Orbot, your device and other apps to successfully use Tor. + + Permissions + 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 does not appear to be rooted or provide root or \'Superuser\' access.\n\nPlease try the \'Apps\' mode on the main screen instead. + + Orbot-Enabled Apps + ChatSecure: Secure chat app with Off-the-Record Encryption + Orfox: Privacy-enhanced browser that works through Tor + Find all Guardian Project apps on Google Play + Find all Guardian Project apps on F-Droid + Find all Guardian Project apps on https://f-droid.org + + 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) + None + Tor Tethering + Enable Tor Transparent Proxying for Wifi and USB Tethered Devices (requires restart) + Request Superuser Access + Select Apps + Choose Apps to Route Through Tor + Node Configuration + These are advanced settings that can reduce your anonymity + Entrance Nodes + Fingerprints, nicks, countries and addresses for the first hop + Enter Entrance Nodes + Allow Background Starts + Let any app tell Orbot to start Tor and related services - Outbound Network Proxy (Optional) - - Outbound Proxy Type - Protocol to use for proxy server: HTTP, HTTPS, Socks4, Socks5 - Enter Proxy Type - - Outbound Proxy Host - Proxy Server hostname - Enter Proxy Host - - Outbound Proxy Port - Proxy Server port - Enter Proxy port + Proxy All + Proxy None + Invert Selection + + Outbound Network Proxy (Optional) + + Outbound Proxy Type + Protocol to use for proxy server: HTTP, HTTPS, Socks4, Socks5 + Enter Proxy Type + + Outbound Proxy Host + Proxy Server hostname + Enter Proxy Host + + Outbound Proxy Port + Proxy Server port + Enter Proxy port + + Outbound Proxy Username + Proxy Username (Optional) + Enter Proxy Username + + Outbound Proxy Password + Proxy Password (Optional) + Enter Proxy Password + + + Status + Setting up full transparent proxying… + Setting up app-based transparent proxying… + Transparent proxying ENABLED + TransProxy enabled for Tethering! + WARNING: error starting transparent proxying! + TransProxy rules cleared + Couldn\'t start Tor process: + Polipo is running on port: + Setting up port-based transparent proxying… + Bridge Error + In order to use the bridge feature, you must enter at least one bridge IP address. + Send an email to bridges@torproject.org with the line \"get bridges\" by itself in the body of the mail from a gmail account. + Error + Your ReachableAddresses settings caused an exception! + Your relay settings caused an exception! + Exit Nodes + Fingerprints, nicks, countries and addresses for the last hop + Enter Exit Nodes + Exclude Nodes + Fingerprints, nicks, countries and addresses to exclude + Enter Exclude Nodes + Strict Nodes + Use *only* these specified nodes + Bridges + Use Bridges + Obfuscated Bridges + Enable alternate entrance nodes into the Tor Network + Enable if configured bridges are obfuscated bridges + IP address and port of bridges + Enter Bridge Addresses + Relays + Relaying + Enable your device to be a non-exit relay + Relay Port + Listening port for your Tor relay + Enter OR port + Relay nickname + The nickname for your Tor relay + Enter a custom relay nickname + Reachable Addresses + Run as a client behind a firewall with restrictive policies + Reachable ports + Ports reachable behind a restrictive firewall + Enter ports + Hidden Services + enable debug log to output (must use adb or aLogCat to view) + Project Home(s): + https://www.torproject.org/docs/android\nhttps://guardianproject.info/apps/orbot/ + The Tor License + https://torproject.org + 3rd-Party-Software: + Tor: https://www.torproject.org + LibEvent v2.0.21: http://www.monkey.org/~provos/libevent/ + Polipo v1.1.9: https://github.com/jech/polipo + IPtables v1.4.21: http://www.netfilter.org + OpenSSL v1.0.2j: http://www.openssl.org + An app wants to open hidden server port %1$s to the Tor network. This is safe if you trust the app. + found existing Tor process… + Something bad happened. Check the log + hidden service on: + unable to read hidden service name + Unable to start Tor: + Reboot your device, unable to reset Tor! + Use Default Iptables + use the built-in iptables binary instead of the one bundled with Orbot + + The Tor binaries were not able to be installed or upgraded. + + Always keep the icon in toolbar when Orbot is connected + Always-On Notifications + + Show expanded notification with Tor exit country and IP + Expanded Notifications + + Bridges enabled! + + Language + Choose the locale and language for Orbot + Choose Language + Leave default or switch the current language + powered by Tor + Save Settings + No internet connection; Tor is on standby… + Bandwidth: + down + up + No Network Auto-Sleep + Put Tor to sleep when there is no internet available + You\'ve switched to a new Tor identity! - Outbound Proxy Username - Proxy Username (Optional) - Enter Proxy Username - - Outbound Proxy Password - Proxy Password (Optional) - Enter Proxy Password - - - - Status - Setting up full transparent proxying… - Setting up app-based transparent proxying… - Transparent proxying ENABLED - TransProxy enabled for Tethering! - WARNING: error starting transparent proxying! - TransProxy rules cleared - Couldn\'t start Tor process: - Polipo is running on port: - Setting up port-based transparent proxying… - Bridge Error - In order to use the bridge feature, you must enter at least one bridge IP address. - Send an email to bridges@torproject.org with the line \"get bridges\" by itself in the body of the mail from a gmail account. - Error - Your ReachableAddresses settings caused an exception! - Your relay settings caused an exception! - Exit Nodes - Fingerprints, nicks, countries and addresses for the last hop - Enter Exit Nodes - Exclude Nodes - Fingerprints, nicks, countries and addresses to exclude - Enter Exclude Nodes - Strict Nodes - Use *only* these specified nodes - Bridges - Use Bridges - Obfuscated Bridges - Enable alternate entrance nodes into the Tor Network - Enable if configured bridges are obfuscated bridges - IP address and port of bridges - Enter Bridge Addresses - Relays - Relaying - Enable your device to be a non-exit relay - Relay Port - Listening port for your Tor relay - Enter OR port - Relay nickname - The nickname for your Tor relay - Enter a custom relay nickname - Reachable Addresses - Run as a client behind a firewall with restrictive policies - Reachable ports - Ports reachable behind a restrictive firewall - Enter ports - Hidden Service Hosting - allow on-device server to be accessible via the Tor network - enter localhost ports for hidden services - Hidden Service Ports - the addressable name for your hidden service (generated automatically) - enable debug log to output (must use adb or aLogCat to view) - Project Home(s): - https://www.torproject.org/docs/android\nhttps://guardianproject.info/apps/orbot/ - The Tor License - https://torproject.org - 3rd-Party-Software: - Tor: https://www.torproject.org - LibEvent v2.0.21: http://www.monkey.org/~provos/libevent/ - Polipo v1.1.9: https://github.com/jech/polipo - IPtables v1.4.21: http://www.netfilter.org - OpenSSL v1.0.2j: http://www.openssl.org - An app wants to open hidden server port %1$s to the Tor network. This is safe if you trust the app. - found existing Tor process… - Something bad happened. Check the log - hidden service on: - unable to read hidden service name - Unable to start Tor: - Reboot your device, unable to reset Tor! - Use Default Iptables - use the built-in iptables binary instead of the one bundled with Orbot - - The Tor binaries were not able to be installed or upgraded. - - Always keep the icon in toolbar when Orbot is connected - Always-On Notifications - - Show expanded notification with Tor exit country and IP - Expanded Notifications - - Bridges enabled! - - Language - Choose the locale and language for Orbot - Choose Language - Leave default or switch the current language - powered by Tor - Save Settings - No internet connection; Tor is on standby… - Bandwidth: - down - up - No Network Auto-Sleep - Put Tor to sleep when there is no internet available - You\'ve switched to a new Tor identity! - Browser Use ChatSecure @@ -262,78 +256,79 @@ No network connectivity. Putting Tor to sleep… Network connectivity is good. Waking Tor up… updating settings in Tor service - + Tor SOCKS Port that Tor offers its SOCKS proxy on (default: 9050 or 0 to disable) SOCKS Port Config - + Tor TransProxy Port Port that Tor offers its Transparent Proxy on (default: 9040 or 0 to disable) TransProxy Port Config - - + + Tor DNS Port Port that Tor offers its DNS on (default: 5400 or 0 to disable) DNS Port Config - - + + Torrc Custom Config EXPERTS ONLY: enter direct torrc config lines Custom Torrc - + Mobile Martus - Benetech Human Rights Documentation App - Your Tor Public IPs: - "Please disable this app in Android->Settings->Apps if you are having problems with Orbot: " - App Conflict - + Your Tor Public IPs: + "Please disable this app in Android->Settings->Apps if you are having problems with Orbot: " + App Conflict - Transproxy Auto-Refresh - Re-apply Transproxy rules when the network state changes - - Transproxy FORCE REMOVE - Tap here to flush all transproxy network rules NOW - Transparent proxy rules flushed! - You do not have ROOT access enabled - You may need to stop and start Orbot for settings change to be enabled. - - Apps - - kbps - - mbps - - KB - - MB - - Bridges Updated - - Please restart Orbot to enable the changes - - QR Codes - - If your mobile network actively blocks Tor, you can use a Bridge to access the network. SELECT one of the bridge types above to enable bridges. - - Bridge Mode - - Email - Web - - Activate - - Apps VPN Mode - - You can enable all apps on your device to run through the Tor network using the VPN feature of Android.\n\n*WARNING* This is a new, experimental feature and in some cases may not start automatically, or may stop. It should NOT be used for anonymity, and ONLY used for getting through firewalls and filters. - - Send Email - - You can get a bridge address through email, the web or by scanning a bridge QR code. Select \'Email\' or \'Web\' below to request a bridge address.\n\nOnce you have an address, copy & paste it into the \"Bridges\" preference in Orbot\'s setting and restart. - - Install Orfox - - Standard Browser - - NOTE: Only standard Tor bridges work on Intel X86/ATOM devices - World (Location) + Transproxy Auto-Refresh + Re-apply Transproxy rules when the network state changes + + Transproxy FORCE REMOVE + Tap here to flush all transproxy network rules NOW + Transparent proxy rules flushed! + You do not have ROOT access enabled + You may need to stop and start Orbot for settings change to be enabled. + + Apps + + kbps + + mbps + + KB + + MB + + Bridges Updated + + Please restart Orbot to enable the changes + + QR Codes + + If your mobile network actively blocks Tor, you can use a Bridge to access the network. SELECT one of the bridge types above to enable bridges. + + Bridge Mode + + Email + Web + + Activate + + Apps VPN Mode + + You can enable all apps on your device to run through the Tor network using the VPN feature of Android.\n\n*WARNING* This is a new, experimental feature and in some cases may not start automatically, or may stop. It should NOT be used for anonymity, and ONLY used for getting through firewalls and filters. + + Send Email + + You can get a bridge address through email, the web or by scanning a bridge QR code. Select \'Email\' or \'Web\' below to request a bridge address.\n\nOnce you have an address, copy & paste it into the \"Bridges\" preference in Orbot\'s setting and restart. + + Install Orfox + + Standard Browser + + NOTE: Only standard Tor bridges work on Intel X86/ATOM devices + + World (Location) + Hidden Services diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index b3fe8af4..6089ad7e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,5 +1,11 @@ +