This commit is contained in:
Tad 2018-06-06 17:32:17 -04:00
parent b10f0a97dc
commit dc9ec2d8f3
6 changed files with 104 additions and 4 deletions

View File

@ -0,0 +1,19 @@
dm-verity has been supported since KitKat! Why isn't it enabled on all devices???
fstab /system
verify=[metadata partition]
device.mk
ifeq ($(TARGET_BUILD_VARIANT),user)
PRODUCT_SYSTEM_VERITY_PARTITION := [system partition]
$(call inherit-product, build/target/product/verity.mk)
endif
init.device.rc
on init
# Load persistent dm-verity state
verity_load_state
on early-boot
# Update dm-verity state and set partition.*.verified properties
verity_update_state

View File

@ -0,0 +1,78 @@
CONFIG_PROFILING
CONFIG_PNP_DEBUG_MESSAGES
CONFIG_SCSI_PROC_FS
CONFIG_ETHERNET
CONFIG_USB_NET_NET1080
CONFIG_USB_ARMLINUX
CONFIG_USB_NET_ZAURUS
CONFIG_UNIX98_PTYS
CONFIG_DIAGFWD_BRIDGE_CODE
CONFIG_FB_VIRTUAL
CONFIG_SND_VERBOSE_PROCFS
CONFIG_SND_SUPPORT_OLD_API
CONFIG_USB_DEVICEFS
CONFIG_USB_GADGET_DEBUG_FILES
CONFIG_MAGIC_SYSRQ
CONFIG_UNUSED_SYMBOLS
CONFIG_DEBUG_INFO
CONFIG_VIRTUALIZATION
CONFIG_HID_A4TECH
CONFIG_HID_ACRUX
CONFIG_HID_ACRUX_FF
CONFIG_HID_APPLE
CONFIG_HID_BELKIN
CONFIG_HID_CHERRY
CONFIG_HID_CHICONY
CONFIG_HID_PRODIKEYS
CONFIG_HID_CYPRESS
CONFIG_HID_DRAGONRISE
CONFIG_DRAGONRISE_FF
CONFIG_HID_EMS_FF
CONFIG_HID_ELECOM
CONFIG_HID_EZKEY
CONFIG_HID_HOLTEK
CONFIG_HOLTEK_FF
CONFIG_HID_KEYTOUCH
CONFIG_HID_KYE
CONFIG_HID_UCLOGIC
CONFIG_HID_WALTOP
CONFIG_HID_GYRATION
CONFIG_HID_TWINHAN
CONFIG_HID_KENSINGTON
CONFIG_HID_LCPOWER
CONFIG_LOGITECH_FF
CONFIG_LOGIRUMBLEPAD2_FF
CONFIG_LOGIG940_FF
CONFIG_LOGIWHEELS_FF
CONFIG_HID_MAGICMOUSE
CONFIG_HID_MICROSOFT
CONFIG_HID_MONTEREY
CONFIG_HID_MULTITOUCH
CONFIG_HID_NTRIG
CONFIG_HID_ORTEK
CONFIG_HID_PANTHERLORD
CONFIG_PANTHERLORD_FF
CONFIG_HID_PETALYNX
CONFIG_HID_PICOLCD
CONFIG_HID_PICOLCD_FB
CONFIG_HID_PICOLCD_BACKLIGHT
CONFIG_HID_PRIMAX
CONFIG_HID_ROCCAT
CONFIG_HID_SAITEK
CONFIG_HID_SAMSUNG
CONFIG_HID_SPEEDLINK
CONFIG_HID_SUNPLUS
CONFIG_HID_GREENASIA
CONFIG_GREENASIA_FF
CONFIG_HID_SMARTJOYPLUS
CONFIG_SMARTJOYPLUS_FF
CONFIG_HID_TIVO
CONFIG_HID_TOPSEED
CONFIG_HID_THRUSTMASTER
CONFIG_THRUSTMASTER_FF
CONFIG_HID_WACOM
CONFIG_HID_WACOM_POWER_SUPPLY
CONFIG_HID_ZEROPLUS
CONFIG_ZEROPLUS_FF
CONFIG_HID_ZYDACRON

View File

@ -93,6 +93,7 @@ echo "Deblobbing..."
blobs=$blobs"|lib-sec-disp.so|libSecureUILib.so|libsecureui.so|libsecureuisvc_jni.so|libsecureui_svcsock.so"; blobs=$blobs"|lib-sec-disp.so|libSecureUILib.so|libsecureui.so|libsecureuisvc_jni.so|libsecureui_svcsock.so";
blobs=$blobs"|liboemcrypto.so|libtzdrmgenprov.so"; blobs=$blobs"|liboemcrypto.so|libtzdrmgenprov.so";
blobs=$blobs"|libpvr.so|librmp.so|libsi.so|libSSEPKCS11.so"; blobs=$blobs"|libpvr.so|librmp.so|libsi.so|libSSEPKCS11.so";
makes=$makes"android.hardware.drm.*";
#Face Unlock [Google] #Face Unlock [Google]
blobs=$blobs"|libfacenet.so|libfilterpack_facedetect.so|libfrsdk.so"; blobs=$blobs"|libfacenet.so|libfilterpack_facedetect.so|libfrsdk.so";
@ -247,7 +248,7 @@ deblobDevice() {
sed -i 's/BOARD_USES_WIPOWER := true/BOARD_USES_WIPOWER := false/' BoardConfig.mk; #Disable WiPower sed -i 's/BOARD_USES_WIPOWER := true/BOARD_USES_WIPOWER := false/' BoardConfig.mk; #Disable WiPower
fi; fi;
if [ -f device.mk ]; then if [ -f device.mk ]; then
awk -i inplace '!/'$makes'/' device.mk; #Remove all shim references from device makefile awk -i inplace '!/'$makes'/' device.mk; #Remove references from device makefile
if [ -z "$replaceTime" ]; then if [ -z "$replaceTime" ]; then
#Switch to Sony TimeKeep #Switch to Sony TimeKeep
echo "PRODUCT_PACKAGES += \\" >> device.mk; echo "PRODUCT_PACKAGES += \\" >> device.mk;
@ -256,7 +257,7 @@ deblobDevice() {
fi; fi;
fi; fi;
if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then
awk -i inplace '!/'$makes'/' "${PWD##*/}".mk; #Remove all shim references from device makefile awk -i inplace '!/'$makes'/' "${PWD##*/}".mk; #Remove references from device makefile
if [ -z "$replaceTime" ]; then if [ -z "$replaceTime" ]; then
#Switch to Sony TimeKeep #Switch to Sony TimeKeep
echo "PRODUCT_PACKAGES += \\" >> "${PWD##*/}".mk; echo "PRODUCT_PACKAGES += \\" >> "${PWD##*/}".mk;

View File

@ -190,7 +190,7 @@ hardenDefconfig() {
#Enable supported options #Enable supported options
#Disabled: CONFIG_DEBUG_SG (bootloops - https://patchwork.kernel.org/patch/8989981) #Disabled: CONFIG_DEBUG_SG (bootloops - https://patchwork.kernel.org/patch/8989981)
declare -a optionsYes=("CONFIG_ARM64_SW_TTBR0_PAN" "CONFIG_BUG" "CONFIG_BUG_ON_DATA_CORRUPTION" "CONFIG_CC_STACKPROTECTOR" "CONFIG_CC_STACKPROTECTOR_STRONG" "CONFIG_CPU_SW_DOMAIN_PAN" "CONFIG_DEBUG_CREDENTIALS" "CONFIG_DEBUG_KERNEL" "CONFIG_DEBUG_LIST" "CONFIG_DEBUG_NOTIFIERS" "CONFIG_DEBUG_RODATA" "CONFIG_DEBUG_WX" "CONFIG_FORTIFY_SOURCE" "CONFIG_GCC_PLUGIN_LATENT_ENTROPY" "CONFIG_GCC_PLUGIN_RANDSTRUCT" "CONFIG_GCC_PLUGINS" "CONFIG_GCC_PLUGIN_STRUCTLEAK" "CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL" "CONFIG_HARDENED_USERCOPY" "CONFIG_IO_STRICT_DEVMEM" "CONFIG_KAISER" "CONFIG_LEGACY_VSYSCALL_NONE" "CONFIG_PAGE_POISONING" "CONFIG_PAGE_POISONING_NO_SANITY" "CONFIG_PAGE_POISONING_ZERO" "CONFIG_PAGE_TABLE_ISOLATION" "CONFIG_PANIC_ON_OOPS" "CONFIG_RANDOMIZE_BASE" "CONFIG_REFCOUNT_FULL" "CONFIG_RETPOLINE" "CONFIG_SCHED_STACK_END_CHECK" "CONFIG_SECCOMP" "CONFIG_SECCOMP_FILTER" "CONFIG_SECURITY" "CONFIG_SECURITY_PERF_EVENTS_RESTRICT" "CONFIG_SECURITY_YAMA" "CONFIG_SECURITY_YAMA_STACKED" "CONFIG_SLAB_FREELIST_RANDOM" "CONFIG_SLAB_HARDENED" "CONFIG_SLUB_DEBUG" "CONFIG_STRICT_DEVMEM" "CONFIG_STRICT_KERNEL_RWX" "CONFIG_STRICT_MEMORY_RWX" "CONFIG_SYN_COOKIES" "CONFIG_UNMAP_KERNEL_AT_EL0" "CONFIG_VMAP_STACK") declare -a optionsYes=("CONFIG_ARM64_SW_TTBR0_PAN" "CONFIG_BUG" "CONFIG_BUG_ON_DATA_CORRUPTION" "CONFIG_CC_STACKPROTECTOR" "CONFIG_CC_STACKPROTECTOR_STRONG" "CONFIG_CPU_SW_DOMAIN_PAN" "CONFIG_DEBUG_CREDENTIALS" "CONFIG_DEBUG_KERNEL" "CONFIG_DEBUG_LIST" "CONFIG_DEBUG_NOTIFIERS" "CONFIG_DEBUG_RODATA" "CONFIG_DEBUG_WX" "CONFIG_FORTIFY_SOURCE" "CONFIG_GCC_PLUGIN_LATENT_ENTROPY" "CONFIG_GCC_PLUGIN_RANDSTRUCT" "CONFIG_GCC_PLUGINS" "CONFIG_GCC_PLUGIN_STRUCTLEAK" "CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL" "CONFIG_HARDENED_USERCOPY" "CONFIG_IO_STRICT_DEVMEM" "CONFIG_KAISER" "CONFIG_LEGACY_VSYSCALL_NONE" "CONFIG_PAGE_POISONING" "CONFIG_PAGE_POISONING_NO_SANITY" "CONFIG_PAGE_POISONING_ZERO" "CONFIG_PAGE_TABLE_ISOLATION" "CONFIG_PANIC_ON_OOPS" "CONFIG_RANDOMIZE_BASE" "CONFIG_REFCOUNT_FULL" "CONFIG_RETPOLINE" "CONFIG_SCHED_STACK_END_CHECK" "CONFIG_SECCOMP" "CONFIG_SECCOMP_FILTER" "CONFIG_SECURITY" "CONFIG_SECURITY_PERF_EVENTS_RESTRICT" "CONFIG_SECURITY_YAMA" "CONFIG_SECURITY_YAMA_STACKED" "CONFIG_SLAB_FREELIST_RANDOM" "CONFIG_SLAB_HARDENED" "CONFIG_SLUB_DEBUG" "CONFIG_STRICT_DEVMEM" "CONFIG_STRICT_KERNEL_RWX" "CONFIG_STRICT_MEMORY_RWX" "CONFIG_SYN_COOKIES" "CONFIG_UNMAP_KERNEL_AT_EL0" "CONFIG_VMAP_STACK" "CONFIG_SECURITY_DMESG_RESTRICT" "CONFIG_SLAB_FREELIST_HARDENED" "CONFIG_GCC_PLUGINS" "CONFIG_GCC_PLUGIN_LATENT_ENTROPY" "CONFIG_GCC_PLUGIN_STRUCTLEAK" "CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL" "CONFIG_GCC_PLUGIN_RANDSTRUCT" "CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE" "CONFIG_PARTIALRESUME" "CONFIG_CRYPTO_DEV_QCRYPTO" "CONFIG_CRYPTO_PCRYPT")
for option in "${optionsYes[@]}" for option in "${optionsYes[@]}"
do do
sed -i 's/# '$option' is not set/'$option'=y/' $defconfigPath &>/dev/null || true; sed -i 's/# '$option' is not set/'$option'=y/' $defconfigPath &>/dev/null || true;
@ -209,6 +209,7 @@ hardenDefconfig() {
sed -i 's/'$option'=y/# '$option' is not set/' $defconfigPath &>/dev/null || true; sed -i 's/'$option'=y/# '$option' is not set/' $defconfigPath &>/dev/null || true;
done done
#Extras #Extras
sed -i 's/CONFIG_ARCH_MMAP_RND_BITS=8/CONFIG_ARCH_MMAP_RND_BITS=16/' $defconfigPath &>/dev/null || true;
sed -i 's/CONFIG_DEFAULT_MMAP_MIN_ADDR=4096/CONFIG_DEFAULT_MMAP_MIN_ADDR=32768/' $defconfigPath &>/dev/null || true; sed -i 's/CONFIG_DEFAULT_MMAP_MIN_ADDR=4096/CONFIG_DEFAULT_MMAP_MIN_ADDR=32768/' $defconfigPath &>/dev/null || true;
sed -i 's/CONFIG_LSM_MMAP_MIN_ADDR=4096/CONFIG_DEFAULT_MMAP_MIN_ADDR=32768/' $defconfigPath &>/dev/null || true; sed -i 's/CONFIG_LSM_MMAP_MIN_ADDR=4096/CONFIG_DEFAULT_MMAP_MIN_ADDR=32768/' $defconfigPath &>/dev/null || true;

View File

@ -39,9 +39,11 @@ sed -i "s/#fff4511e/#ffe53935/" core/res/res/values/colors.xml;
enter "packages/apps/CMParts"; enter "packages/apps/CMParts";
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/colors.xml; sed -i "s/#ff009688/#ff$themeOverride500/" res/values/colors.xml;
if [ "$MICROG_INCLUDED" = true ]; then
enter "packages/apps/GmsCore"; enter "packages/apps/GmsCore";
sed -i "s/#ff7fcac3/#ff$themeOverride300/" microg-ui-tools/src/main/res/values/colors.xml; sed -i "s/#ff7fcac3/#ff$themeOverride300/" microg-ui-tools/src/main/res/values/colors.xml;
sed -i "s/#ff009688/#ff$themeOverride500/" microg-ui-tools/src/main/res/values/colors.xml; sed -i "s/#ff009688/#ff$themeOverride500/" microg-ui-tools/src/main/res/values/colors.xml;
fi;
enter "packages/apps/Settings"; enter "packages/apps/Settings";
sed -i "s/#ff009688/#ff$themeOverride500/" res/values/styles.xml; sed -i "s/#ff009688/#ff$themeOverride500/" res/values/styles.xml;

View File

@ -79,7 +79,6 @@ patchWorkspace() {
repopick -f 214824 209584 209585 215010 214300; #g3-common repopick -f 214824 209584 209585 215010 214300; #g3-common
repopick -f 211404 211405 211406 211407 211408 211409; #d852 repopick -f 211404 211405 211406 211407 211408 211409; #d852
repopick -f 211396 214817; #d855 repopick -f 211396 214817; #d855
repopick -f 216410; #Revert "lineage-sdk: Switch back to AOSP TwilightService"
#repopick -t trust_interface; #repopick -t trust_interface;
source $scripts/Patch.sh; source $scripts/Patch.sh;