Updates and fixes

This commit is contained in:
Tad 2019-02-12 16:09:41 -05:00
parent c9e17ffb52
commit b9ff7a74e6
4 changed files with 34 additions and 39 deletions

View File

@ -1,4 +1,4 @@
From d6ba2b0633832e34760e0d38091a10a5488b2b09 Mon Sep 17 00:00:00 2001
From 315dba9fbc687da50f6217ff3db20bb14c11a1a4 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Thu, 20 Sep 2018 21:44:53 -0400
Subject: [PATCH] Add support for routing over Tor
@ -17,12 +17,12 @@ Change-Id: Ibfe080c3d801af34fb64fda1b6b8f4f39a2b1ccf
9 files changed, 130 insertions(+), 5 deletions(-)
diff --git a/res/layout/preferences_dialog.xml b/res/layout/preferences_dialog.xml
index 898f53e..db88a41 100644
index e30c117..f5f3170 100644
--- a/res/layout/preferences_dialog.xml
+++ b/res/layout/preferences_dialog.xml
@@ -15,6 +15,14 @@
android:text="@string/menu_auto_updates_check"
android:textSize="16sp" />
@@ -29,6 +29,14 @@
android:entries="@array/menu_auto_updates_check_interval_entries" />
</LinearLayout>
+ <Switch
+ android:id="@+id/preferences_onion_routing"
@ -36,18 +36,18 @@ index 898f53e..db88a41 100644
android:id="@+id/preferences_auto_delete_updates"
android:layout_width="match_parent"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index aa84059..a85dd6a 100644
index b3ce44e..48d8a81 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -64,6 +64,7 @@
<string name="menu_refresh">Refresh</string>
<string name="menu_preferences">Preferences</string>
<string name="menu_auto_updates_check">Auto updates check</string>
@@ -68,6 +68,7 @@
<string name="menu_auto_updates_check_interval_weekly">Once a week</string>
<string name="menu_auto_updates_check_interval_monthly">Once a month</string>
<string name="menu_auto_updates_check_interval_never">Never</string>
+ <string name="menu_onion_routing">Perform requests over Tor</string>
<string name="menu_auto_delete_updates">Delete updates when installed</string>
<string name="menu_delete_update">Delete</string>
<string name="menu_copy_url">Copy URL</string>
@@ -79,6 +80,7 @@
@@ -83,6 +84,7 @@
<string name="snack_download_failed">The download failed. Please check your internet connection and try again later.</string>
<string name="snack_download_verification_failed">The update verification failed.</string>
<string name="snack_download_verified">Download completed.</string>
@ -56,10 +56,10 @@ index aa84059..a85dd6a 100644
<string name="snack_update_not_installable">This update can\'t be installed on top of the current build.</string>
diff --git a/src/org/lineageos/updater/UpdatesActivity.java b/src/org/lineageos/updater/UpdatesActivity.java
index 2d3fc57..15d4a66 100644
index efea969..6e61129 100644
--- a/src/org/lineageos/updater/UpdatesActivity.java
+++ b/src/org/lineageos/updater/UpdatesActivity.java
@@ -340,10 +340,14 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -341,10 +341,14 @@ public class UpdatesActivity extends UpdatesListActivity {
final DownloadClient downloadClient;
try {
@ -74,32 +74,32 @@ index 2d3fc57..15d4a66 100644
.build();
} catch (IOException exception) {
Log.e(TAG, "Could not build download client");
@@ -407,6 +411,7 @@ public class UpdatesActivity extends UpdatesListActivity {
private void showPreferencesDialog() {
@@ -409,6 +413,7 @@ public class UpdatesActivity extends UpdatesListActivity {
View view = LayoutInflater.from(this).inflate(R.layout.preferences_dialog, null);
Switch autoCheck = view.findViewById(R.id.preferences_auto_updates_check);
Spinner autoCheckInterval =
view.findViewById(R.id.preferences_auto_updates_check_interval);
+ Switch onionRouting = view.findViewById(R.id.preferences_onion_routing);
Switch autoDelete = view.findViewById(R.id.preferences_auto_delete_updates);
Switch dataWarning = view.findViewById(R.id.preferences_mobile_data_warning);
Switch abPerfMode = view.findViewById(R.id.preferences_ab_perf_mode);
@@ -417,6 +422,7 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -419,6 +424,7 @@ public class UpdatesActivity extends UpdatesListActivity {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
autoCheck.setChecked(prefs.getBoolean(Constants.PREF_AUTO_UPDATES_CHECK, true));
autoCheckInterval.setSelection(Utils.getUpdateCheckSetting(this));
+ onionRouting.setChecked(prefs.getBoolean(Constants.PREF_ONION_ROUTING, false));
autoDelete.setChecked(prefs.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, false));
dataWarning.setChecked(prefs.getBoolean(Constants.PREF_MOBILE_DATA_WARNING, true));
abPerfMode.setChecked(prefs.getBoolean(Constants.PREF_AB_PERF_MODE, false));
@@ -428,6 +434,8 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -430,6 +436,8 @@ public class UpdatesActivity extends UpdatesListActivity {
prefs.edit()
.putBoolean(Constants.PREF_AUTO_UPDATES_CHECK,
autoCheck.isChecked())
.putInt(Constants.PREF_AUTO_UPDATES_CHECK_INTERVAL,
autoCheckInterval.getSelectedItemPosition())
+ .putBoolean(Constants.PREF_ONION_ROUTING,
+ onionRouting.isChecked() && Utils.isOrbotInstalled(getApplicationContext()))
.putBoolean(Constants.PREF_AUTO_DELETE_UPDATES,
autoDelete.isChecked())
.putBoolean(Constants.PREF_MOBILE_DATA_WARNING,
@@ -443,6 +451,10 @@ public class UpdatesActivity extends UpdatesListActivity {
@@ -445,6 +453,10 @@ public class UpdatesActivity extends UpdatesListActivity {
UpdatesCheckReceiver.cancelUpdatesCheck(this);
}
@ -111,10 +111,10 @@ index 2d3fc57..15d4a66 100644
mUpdaterService.getUpdaterController().setPerformanceMode(enableABPerfMode);
})
diff --git a/src/org/lineageos/updater/UpdatesCheckReceiver.java b/src/org/lineageos/updater/UpdatesCheckReceiver.java
index c7f1b4e..0abbde5 100644
index d0769cf..b6d32f9 100644
--- a/src/org/lineageos/updater/UpdatesCheckReceiver.java
+++ b/src/org/lineageos/updater/UpdatesCheckReceiver.java
@@ -111,10 +111,14 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
@@ -112,10 +112,14 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
};
try {
@ -280,22 +280,22 @@ index 2b7c80e..caeaf66 100644
mClient.connect();
int responseCode = mClient.getResponseCode();
diff --git a/src/org/lineageos/updater/misc/Constants.java b/src/org/lineageos/updater/misc/Constants.java
index 5bc0e8b..b8a3193 100644
index 81e7c1a..46d8666 100644
--- a/src/org/lineageos/updater/misc/Constants.java
+++ b/src/org/lineageos/updater/misc/Constants.java
@@ -25,6 +25,7 @@ public final class Constants {
@@ -30,6 +30,7 @@ public final class Constants {
public static final String PREF_LAST_UPDATE_CHECK = "last_update_check";
public static final String PREF_AUTO_UPDATES_CHECK = "auto_updates_check";
public static final String PREF_AUTO_UPDATES_CHECK_INTERVAL = "auto_updates_check_interval";
+ public static final String PREF_ONION_ROUTING = "onion_routing";
public static final String PREF_AUTO_DELETE_UPDATES = "auto_delete_updates";
public static final String PREF_AB_PERF_MODE = "ab_perf_mode";
public static final String PREF_MOBILE_DATA_WARNING = "pref_mobile_data_warning";
diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java
index d97a492..a151c75 100644
index 65d6ec7..06838ef 100644
--- a/src/org/lineageos/updater/misc/Utils.java
+++ b/src/org/lineageos/updater/misc/Utils.java
@@ -44,6 +44,7 @@ import java.io.BufferedReader;
@@ -45,6 +45,7 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
@ -303,7 +303,7 @@ index d97a492..a151c75 100644
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
@@ -145,12 +146,76 @@ public class Utils {
@@ -146,12 +147,76 @@ public class Utils {
return updates;
}

View File

@ -80,7 +80,7 @@ git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-11286/ANY/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-11832/ANY/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-11918/ANY/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-11987/ANY/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-13913/ANY/0001.patch
#git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-13913/ANY/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-14634/ANY/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-3563/3.10/0001.patch
git apply $DOS_PATCHES_LINUX_CVES/CVE-2018-5390/3.10/0001.patch

View File

@ -83,7 +83,6 @@ patchWorkspace() {
source build/envsetup.sh;
#repopick 219020; #ab-neverallow-user
repopick 239013; #update webview
repopick -it O_asb_2019-02;
source "$DOS_SCRIPTS/Patch.sh";
source "$DOS_SCRIPTS/Defaults.sh";

View File

@ -67,7 +67,7 @@ patch -p1 < "$DOS_PATCHES/android_build/0001-Automated_Build_Signing.patch"; #Au
awk -i inplace '!/PRODUCT_EXTRA_RECOVERY_KEYS/' core/product.mk;
sed -i '57i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aapt2.mk;
enterAndClear "device/lineage/sepolicy"; #XXX: TEMPORARY for O_asb_2019-02
enterAndClear "device/lineage/sepolicy";
git revert 9c28a0dfb91bb468515e123b1aaf3fcfc007b82f; #neverallow violation - breaks backuptool
git revert f1ad32105599a0b71702f840b2deeb6849f1ae80; #neverallow violation - breaks addons
git revert c9b0d95630b82cd0ad1a0fc633c6d59c2cb8aad7 37422f7df389f3ae5a34ee3d6dd9354217f9c536; #neverallow violation - breaks update_engine
@ -75,11 +75,6 @@ git revert c9b0d95630b82cd0ad1a0fc633c6d59c2cb8aad7 37422f7df389f3ae5a34ee3d6dd9
enterAndClear "device/qcom/sepolicy";
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
enter "external/skia";
git fetch https://github.com/LineageOS/android_external_skia refs/changes/18/240818/1 && git cherry-pick FETCH_HEAD
git fetch https://github.com/LineageOS/android_external_skia refs/changes/17/240817/1 && git cherry-pick FETCH_HEAD
git fetch https://github.com/LineageOS/android_external_skia refs/changes/16/240816/1 && git cherry-pick FETCH_HEAD
enterAndClear "external/svox";
git revert 1419d63b4889a26d22443fd8df1f9073bf229d3d; #Add back Makefiles
@ -128,6 +123,7 @@ enterAndClear "packages/apps/SetupWizard";
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
enterAndClear "packages/apps/Updater";
#sed -i 's/Constants.AUTO_UPDATES_CHECK_INTERVAL_WEEKLY);/Constants.AUTO_UPDATES_CHECK_INTERVAL_DAILY);/' src/org/lineageos/updater/misc/Utils.java; #Revert to daily update checks
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0002-Tor_Support.patch"; #Add Tor support
#TODO: Remove changelog
@ -187,7 +183,7 @@ enterAndClear "device/lge/g3-common";
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
sed -i '1itypeattribute wcnss_service misc_block_device_exception;' sepolicy/wcnss_service.te;
echo "/dev/block/platform/msm_sdcc\.1/by-name/pad u:object_r:misc_block_device:s0" >> sepolicy/file_contexts; #fix uncrypt denial
sed -i 's/qcrilmsgtunnel.apk/qcrilmsgtunnel.apk:vendor/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk' proprietary-files.txt; #Fix vendor Android.mk path for qcrilmsgtunnel.apk
sed -i 's|qcrilmsgtunnel.apk|qcrilmsgtunnel.apk:vendor/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk|' proprietary-files.txt; #Fix vendor Android.mk path for qcrilmsgtunnel.apk
enterAndClear "device/lge/msm8996-common";
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;