diff --git a/Patches/Common/android_vendor_divested/divested.mk b/Patches/Common/android_vendor_divested/divested.mk
index ab6d3d3e..8d997dc3 100644
--- a/Patches/Common/android_vendor_divested/divested.mk
+++ b/Patches/Common/android_vendor_divested/divested.mk
@@ -1,7 +1,7 @@
-PRODUCT_BRAND ?= DivestOS
-PRODUCT_VERSION_MAJOR = 1
-PRODUCT_VERSION_MINOR = 0
-PRODUCT_VERSION_MAINTENANCE := 0
+#PRODUCT_BRAND ?= DivestOS
+#PRODUCT_VERSION_MAJOR = 1
+#PRODUCT_VERSION_MINOR = 0
+#PRODUCT_VERSION_MAINTENANCE := 0
DEVICE_PACKAGE_OVERLAYS += vendor/divested/overlay/common
diff --git a/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/core/res/res/values/config.xml b/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/core/res/res/values/config.xml
index d979dd3d..3a9fa256 100644
--- a/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/core/res/res/values/config.xml
+++ b/Patches/Common/android_vendor_divested/overlay/common/frameworks/base/core/res/res/values/config.xml
@@ -83,7 +83,7 @@
Android-Mms/2.0
-
+ http://www.google.com/oha/rdf/ua-profile-kila.xml
-
+ us.spotco.fennec_dos
- com.android.location.fused
- org.microg.nlp
+ - com.google.android.gms
- false
+ true
- Preferred network mode: LTE
-+
-+ Preferred network mode: LTE only
-
- Preferred network mode: GSM/WCDMA/LTE
-
-@@ -681,7 +683,9 @@
- Multi-category disabled
-
- LTE (recommended)
-+ LTE only
- 4G (recommended)
-+ 4G only
- 3G
- 2G
- 1x
-@@ -689,14 +693,17 @@
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
-
-
- - @string/network_4G
-+ - @string/network_4G_only
- - @string/network_3G
-
-
- - "9"
-+ - "11"
- - "0"
-
-
-@@ -718,28 +725,33 @@
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
- - @string/network_2G
-
-
- - @string/network_4G
-+ - @string/network_4G_only
- - @string/network_3G
- - @string/network_2G
-
-
- - "9"
-+ - "11"
- - "0"
- - "1"
-
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
- - @string/network_1x
- - @string/network_global
-
-
- - "8"
-+ - "11"
- - "4"
- - "5"
- - "10"
-@@ -756,20 +768,24 @@
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_global
-
-
- - "8"
-+ - "11"
- - "10"
-
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
- - @string/network_2G
-
-
- - "22"
-+ - "11"
- - "18"
- - "1"
-
-diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
-index 71feff8b..2a68c99a 100644
---- a/src/com/android/phone/MobileNetworkSettings.java
-+++ b/src/com/android/phone/MobileNetworkSettings.java
-@@ -819,6 +819,7 @@ public class MobileNetworkSettings extends PreferenceActivity
- switch (buttonNetworkMode) {
- case Phone.NT_MODE_WCDMA_PREF:
- case Phone.NT_MODE_GSM_ONLY:
-+ case Phone.NT_MODE_LTE_ONLY:
- case Phone.NT_MODE_LTE_GSM_WCDMA:
- case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
- case Phone.NT_MODE_CDMA:
-@@ -1007,7 +1008,7 @@ public class MobileNetworkSettings extends PreferenceActivity
- break;
- case Phone.NT_MODE_LTE_ONLY:
- mButtonPreferredNetworkMode.setSummary(
-- R.string.preferred_network_mode_lte_summary);
-+ R.string.preferred_network_mode_lte_only_summary);
- break;
- case Phone.NT_MODE_LTE_TDSCDMA_GSM:
- mButtonPreferredNetworkMode.setSummary(
-@@ -1107,7 +1108,6 @@ public class MobileNetworkSettings extends PreferenceActivity
- controlGsmOptions(true);
- break;
- }
-- case Phone.NT_MODE_LTE_ONLY:
- case Phone.NT_MODE_LTE_WCDMA:
- if (!mIsGlobalCdma) {
- mButtonEnabledNetworks.setValue(
-@@ -1120,6 +1120,12 @@ public class MobileNetworkSettings extends PreferenceActivity
- mButtonEnabledNetworks.setSummary(R.string.network_global);
- }
- break;
-+ case Phone.NT_MODE_LTE_ONLY:
-+ mButtonEnabledNetworks.setValue(
-+ Integer.toString(Phone.NT_MODE_LTE_ONLY));
-+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
-+ ? R.string.network_4G_only : R.string.network_lte_only);
-+ break;
- case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
- if (isWorldMode()) {
- mButtonEnabledNetworks.setSummary(
---
-2.14.1
-
diff --git a/Patches/LineageOS-14.1/android_system_keymaster/0001-Backport_Fixes.patch b/Patches/LineageOS-14.1/android_system_keymaster/0001-Backport_Fixes.patch
deleted file mode 100644
index 980fa992..00000000
--- a/Patches/LineageOS-14.1/android_system_keymaster/0001-Backport_Fixes.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/keymaster_configuration.cpp b/keymaster_configuration.cpp
-index 428197c..42df7d6 100644
---- a/keymaster_configuration.cpp
-+++ b/keymaster_configuration.cpp
-@@ -89,7 +89,10 @@
- }
-
- regmatch_t matches[kPlatformVersionMatchCount];
-- if (regexec(®ex, version_str, kPlatformVersionMatchCount, matches, 0 /* flags */)) {
-+ int not_match
-+ = regexec(®ex, version_str, kPlatformVersionMatchCount, matches, 0 /* flags */);
-+ regfree(®ex);
-+ if (not_match) {
- ALOGI("Platform version string does not match expected format. Using version 0.");
- return 0;
- }
-@@ -109,7 +112,10 @@
- }
-
- regmatch_t matches[kPlatformPatchlevelMatchCount];
-- if (regexec(®ex, patchlevel_str, kPlatformPatchlevelMatchCount, matches, 0 /* flags */)) {
-+ int not_match
-+ = regexec(®ex, patchlevel_str, kPlatformPatchlevelMatchCount, matches, 0 /* flags */);
-+ regfree(®ex);
-+ if (not_match) {
- ALOGI("Platform patchlevel string does not match expected format. Using patchlevel 0");
- return 0;
- }
diff --git a/Patches/LineageOS-14.1/android_system_keymaster/0002-Backport_Fixes.patch b/Patches/LineageOS-14.1/android_system_keymaster/0002-Backport_Fixes.patch
deleted file mode 100644
index 4adaef3d..00000000
--- a/Patches/LineageOS-14.1/android_system_keymaster/0002-Backport_Fixes.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-diff --git a/include/keymaster/keymaster_configuration.h b/include/keymaster/keymaster_configuration.h
-index 97b7fa5..69738fd 100644
---- a/include/keymaster/keymaster_configuration.h
-+++ b/include/keymaster/keymaster_configuration.h
-@@ -40,12 +40,24 @@
- uint32_t GetOsVersion(const char* version_string);
-
- /**
-+ * Retrieves and parses OS version information from build properties. Returns 0 if the string
-+ * doesn't contain a numeric version number.
-+ */
-+uint32_t GetOsVersion();
-+
-+/**
- * Parses OS patch level string, returning year and month in integer form. For example, "2016-03-25"
- * will be returned as 201603. Returns 0 if the string doesn't contain a date in the form
- * YYYY-MM-DD.
- */
- uint32_t GetOsPatchlevel(const char* patchlevel_string);
-
-+/**
-+ * Retrieves and parses OS patch level from build properties. Returns 0 if the string doesn't
-+ * contain a date in the form YYYY-MM-DD.
-+ */
-+uint32_t GetOsPatchlevel();
-+
- } // namespace keymaster
-
- #endif // SYSTEM_KEYMASTER_KEYMASTER_CONFIGURATION_H_
-diff --git a/keymaster_configuration.cpp b/keymaster_configuration.cpp
-index 42df7d6..ac6d3c1 100644
---- a/keymaster_configuration.cpp
-+++ b/keymaster_configuration.cpp
-@@ -70,15 +70,7 @@
- }
-
- keymaster_error_t ConfigureDevice(keymaster2_device_t* dev) {
-- char version_str[PROPERTY_VALUE_MAX];
-- property_get(kPlatformVersionProp, version_str, "" /* default */);
-- uint32_t version = GetOsVersion(version_str);
--
-- char patchlevel_str[PROPERTY_VALUE_MAX];
-- property_get(kPlatformPatchlevelProp, patchlevel_str, "" /* default */);
-- uint32_t patchlevel = GetOsPatchlevel(patchlevel_str);
--
-- return ConfigureDevice(dev, version, patchlevel);
-+ return ConfigureDevice(dev, GetOsVersion(), GetOsPatchlevel());
- }
-
- uint32_t GetOsVersion(const char* version_str) {
-@@ -89,8 +81,8 @@
- }
-
- regmatch_t matches[kPlatformVersionMatchCount];
-- int not_match
-- = regexec(®ex, version_str, kPlatformVersionMatchCount, matches, 0 /* flags */);
-+ int not_match =
-+ regexec(®ex, version_str, kPlatformVersionMatchCount, matches, 0 /* flags */);
- regfree(®ex);
- if (not_match) {
- ALOGI("Platform version string does not match expected format. Using version 0.");
-@@ -104,6 +96,12 @@
- return (major * 100 + minor) * 100 + subminor;
- }
-
-+uint32_t GetOsVersion() {
-+ char version_str[PROPERTY_VALUE_MAX];
-+ property_get(kPlatformVersionProp, version_str, "" /* default */);
-+ return GetOsVersion(version_str);
-+}
-+
- uint32_t GetOsPatchlevel(const char* patchlevel_str) {
- regex_t regex;
- if (regcomp(®ex, kPlatformPatchlevelRegex, REG_EXTENDED) != 0) {
-@@ -112,8 +110,8 @@
- }
-
- regmatch_t matches[kPlatformPatchlevelMatchCount];
-- int not_match
-- = regexec(®ex, patchlevel_str, kPlatformPatchlevelMatchCount, matches, 0 /* flags */);
-+ int not_match =
-+ regexec(®ex, patchlevel_str, kPlatformPatchlevelMatchCount, matches, 0 /* flags */);
- regfree(®ex);
- if (not_match) {
- ALOGI("Platform patchlevel string does not match expected format. Using patchlevel 0");
-@@ -130,4 +128,10 @@
- return year * 100 + month;
- }
-
-+uint32_t GetOsPatchlevel() {
-+ char patchlevel_str[PROPERTY_VALUE_MAX];
-+ property_get(kPlatformPatchlevelProp, patchlevel_str, "" /* default */);
-+ return GetOsPatchlevel(patchlevel_str);
-+}
-+
- } // namespace keymaster
diff --git a/Patches/LineageOS-15.1/android_build/Copperhead/0002-Deny_USB.patch b/Patches/LineageOS-15.1/android_build/Copperhead/0002-Deny_USB.patch
deleted file mode 100644
index 8ac36924..00000000
--- a/Patches/LineageOS-15.1/android_build/Copperhead/0002-Deny_USB.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From d0d489b8380cb06a7738e9b7276056d9d7479d44 Mon Sep 17 00:00:00 2001
-From: Daniel Micay
-Date: Fri, 17 Jun 2016 07:13:49 -0400
-Subject: [PATCH] set deny_new_usb feature to dynamic by default
-
-Change-Id: Ied8e75e6c7f8cc5e1483fe93281a32fe799638c3
----
- core/main.mk | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/core/main.mk b/core/main.mk
-index af98b548c..e2c90d2d0 100644
---- a/core/main.mk
-+++ b/core/main.mk
-@@ -244,6 +244,7 @@ ifneq (,$(user_variant))
- # Target is secure in user builds.
- ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
- ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1
-+ ADDITIONAL_DEFAULT_PROPERTIES += persist.security.deny_new_usb=dynamic
-
- ifeq ($(user_variant),user)
- ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
diff --git a/Patches/LineageOS-15.1/android_frameworks_base/Copperhead/0005-Deny_USB.patch b/Patches/LineageOS-15.1/android_frameworks_base/Copperhead/0005-Deny_USB.patch
deleted file mode 100644
index f347be60..00000000
--- a/Patches/LineageOS-15.1/android_frameworks_base/Copperhead/0005-Deny_USB.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 7b811853c5d2b05ec5db11786ab3f4b6a079e1a1 Mon Sep 17 00:00:00 2001
-From: Daniel Micay
-Date: Thu, 16 Jun 2016 01:19:53 -0400
-Subject: [PATCH] dynamic deny_new_usb toggle
-
-Change-Id: Ie05bf2aaebd8660ec3ff9d823be93cd1202e22db
----
- .../java/com/android/server/policy/keyguard/KeyguardStateMonitor.java | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java b/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java
-index 941cd4441e2..80b79bd04da 100644
---- a/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java
-+++ b/services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java
-@@ -19,6 +19,7 @@
- import android.app.ActivityManager;
- import android.content.Context;
- import android.os.RemoteException;
-+import android.os.SystemProperties;
- import android.util.Slog;
-
- import com.android.internal.policy.IKeyguardService;
-@@ -85,6 +86,9 @@ public boolean hasLockscreenWallpaper() {
-
- @Override // Binder interface
- public void onShowingStateChanged(boolean showing) {
-+ if ("dynamic".equals(SystemProperties.get("persist.security.deny_new_usb"))) {
-+ SystemProperties.set("security.deny_new_usb", showing ? "1" : "0");
-+ }
- mIsShowing = showing;
- }
-
diff --git a/Patches/LineageOS-15.1/android_packages_apps_Settings/Copperhead/0003-Deny_USB.patch b/Patches/LineageOS-15.1/android_packages_apps_Settings/Copperhead/0003-Deny_USB.patch
deleted file mode 100644
index 156dbf09..00000000
--- a/Patches/LineageOS-15.1/android_packages_apps_Settings/Copperhead/0003-Deny_USB.patch
+++ /dev/null
@@ -1,238 +0,0 @@
-From 8d6cd259a90a009167c11a2f135cb9845a8f3e7f Mon Sep 17 00:00:00 2001
-From: Daniel Micay
-Date: Thu, 14 Apr 2016 20:44:06 -0400
-Subject: [PATCH] add deny_new_usb setting
-
-Change-Id: If4ee98d636e1876ba546f8a5d562859e8ab7b931
----
- res/values/arrays.xml | 16 +++++++++++++
- res/values/strings.xml | 3 +++
- res/xml/security_settings_chooser.xml | 8 +++++++
- res/xml/security_settings_lockscreen.xml | 8 +++++++
- res/xml/security_settings_password.xml | 8 +++++++
- res/xml/security_settings_pattern.xml | 8 +++++++
- res/xml/security_settings_pin.xml | 8 +++++++
- src/com/android/settings/SecuritySettings.java | 31 +++++++++++++++++++++++++-
- 8 files changed, 89 insertions(+), 1 deletion(-)
-
-diff --git a/res/values/arrays.xml b/res/values/arrays.xml
-index 5e1a468f87..16a7300e96 100644
---- a/res/values/arrays.xml
-+++ b/res/values/arrays.xml
-@@ -1038,4 +1038,20 @@
- - never
-
-
-+
-+
-+ - Disallow new USB peripherals
-+ - Allow new USB peripherals when unlocked
-+ - Allow new USB peripherals
-+
-+
-+
-+
-+
-+ - enabled
-+
-+ - dynamic
-+
-+ - disabled
-+
-
-diff --git a/res/values/strings.xml b/res/values/strings.xml
-index 8265475a98..84ebf5d10b 100644
---- a/res/values/strings.xml
-+++ b/res/values/strings.xml
-@@ -9052,4 +9052,7 @@
-
-
- This feature is not available on this device
-+
-+ USB accessories
-+ Control support for USB peripherals such as input (mice, keyboards, joysticks) and storage devices.
-
-diff --git a/res/xml/security_settings_chooser.xml b/res/xml/security_settings_chooser.xml
-index 067ebaba0d..2ba2b41006 100644
---- a/res/xml/security_settings_chooser.xml
-+++ b/res/xml/security_settings_chooser.xml
-@@ -33,6 +33,14 @@
- android:title="@string/lockscreen_settings_title"
- android:fragment="com.android.settings.security.LockscreenDashboardFragment"/>
-
-+
-+
-
-
-
-diff --git a/res/xml/security_settings_lockscreen.xml b/res/xml/security_settings_lockscreen.xml
-index c141fb7c74..5181997c99 100644
---- a/res/xml/security_settings_lockscreen.xml
-+++ b/res/xml/security_settings_lockscreen.xml
-@@ -29,6 +29,14 @@
- settings:keywords="@string/keywords_lockscreen"
- android:persistent="false"/>
-
-+
-+
-
-
-
-diff --git a/res/xml/security_settings_password.xml b/res/xml/security_settings_password.xml
-index 7de65f7cc0..2e8361f470 100644
---- a/res/xml/security_settings_password.xml
-+++ b/res/xml/security_settings_password.xml
-@@ -32,6 +32,14 @@
- android:title="@string/lockscreen_settings_title"
- android:fragment="com.android.settings.security.LockscreenDashboardFragment"/>
-
-+
-+
-
-
-
-diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml
-index 1585f016ee..9ce00d616e 100644
---- a/res/xml/security_settings_pattern.xml
-+++ b/res/xml/security_settings_pattern.xml
-@@ -32,6 +32,14 @@
- android:title="@string/lockscreen_settings_title"
- android:fragment="com.android.settings.security.LockscreenDashboardFragment"/>
-
-+
-+
-
-
-
-diff --git a/res/xml/security_settings_pin.xml b/res/xml/security_settings_pin.xml
-index f7705b7e9c..c291f118a2 100644
---- a/res/xml/security_settings_pin.xml
-+++ b/res/xml/security_settings_pin.xml
-@@ -32,6 +32,14 @@
- android:title="@string/lockscreen_settings_title"
- android:fragment="com.android.settings.security.LockscreenDashboardFragment"/>
-
-+
-+
-
-
-
-diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
-index 55f21fd22a..555b4a7c90 100644
---- a/src/com/android/settings/SecuritySettings.java
-+++ b/src/com/android/settings/SecuritySettings.java
-@@ -38,11 +38,13 @@
- import android.os.UserHandle;
- import android.os.UserManager;
- import android.os.storage.StorageManager;
-+import android.os.SystemProperties;
- import android.provider.SearchIndexableResource;
- import android.provider.Settings;
- import android.service.trust.TrustAgentService;
- import android.support.annotation.VisibleForTesting;
- import android.support.v14.preference.SwitchPreference;
-+import android.support.v7.preference.ListPreference;
- import android.support.v7.preference.Preference;
- import android.support.v7.preference.Preference.OnPreferenceChangeListener;
- import android.support.v7.preference.PreferenceGroup;
-@@ -118,6 +120,10 @@
- private static final int UNUNIFY_LOCK_CONFIRM_DEVICE_REQUEST = 130;
- private static final String TAG_UNIFICATION_DIALOG = "unification_dialog";
-
-+ private static final String KEY_DENY_NEW_USB = "deny_new_usb";
-+ private static final String DENY_NEW_USB_PROP = "security.deny_new_usb";
-+ private static final String DENY_NEW_USB_PERSIST_PROP = "persist.security.deny_new_usb";
-+
- // Misc Settings
- private static final String KEY_SIM_LOCK = "sim_lock_settings";
- private static final String KEY_SHOW_PASSWORD = "show_password";
-@@ -139,7 +145,7 @@
-
- // These switch preferences need special handling since they're not all stored in Settings.
- private static final String SWITCH_PREFERENCE_KEYS[] = {
-- KEY_SHOW_PASSWORD, KEY_UNIFICATION, KEY_VISIBLE_PATTERN_PROFILE
-+ KEY_SHOW_PASSWORD, KEY_UNIFICATION, KEY_VISIBLE_PATTERN_PROFILE, KEY_DENY_NEW_USB
- };
-
- // Only allow one trust agent on the platform.
-@@ -169,6 +175,8 @@
-
- private int mProfileChallengeUserId;
-
-+ private ListPreference mDenyNewUsb;
-+
- private String mCurrentDevicePassword;
- private String mCurrentProfilePassword;
-
-@@ -324,6 +332,16 @@ private PreferenceScreen createPreferenceHierarchy() {
-
- mIsAdmin = mUm.isAdminUser();
-
-+ if (mIsAdmin) {
-+ mDenyNewUsb = (ListPreference) findPreference(KEY_DENY_NEW_USB);
-+ } else {
-+ PreferenceGroup securityCategory = (PreferenceGroup)
-+ root.findPreference(KEY_SECURITY_CATEGORY);
-+ if (securityCategory != null) {
-+ securityCategory.removePreference(securityCategory.findPreference(KEY_DENY_NEW_USB));
-+ }
-+ }
-+
- // Fingerprint and trust agents
- int numberOfTrustAgent = 0;
- PreferenceGroup securityCategory = (PreferenceGroup)
-@@ -626,6 +644,10 @@ public void onResume() {
- }
-
- mLocationcontroller.updateSummary();
-+
-+ if (mDenyNewUsb != null) {
-+ mDenyNewUsb.setValue(SystemProperties.get(DENY_NEW_USB_PERSIST_PROP, "disabled"));
-+ }
- }
-
- private void updateUnificationPreference() {
-@@ -812,6 +834,13 @@ public boolean onPreferenceChange(Preference preference, Object value) {
- Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD,
- ((Boolean) value) ? 1 : 0);
- lockPatternUtils.setVisiblePasswordEnabled((Boolean) value, MY_USER_ID);
-+ } else if (KEY_DENY_NEW_USB.equals(key)) {
-+ String mode = (String) value;
-+ SystemProperties.set(DENY_NEW_USB_PERSIST_PROP, mode);
-+ // The dynamic mode defaults to the disabled state
-+ if (mode.equals("dynamic")) {
-+ SystemProperties.set(DENY_NEW_USB_PROP, "0");
-+ }
- }
- return result;
- }
diff --git a/Patches/LineageOS-15.1/android_packages_services_Telephony/Copperhead/0001-LTE_Only.patch b/Patches/LineageOS-15.1/android_packages_services_Telephony/Copperhead/0001-LTE_Only.patch
deleted file mode 100644
index aafe1691..00000000
--- a/Patches/LineageOS-15.1/android_packages_services_Telephony/Copperhead/0001-LTE_Only.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From f6132218fcfcf8932e963b7f7e785710cdd13f13 Mon Sep 17 00:00:00 2001
-From: Daniel Micay
-Date: Mon, 12 Feb 2018 07:27:04 -0500
-Subject: [PATCH] LTE only option
-
-This is a modified version of thestinger's implementation in CopperheadOS from a time when the repo was/is still licensed under Apache2
-https://github.com/CopperheadOS/platform_packages_services_Telephony/commit/567b8daca2d5d570e4eeecd548aa03c606ee9c18
-
-Change-Id: I63cd7d31bc5942b4dd48ce0c3bef0397a06091a6
----
- res/values/strings.xml | 16 ++++++++++++++++
- src/com/android/phone/MobileNetworkSettings.java | 10 ++++++++--
- 2 files changed, 24 insertions(+), 2 deletions(-)
-
-diff --git a/res/values/strings.xml b/res/values/strings.xml
-index a5651571c..7bf60a8df 100644
---- a/res/values/strings.xml
-+++ b/res/values/strings.xml
-@@ -408,6 +408,8 @@
- Preferred network mode: CDMA/EvDo/GSM/WCDMA
-
- Preferred network mode: LTE
-+
-+ Preferred network mode: LTE only
-
- Preferred network mode: GSM/WCDMA/LTE
-
-@@ -695,7 +697,9 @@
- Multi-category disabled
-
- LTE (recommended)
-+ LTE only
- 4G (recommended)
-+ 4G only
- 3G
- 2G
- 1x
-@@ -703,14 +707,17 @@
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
-
-
- - @string/network_4G
-+ - @string/network_4G_only
- - @string/network_3G
-
-
- - "9"
-+ - "11"
- - "0"
-
-
-@@ -732,28 +739,33 @@
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
- - @string/network_2G
-
-
- - @string/network_4G
-+ - @string/network_4G_only
- - @string/network_3G
- - @string/network_2G
-
-
- - "9"
-+ - "11"
- - "0"
- - "1"
-
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
- - @string/network_1x
- - @string/network_global
-
-
- - "8"
-+ - "11"
- - "4"
- - "5"
- - "10"
-@@ -770,20 +782,24 @@
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_global
-
-
- - "8"
-+ - "11"
- - "10"
-
-
-
- - @string/network_lte
-+ - @string/network_lte_only
- - @string/network_3G
- - @string/network_2G
-
-
- - "22"
-+ - "11"
- - "18"
- - "1"
-
-diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
-index 0ea4702b4..47e8bcf12 100644
---- a/src/com/android/phone/MobileNetworkSettings.java
-+++ b/src/com/android/phone/MobileNetworkSettings.java
-@@ -1157,6 +1157,7 @@ public class MobileNetworkSettings extends Activity {
- switch (buttonNetworkMode) {
- case Phone.NT_MODE_WCDMA_PREF:
- case Phone.NT_MODE_GSM_ONLY:
-+ case Phone.NT_MODE_LTE_ONLY:
- case Phone.NT_MODE_LTE_GSM_WCDMA:
- case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
- case Phone.NT_MODE_CDMA:
-@@ -1363,7 +1364,7 @@ public class MobileNetworkSettings extends Activity {
- break;
- case Phone.NT_MODE_LTE_ONLY:
- mButtonPreferredNetworkMode.setSummary(
-- R.string.preferred_network_mode_lte_summary);
-+ R.string.preferred_network_mode_lte_only_summary);
- break;
- case Phone.NT_MODE_LTE_TDSCDMA_GSM:
- mButtonPreferredNetworkMode.setSummary(
-@@ -1463,7 +1464,6 @@ public class MobileNetworkSettings extends Activity {
- controlGsmOptions(true);
- break;
- }
-- case Phone.NT_MODE_LTE_ONLY:
- case Phone.NT_MODE_LTE_WCDMA:
- if (!mIsGlobalCdma) {
- mButtonEnabledNetworks.setValue(
-@@ -1476,6 +1476,12 @@ public class MobileNetworkSettings extends Activity {
- mButtonEnabledNetworks.setSummary(R.string.network_global);
- }
- break;
-+ case Phone.NT_MODE_LTE_ONLY:
-+ mButtonEnabledNetworks.setValue(
-+ Integer.toString(Phone.NT_MODE_LTE_ONLY));
-+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
-+ ? R.string.network_4G_only : R.string.network_lte_only);
-+ break;
- case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
- if (isWorldMode()) {
- mButtonEnabledNetworks.setSummary(
---
-2.16.1
-
diff --git a/Patches/LineageOS-15.1/android_system_core/Copperhead/0002-Deny_USB.patch b/Patches/LineageOS-15.1/android_system_core/Copperhead/0002-Deny_USB.patch
deleted file mode 100644
index fee50730..00000000
--- a/Patches/LineageOS-15.1/android_system_core/Copperhead/0002-Deny_USB.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 808fb79d8171f26bc29332145df4edac1925e76e Mon Sep 17 00:00:00 2001
-From: Daniel Micay
-Date: Sun, 22 Apr 2018 10:18:06 -0400
-Subject: [PATCH] add properties for controlling deny_new_usb
-
-Change-Id: I0ead2254b7e379abaeab6f0f78a48680d40a8994
----
- rootdir/init.rc | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/rootdir/init.rc b/rootdir/init.rc
-index 2a7333563..aa654c38f 100644
---- a/rootdir/init.rc
-+++ b/rootdir/init.rc
-@@ -696,6 +696,18 @@ on property:sys.sysctl.extra_free_kbytes=*
- on property:sys.sysctl.tcp_def_init_rwnd=*
- write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd}
-
-+on property:persist.security.deny_new_usb=disabled
-+ write /proc/sys/kernel/deny_new_usb 0
-+
-+on property:persist.security.deny_new_usb=enabled
-+ write /proc/sys/kernel/deny_new_usb 1
-+
-+on property:persist.security.deny_new_usb=dynamic
-+ write /proc/sys/kernel/deny_new_usb 1
-+
-+on property:security.deny_new_usb=*
-+ write /proc/sys/kernel/deny_new_usb ${security.deny_new_usb}
-+
- on property:security.perf_harden=0
- write /proc/sys/kernel/perf_event_paranoid 1
-
---
-2.17.0
-
diff --git a/Patches/LineageOS-15.1/android_system_sepolicy/Copperhead/0002-Deny_USB.patch b/Patches/LineageOS-15.1/android_system_sepolicy/Copperhead/0002-Deny_USB.patch
deleted file mode 100644
index 71b48e4f..00000000
--- a/Patches/LineageOS-15.1/android_system_sepolicy/Copperhead/0002-Deny_USB.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 9bd23222fab996016eb2d31772129b09594f4667 Mon Sep 17 00:00:00 2001
-From: Daniel Micay
-Date: Thu, 16 Jun 2016 01:07:25 -0400
-Subject: [PATCH] allow system to set security.deny_new_usb
-
----
- private/property_contexts | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/private/property_contexts b/private/property_contexts
-index e524f54e..86b7d8a3 100644
---- a/private/property_contexts
-+++ b/private/property_contexts
-@@ -66,6 +66,8 @@ ro.boot.btmacaddr u:object_r:bluetooth_prop:s0
- ro.boot.serialno u:object_r:serialno_prop:s0
- ro.bt. u:object_r:bluetooth_prop:s0
-
-+security.deny_new_usb u:object_r:system_prop:s0
-+
- # Boolean property set by system server upon boot indicating
- # if device owner is provisioned.
- ro.device_owner u:object_r:device_logging_prop:s0
diff --git a/Scripts/LineageOS-14.1/Functions.sh b/Scripts/LineageOS-14.1/Functions.sh
index 44c4454e..dc2b58d7 100644
--- a/Scripts/LineageOS-14.1/Functions.sh
+++ b/Scripts/LineageOS-14.1/Functions.sh
@@ -139,7 +139,7 @@ export -f enableDexPreOptFull;
enableLowRam() {
cd "$DOS_BUILD_BASE$1";
- if [ -f lineage.mk ]; then echo '$(call inherit-product, $(SRC_TARGET_DIR)/product/lowram.mk)' >> lineage.mk; fi;
+ if [ -f lineage.mk ]; then echo '$(call inherit-product, vendor/divested/target/product/lowram.mk)' >> lineage.mk; fi;
if [ -f BoardConfig.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfig.mk; fi;
if [ -f BoardConfigCommon.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfigCommon.mk; fi;
echo "Enabled lowram for $1";
diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh
index ac726c46..38ac38fd 100755
--- a/Scripts/LineageOS-14.1/Patch.sh
+++ b/Scripts/LineageOS-14.1/Patch.sh
@@ -65,10 +65,6 @@ patch -p1 < "$DOS_PATCHES/android_bootable_recovery/0001-Squash_Menus.patch"; #W
enterAndClear "build";
patch -p1 < "$DOS_PATCHES/android_build/0001-Automated_Build_Signing.patch"; #Automated build signing (CopperheadOS-13.0)
-sed -i 's/messaging/Silence/' target/product/*.mk; #Replace AOSP Messaging app with Silence
-sed -i 's/ro.secure=0/ro.secure=1/' core/main.mk;
-#sed -i 's/ro.adb.secure=0/ro.adb.secure=1/' core/main.mk;
-cp "$DOS_PATCHES_COMMON/android_build/lowram.mk" target/product/lowram.mk;
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
@@ -79,13 +75,9 @@ patch -p1 < "$DOS_PATCHES/android_external_sqlite/0001-Secure_Delete.patch"; #En
enterAndClear "frameworks/base";
git revert 0326bb5e41219cf502727c3aa44ebf2daa19a5b3; #re-enable doze on devices without gms
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
-sed -i 's/com.android.messaging/org.smssecure.smssecure/' core/res/res/values/config.xml; #Change default SMS app to Silence
-sed -i 's|db_default_journal_mode" translatable="false">PERSIST|db_default_journal_mode" translatable="false">TRUNCATE|' core/res/res/values/config.xml; #Mirror SQLite secure_delete
-sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired">true|' core/res/res/values/config.xml;
patch -p1 < "$DOS_PATCHES/android_frameworks_base/0001-Reduced_Resolution.patch"; #Allow reducing resolution to save power TODO: Add 800x480
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then patch -p1 < "$DOS_PATCHES/android_frameworks_base/0003-Signature_Spoofing.patch"; fi; #Allow packages to spoof their signature (microG)
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then patch -p1 < "$DOS_PATCHES/android_frameworks_base/0005-Harden_Sig_Spoofing.patch"; fi; #Restrict signature spoofing to system apps signed with the platform key
-if [ "$DOS_MICROG_INCLUDED" = "NLP" ]; then sed -i '/- com.android.location.fused<\/item>/a \ \ \ \ \ \ \ \
- org.microg.nlp
' core/res/res/values/config.xml; fi; #Add UnifiedNLP to location providers
changeDefaultDNS;
#patch -p1 < "$DOS_PATCHES/android_frameworks_base/0007-Connectivity.patch"; #Change connectivity check URLs to ours
patch -p1 < "$DOS_PATCHES/android_frameworks_base/0008-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries
@@ -107,19 +99,11 @@ awk -i inplace '!/com.android.internal.R.bool.config_permissionReviewRequired/'
enterAndClear "packages/apps/CMParts";
rm -rf src/org/cyanogenmod/cmparts/cmstats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of CMStats
-sed -i 's|config_showWeatherMenu">true|config_showWeatherMenu">false|' res/values/config.xml; #Disable Weather
+sed -i 's|config_showWeatherMenu">true|config_showWeatherMenu">false|' res/values/config.xml; #Disable Weather #TODO OVERLAY
patch -p1 < "$DOS_PATCHES/android_packages_apps_CMParts/0001-Remove_Analytics.patch"; #Remove the rest of CMStats
patch -p1 < "$DOS_PATCHES/android_packages_apps_CMParts/0002-Reduced_Resolution.patch"; #Allow reducing resolution to save power
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then
-enterAndClear "packages/apps/FakeStore";
-sed -i 's|$(OUT_DIR)/target/|$(PWD)/$(OUT_DIR)/target/|' Android.mk;
-sed -i 's/ln -s /ln -sf /' Android.mk;
-sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle;
-fi;
-
enterAndClear "packages/apps/FDroid";
-cp "$DOS_PATCHES_COMMON/android_packages_apps_FDroid/default_repos.xml" app/src/main/res/values/default_repos.xml; #Add extra repos
sed -i 's|outputs/apk/|outputs/apk/full/release/|' Android.mk;
sed -i 's|-release-unsigned|-full-release-unsigned|' Android.mk;
sed -i 's|gradle|./gradlew|' Android.mk; #Gradle 4.0 fix
@@ -132,16 +116,6 @@ sed -i 's/\"org\.fdroid\.fdroid/\"org.fdroid.fdroid_dos/' app/src/main/java/org/
#release-key: CB:1E:E2:EC:40:D0:5E:D6:78:F4:2A:E7:01:CD:FA:29:EE:A7:9D:0E:6D:63:32:76:DE:23:0B:F3:49:40:67:C3
#test-key: C8:A2:E9:BC:CF:59:7C:2F:B6:DC:66:BE:E2:93:FC:13:F2:FC:47:EC:77:BC:6B:2B:0D:52:C1:1F:51:19:2A:B8
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then
-enterAndClear "packages/apps/GmsCore";
-git submodule update --init --recursive;
-fi;
-
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then
-enterAndClear "packages/apps/GsfProxy";
-sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle;
-fi;
-
enterAndClear "packages/apps/PackageInstaller";
patch -p1 < "$DOS_PATCHES/android_packages_apps_PackageInstaller/64d8b44.diff"; #Fix an issue with Permission Review
@@ -153,9 +127,6 @@ if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com
enterAndClear "packages/apps/SetupWizard";
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove the rest of CMStats
-enterAndClear "packages/apps/Trebuchet";
-cp -r "$DOS_PATCHES_COMMON/android_packages_apps_Trebuchet/default_workspace/." "res/xml/";
-
enterAndClear "packages/apps/Updater";
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
#TODO: Remove changelog
@@ -172,18 +143,11 @@ sed -i 's/WallpaperUtils.EXTRA_WALLPAPER_OFFSET, 0);/WallpaperUtils.EXTRA_WALLPA
enterAndClear "packages/inputmethods/LatinIME";
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
-enterAndClear "packages/services/Telephony";
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/Copperhead/0001-LTE_Only.patch"; fi; #LTE only preferred network mode choice (Copperhead CC BY-NC-SA)
-
enterAndClear "system/core";
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
git revert 0217dddeb5c16903c13ff6c75213619b79ea622b d7aa1231b6a0631f506c0c23816f2cd81645b15f; #Always update recovery XXX: This doesn't seem to work
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden_Mounts.patch"; #Harden mounts with nodev/noexec/nosuid (CopperheadOS-13.0)
-enterAndClear "system/keymaster";
-patch -p1 < "$DOS_PATCHES/android_system_keymaster/0001-Backport_Fixes.patch"; #Fixes from 8.1, appears to fix https://jira.lineageos.org/browse/BUGBASH-590
-patch -p1 < "$DOS_PATCHES/android_system_keymaster/0002-Backport_Fixes.patch";
-
enterAndClear "system/sepolicy";
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
@@ -195,30 +159,23 @@ rm -rf overlay/common/vendor/cmsdk/packages; #Remove analytics
awk -i inplace '!/50-cm.sh/' config/common.mk; #Make sure our hosts is always used
awk -i inplace '!/PRODUCT_EXTRA_RECOVERY_KEYS/' config/common.mk; #Remove extra keys
awk -i inplace '!/security\/lineage/' config/common.mk; #Remove extra keys
-sed -i '3iinclude vendor/cm/config/sce.mk' config/common.mk; #Include extra apps
if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then
awk -i inplace '!/AudioFX/' config/common.mk;
awk -i inplace '!/AudioService/' config/common.mk;
fi;
-cp "$DOS_PATCHES_COMMON/android_vendor_divested/sce.mk" config/sce.mk;
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> config/sce.mk; fi;
-if [ "$DOS_MICROG_INCLUDED" = "NLP" ]; then echo "PRODUCT_PACKAGES += UnifiedNLP" >> config/sce.mk; fi;
-if [ "$DOS_MICROG_INCLUDED" = "NLP" ]; then sed -i '/Google provider/!b;n;s/com.google.android.gms/org.microg.nlp/' overlay/common/frameworks/base/core/res/res/values/config.xml; fi;
-if [ "$DOS_MICROG_INCLUDED" != "NONE" ]; then cp "$DOS_PATCHES_COMMON/android_vendor_divested/sce-UnifiedNLP-Backends.mk" config/sce-UnifiedNLP-Backends.mk; fi;
-if [ "$DOS_MICROG_INCLUDED" != "NONE" ]; then echo "include vendor/cm/config/sce-UnifiedNLP-Backends.mk" >> config/sce.mk; fi;
-cp "$DOS_PATCHES/android_vendor_cm/config.xml" overlay/common/vendor/cmsdk/cm/res/res/values/config.xml; #Per app performance profiles
-cp -r "$DOS_PATCHES_COMMON/android_vendor_divested/firmware_deblobber" .;
-cp "$DOS_PATCHES/android_vendor_cm/firmware_deblobber.mk" build/tasks/firmware_deblobber.mk;
sed -i 's/CM_BUILDTYPE := UNOFFICIAL/CM_BUILDTYPE := dos/' config/common.mk; #Change buildtype
if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/CM_BUILDTYPE := dos/CM_BUILDTYPE := dosNC/' config/common.mk; fi;
-sed -i 's/messaging/Silence/' config/telephony.mk; #Replace AOSP Messaging app with Silence
-#if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += DNS66" >> config/sce.mk; fi; #Include DNS66 as an alternative
+cp "$DOS_PATCHES/android_vendor_cm/config.xml" overlay/common/vendor/cmsdk/cm/res/res/values/config.xml; #Per app performance profiles
+sed -i '3iinclude vendor/divested/divested.mk' config/common.mk; #Include our customizations
enterAndClear "vendor/cmsdk";
awk -i inplace '!/WeatherManagerServiceBroker/' cm/res/res/values/config.xml; #Disable Weather
if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then awk -i inplace '!/CMAudioService/' cm/res/res/values/config.xml; fi;
-cp "$DOS_PATCHES_COMMON/android_lineage-sdk/profile_default.xml" cm/res/res/xml/profile_default.xml; #Replace default profiles with *way* better ones
sed -i 's/shouldUseOptimizations(weight)/true/' cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java; #Per app performance profiles fix
+
+enterAndClear "vendor/divested";
+if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += microG" >> packages.mk;
+if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += DNS66" >> packages.mk;
#
#END OF ROM CHANGES
#
diff --git a/Scripts/LineageOS-15.1/Functions.sh b/Scripts/LineageOS-15.1/Functions.sh
index a01c5968..8d7796fa 100644
--- a/Scripts/LineageOS-15.1/Functions.sh
+++ b/Scripts/LineageOS-15.1/Functions.sh
@@ -127,7 +127,7 @@ export -f enableDexPreOptFull;
enableLowRam() {
cd "$DOS_BUILD_BASE$1";
#if [ -f lineage.mk ]; then echo '$(call inherit-product, $(SRC_TARGET_DIR)/product/go_defaults.mk)' >> lineage.mk; fi;
- if [ -f lineage.mk ]; then echo '$(call inherit-product, $(SRC_TARGET_DIR)/product/lowram.mk)' >> lineage.mk; fi;
+ if [ -f lineage.mk ]; then echo '$(call inherit-product, vendor/divested/target/product/lowram.mk)' >> lineage.mk; fi;
if [ -f BoardConfig.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfig.mk; fi;
if [ -f BoardConfigCommon.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfigCommon.mk; fi;
echo "Enabled lowram for $1";
diff --git a/Scripts/LineageOS-15.1/Patch.sh b/Scripts/LineageOS-15.1/Patch.sh
index 2ce17dde..eea765bf 100755
--- a/Scripts/LineageOS-15.1/Patch.sh
+++ b/Scripts/LineageOS-15.1/Patch.sh
@@ -62,12 +62,7 @@ cp -r "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BAS
enterAndClear "build/make";
patch -p1 < "$DOS_PATCHES/android_build/0001-Automated_Build_Signing.patch"; #Automated build signing (CopperheadOS-13.0)
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_build/Copperhead/0002-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
awk -i inplace '!/PRODUCT_EXTRA_RECOVERY_KEYS/' core/product.mk;
-sed -i 's/messaging/Silence/' target/product/*.mk; #Replace AOSP Messaging app with Silence
-sed -i 's/ro.secure=0/ro.secure=1/' core/main.mk;
-#sed -i 's/ro.adb.secure=0/ro.adb.secure=1/' core/main.mk;
-cp "$DOS_PATCHES_COMMON/android_build/lowram.mk" target/product/lowram.mk;
enterAndClear "device/lineage/sepolicy";
git revert c9b0d95630b82cd0ad1a0fc633c6d59c2cb8aad7 37422f7df389f3ae5a34ee3d6dd9354217f9c536; #neverallow violation
@@ -82,15 +77,11 @@ enterAndClear "frameworks/base";
git revert 759d6831f0207f8b59445b33fd57d770c16d3750;
#git revert https://review.lineageos.org/#/c/202875/ #re-enable doze on devices without gms
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
-sed -i 's/com.android.messaging/org.smssecure.smssecure/' core/res/res/values/config.xml; #Change default SMS app to Silence
-sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired">true|' core/res/res/values/config.xml;
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then patch -p1 < "$DOS_PATCHES/android_frameworks_base/0002-Signature_Spoofing.patch"; fi; #Allow packages to spoof their signature (microG)
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then patch -p1 < "$DOS_PATCHES/android_frameworks_base/0003-Harden_Sig_Spoofing.patch"; fi; #Restrict signature spoofing to system apps signed with the platform key
-if [ "$DOS_MICROG_INCLUDED" = "NLP" ]; then sed -i '/- com.android.location.fused<\/item>/a \ \ \ \ \ \ \ \
- org.microg.nlp
' core/res/res/values/config.xml; fi; #Add UnifiedNLP to location providers
changeDefaultDNS;
#patch -p1 < "$DOS_PATCHES/android_frameworks_base/0005-Connectivity.patch"; #Change connectivity check URLs to ours
patch -p1 < "$DOS_PATCHES/android_frameworks_base/0006-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_frameworks_base/Copperhead/0005-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;
@@ -110,17 +101,8 @@ awk -i inplace '!/com.android.internal.R.bool.config_permissionReviewRequired/'
enterAndClear "lineage-sdk";
awk -i inplace '!/WeatherManagerServiceBroker/' lineage/res/res/values/config.xml; #Disable Weather
if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then awk -i inplace '!/LineageAudioService/' lineage/res/res/values/config.xml; fi;
-cp "$DOS_PATCHES_COMMON/android_lineage-sdk/profile_default.xml" lineage/res/res/xml/profile_default.xml; #Replace default profiles with *way* better ones
-
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then
-enterAndClear "packages/apps/FakeStore";
-sed -i 's|$(OUT_DIR)/target/|$(PWD)/$(OUT_DIR)/target/|' Android.mk;
-sed -i 's/ln -s /ln -sf /' Android.mk;
-sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle;
-fi;
enterAndClear "packages/apps/FDroid";
-cp "$DOS_PATCHES_COMMON/android_packages_apps_FDroid/default_repos.xml" app/src/main/res/values/default_repos.xml; #Add extra repos
sed -i 's|outputs/apk/|outputs/apk/full/release/|' Android.mk;
sed -i 's|-release-unsigned|-full-release-unsigned|' Android.mk;
sed -i 's|gradle|./gradlew|' Android.mk; #Gradle 4.0 fix
@@ -133,25 +115,14 @@ sed -i 's/\"org\.fdroid\.fdroid/\"org.fdroid.fdroid_dos/' app/src/main/java/org/
#release-key: CB:1E:E2:EC:40:D0:5E:D6:78:F4:2A:E7:01:CD:FA:29:EE:A7:9D:0E:6D:63:32:76:DE:23:0B:F3:49:40:67:C3
#test-key: C8:A2:E9:BC:CF:59:7C:2F:B6:DC:66:BE:E2:93:FC:13:F2:FC:47:EC:77:BC:6B:2B:0D:52:C1:1F:51:19:2A:B8
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then
-enterAndClear "packages/apps/GmsCore";
-git submodule update --init --recursive;
-fi;
-
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then
-enterAndClear "packages/apps/GsfProxy";
-sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle;
-fi;
-
enterAndClear "packages/apps/LineageParts";
rm -rf src/org/lineageos/lineageparts/lineagestats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml #Nuke part of the analytics
-sed -i 's|config_showWeatherMenu">true|config_showWeatherMenu">false|' res/values/config.xml; #Disable Weather
+sed -i 's|config_showWeatherMenu">true|config_showWeatherMenu">false|' res/values/config.xml; #Disable Weather #TODO OVERLAY
patch -p1 < "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytics.patch"; #Remove analytics
rm AndroidManifest.xml.orig res/values/*.xml.orig;
enterAndClear "packages/apps/Settings";
git revert a96df110e84123fe1273bff54feca3b4ca484dcd; #don't hide oem unlock
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/Copperhead/0003-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0004-PDB_Fixes.patch"; #Fix crashes when the PersistentDataBlockManager service isn't available
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/password/ChooseLockPassword.java; #Increase max password length
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/PrivacySettings.java; fi; #microG doesn't support Backup, hide the options
@@ -160,9 +131,6 @@ rm res/values/strings.xml.orig;
enterAndClear "packages/apps/SetupWizard";
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
-enterAndClear "packages/apps/Trebuchet";
-cp -r "$DOS_PATCHES_COMMON/android_packages_apps_Trebuchet/default_workspace/." "res/xml/";
-
enterAndClear "packages/apps/Updater";
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
#TODO: Remove changelog
@@ -176,19 +144,13 @@ sed -i 's/WallpaperUtils.EXTRA_WALLPAPER_OFFSET, 0);/WallpaperUtils.EXTRA_WALLPA
enterAndClear "packages/inputmethods/LatinIME";
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
-enterAndClear "packages/services/Telephony";
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/Copperhead/0001-LTE_Only.patch"; fi; #LTE only preferred network mode choice (Copperhead CC BY-NC-SA)
-
enterAndClear "system/core";
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
git revert a6a4ce8e9a6d63014047a447c6bb3ac1fa90b3f4; #Always update recovery
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden_Mounts.patch"; #Harden mounts with nodev/noexec/nosuid (CopperheadOS-13.0)
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_system_core/Copperhead/0002-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
-#if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_system_core/0003-Deny_USB-Aggressive.patch"; fi; #Deny USB on boot, may break things
enterAndClear "system/sepolicy";
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
-if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$DOS_PATCHES/android_system_sepolicy/Copperhead/0002-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
enterAndClear "system/vold";
patch -p1 < "$DOS_PATCHES/android_system_vold/0001-AES256.patch"; #Add a variable for enabling AES-256 bit encryption
@@ -198,20 +160,14 @@ rm -rf overlay/common/vendor/lineage-sdk/packages; #Remove analytics
if [ "$DOS_HOSTS_BLOCKING" = true ]; then awk -i inplace '!/50-lineage.sh/' config/common.mk; fi; #Make sure our hosts is always used
awk -i inplace '!/PRODUCT_EXTRA_RECOVERY_KEYS/' config/common.mk; #Remove extra keys
awk -i inplace '!/security\/lineage/' config/common.mk; #Remove extra keys
-sed -i '3iinclude vendor/lineage/config/sce.mk' config/common.mk; #Include extra apps
if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then awk -i inplace '!/AudioFX/' config/common.mk; fi;
-cp "$DOS_PATCHES_COMMON/android_vendor_divested/sce.mk" config/sce.mk;
-if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> config/sce.mk; fi;
-if [ "$DOS_MICROG_INCLUDED" = "NLP" ]; then echo "PRODUCT_PACKAGES += UnifiedNLP" >> config/sce.mk; fi;
-if [ "$DOS_MICROG_INCLUDED" = "NLP" ]; then sed -i '/Google provider/!b;n;s/com.google.android.gms/org.microg.nlp/' overlay/common/frameworks/base/core/res/res/values/config.xml; fi;
-if [ "$DOS_MICROG_INCLUDED" != "NONE" ]; then cp "$DOS_PATCHES_COMMON/android_vendor_divested/sce-UnifiedNLP-Backends.mk" config/sce-UnifiedNLP-Backends.mk; fi;
-if [ "$DOS_MICROG_INCLUDED" != "NONE" ]; then echo "include vendor/lineage/config/sce-UnifiedNLP-Backends.mk" >> config/sce.mk; fi;
-cp -r "$DOS_PATCHES_COMMON/android_vendor_divested/firmware_deblobber" .;
-cp "$DOS_PATCHES/android_vendor_lineage/firmware_deblobber.mk" build/tasks/firmware_deblobber.mk;
sed -i 's/LINEAGE_BUILDTYPE := UNOFFICIAL/LINEAGE_BUILDTYPE := dos/' config/common.mk; #Change buildtype
if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYPE := dos/LINEAGE_BUILDTYPE := dosNC/' config/common.mk; fi;
-sed -i 's/messaging/Silence/' config/telephony.mk; #Replace AOSP Messaging app with Silence
-#if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += DNS66" >> config/sce.mk; fi; #Include DNS66 as an alternative
+sed -i '3iinclude vendor/divested/divested.mk' config/common.mk; #Include our customizations
+
+enterAndClear "vendor/divested";
+if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += microG" >> packages.mk;
+if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += DNS66" >> packages.mk;
#
#END OF ROM CHANGES
#
diff --git a/Scripts/init.sh b/Scripts/init.sh
index 8155a8fa..7f5ada53 100644
--- a/Scripts/init.sh
+++ b/Scripts/init.sh
@@ -33,7 +33,7 @@ export DOS_DEFAULT_DNS_PRESET="OpenNIC"; #Sets default DNS. Options: Cloudflare,
export DOS_GLONASS_FORCED_ENABLE=true; #Enables GLONASS on all devices
export DOS_MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchWorkspace() and a through scan on buildAll()
export DOS_MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full
-export DOS_MICROG_INCLUDED="NLP"; #Determines inclusion of microG. Options: NONE, NLP, FULL
+export DOS_MICROG_INCLUDED="NLP"; #Determines inclusion of microG. Options: NLP, FULL
export DOS_HOSTS_BLOCKING=true; #Switch to false to prevent inclusion of our HOSTS file
export DOS_HOSTS_BLOCKING_LIST="https://divestos.xyz/hosts"; #Must be in the format "127.0.0.1 bad.domain.tld"
export DOS_OVERCLOCKS_ENABLED=true; #Switch to false to disable overclocks