[ULTIMATE GUIDE FOR DUMMIES] PORT MIUI ROM TO ANY MEDIATEK (MT65XX) DEVICES

label
label
label
label
label
label
label
label
label
label

NOW EVERYONE BECOME A PORTER.
I CAN'T WRITE A MORE SIMPLEST
TUTORIAL THAN THIS.


HAPPY PORTING!!!

Requirements:
  • Notepad++
  • 7zip
  • Stock ROM (Original Firmware of your device)
  • Port Rom (MIUI ROM you want to port to your device)
  • Android kitchen (Optional)

How to choose a miui rom for porting?
Check the miui rom you choose is similar to your
  • Chipset (If your device is MT6589 choose an miui rom of a same MT6589 device)
  • Display (If your device is QHD choose a QHD, if your device is HD choose QHD or HD, if FHD choose QHD, HD or FHD MIUI ROM)

Suggesstion for port rom selection


Choose a rom which is updated regularly.

Copy/replace the necessary files from Stock rom to port ROM
  • open stock ROM and port rom in separate window.
  • Delete the folder "firmware" folder from port ROM \system\etc" & Copy "firmware" folderfrom " Stock\system\etc" to "port ROM\system\etc"
  • Copy all files from "\system\lib\HW" and replace to "port ROM\system\lib\HW"
  • Replace libcamalgo.so and libcameracustom.so files from" \system\lib\" and replace to " port ROM \system\lib\"
  • Replace mtk_stp_wmt.ko file from "Stock\system\lib\modules" and replace to "port rom\system\lib\modules"
  • Replace boot.img from stock to port.
Change necessary lines from updater-script and build.prop
In updater-script
  • Open updater-script using notepad++ from "port ROM \META-INF\com\google\android"
  • Remove whole lines contain assert word at the beginning of the file like this line 
    assert(getprop("ro.product.device") == "cancro" || getprop("ro.build.product") == "cancro");
  • Verify /system should be mounted in "/dev/block/mmcblk0pS" & /data should be mounted in "/dev/block/mmcblk0pD"

What is S and D?
S – System Mount Point
D – Data Mount Point
To know these mount point values
- Open MTK Droid Tool after connecting your phone to PC.
- Open Block Maps.
- Check these lines.



Change accordingly these lines in updater-script
format("ext4", "EMMC","/dev/block/mmcblk0p5", "0");
mount("ext4", "EMMC","/dev/block/mmcblk0p5", "/system");
mount("ext4", "EMMC","/dev/block/mmcblk0p7", "/data");

In build.prop
buid.prop (founder under /system folder) you can left it as it is or if you can compare with STOCK ROM change below mentioned lines

ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.board=
ro.product.locale.language=en
ro.product.locale.region=US

FLASHABLE ROM ZIP MAKING:

  • Select “Data (If present), META-INF, System folders and boot.img”
  • Right Click and 7Zip- > add to Archive -> Select zip and compression Method “Store”
  • Make a zip and Flash it.
  • DONE !!!

OPTIONAL STEP: (If phone is in bootloop)
Install Andriod Kitchen to your windows/Linux
Refer :- ( http://forum.xda-developers.com/showthread.php?t=633246 ) 
- Rename port rom as WORKING_somename (important) and place it in Android-Kitchen folder.
Run Android Kitchen and
1, select "0" and "12" and "w" [it will extract boot.img from port ROM to Kitchen\BOOT-EXTRACTED ]
2, Now select "a" and then copy the boot.img from "stock rom" to"Kitchen\bootimg_mmddyy_hhmmss"
3, copy zimgage from "Android Kitchen\bootimg_mmddyy_hhmmss" & paste to "AndroidKitchen\BOOT-EXTRACTED"
4, compare the init.rc file inside extracted boot.img and find (ctrl+F)“cam”. Copy and replace lines related to camera from stock boot.img to port ROM boot.img.
5, now select "b" option in andriod kitchen [it will build boot.img from BOOT-EXTRACTED in to WORKING folder]
6, Then zip the whole and flash.

Here is a small video tutorial for this optional step.

                                                                                    
 


BUG FIXING
After you able to boot into MIUI, you have to check for bugs. Here is few most encountered bugs after porting and their solutions.

(If you get any more bugs and solutions please let me know. I will add them here. It will be helpful for all.)

1. FOR NETWORK RELATED ISSUES (3G)
Replace from /etc folder, mddb then replace agps_profiles_conf, apns-conf,epo_conf, spn-conf, virtual-spn-conf-by-efpnn, virtual-spn-conf-by-efspn, virtual-spn-conf-by-imsi

2. FOR WIFI TOGGLE PROBLEM
Replace wide-dhcpv6, wifi in /etc folder

3. FOR INTERNAL / EXTERNAL MEMORY NOT MOUNT PROBLEM
Replace vold.fstab from /etc folder

4. FOR HIGH AUDIO VOLUME ISSUE
Replace libcustom_nvram.sofrom /lib

5. FOR CAMERA NOT CONNECTED ISSUE / CAMERA GREEN
Replace first libcamdrv.so and check if not success then replace libcameraservice.so from/lib

6. FOR AUDIO NOT COMING IN LOUDSPEAKER MODE
Replace libaudio.primary.default.sofrom /lib
If still sound related problem:
Replace all libaud*.so
Sometimes replacing all audio files give you a boot loop in that case replace only
libaudio.a2dp.default.so
libaudio.primary.default.so
libaudiocompensationfilter.so
libaudiocustparam.so
libaudiosetting.so
libaudioutils.so

7. FOR FLASH LIGHT NOT COMING FROM CAMERA
Replace libfeatureio.so from /lib

8. FOR FM PROBLEM
Replace from /lib/module folder mtk_fm_drv.ko

9. TO FIX GPS
Replace from/lib/module folder mtk_stp_gps.ko

10. TO FIX COMPASS
Replace libsensorservice.so from /lib

11. TO FIX VIDEO SHOWING PIXELS AND GLITCHES
Replace libvcodecdrv.so from /lib

12. SHOWING WRONG RAM INFO IN TASK MANAGER
Don’t change ro.product.device value from the miui rom you are porting.

13. FOR GREEN CAMERA
Replacelibdpframework.so from lib folder

14. PROBLEM WITH 2G/3G SWITCHOpen Dialer and type *#*#4636#*#*
If a Pop Up appears go to Phone Information and choose your preferred network type.

15. PROBLEM DOWNLOADING EPO
Replace in framework folder
mediatek-common.jar
mediatek-framework.jar
mediatek-op.jar
mediatek-telephony-common.jar

16. ANY RESOLUTION PROBLEM
Add this line to build.prop
ro.sf.lcd_density=your phone screen dpi
ex- ro.sf.lcd_density=480 for FHD devices

17. SOME KEYS NOT WORKING

Replace keylayout folder under usr


18. TOUCH SCREEN PROBLEM
(Sometimes screen behaves weird ..means for example if you touch bottom left effect on top right ...almost opposite response)
Replace libinput.so from /system/lib folder.

19. BOOTLOOP ON HDC CLONES
Replace libsync.so from /system/lib folder.

20. WIFI TETHERING PROBLEM
Replace dnsmasq from /bin folder.

21. SCREEN IS UPSIDE DOWN
In build.prop find this line
ro.sf.hwrotation=0
change the value 0 to 180.
ro.sf.hwrotation=180

22. Problem with Proximity Sensor
Replace nvram.so, nvram_platform.so, nvram_daemon_callback.so from /lib

23. Fixing Sdcard or Internal memory not showing Problem

Replace from /bin folder following files

vold

if still not fixed

ext4_resize
make_ext4fs
memsicd
memsicd3416x
mke2fs
sdcard
sdiotool
resize2fs

I am not sure which file exactly fixes the issue but I hope it should fix the issue.



Credits:
Note: I am not responsible for any harm caused to your device.

Tags: port miui, miui porting, tutorial, guide, simple tutorial, port to mtk, device, MTK6589, MTK6582, MTK6592, MTK6577, android kitchen, kitchen, xiaomi, port, miui, FHD, QHD, ROM, custom rom, full rom, ota, update, weekly ota
Keywords: port miui, miui porting, tutorial, guide, simple tutorial, port to mtk, device, MTK6589, MTK6582, MTK6592, MTK6577, android kitchen, kitchen, xiaomi, port, miui, FHD, QHD, ROM, custom rom, full rom, ota, update, weekly ota
Labels: port miui, miui porting, tutorial, guide, simple tutorial, port to mtk, device, MTK6589, MTK6582, MTK6592, MTK6577, android kitchen, kitchen, xiaomi, port, miui, FHD, QHD, ROM, custom rom, full rom, ota, update, weekly ota
Index: port miui, miui porting, tutorial, guide, simple tutorial, port to mtk, device, MTK6589, MTK6582, MTK6592, MTK6577, android kitchen, kitchen, xiaomi, port, miui, FHD, QHD, ROM, custom rom, full rom, ota, update, weekly ota
Share This :



sentiment_satisfied Emoticon