Monday, June 5, 2017

[Guide] [4.4.x] [KK] MTK ROM Porting


MT65xx Porting Guide

Port 4.4.2 and 4.4 ROMs using this guide
I will not be responsible for any damage to your device.

This guide is only for porting ROM of the same chipset. You can port any ROM which is made for your chipset.

MT6572 to MT6572
MT6582 to MT6582
MT6592 to MT6592
MT6577 to MT6577
MT6589 to MT6589

This guide can only be used to port ROMs for the same android version.

4.4.2 to 4.4.2
4.4 to 4.4

GUIDE :
Replace folders from Port To Stock

1. /system/app
2. /system/framework
3. /system/fonts
4. /system/media
5. /system/priv-app
6. /system/build.prop
7. /META-INF
8. Copy any extra files in the Port ROM

Copy files from Port to Stock :

1. Copy any extra file in /system/bin
2. Copy all files except platform.xml and handheld_core_hardware.xml from /system/etc/permissions
3. Copy all files from /system/lib/ not folders and paste them in Stock ROM /system/lib/ skip any existing file do not replace

Last Step :
This step is important because sometimes the device gets stuck in boot logo because the /system partition is not mounted properly1. Open Port ROM /META-INF/com/google/android/updater-script using Notepad++


2. Open MTK Droid Tools and connect your device
3. Select Blocks Map
4. Now in updater-script find a line that resembles this (Note it will not be the same)

format("ext4", "EMMC", "/data", "0");
format("ext4", "EMMC", "/system", "0");
mount("ext4", "EMMC", "/dev/block/mmcblk0p4", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p6", "/data");

5. In the Blocks Map you opened before find these :



6. Now just change the mount points accordingly

Example : 

*Note : Your updater-script and my updater-script will not be the same 
My Port ROM updater-script has these lines :

"format("ext4", "EMMC", "/cache", "0");
format("ext4", "EMMC", "/system", "0");" (These lines do not have any mount points you do not need to do anything)
"mount("ext4", "EMMC", "/dev/block/mmcblk0p8", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");" (The red colored numbers are the mount points)

My Blocks Map shows that /system is mounted in 5 and /data is mounted in 7 so I will edit it like this :

format("ext4", "EMMC", "/cache", "0");
format("ext4", "EMMC", "/system", "0");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/data");

BUG FIXING :

To fix stuck on boot animation after flashing MIUI ROM :
Port the kernel using this guide : Port Kernel
To fix bootloop :
Replace files from Stock to Port
1. libandroid_runtime.so
2. libandroid_servers.so
3. libmedia_jni.so

To fix black screen, Or messed up boot screen :
Replace files from Stock to Port
1. /system/lib/libMali.so

To fix memory issues :
Replace files from Stock to Port
1. /system/bin/vold

To fix audio :
Replace files from Stock to Port
1. /system/lib/libaudio.primary.default.so

NOW ZIP AND FLASH

No comments:

Post a Comment