mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
Directory sanity
This commit is contained in:
parent
dd3a611d0e
commit
ca857913ef
@ -20,7 +20,7 @@
|
||||
|
||||
echo "Optimizing...";
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
sed -i 's/ScaleSetting = 1.0f;/ScaleSetting = 0.5f;/' services/java/com/android/server/wm/WindowManagerService.java &>/dev/null || true;
|
||||
sed -i 's/AnimationScale = 1.0f;/AnimationScale = 0.5f;/' services/java/com/android/server/wm/WindowManagerService.java &>/dev/null || true;
|
||||
sed -i 's/DurationnScale = 1.0f;/DurationScale = 0.5f;/' services/java/com/android/server/wm/WindowManagerService.java &>/dev/null || true;
|
||||
@ -28,9 +28,11 @@ sed -i 's/ScaleSetting = 1.0f;/ScaleSetting = 0.5f;/' services/core/java/com/and
|
||||
sed -i 's/AnimationScale = 1.0f;/AnimationScale = 0.5f;/' services/core/java/com/android/server/wm/WindowManagerService.java &>/dev/null || true;
|
||||
sed -i 's/DurationnScale = 1.0f;/DurationScale = 0.5f;/' services/core/java/com/android/server/wm/WindowManagerService.java &>/dev/null || true;
|
||||
#sed -i 's|||'
|
||||
fi;
|
||||
|
||||
enter "kernel"
|
||||
if enter "kernel"; then
|
||||
sed -i "s/#define VM_MAX_READAHEAD\t128/#define VM_MAX_READAHEAD\t512/" ./*/*/include/linux/mm.h; #Lee Susman <lsusman@codeaurora.org>: Change the VM_MAX_READAHEAD value from the default 128KB to 512KB. This will allow the readahead window to grow to a maximum size of 512KB, which greatly benefits to sequential read throughput.
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Optimizing complete!";
|
||||
|
@ -24,21 +24,25 @@
|
||||
|
||||
echo "Changing default settings...";
|
||||
|
||||
enter "packages/apps/Dialer";
|
||||
if enter "packages/apps/Dialer"; then
|
||||
sed -i 's/ENABLE_FORWARD_LOOKUP, 1)/ENABLE_FORWARD_LOOKUP, 0)/' src/com/android/dialer/*/LookupSettings*.java; #Disable FLP
|
||||
sed -i 's/ENABLE_PEOPLE_LOOKUP, 1)/ENABLE_PEOPLE_LOOKUP, 0)/' src/com/android/dialer/*/LookupSettings*.java; #Disable PLP
|
||||
sed -i 's/ENABLE_REVERSE_LOOKUP, 1)/ENABLE_REVERSE_LOOKUP, 0)/' src/com/android/dialer/*/LookupSettings*.java; #Disable RLP
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Nfc";
|
||||
if enter "packages/apps/Nfc"; then
|
||||
sed -i 's/boolean NFC_ON_DEFAULT = true;/boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
|
||||
sed -i 's/boolean NDEF_PUSH_ON_DEFAULT = true;/boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i 's/Float.parseFloat(newValue.toString()) : 1;/Float.parseFloat(newValue.toString()) : 0.5f;/' src/com/android/settings/DevelopmentSettings.java; #Always reset animation scales to 0.5
|
||||
fi;
|
||||
|
||||
enter "vendor/cm";
|
||||
if enter "vendor/cm"; then
|
||||
sed -i 's/ro.config.notification_sound=Argon.ogg/ro.config.notification_sound=Pong.ogg/' config/common*.mk;
|
||||
sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.ogg/' config/common*.mk;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Default settings changed!";
|
||||
|
@ -58,38 +58,45 @@ cp -r "$DOS_PATCHES_COMMON""android_vendor_divested/." "$DOS_BUILD_BASE""vendor/
|
||||
sed -i 's/LOCAL_DEX_PREOPT := false/LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)/' packages/apps/Fennec_DOS-Shim/Android.mk;
|
||||
sed -i 's/LOCAL_DEX_PREOPT := false/LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)/' vendor/fdroid_prebuilt/Android.mk;
|
||||
|
||||
enterAndClear "build";
|
||||
if enterAndClear "build"; then
|
||||
sed -i 's/Mms/Silence/' target/product/*.mk; #Replace AOSP Messaging app with Silence
|
||||
sed -i '497i$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/base_rules.mk;
|
||||
sed -i '80iLOCAL_AAPT_FLAGS += --auto-add-overlay' core/package.mk;
|
||||
fi;
|
||||
|
||||
enterAndClear "external/bluetooth/bluedroid";
|
||||
if enterAndClear "external/bluetooth/bluedroid"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_bluetooth_bluedroid/251199.patch"; #asb-2019.12-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_bluetooth_bluedroid/265361.patch"; #asb-2019.12-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_bluetooth_bluedroid/265493.patch"; #asb-2019.12-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_bluetooth_bluedroid/265494.patch"; #asb-2019.12-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "external/libnfc-nci";
|
||||
if enterAndClear "external/libnfc-nci"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_libnfc-nci/258164.patch"; #asb-2019.09-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_libnfc-nci/258165.patch"; #asb-2019.09-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_libnfc-nci/264094.patch"; #asb-2019.11-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_libnfc-nci/264097.patch"; #asb-2019.11-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "external/libvpx";
|
||||
if enterAndClear "external/libvpx"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_libvpx/253499.patch"; #asb-2019.08-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_external_libvpx/253500.patch"; #asb-2019.08-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "external/sfntly";
|
||||
if enterAndClear "external/sfntly"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_sfntly/251198.patch"; #asb-2019.07-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "external/skia";
|
||||
if enterAndClear "external/skia"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_skia/249705.patch"; #asb-2019.06-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "external/sqlite";
|
||||
if enterAndClear "external/sqlite"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_sqlite/0001-Secure_Delete.patch"; #Enable secure_delete by default (AndroidHardening-13.0)
|
||||
patch -p1 < "$DOS_PATCHES/android_external_sqlite/263910.patch"; #asb-2019.11-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/av";
|
||||
if enterAndClear "frameworks/av"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/247874.patch"; #asb-2019.06-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/249706.patch"; #asb-2019.07-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/249707.patch"; #asb-2019.07-cm11
|
||||
@ -97,8 +104,9 @@ patch -p1 < "$DOS_PATCHES/android_frameworks_av/253521.patch"; #asb-2019.08-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/253522.patch"; #asb-2019.08-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/261040.patch"; #asb-2019.10-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/261041.patch"; #asb-2019.10-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/base";
|
||||
if enterAndClear "frameworks/base"; then
|
||||
hardenLocationFWB "$DOS_BUILD_BASE";
|
||||
sed -i 's/com.android.mms/org.smssecure.smssecure/' core/res/res/values/config.xml; #Change default SMS app to Silence
|
||||
sed -i 's|db_default_journal_mode">PERSIST|db_default_journal_mode">TRUNCATE|' core/res/res/values/config.xml; #Mirror SQLite secure_delete
|
||||
@ -111,30 +119,37 @@ patch -p1 < "$DOS_PATCHES/android_frameworks_base/265311.patch"; #asb-2019.12-cm
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_base/267438.patch"; #asb-2020.01-cm11
|
||||
changeDefaultDNS;
|
||||
#patch -p1 < "$DOS_PATCHES/android_frameworks_base/0008-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries #TODO BACKPORT-11.0
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/native";
|
||||
if enterAndClear "frameworks/native"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_native/253524.patch"; #asb-2019.08-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_native/256319.patch"; #asb-2019.09-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_native/256322.patch"; #asb-2019.09-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Bluetooth";
|
||||
if enterAndClear "packages/apps/Bluetooth"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Bluetooth/264098.patch"; #asb-2019.11-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Dialer";
|
||||
if enterAndClear "packages/apps/Dialer"; then
|
||||
rm -rf src/com/android/dialer/cmstats;
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Dialer/0001-Remove_Analytics.patch"; #Remove CMStats
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Email";
|
||||
if enterAndClear "packages/apps/Email"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Email/253862.patch"; #asb-2019.08-cm11
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Email/256927.patch"; #asb-2019.09-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/InCallUI";
|
||||
if enterAndClear "packages/apps/InCallUI"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_InCallUI/0001-Remove_Analytics.patch"; #Remove CMStats
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Nfc";
|
||||
if enterAndClear "packages/apps/Nfc"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Nfc/261042.patch"; #asb-2019.10-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Settings";
|
||||
if enterAndClear "packages/apps/Settings"; then
|
||||
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/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
|
||||
rm -rf src/com/android/settings/cmstats res/xml/security_settings_cyanogenmod.xml; #Nuke part of CMStats
|
||||
@ -142,20 +157,24 @@ patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0001-Remove_Analytics.p
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/230054.patch"; #ASB disclaimer
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/230392.patch"; #ASB disclaimer translations
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/248015.patch"; #asb-2019.05-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Trebuchet";
|
||||
if enterAndClear "packages/apps/Trebuchet"; then
|
||||
#cp -r "$DOS_PATCHES_COMMON/android_packages_apps_Trebuchet/default_workspace/." "res/xml/"; #TODO BACKPORT-11.0
|
||||
sed -i 's/mCropView.setTouchEnabled(touchEnabled);/mCropView.setTouchEnabled(true);/' WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java;
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/UnifiedEmail";
|
||||
if enterAndClear "packages/apps/UnifiedEmail"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_UnifiedEmail/253861.patch"; #asb-2019.08-cm11
|
||||
fi;
|
||||
|
||||
enterAndClear "system/core";
|
||||
if enterAndClear "system/core"; then
|
||||
sed -i 's/!= 2048/< 2048/' libmincrypt/tools/DumpPublicKey.java; #Allow 4096-bit keys
|
||||
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
|
||||
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden_Mounts.patch"; #Harden mounts with nodev/noexec/nosuid (AndroidHardening-13.0)
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/cm";
|
||||
if enterAndClear "vendor/cm"; then
|
||||
rm -rf terminal;
|
||||
awk -i inplace '!/50-cm.sh/' config/common.mk; #Make sure our hosts is always used
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then
|
||||
@ -166,11 +185,13 @@ sed -i 's/CM_BUILDTYPE := UNOFFICIAL/CM_BUILDTYPE := dos/' config/common.mk; #Ch
|
||||
if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/CM_BUILDTYPE := dos/CM_BUILDTYPE := dosNC/' config/common.mk; fi;
|
||||
sed -i 's/Mms/Silence/' config/telephony.mk; #Replace AOSP Messaging app with Silence
|
||||
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
|
||||
fi;
|
||||
|
||||
enter "vendor/divested";
|
||||
if enter "vendor/divested"; then
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> packages.mk; fi;
|
||||
if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_BLOCKING_APP" >> packages.mk; fi;
|
||||
awk -i inplace '!/FairEmail/' packages.mk; #FairEmail requires 5.0+
|
||||
fi;
|
||||
#
|
||||
#END OF ROM CHANGES
|
||||
#
|
||||
@ -178,7 +199,7 @@ awk -i inplace '!/FairEmail/' packages.mk; #FairEmail requires 5.0+
|
||||
#
|
||||
#START OF DEVICE CHANGES
|
||||
#
|
||||
enterAndClear "device/zte/nex"
|
||||
if enterAndClear "device/zte/nex" then
|
||||
mv cm.mk lineage.mk;
|
||||
sed -i 's/cm_/lineage_/' lineage.mk vendorsetup.sh;
|
||||
echo "TARGET_DISPLAY_USE_RETIRE_FENCE := true" >> BoardConfig.mk;
|
||||
@ -188,9 +209,11 @@ awk -i inplace '!/WCNSS_qcom_wlan_nv_2.bin/' proprietary-files.txt; #Missing
|
||||
#echo "lib/hw/camera.msm8960.so" >> proprietary-files.txt;
|
||||
#In nex-vendor-blobs.mk
|
||||
# Copy "system/lib/libtime_genoff.so" as "obj/lib/libtime_genoff.so"
|
||||
fi;
|
||||
|
||||
enterAndClear "kernel/zte/msm8930"
|
||||
if enterAndClear "kernel/zte/msm8930" then
|
||||
patch -p1 < "$DOS_PATCHES/android_kernel_zte_msm8930/0001-MDP-Fix.patch";
|
||||
fi;
|
||||
|
||||
#Make changes to all devices
|
||||
cd "$DOS_BUILD_BASE";
|
||||
@ -203,6 +226,7 @@ find "device" -maxdepth 2 -mindepth 2 -type d -print0 | xargs -0 -n 1 -P 8 -I {}
|
||||
find "kernel" -maxdepth 2 -mindepth 2 -type d -print0 | xargs -0 -n 1 -P 4 -I {} bash -c 'hardenDefconfig "{}"';
|
||||
cd "$DOS_BUILD_BASE";
|
||||
deblobAudio;
|
||||
removeBuildFingerprints;
|
||||
|
||||
#Fixes
|
||||
#Fix broken options enabled by hardenDefconfig()
|
||||
|
@ -20,31 +20,37 @@
|
||||
|
||||
echo "Rebranding...";
|
||||
|
||||
enter "bootable/recovery-cm";
|
||||
if enter "bootable/recovery-cm"; then
|
||||
sed -i 's|CyanogenMod Simple Recovery|'"$DOS_BRANDING_NAME"' Recovery|' ./recovery.cpp;
|
||||
fi;
|
||||
|
||||
enter "build";
|
||||
if enter "build"; then
|
||||
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/'"$DOS_BRANDING_ZIP_PREFIX"'/' core/Makefile;
|
||||
fi;
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
||||
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i '/.*cmlicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml
|
||||
sed -i '/.*cmlicense_activity_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml
|
||||
sed -i '/.*cmupdate_settings_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml
|
||||
sed -i '/.*mod_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml
|
||||
sed -i '/.*privacy_settings_cyanogenmod_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml
|
||||
fi;
|
||||
|
||||
enter "packages/apps/CMUpdater";
|
||||
if enter "packages/apps/CMUpdater"; then
|
||||
sed -i 's|https://download.cyanogenmod.org/api|'"$DOS_BRANDING_SERVER_OTA"'|' res/values/config.xml;
|
||||
fi;
|
||||
|
||||
enter "vendor/cm";
|
||||
if enter "vendor/cm"; then
|
||||
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' config/common.mk;
|
||||
rm -rf bootanimation;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Rebranding complete!";
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
echo "Changing default settings...";
|
||||
|
||||
enter "frameworks/base";
|
||||
#if enter "frameworks/base"; then
|
||||
#sed -i 's/CMPRIVACY_GUARD_NOTIFICATION, 1/CMPRIVACY_GUARD_NOTIFICATION, 0/' services/core/java/com/android/server/am/ActivityStack.java;
|
||||
#sed -i 's/VOLBTN_MUSIC_CONTROLS, 1/VOLBTN_MUSIC_CONTROLS, 0/' services/core/java/com/android/server/policy/PhoneWindowManager.java; #FIXME
|
||||
#sed -i 's/VOLUME_KEYS_CONTROL_RING_STREAM, 1/VOLUME_KEYS_CONTROL_RING_STREAM, 0/' services/core/java/com/android/server/audio/AudioService.java; #FIXME
|
||||
@ -32,23 +32,28 @@ enter "frameworks/base";
|
||||
#sed -i 's/TORCH_LONG_PRESS_POWER_TIMEOUT, 0/TORCH_LONG_PRESS_POWER_TIMEOUT, 120/' services/core/java/com/android/server/policy/PhoneWindowManager.java; #FIXME
|
||||
#sed -i 's/CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0/CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 1/' services/core/java/com/android/server/GestureLauncherService.java; #FIXME
|
||||
#sed -i 's/NAVIGATION_BAR_MENU_ARROW_KEYS, 0/NAVIGATION_BAR_MENU_ARROW_KEYS, 1/' packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java; #FIXME
|
||||
#fi;
|
||||
|
||||
enter "packages/apps/Dialer";
|
||||
if enter "packages/apps/Dialer"; then
|
||||
sed -i 's/ENABLE_FORWARD_LOOKUP, 1)/ENABLE_FORWARD_LOOKUP, 0)/' src/com/android/dialer/*/LookupSettings*.java; #Disable FLP
|
||||
sed -i 's/ENABLE_PEOPLE_LOOKUP, 1)/ENABLE_PEOPLE_LOOKUP, 0)/' src/com/android/dialer/*/LookupSettings*.java; #Disable PLP
|
||||
sed -i 's/ENABLE_REVERSE_LOOKUP, 1)/ENABLE_REVERSE_LOOKUP, 0)/' src/com/android/dialer/*/LookupSettings*.java; #Disable RLP
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Nfc";
|
||||
if enter "packages/apps/Nfc"; then
|
||||
sed -i 's/boolean NFC_ON_DEFAULT = true;/boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
|
||||
sed -i 's/boolean NDEF_PUSH_ON_DEFAULT = true;/boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i 's/WEB_ACTION_ENABLED, 1/WEB_ACTION_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/DevelopmentSettings.java; #Always reset animation scales to 0.5
|
||||
fi;
|
||||
|
||||
enter "vendor/cm";
|
||||
if enter "vendor/cm"; then
|
||||
sed -i 's/ro.config.notification_sound=Argon.ogg/ro.config.notification_sound=Pong.ogg/' config/common.mk;
|
||||
sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.ogg/' config/common.mk;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Default settings changed!";
|
||||
|
@ -54,33 +54,39 @@ gpgVerifyDirectory "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/packa
|
||||
cp -r "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BASE""vendor/fdroid_prebuilt/"; #Add the prebuilt apps
|
||||
cp -r "$DOS_PATCHES_COMMON""android_vendor_divested/." "$DOS_BUILD_BASE""vendor/divested/"; #Add our vendor files
|
||||
|
||||
enterAndClear "bootable/recovery";
|
||||
if enterAndClear "bootable/recovery"; then
|
||||
git revert --no-edit 3c0d796b79c7a1ee904e0cef7c0f2e20bf84c237; #remove sideload cache, breaks with large files
|
||||
patch -p1 < "$DOS_PATCHES/android_bootable_recovery/0001-Squash_Menus.patch"; #What's a back button?
|
||||
sed -i 's/(!has_serial_number || serial_number_matched)/!has_serial_number/' recovery.cpp; #Abort on serial number specific packages (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "build";
|
||||
if enterAndClear "build"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0001-OTA_Keys.patch"; #add correct keys to recovery for OTA verification
|
||||
sed -i '50i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aapt2.mk;
|
||||
sed -i '296iLOCAL_AAPT_FLAGS += --auto-add-overlay' core/package_internal.mk;
|
||||
sed -i 's/messaging/Silence/' target/product/aosp_base_telephony.mk; #Switch to Silence
|
||||
|
||||
enterAndClear "device/qcom/sepolicy";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/248649.patch"; #msm_irqbalance: Allow read for stats and interrupts
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on user builds XXX: REMOVE THIS TRASH
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
enterAndClear "external/chromium-webview";
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
|
||||
enterAndClear "external/sqlite";
|
||||
if enterAndClear "device/qcom/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/248649.patch"; #msm_irqbalance: Allow read for stats and interrupts
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on user builds XXX: REMOVE THIS TRASH
|
||||
fi;
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
if enterAndClear "external/chromium-webview"; then
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if enterAndClear "external/sqlite"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_external_sqlite/0001-Secure_Delete.patch"; #Enable secure_delete by default (AndroidHardening-13.0)
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/av";
|
||||
if enterAndClear "frameworks/av"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_av/212799.patch"; #FLAC extractor CVE-2017-0592. alt: 212827/174106
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/base";
|
||||
if enterAndClear "frameworks/base"; then
|
||||
hardenLocationFWB "$DOS_BUILD_BASE";
|
||||
git revert --no-edit 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
|
||||
@ -97,82 +103,100 @@ patch -p1 < "$DOS_PATCHES_COMMON/android_frameworks_base/0001-Browser_No_Locatio
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_frameworks_base/0003-SUPL_No_IMSI.patch"; #don't send IMSI to SUPL (MSe)
|
||||
rm -rf packages/Osu; #Automatic Wi-Fi connection non-sense
|
||||
rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps
|
||||
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
|
||||
enterAndClear "frameworks/opt/net/ims";
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling when IMS is removed
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/opt/net/wifi";
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
|
||||
if enterAndClear "frameworks/opt/net/ims"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling when IMS is removed
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if enterAndClear "frameworks/opt/net/wifi"; then
|
||||
#Fix an issue when permision review is enabled that prevents using the Wi-Fi quick tile (AndroidHardening)
|
||||
#See https://github.com/AndroidHardening/platform_frameworks_opt_net_wifi/commit/c2a2f077a902226093b25c563e0117e923c7495b
|
||||
sed -i 's/boolean mPermissionReviewRequired/boolean mPermissionReviewRequired = false/' service/java/com/android/server/wifi/WifiServiceImpl.java;
|
||||
awk -i inplace '!/mPermissionReviewRequired = Build.PERMISSIONS_REVIEW_REQUIRED/' service/java/com/android/server/wifi/WifiServiceImpl.java;
|
||||
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;
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/ti/omap4";
|
||||
if enterAndClear "hardware/ti/omap4"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_hardware_ti_omap4/0001-tuna-camera.patch"; #fix camera on tuna
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/ti/wlan";
|
||||
if enterAndClear "hardware/ti/wlan"; then
|
||||
#krack fixes
|
||||
git apply "$DOS_PATCHES/android_hardware_ti_wlan/209209.patch"; #wl12xx: Update SR and MR firmwares versions
|
||||
git apply "$DOS_PATCHES/android_hardware_ti_wlan/209210.patch"; #wl12xx: Update SR PLT firmwares
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display";
|
||||
if enterAndClear "hardware/qcom/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8084.patch" --directory msm8084;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch" --directory msm8226;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch" --directory msm8960;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch" --directory msm8974;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch" --directory msm8994;
|
||||
#missing msm8909, msm8996, msm8998
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/apq8084";
|
||||
if enterAndClear "hardware/qcom/display-caf/apq8084"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-apq8084.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8916";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8916"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8952";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8952"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8952.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8960";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8960"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8974";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8974"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8994";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8994"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/gps";
|
||||
if enterAndClear "hardware/qcom/gps"; then
|
||||
git apply "$DOS_PATCHES/android_hardware_qcom_gps/0001-rollover.patch"; #fix week rollover
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/CMParts";
|
||||
if enterAndClear "packages/apps/CMParts"; then
|
||||
rm -rf src/org/cyanogenmod/cmparts/cmstats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of CMStats
|
||||
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
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/PackageInstaller";
|
||||
if enterAndClear "packages/apps/PackageInstaller"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_PackageInstaller/64d8b44.diff"; #Fix an issue with Permission Review
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Settings";
|
||||
if enterAndClear "packages/apps/Settings"; then
|
||||
git revert --no-edit 2ebe6058c546194a301c1fd22963d6be4adbf961; #don't hide oem unlock
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/201113.patch"; #wifi: Add world regulatory domain country code
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0001-Captive_Portal_Toggle.patch"; #Add option to disable captive portal checks (MSe)
|
||||
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length (GrapheneOS)
|
||||
sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service
|
||||
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
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/SetupWizard";
|
||||
if enterAndClear "packages/apps/SetupWizard"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove the rest of CMStats
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Updater";
|
||||
if enterAndClear "packages/apps/Updater"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0002-Tor_Support.patch"; #Add Tor support
|
||||
#TODO: Remove changelog
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/WallpaperPicker";
|
||||
if enterAndClear "packages/apps/WallpaperPicker"; then
|
||||
rm res/drawable-nodpi/{*.png,*.jpg} res/values-nodpi/wallpapers.xml; #Remove old ones
|
||||
cp -r "$DOS_WALLPAPERS"'Compressed/.' res/drawable-nodpi/; #Add ours
|
||||
cp -r "$DOS_WALLPAPERS""Thumbs/." res/drawable-nodpi/;
|
||||
@ -180,34 +204,41 @@ cp "$DOS_WALLPAPERS""wallpapers.xml" res/values-nodpi/wallpapers.xml;
|
||||
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
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/inputmethods/LatinIME";
|
||||
if enterAndClear "packages/inputmethods/LatinIME"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0002-Disable_Personalization.patch"; #Disable personalization dictionary by default (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/services/Telephony";
|
||||
if enterAndClear "packages/services/Telephony"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch";
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "system/bt";
|
||||
if enterAndClear "system/bt"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_bt/229574.patch"; #Increase maximum Bluetooth SBC codec bitrate for SBC HD
|
||||
patch -p1 < "$DOS_PATCHES/android_system_bt/229575.patch"; #Explicit SBC Dual Channel (SBC HD) support
|
||||
patch -p1 < "$DOS_PATCHES/android_system_bt/242134.patch"; #avrc_bld_get_attrs_rsp - fix attribute length position off by one
|
||||
fi;
|
||||
|
||||
enterAndClear "system/core";
|
||||
if enterAndClear "system/core"; then
|
||||
sed -i 's/!= 2048/< 2048/' libmincrypt/tools/DumpPublicKey.java; #Allow 4096-bit keys
|
||||
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
|
||||
git revert --no-edit 0217dddeb5c16903c13ff6c75213619b79ea622b d7aa1231b6a0631f506c0c23816f2cd81645b15f; #Always update recovery XXX: This doesn't seem to work
|
||||
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden.patch"; #Harden mounts with nodev/noexec/nosuid + misc sysctl changes (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/sepolicy";
|
||||
if enterAndClear "system/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/248600.patch"; #restrict access to timing information in /proc
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
|
||||
fi;
|
||||
|
||||
enterAndClear "system/vold";
|
||||
if enterAndClear "system/vold"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_vold/0001-AES256.patch"; #Add a variable for enabling AES-256 bit encryption
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/cm";
|
||||
if enterAndClear "vendor/cm"; then
|
||||
rm build/target/product/security/lineage.x509.pem;
|
||||
rm -rf overlay/common/vendor/cmsdk/packages; #Remove analytics
|
||||
rm -rf overlay/common/frameworks/base/core/res/res/drawable-*/default_wallpaper.png;
|
||||
@ -225,15 +256,18 @@ if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/CM_BUILDTYPE :=
|
||||
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
|
||||
cp -f "$DOS_PATCHES_COMMON/apns-conf.xml" prebuilt/common/etc/apns-conf.xml; #Update APN list
|
||||
sed -i 's/messaging/Silence/' config/telephony.mk; #Switch to Silence
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/cmsdk";
|
||||
if enterAndClear "vendor/cmsdk"; then
|
||||
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;
|
||||
sed -i 's/shouldUseOptimizations(weight)/true/' cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java; #Per app performance profiles fix
|
||||
fi;
|
||||
|
||||
enter "vendor/divested";
|
||||
if enter "vendor/divested"; then
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> packages.mk; fi;
|
||||
if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_BLOCKING_APP" >> packages.mk; fi;
|
||||
fi;
|
||||
#
|
||||
#END OF ROM CHANGES
|
||||
#
|
||||
@ -241,39 +275,46 @@ if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_
|
||||
#
|
||||
#START OF DEVICE CHANGES
|
||||
#
|
||||
enterAndClear "device/amazon/hdx-common";
|
||||
if enterAndClear "device/amazon/hdx-common"; then
|
||||
sed -i 's/,encryptable=footer//' rootdir/etc/fstab.qcom; #Using footer will break the bootloader, it might work with /misc enabled
|
||||
#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
|
||||
fi;
|
||||
|
||||
enterAndClear "device/asus/grouper";
|
||||
if enterAndClear "device/asus/grouper"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_asus_grouper/0001-Update_Blobs.patch";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_asus_grouper/0002-Perf_Tweaks.patch";
|
||||
rm proprietary-blobs.txt;
|
||||
cp "$DOS_PATCHES/android_device_asus_grouper/lineage-proprietary-files.txt" lineage-proprietary-files.txt;
|
||||
echo "allow gpsd system_data_file:dir write;" >> sepolicy/gpsd.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/g4-common";
|
||||
if enterAndClear "device/lge/g4-common"; then
|
||||
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/motorola/clark";
|
||||
if enterAndClear "device/motorola/clark"; then
|
||||
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
|
||||
fi;
|
||||
|
||||
enterAndClear "device/samsung/exynos5420-common";
|
||||
if enterAndClear "device/samsung/exynos5420-common"; then
|
||||
awk -i inplace '!/shell su/' sepolicy/shell.te; #neverallow
|
||||
fi;
|
||||
|
||||
enterAndClear "device/samsung/manta";
|
||||
if enterAndClear "device/samsung/manta"; then
|
||||
#git revert --no-edit e55bbff1c8aa50e25ffe39c8936ea3dc92a4a575; #restore releasetools #TODO
|
||||
echo "allow audioserver sensorservice_service:service_manager find;" >> sepolicy/audioserver.te;
|
||||
echo "allow mediacodec audio_device:chr_file getattr;" >> sepolicy/mediacodec.te;
|
||||
echo "allow mediacodec camera_device:chr_file getattr;" >> sepolicy/mediacodec.te;
|
||||
echo "allow mediacodec sysfs:file read;" >> sepolicy/mediacodec.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/samsung/toroplus";
|
||||
if enterAndClear "device/samsung/toroplus"; then
|
||||
awk -i inplace '!/additional_system_update/' overlay/packages/apps/Settings/res/values*/*.xml;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/samsung/tuna";
|
||||
if enterAndClear "device/samsung/tuna"; then
|
||||
#git revert --no-edit e53eea6426da49dfb542929d5aa686667f4d416f; #restore releasetools #TODO
|
||||
rm setup-makefiles.sh; #broken, deblobber will still function
|
||||
sed -i 's|vendor/maguro/|vendor/|' libgps-shim/gps.c; #fix dlopen not found
|
||||
@ -284,9 +325,11 @@ patch -p1 < "$DOS_PATCHES/android_device_samsung_tuna/0003-fix_denial.patch";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_samsung_tuna/0004-fix_denial.patch";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_samsung_tuna/0005-fix_denial.patch";
|
||||
echo "allow system_server system_file:file execmod;" >> sepolicy/system_server.te; #fix gps load
|
||||
fi;
|
||||
|
||||
enter "vendor/google";
|
||||
if enter "vendor/google"; then
|
||||
echo "" > atv/atv-common.mk;
|
||||
fi;
|
||||
|
||||
#Make changes to all devices
|
||||
cd "$DOS_BUILD_BASE";
|
||||
|
@ -20,43 +20,51 @@
|
||||
|
||||
echo "Rebranding...";
|
||||
|
||||
enter "bootable/recovery";
|
||||
if enter "bootable/recovery"; then
|
||||
sed -i 's|Android Recovery|'"$DOS_BRANDING_NAME"' Recovery|' ./*ui.cpp;
|
||||
fi;
|
||||
|
||||
enter "build";
|
||||
if enter "build"; then
|
||||
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/'"$DOS_BRANDING_ZIP_PREFIX"'/' core/Makefile;
|
||||
fi;
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
||||
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/CMParts";
|
||||
if enter "packages/apps/CMParts"; then
|
||||
sed -i '/.*egg_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*cmparts_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*privacy_settings_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i '/.*cmlicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
sed -i '/.*cmupdate_settings_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
sed -i '/.*mod_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/SetupWizard";
|
||||
if enter "packages/apps/SetupWizard"; then
|
||||
sed -i 's|http://lineageos.org/legal|'"$DOS_BRANDING_LINK_PRIVACY"'|' src/com/cyanogenmod/setupwizard/LineageSettingsActivity.java;
|
||||
sed -i '/.*os_name/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
sed -i '/.*setup_services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i 's|0OTA_SERVER_CLEARNET0|'"$DOS_BRANDING_SERVER_OTA"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|0OTA_SERVER_ONION0|'"$DOS_BRANDING_SERVER_OTA_ONION"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|>LineageOS|>'"$DOS_BRANDING_NAME"'|' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "vendor/cm";
|
||||
if enter "vendor/cm"; then
|
||||
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' config/common.mk;
|
||||
sed -i '/.*ZIPPATH=/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/envsetup.sh;
|
||||
rm -rf bootanimation;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Rebranding complete!";
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
echo "Applying theme...";
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
sed -i "s/#ffe0f2f1/#ff$DOS_THEME_50/" core/res/res/values/colors_material.xml;
|
||||
sed -i "s/#ffb2dfdb/#ff$DOS_THEME_100/" core/res/res/values/colors_material.xml;
|
||||
sed -i "s/#ff80cbc4/#ff$DOS_THEME_200/" core/res/res/values/colors_material.xml;
|
||||
@ -28,24 +28,29 @@ sed -i "s/#ff4db6ac/#ff$DOS_THEME_300/" core/res/res/values/colors_material.xml;
|
||||
sed -i "s/#ff009688/#ff$DOS_THEME_500/" core/res/res/values/colors_material.xml;
|
||||
sed -i "s/#ff00796b/#ff$DOS_THEME_700/" core/res/res/values/colors_material.xml;
|
||||
sed -i "s/#fff4511e/#ffe53935/" core/res/res/values/colors.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/CMParts";
|
||||
if enter "packages/apps/CMParts"; then
|
||||
sed -i "s/#ff009688/#ff$DOS_THEME_500/" res/values/colors.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i "s/#ff009688/#ff$DOS_THEME_500/" res/values/styles.xml;
|
||||
#TODO: Fix: Storage, Profiles
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Trebuchet";
|
||||
if enter "packages/apps/Trebuchet"; then
|
||||
sed -i "s/009688/$DOS_THEME_500/" res/values/*colors.xml;
|
||||
sed -i "s/009688/$DOS_THEME_500/" WallpaperPicker/res/values/colors.xml;
|
||||
mogrify -format png -fill "#$DOS_THEME_500" -opaque "#009688" -fuzz 10% res/drawable*/cling_bg.9.png;
|
||||
#TODO: Fix: Open app icon
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i "s/#ff009688/#ff$DOS_THEME_500/" res/values/colors.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/inputmethods/LatinIME";
|
||||
if enter "packages/inputmethods/LatinIME"; then
|
||||
sed -i "s/#80CBC4/#$DOS_THEME_200/" java/res/values/colors.xml;
|
||||
sed -i "s/#4DB6AC/#$DOS_THEME_300/" java/res/values/colors.xml;
|
||||
mogrify -format png -fill "#$DOS_THEME_100" -opaque "#b2dfdb" -fuzz 10% java/res/drawable*/*lxx*.png;
|
||||
@ -53,6 +58,7 @@ mogrify -format png -fill "#$DOS_THEME_200" -opaque "#80cbc4" -fuzz 10% java/res
|
||||
mogrify -format png -fill "#$DOS_THEME_300" -opaque "#4db6ac" -fuzz 10% java/res/drawable*/*lxx*.png;
|
||||
mogrify -format png -fill "#$DOS_THEME_300" -opaque "#7fcac3" -fuzz 10% java/res/drawable*/*lxx*.png;
|
||||
mogrify -format png -fill "#$DOS_THEME_500" -opaque "#26a69a" -fuzz 10% java/res/drawable*/*lxx*.png;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Applied theme!";
|
||||
|
@ -24,25 +24,30 @@
|
||||
|
||||
echo "Changing default settings...";
|
||||
|
||||
enter "packages/apps/Dialer";
|
||||
if enter "packages/apps/Dialer"; then
|
||||
sed -i 's/ENABLE_FORWARD_LOOKUP, 1)/ENABLE_FORWARD_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable FLP
|
||||
sed -i 's/ENABLE_PEOPLE_LOOKUP, 1)/ENABLE_PEOPLE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable PLP
|
||||
sed -i 's/ENABLE_REVERSE_LOOKUP, 1)/ENABLE_REVERSE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable RLP
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Nfc";
|
||||
if enter "packages/apps/Nfc"; then
|
||||
sed -i 's/boolean NFC_ON_DEFAULT = true;/boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
|
||||
sed -i 's/boolean NDEF_PUSH_ON_DEFAULT = true;/boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i 's/INSTANT_APPS_ENABLED, 1/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
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Trebuchet";
|
||||
if enter "packages/apps/Trebuchet"; then
|
||||
sed -i 's/"pref_predictive_apps", true/"pref_predictive_apps", false/' src/com/android/launcher3/Launcher.java;
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's/ro.config.notification_sound=Argon.ogg/ro.config.notification_sound=Pong.ogg/' config/common.mk;
|
||||
sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.ogg/' config/common.mk;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Default settings changed!";
|
||||
|
@ -51,38 +51,45 @@ gpgVerifyDirectory "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/packa
|
||||
cp -r "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BASE""vendor/fdroid_prebuilt/"; #Add the prebuilt apps
|
||||
cp -r "$DOS_PATCHES_COMMON""android_vendor_divested/." "$DOS_BUILD_BASE""vendor/divested/"; #Add our vendor files
|
||||
|
||||
enterAndClear "bootable/recovery";
|
||||
if enterAndClear "bootable/recovery"; then
|
||||
git revert --no-edit eb98fde70a6e54a25408eb8c626caecf7841c5df; #remove sideload cache, breaks with large files
|
||||
git revert --no-edit ac258a4f4c4b4b91640cc477ad1ac125f206db02; #Resurrect dm-verity
|
||||
sed -i 's/!= 2048/< 2048/' tools/dumpkey/DumpPublicKey.java; #Allow 4096-bit keys
|
||||
sed -i 's/(!has_serial_number || serial_number_matched)/!has_serial_number/' recovery.cpp; #Abort on serial number specific packages (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "build/make";
|
||||
if enterAndClear "build/make"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0001-OTA_Keys.patch"; #add correct keys to recovery for OTA verification
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0002-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
sed -i '57i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aapt2.mk;
|
||||
sed -i 's/messaging/Silence/' target/product/aosp_base_telephony.mk target/product/treble_common.mk; #Switch to Silence
|
||||
fi;
|
||||
|
||||
enterAndClear "build/soong";
|
||||
if enterAndClear "build/soong"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lineage/sepolicy";
|
||||
if enterAndClear "device/lineage/sepolicy"; then
|
||||
git revert --no-edit 9c28a0dfb91bb468515e123b1aaf3fcfc007b82f; #neverallow violation - breaks backuptool
|
||||
git revert --no-edit f1ad32105599a0b71702f840b2deeb6849f1ae80; #neverallow violation - breaks addons
|
||||
git revert --no-edit c9b0d95630b82cd0ad1a0fc633c6d59c2cb8aad7 37422f7df389f3ae5a34ee3d6dd9354217f9c536; #neverallow violation - breaks update_engine
|
||||
|
||||
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
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
enterAndClear "external/chromium-webview";
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
|
||||
enterAndClear "external/svox";
|
||||
git revert --no-edit 1419d63b4889a26d22443fd8df1f9073bf229d3d; #Add back Makefiles
|
||||
if enterAndClear "device/qcom/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/base";
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
if enterAndClear "external/chromium-webview"; then
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if enterAndClear "external/svox"; then
|
||||
git revert --no-edit 1419d63b4889a26d22443fd8df1f9073bf229d3d; #Add back Makefiles
|
||||
fi;
|
||||
|
||||
if enterAndClear "frameworks/base"; then
|
||||
hardenLocationFWB "$DOS_BUILD_BASE";
|
||||
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
sed -i 's/DEFAULT_MAX_FILES_LOWRAM = 300;/DEFAULT_MAX_FILES_LOWRAM = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
@ -101,106 +108,130 @@ patch -p1 < "$DOS_PATCHES_COMMON/android_frameworks_base/0004-Fingerprint_Lockou
|
||||
if [ "$DOS_MICROG_INCLUDED" != "FULL" ]; then rm -rf packages/CompanionDeviceManager; fi; #Used to support Android Wear (which hard depends on GMS)
|
||||
rm -rf packages/Osu packages/Osu2; #Automatic Wi-Fi connection non-sense
|
||||
rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps
|
||||
fi;
|
||||
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
|
||||
enterAndClear "frameworks/opt/net/ims";
|
||||
if enterAndClear "frameworks/opt/net/ims"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling when IMS is removed
|
||||
fi
|
||||
fi;
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/opt/net/wifi";
|
||||
if enterAndClear "frameworks/opt/net/wifi"; then
|
||||
#Fix an issue when permision review is enabled that prevents using the Wi-Fi quick tile (AndroidHardening)
|
||||
#See https://github.com/AndroidHardening/platform_frameworks_opt_net_wifi/commit/c2a2f077a902226093b25c563e0117e923c7495b
|
||||
sed -i 's/boolean mPermissionReviewRequired/boolean mPermissionReviewRequired = false/' service/java/com/android/server/wifi/WifiServiceImpl.java;
|
||||
awk -i inplace '!/mPermissionReviewRequired = Build.PERMISSIONS_REVIEW_REQUIRED/' service/java/com/android/server/wifi/WifiServiceImpl.java;
|
||||
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;
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display";
|
||||
if enterAndClear "hardware/qcom/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8084.patch" --directory msm8084;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch" --directory msm8226;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch" --directory msm8960;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch" --directory msm8974;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch" --directory msm8994;
|
||||
#TODO: missing msm8909, msm8996, msm8998, sdm845
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/apq8084";
|
||||
if enterAndClear "hardware/qcom/display-caf/apq8084"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-apq8084.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8916";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8916"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8952";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8952"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8952.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8960";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8960"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8974";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8974"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8994";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8994"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/gps";
|
||||
if enterAndClear "hardware/qcom/gps"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_gps/0001-rollover.patch"; #fix week rollover
|
||||
fi;
|
||||
|
||||
enterAndClear "lineage-sdk";
|
||||
if enterAndClear "lineage-sdk"; then
|
||||
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;
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Contacts";
|
||||
if enterAndClear "packages/apps/Contacts"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/LineageParts";
|
||||
if enterAndClear "packages/apps/LineageParts"; then
|
||||
rm -rf src/org/lineageos/lineageparts/lineagestats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of the analytics
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Settings";
|
||||
if enterAndClear "packages/apps/Settings"; then
|
||||
git revert --no-edit a96df110e84123fe1273bff54feca3b4ca484dcd; #don't hide oem unlock
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0001-Captive_Portal_Toggle.patch"; #Add option to disable captive portal checks (MSe)
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Settings/0004-PDB_Fixes.patch"; #Fix crashes when the PersistentDataBlockManager service isn't available XXX: This might be broken!
|
||||
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/password/ChooseLockPassword.java; #Increase max password length (GrapheneOS)
|
||||
sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service
|
||||
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
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/SetupWizard";
|
||||
if enterAndClear "packages/apps/SetupWizard"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Updater";
|
||||
if enterAndClear "packages/apps/Updater"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0002-Tor_Support.patch"; #Add Tor support
|
||||
#TODO: Remove changelog
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/WallpaperPicker";
|
||||
if enterAndClear "packages/apps/WallpaperPicker"; then
|
||||
#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
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/inputmethods/LatinIME";
|
||||
if enterAndClear "packages/inputmethods/LatinIME"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0002-Disable_Personalization.patch"; #Disable personalization dictionary by default (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/providers/MediaProvider";
|
||||
if enterAndClear "packages/providers/MediaProvider"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_providers_MediaProvider/0001-External_Permission.patch"; #Fix permission denial
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/services/Telephony";
|
||||
if enterAndClear "packages/services/Telephony"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch";
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "system/core";
|
||||
if enterAndClear "system/core"; then
|
||||
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
|
||||
git revert --no-edit a6a4ce8e9a6d63014047a447c6bb3ac1fa90b3f4; #Always update recovery
|
||||
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden.patch"; #Harden mounts with nodev/noexec/nosuid + misc sysctl changes (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/sepolicy";
|
||||
if enterAndClear "system/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/26.0";
|
||||
fi;
|
||||
|
||||
enterAndClear "system/vold";
|
||||
if enterAndClear "system/vold"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_vold/0001-AES256.patch"; #Add a variable for enabling AES-256 bit encryption
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/lineage";
|
||||
if enterAndClear "vendor/lineage"; then
|
||||
rm build/target/product/security/lineage.x509.pem;
|
||||
rm -rf overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml; #Remove analytics
|
||||
rm -rf verity_tool; #Resurrect dm-verity
|
||||
@ -217,10 +248,12 @@ if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYP
|
||||
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
|
||||
cp -f "$DOS_PATCHES_COMMON/apns-conf.xml" prebuilt/common/etc/apns-conf.xml; #Update APN list
|
||||
sed -i 's/messaging/Silence/' config/telephony.mk; #Switch to Silence
|
||||
fi;
|
||||
|
||||
enter "vendor/divested";
|
||||
if enter "vendor/divested"; then
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> packages.mk; fi;
|
||||
if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_BLOCKING_APP" >> packages.mk; fi;
|
||||
fi;
|
||||
#
|
||||
#END OF ROM CHANGES
|
||||
#
|
||||
@ -228,21 +261,26 @@ if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_
|
||||
#
|
||||
#START OF DEVICE CHANGES
|
||||
#
|
||||
enterAndClear "device/asus/flo";
|
||||
if enterAndClear "device/asus/flo"; then
|
||||
compressRamdisks;
|
||||
echo "/dev/block/platform/msm_sdcc\.1/by-name/misc u:object_r:misc_block_device:s0" >> sepolicy/file_contexts;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/asus/msm8916-common";
|
||||
if enterAndClear "device/asus/msm8916-common"; then
|
||||
rm -rf Android.bp sensors; #exact duplicate in asus/flo #XXX be careful with this
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/msm8996-common";
|
||||
if enterAndClear "device/lge/msm8996-common"; then
|
||||
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oneplus/oneplus2";
|
||||
if enterAndClear "device/oneplus/oneplus2"; then
|
||||
sed -i 's|etc/permissions/qti_libpermissions.xml|vendor/etc/permissions/qti_libpermissions.xml|' proprietary-files.txt; #Fix outdated path
|
||||
fi;
|
||||
|
||||
#enterAndClear "device/moto/shamu";
|
||||
#if enterAndClear "device/moto/shamu"; then
|
||||
#git revert --no-edit 05fb49518049440f90423341ff25d4f75f10bc0c; #restore releasetools #TODO
|
||||
#fi;
|
||||
|
||||
#Make changes to all devices
|
||||
cd "$DOS_BUILD_BASE";
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
echo "Rebranding...";
|
||||
|
||||
enter "bootable/recovery";
|
||||
if enter "bootable/recovery"; then
|
||||
git revert --no-edit bc57208dfcd0958d03a00bbcf5345be6ceac9988 6ac3bb48f9d10e604d4b2d6c4152be9d35d17ea0;
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_bootable_recovery/0001-Remove_Logo.patch"; #Remove logo rendering code
|
||||
rm res*/images/logo_image.png; #Remove logo images
|
||||
@ -29,45 +29,54 @@ sed -i 's|grid_h \* 2 / 3|grid_h * 0.25|' screen_ui.cpp; #Center icons
|
||||
sed -i 's|0x16, 0x7c, 0x80|0x03, 0xa9, 0xf4|' screen_ui.cpp; #Recolor text
|
||||
sed -i 's|Android Recovery|'"$DOS_BRANDING_NAME"' Recovery|' ./*ui.cpp;
|
||||
sed -i 's|LineageOS|'"$DOS_BRANDING_NAME"'|' ui.cpp;
|
||||
fi;
|
||||
|
||||
enter "build/make";
|
||||
if enter "build/make"; then
|
||||
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
|
||||
fi;
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
||||
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
||||
fi;
|
||||
|
||||
enter "lineage-sdk";
|
||||
if enter "lineage-sdk"; then
|
||||
sed -i '/.*lineage_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineage_updates/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineageos_system_label/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/LineageParts";
|
||||
if enter "packages/apps/LineageParts"; then
|
||||
sed -i '/.*egg_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*lineageparts_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*privacy_settings_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i '/.*lineagelicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/SetupWizard";
|
||||
if enter "packages/apps/SetupWizard"; then
|
||||
sed -i 's|http://lineageos.org/legal|'"$DOS_BRANDING_LINK_PRIVACY"'|' src/org/lineageos/setupwizard/LineageSettingsActivity.java;
|
||||
sed -i '/.*os_name/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
sed -i '/.*setup_services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i 's|0OTA_SERVER_CLEARNET0|'"$DOS_BRANDING_SERVER_OTA"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|0OTA_SERVER_ONION0|'"$DOS_BRANDING_SERVER_OTA_ONION"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|>LineageOS|>'"$DOS_BRANDING_NAME"'|' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' build/core/main_version.mk
|
||||
sed -i '/.*ZIPPATH=/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/envsetup.sh;
|
||||
sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/tasks/bacon.mk;
|
||||
rm -rf bootanimation;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Rebranding complete!";
|
||||
|
@ -24,22 +24,26 @@
|
||||
|
||||
echo "Changing default settings...";
|
||||
|
||||
enter "packages/apps/Dialer";
|
||||
if enter "packages/apps/Dialer"; then
|
||||
sed -i 's/ENABLE_FORWARD_LOOKUP, 1)/ENABLE_FORWARD_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable FLP
|
||||
sed -i 's/ENABLE_PEOPLE_LOOKUP, 1)/ENABLE_PEOPLE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable PLP
|
||||
sed -i 's/ENABLE_REVERSE_LOOKUP, 1)/ENABLE_REVERSE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable RLP
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Nfc";
|
||||
if enter "packages/apps/Nfc"; then
|
||||
sed -i 's/boolean NFC_ON_DEFAULT = true;/boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
|
||||
sed -i 's/boolean NDEF_PUSH_ON_DEFAULT = true;/boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i 's/INSTANT_APPS_ENABLED, 1/INSTANT_APPS_ENABLED, 0/' src/com/android/settings/applications/ManageDomainUrls.java; #Disable "Instant Apps"
|
||||
sed -i 's/DEFAULT_VALUE = 1;/DEFAULT_VALUE = 0.5f;/' src/com/android/settings/development/*ScalePreferenceController.java; #Always reset animation scales to 0.5
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's/ro.config.notification_sound=Argon.ogg/ro.config.notification_sound=Pong.ogg/' config/common*.mk;
|
||||
sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.ogg/' config/common*.mk;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Default settings changed!";
|
||||
|
@ -51,47 +51,55 @@ gpgVerifyDirectory "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/packa
|
||||
cp -r "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BASE""vendor/fdroid_prebuilt/"; #Add the prebuilt apps
|
||||
cp -r "$DOS_PATCHES_COMMON""android_vendor_divested/." "$DOS_BUILD_BASE""vendor/divested/"; #Add our vendor files
|
||||
|
||||
enterAndClear "bionic";
|
||||
if enterAndClear "bionic"; then
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES/android_bionic/0001-HM-Use_HM.patch"; fi; #(GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "bootable/recovery";
|
||||
if enterAndClear "bootable/recovery"; then
|
||||
git revert --no-edit 4d361ff13b5bd61d5a6a5e95063b24b8a37a24ab; #Always enforcing
|
||||
git revert --no-edit 3f55a863ac34969f95bfb38641747d2fd9939630 865c6c770816f6e8099d6d93e04aeea35091a9d6; #Remove sideload cache, breaks with large files
|
||||
git revert --no-edit 37d729bf; #Fix USB on most devices
|
||||
git revert --no-edit fe2901b144c515c5a90b547198aed37c209b5a82; #Resurrect dm-verity
|
||||
sed -i 's/!= 2048/< 2048/' tools/dumpkey/DumpPublicKey.java; #Allow 4096-bit keys
|
||||
patch -p1 < "$DOS_PATCHES/android_bootable_recovery/0001-No_SerialNum_Restrictions.patch"; #Abort on serial number specific packages (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "build/make";
|
||||
if enterAndClear "build/make"; then
|
||||
git revert --no-edit 271f6ffa045064abcac066e97f2cb53ccb3e5126 61f7ee9386be426fd4eadc2c8759362edb5bef8; #Add back PicoTTS and language files
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0001-OTA_Keys.patch"; #add correct keys to recovery for OTA verification
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0002-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
sed -i '74i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aapt2.mk;
|
||||
sed -i 's/messaging/Silence/' target/product/aosp_base_telephony.mk target/product/treble_common.mk; #Switch to Silence
|
||||
sed -i 's/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 17/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 28/' core/version_defaults.mk; #Bump minimum SDK version (GrapheneOS)
|
||||
|
||||
enterAndClear "build/soong";
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
|
||||
enterAndClear "device/qcom/sepolicy-legacy";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy-legacy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> sepolicy.mk; #necessary for -user builds of legacy devices
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
enterAndClear "external/chromium-webview";
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
|
||||
enterAndClear "external/svox";
|
||||
if enterAndClear "build/soong"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
fi;
|
||||
|
||||
if enterAndClear "device/qcom/sepolicy-legacy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy-legacy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> sepolicy.mk; #necessary for -user builds of legacy devices
|
||||
fi;
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
if enterAndClear "external/chromium-webview"; then
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if enterAndClear "external/svox"; then
|
||||
git revert --no-edit 1419d63b4889a26d22443fd8df1f9073bf229d3d; #Add back Makefiles
|
||||
sed -i '12iLOCAL_SDK_VERSION := current' pico/Android.mk; #Fix build under Pie
|
||||
sed -i 's/about to delete/unable to delete/' pico/src/com/svox/pico/LangPackUninstaller.java;
|
||||
awk -i inplace '!/deletePackage/' pico/src/com/svox/pico/LangPackUninstaller.java;
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/av";
|
||||
if enterAndClear "frameworks/av"; then
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES_COMMON/android_frameworks_av/0001-HM-No_RLIMIT_AS.patch"; fi; #(GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/base";
|
||||
if enterAndClear "frameworks/base"; then
|
||||
hardenLocationFWB "$DOS_BUILD_BASE";
|
||||
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
sed -i 's/DEFAULT_MAX_FILES_LOWRAM = 300;/DEFAULT_MAX_FILES_LOWRAM = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
@ -113,105 +121,130 @@ patch -p1 < "$DOS_PATCHES_COMMON/android_frameworks_base/0004-Fingerprint_Lockou
|
||||
sed -i '301i\ if(packageList != null && packageList.length() > 0) { packageList += ","; } packageList += "net.sourceforge.opencamera";' core/java/android/hardware/Camera.java; #add Open Camera to aux camera allowlist
|
||||
if [ "$DOS_MICROG_INCLUDED" != "FULL" ]; then rm -rf packages/CompanionDeviceManager; fi; #Used to support Android Wear (which hard depends on GMS)
|
||||
rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps
|
||||
fi;
|
||||
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
|
||||
enterAndClear "frameworks/opt/net/ims";
|
||||
if enterAndClear "frameworks/opt/net/ims"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling when IMS is removed
|
||||
fi
|
||||
fi;
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display";
|
||||
if enterAndClear "hardware/qcom/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8084.patch" --directory msm8084;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch" --directory msm8226;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch" --directory msm8960;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch" --directory msm8974;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch" --directory msm8994;
|
||||
#TODO: missing msm8909, msm8996, msm8998, sdm845, sdm8150
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/apq8084";
|
||||
if enterAndClear "hardware/qcom/display-caf/apq8084"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-apq8084.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8916";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8916"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8952";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8952"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8952.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8960";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8960"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8974";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8974"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8994";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8994"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8996";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8996"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8996.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display-caf/msm8998";
|
||||
if enterAndClear "hardware/qcom/display-caf/msm8998"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8998.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "lineage-sdk";
|
||||
if enterAndClear "lineage-sdk"; then
|
||||
awk -i inplace '!/LineageWeatherManagerService/' 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;
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Backgrounds";
|
||||
if enterAndClear "packages/apps/Backgrounds"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Backgrounds/308977.patch"; #Optimize builtin wallpaper loading code
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Contacts";
|
||||
if enterAndClear "packages/apps/Contacts"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Dialer";
|
||||
if enterAndClear "packages/apps/Dialer"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Dialer/0001-Not_Private_Banner.patch"; #Add a privacy warning banner to calls (CalyxOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/LineageParts";
|
||||
if enterAndClear "packages/apps/LineageParts"; then
|
||||
rm -rf src/org/lineageos/lineageparts/lineagestats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of the analytics
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Settings";
|
||||
if enterAndClear "packages/apps/Settings"; then
|
||||
git revert --no-edit c240992b4c86c7f226290807a2f41f2619e7e5e8; #don't hide oem unlock
|
||||
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/password/ChooseLockPassword.java; #Increase max password length (GrapheneOS)
|
||||
sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service
|
||||
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
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/SetupWizard";
|
||||
if enterAndClear "packages/apps/SetupWizard"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Trebuchet";
|
||||
if enterAndClear "packages/apps/Trebuchet"; then
|
||||
cp $DOS_BUILD_BASE/vendor/divested/overlay/common/packages/apps/Trebuchet/res/xml/default_workspace_*.xml res/xml/; #XXX: Likely no longer needed
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Updater";
|
||||
if enterAndClear "packages/apps/Updater"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0002-Tor_Support.patch"; #Add Tor support
|
||||
sed -i 's/PROP_BUILD_VERSION_INCREMENTAL);/PROP_BUILD_VERSION_INCREMENTAL).replaceAll("\\\\.", "");/' src/org/lineageos/updater/misc/Utils.java; #Remove periods from incremental version
|
||||
#TODO: Remove changelog
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/inputmethods/LatinIME";
|
||||
if enterAndClear "packages/inputmethods/LatinIME"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0002-Disable_Personalization.patch"; #Disable personalization dictionary by default (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/services/Telephony";
|
||||
if enterAndClear "packages/services/Telephony"; then
|
||||
git revert --no-edit 99564aaf0417c9ddf7d6aeb10d326e5b24fa8f55;
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch";
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "system/core";
|
||||
if enterAndClear "system/core"; then
|
||||
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
|
||||
git revert --no-edit b3609d82999d23634c5e6db706a3ecbc5348309a; #Always update recovery
|
||||
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden.patch"; #Harden mounts with nodev/noexec/nosuid + misc sysctl changes (GrapheneOS)
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES_COMMON/android_system_core/0001-HM-Increase_vm_mmc.patch"; fi; #(GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/extras";
|
||||
if enterAndClear "system/extras"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_extras/0001-ext4_pad_filenames.patch"; #FBE: pad filenames more (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/sepolicy";
|
||||
if enterAndClear "system/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/28.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/27.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/26.0";
|
||||
awk -i inplace '!/true cannot be used in user builds/' Android.mk; #Allow ignoring neverallows under -user
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/lineage";
|
||||
if enterAndClear "vendor/lineage"; then
|
||||
rm build/target/product/security/lineage.x509.pem;
|
||||
rm -rf overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml; #Remove analytics
|
||||
rm -rf verity_tool; #Resurrect dm-verity
|
||||
@ -229,11 +262,13 @@ if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYP
|
||||
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
|
||||
cp -f "$DOS_PATCHES_COMMON/apns-conf.xml" prebuilt/common/etc/apns-conf.xml; #Update APN list
|
||||
sed -i 's/messaging/Silence/' config/telephony.mk; #Switch to Silence
|
||||
fi;
|
||||
|
||||
enter "vendor/divested";
|
||||
if enter "vendor/divested"; then
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> packages.mk; fi;
|
||||
if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_BLOCKING_APP" >> packages.mk; fi;
|
||||
echo "PRODUCT_PACKAGES += vendor.lineage.trust@1.0-service" >> packages.mk; #All of our kernels have deny USB patch added
|
||||
fi;
|
||||
#
|
||||
#END OF ROM CHANGES
|
||||
#
|
||||
@ -241,12 +276,14 @@ echo "PRODUCT_PACKAGES += vendor.lineage.trust@1.0-service" >> packages.mk; #All
|
||||
#
|
||||
#START OF DEVICE CHANGES
|
||||
#
|
||||
enterAndClear "device/asus/zenfone3";
|
||||
if enterAndClear "device/asus/zenfone3"; then
|
||||
rm -rf libhidl; #breaks other devices
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/hammerhead";
|
||||
if enterAndClear "device/lge/hammerhead"; then
|
||||
git am $DOS_PATCHES/android_device_lge_hammerhead/*.patch; #hh-p-sepolicy
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> BoardConfig.mk; #qcom-legacy sepolicy
|
||||
fi;
|
||||
|
||||
#Make changes to all devices
|
||||
cd "$DOS_BUILD_BASE";
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
echo "Rebranding...";
|
||||
|
||||
enter "bootable/recovery";
|
||||
if enter "bootable/recovery"; then
|
||||
git revert --no-edit c9ab109b6b6c502238ec88badc1fbed2644480f2 cb5b7cc0b04c445dbc189e28575bba50638433b5;
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_bootable_recovery/0001-Remove_Logo.patch"; #Remove logo rendering code
|
||||
rm res*/images/logo_image.png; #Remove logo images
|
||||
@ -29,45 +29,54 @@ sed -i 's|grid_h \* 2 / 3|grid_h * 0.25|' screen_ui.cpp; #Center icons
|
||||
sed -i 's|0x16, 0x7c, 0x80|0x03, 0xa9, 0xf4|' screen_ui.cpp; #Recolor text
|
||||
sed -i 's|Android Recovery|'"$DOS_BRANDING_NAME"' Recovery|' ./*ui.cpp;
|
||||
sed -i 's|LineageOS|'"$DOS_BRANDING_NAME"'|' ui.cpp;
|
||||
fi;
|
||||
|
||||
enter "build/make";
|
||||
if enter "build/make"; then
|
||||
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
|
||||
fi;
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
||||
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
||||
fi;
|
||||
|
||||
enter "lineage-sdk";
|
||||
if enter "lineage-sdk"; then
|
||||
sed -i '/.*lineage_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineage_updates/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineageos_system_label/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/LineageParts";
|
||||
if enter "packages/apps/LineageParts"; then
|
||||
sed -i '/.*egg_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*lineageparts_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*privacy_settings_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i '/.*lineagelicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/SetupWizard";
|
||||
if enter "packages/apps/SetupWizard"; then
|
||||
sed -i 's|http://lineageos.org/legal|'"$DOS_BRANDING_LINK_PRIVACY"'|' src/org/lineageos/setupwizard/LineageSettingsActivity.java;
|
||||
sed -i '/.*os_name/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
sed -i '/.*setup_services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i 's|0OTA_SERVER_CLEARNET0|'"$DOS_BRANDING_SERVER_OTA"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|0OTA_SERVER_ONION0|'"$DOS_BRANDING_SERVER_OTA_ONION"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|>LineageOS|>'"$DOS_BRANDING_NAME"'|' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' build/core/main_version.mk
|
||||
sed -i '/.*ZIPPATH=/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/envsetup.sh;
|
||||
sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/tasks/bacon.mk;
|
||||
rm -rf bootanimation;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Rebranding complete!";
|
||||
|
@ -24,22 +24,26 @@
|
||||
|
||||
echo "Changing default settings...";
|
||||
|
||||
enter "packages/apps/Dialer";
|
||||
if enter "packages/apps/Dialer"; then
|
||||
sed -i 's/ENABLE_FORWARD_LOOKUP, 1)/ENABLE_FORWARD_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable FLP
|
||||
sed -i 's/ENABLE_PEOPLE_LOOKUP, 1)/ENABLE_PEOPLE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable PLP
|
||||
sed -i 's/ENABLE_REVERSE_LOOKUP, 1)/ENABLE_REVERSE_LOOKUP, 0)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable RLP
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Nfc";
|
||||
if enter "packages/apps/Nfc"; then
|
||||
sed -i 's/boolean NFC_ON_DEFAULT = true;/boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
|
||||
sed -i 's/boolean NDEF_PUSH_ON_DEFAULT = true;/boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i 's/INSTANT_APPS_ENABLED, 1/INSTANT_APPS_ENABLED, 0/' src/com/android/settings/applications/managedomainurls/InstantAppWebActionPreferenceController.java; #Disable "Instant Apps"
|
||||
sed -i 's/DEFAULT_VALUE = 1;/DEFAULT_VALUE = 0.5f;/' src/com/android/settings/development/*ScalePreferenceController.java; #Always reset animation scales to 0.5
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's/ro.config.notification_sound=Argon.ogg/ro.config.notification_sound=Pong.ogg/' config/common*.mk;
|
||||
sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.ogg/' config/common*.mk;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Default settings changed!";
|
||||
|
@ -51,14 +51,16 @@ gpgVerifyDirectory "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/packa
|
||||
cp -r "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BASE""vendor/fdroid_prebuilt/"; #Add the prebuilt apps
|
||||
cp -r "$DOS_PATCHES_COMMON""android_vendor_divested/." "$DOS_BUILD_BASE""vendor/divested/"; #Add our vendor files
|
||||
|
||||
enterAndClear "bootable/recovery";
|
||||
if enterAndClear "bootable/recovery"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_bootable_recovery/0001-No_SerialNum_Restrictions.patch"; #Abort on serial number specific packages (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "bionic";
|
||||
if enterAndClear "bionic"; then
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES/android_bionic/0001-HM-Use_HM.patch"; fi; #(GrapheneOS)
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES/android_bionic/0002-Symbol_Ordering.patch"; fi; #(GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "build/make";
|
||||
if enterAndClear "build/make"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0001-Restore_TTS.patch"; #Add back PicoTTS and language files
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0002-OTA_Keys.patch"; #add correct keys to recovery for OTA verification
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0003-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
@ -66,29 +68,35 @@ sed -i '75i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aap
|
||||
sed -i 's/messaging/Silence/' target/product/aosp_base_telephony.mk target/product/gsi_common.mk; #Switch to Silence
|
||||
awk -i inplace '!/updatable_apex.mk/' target/product/mainline_system.mk; #Disable APEX
|
||||
sed -i 's/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 28/' core/version_defaults.mk; #Bump minimum SDK version (GrapheneOS)
|
||||
|
||||
enterAndClear "build/soong";
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
|
||||
enterAndClear "device/qcom/sepolicy-legacy";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy-legacy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> sepolicy.mk; #necessary for -user builds of legacy devices
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
enterAndClear "external/chromium-webview";
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
|
||||
enterAndClear "external/svox";
|
||||
if enterAndClear "build/soong"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
fi;
|
||||
|
||||
if enterAndClear "device/qcom/sepolicy-legacy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy-legacy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> sepolicy.mk; #necessary for -user builds of legacy devices
|
||||
fi;
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
if enterAndClear "external/chromium-webview"; then
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if enterAndClear "external/svox"; then
|
||||
git revert --no-edit 1419d63b4889a26d22443fd8df1f9073bf229d3d; #Add back Makefiles
|
||||
sed -i '12iLOCAL_SDK_VERSION := current' pico/Android.mk; #Fix build under Pie
|
||||
sed -i 's/about to delete/unable to delete/' pico/src/com/svox/pico/LangPackUninstaller.java;
|
||||
awk -i inplace '!/deletePackage/' pico/src/com/svox/pico/LangPackUninstaller.java;
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/av";
|
||||
if enterAndClear "frameworks/av"; then
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES/android_frameworks_av/0001-HM_A2DP_Fix.patch"; fi; #(GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/base";
|
||||
if enterAndClear "frameworks/base"; then
|
||||
hardenLocationConf services/core/java/com/android/server/location/gps_debug.conf;
|
||||
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
sed -i 's/DEFAULT_MAX_FILES_LOWRAM = 300;/DEFAULT_MAX_FILES_LOWRAM = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
@ -110,117 +118,145 @@ if [ "$DOS_MICROG_INCLUDED" != "FULL" ]; then rm -rf packages/CompanionDeviceMan
|
||||
#sed -i '295i\ if(packageList != null && packageList.size() > 0) { packageList.add("net.sourceforge.opencamera"); }' core/java/android/hardware/Camera.java; #add Open Camera to aux camera whitelist XXX: needs testing, broke boot last time
|
||||
rm -rf packages/OsuLogin; #Automatic Wi-Fi connection non-sense
|
||||
rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps
|
||||
fi;
|
||||
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
|
||||
enterAndClear "frameworks/opt/net/ims";
|
||||
if enterAndClear "frameworks/opt/net/ims"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling when IMS is removed
|
||||
fi
|
||||
fi;
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/opt/net/voip";
|
||||
if enterAndClear "frameworks/opt/net/voip"; then
|
||||
git pull "https://github.com/LineageOS/android_frameworks_opt_net_voip" refs/changes/91/313291/1; #Q_asb_2021-07
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display";
|
||||
if enterAndClear "hardware/qcom/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8084.patch" --directory msm8084;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch" --directory msm8226;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch" --directory msm8960;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch" --directory msm8974;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch" --directory msm8994;
|
||||
#TODO: missing msm8909, msm8996, msm8998, sdm845, sdm8150
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/apq8084/display";
|
||||
if enterAndClear "hardware/qcom-caf/apq8084/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-apq8084.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8952/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8952/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8952.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8960/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8960/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8974/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8974/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8994/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8994/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8996/audio";
|
||||
if enterAndClear "hardware/qcom-caf/msm8996/audio"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-8996.patch"; #audio_extn: Fix unused parameter warning in utils.c
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8998/audio";
|
||||
if enterAndClear "hardware/qcom-caf/msm8998/audio"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-8998.patch"; #audio_extn: Fix unused parameter warning in utils.c
|
||||
fi;
|
||||
|
||||
enterAndClear "libcore";
|
||||
if enterAndClear "libcore"; then
|
||||
if [ "$DOS_GRAPHENE_EXEC" = true ]; then patch -p1 < "$DOS_PATCHES/android_libcore/0001-Exec_Preload.patch"; fi; #add exec-based spawning support (GrapheneOS)
|
||||
if [ "$DOS_GRAPHENE_EXEC" = true ]; then patch -p1 < "$DOS_PATCHES/android_libcore/0002-Exec_Based_Spawning.patch"; fi; #add exec-based spawning support (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "lineage-sdk";
|
||||
if enterAndClear "lineage-sdk"; then
|
||||
awk -i inplace '!/LineageWeatherManagerService/' 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;
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Contacts";
|
||||
if enterAndClear "packages/apps/Contacts"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Backup.patch"; #Backups are not sent to Google (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Dialer";
|
||||
if enterAndClear "packages/apps/Dialer"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Dialer/0001-Not_Private_Banner.patch"; #Add a privacy warning banner to calls (CalyxOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/LineageParts";
|
||||
if enterAndClear "packages/apps/LineageParts"; then
|
||||
rm -rf src/org/lineageos/lineageparts/lineagestats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of the analytics
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Settings";
|
||||
if enterAndClear "packages/apps/Settings"; then
|
||||
git revert --no-edit 486980cfecce2ca64267f41462f9371486308e9d; #don't hide oem unlock
|
||||
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/password/ChooseLockPassword.java; #Increase max password length (GrapheneOS)
|
||||
sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/backup/PrivacySettingsUtils.java; fi; #microG doesn't support Backup, hide the options
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/SetupWizard";
|
||||
if enterAndClear "packages/apps/SetupWizard"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Trebuchet";
|
||||
if enterAndClear "packages/apps/Trebuchet"; then
|
||||
cp $DOS_BUILD_BASE/vendor/divested/overlay/common/packages/apps/Trebuchet/res/xml/default_workspace_*.xml res/xml/; #XXX: Likely no longer needed
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Updater";
|
||||
if enterAndClear "packages/apps/Updater"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0002-Tor_Support.patch"; #Add Tor support
|
||||
sed -i 's/PROP_BUILD_VERSION_INCREMENTAL);/PROP_BUILD_VERSION_INCREMENTAL).replaceAll("\\\\.", "");/' src/org/lineageos/updater/misc/Utils.java; #Remove periods from incremental version
|
||||
#TODO: Remove changelog
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/inputmethods/LatinIME";
|
||||
if enterAndClear "packages/inputmethods/LatinIME"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0002-Disable_Personalization.patch"; #Disable personalization dictionary by default (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/modules/NetworkStack";
|
||||
if enterAndClear "packages/modules/NetworkStack"; then
|
||||
git pull "https://github.com/LineageOS/android_packages_modules_NetworkStack" refs/changes/01/313301/1; #Q_asb_2021-07
|
||||
fi;
|
||||
|
||||
#enterAndClear "packages/services/Telephony";
|
||||
#if enterAndClear "packages/services/Telephony"; then
|
||||
#patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch"; #XXX 17REBASE
|
||||
#patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch"; #XXX 17REBASE
|
||||
#fi;
|
||||
|
||||
enterAndClear "system/core";
|
||||
if enterAndClear "system/core"; then
|
||||
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
|
||||
git revert --no-edit 3032c7aa5ce90c0ae9c08fe271052c6e0304a1e7 01266f589e6deaef30b782531ae14435cdd2f18e; #insanity
|
||||
git revert --no-edit bd4142eab8b3cead0c25a2e660b4b048d1315d3c; #Always update recovery
|
||||
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden.patch"; #Harden mounts with nodev/noexec/nosuid + misc sysctl changes (GrapheneOS)
|
||||
if [ "$DOS_GRAPHENE_MALLOC" = true ]; then patch -p1 < "$DOS_PATCHES/android_system_core/0002-HM-Increase_vm_mmc.patch"; fi; #(GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/extras";
|
||||
if enterAndClear "system/extras"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_extras/0001-ext4_pad_filenames.patch"; #FBE: pad filenames more (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/libfmq";
|
||||
if enterAndClear "system/libfmq"; then
|
||||
git pull "https://github.com/LineageOS/android_system_libfmq" refs/changes/03/313303/1; #Q_asb_2021-07
|
||||
fi;
|
||||
|
||||
enterAndClear "system/sepolicy";
|
||||
if enterAndClear "system/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/29.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/28.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/27.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/26.0";
|
||||
awk -i inplace '!/true cannot be used in user builds/' Android.mk; #Allow ignoring neverallows under -user
|
||||
fi;
|
||||
|
||||
enterAndClear "system/update_engine";
|
||||
if enterAndClear "system/update_engine"; then
|
||||
git revert --no-edit c68499e3ff10f2a31f913e14f66aafb4ed94d42d; #Do not skip payload signature verification
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/lineage";
|
||||
if enterAndClear "vendor/lineage"; then
|
||||
rm build/target/product/security/lineage.x509.pem;
|
||||
rm -rf overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml; #Remove analytics
|
||||
rm -rf overlay/common/frameworks/base/core/res/res/drawable-*/default_wallpaper.png;
|
||||
@ -236,12 +272,14 @@ if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYP
|
||||
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
|
||||
cp -f "$DOS_PATCHES_COMMON/apns-conf.xml" prebuilt/common/etc/apns-conf.xml; #Update APN list
|
||||
sed -i 's/messaging/Silence/' config/telephony.mk; #Switch to Silence
|
||||
fi;
|
||||
|
||||
enter "vendor/divested";
|
||||
if enter "vendor/divested"; then
|
||||
awk -i inplace '!/EtarPrebuilt/' packages.mk; #lineage-17.1 calendar is Etar fork
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> packages.mk; fi;
|
||||
if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_BLOCKING_APP" >> packages.mk; fi;
|
||||
echo "PRODUCT_PACKAGES += vendor.lineage.trust@1.0-service" >> packages.mk; #All of our kernels have deny USB patch added
|
||||
fi;
|
||||
#
|
||||
#END OF ROM CHANGES
|
||||
#
|
||||
@ -249,23 +287,28 @@ echo "PRODUCT_PACKAGES += vendor.lineage.trust@1.0-service" >> packages.mk; #All
|
||||
#
|
||||
#START OF DEVICE CHANGES
|
||||
#
|
||||
enterAndClear "device/cyanogen/msm8916-common";
|
||||
if enterAndClear "device/cyanogen/msm8916-common"; then
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #broken releasetools
|
||||
fi;
|
||||
|
||||
enterAndClear "device/fairphone/FP3";
|
||||
if enterAndClear "device/fairphone/FP3"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/google/bonito";
|
||||
if enterAndClear "device/google/bonito"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
awk -i inplace '!/INODE_COUNT/' BoardConfig-lineage.mk; #mke2fs -1 incompatibility (?)
|
||||
fi;
|
||||
|
||||
enterAndClear "device/google/marlin";
|
||||
if enterAndClear "device/google/marlin"; then
|
||||
git revert --no-edit 777dafa35f185b1f501e3c80b8ab495191583444; #remove some carrier blobs
|
||||
fi;
|
||||
|
||||
enterAndClear "device/htc/m8-common";
|
||||
if enterAndClear "device/htc/m8-common"; then
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #broken releasetools
|
||||
fi;
|
||||
|
||||
enterAndClear "device/motorola/clark";
|
||||
if enterAndClear "device/motorola/clark"; then
|
||||
echo "recovery_only('" >> sepolicy/recovery.te; #304224: Allow recovery to unzip and chmod modem firmware
|
||||
echo " allow firmware_file labeledfs:filesystem associate;" >> sepolicy/recovery.te;
|
||||
echo " allow recovery firmware_file:dir search;" >> sepolicy/recovery.te;
|
||||
@ -273,11 +316,13 @@ echo " allow recovery firmware_file:file { open write };" >> sepolicy/recovery.
|
||||
echo "')" >> sepolicy/recovery.te;
|
||||
#sed -i '2isetenforce 0' releasetools/extract_firmware.sh;
|
||||
#echo "setenforce 1" >> releasetools/extract_firmware.sh;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oneplus/avicii";
|
||||
if enterAndClear "device/oneplus/avicii"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oneplus/oneplus2";
|
||||
if enterAndClear "device/oneplus/oneplus2"; then
|
||||
sed -i 's|etc/permissions/qti_libpermissions.xml|vendor/etc/permissions/qti_libpermissions.xml|' proprietary-files.txt;
|
||||
echo "allow mm-qcamerad camera_data_file:file create_file_perms;" >> sepolicy/mm-qcamerad.te; #Likely some of these could be removed
|
||||
echo "allow mm-qcamerad node:tcp_socket node_bind;" >> sepolicy/mm-qcamerad.te;
|
||||
@ -286,18 +331,23 @@ echo "allow mm-qcamerad self:tcp_socket { accept listen };" >> sepolicy/mm-qcame
|
||||
echo "allow mm-qcamerad self:tcp_socket { bind create setopt };" >> sepolicy/mm-qcamerad.te;
|
||||
echo "allow mm-qcamerad camera_prop:file read;" >> sepolicy/mm-qcamerad.te;
|
||||
echo "set_prop(mm-qcamerad, camera_prop)" >> sepolicy/mm-qcamerad.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oneplus/sm8150-common";
|
||||
if enterAndClear "device/oneplus/sm8150-common"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oppo/common";
|
||||
if enterAndClear "device/oppo/common"; then
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #disable releasetools to fix delta ota generation
|
||||
fi;
|
||||
|
||||
enterAndClear "device/zuk/msm8996-common";
|
||||
if enterAndClear "device/zuk/msm8996-common"; then
|
||||
awk -i inplace '!/WfdCommon/' msm8996.mk; #fix breakage
|
||||
fi;
|
||||
|
||||
enterAndClear "kernel/google/marlin";
|
||||
if enterAndClear "kernel/google/marlin"; then
|
||||
git revert --no-edit dd4a454f080f60cc7c4f5cc281a48cba80947baf; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
#Make changes to all devices
|
||||
cd "$DOS_BUILD_BASE";
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
echo "Rebranding...";
|
||||
|
||||
enter "bootable/recovery";
|
||||
if enter "bootable/recovery"; then
|
||||
git revert --no-edit 7e46bc14; #use standard animation
|
||||
sed -i 's/if (lineage_logo_/if (false/' recovery_ui/*ui.cpp;
|
||||
awk -i inplace '!/DrawSurface\(logo.get\(\)/' recovery_ui/screen_ui.cpp; #Hide logo
|
||||
@ -35,46 +35,55 @@ sed -i 's|0x16, 0x7c, 0x80|0x03, 0xa9, 0xf4|' recovery_ui/*ui.cpp; #Recolor text
|
||||
sed -i 's|Android Recovery|'"$DOS_BRANDING_NAME"' Recovery|' recovery_ui/*ui.cpp;
|
||||
sed -i 's|LineageOS|'"$DOS_BRANDING_NAME"'|' recovery_ui/*ui.cpp;
|
||||
sed -i 's|Lineage |'"$DOS_BRANDING_NAME"' |' recovery.cpp;
|
||||
fi;
|
||||
|
||||
enter "build/make";
|
||||
if enter "build/make"; then
|
||||
sed -i 's|echo "ro.build.user=$BUILD_USERNAME"|echo "ro.build.user=emy"|' tools/buildinfo.sh; #Override build user
|
||||
sed -i 's|echo "ro.build.host=$BUILD_HOSTNAME"|echo "ro.build.host=dosbm"|' tools/buildinfo.sh; #Override build host
|
||||
fi;
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
||||
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
||||
fi;
|
||||
|
||||
enter "lineage-sdk";
|
||||
if enter "lineage-sdk"; then
|
||||
sed -i '/.*lineage_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineage_updates/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineageos_system_label/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/LineageParts";
|
||||
if enter "packages/apps/LineageParts"; then
|
||||
sed -i '/.*egg_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*lineageparts_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*privacy_settings_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i '/.*lineagelicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/SetupWizard";
|
||||
if enter "packages/apps/SetupWizard"; then
|
||||
sed -i 's|http://lineageos.org/legal|'"$DOS_BRANDING_LINK_PRIVACY"'|' src/org/lineageos/setupwizard/LineageSettingsActivity.java;
|
||||
sed -i '/.*intro_restore/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*os_name/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
sed -i '/.*setup_services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i 's|0OTA_SERVER_CLEARNET0|'"$DOS_BRANDING_SERVER_OTA"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|0OTA_SERVER_ONION0|'"$DOS_BRANDING_SERVER_OTA_ONION"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|>LineageOS|>'"$DOS_BRANDING_NAME"'|' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' build/core/main_version.mk
|
||||
sed -i '/.*ZIPPATH=/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/envsetup.sh;
|
||||
sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/tasks/bacon.mk;
|
||||
rm -rf bootanimation;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Rebranding complete!";
|
||||
|
@ -24,28 +24,34 @@
|
||||
|
||||
echo "Changing default settings...";
|
||||
|
||||
enter "packages/apps/Dialer";
|
||||
if enter "packages/apps/Dialer"; then
|
||||
sed -i 's/ENABLE_FORWARD_LOOKUP, true)/ENABLE_FORWARD_LOOKUP, false)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable FLP
|
||||
sed -i 's/ENABLE_PEOPLE_LOOKUP, true)/ENABLE_PEOPLE_LOOKUP, false)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable PLP
|
||||
sed -i 's/ENABLE_REVERSE_LOOKUP, true)/ENABLE_REVERSE_LOOKUP, false)/' java/com/android/dialer/lookup/LookupSettings*.java; #Disable RLP
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Nfc";
|
||||
if enter "packages/apps/Nfc"; then
|
||||
sed -i 's/boolean NFC_ON_DEFAULT = true;/boolean NFC_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NFC
|
||||
sed -i 's/boolean NDEF_PUSH_ON_DEFAULT = true;/boolean NDEF_PUSH_ON_DEFAULT = false;/' src/com/android/nfc/NfcService.java; #Disable NDEF Push
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i 's/INSTANT_APPS_ENABLED, 1/INSTANT_APPS_ENABLED, 0/' src/com/android/settings/applications/managedomainurls/InstantAppWebActionPreferenceController.java; #Disable "Instant Apps"
|
||||
sed -i 's/DEFAULT_VALUE = 1;/DEFAULT_VALUE = 0.5f;/' src/com/android/settings/development/*ScalePreferenceController.java; #Always reset animation scales to 0.5
|
||||
fi;
|
||||
|
||||
enter "packages/apps/SetupWizard";
|
||||
if enter "packages/apps/SetupWizard"; then
|
||||
sed -i 's/UPDATE_RECOVERY_PROP, false)/UPDATE_RECOVERY_PROP, true)/' src/org/lineageos/setupwizard/UpdateRecoveryActivity.java; #Always update recovery by default
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i 's/Constants.UPDATE_RECOVERY_PROPERTY, false)/Constants.UPDATE_RECOVERY_PROPERTY, true)/' src/org/lineageos/updater/UpdatesActivity.java; #Always update recovery by default
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's/ro.config.notification_sound=Argon.ogg/ro.config.notification_sound=Pong.ogg/' config/common*.mk;
|
||||
sed -i 's/ro.config.alarm_alert=Hassium.ogg/ro.config.alarm_alert=Alarm_Buzzer.ogg/' config/common*.mk;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Default settings changed!";
|
||||
|
@ -51,30 +51,35 @@ gpgVerifyDirectory "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/packa
|
||||
cp -r "$DOS_PREBUILT_APPS""android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BASE""vendor/fdroid_prebuilt/"; #Add the prebuilt apps
|
||||
cp -r "$DOS_PATCHES_COMMON""android_vendor_divested/." "$DOS_BUILD_BASE""vendor/divested/"; #Add our vendor files
|
||||
|
||||
enterAndClear "bootable/recovery";
|
||||
if enterAndClear "bootable/recovery"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_bootable_recovery/0001-No_SerialNum_Restrictions.patch"; #Abort on serial number specific packages (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "build/make";
|
||||
if enterAndClear "build/make"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
patch -p1 < "$DOS_PATCHES/android_build/0002-OTA_Keys.patch"; #add correct keys to recovery for OTA verification
|
||||
sed -i '75i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aapt2.mk;
|
||||
sed -i 's/messaging/Silence/' target/product/aosp_base_telephony.mk target/product/aosp_product.mk; #Switch to Silence
|
||||
awk -i inplace '!/updatable_apex.mk/' target/product/mainline_system.mk; #Disable APEX
|
||||
sed -i 's/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 28/' core/version_defaults.mk; #Bump minimum SDK version (GrapheneOS)
|
||||
|
||||
enterAndClear "build/soong";
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
|
||||
enterAndClear "device/qcom/sepolicy-legacy";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy-legacy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> sepolicy.mk; #necessary for -user builds of legacy devices
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
enterAndClear "external/chromium-webview";
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
|
||||
enterAndClear "frameworks/base";
|
||||
if enterAndClear "build/soong"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
|
||||
fi;
|
||||
|
||||
if enterAndClear "device/qcom/sepolicy-legacy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy-legacy/0001-Camera_Fix.patch"; #Fix camera on -user builds XXX: REMOVE THIS TRASH
|
||||
echo "SELINUX_IGNORE_NEVERALLOWS := true" >> sepolicy.mk; #necessary for -user builds of legacy devices
|
||||
fi;
|
||||
|
||||
if [ "$(type -t DOS_WEBVIEW_CHERRYPICK)" = "alias" ] ; then
|
||||
if enterAndClear "external/chromium-webview"; then
|
||||
DOS_WEBVIEW_CHERRYPICK; #update webview
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if enterAndClear "frameworks/base"; then
|
||||
hardenLocationConf services/core/java/com/android/server/location/gps_debug.conf;
|
||||
sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
sed -i 's/DEFAULT_MAX_FILES_LOWRAM = 300;/DEFAULT_MAX_FILES_LOWRAM = 0;/' services/core/java/com/android/server/DropBoxManagerService.java; #Disable DropBox
|
||||
@ -94,99 +99,124 @@ patch -p1 < "$DOS_PATCHES/android_frameworks_base/0004-Fingerprint_Lockout.patch
|
||||
#sed -i '301i\ if(packageList != null && packageList.size() > 0) { packageList.add("net.sourceforge.opencamera"); }' core/java/android/hardware/Camera.java; #add Open Camera to aux camera whitelist XXX: needs testing, broke boot last time
|
||||
if [ "$DOS_MICROG_INCLUDED" != "FULL" ]; then rm -rf packages/CompanionDeviceManager; fi; #Used to support Android Wear (which hard depends on GMS)
|
||||
rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps
|
||||
fi;
|
||||
|
||||
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
|
||||
enterAndClear "frameworks/opt/net/ims";
|
||||
if enterAndClear "frameworks/opt/net/ims"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_frameworks_opt_net_ims/0001-Fix_Calling.patch"; #Fix calling when IMS is removed
|
||||
fi
|
||||
fi;
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom/display";
|
||||
if enterAndClear "hardware/qcom/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8084.patch" --directory msm8084;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8916.patch" --directory msm8226;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch" --directory msm8960;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch" --directory msm8974;
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch" --directory msm8994;
|
||||
#TODO: missing msm8909, msm8996, msm8998, sdm845, sdm8150
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/apq8084/display";
|
||||
if enterAndClear "hardware/qcom-caf/apq8084/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-apq8084.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8952/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8952/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8952.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8960/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8960/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8960.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8974/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8974/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8974.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8994/display";
|
||||
if enterAndClear "hardware/qcom-caf/msm8994/display"; then
|
||||
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_display/CVE-2019-2306-msm8994.patch";
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8996/audio";
|
||||
if enterAndClear "hardware/qcom-caf/msm8996/audio"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-8996.patch"; #audio_extn: Fix unused parameter warning in utils.c
|
||||
fi;
|
||||
|
||||
enterAndClear "hardware/qcom-caf/msm8998/audio";
|
||||
if enterAndClear "hardware/qcom-caf/msm8998/audio"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-8998.patch"; #audio_extn: Fix unused parameter warning in utils.c
|
||||
fi;
|
||||
|
||||
enterAndClear "lineage-sdk";
|
||||
if enterAndClear "lineage-sdk"; then
|
||||
awk -i inplace '!/LineageWeatherManagerService/' 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;
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Contacts";
|
||||
if enterAndClear "packages/apps/Contacts"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Backup.patch"; #Backups are not sent to Google (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Dialer";
|
||||
if enterAndClear "packages/apps/Dialer"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Dialer/0001-Not_Private_Banner.patch"; #Add a privacy warning banner to calls (CalyxOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/LineageParts";
|
||||
if enterAndClear "packages/apps/LineageParts"; then
|
||||
rm -rf src/org/lineageos/lineageparts/lineagestats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml; #Nuke part of the analytics
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/PermissionController";
|
||||
if enterAndClear "packages/apps/PermissionController"; then
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then patch -p1 < "$DOS_PATCHES/android_packages_apps_PermissionController/0001-Signature_Spoofing.patch"; fi; #Allow packages to spoof their signature (microG)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Settings";
|
||||
if enterAndClear "packages/apps/Settings"; then
|
||||
sed -i 's/if (isFullDiskEncrypted()) {/if (false) {/' src/com/android/settings/accessibility/*AccessibilityService*.java; #Never disable secure start-up when enabling an accessibility service
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then sed -i 's/GSETTINGS_PROVIDER = "com.google.settings";/GSETTINGS_PROVIDER = "com.google.oQuae4av";/' src/com/android/settings/backup/PrivacySettingsUtils.java; fi; #microG doesn't support Backup, hide the options
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/SetupWizard";
|
||||
if enterAndClear "packages/apps/SetupWizard"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_SetupWizard/0001-Remove_Analytics.patch"; #Remove analytics
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Trebuchet";
|
||||
if enterAndClear "packages/apps/Trebuchet"; then
|
||||
cp $DOS_BUILD_BASE/vendor/divested/overlay/common/packages/apps/Trebuchet/res/xml/default_workspace_*.xml res/xml/; #XXX: Likely no longer needed
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/apps/Updater";
|
||||
if enterAndClear "packages/apps/Updater"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0001-Server.patch"; #Switch to our server
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_apps_Updater/0002-Tor_Support.patch"; #Add Tor support
|
||||
sed -i 's/PROP_BUILD_VERSION_INCREMENTAL);/PROP_BUILD_VERSION_INCREMENTAL).replaceAll("\\\\.", "");/' src/org/lineageos/updater/misc/Utils.java; #Remove periods from incremental version
|
||||
#TODO: Remove changelog
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/inputmethods/LatinIME";
|
||||
if enterAndClear "packages/inputmethods/LatinIME"; then
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0001-Voice.patch"; #Remove voice input key
|
||||
patch -p1 < "$DOS_PATCHES_COMMON/android_packages_inputmethods_LatinIME/0002-Disable_Personalization.patch"; #Disable personalization dictionary by default (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "packages/providers/TelephonyProvider";
|
||||
if enterAndClear "packages/providers/TelephonyProvider"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_providers_TelephonyProvider/304614.patch"; #mcc/mnc fix
|
||||
patch -p1 < "$DOS_PATCHES/android_packages_providers_TelephonyProvider/312102.patch"; #mnc fix
|
||||
fi;
|
||||
|
||||
#enterAndClear "packages/services/Telephony";
|
||||
#if enterAndClear "packages/services/Telephony"; then
|
||||
#patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0001-PREREQ_Handle_All_Modes.patch"; #XXX 18REBASE
|
||||
#patch -p1 < "$DOS_PATCHES/android_packages_services_Telephony/0002-More_Preferred_Network_Modes.patch"; #XXX 18REBASE
|
||||
#fi;
|
||||
|
||||
enterAndClear "system/bt";
|
||||
if enterAndClear "system/bt"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_bt/a2dp-master-fixes.patch"; #topic
|
||||
fi;
|
||||
|
||||
enterAndClear "system/core";
|
||||
if enterAndClear "system/core"; then
|
||||
if [ "$DOS_HOSTS_BLOCKING" = true ]; then cat "$DOS_HOSTS_FILE" >> rootdir/etc/hosts; fi; #Merge in our HOSTS file
|
||||
git revert --no-edit e8dcabaf6b55ec55eb73c4585501ddbafc04fc9b 79f606ece6b74652d374eb4f79de309a0aa81360; #insanity
|
||||
patch -p1 < "$DOS_PATCHES/android_system_core/0001-Harden.patch"; #Harden mounts with nodev/noexec/nosuid + misc sysctl changes (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/extras";
|
||||
if enterAndClear "system/extras"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_extras/0001-ext4_pad_filenames.patch"; #FBE: pad filenames more (GrapheneOS)
|
||||
fi;
|
||||
|
||||
enterAndClear "system/sepolicy";
|
||||
if enterAndClear "system/sepolicy"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch"; #Fix -user builds for LGE devices
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/30.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/29.0";
|
||||
@ -194,11 +224,13 @@ patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --direct
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/27.0";
|
||||
patch -p1 < "$DOS_PATCHES/android_system_sepolicy/0001-LGE_Fixes.patch" --directory="prebuilts/api/26.0";
|
||||
awk -i inplace '!/true cannot be used in user builds/' Android.mk; #Allow ignoring neverallows under -user
|
||||
fi;
|
||||
|
||||
enterAndClear "system/update_engine";
|
||||
if enterAndClear "system/update_engine"; then
|
||||
git revert --no-edit c0e056ed5c084ce55557c4aecbad540e2b235785; #Do not skip payload signature verification
|
||||
fi;
|
||||
|
||||
enterAndClear "vendor/lineage";
|
||||
if enterAndClear "vendor/lineage"; then
|
||||
rm build/target/product/security/lineage.x509.pem;
|
||||
rm -rf overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml; #Remove analytics
|
||||
rm -rf overlay/common/frameworks/base/core/res/res/drawable-*/default_wallpaper.png;
|
||||
@ -214,14 +246,16 @@ if [ "$DOS_NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYP
|
||||
echo 'include vendor/divested/divestos.mk' >> config/common.mk; #Include our customizations
|
||||
cp -f "$DOS_PATCHES_COMMON/apns-conf.xml" prebuilt/common/etc/apns-conf.xml; #Update APN list
|
||||
sed -i 's/messaging/Silence/' config/telephony.mk; #Switch to Silence
|
||||
fi;
|
||||
|
||||
enter "vendor/divested";
|
||||
if enter "vendor/divested"; then
|
||||
awk -i inplace '!/EtarPrebuilt/' packages.mk; #lineage-17.1 calendar is Etar fork
|
||||
awk -i inplace '!/_lookup/' overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml;
|
||||
if [ "$DOS_MICROG_INCLUDED" = "FULL" ]; then echo "PRODUCT_PACKAGES += GmsCore GsfProxy FakeStore" >> packages.mk; fi;
|
||||
if [ "$DOS_HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += $DOS_HOSTS_BLOCKING_APP" >> packages.mk; fi;
|
||||
echo "PRODUCT_PACKAGES += vendor.lineage.trust@1.0-service" >> packages.mk; #All of our kernels have deny USB patch added
|
||||
echo "PRODUCT_PACKAGES += eSpeakNG" >> packages.mk; #PicoTTS needs work to compile on 18.1, use eSpeak-NG instead
|
||||
fi;
|
||||
#
|
||||
#END OF ROM CHANGES
|
||||
#
|
||||
@ -229,81 +263,102 @@ echo "PRODUCT_PACKAGES += eSpeakNG" >> packages.mk; #PicoTTS needs work to compi
|
||||
#
|
||||
#START OF DEVICE CHANGES
|
||||
#
|
||||
enterAndClear "device/asus/flox";
|
||||
if enterAndClear "device/asus/flox"; then
|
||||
compressRamdisks;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/essential/mata";
|
||||
if enterAndClear "device/essential/mata"; then
|
||||
git revert --no-edit 1f1d061c4d7ddedcac503608e8fa333aff30a693 3928b30a97fe7f6b6020bbd9d83a56a32de4ba16 e91f0fece65d32ca407be532e2c4456056b1a968; #Unbreak the earpiece speaker, breaking the loud speaker volume control on calls
|
||||
fi;
|
||||
|
||||
enterAndClear "device/fxtec/pro1";
|
||||
if enterAndClear "device/fxtec/pro1"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/google/bonito";
|
||||
if enterAndClear "device/google/bonito"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
awk -i inplace '!/INODE_COUNT/' BoardConfigLineage.mk; #mke2fs -1 incompatibility (?)
|
||||
fi;
|
||||
|
||||
enterAndClear "device/google/coral";
|
||||
if enterAndClear "device/google/coral"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/google/crosshatch";
|
||||
if enterAndClear "device/google/crosshatch"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/google/wahoo";
|
||||
if enterAndClear "device/google/wahoo"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/htc/m8-common";
|
||||
if enterAndClear "device/htc/m8-common"; then
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #broken releasetools
|
||||
fi;
|
||||
|
||||
enterAndClear "device/htc/msm8974-common";
|
||||
if enterAndClear "device/htc/msm8974-common"; then
|
||||
patch -p1 < "$DOS_PATCHES/android_device_htc_msm8974-common/312412.patch"; #shim all the rils
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/g2-common";
|
||||
if enterAndClear "device/lge/g2-common"; then
|
||||
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #broken releasetools
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/g3-common";
|
||||
if enterAndClear "device/lge/g3-common"; then
|
||||
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
|
||||
sed -i '1itypeattribute wcnss_service misc_block_device_exception;' sepolicy/wcnss_service.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/mako";
|
||||
if enterAndClear "device/lge/mako"; then
|
||||
echo "pmf=0" >> wifi/wpa_supplicant_overlay.conf; #Wi-Fi chipset doesn't support PMF
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfig.mk; #broken releasetools
|
||||
sed -i 's/bdAddrLoader/bdAddrLoader-mako/' device.mk bdAddrLoader/Android.bp bdAddrLoader/addrloader.c rootdir/etc/init.mako.bt.sh sepolicy/file_contexts; #Fix conflicts
|
||||
sed -i 's|/bdAddrLoader|/bdAddrLoader-mako|' rootdir/etc/init.mako.rc;
|
||||
sed -i '16iifeq ($(TARGET_DEVICE),mako)' sensors/Android.mk;
|
||||
echo "endif" >> sensors/Android.mk;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/lge/msm8996-common";
|
||||
if enterAndClear "device/lge/msm8996-common"; then
|
||||
sed -i '3itypeattribute hwaddrs misc_block_device_exception;' sepolicy/hwaddrs.te;
|
||||
awk -i inplace '!/WfdCommon/' msm8996.mk; #fix breakage
|
||||
echo "type sensors_data_file, file_type, data_file_type, core_data_file_type;" >> sepolicy/file.te; #only included in -userdebug
|
||||
fi;
|
||||
|
||||
enterAndClear "device/moto/shamu";
|
||||
if enterAndClear "device/moto/shamu"; then
|
||||
git revert --no-edit 0ba2cb240e8483fa85fcc831328f70f65eeb7180 2be3c88c331387f03978b75ebc118e09738216d0 ff98fee8fc40d00e1c8b296fd4bb20077bc056d6; #breakage
|
||||
#git revert --no-edit 05fb49518049440f90423341ff25d4f75f10bc0c; #restore releasetools #TODO
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oneplus/msm8998-common";
|
||||
if enterAndClear "device/oneplus/msm8998-common"; then
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #disable releasetools to fix delta ota generation
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oneplus/sm8150-common";
|
||||
if enterAndClear "device/oneplus/sm8150-common"; then
|
||||
enableVerity; #Resurrect dm-verity
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oppo/common";
|
||||
if enterAndClear "device/oppo/common"; then
|
||||
awk -i inplace '!/TARGET_RELEASETOOLS_EXTENSIONS/' BoardConfigCommon.mk; #disable releasetools to fix delta ota generation
|
||||
fi;
|
||||
|
||||
enterAndClear "device/oppo/msm8974-common";
|
||||
if enterAndClear "device/oppo/msm8974-common"; then
|
||||
sed -i 's/libinit_msm8974/libinit_msm8974-oppo/' BoardConfigCommon.mk init/Android.bp; #Fix name conflict
|
||||
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/
|
||||
fi;
|
||||
|
||||
enterAndClear "device/samsung/jfltexx";
|
||||
if enterAndClear "device/samsung/jfltexx"; then
|
||||
smallerSystem;
|
||||
fi;
|
||||
|
||||
enterAndClear "device/samsung/msm8974-common";
|
||||
if enterAndClear "device/samsung/msm8974-common"; then
|
||||
echo "TARGET_RECOVERY_DENSITY := hdpi" >> BoardConfigCommon.mk;
|
||||
echo "allow hal_gnss_default ssr_device:chr_file { open read };" >> sepolicy/common/hal_gnss_default.te;
|
||||
fi;
|
||||
|
||||
enterAndClear "kernel/google/wahoo";
|
||||
if enterAndClear "kernel/google/wahoo"; then
|
||||
sed -i 's/asm(SET_PSTATE_UAO(1));/asm(SET_PSTATE_UAO(1)); return 0;/' arch/arm64/mm/fault.c; #fix build with CONFIG_ARM64_UAO
|
||||
fi;
|
||||
|
||||
#Make changes to all devices
|
||||
cd "$DOS_BUILD_BASE";
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
echo "Rebranding...";
|
||||
|
||||
enter "bootable/recovery";
|
||||
if enter "bootable/recovery"; then
|
||||
git revert --no-edit c4071b4f; #use standard animation
|
||||
awk -i inplace '!/DrawSurface\(logo.get\(\)/' recovery_ui/screen_ui.cpp; #Hide logo
|
||||
mogrify -format png -fill "#FF5722" -opaque "#167C80" -fuzz 10% res-*/images/*sel.png; #Recolor icons
|
||||
@ -34,48 +34,57 @@ sed -i 's|0x16, 0x7c, 0x80|0x03, 0xa9, 0xf4|' recovery_ui/*ui.cpp; #Recolor text
|
||||
sed -i 's|Android Recovery|'"$DOS_BRANDING_NAME"' Recovery|' recovery_ui/*ui.cpp;
|
||||
sed -i 's|LineageOS|'"$DOS_BRANDING_NAME"'|' recovery_ui/*ui.cpp;
|
||||
sed -i 's|Lineage |'"$DOS_BRANDING_NAME"' |' recovery.cpp;
|
||||
fi;
|
||||
|
||||
enter "build/make";
|
||||
if enter "build/make"; then
|
||||
sed -i 's|echo "ro.build.user=$BUILD_USERNAME"|echo "ro.build.user=emy"|' tools/buildinfo.sh; #Override build user
|
||||
sed -i 's|echo "ro.build.host=$BUILD_HOSTNAME"|echo "ro.build.host=dosbm"|' tools/buildinfo.sh; #Override build host
|
||||
fi;
|
||||
|
||||
enter "frameworks/base";
|
||||
if enter "frameworks/base"; then
|
||||
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
||||
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
||||
fi;
|
||||
|
||||
enter "lineage-sdk";
|
||||
if enter "lineage-sdk"; then
|
||||
sed -i '/.*lineage_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineage_updates/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
sed -i '/.*lineageos_system_label/s/LineageOS/'"$DOS_BRANDING_NAME"'/' lineage/res/res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/LineageParts";
|
||||
if enter "packages/apps/LineageParts"; then
|
||||
sed -i '/.*egg_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*lineageparts_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*privacy_settings_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Settings";
|
||||
if enter "packages/apps/Settings"; then
|
||||
sed -i '/.*lineagelicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/SetupWizard";
|
||||
if enter "packages/apps/SetupWizard"; then
|
||||
sed -i 's|http://lineageos.org/legal|'"$DOS_BRANDING_LINK_PRIVACY"'|' src/org/lineageos/setupwizard/LineageSettingsActivity.java;
|
||||
sed -i '/.*intro_restore/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*os_name/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
||||
sed -i '/.*services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
sed -i '/.*setup_services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
sed -i '/.*update_recovery/s/Lineage/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "packages/apps/Updater";
|
||||
if enter "packages/apps/Updater"; then
|
||||
sed -i 's|0OTA_SERVER_CLEARNET0|'"$DOS_BRANDING_SERVER_OTA"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|0OTA_SERVER_ONION0|'"$DOS_BRANDING_SERVER_OTA_ONION"'|' src/org/lineageos/updater/misc/Utils.java;
|
||||
sed -i 's|>LineageOS|>'"$DOS_BRANDING_NAME"'|' res/values*/strings.xml;
|
||||
sed -i '/.*toast_forced_update_recovery/s/Lineage/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
||||
fi;
|
||||
|
||||
enter "vendor/lineage";
|
||||
if enter "vendor/lineage"; then
|
||||
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' build/core/main_version.mk
|
||||
sed -i '/.*ZIPPATH=/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/envsetup.sh;
|
||||
sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/tasks/bacon.mk;
|
||||
rm -rf bootanimation;
|
||||
fi;
|
||||
|
||||
cd "$DOS_BUILD_BASE";
|
||||
echo "Rebranding complete!";
|
||||
|
Loading…
Reference in New Issue
Block a user