cp -r "$DOS_PREBUILT_APPS""Fennec_DOS-Shim""$DOS_BUILD_BASE""packages/apps/";#Add a shim to install Fennec DOS without actually including the large APK
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
if["$DOS_MICROG_INCLUDED"="FULL"];then patch -p1 < "$DOS_PATCHES/android_frameworks_base/0001-Signature_Spoofing.patch";fi;#Allow packages to spoof their signature (microG)
if["$DOS_MICROG_INCLUDED"="FULL"];then patch -p1 < "$DOS_PATCHES/android_frameworks_base/0002-Harden_Sig_Spoofing.patch";fi;#Restrict signature spoofing to system apps signed with the platform key
changeDefaultDNS;
#patch -p1 < "$DOS_PATCHES/android_frameworks_base/0008-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries #TODO
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
sed -i 's/mCropView.setTouchEnabled(touchEnabled);/mCropView.setTouchEnabled(true);/' WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java;
enterAndClear "system/core";
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 (CopperheadOS-13.0)
enterAndClear "vendor/cm";
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
awk -i inplace '!/DSPManager/' config/common.mk;
fi;
if["$DOS_MICROG_INCLUDED"="NLP"];then sed -i '/Google provider/!b;n;s/com.google.android.gms/org.microg.nlp/' overlay/common/frameworks/base/core/res/res/values/config.xml;fi;
sed -i 's/CM_BUILDTYPE := UNOFFICIAL/CM_BUILDTYPE := dos/' config/common.mk;#Change buildtype
if["$DOS_NON_COMMERCIAL_USE_PATCHES"=true];then sed -i 's/CM_BUILDTYPE := dos/CM_BUILDTYPE := dosNC/' config/common.mk;fi;
sed -i 's/Mms/Silence/' config/telephony.mk;#Replace AOSP Messaging app with Silence