[Android Software/Hacking General [Developers Only]] yshalsager:
Part 4: How to add new Devices to DualBootPatcher?

To add your/new device to DualBootPatcher you need to get some information first then add it to DualBootPatcher devices:

- Flash GetLogs-20161128-1.zip using recovery [TWRP highly recommended]

- Copy /sdcard/logs/[Date&Time].tar to PC, extract it and let's start.

- This is new device template:

- name: (Device Name)
id: (device id)
codenames:
- (device codename1)
- (device codename2)
- (device codename3)
architecture: (device architecture)

block_devs:
base_dirs:
- (/dev/block/bootdevice/by-name)
system:
- (/dev/block/bootdevice/by-name/system)
cache:
- (/dev/block/bootdevice/by-name/cache)
data:
- (/dev/block/bootdevice/by-name/userdata)
boot:
- (/dev/block/bootdevice/by-name/boot)
recovery:
- (/dev/block/bootdevice/recovery)
extra:
- (/dev/block/bootdevice/modem)

boot_ui:
supported: true
flags:
- (TW_HAS_DOWNLOAD_MODE)
graphics_backends:
- fbdev
brightness_path: (/sys/class/leds/lcd-backlight/brightness)
max_brightness: (255)
default_brightness: (162)
pixel_format: (RGBX_8888)
theme: portrait_hdpi

- You'll edit all values between brackets.

- open logs/system/build.prop, you'll find:

ro.product.model= is your (Device Name)

ro.product.name= and ro.product.device= is your (device id) and (device codename1), if you know more names for your device add it in (device codename2) / (device codename3)

ro.product.cpu.abi= is your (device architecture)

- open logs/recovery/recovery.fstab, you'll find main device mount points, copy each mount point to it name

- open logs/recovery/recovery.log, you'll find TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness this is your (brightness_path)

I:Got max brightness 255 is (max_brightness)

setting GGL_PIXEL_FORMAT_RGBA_8888 is (pixel_format)

- Note: you can get these info from BoradConfig.mk in your device twrp tree.

- Now read "Partition Logs:" in recovery.log

it'll tell us second mount point, as example /system | /dev/block/mmcblk0p41

so you should add it like

system:
- /dev/block/bootdevice/by-name/system
- /dev/block/mmcblk0p41

and so on with other partitions.

- Checking more mounts: (not necessary but i recommend it)

open logs/listings/dev_full and scroll down to /dev/block/platform/soc.0 you'll find another main mount point which contain by-name and by-num folders like /dev/block/platform/soc.0/f9824900.sdhci

from /dev/block/platform/soc.0/f9824900.sdhci/by-name list copy each partition mount point to your device

- Now we're done, you should have something like

- name: Xiaomi Mi4S
id: aqua
codenames:
- aqua
architecture: arm64-v8a

block_devs:
base_dirs:
- /dev/block/bootdevice/by-name
- /dev/block/platform/soc.0/f9824900.sdhci/by-name
system:
- /dev/block/bootdevice/by-name/system
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
- /dev/block/mmcblk0p41
cache:
- /dev/block/bootdevice/by-name/cache
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/cache
- /dev/block/mmcblk0p42
data:
- /dev/block/bootdevice/by-name/userdata
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata
- /dev/block/mmcblk0p44
boot:
- /dev/block/bootdevice/by-name/boot
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/boot
- /dev/block/mmcblk0p37
recovery:
- /dev/block/bootdevice/by-name/recovery
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/recovery
- /dev/block/mmcblk0p38

boot_ui:
supported: true
graphics_backends:
- fbdev
flags:
- TW_QCOM_RTC_FIX
pixel_format: RGBX_8888
brightness_path: /sys/class/leds/lcd-backlight/brightness
max_brightness: 255
default_brightness: 162
theme: portrait_hdpi

- Open DualBootPatcher/data/devices/(your device manufacturer).yml and add your device codes. then Check your code syntax here if everything is right, make commit to add your device to your repository.

- Build apk using any method explained above to test it.