Zackptg5 / Disable_Dm-Verity_ForceEncrypt

Disables dm-verity and forceencrypt
398 stars 104 forks source link

Use hex patch for dtb patching #1

Closed Zackptg5 closed 6 years ago

Zackptg5 commented 6 years ago

Use hex patch for dtb rather than relying on magisk's bugged method: Replace ',verify' with nothing: ,verify = 2c 76 65 72 69 66 79 verify, = 76 65 72 69 66 79 2c verify = 76 65 72 69 66 79

Perhaps a simple sed patch would do the trick? sed -i -e 's/\x2c\x76\x65\x72\x69\x66\x79/\x00\x00\x00\x00\x00\x00\x00/g' -e 's/\x76\x65\x72\x69\x66\x79\x2c/\x00\x00\x00\x00\x00\x00\x00/g' -e 's/\x76\x65\x72\x69\x66\x79/\x00\x00\x00\x00\x00\x00/g' $overlay/dtb (Assuming it's unpacked properly and stuff)

With my OP5T. This is what is extracted:

/tmp/anykernel/ramdisk:
acct
bt_firmware
bugreports
cache
charger
charger_log
config
d
data
default.prop
dev
dsp
etc
firmware
ftm_power_config.sh
init
init.blu_spark.rc
init.environ.rc
init.oem.debug.rc
init.oem.early_boot.sh
init.oem.engineermode.sh
init.oem.rc
init.oem_ftm.rc
init.rc
init.recovery.qcom.rc
init.usb.configfs.rc
init.usb.rc
init.zygote32.rc
init.zygote64_32.rc
kmemleak.sh
mnt
nonplat_file_contexts
nonplat_hwservice_contexts
nonplat_property_contexts
nonplat_seapp_contexts
nonplat_service_contexts
oem
persist
plat_file_contexts
plat_hwservice_contexts
plat_property_contexts
plat_seapp_contexts
plat_service_contexts
proc
res
sbin
sdcard
sepolicy
sepolicy_debug
storage
sys
system
ueventd.rc
vendor
vndservice_contexts

/tmp/anykernel/ramdisk/acct:

/tmp/anykernel/ramdisk/bt_firmware:

/tmp/anykernel/ramdisk/cache:

/tmp/anykernel/ramdisk/config:

/tmp/anykernel/ramdisk/data:

/tmp/anykernel/ramdisk/dev:

/tmp/anykernel/ramdisk/dsp:

/tmp/anykernel/ramdisk/firmware:

/tmp/anykernel/ramdisk/mnt:

/tmp/anykernel/ramdisk/oem:

/tmp/anykernel/ramdisk/persist:

/tmp/anykernel/ramdisk/proc:

/tmp/anykernel/ramdisk/res:
images

/tmp/anykernel/ramdisk/res/images:
charger

/tmp/anykernel/ramdisk/res/images/charger:
battery_fail.png
battery_scale.png

/tmp/anykernel/ramdisk/sbin:
OPNetlinkService
charger
charger_log
dashd
self-init
ueventd
watchdogd

/tmp/anykernel/ramdisk/storage:

/tmp/anykernel/ramdisk/sys:

/tmp/anykernel/ramdisk/system:

/tmp/anykernel/split_img: boot.img-base boot.img-board boot.img-cmdline boot.img-hash boot.img-kerneloff boot.img-oslevel boot.img-osversion boot.img-pagesize boot.img-ramdisk.cpio.gz boot.img-ramdiskoff boot.img-secondoff boot.img-tagsoff boot.img-zImage

I'm assuming zImage in split_img is where dtb lies?

For my reference: https://source.android.com/devices/architecture/dto/implement

dtb is typically found in zImage in split_disk, dtbo is a separate partition/img. Both are imgs and are patched the same way

Zackptg5 commented 6 years ago

Possibly done with https://github.com/Zackptg5/Disable_FEC_DmVerity/commit/4d6bdb47a7db29a4ecf081acbad477d0f3f665fb

Zackptg5 commented 6 years ago

Forgot that android sed seemingly can't do hex patching

Zackptg5 commented 6 years ago

Think I got it with this commit e2232d225ce5cd843b664edead1958c6d08a2ff7