Vous êtes sur la page 1sur 13

______________________________________________________________________________

U L T I M A T E M E D I A T E K T O O L
B Y T E C H N Y O U
______________________________________________________________________________
________________________________________
R O M P O R T I N G G U I D E
________________________________________
######################################
#ICS AND JB PORTING GUIDE
#
#BY XTREME ORNOB @XDA-DEVELOEPRS.COM #
#KITKAT TO KITKAT PORTING GUIDE BY ME#
#MT6592 to MT6592, MT6595 to MT6595 #
#in the end by me
#
######################################
This is ultimate guide for both noobs and experts! It is all in one guide! Fixin
g bugs, porting everything!
DISCLAMIER
I OR ANY OTHER DEVELOPER DO NOT SUGGEST TO FOLLOW THIS IF YOU HAVE NO IDEA ABOUT
MTK CHIPSETS OR ANDROID OR GOOGLE. DOING THIS WRONGLY CAN BRICK THE DEVICE
I OR NO OTHER DEV WILL BE RESPONSIBLE FOR YOUR DEVICE, YOU CHOSE TO DO THIS ON Y
OUR OWN WE DIDN'T MAKE YOU DO IT.
TRY AT YOUR OWN RISK. YOU HAVE BEEN WARNED.
ALWAYS REMEMBER TO KEEP A NANDROID BACKUP IN HANDY INCASE ANYTHING GOES WRONG
NOTE - For Kitkat porting guide scroll to bottom
HOW to Port ROMs...
For Begineers & Advanced Users
Almost Any Device to Any Device!
ONLY FOR MEDIATEK SoCs
In This Guide You'll Learn..
How to Port ROMs of the Same CPU
And Also..
HOW TO PORT ROM FROM A DIFFERENT SoC
Works forMT6589 to MT6577
MT6582 to MT6572
MT6577 to MT6575
ICS to ICS & JB to JB (KitKat to KitKat guide by me, for KK porting guide go abs

olutely down)
No Need of Source
No Need of Kernel Source
No Need of ANDROID KITCHEN
No Need of LINUX...
Requirements:
A Brain
Patience
Windows XP/7/8
7-Zip
Notepad++
U L T I M A T E M E D I A T E K T O O L
Stock ROM
And a Little Respect!!
So now Lets Begin... [ONLY ICS TO ICS AND JB TO JB]
PORTING For Same SoCs ( Ex: MT6582/89/92 to MT6582/89/92)
Replace these from your Stock ROM to the ROM u want to PORT!! Lets Call it "PORT
"
FILE LIST FOR REPLACING:
:
system/vendor
system/usr
system/lib/modules
system/lib/hw
system/lib/libncurses.so
system/etc/firmware
system/etc/vold.fstab
system/etc/vold.fstab.nand
system/etc/bluetooth
For Fixing Problems...
:
system/etc/permissions
system/etc/security
system/etc/audio
system/etc/wifi
system/lib/drm
system/lisystem/lib/soundfx
Now Replace the Stock Boot.img to Port ROM!
Now Open The Port ROM folder and go to META-INF/google/android and open updaterscript in Notepad++
Do the same for the Stock ROM

Now In the Port ROM's Updater Script, find a line that starts with this...
format(".......
and only replace the mmcblk0p.. with the stock one!
Do the same for this line...
mount("...
Example:
This is the PORT one!!!
:
format("ext4", "EMMC", "/dev/block/mmcblk0p5", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
This is the Stock one!!
:
format("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
Now just Replace the "mmcblk0p3" from STOCK to PORT!!
It should look like this:
:
format("ext4", "EMMC", "/dev/block/mmcblk0p3", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
DO NOT REPLACE THE WHOLE LINE!
Now go back to the Folder of Port ROM and You'll see 2 folders & 1 file named
-META-INF
-system
-boot.img
Now Select these three and Click Right Mouse Button and Click on 7-Zip ->> Add t
o Archive
Now a dialouge box should appear!
Configure the Format like This:
Archive format: ZIP
Compression Level : Normal
Compression Method: Deflate
Dictoioany Size: 32k
Word Size 32

Now Start Zipping and Push the ZIP to your Memory Card
Go to Recovery >> Install ZIP & Wipe Data
Finished!!
Now was that so hard?? Its a Really Easy thing to d0!!
Now Come to the Hard Part!!
Porting From Different SoCs ( Ex: MT6582 to MT7572 )
Read this carefully & apply the way i say!
Take the ROM u want to port & name it PORT!
Take your Stock ROM & Name it Stock
Now Replace These files from Stock to PORT-:
system/vendor
system/usr
system/lib/modules
system/lib/hw
system/lib/libncurses.so
system/etc/firmware
system/etc/vold.fstab
system/etc/vold.fstab.nand
system/etc/bluetooth
Now Open build.prop in notepad++ & Search for this line
:
ro.mediatek.platform=MT65xx
Now Replace this (MT65xx) with your CPU!!
For Example
:
ro.mediatek.platform=MT6572
Now Go To META-INF/google/android and open updater-script in notepad++
Add this line between the lines of "set_perm"
:
set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.mt65xx.so");
[Replace the mt65xx with your cpu]
Example:
:
set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.mt6572.so");

Now Go back to the Rom folder and Take the boot.img and decompile it with any bo
otimg-unpack tool!
Now delete the zimage and rename boot.img-ramdisk to PORT-Ramdisk
Now Do the Same for Stock boot.img and open the folder named PORT-ramdisk and co
py all the fil PORT-[QUOTE]ramdisk to boot.img-ramdisk of your Stock boot.img
Now Go to boot.img-ramdisk and open init.rc
Now find these lines and replace with your cpu
:
#Create Chip Property
on early_property:ro.hardware=mt6582
setprop ro.mtk.hardware mt6589
on early_property:ro.hardware=mt6589
setprop ro.mtk.hardware mt6589

example :
:
#Create Chip Property
on early_property:ro.hardware=mt6582
setprop ro.mtk.hardware mt6572
on early_property:ro.hardware=mt6589
setprop ro.mtk.hardware mt6572

Now Compile your New boot.img and Pack your New ROM and Flash!!
Cheers!!!!
Porting Lewa OS5 ROM:
Replace These files from Stock to LeWa OS5 ROM
:
system/vendor
system/usr
system/lib/modules
system/lib/hw
system/etc/firmware
system/etc/vold.fstab
system/etc/vold.fstab.nand
system/etc/bluetooth
Replace Stock boot.img to Lewa OS5 ROM
Unpack boot.img
Open init.rc
Find these lines

:
on early_property:ro.build.type=user
write /proc/bootprof "INIT: user build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar
on early_property:ro.build.type=userdebug
write /proc/bootprof "INIT: userdebug build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar
on early_property:ro.build.type=eng
write /proc/bootprof "INIT: eng build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar

Now Add this line in the end of 1t and 3rd line


:/system/framework/lewa-framework.jar
Example:
:
on early_property:ro.build.type=user
write /proc/bootprof "INIT: user build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar:/system/framework/lewa-framework.ja
r
on early_property:ro.build.type=userdebug
write /proc/bootprof "INIT: userdebug build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor

k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar
on early_property:ro.build.type=eng
write /proc/bootprof "INIT: eng build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar:/system/
framework/lewa-framework.jar
Now Compile the new boot.img and Repack your New Lewa OS5 ROM
Porting MiUI ROM
Replace These files from Stock to MiUI ROM
:
system/vendor
system/usr
system/lib/modules
system/lib/hw
system/etc/firmware
system/etc/vold.fstab
system/etc/vold.fstab.nand
system/etc/bluetooth
Replace Stock boot.img to Lewa OS5 ROM
Unpack boot.img
Open init.rc
Find these lines
:
on early_property:ro.build.type=user
write /proc/bootprof "INIT: user build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar
on early_property:ro.build.type=userdebug
write /proc/bootprof "INIT: userdebug build setting"

export BOOTCLASSPATH /system/framework/core.jar:/system/framewor


k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar
on early_property:ro.build.type=eng
write /proc/bootprof "INIT: eng build setting"
export BOOTCLASSPATH /system/framework/core.jar:/system/framewor
k/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/s
ystem/framework/framework.jar:/system/framework/telephony-common.jar:/system/fra
mework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/ser
vices.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar
:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.
jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephonycommon.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar

Do the Same as Lewa and add this line in the end of 1st and 3rd line.
:
:/system/framework/miui-framework.jar
Compile the New Boot.img and Repack your new ROM and FLash!!
Cheers!!
Enjoy your New ROM and Give Credits to me for if I Helped you!
For Advanced Users:
PORTING FIX:
Framework:
decompile framework.jar
Go to
:
\smali\com\mediatek
Replace All Files from STOCK to this Folder
Now go to
:
\smali\com\android\server
Replace All Files from STOCK to this Folder
Compile framework.jar and Push to Device!

This Should FIX Bootloop, Mms.apk, Phone.apk, Settings.apk, Contacts.apk Force C


lose
Fixing Other Problems:
Files related to Specific hardware:
Replace if Not Working!!
Camrea:
:
\system\lib\libcamalgo.so
\system\lib\libmhaldrv.so
\system\lib\libcamera_client.so
\system\lib\libcameracustom.so
\system\lib\libcameraprofile.so
\system\lib\libcameraservice.so
GPS:
:
/system/xbin/libmnlp
Bluetooth & Wifi:
:
/system/lib/libbluetooth_mtk.so
/system/lib/libbluetoothem_mtk.so
Radio:
:
\system\lib\libaudio.a2dp.default.so
\system\lib\libaudio.primary.default.so
\system\lib\libaudiocompensationfilter.so
\system\lib\libaudiocustparam.so
\system\lib\libaudioeffect_jni.so
\system\lib\libaudioflinger.so
\system\lib\libaudiosetting.so
\system\lib\libfmar1000.so
\system\lib\libfmcust.so
\system\lib\libfmjni.so
\system\lib\libfmmt6616.so
\system\lib\libfmmt6620.so
\system\lib\libfmmt6626.so
\system\lib\libfmmt6628.so

For Fixing Wifi & FM-Radio do this!


(NOT NEEDED IN MT6572)
:

fmradio.driver.chip=1
(Change it to 3 if yours is MT6628)
:
mediatek.wlan.chip=MT6620
(Replace mediatek.wlan.chip=MT6620 to your WLAM Chip Type Ex: mediatek.wlan.chip
=MT6628 for MT6628)
:
mediatek.wlan.module.postfix=_mt6620
(Replace mediatek.wlan.module.postfix=_mt6620 to your WLAM Chip Type Ex: mediate
k.wlan.module.postfix=_mt6628 for MT6628)
Now open updater-script and Find this line or ADD a New one(If Not Found)!!
symlink("wlan_mt6620.ko", "/system/lib/modules/wlan.ko")
(Replace wlan_mt6620.ko to your WLAM Chip Type Ex: wlan_mt6628.ko for MT6628)

KitKat Porting Guide (By Tech N You @me) for same chipset porting MT6592 to MT65
92, MT6595 to MT6595, MT6589 to MT6589 (and all MT65xx device running kitkat)
Easiset guide I possibly can make.
Pre-requisite : PORT ROM should be same android version as BASE i.e both 4.4.x (
4.4.2, 4.4.3 or 4.4.4)
Let's begin
Extract both stock and port ROM in two new folders respectively named as stock a
nd port.
Files to replace from stock to port
/system/lib/modules folder (Delete port and use stock, If you d
on't see modules folders or don't see any file in it don't be alarmed it's ok, b
ut if you see modules in stock then copy it over to port ONLY IF PORT CONTAINS M
ODULES FOLDER TOO)
/system/lib/hw folder (use stock, delete port)
/system/lib/libaudioprimarydefault.so (copy from stock to port
and replace)
/system/lib/libaudiocompensationfilter.so (copy from stock to p
ort and replace)
/system/lib/libaudiocomponentengine.so (copy from stock to port
and replace)
/system/lib/libaudiocustparam.so (copy from stock to port and r
eplace)
/system/lib/libaudiosetting.so (copy from stock to port and rep
lace)
/system/lib/libaudioutils.so (copy from stock to port and repla
ce)
/system/lib/libMali.so (XOLO users ONLY, other may try if this
if your device is stuck on a black screen after device LOGO)

/system/lib/libcamdrv.so (copy from stock to port and replace)


/system/lib/libcameracustom.so (copy from stock to port and rep
lace)
/system/lib/libcameraservice.so (copy from stock to port and re
place)
/system/xbin/libmnlp_mt65xx (here "xx" is you device chipset li
ke MT6589 MT6592 etc)
/system/etc/firmware (delete port one and copy your's stock, DO
NT MERGE WITH PORT)
/system/etc/mddb (delete previous files inside it and copy your
stock)
/system/etc/bluetooth (use stock, delete port)
/system/bin/6620_launcher (copy from stock to port and replace
ONLY IF ROM IS SHOWING ERROR IN LOGCAT RELATED TO THIS FILE)
/system/bin/aee (copy from stock to port and replace ONLY IF RO
M IS SHOWING ERROR IN LOGCAT RELATED TO THIS FILE)
/system/boot.img (remove port ROM and use stock)
/system/vendor (Copy folder from stock and merge folder with po
rt, DONT DELETE ORIGINAL FOLDER FROM PORT)
Now open META-INF folder then com->android->google and open updater-script with
NOTEPAD++ ONLY
Remove whole lines contain assert word at the beginning of the file like this li
ne if exist
assert(getprop("ro.product.device") == "cancro" || getprop("ro.build.product") =
= "cancro");
Verify /system should be mounted in "/dev/block/mmcblk0pS" & /data should be mou
nted 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 there the mmcblkpx line that's your mount point edit it if port has diff
erent as of base
Basic MT6592 follow these linesChange accordingly these lines in updater-script to your chipset
format("ext4", "EMMC","/dev/block/mmcblk0p5", "0"); or format("ext4", "EMMC","/d
ev/block/mmcblk0p5");
mount("ext4", "EMMC","/dev/block/mmcblk0p5", "/system");
mount("ext4", "EMMC","/dev/block/mmcblk0p7", "/data");
Now save updater-script and exit
Go to Port ROM folder and select all the files i.e.*Data (if present)
*META-INF
*System
*boot.img
*and any other file if present too like check_data_app etc
If using WinRAR right click and choose Add to archive and choose "zip" as format
and set compression to "store" and zip the whole and flash via tool using adb c
ommand menu or via recovery by yourself. If using 7-zip file manager open 7-zip
file manager and go to port folder select "zip" format and compression to store
dont touch anything else!
Now after this if ROM doesn't boot then time to patch boot.img by using boot/rec
overy unpack option from tool.

After unpacking both stock and port boot.img copy "kernel" and "kernel_header" f
rom stock and paste and replace with port and pack the image
Now use this boot.img in ported ROM
Fixing Bugs (If you don't see your bug here go up and try to find it in Xterme O
RNOB's Guide)
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 "unfortunatel
y camera has stopped"
No success after the files replaced above then keep on replacing one file at a t
ime and check.
Camera problem is the one major bug in this type of porting. You have to have pa
tience. This will take half of your energy.
Replace all "libcam*.so" files from stock to port if even after trying these fil
es 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 ty

pe.
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 /u
sr folder.
TOUCH SCREEN PROBLEM
(Sometimes screen behaves weird ..means for example if you touch bottom left eff
ect 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 st
ock 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
ROM still not booting? Get logcat.txt from current device state using ADB menu c
ommands in tool and share with me on thread! I will try my best to help!
I took a lot of pain and effort in making this tool and these guides please don'
t just leech them.
Download and hit thanks in the thread rather than saying thanks.

Vous aimerez peut-être aussi