From b9ff7a74e633b8f0117870ab5ae68a6f66ede9cf Mon Sep 17 00:00:00 2001 From: Tad Date: Tue, 12 Feb 2019 16:09:41 -0500 Subject: [PATCH] Updates and fixes --- .../0002-Tor_Support.patch | 60 +++++++++---------- .../android_kernel_asus_msm8916.sh | 2 +- Scripts/LineageOS-15.1/Functions.sh | 1 - Scripts/LineageOS-15.1/Patch.sh | 10 +--- 4 files changed, 34 insertions(+), 39 deletions(-) diff --git a/Patches/LineageOS-15.1/android_packages_apps_Updater/0002-Tor_Support.patch b/Patches/LineageOS-15.1/android_packages_apps_Updater/0002-Tor_Support.patch index 25a815e9..28f98f1b 100644 --- a/Patches/LineageOS-15.1/android_packages_apps_Updater/0002-Tor_Support.patch +++ b/Patches/LineageOS-15.1/android_packages_apps_Updater/0002-Tor_Support.patch @@ -1,4 +1,4 @@ -From d6ba2b0633832e34760e0d38091a10a5488b2b09 Mon Sep 17 00:00:00 2001 +From 315dba9fbc687da50f6217ff3db20bb14c11a1a4 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 @@ -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" /> + + Refresh - Preferences - Auto updates check +@@ -68,6 +68,7 @@ + Once a week + Once a month + Never + Perform requests over Tor Delete updates when installed Delete Copy URL -@@ -79,6 +80,7 @@ +@@ -83,6 +84,7 @@ The download failed. Please check your internet connection and try again later. The update verification failed. Download completed. @@ -56,10 +56,10 @@ index aa84059..a85dd6a 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 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; } diff --git a/Scripts/LineageOS-14.1/CVE_Patchers/android_kernel_asus_msm8916.sh b/Scripts/LineageOS-14.1/CVE_Patchers/android_kernel_asus_msm8916.sh index 26f6062c..bc7b4fa7 100644 --- a/Scripts/LineageOS-14.1/CVE_Patchers/android_kernel_asus_msm8916.sh +++ b/Scripts/LineageOS-14.1/CVE_Patchers/android_kernel_asus_msm8916.sh @@ -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 diff --git a/Scripts/LineageOS-15.1/Functions.sh b/Scripts/LineageOS-15.1/Functions.sh index 33f3ff9b..07906c32 100644 --- a/Scripts/LineageOS-15.1/Functions.sh +++ b/Scripts/LineageOS-15.1/Functions.sh @@ -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"; diff --git a/Scripts/LineageOS-15.1/Patch.sh b/Scripts/LineageOS-15.1/Patch.sh index 44474671..d4ac0a6b 100644 --- a/Scripts/LineageOS-15.1/Patch.sh +++ b/Scripts/LineageOS-15.1/Patch.sh @@ -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;