[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] add "minimal permission" build for SDK 16 to 22 devices



commit 028f76e62ea31f44c68846ce6ec5296aae96823b
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date:   Fri Jun 9 02:01:42 2017 -0400

    add "minimal permission" build for SDK 16 to 22 devices
    - these platforms don't allow for runtime permissions requests and the new permissions we are asking for can be alarming
    - we will disable the advanced hidden service features on these devices
---
 app/build.gradle                            |  13 ++-
 app/src/minimalperm/AndroidManifest.xml     | 165 ++++++++++++++++++++++++++++
 app/src/minimalperm/res/menu/orbot_main.xml |  80 ++++++++++++++
 3 files changed, 254 insertions(+), 4 deletions(-)

diff --git a/app/build.gradle b/app/build.gradle
index 38f2169..e21a302 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -3,26 +3,31 @@ apply plugin: 'com.android.application'
 android {
     compileSdkVersion 25
     buildToolsVersion "25"
-
     defaultConfig {
         applicationId "org.torproject.android"
-        minSdkVersion 16
+        minSdkVersion 23
         targetSdkVersion 25
     }
-
     lintOptions {
         checkReleaseBuilds false
         // Or, if you prefer, you can continue to check for errors in release builds,
         // but continue the build even when errors are found:
         abortOnError false
     }
-
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
         }
     }
+    productFlavors {
+        minimalperm {
+            minSdkVersion 16
+            applicationId 'org.torproject.android'
+            targetSdkVersion 22
+            maxSdkVersion 22
+        }
+    }
 }
 
 dependencies {
diff --git a/app/src/minimalperm/AndroidManifest.xml b/app/src/minimalperm/AndroidManifest.xml
new file mode 100644
index 0000000..523938a
--- /dev/null
+++ b/app/src/minimalperm/AndroidManifest.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android";
+    package="org.torproject.android"
+    android:installLocation="auto"
+    android:versionCode="15410000"
+    android:versionName="15.4.1-RC-1-multi">
+
+    <uses-sdk
+        android:minSdkVersion="16"
+        android:maxSdkVersion="22"
+        android:targetSdkVersion="22" />
+
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+    <uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
+
+    <application
+        android:name=".OrbotApp"
+        android:allowBackup="false"
+        android:allowClearUserData="true"
+        android:configChanges="locale|orientation|screenSize"
+        android:description="@string/app_description"
+        android:hardwareAccelerated="false"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:largeHeap="false"
+        android:theme="@style/DefaultTheme">
+        <activity
+            android:name=".OrbotMainActivity"
+            android:excludeFromRecents="true"
+            android:launchMode="singleTop">
+            <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" />
+
+                <data android:scheme="bridge" />
+            </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>
+
+		<!--         This is for ensuring the background service still runs when/if the app is swiped away -->
+        <activity
+            android:name=".service.util.DummyActivity"
+            android:allowTaskReparenting="true"
+            android:alwaysRetainTaskState="false"
+            android:clearTaskOnLaunch="true"
+            android:enabled="true"
+            android:excludeFromRecents="true"
+            android:finishOnTaskLaunch="true"
+            android:noHistory="true"
+            android:stateNotNeeded="true"
+            android:theme="@android:style/Theme.Translucent" />
+        <activity
+            android:name=".vpn.VPNEnableActivity"
+            android:exported="false"
+            android:label="@string/app_name" />
+        <activity
+            android:name=".ui.PromoAppsActivity"
+            android:exported="false" />
+        <activity
+            android:name=".settings.SettingsPreferences"
+            android:label="@string/app_name" />
+        <activity
+            android:name=".ui.AppManager"
+            android:label="@string/app_name"
+            android:theme="@style/Theme.AppCompat" />
+
+        <service
+            android:name=".service.TorService"
+            android:enabled="true"
+            android:permission="android.permission.BIND_VPN_SERVICE"
+            android:stopWithTask="false"></service>
+        <service
+            android:name=".service.vpn.TorVpnService"
+            android:enabled="true"
+            android:permission="android.permission.BIND_VPN_SERVICE">
+            <intent-filter>
+                <action android:name="android.net.VpnService" />
+            </intent-filter>
+        </service>
+
+        <receiver
+            android:name=".service.StartTorReceiver"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="org.torproject.android.intent.action.START" />
+            </intent-filter>
+        </receiver>
+        <receiver
+            android:name=".OnBootReceiver"
+            android:enabled="true"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+
+                <category android:name="android.intent.category.HOME" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
+
+                <category android:name="android.intent.category.HOME" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.MEDIA_MOUNTED" />
+
+                <category android:name="android.intent.category.HOME" />
+            </intent-filter>
+        </receiver>
+
+        <activity
+            android:name=".ui.hiddenservices.HiddenServicesActivity"
+            android:label="@string/title_activity_hidden_services"
+            android:theme="@style/DefaultTheme">
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value=".OrbotMainActivity" />
+        </activity>
+
+        <provider
+            android:name=".ui.hiddenservices.providers.HSContentProvider"
+            android:authorities="org.torproject.android.ui.hiddenservices.providers"
+            android:exported="false" />
+        <provider
+            android:name="android.support.v4.content.FileProvider"
+            android:authorities="org.torproject.android.ui.hiddenservices.storage"
+            android:exported="false"
+            android:grantUriPermissions="true">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/hidden_services_paths" />
+        </provider>
+
+        <activity
+            android:name=".ui.hiddenservices.ClientCookiesActivity"
+            android:label="@string/client_cookies"
+            android:theme="@style/DefaultTheme">
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value=".OrbotMainActivity" />
+        </activity>
+
+        <provider
+            android:name=".ui.hiddenservices.providers.CookieContentProvider"
+            android:authorities="org.torproject.android.ui.hiddenservices.providers.cookie"
+            android:exported="false" />
+    </application>
+
+</manifest>
diff --git a/app/src/minimalperm/res/menu/orbot_main.xml b/app/src/minimalperm/res/menu/orbot_main.xml
new file mode 100644
index 0000000..6685baa
--- /dev/null
+++ b/app/src/minimalperm/res/menu/orbot_main.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright (C) 2008 Esmertec AG.
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * 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.
+ */
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android";
+    xmlns:yourapp="http://schemas.android.com/apk/res-auto";
+    >
+
+ <item android:id="@+id/menu_settings"
+        android:title="@string/menu_settings"
+         android:icon="@drawable/ic_action_settings"
+         yourapp:showAsAction="never"
+         />
+
+ <item
+        android:title="@string/menu_qr"
+     yourapp:showAsAction="never"
+         >
+  <menu>
+  <item android:id="@+id/menu_scan"
+        android:title="@string/menu_scan"
+      yourapp:showAsAction="never"
+         />
+  
+  <item android:id="@+id/menu_share_bridge"
+        android:title="@string/menu_share_bridge"
+      yourapp:showAsAction="never"
+         />
+  </menu>
+ </item>
+
+    <!--
+    <item
+        android:title="@string/menu_hidden_services"
+        yourapp:showAsAction="never"
+        >
+      <menu>
+        <item android:id="@+id/menu_hidden_services"
+              android:title="@string/hosted_services"
+            yourapp:showAsAction="never"
+               />
+
+        <item android:id="@+id/menu_client_cookies"
+              android:title="@string/client_cookies"
+            yourapp:showAsAction="never"
+               />
+      </menu>
+    </item>
+        -->
+ 
+  <item android:id="@+id/menu_about"
+        android:title="@string/menu_about"
+         android:icon="@drawable/ic_menu_about"
+      yourapp:showAsAction="never"
+         
+         />
+ 
+  <item android:id="@+id/menu_exit"
+        android:title="@string/menu_exit"
+         android:icon="@drawable/ic_menu_exit"
+      yourapp:showAsAction="never"
+         
+         />
+ 
+</menu>



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits