Terminate all lines

This commit is contained in:
Tad 2018-04-23 08:59:18 -04:00
parent 28600556b4
commit 02908a652a
16 changed files with 299 additions and 299 deletions

View File

@ -19,13 +19,13 @@
#Is this the best way to do it? No. Is it the proper way to do it? No. Do I wish device maintainers would do it? Yes. Is it better then nothing? YES!
echo "Patching CVEs..."
echo "Patching CVEs...";
cd $base
cd $base;
for patcher in $cveScripts/*.sh; do
echo "Running " $patcher;
source $patcher;
done;
cd $base
echo "Patched CVEs!"
cd $base;
echo "Patched CVEs!";

View File

@ -35,20 +35,20 @@ export cveScripts=$scripts"CVE_Patchers/";
export ANDROID_HOME="/home/$USER/Android/Sdk";
export KBUILD_BUILD_USER=emy
export KBUILD_BUILD_HOST=dosbm
export KBUILD_BUILD_USER="emy";
export KBUILD_BUILD_HOST="dosbm";
export ANDROID_JACK_VM_ARGS="-Xmx6144m -Xms512m -Dfile.encoding=UTF-8 -XX:+TieredCompilation";
export JACK_SERVER_VM_ARGUMENTS="${ANDROID_JACK_VM_ARGS}";
export GRADLE_OPTS=-Xmx2048m
export GRADLE_OPTS="-Xmx2048m";
export NON_COMMERCIAL_USE_PATCHES=true; #Switch to false to prevent inclusion of non-commercial use patches
source $scriptsCommon"/Functions.sh";
source $scripts"/Functions.sh";
unalias cp
unalias mv
unalias rm
unalias ln
unalias cp;
unalias mv;
unalias rm;
unalias ln;

View File

@ -17,9 +17,9 @@
#Changes various default settings
echo "Changing default settings..."
echo "Changing default settings...";
enter "frameworks/base"
enter "frameworks/base";
sed -i '0,/wifi,cell,battery/s/wifi,cell,battery,dnd,flashlight,rotation,bt,airplane/wifi,cell,bt,dnd,flashlight,rotation,battery,profiles,location,airplane,saver,hotspot,nfc/' packages/SystemUI/res/values/config.xml; #Default quick tiles
#sed -i 's|config_longPressOnHomeBehavior">2|config_longPressOnHomeBehavior">0|' core/res/res/values/config.xml; #Set long press home to do nothing
#sed -i 's|config_doubleTapOnHomeBehavior">0|config_doubleTapOnHomeBehavior">8|' core/res/res/values/config.xml; #Set double tap home to switch to last app
@ -49,5 +49,5 @@ sed -i 's|drawer_compact_default">false|drawer_compact_default">true|' res/value
sed -i 's|use_scroller_default">true|use_scroller_default">false|' res/values/preferences_defaults.xml; #Hide scroller
sed -i 's|drawer_search_default">true|drawer_search_default">false|' res/values/preferences_defaults.xml; #Disable search
cd $base
echo "Default settings changed!"
cd $base;
echo "Default settings changed!";

View File

@ -74,8 +74,8 @@ patchWorkspace() {
#Deblobbing fixes
##setup-makefiles doesn't execute properly for some devices, running it twice seems to fix whatever is wrong
cd device/asus/Z00T && ./setup-makefiles.sh && cd $base
cd device/lge/h850 && ./setup-makefiles.sh && cd $base
cd device/asus/Z00T && ./setup-makefiles.sh && cd $base;
cd device/lge/h850 && ./setup-makefiles.sh && cd $base;
}
export -f patchWorkspace;

View File

@ -17,9 +17,9 @@
#Attempts to increase performance and battery life
echo "Optimizing..."
echo "Optimizing...";
enter "frameworks/base"
enter "frameworks/base";
sed -i 's/ScaleSetting = 1.0f;/ScaleSetting = 0.5f;/' services/core/java/com/android/server/wm/WindowManagerService.java;
sed -i 's|config_useVolumeKeySounds">true|config_useVolumeKeySounds">false|' core/res/res/values/config.xml;
sed -i 's|config_radioScanningTimeout">0|config_radioScanningTimeout">300000|' core/res/res/values/config.xml;
@ -33,5 +33,5 @@ sed -i 's|config_notifications_round_rect_clipping">true|config_notifications_ro
sed -i 's|config_showTemperatureWarning">0|config_showTemperatureWarning">1|' packages/SystemUI/res/values/config.xml; #XXX: Doesn't seem to work?
#sed -i 's|||'
cd $base
echo "Optimizing complete!"
cd $base;
echo "Optimizing complete!";

View File

@ -17,43 +17,43 @@
#Overclocks the CPU to increase performance
echo "Applying overclocks..."
echo "Applying overclocks...";
enter "kernel/amazon/hdx-common"
patch -p1 < $patches"android_kernel_amazon_hdx-common/0001-Overclock.patch" #300Mhz -> 268Mhz, 2.26Ghz -> 2.41Ghz =+0.60Ghz
patch -p1 < $patches"android_kernel_amazon_hdx-common/0002-Overclock.patch"
patch -p1 < $patches"android_kernel_amazon_hdx-common/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_amazon_hdx-common/0004-Overclock.patch"
enter "kernel/amazon/hdx-common";
patch -p1 < $patches"android_kernel_amazon_hdx-common/0001-Overclock.patch"; #300Mhz -> 268Mhz, 2.26Ghz -> 2.41Ghz =+0.60Ghz
patch -p1 < $patches"android_kernel_amazon_hdx-common/0002-Overclock.patch";
patch -p1 < $patches"android_kernel_amazon_hdx-common/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_amazon_hdx-common/0004-Overclock.patch";
enter "kernel/lge/hammerhead"
patch -p1 < $patches"android_kernel_lge_hammerhead/0001-Overclock.patch" #2.26Ghz -> 2.95Ghz =+2.76Ghz XXX: Untested!
enter "kernel/lge/hammerhead";
patch -p1 < $patches"android_kernel_lge_hammerhead/0001-Overclock.patch"; #2.26Ghz -> 2.95Ghz =+2.76Ghz XXX: Untested!
enter "kernel/lge/msm8992"
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch"
enter "kernel/lge/msm8992";
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch";
enter "kernel/motorola/msm8916"
patch -p1 < $patches"android_kernel_motorola_msm8916/0001-Overclock.patch" #1.36Ghz -> 1.88Ghz =+ 2.07Ghz
enter "kernel/motorola/msm8916";
patch -p1 < $patches"android_kernel_motorola_msm8916/0001-Overclock.patch"; #1.36Ghz -> 1.88Ghz =+ 2.07Ghz
enter "kernel/motorola/msm8992"
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch"
enter "kernel/motorola/msm8992";
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch";
enter "kernel/nextbit/msm8992"
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch"
enter "kernel/nextbit/msm8992";
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch";
cd $base
echo "Overclocks applied!"
cd $base;
echo "Overclocks applied!";

View File

@ -38,14 +38,14 @@
#START OF PREPRATION
#
#Download some (non-executable) out-of-tree files for use later on
mkdir /tmp/ar
cd /tmp/ar
wget https://spotco.us/hosts -N #XXX: /hosts is built from non-commercial use files, switch to /hsc for release
mkdir /tmp/ar;
cd /tmp/ar;
wget https://spotco.us/hosts -N; #XXX: /hosts is built from non-commercial use files, switch to /hsc for release
#Accept all SDK licences, not normally needed but Gradle managed apps fail without it
mkdir -p "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
mkdir -p "$ANDROID_HOME/licenses";
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license";
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license";
#
#END OF PREPRATION
#
@ -58,36 +58,36 @@ echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/a
cp -r $prebuiltApps"Fennec_DOS-Shim" $base"packages/apps/"; #Add a shim to install Fennec DOS without actually including the large APK
cp -r $prebuiltApps"android_vendor_FDroid_PrebuiltApps/." $base"vendor/fdroid_prebuilt/"; #Add the prebuilt apps
enterAndClear "bootable/recovery"
enterAndClear "bootable/recovery";
patch -p1 < $patches"android_bootable_recovery/0001-Squash_Menus.patch"; #What's a back button?
enterAndClear "build"
enterAndClear "build";
patch -p1 < $patches"android_build/0001-Automated_Build_Signing.patch" #Automated build signing. Disclaimer: From CopperheadOS 13.0
sed -i 's/messaging/Silence/' target/product/*.mk; #Replace AOSP Messaging app with Silence
enterAndClear "device/qcom/sepolicy"
patch -p1 < $patches"android_device_qcom_sepolicy/0001-Camera_Fix.patch" #Fix camera on user builds XXX: REMOVE THIS TRASH
enterAndClear "device/qcom/sepolicy";
patch -p1 < $patches"android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on user builds XXX: REMOVE THIS TRASH
enterAndClear "external/sqlite"
patch -p1 < $patches"android_external_sqlite/0001-Secure_Delete.patch" #Enable secure_delete by default. Disclaimer: From CopperheadOS 13.0
enterAndClear "external/sqlite";
patch -p1 < $patches"android_external_sqlite/0001-Secure_Delete.patch"; #Enable secure_delete by default. Disclaimer: From CopperheadOS 13.0
enterAndClear "frameworks/base"
git revert 0326bb5e41219cf502727c3aa44ebf2daa19a5b3 #re-enable doze on devices without gms
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" translateble="false">PERSIST|db_default_journal_mode" translateble="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 < $patches"android_frameworks_base/0001-Reduced_Resolution.patch" #Allow reducing resolution to save power TODO: Add 800x480
patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch" #Allow packages to spoof their signature (MicroG)
patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch" #Restrict signature spoofing to system apps signed with the platform key
patch -p1 < $patches"android_frameworks_base/0006-OpenNIC.patch" #Change fallback and tethering DNS servers to OpenNIC AnyCast
patch -p1 < $patches"android_frameworks_base/0001-Reduced_Resolution.patch"; #Allow reducing resolution to save power TODO: Add 800x480
patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch"; #Allow packages to spoof their signature (MicroG)
patch -p1 < $patches"android_frameworks_base/0005-Harden_Sig_Spoofing.patch"; #Restrict signature spoofing to system apps signed with the platform key
patch -p1 < $patches"android_frameworks_base/0006-OpenNIC.patch"; #Change fallback and tethering DNS servers to OpenNIC AnyCast
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
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;
#enterAndClear "frameworks/opt/net/ims"
#patch -p1 < $patches"android_frameworks_opt_net_ims/0001-Fix_Calling.patch" #Fix calling after we remove IMS
#enterAndClear "frameworks/opt/net/ims";
#patch -p1 < $patches"android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling after we remove IMS
enterAndClear "frameworks/opt/net/wifi"
enterAndClear "frameworks/opt/net/wifi";
#Fix an issue when permision review is enabled that prevents using the Wi-Fi quick tile
#See https://github.com/CopperheadOS/platform_frameworks_opt_net_wifi/commit/c2a2f077a902226093b25c563e0117e923c7495b
sed -i 's/boolean mPermissionReviewRequired/boolean mPermissionReviewRequired = false/' service/java/com/android/server/wifi/WifiServiceImpl.java;
@ -95,55 +95,55 @@ awk -i inplace '!/mPermissionReviewRequired = Build.PERMISSIONS_REVIEW_REQUIRED/
awk -i inplace '!/\|\| context.getResources\(\).getBoolean\(/' service/java/com/android/server/wifi/WifiServiceImpl.java;
awk -i inplace '!/com.android.internal.R.bool.config_permissionReviewRequired/' service/java/com/android/server/wifi/WifiServiceImpl.java;
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
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
patch -p1 < $patches"android_packages_apps_CMParts/0001-Remove_Analytics.patch" #Remove the rest of CMStats
patch -p1 < $patches"android_packages_apps_CMParts/0002-Reduced_Resolution.patch" #Allow reducing resolution to save power
patch -p1 < $patches"android_packages_apps_CMParts/0001-Remove_Analytics.patch"; #Remove the rest of CMStats
patch -p1 < $patches"android_packages_apps_CMParts/0002-Reduced_Resolution.patch"; #Allow reducing resolution to save power
enterAndClear "packages/apps/FakeStore"
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;
enterAndClear "packages/apps/FDroid"
enterAndClear "packages/apps/FDroid";
cp $patches"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/release/' Android.mk;
sed -i 's|gradle|./gradlew|' Android.mk; #Gradle 4.0 fix
sed -i 's|/$(fdroid_dir) \&\&| \&\&|' Android.mk; #One line wouldn't work... no matter what I tried.
#TODO: Change the package ID until https://gitlab.com/fdroid/fdroidclient/issues/843 is implemented
enterAndClear "packages/apps/FDroidPrivilegedExtension"
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0001-Release_Key.patch" #Change to release key
enterAndClear "packages/apps/FDroidPrivilegedExtension";
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0001-Release_Key.patch"; #Change to release key
#release-keys: 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-keys: 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
enterAndClear "packages/apps/GmsCore"
git submodule update --init --recursive
enterAndClear "packages/apps/GmsCore";
git submodule update --init --recursive;
sed -i 's|build/outputs/apk/play-services-core-release-unsigned.apk|build/outputs/apk/release/play-services-core-release-unsigned.apk|' Android.mk;
enterAndClear "packages/apps/GsfProxy"
enterAndClear "packages/apps/GsfProxy";
sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle;
enterAndClear "packages/apps/PackageInstaller"
patch -p1 < $patches"android_packages_apps_PackageInstaller/64d8b44.diff" #Fix an issue with Permission Review
enterAndClear "packages/apps/PackageInstaller";
patch -p1 < $patches"android_packages_apps_PackageInstaller/64d8b44.diff"; #Fix an issue with Permission Review
enterAndClear "packages/apps/Settings"
git revert 2ebe6058c546194a301c1fd22963d6be4adbf961
enterAndClear "packages/apps/Settings";
git revert 2ebe6058c546194a301c1fd22963d6be4adbf961;
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length
sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/PrivacySettings.java; #MicroG doesn't support Backup, hide the options
enterAndClear "packages/apps/SetupWizard"
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-Remove_Analytics.patch" #Remove the rest of CMStats
enterAndClear "packages/apps/SetupWizard";
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove the rest of CMStats
enterAndClear "packages/apps/Trebuchet"
enterAndClear "packages/apps/Trebuchet";
cp -r $patches"android_packages_apps_Trebuchet/default_workspace/." "res/xml/";
enterAndClear "packages/apps/Updater"
patch -p1 < $patches"android_packages_apps_Updater/0001-Server.patch" #Switch to our server
enterAndClear "packages/apps/Updater";
patch -p1 < $patches"android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
#TODO: Remove changelog
enterAndClear "packages/apps/WallpaperPicker"
enterAndClear "packages/apps/WallpaperPicker";
rm res/drawable-nodpi/{*.png,*.jpg} res/values-nodpi/wallpapers.xml; #Remove old ones
cp -r $dosWallpapers'Compressed/.' res/drawable-nodpi/; #Add ours
cp -r $dosWallpapers"Thumbs/." res/drawable-nodpi/;
@ -152,38 +152,38 @@ sed -i 's/req.touchEnabled = touchEnabled;/req.touchEnabled = true;/' src/com/an
sed -i 's/mCropView.setTouchEnabled(req.touchEnabled);/mCropView.setTouchEnabled(true);/' src/com/android/wallpaperpicker/WallpaperCropActivity.java;
sed -i 's/WallpaperUtils.EXTRA_WALLPAPER_OFFSET, 0);/WallpaperUtils.EXTRA_WALLPAPER_OFFSET, 0.5f);/' src/com/android/wallpaperpicker/WallpaperPickerActivity.java; #Center aligned by default
enterAndClear "packages/inputmethods/LatinIME"
patch -p1 < $patches"android_packages_inputmethods_LatinIME/0001-Voice.patch" #Remove voice input key
enterAndClear "packages/inputmethods/LatinIME";
patch -p1 < $patches"android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
enterAndClear "packages/services/Telephony"
enterAndClear "packages/services/Telephony";
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_packages_services_Telephony/0001-LTE_Only.patch"; fi; #LTE only preferred network mode choice. XXX: NEEDS SIGNOFF FROM COPPERHEAD
enterAndClear "system/core"
enterAndClear "system/core";
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then cat /tmp/ar/hosts >> rootdir/etc/hosts; fi; #Merge in our HOSTS file XXX: Switch to /hsc for release
git revert 0217dddeb5c16903c13ff6c75213619b79ea622b d7aa1231b6a0631f506c0c23816f2cd81645b15f #Always update recovery XXX: This doesn't seem to work
patch -p1 < $patches"android_system_core/0001-Harden_Mounts.patch" #Harden mounts with nodev/noexec/nosuid. Disclaimer: From CopperheadOS 13.0
git revert 0217dddeb5c16903c13ff6c75213619b79ea622b d7aa1231b6a0631f506c0c23816f2cd81645b15f; #Always update recovery XXX: This doesn't seem to work
patch -p1 < $patches"android_system_core/0001-Harden_Mounts.patch"; #Harden mounts with nodev/noexec/nosuid. Disclaimer: From CopperheadOS 13.0
enterAndClear "system/keymaster"
patch -p1 < $patches"android_system_keymaster/0001-Backport_Fixes.patch" #Fixes from 8.1, appears to fix https://jira.lineageos.org/browse/BUGBASH-590
patch -p1 < $patches"android_system_keymaster/0002-Backport_Fixes.patch"
enterAndClear "system/keymaster";
patch -p1 < $patches"android_system_keymaster/0001-Backport_Fixes.patch"; #Fixes from 8.1, appears to fix https://jira.lineageos.org/browse/BUGBASH-590
patch -p1 < $patches"android_system_keymaster/0002-Backport_Fixes.patch";
enterAndClear "system/vold"
patch -p1 < $patches"android_system_vold/0001-AES256.patch" #Add a variable for enabling AES-256 bit encryption
enterAndClear "system/vold";
patch -p1 < $patches"android_system_vold/0001-AES256.patch"; #Add a variable for enabling AES-256 bit encryption
enterAndClear "vendor/cm"
rm -rf overlay/common/vendor/cmsdk/packages #Remove analytics
enterAndClear "vendor/cm";
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
patch -p1 < $patches"android_vendor_cm/0001-SCE.patch" #Include our extras such as MicroG and F-Droid
cp $patches"android_vendor_cm/sce.mk" config/sce.mk
patch -p1 < $patches"android_vendor_cm/0001-SCE.patch"; #Include our extras such as MicroG and F-Droid
cp $patches"android_vendor_cm/sce.mk" config/sce.mk;
cp $patches"android_vendor_cm/config.xml" overlay/common/vendor/cmsdk/cm/res/res/values/config.xml; #Per app performance profiles
cp -r $patches"android_vendor_cm/firmware_deblobber" .;
cp $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
sed -i 's/messaging/Silence/' config/telephony.mk; #Replace AOSP Messaging app with Silence
enterAndClear "vendor/cmsdk"
enterAndClear "vendor/cmsdk";
awk -i inplace '!/WeatherManagerServiceBroker/' cm/res/res/values/config.xml; #Disable Weather
cp $patches"cm_platform_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
@ -194,22 +194,22 @@ sed -i 's/shouldUseOptimizations(weight)/true/' cm/lib/main/java/org/cyanogenmod
#
#START OF DEVICE CHANGES
#
#enterAndClear "device/amazon/hdx-common"
#enterAndClear "device/amazon/hdx-common";
#XXX: If not used with a supported recovery, it'll be thrown into a bootloop, don't worry just 'fastboot erase misc' and reboot
#echo "/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults" >> rootdir/etc/fstab.qcom; #Add the misc (mmcblk0p5) partition for recovery flags
enterAndClear "device/motorola/clark"
enterAndClear "device/motorola/clark";
sed -i 's/0xA04D/0xA04D|0xA052/' board-info.txt; #Allow installing on Nougat bootloader, assume the user is running the correct modem
rm board-info.txt; #Never restrict installation
#Make changes to all devices
cd $base
cd $base;
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enhanceLocation "$0"' {} \;
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDexPreOpt "$0"' {} \;
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableForcedEncryption "$0"' {} \;
#find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \;
find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \;
cd $base
cd $base;
#Fixes
#Fix broken options enabled by hardenDefconfig()

View File

@ -17,34 +17,34 @@
#Updates select user facing strings
echo "Rebranding..."
echo "Rebranding...";
enter "bootable/recovery"
enter "bootable/recovery";
sed -i 's|Android Recovery|DivestOS Recovery|' *_ui.cpp;
enter "build"
enter "build";
sed -i 's|echo "ro.build.user=$USER"|echo "ro.build.user=emy"|' tools/buildinfo.sh; #Override build user
sed -i 's|echo "ro.build.host=`hostname`"|echo "ro.build.host=dosbm"|' tools/buildinfo.sh; #Override build host
sed -i '/CM_TARGET_PACKAGE/s/lineage/coverage/' core/Makefile;
enter "packages/apps/Settings"
enter "packages/apps/Settings";
sed -i '/.*cmlicense_title/s/LineageOS/DivestOS/' res/values*/cm_strings.xml;
sed -i '/.*cmupdate_settings_title/s/LineageOS/DivestOS/' res/values*/cm_strings.xml;
sed -i '/.*mod_version/s/LineageOS/DivestOS/' res/values*/cm_strings.xml;
enter "packages/apps/SetupWizard"
enter "packages/apps/SetupWizard";
sed -i 's|http://lineageos.org/legal|https://divestos.xyz/pages/legal/pp.html|' src/com/cyanogenmod/setupwizard/LineageSettingsActivity.java;
sed -i '/.*setup_services/s/LineageOS/DivestOS/' res/values*/strings.xml;
sed -i '/.*services_explanation/s/LineageOS/DivestOS/' res/values*/strings.xml;
cp $patches"android_packages_apps_SetupWizard/logo.xml" "res/drawable/logo.xml"; #Replace Lineage logo with ours
enter "packages/apps/Updater"
enter "packages/apps/Updater";
sed -i 's|>LineageOS|>DivestOS|' res/values*/strings.xml;
enter "vendor/cm"
enter "vendor/cm";
sed -i 's|https://lineageos.org/legal|https://divestos.xyz/pages/about.html|' config/common.mk;
sed -i '/.*ZIPPATH=/s/lineage/coverage/' build/envsetup.sh;
rm -rf bootanimation #TODO: Create a boot animation
cd $base
echo "Rebranding complete!"
cd $base;
echo "Rebranding complete!";

View File

@ -17,59 +17,59 @@
#Replaces teal accents with orange/yellow ones
echo "Applying theme..."
echo "Applying theme...";
export themeOverride50="FFCA28" #Amber 400
export themeOverride100="FFC107" #Amber 500
export themeOverride200="FFA726" #Orange 400
export themeOverride300="FF9800" #Orange 500
export themeOverride500="FF5722" #Deep Orange 500
export themeOverride700="E64A19" #Deep Orange 700
export themeOverride50="FFCA28"; #Amber 400
export themeOverride100="FFC107"; #Amber 500
export themeOverride200="FFA726"; #Orange 400
export themeOverride300="FF9800"; #Orange 500
export themeOverride500="FF5722"; #Deep Orange 500
export themeOverride700="E64A19"; #Deep Orange 700
#export themeOverride50="26C6DA" #Cyan 400
#export themeOverride100="00BCD4" #Cyan 500
#export themeOverride200="29B6F6" #Light Blue 400
#export themeOverride300="03A9F4" #Light Blue 500
#export themeOverride500="2196F3" #Blue 500
#export themeOverride700="1976D2" #Blue 700
#export themeOverride50="26C6DA"; #Cyan 400
#export themeOverride100="00BCD4"; #Cyan 500
#export themeOverride200="29B6F6"; #Light Blue 400
#export themeOverride300="03A9F4"; #Light Blue 500
#export themeOverride500="2196F3"; #Blue 500
#export themeOverride700="1976D2"; #Blue 700
enter "frameworks/base"
sed -i "s/#ffe0f2f1/#ff$themeOverride50/" core/res/res/values/colors_material.xml
sed -i "s/#ffb2dfdb/#ff$themeOverride100/" core/res/res/values/colors_material.xml
sed -i "s/#ff80cbc4/#ff$themeOverride200/" core/res/res/values/colors_material.xml
sed -i "s/#ff4db6ac/#ff$themeOverride300/" core/res/res/values/colors_material.xml
sed -i "s/#ff009688/#ff$themeOverride500/" core/res/res/values/colors_material.xml
sed -i "s/#ff00796b/#ff$themeOverride700/" core/res/res/values/colors_material.xml
sed -i "s/#fff4511e/#ffe53935/" core/res/res/values/colors.xml
enter "frameworks/base";
sed -i "s/#ffe0f2f1/#ff$themeOverride50/" core/res/res/values/colors_material.xml;
sed -i "s/#ffb2dfdb/#ff$themeOverride100/" core/res/res/values/colors_material.xml;
sed -i "s/#ff80cbc4/#ff$themeOverride200/" core/res/res/values/colors_material.xml;
sed -i "s/#ff4db6ac/#ff$themeOverride300/" core/res/res/values/colors_material.xml;
sed -i "s/#ff009688/#ff$themeOverride500/" core/res/res/values/colors_material.xml;
sed -i "s/#ff00796b/#ff$themeOverride700/" core/res/res/values/colors_material.xml;
sed -i "s/#fff4511e/#ffe53935/" core/res/res/values/colors.xml;
enter "packages/apps/CMParts"
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/colors.xml
enter "packages/apps/CMParts";
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/colors.xml;
enter "packages/apps/GmsCore"
sed -i "s/#ff7fcac3/#ff$themeOverride300/" microg-ui-tools/src/main/res/values/colors.xml
sed -i "s/#ff009688/#ff$themeOverride500/" microg-ui-tools/src/main/res/values/colors.xml
enter "packages/apps/GmsCore";
sed -i "s/#ff7fcac3/#ff$themeOverride300/" microg-ui-tools/src/main/res/values/colors.xml;
sed -i "s/#ff009688/#ff$themeOverride500/" microg-ui-tools/src/main/res/values/colors.xml;
enter "packages/apps/Settings"
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/styles.xml
enter "packages/apps/Settings";
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/styles.xml;
#TODO: Fix: Storage, Profiles
enter "packages/apps/Trebuchet"
sed -i "s/009688/$themeOverride500/" res/values/*colors.xml
sed -i "s/009688/$themeOverride500/" WallpaperPicker/res/values/colors.xml
mogrify -format png -fill "#$themeOverride500" -opaque "#009688" -fuzz 10% res/drawable*/cling_bg.9.png
enter "packages/apps/Trebuchet";
sed -i "s/009688/$themeOverride500/" res/values/*colors.xml;
sed -i "s/009688/$themeOverride500/" WallpaperPicker/res/values/colors.xml;
mogrify -format png -fill "#$themeOverride500" -opaque "#009688" -fuzz 10% res/drawable*/cling_bg.9.png;
#TODO: Fix: Open app icon
enter "packages/apps/Updater"
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/colors.xml
enter "packages/apps/Updater";
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/colors.xml;
enter "packages/inputmethods/LatinIME"
sed -i "s/#80CBC4/#$themeOverride200/" java/res/values/colors.xml
sed -i "s/#4DB6AC/#$themeOverride300/" java/res/values/colors.xml
mogrify -format png -fill "#$themeOverride100" -opaque "#b2dfdb" -fuzz 10% java/res/drawable*/*lxx*.png
mogrify -format png -fill "#$themeOverride200" -opaque "#80cbc4" -fuzz 10% java/res/drawable*/*lxx*.png
mogrify -format png -fill "#$themeOverride300" -opaque "#4db6ac" -fuzz 10% java/res/drawable*/*lxx*.png
mogrify -format png -fill "#$themeOverride300" -opaque "#7fcac3" -fuzz 10% java/res/drawable*/*lxx*.png
mogrify -format png -fill "#$themeOverride400" -opaque "#26a69a" -fuzz 10% java/res/drawable*/*lxx*.png
enter "packages/inputmethods/LatinIME";
sed -i "s/#80CBC4/#$themeOverride200/" java/res/values/colors.xml;
sed -i "s/#4DB6AC/#$themeOverride300/" java/res/values/colors.xml;
mogrify -format png -fill "#$themeOverride100" -opaque "#b2dfdb" -fuzz 10% java/res/drawable*/*lxx*.png;
mogrify -format png -fill "#$themeOverride200" -opaque "#80cbc4" -fuzz 10% java/res/drawable*/*lxx*.png;
mogrify -format png -fill "#$themeOverride300" -opaque "#4db6ac" -fuzz 10% java/res/drawable*/*lxx*.png;
mogrify -format png -fill "#$themeOverride300" -opaque "#7fcac3" -fuzz 10% java/res/drawable*/*lxx*.png;
mogrify -format png -fill "#$themeOverride400" -opaque "#26a69a" -fuzz 10% java/res/drawable*/*lxx*.png;
cd $base
echo "Applied theme!"
cd $base;
echo "Applied theme!";

View File

@ -35,20 +35,20 @@ export cveScripts=$scripts"CVE_Patchers/";
export ANDROID_HOME="/home/$USER/Android/Sdk";
export KBUILD_BUILD_USER=emy
export KBUILD_BUILD_HOST=dosbm
export KBUILD_BUILD_USER="emy";
export KBUILD_BUILD_HOST="dosbm";
export ANDROID_JACK_VM_ARGS="-Xmx6144m -Xms512m -Dfile.encoding=UTF-8 -XX:+TieredCompilation";
export JACK_SERVER_VM_ARGUMENTS="${ANDROID_JACK_VM_ARGS}";
export GRADLE_OPTS=-Xmx2048m
export GRADLE_OPTS="-Xmx2048m";
export NON_COMMERCIAL_USE_PATCHES=true; #Switch to false to prevent inclusion of non-commercial use patches
source $scriptsCommon"/Functions.sh";
source $scripts"/Functions.sh";
unalias cp
unalias mv
unalias rm
unalias ln
unalias cp;
unalias mv;
unalias rm;
unalias ln;

View File

@ -17,31 +17,31 @@
#Changes various default settings
echo "Changing default settings..."
echo "Changing default settings...";
enter "frameworks/base"
enter "frameworks/base";
sed -i '0,/wifi,bt,dnd,flashlight/s/wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast/wifi,cell,bt,dnd,flashlight,rotation,battery,sync,location,airplane,saver,hotspot,nfc/' packages/SystemUI/res/values/config.xml; #Default quick tiles
#sed -i 's|config_longPressOnHomeBehavior">2|config_longPressOnHomeBehavior">0|' core/res/res/values/config.xml; #Set long press home to do nothing
#sed -i 's|config_doubleTapOnHomeBehavior">0|config_doubleTapOnHomeBehavior">8|' core/res/res/values/config.xml; #Set double tap home to switch to last app
enter "packages/apps/Dialer"
enter "packages/apps/Dialer";
sed -i 's/LineageSettings.System.ENABLE_FORWARD_LOOKUP, 1)/LineageSettings.System.ENABLE_FORWARD_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable FLP
sed -i 's/LineageSettings.System.ENABLE_PEOPLE_LOOKUP, 1)/LineageSettings.System.ENABLE_PEOPLE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable PLP
sed -i 's/LineageSettings.System.ENABLE_REVERSE_LOOKUP, 1)/LineageSettings.System.ENABLE_REVERSE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable RLP
enter "packages/apps/FDroid"
enter "packages/apps/FDroid";
sed -i 's|DEFAULT_ROOTED = true;|DEFAULT_ROOTED = false;|' app/src/main/java/org/fdroid/fdroid/Preferences.java; #Hide root apps
sed -i '/string\/rooted/!b;n;s/defaultValue="true"/defaultValue="false"/' app/src/main/res/xml/preferences.xml;
sed -i 's|DEFAULT_HIDE_ANTI_FEATURE_APPS = false;|DEFAULT_HIDE_ANTI_FEATURE_APPS = true;|' app/src/main/java/org/fdroid/fdroid/Preferences.java; #Hide anti-feature apps
sed -i '/string\/hide_anti_feature_apps/!b;n;s/defaultValue="false"/defaultValue="true"/' app/src/main/res/xml/preferences.xml;
enter "packages/apps/Nfc"
enter "packages/apps/Nfc";
sed -i 's/static final boolean NFC_ON_DEFAULT = true;/static final boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
sed -i 's/static final boolean NDEF_PUSH_ON_DEFAULT = true;/static final boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
enter "packages/apps/Settings"
enter "packages/apps/Settings";
sed -i 's/Settings.Secure.INSTANT_APPS_ENABLED, 1/Settings.Secure.INSTANT_APPS_ENABLED, 0/' src/com/android/settings/applications/ManageDomainUrls.java; #Disable "Instant Apps"
sed -i 's/Float.parseFloat(newValue.toString()) : 1;/Float.parseFloat(newValue.toString()) : 0.5f;/' src/com/android/settings/development/DevelopmentSettings.java; #Always reset animation scales to 0.5
cd $base
echo "Default settings changed!"
cd $base;
echo "Default settings changed!";

View File

@ -78,7 +78,7 @@ patchWorkspace() {
#Deblobbing fixes
##setup-makefiles doesn't execute properly for some devices, running it twice seems to fix whatever is wrong
cd device/lge/h850 && ./setup-makefiles.sh && cd $base
cd device/lge/h850 && ./setup-makefiles.sh && cd $base;
}
export -f patchWorkspace;

View File

@ -17,9 +17,9 @@
#Attempts to increase performance and battery life
echo "Optimizing..."
echo "Optimizing...";
enter "frameworks/base"
enter "frameworks/base";
sed -i 's/ScaleSetting = 1.0f;/ScaleSetting = 0.5f;/' services/core/java/com/android/server/wm/WindowManagerService.java; #TODO: Fix transition scale
sed -i 's|config_useVolumeKeySounds">true|config_useVolumeKeySounds">false|' core/res/res/values/config.xml;
sed -i 's|config_radioScanningTimeout">0|config_radioScanningTimeout">300000|' core/res/res/values/config.xml;
@ -33,5 +33,5 @@ sed -i 's|config_notifications_round_rect_clipping">true|config_notifications_ro
sed -i 's|config_showTemperatureWarning">0|config_showTemperatureWarning">1|' packages/SystemUI/res/values/config.xml; #XXX: Doesn't seem to work?
#sed -i 's|||'
cd $base
echo "Optimizing complete!"
cd $base;
echo "Optimizing complete!";

View File

@ -17,52 +17,52 @@
#Overclocks the CPU to increase performance
echo "Applying overclocks..."
echo "Applying overclocks...";
enter "kernel/huawei/angler"
patch -p1 < $patches"android_kernel_huawei_angler/0001-Overclock.patch"
enter "kernel/huawei/angler";
patch -p1 < $patches"android_kernel_huawei_angler/0001-Overclock.patch";
enter "kernel/lge/bullhead"
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0002-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch"
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch"
enter "kernel/lge/bullhead";
patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0002-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch";
patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch";
enter "kernel/lge/g3"
patch -p1 < $patches"android_kernel_lge_g3/0001-Overclock.patch" #2.45Ghz -> 2.76Ghz =+1.24Ghz
patch -p1 < $patches"android_kernel_lge_g3/0002-Overclock.patch"
patch -p1 < $patches"android_kernel_lge_g3/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_lge_g3/0004-Overclock.patch"
enter "kernel/lge/g3";
patch -p1 < $patches"android_kernel_lge_g3/0001-Overclock.patch"; #2.45Ghz -> 2.76Ghz =+1.24Ghz
patch -p1 < $patches"android_kernel_lge_g3/0002-Overclock.patch";
patch -p1 < $patches"android_kernel_lge_g3/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_lge_g3/0004-Overclock.patch";
enter "kernel/lge/hammerhead"
patch -p1 < $patches"android_kernel_lge_hammerhead/0001-Overclock.patch" #2.26Ghz -> 2.95Ghz =+2.76Ghz XXX: Untested!
enter "kernel/lge/hammerhead";
patch -p1 < $patches"android_kernel_lge_hammerhead/0001-Overclock.patch"; #2.26Ghz -> 2.95Ghz =+2.76Ghz XXX: Untested!
enter "kernel/lge/mako"
patch -p1 < $patches"android_kernel_lge_mako/0001-Overclock.patch"
patch -p1 < $patches"android_kernel_lge_mako/0002-Overclock.patch"
patch -p1 < $patches"android_kernel_lge_mako/0003-Overclock.patch"
patch -p1 < $patches"android_kernel_lge_mako/0004-Overclock.patch"
patch -p1 < $patches"android_kernel_lge_mako/0005-Overclock.patch"
echo "CONFIG_LOW_CPUCLOCKS=y" >> arch/arm/configs/lineageos_mako_defconfig #384Mhz -> 81Mhz
echo "CONFIG_CPU_OVERCLOCK=y" >> arch/arm/configs/lineageos_mako_defconfig #1.51Ghz -> 1.7Ghz =+0.90Ghz
#echo "CPU_OVERCLOCK_ULTRA=y" >> arch/arm/configs/lineageos_mako_defconfig #1.51Ghz -> 1.94Ghz =+1.72Ghz XXX: Causes excessive throttling
enter "kernel/lge/mako";
patch -p1 < $patches"android_kernel_lge_mako/0001-Overclock.patch";
patch -p1 < $patches"android_kernel_lge_mako/0002-Overclock.patch";
patch -p1 < $patches"android_kernel_lge_mako/0003-Overclock.patch";
patch -p1 < $patches"android_kernel_lge_mako/0004-Overclock.patch";
patch -p1 < $patches"android_kernel_lge_mako/0005-Overclock.patch";
echo "CONFIG_LOW_CPUCLOCKS=y" >> arch/arm/configs/lineageos_mako_defconfig; #384Mhz -> 81Mhz
echo "CONFIG_CPU_OVERCLOCK=y" >> arch/arm/configs/lineageos_mako_defconfig; #1.51Ghz -> 1.7Ghz =+0.90Ghz
#echo "CPU_OVERCLOCK_ULTRA=y" >> arch/arm/configs/lineageos_mako_defconfig; #1.51Ghz -> 1.94Ghz =+1.72Ghz XXX: Causes excessive throttling
#enter "kernel/lge/msm8992"
#patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch"
#patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch"
#patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch"
#patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch"
#patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch"
#patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch"
#enter "kernel/lge/msm8992";
#patch -p1 < $patches"android_kernel_common_msm8992/0001-Overclock.patch";
#patch -p1 < $patches"android_kernel_common_msm8992/0003-Overclock.patch";
#patch -p1 < $patches"android_kernel_common_msm8992/0004-Overclock.patch";
#patch -p1 < $patches"android_kernel_common_msm8992/0005-Overclock.patch";
#patch -p1 < $patches"android_kernel_common_msm8992/0006-Overclock.patch";
#patch -p1 < $patches"android_kernel_common_msm8992/0007-Overclock.patch";
#enter "kernel/motorola/msm8916"
#patch -p1 < $patches"android_kernel_motorola_msm8916/0001-Overclock.patch" #1.36Ghz -> 1.88Ghz =+ 2.07Ghz
#enter "kernel/motorola/msm8916";
#patch -p1 < $patches"android_kernel_motorola_msm8916/0001-Overclock.patch"; #1.36Ghz -> 1.88Ghz =+ 2.07Ghz
enter "kernel/oppo/msm8974"
patch -p1 < $patches"android_kernel_oppo_msm8974/0001-OverUnderClock-EXTREME.patch" #300Mhz -> 268Mhz, 2.45Ghz -> 2.95Ghz =+2.02Ghz XXX: Not 100% stable under intense workloads
enter "kernel/oppo/msm8974";
patch -p1 < $patches"android_kernel_oppo_msm8974/0001-OverUnderClock-EXTREME.patch"; #300Mhz -> 268Mhz, 2.45Ghz -> 2.95Ghz =+2.02Ghz XXX: Not 100% stable under intense workloads
cd $base
echo "Overclocks applied!"
cd $base;
echo "Overclocks applied!";

View File

@ -38,14 +38,14 @@
#START OF PREPRATION
#
#Download some (non-executable) out-of-tree files for use later on
mkdir /tmp/ar
cd /tmp/ar
wget https://spotco.us/hosts -N #XXX: /hosts is built from non-commercial use files, switch to /hsc for release
mkdir /tmp/ar;
cd /tmp/ar;
wget https://spotco.us/hosts -N; #XXX: /hosts is built from non-commercial use files, switch to /hsc for release
#Accept all SDK licences, not normally needed but Gradle managed apps fail without it
mkdir -p "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
mkdir -p "$ANDROID_HOME/licenses";
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license";
echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license";
#
#END OF PREPRATION
#
@ -58,34 +58,34 @@ echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/a
cp -r $prebuiltApps"Fennec_DOS-Shim" $base"packages/apps/"; #Add a shim to install Fennec DOS without actually including the large APK
cp -r $prebuiltApps"android_vendor_FDroid_PrebuiltApps/." $base"vendor/fdroid_prebuilt/"; #Add the prebuilt apps
enterAndClear "build/make"
patch -p1 < $patches"android_build/0001-Automated_Build_Signing.patch" #Automated build signing. Disclaimer: From CopperheadOS 13.0
enterAndClear "build/make";
patch -p1 < $patches"android_build/0001-Automated_Build_Signing.patch"; #Automated build signing. Disclaimer: From CopperheadOS 13.0
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_build/0002-Deny_USB.patch"; fi; #Deny USB support XXX: NEEDS SIGNOFF FROM COPPERHEAD
awk -i inplace '!/PRODUCT_EXTRA_RECOVERY_KEYS/' core/product.mk;
sed -i 's/messaging/Silence/' target/product/*.mk; #Replace AOSP Messaging app with Silence
enterAndClear "device/qcom/sepolicy"
patch -p1 < $patches"android_device_qcom_sepolicy/0001-Camera_Fix.patch" #Fix camera on -user builds XXX: REMOVE THIS TRASH
enterAndClear "device/qcom/sepolicy";
patch -p1 < $patches"android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
enterAndClear "external/svox"
enterAndClear "external/svox";
git revert 1419d63b4889a26d22443fd8df1f9073bf229d3d; #Add back makefiles
enterAndClear "frameworks/base"
enterAndClear "frameworks/base";
#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;
patch -p1 < $patches"android_frameworks_base/0002-Signature_Spoofing.patch" #Allow packages to spoof their signature (microG)
patch -p1 < $patches"android_frameworks_base/0003-Harden_Sig_Spoofing.patch" #Restrict signature spoofing to system apps signed with the platform key
patch -p1 < $patches"android_frameworks_base/0004-OpenNIC.patch" #Change fallback and tethering DNS servers to OpenNIC AnyCast
patch -p1 < $patches"android_frameworks_base/0002-Signature_Spoofing.patch"; #Allow packages to spoof their signature (microG)
patch -p1 < $patches"android_frameworks_base/0003-Harden_Sig_Spoofing.patch"; #Restrict signature spoofing to system apps signed with the platform key
patch -p1 < $patches"android_frameworks_base/0004-OpenNIC.patch"; #Change fallback and tethering DNS servers to OpenNIC AnyCast
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_frameworks_base/0005-Deny_USB.patch"; fi; #Deny USB support XXX: NEEDS SIGNOFF FROM COPPERHEAD
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
rm core/res/res/values/config.xml.orig core/res/res/values/strings.xml.orig;
#enterAndClear "frameworks/opt/net/ims"
#patch -p1 < $patches"android_frameworks_opt_net_ims/0001-Fix_Calling.patch" #Fix calling after we remove IMS
#enterAndClear "frameworks/opt/net/ims";
#patch -p1 < $patches"android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling after we remove IMS
enterAndClear "frameworks/opt/net/wifi"
enterAndClear "frameworks/opt/net/wifi";
#Fix an issue when permision review is enabled that prevents using the Wi-Fi quick tile
#See https://github.com/CopperheadOS/platform_frameworks_opt_net_wifi/commit/c2a2f077a902226093b25c563e0117e923c7495b
sed -i 's/boolean mPermissionReviewRequired/boolean mPermissionReviewRequired = false/' service/java/com/android/server/wifi/WifiServiceImpl.java;
@ -93,90 +93,90 @@ awk -i inplace '!/mPermissionReviewRequired = Build.PERMISSIONS_REVIEW_REQUIRED/
awk -i inplace '!/\|\| context.getResources\(\).getBoolean\(/' service/java/com/android/server/wifi/WifiServiceImpl.java;
awk -i inplace '!/com.android.internal.R.bool.config_permissionReviewRequired/' service/java/com/android/server/wifi/WifiServiceImpl.java;
enterAndClear "lineage-sdk"
enterAndClear "lineage-sdk";
awk -i inplace '!/WeatherManagerServiceBroker/' lineage/res/res/values/config.xml; #Disable Weather
cp $patches"android_lineage-sdk/profile_default.xml" lineage/res/res/xml/profile_default.xml; #Replace default profiles with *way* better ones
enterAndClear "packages/apps/FakeStore"
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;
enterAndClear "packages/apps/FDroid"
enterAndClear "packages/apps/FDroid";
cp $patches"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/release/' Android.mk;
sed -i 's|gradle|./gradlew|' Android.mk; #Gradle 4.0 fix
sed -i 's|/$(fdroid_dir) \&\&| \&\&|' Android.mk; #One line wouldn't work... no matter what I tried.
#TODO: Change the package ID until https://gitlab.com/fdroid/fdroidclient/issues/843 is implemented
enterAndClear "packages/apps/FDroidPrivilegedExtension"
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0001-Release_Key.patch" #Change to release key
enterAndClear "packages/apps/FDroidPrivilegedExtension";
patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0001-Release_Key.patch"; #Change to release key
#release-keys: 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-keys: 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
enterAndClear "packages/apps/GmsCore"
git submodule update --init --recursive
enterAndClear "packages/apps/GmsCore";
git submodule update --init --recursive;
sed -i 's|build/outputs/apk/play-services-core-release-unsigned.apk|build/outputs/apk/release/play-services-core-release-unsigned.apk|' Android.mk;
enterAndClear "packages/apps/GsfProxy"
enterAndClear "packages/apps/GsfProxy";
sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle;
enterAndClear "packages/apps/LineageParts"
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
patch -p1 < $patches"android_packages_apps_LineageParts/0001-Remove_Analytics-Pre_Trust.patch" #Remove analytics
patch -p1 < $patches"android_packages_apps_LineageParts/0001-Remove_Analytics-Pre_Trust.patch"; #Remove analytics
rm AndroidManifest.xml.orig res/values/*.xml.orig;
enterAndClear "packages/apps/Settings"
patch -p1 < $patches"android_packages_apps_Settings/0002-Remove_Analytics.patch" #Remove analytics
enterAndClear "packages/apps/Settings";
patch -p1 < $patches"android_packages_apps_Settings/0002-Remove_Analytics.patch"; #Remove analytics
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_packages_apps_Settings/0003-Deny_USB.patch"; fi; #Deny USB support XXX: NEEDS SIGNOFF FROM COPPERHEAD
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/password/ChooseLockPassword.java; #Increase max password length
sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/PrivacySettings.java; #MicroG doesn't support Backup, hide the options
rm res/values/strings.xml.orig;
enterAndClear "packages/apps/SetupWizard"
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-Remove_Analytics.patch" #Remove analytics
enterAndClear "packages/apps/SetupWizard";
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
enterAndClear "packages/apps/Trebuchet"
enterAndClear "packages/apps/Trebuchet";
cp -r $patches"android_packages_apps_Trebuchet/default_workspace/." "res/xml/";
enterAndClear "packages/apps/Updater"
patch -p1 < $patches"android_packages_apps_Updater/0001-Server.patch" #Switch to our server
enterAndClear "packages/apps/Updater";
patch -p1 < $patches"android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
#TODO: Remove changelog
enterAndClear "packages/apps/WallpaperPicker"
enterAndClear "packages/apps/WallpaperPicker";
#TODO: Add back wallpapers
sed -i 's/req.touchEnabled = touchEnabled;/req.touchEnabled = true;/' src/com/android/wallpaperpicker/WallpaperCropActivity.java; #Allow scrolling
sed -i 's/mCropView.setTouchEnabled(req.touchEnabled);/mCropView.setTouchEnabled(true);/' src/com/android/wallpaperpicker/WallpaperCropActivity.java;
sed -i 's/WallpaperUtils.EXTRA_WALLPAPER_OFFSET, 0);/WallpaperUtils.EXTRA_WALLPAPER_OFFSET, 0.5f);/' src/com/android/wallpaperpicker/WallpaperPickerActivity.java; #Center aligned by default
enterAndClear "packages/inputmethods/LatinIME"
patch -p1 < $patches"android_packages_inputmethods_LatinIME/0001-Voice.patch" #Remove voice input key
enterAndClear "packages/inputmethods/LatinIME";
patch -p1 < $patches"android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
enterAndClear "packages/services/Telephony"
enterAndClear "packages/services/Telephony";
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_packages_services_Telephony/0001-LTE_Only.patch"; fi; #LTE only preferred network mode choice. XXX: NEEDS SIGNOFF FROM COPPERHEAD
enterAndClear "system/core"
enterAndClear "system/core";
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then cat /tmp/ar/hosts >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
git revert a6a4ce8e9a6d63014047a447c6bb3ac1fa90b3f4 #Always update recovery
patch -p1 < $patches"android_system_core/0001-Harden_Mounts.patch" #Harden mounts with nodev/noexec/nosuid. Disclaimer: From CopperheadOS 13.0
git revert a6a4ce8e9a6d63014047a447c6bb3ac1fa90b3f4; #Always update recovery
patch -p1 < $patches"android_system_core/0001-Harden_Mounts.patch"; #Harden mounts with nodev/noexec/nosuid. Disclaimer: From CopperheadOS 13.0
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_system_core/0002-Deny_USB.patch"; fi; #Deny USB support XXX: NEEDS SIGNOFF FROM COPPERHEAD
enterAndClear "system/sepolicy"
patch -p1 < $patches"android_system_sepolicy/0001-LGE_Fixes.patch" #Fix -user builds for LGE devices
enterAndClear "system/sepolicy";
patch -p1 < $patches"android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_system_sepolicy/0002-Deny_USB.patch"; fi; #Deny USB support XXX: NEEDS SIGNOFF FROM COPPERHEAD
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < $patches"android_system_sepolicy/0003-Deny_USB-Aggressive.patch"; fi; #Deny USB on boot
enterAndClear "system/vold"
patch -p1 < $patches"android_system_vold/0001-AES256.patch" #Add a variable for enabling AES-256 bit encryption
enterAndClear "system/vold";
patch -p1 < $patches"android_system_vold/0001-AES256.patch"; #Add a variable for enabling AES-256 bit encryption
enterAndClear "vendor/lineage"
rm -rf overlay/common/vendor/lineage-sdk/packages #Remove analytics
enterAndClear "vendor/lineage";
rm -rf overlay/common/vendor/lineage-sdk/packages; #Remove analytics
awk -i inplace '!/50-lineage.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
patch -p1 < $patches"android_vendor_lineage/0001-SCE.patch" #Include our extras such as MicroG and F-Droid
cp $patches"android_vendor_lineage/sce.mk" config/sce.mk
patch -p1 < $patches"android_vendor_lineage/0001-SCE.patch"; #Include our extras such as MicroG and F-Droid
cp $patches"android_vendor_lineage/sce.mk" config/sce.mk;
cp -r $patches"android_vendor_lineage/firmware_deblobber" .;
cp $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
@ -188,29 +188,29 @@ sed -i 's/messaging/Silence/' config/telephony.mk; #Replace AOSP Messaging app w
#
#START OF DEVICE CHANGES
#
enterAndClear "device/lge/g2-common"
enterAndClear "device/lge/g2-common";
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
enterAndClear "device/lge/g3-common"
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 "allow wcnss_service block_device:dir search;" >> sepolicy/wcnss_service.te; #fix incorrect Wi-Fi MAC address
echo "/dev/block/platform/msm_sdcc\.1/by-name/pad u:object_r:misc_block_device:s0" >> sepolicy/file_contexts; #fix uncrypt denial
enterAndClear "device/lge/mako"
enterAndClear "device/lge/mako";
cp $patches"android_device_lge_mako/proprietary-blobs.txt" proprietary-blobs.txt; #update that? nah
enterAndClear "device/oppo/msm8974-common"
enterAndClear "device/oppo/msm8974-common";
sed -i "s/TZ.BF.2.0-2.0.0134/TZ.BF.2.0-2.0.0134|TZ.BF.2.0-2.0.0137/" board-info.txt; #Suport new TZ firmware https://review.lineageos.org/#/c/178999/
#Make changes to all devices
cd $base
cd $base;
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enhanceLocation "$0"' {} \;
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDexPreOpt "$0"' {} \;
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableForcedEncryption "$0"' {} \;
#find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \;
find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \;
cd $base
cd $base;
#Fix broken options enabled by hardenDefconfig()
sed -i "s/CONFIG_DEBUG_RODATA=y/# CONFIG_DEBUG_RODATA is not set/" kernel/google/msm/arch/arm/configs/lineageos_*_defconfig; #Breaks on compile

View File

@ -17,42 +17,42 @@
#Updates select user facing strings
echo "Rebranding..."
echo "Rebranding...";
enter "bootable/recovery"
enter "bootable/recovery";
sed -i 's|Android Recovery|DivestOS Recovery|' *_ui.cpp;
sed -i 's|LineageOS|DivestOS|' ui.cpp;
#TODO: Change out res-*/images/logo_image.png
enter "build/make"
enter "build/make";
sed -i 's|echo "ro.build.user=$USER"|echo "ro.build.user=emy"|' tools/buildinfo.sh; #Override build user
sed -i 's|echo "ro.build.host=`hostname`"|echo "ro.build.host=dosbm"|' tools/buildinfo.sh; #Override build host
enter "lineage-sdk"
enter "lineage-sdk";
sed -i '/.*lineage_version/s/LineageOS/DivestOS/' lineage/res/res/values*/strings.xml;
sed -i '/.*lineage_updates/s/LineageOS/DivestOS/' lineage/res/res/values*/strings.xml;
sed -i '/.*lineageos_system_label/s/LineageOS/DivestOS/' lineage/res/res/values*/strings.xml;
enter "packages/apps/LineageParts"
enter "packages/apps/LineageParts";
sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/DivestOS/' res/values*/strings.xml;
enter "packages/apps/Settings"
enter "packages/apps/Settings";
sed -i '/.*lineagelicense_title/s/LineageOS/DivestOS/' res/values*/cm_strings.xml;
enter "packages/apps/SetupWizard"
enter "packages/apps/SetupWizard";
sed -i 's|http://lineageos.org/legal|https://divestos.xyz/pages/legal/pp.html|' src/org/lineageos/setupwizard/LineageSettingsActivity.java;
sed -i '/.*setup_services/s/LineageOS/DivestOS/' res/values*/strings.xml;
sed -i '/.*services_explanation/s/LineageOS/DivestOS/' res/values*/strings.xml;
cp $patches"android_packages_apps_SetupWizard/logo.xml" "res/drawable/logo.xml"; #Replace Lineage logo with ours
enter "packages/apps/Updater"
enter "packages/apps/Updater";
sed -i 's|>LineageOS|>DivestOS|' res/values*/strings.xml;
enter "vendor/lineage"
enter "vendor/lineage";
sed -i 's|https://lineageos.org/legal|https://divestos.xyz/pages/about.html|' config/common.mk;
sed -i '/.*ZIPPATH=/s/lineage/coverage/' build/envsetup.sh;
sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/coverage/' build/tasks/bacon.mk;
rm -rf bootanimation #TODO: Create a boot animation
rm -rf bootanimation; #TODO: Create a boot animation
cd $base
echo "Rebranding complete!"
cd $base;
echo "Rebranding complete!";