SECOND GUIDE to Port Mtk roms
First Guide for porting (try it first): click me
This porting method works for
mt6592 to mt6592 or
mt6591 to mt6591 or
mt6592 to mt6591 or
mt6591 to mt6592
mt6582 to mt6582
This porting method works for all roms
Only thing is the base rom and port rom must be of same android version
Like 4.4.2 to 4.4.2 or 4.4.4 to 4.4.4 (but it may works for cross porting like 4.4.2 to 4.4.4)
DO EVERYTHING AT YOUR OWN RESPONSIBILITY,i wont be responsible to whatever happens to you,your phone,or sim or sd card or anything
Procedure-
Lets start Porting
1. Extract both roms in two different folders,rename the rom which is working for your device as BASE and the new rom which you want to port for your device as PORT
2.Now open both folders ,then copy these files from base folder to port folder
3.copy / replace from based to port [If anything missing,just Skip it]
- Copy boot.img from Stock to Port Rom
- Open sytem Folder Of Both Rom
- Replace vendor from Stock to Port
- Replace usr From Stock to Port
- Open lib Folder in Both Roms
- Replace following- Replace hw Folder from Stock to Port
- Replace module folder If present From Stock to Port
- Replace All libaudio Files
- Replace libEgl,libMali
- Open lib/egl Folder in Both Roms
- Replace libGLES_android.so
- Replace libEGL_mali.so
- Replace Following Lib Cam Files (there will be a little variation in names so better look carefully than searching for file)
- cameracustom
- camerametadata
- cameraservice
- camerahwutils
- camclient
- Open sytem/etc of both Stock and Port
- Replace firmware Folder
-Now copy and replace boot.img present in stock rom to port rom if its an asop rom
OTHERSWISE,
You need to replace bootclass path pin int.rc file present in boot.img ..Guide here:click me
VIDEO GUIDE COMING SOON,STAY TUNED
Next step is open Meta-inf folder/google/android/updater script with notepad++ from here
you will see these lines or more than these lines
{ mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/data");OTHERSWISE,
You need to replace bootclass path pin int.rc file present in boot.img ..Guide here:click me
VIDEO GUIDE COMING SOON,STAY TUNED
Next step is open Meta-inf folder/google/android/updater script with notepad++ from here
you will see these lines or more than these lines
format("ext4", "EMMC", "/dev/block/mmcblk0p5");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
}
here you see 5 and 7 ...but this maybe different for your device,to know that open updater script file from the stock rom(BASE) and look at it...
Now replace those those number from BASE UPDATER SCRIPT TO PORT UPDATER SCRIPT and save it
LAST AND FINAL STEP
Install winrar if you already havent from here
now select META-inf,system,boot ,data(if you have) and right click,select add to archive
select zip from opening window and click ok...
After that copy to sd card and flash via recovery
BUG FIXING
If you found any bugs repalce from BASE to PORT
Bootloop?
Replace following files(from stock to port):
Code:
libandroid_runtime.so
libandroid_servers.so
libmedia_jni.so
FOR CAMERA NOT CONNECTED ISSUE / CAMERA GREEN / CAMERA FORCE CLOSE "unfortunately camera has stopped"
No success after the files replaced above then keep on replacing one file at a time and check.
Camera problem is the one major bug in this type of porting. You have to have patience. This will take half of your energy.
Replace all "libcam*.so" files from stock to port if even after trying these files camera can't connect (It may lead to bootloop if ROM boots successfully)
Another fix Init.rc (very important)
Unpack port boot.img and stock boot.img
compare the init.rc file inside extracted boot.img and find (ctrl+F)“cam”. Copy and replace ALL lines related to camera from stock boot.img to port ROM boot.img.
Now repack the boot.img from tool
FOR FLASH LIGHT NOT COMING FROM CAMERA
Replace libfeatureio.so from /lib
FOR FM PROBLEM
Replace from /lib/module folder mtk_fm_drv.ko
TO FIX GPS
Replace from/lib/module folder mtk_stp_gps.ko
TO FIX COMPASS
Replace libsensorservice.so from /lib
TO FIX VIDEO SHOWING PIXELS AND GLITCHES
Replace libvcodecdrv.so from /lib
SHOWING WRONG RAM INFO IN TASK MANAGER
Don't change ro.product.device value in the build.prop.
FOR GREEN CAMERA/ LAG / NO WALLPAPER / NO STATUS BAR (IMPORTANT FILE FOR MT6582)
Replace libdpframework.so from lib folder
PROBLEM WITH 2G/3G SWITCH
Open Dialer and type *#*#4636#*#*
If a Pop Up appears go to Phone Information and choose your preferred network type.
PROBLEM DOWNLOADING EPO
Replace in framework folder
mediatek-common.jar
mediatek-framework.jar
mediatek-op.jar
mediatek-telephony-common.jar
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
SOME KEYS NOT WORKING
Replace keylayout folder under /usr. If still not work then replace the whole /usr folder.
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.
BOOTLOOP ON HDC CLONES
Replace libsync.so from /system/lib folder.
WIFI TETHERING PROBLEM
Replace dnsmasq from /bin folder.
SCREEN IS UPSIDE DOWN
In build.prop find this line
ro.sf.hwrotation=0
change the value 0 to 180.
ro.sf.hwrotation=180
Problem with Proximity Sensor
Replace nvram.so, nvram_platform.so, nvram_daemon_callback.so
SD Card not mounting or not working
In the framework-res.apk of your port, replace /res/xml/storage_list.xml from stock one.
USB storage not mounting
Unpack your boot.img replace init.usb.rc from ramdisk by stock boot.img init.usb.rc
FOR WIFI TOGGLE PROBLEM
Replace wide-dhcpv6, wifi in /etc folder