From d15d4f5757747c86996b965f747bcabb6a51e876 Mon Sep 17 00:00:00 2001 From: Tad Date: Sat, 17 Apr 2021 10:14:29 -0400 Subject: [PATCH] 18.1: updater: fix Tor support --- .../0002-Tor_Support.patch | 44 +++++++++++++------ Scripts/LineageOS-11.0/Functions.sh | 2 +- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Patches/LineageOS-18.1/android_packages_apps_Updater/0002-Tor_Support.patch b/Patches/LineageOS-18.1/android_packages_apps_Updater/0002-Tor_Support.patch index 1e9443cb..250a3c4e 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Updater/0002-Tor_Support.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Updater/0002-Tor_Support.patch @@ -1,10 +1,11 @@ -From 14bd0c11762e842c876c7c22c2f82ee1002e7186 Mon Sep 17 00:00:00 2001 +From 43f202718d34b75d4128bc280ebf1f3bee0cb43d Mon Sep 17 00:00:00 2001 From: Tad Date: Thu, 20 Sep 2018 21:44:53 -0400 Subject: [PATCH] Add support for routing over Tor Change-Id: Ibfe080c3d801af34fb64fda1b6b8f4f39a2b1ccf --- + AndroidManifest.xml | 4 ++ res/layout/preferences_dialog.xml | 8 +++ res/values/strings.xml | 2 + .../lineageos/updater/UpdatesActivity.java | 12 ++++ @@ -14,10 +15,25 @@ Change-Id: Ibfe080c3d801af34fb64fda1b6b8f4f39a2b1ccf .../download/HttpURLConnectionClient.java | 27 ++++++-- src/org/lineageos/updater/misc/Constants.java | 1 + src/org/lineageos/updater/misc/Utils.java | 65 +++++++++++++++++++ - 9 files changed, 130 insertions(+), 5 deletions(-) + 10 files changed, 134 insertions(+), 5 deletions(-) +diff --git a/AndroidManifest.xml b/AndroidManifest.xml +index d4d24c0..cb74219 100644 +--- a/AndroidManifest.xml ++++ b/AndroidManifest.xml +@@ -12,6 +12,10 @@ + + + ++ ++ ++ ++ + Delete updates when installed Delete Copy URL -@@ -85,6 +86,7 @@ +@@ -87,6 +88,7 @@ The download failed. Please check your internet connection and try again later. The update verification failed. Download completed. @@ -56,10 +72,10 @@ index 34f2fd3..e2a3e09 100644 This update can\'t be installed on top of the current build. diff --git a/src/org/lineageos/updater/UpdatesActivity.java b/src/org/lineageos/updater/UpdatesActivity.java -index ad001c8..4bebc17 100644 +index 6e93153..3c7ab2c 100644 --- a/src/org/lineageos/updater/UpdatesActivity.java +++ b/src/org/lineageos/updater/UpdatesActivity.java -@@ -343,10 +343,14 @@ public class UpdatesActivity extends UpdatesListActivity { +@@ -346,10 +346,14 @@ public class UpdatesActivity extends UpdatesListActivity { final DownloadClient downloadClient; try { @@ -74,7 +90,7 @@ index ad001c8..4bebc17 100644 .build(); } catch (IOException exception) { Log.e(TAG, "Could not build download client"); -@@ -411,6 +415,7 @@ public class UpdatesActivity extends UpdatesListActivity { +@@ -414,6 +418,7 @@ public class UpdatesActivity extends UpdatesListActivity { View view = LayoutInflater.from(this).inflate(R.layout.preferences_dialog, null); Spinner autoCheckInterval = view.findViewById(R.id.preferences_auto_updates_check_interval); @@ -82,7 +98,7 @@ index ad001c8..4bebc17 100644 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); -@@ -421,6 +426,7 @@ public class UpdatesActivity extends UpdatesListActivity { +@@ -425,6 +430,7 @@ public class UpdatesActivity extends UpdatesListActivity { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); autoCheckInterval.setSelection(Utils.getUpdateCheckSetting(this)); @@ -90,7 +106,7 @@ index ad001c8..4bebc17 100644 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)); -@@ -432,6 +438,8 @@ public class UpdatesActivity extends UpdatesListActivity { +@@ -464,6 +470,8 @@ public class UpdatesActivity extends UpdatesListActivity { prefs.edit() .putInt(Constants.PREF_AUTO_UPDATES_CHECK_INTERVAL, autoCheckInterval.getSelectedItemPosition()) @@ -99,7 +115,7 @@ index ad001c8..4bebc17 100644 .putBoolean(Constants.PREF_AUTO_DELETE_UPDATES, autoDelete.isChecked()) .putBoolean(Constants.PREF_MOBILE_DATA_WARNING, -@@ -447,6 +455,10 @@ public class UpdatesActivity extends UpdatesListActivity { +@@ -479,6 +487,10 @@ public class UpdatesActivity extends UpdatesListActivity { UpdatesCheckReceiver.cancelUpdatesCheck(this); } @@ -280,7 +296,7 @@ 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 81e7c1a..46d8666 100644 +index 0597eab..ea162e2 100644 --- a/src/org/lineageos/updater/misc/Constants.java +++ b/src/org/lineageos/updater/misc/Constants.java @@ -30,6 +30,7 @@ public final class Constants { @@ -292,7 +308,7 @@ index 81e7c1a..46d8666 100644 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 048d865..d1b5a74 100644 +index aa6e9f3..3329a38 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -45,6 +45,7 @@ import java.io.BufferedReader; @@ -380,5 +396,5 @@ index 048d865..d1b5a74 100644 return server + "?base=LineageOS&device=" + device + "&inc=" + incrementalVersion; } -- -2.26.0 +2.30.2 diff --git a/Scripts/LineageOS-11.0/Functions.sh b/Scripts/LineageOS-11.0/Functions.sh index 128e53e3..8a996d1e 100644 --- a/Scripts/LineageOS-11.0/Functions.sh +++ b/Scripts/LineageOS-11.0/Functions.sh @@ -60,7 +60,7 @@ patchWorkspace() { if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/cm"; fi; sed -i "s/'git', 'show', '-q'/'git', 'show'/" build/tools/repopick.py; #fix for old git versions source build/envsetup.sh; - repopick -itf asb-2018.09-cm11-qcom; #TODO: move in tree + repopick -ift asb-2018.09-cm11-qcom; #TODO: move in tree source "$DOS_SCRIPTS/Patch.sh"; source "$DOS_SCRIPTS/Defaults.sh";