Skip to content

penn5/NoiceDualBootPatcher

Repository files navigation

NoiceDualBootPatcher

This is a collection of scripts that will patch your ramdisk (part of the kernel) to allow you do dualboot your Android phone.

Working

  • It boots and works correctly on my Project Treble phone on both Oreo and Pie
  • You can install magisk over the patched ramdisk, and it works.
  • Android works and no noticable bugs are created

Known Bugs

  • Bluetooth pairings are lost every time you switch data (Needs Confirmation)
  • On some weird devices (that don't conform to google specs) there is a risk that the boot.img requires AVB to work. This is also the case on Huawei's patch01 if I understand correctly. Currently, the system will simply pad the AVB field with nulls. This means that the checksum will fail if your device has a non-null AVB field (aka stock, unpatched boot.img). This will be fixed in a later release, as it will fail the checksum check.

Usage

  1. Clone this repo
  2. Get the file containing your ramdisk from the phone or stock rom and put it in this folder with the name boot.img
  3. make
  4. Run as either fakeroot (unsupported) or root (either sudo or su): python3 main.py
  5. The output will be generated in boot.img-repack
  6. Copy this file to the phone and flash it to the same partition it came from. Various checks are conducted to ensure it won't brick the phone.
  7. Wipe data and cache in TWRP
  8. Reboot!

Installing a dual system

https://github.com/penn5/DualBootInstaller will do it automatically.

  1. Download the zip file for the system
  2. Extract it.
  3. If there are any .br files, extract them too (brotli)
  4. Use https://github.com/xpirt/sdat2img to covert it to a system.img
  5. Send this system.img to the phone
  6. Enter the twrp shell (Advanced --> Terminal) and run (replacing paths with the correct ones) rm -rf /mnt/tmp;mkdir /mnt/tmp;mount -o loop -t auto /path/to/system.img /mnt/tmp
  7. Exit the twrp shell and enter File Manager
  8. Navigate to /mnt/tmp
  9. Click the blue folder icon in the bottom right corner.
  10. Select 'Copy'
  11. Navigate to /system/(a|b) (make the folder if it doesn't exist)
  12. Click the blue folder icon again and paste the files. This will take a while.
  13. Reboot System!

Getting Logs

  • If it is booting, get /dev/mounts - this is a tmpfs with all the logs in
  • If it isn't booting, send the ramdisk folder relative to this file.