[Guide] Cyanogenmod 13 Porting for Mediatek MT6592 Devices - Miscellaneous Android Development

Guide to port Fire855's Cyanogenmod 13 to Mediatek Devices
Here I am posting guide how to port Fire855's Cyanogenmod 13 to Mediatek devices based on MT6592 SoC.
@fire855 Cyanogenmod 13 thread --> http://forum.xda-developers.com/android/development/rom-cyanogenmod-13-kingzone-k1-turbo-t3360336
Required Tools
Java Development Kit
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Dat File Extractor
https://goo.gl/NxNe97
Cygwin
https://goo.gl/uMvH7C
Android Kitchen
https://goo.gl/rMH3kX
Meta-Inf Folder
https://goo.gl/y2WZZI
Notepad++
https://notepad-plus-plus.org/download/
Extracting system.new.dat file from Fire855 build
- Use extractor
- First Extract fire855 build zip using Winrar or 7z software.
- Put following files in "place_for_supported_files_here" folder
- file_contexts
- system.new.dat
- system.patch.dat
- system.transfer.list
- Run Extraktor_En.cmd
- Type 1 and press enter
- Your files will be extracted in "extract_file_here" folder
- Now copy these files from "system.dat" in "system" folder of Fire855 build
- Delete ".jounal" file from "/system" folder
Before Porting
- Delete Meta-Inf folder from Fire855 build
- Delete "system.new.dat", "system.patch.dat", "system.transfer.list
- Replace it with the Meta-inf folder given above
- You will have these folder and files now
- Install
- Meta-inf
- System
- boot.img
- file_contexts
- Now compress these above files and folder in one standard zip format.
Setting up Android Kitchen and Extracting Boot.img
1. Extract the Cygwin. In this folder you will find another folder named cygwin_packages and a file named setup. Copy these to C :\cygwin (create a folder named cygwin if it doesn't exist)
2. Open the cygwin folder in C:
3. Now in cygwin folder right click on the setup.exe and Run as Administrator
4. Click Next and then select Install from Local Directory
5. Select the path to the cygwin folder in C: then click Next
6. Select the path to the cygwin_packages folder (C:\cygwin\cygwin_packages) then click Next
7. Click Next. A message will appear click OK
8. Single click in the area between the Red box
9. Click Next. A message will appear, click Next. After this, installation will take place. After the installation process is complete check / tick the Create icon on Desktop and click on Finish. After this Right click on the Cygwin desktop icon and Run as Administrator. Some processes will take place after the completion of the process, close it
10. Now open C Drive. In the drive you will find a folder named Cygwin, Open it
11. Now open the home folder. In this folder you will find another folder having your Username, open it
12. Don't delete any file. Make a new folder named Kitchen
13. Open the folder named Kitchen. Now extract the file named dsixda Android Kitchen that you copied on your computer's desktop, then open the extracted folder of dsixda Android Kitchen
14. Copy all the files that are in the extracted folder of dsixda Android Kitchen and paste them in the Kitchen folder that you made
15. Now do Right click on the Cygwin desktop icon and Run as Administrator
16. Cygwin window will open. Now type "cd kitchen" (without "") then press Enter
17. Now type "./menu" then press Enter
18. After this Android Kitchen will open
You're good to go!
(You can use pictorial guide given on (https://forum.hovatek.com/thread-647.html)
Files needs to be ported
In Boot.img
- zimage (simply your device kernel)
- uevented.rc (if only device get bootloops)
Lib files need to replace from your Stock ROM
From "/system/lib/hw" folder
- hwcomposer.mt6592.so
- sensors.default.so (first rename this file to sensors.mt6592.so and then copy it same location in Fire855 build)
From "system/lib" folder
- libMali.so
- libaudio.primary.defaults.so
- libcameracustom.so
- libfeatureio.so
- libcamdrv.so
- libcamalgo.so
- libdpframework.so
- libcamparamsmgr.so
From "system/bin" folder
- gsm0710muxd
- gsm0710muxdmd2
- rild
From "/system/etc" folder
- Bluetooth folder
- Wifi Folder
- Firmware Folder
Making changes in boot.img only for devices having Emulated storage
Note: (No need of change for Non-emulated storage devices)
Edit fstab file in ramdisk folder after extracting boot.img in Android Kitchen
Refer this post by @Typhus_ --> http://forum.xda-developers.com/showpost.php?p=66440098&postcount=228
Note : Edit system and data mount points according to your device in updater-script using Notepad++.

Unpack/Repack Boot.img using Android Kitchen
1) First you need to set up working folder.
2) Place the zip you have created from above instructions in Original_Update folder.
3) Type 1 and press enter.
4) Select zip.
5) No need to rename working folder.
6) Also when it asks to do changes in updater script, Type 2 and press Enter for "Do nothing" and keep updater script as it is.
7) Now working folder is set up.
8) Go to advanced settings. Type 0 and press Enter.
9) Then type 12 and press enter.
10) Then type "w" (without "") and press enter.
11) A folder will be creatred name Boot-Extracted.
12) Now type "a" (without "") and press enter.
13) A messege will appear and a new folder will create by name Boot-img(Date)(time)
14) Place your stock boot.img in it and then come back to cmd window and press enter.
15) Now replace necessary files from stock boot to boot-extracted (zimage, uevented.rc etc)
16) Make changes in fstab file and other related files (for devices having emulated storage)
17) After making all changes in android kitchen cmd window type "b" and press enter. This will compile boot.img and repack it and get saved in working folder.

You can use to MTKbootimg Tool to Unpack and Repack boot.img
Link --> https://goo.gl/6NJJVx

I think carliv image tool is much better to exctract boot and recovery.img. much better than kitchen

vickdu31 said:
I think carliv image tool is much better to exctract boot and recovery.img. much better than kitchen
Click to expand...
Click to collapse
not really. but that's just a subjective opinion, isnt it? its a lil bit harder but it worth

vickdu31 said:
I think carliv image tool is much better to exctract boot and recovery.img. much better than kitchen
Click to expand...
Click to collapse
Cata Versi said:
not really. but that's just a subjective opinion, isnt it? its a lil bit harder but it worth
Click to expand...
Click to collapse
bravonova said:
You can use to MTKbootimg Tool to Unpack and Repack boot.img
Link --> https://goo.gl/cHhCsZ
Click to expand...
Click to collapse
It depends on which tool we get easier to use. It can be vary person by person. I am using Android Kitchen for very long time and get used to it now.

I have only a bug after porting procedure: in video Facebook app there is a green vertical bar...
How can I solve?
Inviato dal mio Elephone P8000 utilizzando Tapatalk

stefano91av said:
I have only a bug after porting procedure: in video Facebook app there is a green vertical bar...
How can I solve?
Inviato dal mio Elephone P8000 utilizzando Tapatalk
Click to expand...
Click to collapse
Replace "gralloc.default.so" and "gralloc.mt6592.so" from "/system/lib/hw" folder

Google Maps Compass & video playback!
How do I fix compass on Google maps? Its arrowhead is stuck on one position and never rotates. Compass/magnetic sensor works on all other apps except for Google maps.
Also
I have issue with video playback. I cannot stream videos from certain apps such as SonyLiv. However hotstar works fine. Also I have green YouTube videos problem on only certain few videos(with certian quality say 360p and/or live videos).

bravonova said:
It depends on which tool we get easier to use. It can be vary person by person. I am using Android Kitchen for very long time and get used to it now.
Click to expand...
Click to collapse
I mean this one : http://forum.xda-developers.com/android/development/tool-cika-carliv-image-kitchen-android-t3013658
This is just way faster and easier ! And available on linux and windows

bravonova said:
Replace "gralloc.default.so" and "gralloc.mt6592.so" from "/system/lib/hw" folder
Click to expand...
Click to collapse
Thanks for the advice. I just tried it always turns out that problem .
Look at the picture ...

ivanmaria said:
How do I fix compass on Google maps? Its arrowhead is stuck on one position and never rotates. Compass/magnetic sensor works on all other apps except for Google maps.
Also
I have issue with video playback. I cannot stream videos from certain apps such as SonyLiv. However hotstar works fine. Also I have green YouTube videos problem on only certain few videos(with certian quality say 360p and/or live videos).
Click to expand...
Click to collapse
Copy sensors.defaults.so from stock rom. Rename it to sensors.mt6592.so and place it in /system/lib/hw folder.
Also add compass/magnetometer permission xml file from /system/etc/permissions to ported rom.
There is streaming issue in some apps.
Use youtube app given in second post of @fire855 CM 13 thread.

stefano91av said:
Thanks for the advice. I just tried it always turns out that problem .
Look at the picture ... /QUOTE]
Try this patch by @jpower73 it worked for me. I kept hwcomposer from stock.
Click to expand...
Click to collapse

ivanmaria said:
stefano91av said:
Thanks for the advice. I just tried it always turns out that problem .
Look at the picture ... /QUOTE]
Try this patch by @jpower73 it worked for me. I kept hwcomposer from stock.
Click to expand...
Click to collapse
Use these particular files to solve green line in FB videos. Copy and paste (replace old) in "/system/lib/hw" folder
Credits : @jpower73
Click to expand...
Click to collapse

bravonova said:
ivanmaria said:
Use these particular files to solve green line in FB videos. Copy and paste (replace old) in "/system/lib/hw" folder
Credits : @jpower73
Click to expand...
Click to collapse
Thanks so much. fantastic! :laugh::good:
Finally facebook operating at 100 % .
I noticed another problem ( see picture) : during charging the animation is wrong ... how can I solve?
Click to expand...
Click to collapse

stefano91av said:
bravonova said:
Thanks so much. fantastic! :laugh::good:
Finally facebook operating at 100 % .
I noticed another problem ( see picture) : during charging the animation is wrong ... how can I solve?
Click to expand...
Click to collapse
You need to change these files from stock rom.
From /system/lib folder
1) libipod.so
2) libshowlogo.so
From /system/bin folder
1) boot_logo_updater
2) ipod
3) logwrapper
Click to expand...
Click to collapse

bravonova said:
Copy sensors.defaults.so from stock rom. Rename it to sensors.mt6592.so and place it in /system/lib/hw folder.
Also add compass/magnetometer permission xml file from /system/etc/permissions to ported rom.
There is streaming issue in some apps.
Use youtube app given in second post of @fire855 CM 13 thread.
Click to expand...
Click to collapse
Google Maps Compass doesn't work yet!?

bravonova said:
stefano91av said:
You need to change these files from stock rom.
From /system/lib folder
1) libipod.so
2) libshowlogo.so
From /system/bin folder
1) boot_logo_updater
2) ipod
3) logwrapper
Click to expand...
Click to collapse
I just tried it, everything solved. Thanks again
Now I still get all rom in dayly use, looking for any bugs.
Click to expand...
Click to collapse

Nice Work Bro ? ..

Thanks guys,
There is, also, another patch fixing potentially BT connection issues with mi wrist smart bands and another one fixing wifi direct issues (both of them tested on cm12.1 from the Greek forum)
Also, in case you face low sound issues, you may try my gionee elife sound patch.
http://www.myphone.gr/forum/showthread.php?p=6549582#post6549582
Fully compatible with atmos, digital plus, audio fx, etc

Related

[GUIDE]How To Create A Custom Rom(noob friendly guide)

HERE IS A GUIDE FOR YOU ALL YOU CAN CREATE YOUR OWN ROM BY THIS SEXY METHOD.I AM NOT RESPONSIBLE FOR BRICKED DEVICES,DAMAGED DEVICES IF YOU BLAME ME I WILL LAUGH AT U.
Click to expand...
Click to collapse
Requirement to make a custom rom
*java jdk installed on your pc
*windows xp or 7.
*package given in download section
Who is this kitchen for ?
Those who are brand new to
creating custom ROMs and
want an easy place to start
learning
Those who just want to modify
shipped ROMs or someone
else's custom ROMs to their
liking
Those who are confused by all
those scripts and complex
commands required for
building and extracting
This is NOT a tool to
automatically turn you into a
full-fledged ROM developer.
ROM development normally
involves work from the ground
up and involves time , research
and patience .
Click to expand...
Click to collapse
PRESS THANKS IF YOU LIKE MY WORK
Kitchen setup guide
setting up android kitchen
1.download all the three link and unzip kitchen.rar and cywin package.
2.open cywin_package then open folder Now, you can see 3 icons, a read-
me,a setup, and a folder. Choose
the setup. Here You will choose
install from local directory. Next,
Navigate to the the folder of
extraction of cygwin and choose
the folder Cygwin_packages inside
the cygwin extraction folder. Wait
for some time. Then, You will come
across a list of file. Click the 2-
circle-arrows,untill, it displays
“install”
After the procedure is complete,
run the batch file cygwin.bat . Now, minimise
it and copy kitchen folder,
Keep it in some location where you have installed your cygwin package open home/ajay-Pc(in my case this is administrator name of my pc)kitchen
Now, open the batch file window
and type
cd C:\Kitchen
Wait for some time and then when
the location the changed, type
./menu
Click to expand...
Click to collapse
PRESS THANKS IF YOU LIKE MY WORK
GUIDE
now minimize the batch file and extract official rom and open pda there you will find system.img then extract it using magic iso or flash
the official stock rom using odin the take a nandroid backup u will get system.rfs.tar in your sd card extract it using magic iso then make a folder in called rom and open it. again create a folder called system and copy all data from system.rfs.tar which u have extracted(do drag and dropping).
Now copy meta-inf of any stock rom and copy and kernel to rom folder.
Now you will get two folder and one file in your rom folder zip the folder content and copy the file where you have installed cygwin/home/ajay/kitchen/original update folder.
now open command shell which you have minimized 1st create working folder then add root permission,deodex your rom.
and at last press 99 to build your rom..
note-if it ask you to change updater script to update script change it but dont forget to change it back to updater script.now you will get your rom in output folder copy it to your sd card flash it if error occur unzip the zip file and delete meta-inf and boot.img and again copy meta-inf of any rom and kernel to it and zip it..again flash the rom..
PRESS THANKS IF YOU LIKE MY WORK
Downloads
Downloads​
Link for cygwin click here :good:​link for kitchen click here :good:​link for magic iso click here :good:​
PRESS THANKS IF YOU LIKE MY WORK
CREDIT
credits
xda
dev of kitchen DSIXDA
me for boring guide
PRESS THANKS IF YOU LIKE MY WORK
gd 1 but think theirs many guide to teach how to cook rom from kitchen
amanmehta007 said:
gd 1 but think theirs many guide to teach how to cook rom from kitchen
Click to expand...
Click to collapse
many user asked for my help so i created this for them
gd
THE DEV OF KITCHEN IS DSIXDA U SHOULD MENTION HER NAME
bY
------------------------------------------------------------------------------SOMKLL---------------------------------------------------------------------------------------------------
Yes
yes i m Flasholic
I already have a guide for this.
Sent from my GT-S5360 using XDA

[GUIDE][MOD][KERNEL] Change Bootsplash Image

DISCLAIMER NOTE: I AND XDA IS NOT TO BE HELD RESPONSIBLE FOR ANY DAMAGES THAT YOUR PHONE MIGHT INCUR DURING THIS PROCESS, I HAVE TESTED IT IN MY BEST KNOWLEDGE TO WORK FOR OUR DEVICE BUT JUST TO BE SURE, PLEASE PERFORM ALL NECESSARY BACKUPS FOR THE PHONE TO PREVENT ANY DATA LOSS, IF YOU HAVE THE NEED TO DISAGREE AND/OR FAIL TO COMPLY JUST DON'T FLASH IT AND GET ON WITH YOUR LIVES
Click to expand...
Click to collapse
This is for editing the bootsplash: the image wich is displayed while kernel is loaded.
For example in Samsung devices is the image which comes between Samsung Logo and bootanimation.
This change is made in kernel, so if you want to include this in your ROM you must include the edited kernel with it.
Pre-requisites:
1.-Android Image Kitchen (DOWNOLAD)(THREAD)
2.-edit image on windows Tool modified by me (DOWNLOAD)(thanks to championswimmer for this)
3.-I recommend Photoshop or similar software for image editing (GIMP or Paint are ok)
4.-I recommend to enable the file extension visualization in Windows.
Let's start!
1.-Take the boot.img of the kernel that you want to use
2.-Extract Android Image Kitchen
3.-Extract edit-image-windows.zip
4.-Put boot.img in Android Image Kitchen folder
5.-Now go to cmd and navigate to Android Image Kitchen folder
6.-Type:
Code:
unpackimg boot.img
7.-Now open windows explorer and navigate to *\Android Image Kitchen\ramdisk, look for a *.rle file and copy it. Rebember the name of the .rle file, you'll need it later.
8.-Paste the rle on edit-image-windows folder
9.- Open cmd, navigate to edit-image-windows folder and type:
Code:
rle2png nameoftthrle.rle 000x000
Where I wrote nameoftthrle.rle write the name of your rle and where I wrote 000x000 write your phone's resolution.
Example: for me, I have a GT-S6500D wich has a 320x480 resolution and the name of my rle is GT-S6500.rle so I must write:
Code:
rle2png GT-S6500.rle 320x480
10.- Open the .png file which is now on edit-image-windows folder with your image edition sowtware (I recommend Photoshop) and made the changes you want. In my phone, is only displayed on black and white, so it's useless to enable color mode.
11.-When you finished editing go again to cmd and write:
Code:
png2rle nameofttherle.png
Where I wrote nameoftthrle.rle write the name of your png.
Example:
Code:
png2rle GT-S6500.rle.png
12.-Now you'll have a file called nameofyourrle.rle.png.rle witch is the modified rle
13.-Go to *\Android Image Kitchen\ramdisk and replace the rle with the new one witch is modified.
14.-Now go to cmd, navigate to Android Image Kitchen folder, and type:
Code:
repackimg
15.-Done! rename the image-new.img to boot.img and flash it!
Click to expand...
Click to collapse
PLEASE give me a thanks if you like my work
reserved
last one reserved
manu19thebest said:
This is for editing the bootsplash: the image wich is displayed while kernel is loaded.
For example in Samsung devices is the image which comes between Samsung Logo and bootanimation.
This change is made in kernel, so if you want to include this in your ROM you must include the edited kernel with it.
Pre-requisites:
1.-Android Image Kitchen (DOWNOLAD)(THREAD)
2.-edit image on windows Tool modified by me (DOWNLOAD)(thanks to championswimmer for this)
3.-I recommend Photoshop or similar software for image editing (GIMP or Paint are ok)
4.-I recommend to enable the file extension visualization in Windows.
Let's start!
PLEASE give me a thanks if you like my work
Click to expand...
Click to collapse
Nice work, wonder if it work on window64
You can now edit/split a ramdisk on your phone now. Apktool on android has boot.img/ramdisk editing functionality. And a whole bunch of others....
Download apktool on android from here:
http://code.google.com/p/apktool/downloads/list
Make sure you download the correct zip file for your phone... And the updated apk. Follow the installation guide the developer has posted.
Before you split the boot.img make sure you're running apktool on an ext4 filesystem. Move the boot.img to /cache/subfolder our something like that.... then you shouldn't have a problem.
EDIT:
If your ROM has SElinux integrated, make sure it's set to permissive before splitting the image file or you'll get sh-applet error.
Go into terminal emulator and type:
su
setenforce 0
Happy editing
_kohjun_ said:
Nice work, wonder if it work on window64
Click to expand...
Click to collapse
My Windows is 64 so yes
Enviado desde mi GT-S6500D usando Tapatalk 2
DexedrineXR said:
You can now edit/split a ramdisk on your phone now. Apktool on android has boot.img/ramdisk editing functionality. And a whole bunch of others....
Download apktool on android from here:
http://code.google.com/p/apktool/downloads/list
Make sure you download the correct zip file for your phone... And the updated apk. Follow the installation guide the developer has posted.
Before you split the boot.img make sure you're running apktool on an ext4 filesystem. Move the boot.img to /cache/subfolder our something like that.... then you shouldn't have a problem.
EDIT:
If your ROM has SElinux integrated, make sure it's set to permissive before splitting the image file or you'll get sh-applet error.
Go into terminal emulator and type:
su
setenforce 0
Happy editing
Click to expand...
Click to collapse
I prefer using pc, mobile isn't good for image editing and boot.img is kernel, so just a little pediting will be a brick for sure.
Enviado desde mi GT-S6500D usando Tapatalk 2
manudroid19 said:
My Windows is 64 so yes
Enviado desde mi GT-S6500D usando Tapatalk 2
Click to expand...
Click to collapse
and on x32 sys? it didnt worked for me. bootloop. anyway doing for the 2nd time now
Edit- it did worked. many thanks
So how do you put a modified kernel in a rom zip? I built a rom from source, and want to change the uninstalled kernel to my own. P.S I have a tool that does this and creates a flashable zip for you, if anyone wants it.
Great work!!!
Tried it on my SONY... - perfect! :good:
Thank you very much
Can you use an .elf or .sin file instead of .img?
I'm on cm12.1 and there aren't any rle files
im also on cm12.1 an no rle file
By using these tools Can I able to change my boot splash ( ASUS Boot logo) in my asus zenfone 5 ? If not, then please guide me so that i can change my ASUS BOOT LOGO with custom made boot logo.
Thanks in advance?
I can't help myself but this work looks very similar to @DooMLoRD work - even the script is almost the same. Only resolution variable added....
https://forum.xda-developers.com/showthread.php?t=1140406

{mtk} cross platform (chipsetrom porting

[align=center]{:4_106:}HELLO FOLKS,
I AM HERE TO INTRODUCE CROSS MTK PLATFORM MIUI ROM PORTING GUIDE
[/align]
WARNINGS :- THIS GUIDE IS ONLY FOR DEV, NOT FOR NEWBIES
Click to expand...
Click to collapse
[align=center]{:4_106:}MTK CROSS PLATFORM ROM PORTING GUIDE{:4_106:}
REQUIRMENTS:
1. FULLY KNOW MIUI ROM PORTING GUIDE (IF U DON'T KNOW TEACH URSELF USING @ANSUMAN GUIDE)
2. THIS GUIDE WILL WORK WITH SAME MTK GPU CHIPSET
(EXAMPLE: MT6582 <------>MT6592 (BOTH CHIPSET HAS MALI GPU),ETC )
3. BASE ROM (STOCK ROM) AND PORT ROM (MIUI ROM WHICH YOU GOING TO PORT FOR UR DEVICE) HAS SAME ANDROID SDK
(EXAMPLE: 4.2.x<---->4.2.x , 4.4.x<---->4.4.x ,ETC )
4. BRAIN AND EXPERT {:4_106:}
[align=center]LETS BEGIN THE GUIDE
1. MAKE 2 NEW FOLDER ON DESKTOP AND EXTRACT STOCK ROM IN 1ST FOLDER (NAME IT TO BASE),EXTRACT PORTING ROM TO 2ND FOLDER (NAME IT TO PORT)
2. OPEN BASE FOLDER >SYSTEM>BIN> COPY ALL BIN FILES TO
PORT FOLDER>SYSTEM>BIN> PASTE HERE AND REPLACE EXISTING FILES
3. OPEN BASE FOLDER >SYSTEM> LIB > COPY HW FOLDER,MODULE FOLDER (IF EXIST IN KK ),SOUNDFX FOLDER TO
PORT FOLDER >SYSTEM>LIB > PASTE HERE (FIRST DELETE HW,MODULE,SOUNDFX)
4. OPEN BASE FOLDER >SYSTEM> LIB> COPY ALL LIB FILES(.SO) TO
PORT FOLDER >SYSTEM>LIB > PASTE HERE AND REPLACE EXISTING FILES
5. OPEN MIUI ROM ZIP FILE IN WINRAR AND GO TO SYSTEM>LIB FOLDER> EXTRACT THIS FILE SOMEWHERE
>>libandroid_runtime.so
>>libandroid_servers.so
>>libandroidfw.so
>> libjavacore.so
>> libjavacrypto.so
(IMPORTANT FILES )
6. NOW COPY ABOVE STEPS 5 LIB FILE AND MOVE IT TO PORT FOLDER >LIB FOLDER> PASTE HERE AND REPLACE EXISTING FILES
7. OPEN MIUI ROM ZIP FILE IN WINRAR AND GO TO SYSTEM>LIB FOLDER> EXTRACT THIS FILE SOMEWHERE
>>libwebp_android.so
>>libwebrtc_audio_preprocessing.so
>>libwebviewchromium.so
>> libwebviewchromium_plat_support.so
(IMPORTANT FILES )
[backcolor=Black]
[backcolor=White]8. NOW COPY ABOVE STEPS 4 LIB FILE AND MOVE IT TO PORT FOLDER >[/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>LIB> PASTE HERE AND REPLACE EXISTING FILES
9. DELETE VENDOR FOLDER OF PORT AND PASTE FROM BASE FOLDER IN PORT FOLDER
10. CHANGE BOOTANIMATION IN PORT FOLDER>MEDIA FOLDER> HERE (ACC. TO YOUR SCREEN RESOLUTION)
11. GO TO PORT FOLDER>[/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>ETC > DELETE FIRMWARE, MDDB(SOME ROM NOT EXISTED,SO IF YOU ROM NOT PRESENT IGNORE IT)
AND PASTE ABOVE TWO FOLDER FROM BASE TO PORT>[/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>ETC> HERE
12. OPEN BASE FOLDER >[/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>ETC> COPY AUDIOEFFECT, AUDIOPOLICY, MEDIACODECS FILES TO
PORT FOLDER>ETC FOLDER> PASTE HERE AND REPLACE EXISTING FILES
13. NOW GO TO BASE> [/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>XBIN> COPY libmnlp_mt65xx(DIFF ACC TO CHIPSET LIKE MT6582,MT6592) FILE TO
PORT FOLDER>[/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>XBIN > PASTE HERE (DELETE PORT ROM'S libmnlp_mt65xx)
14. NOW COMES BOOT.IMG EDITING (USE KITCHEN OR ANYOTHER U PREFER)
>> EXTRACT BOTH BOOT.IMG (BASE AND PORT)
>> OPEN BASE BOOT>INIT.RC AND CAMPARE WITH PORT'S INIT.RC AND CHANGE BOOTCLASSPATH IF PRESENT
AND OTHER REGARDING THEMES ETC.
>> OPEN BASE BOOT>PROJECT.RC AND CAMPARE WITH PORT'S PROJECT.RC AND DO CHANGES WHICH IS EXTRA IN PORT
>> OPEN BASE BOOT>ENVIRONMENT.RC AND CAMPARE WITH PORT'S ENVIRONMENT.RC AND DO CHANGES WHICH IS EXTRA IN PORT (THIS IS ABSENT IN JB ,SO DON'T WORRY ABOUT IT)
>> PACK IT , COPY NEW BOOT.IMG AND PASTE ,REPLACE IN PORT FOLDER
15. NOW OPEN PORT FOLDER>[/backcolor][/backcolor][backcolor=Black][backcolor=White]SYSTEM>BUILD.PROP> AND CHANGE MT65xx TO UR CHIPSET ACC TO UR STOCK BUILD.PROP ,
ALSO WLAN LINE mT65xx TO UR CHIPSET ACC TO UR STOCK BUILD.PROP ,
16. OPEN META-INF>ANDROID>UPDATER-SCRIPT AS TEXT EDITIOR(IN NOTEPAD++ OR U PREFER ANY OTHER)
CHANGE MOUNTPOINT ACC. TO UR STOCK ROM'S UPDATER-SCRIPT[/backcolor]
[/backcolor]
[backcolor=White]ALSO THIS LINE --> symlink("wlan_mt65xx.ko", "/system/lib/modules/wlan.ko"); (MT65XX DEPEND ON UR STOCK ROM UPDATER-SCRIPT)
[/backcolor]
Click to expand...
Click to collapse
[backcolor=White]
SAVE IT
17. GO TO BASE> SYSTEM>FRAMEWORK>COPY SERVICES.JAR(MAKE SURE DEODEXED)
>> USING BASKMALI[/backcolor][backcolor=White][backcolor=White][backcolor=White].JAR[/backcolor][/backcolor] UNPACK IT (NAME AS S)
DO SAME WITH PORT>SYSTEM>FRAMEWORK>[/backcolor][backcolor=White][backcolor=White] SERVICES.JAR(MAKE SURE DEODEXED)[/backcolor][/backcolor]
[backcolor=White][backcolor=White][backcolor=White]>> USING BASKMALI[/backcolor][/backcolor][/backcolor][backcolor=White][backcolor=White][backcolor=White][backcolor=White][backcolor=White].JAR[/backcolor][/backcolor] UNPACK IT[/backcolor][/backcolor][/backcolor][backcolor=White][backcolor=White][backcolor=White][backcolor=White] (NAME AS CLASSOUT)
[/backcolor]
>>NOW OPEN [/backcolor][/backcolor][/backcolor][backcolor=White][backcolor=White][backcolor=White][backcolor=White]S FOLDER[/backcolor]>ANDROID>SERVER AND SEARCH OF THESE FILES
MOUNTSMALI** (U WILL GET LOTS OF FILE STARTING WITH MOUNT),COPY THESE FILES
AND PAST & REPLACE IN CLASSOUT FOLDER>ANDROID>SERVER>HERE
[/backcolor]>> PACK THE CLASSOUT FOLDER USING SMALI.JAR
> PUSH IN SERVICES.JAR(PORT) AND PASTE IN SAME LOCATION AS MENTIONED IN STEPS 17.
(IMPORTANT STEPS)
(IMPORTANT STEPS)
[/backcolor]18. GO TO PORT FOLDER ,DELETE UNWANTED STUFF LIKE, UBOOT.IMG ,SCATTER ETC
19. MAKE ZIP OF BOOT.IMG,SYSTEM,META-INF AND FLASH VIA UR CWM RECOVERY,TWRP ETC[/backcolor]
FAQ :
1. IS THIS REALLY WORKING ??
>> YES ,IT IS ( I PORTED MIUI V5 BASED ON KITKAT (BETA) FROM MT6592 TO MT6582
2. MAY I GET LOTS OF BUGS ??
>> YES U WILL GET BUGS BUT NOT MAJOR.....I FOUND BUGS OF SOME APPS FC....TAKE LOGCAT AND TRY TO FIX IT OR ASK HERE
NOTE : I AM NOT RESPONSIBLE OR MIUI FORUM...IF UR DEVICE GOT FEVER,DEAD,WAR ETC
CREDITS :
GOOGLE
MIUI FORUM
XDA
ANSUMAN GUIDE (HERE IS LINK : http://en.miui.com/thread-20482-1-1.html)
ME
[/align]
[/align]

[Guide] {MTK} CROSS PLATFORM (CHIPSET) ROM PORTING

HELLO FOLKS,
INTRODUCING A CROSS PLATFORM ROM PORTING GUIDE FOR MTK SOCs
Code:
[SIZE="4"][COLOR="Red"]NOTE : [/COLOR][/SIZE]THIS GUIDE HAS 6 PARTS, ONE FOR THE SYSTEM FOLDER CHANGES AND THE OTHER FOR THE BOOT.IMG MODIFICATIONS.
WARNINGS :-
1) THIS GUIDE IS INTENDED FOR DEVELOPERS ONLY.
2) NEWBIES MAY FIND IT COMPLICATED SO PLEASE DO NOT TRY THIS. (RESEARCH A LITTLE MORE BEFORE YOU TRY THIS)
MTK CROSS PLATFORM ROM PORTING GUIDE ​
REQUIRMENTS:
1. FULLY UNDERSTAND THE ROM PORTING GUIDE (PLEASE FOLLOW THE GUIDE FROM XDA.)
2. THIS GUIDE WILL ONLY WORK FOR MTK SOCs WITH THE SAME GPU.
(EXAMPLE: MT6582 <------>MT6592 (BOTH CHIPSETS HAVE MALI GPU)
3. BASE ROM (STOCK ROM) AND PORT ROM . SHOULD HAVE THE SAME ANDROID SDK LEVEL.
(EXAMPLE: 4.2.x<---->4.2.x , 4.4.x<---->4.4.x ,ETC )
4. A FULLY FUNCTIONING BRAIN AND EXPERTISE
LETS BEGIN :
PART 1 : SYSTEM FOLDER CHANGES
----------------------------------
1.
A) MAKE 2 NEW FOLDERS ON DESKTOP
B)EXTRACT THE STOCK ROM IN THE 1ST FOLDER (NAME IT AS BASE),
C)EXTRACT THE ROM YOU WANT TO PORT TO THE 2ND FOLDER (NAME IT AS PORT)
2.
A) OPEN BASE FOLDER >SYSTEM>BIN>
B) COPY ALL BIN FILES TO THE PORT FOLDER>SYSTEM>BIN> AND PASTE IT REPLACEING ANY EXISTING FILES
(DO NOT DELETE THE FILES THAT HAVE NOT BEEN REPLACED.)
3.
A) OPEN BASE FOLDER >SYSTEM> LIB >
B) COPY HW FOLDER,MODULE FOLDER (IF THIS EXISTS IN YOUR STOCK KK ROM ),SOUNDFX FOLDER TO THE PORT FOLDER >SYSTEM>LIB > PASTE HERE (REMEMBER TO DELETE THE HW,MODULE,SOUNDFX FOLDERS FIRST))
4.
A) OPEN BASE FOLDER >SYSTEM> LIB>
B) COPY ALL LIB FILES(.SO) TO THE PORT FOLDER >SYSTEM>LIB > PASTE HERE AND REPLACE EXISTING FILES
5.
A) OPEN ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B) EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
WE NEED ONLY THE FOLLWOING FILES FOR THE NEXT STEP.
>>libandroid_runtime.so
>>libandroid_servers.so
>>libandroidfw.so
>> libjavacore.so
>> libjavacrypto.so
6. COPY 5 LIBRARY FILES MENTIONED IN STEP 5 AND MOVE IT TO THE PORT FOLDER'S >LIB FOLDER> PASTE THERE AND REPLACE EXISTING FILES
7.
A) OPEN PORT ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B)EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
WE NEED ONLY THE FOLLWOING FILES FOR THE NEXT STEP.
>>libwebp_android.so
>>libwebrtc_audio_preprocessing.so
>>libwebviewchromium.so
>> libwebviewchromium_plat_support.so
(IMPORTANT FILES )
8. COPY THE 4 LIBRARY FILES MENTIONED IN STEP 7 AND MOVE IT TO THE PORT FOLDER'S >LIB FOLDER> PASTE THERE AND REPLACE EXISTING FILES
9. REPLACE THE VENDOR FOLDER IN THE PORT FOLDER WITH THE VENDOR FOLDER FROM THE BASE
10 CHANGE BOOTANIMATION IN THE PORT FOLDER>MEDIA FOLDER> (ACC. TO YOUR SCREEN RESOLUTION USE YOUR STOCK BOOTANIMATION IF YOU DONT HAVE A SIMILAR RESOLUTION BOOT ANIMATION FILE)
11.
A) OPEN THE PORT FOLDER>SYSTEM>ETC > ABD DELETE THE FOLLWOING
FIRMWARE,
MDDB(SOME ROMS MAY NOT HAVE THIS,SO IF YOUR ROM DOES NOT, IGNORE IT)
B) COPY THESE TWO FOLDERS FROM BASE TO PORT>SYSTEM>ETC>
12.
A) OPEN BASE FOLDER >SYSTEM>ETC>
B) COPY AUDIOEFFECT, AUDIOPOLICY, MEDIACODECS FILES TO PORT FOLDER>ETC FOLDER> PASTE THERE REPLACING EXISTING FILES
13.
A) OPEN THE BASE ROM FOLDER'S >SYSTEM>XBIN> FOLDER
B) COPY THE libmnlp_mt65xx(DIFF ACC TO CHIPSET LIKE MT6582,MT6592) FILE TO PORT FOLDER>SYSTEM>XBIN > PASTE IT THERE
C) DELETE PORT ROM'S libmnlp_mt65xx
########################################################################################
PART 2 : EDITING THE BOOT.IMG (CRITICAL)
14.
----------------------------------------------------------------------------------------
(USE DSIXDA'S KITCHEN/ MTK FIRMWARE ADAPTER OR ANY OTHER BOOT.IMG DECOMPILER/COMPILER OF YOUR CHOICE)
>> EXTRACT BOTH BOOT.IMG (BASE AND PORT)
>> OPEN BASE BOOT>INIT.RC AND COMPARE WITH PORT'S INIT.RC AND CHANGE BOOTCLASSPATH IF PRESENT
AND OTHER REGARDING THEMES ETC.
>> OPEN BASE BOOT>PROJECT.RC AND COMPARE IT WITH PORT'S PROJECT.RC AND DO CHANGES WHICH IS EXTRA IN PORT
>> OPEN BASE BOOT>ENVIRONMENT.RC AND COMPARE IT WITH PORT'S ENVIRONMENT.RC AND DO CHANGES WHICH IS EXTRA IN PORT (THIS IS ABSENT IN JB ,SO DON'T WORRY ABOUT IT)
>> PACK IT , COPY NEW BOOT.IMG AND PASTE ,REPLACE IN PORT FOLDER
########################################################################################
PART 3 : Build.prop
15.
A) NOW OPEN PORT FOLDER>SYSTEM>BUILD.PROP> AND CHANGE MT65xx TO YOUR CHIPSET ACC TO UR STOCK BUILD.PROP ,
B) ALSO THE WLAN LINE mT65xx TO UR CHIPSET ACC TO UR STOCK BUILD.PROP
++++++++++++++++++++++++++++++++++++++++++++
mediatek.wlan.chip=CONSYS_MT6582
mediatek.wlan.module.postfix=_consys_mt6582
++++++++++++++++++++++++++++++++++++++++++++
########################################################################################
PART 4: UPDATER-SCRIPT EDIT
16.
A) OPEN META-INF>ANDROID>UPDATER-SCRIPT AS TEXT EDITIOR(IN NOTEPAD++ OR U PREFER ANY OTHER)
B) CHANGE MOUNTPOINT ACC. TO UR STOCK ROM'S UPDATER-SCRIPT
C) ALSO THIS LINE --> symlink("wlan_mt65xx.ko", "/system/lib/modules/wlan.ko"); (MT65XX DEPEND ON UR STOCK ROM UPDATER-SCRIPT)
SAVE IT
########################################################################################
PART 5: FRAMEWORK EDIT
17.
A. GO TO BASE> SYSTEM>FRAMEWORK>COPY SERVICES.JAR(MAKE SURE DEODEXED)
>> USING BASKMALI.JAR UNPACK IT (NAME AS S)
B) DO THE SAME WITH PORT>SYSTEM>FRAMEWORK> SERVICES.JAR(MAKE SURE DEODEXED)
>> USING BASKMALI.JAR UNPACK IT (NAME AS CLASSOUT)
>>NOW OPEN THE S FOLDER>ANDROID>SERVER AND SEARCH OF THESE FILES
MOUNTSMALI** (U WILL GET LOTS OF FILE STARTING WITH MOUNT),COPY THESE FILES
PASTE & REPLACE IN THE CLASSOUT FOLDER>ANDROID>SERVER>HERE
>> PACK THE CLASSOUT FOLDER USING SMALI.JAR
> PUSH IN SERVICES.JAR(PORT) AND PASTE IN SAME LOCATION AS MENTIONED IN STEPS 17.
(IMPORTANT STEPS)
(IMPORTANT STEPS)
########################################################################################
Part 6: CLEANING UP
18. GO TO PORT FOLDER ,DELETE UNWANTED STUFF LIKE, UBOOT.IMG ,SCATTER ETC
########################################################################################
19. MAKE ZIP OF BOOT.IMG,SYSTEM,META-INF AND FLASH VIA UR CWM RECOVERY,TWRP ETC
FAQ :
1. DOES THIS REALLY WORK ?
>> YES ,IT DOES ( I PORTED A MIUI V5 BASED ON KITKAT (BETA),hive ui rom,samsung s5 FROM MT6592 TO MT6582 )
2. WIL I GET LOTS OF BUGS ?
>> YES, ALMOST CERTAINLY YOU WILL. MAY NOT BE MAJOR BUT I DID HAVE BUGS LIKE FCs FOR SOME APPS
NOTE : TAKE A LOGCAT AND TRY TO FIX IT OR ASK HERE
NOTE : PLEASE DO NOT HOLD ME OR THE XDA FORUM RESPONSIBLE FOR ANY DAMAGES CAUSED BY YOU.
IF YOUR DEVICES EXPLODES, GOES TO MARS, GIVES BIRTH TO A DRAGON, CAUSES WAR, MAKES AN OMLETTE OR GETS YOU MARRIED CONSIDER IT FATE AND LIVE WITH IT>
CREDITS :
GOOGLE
XDA
ME([email protected])
PART 1
STEP 3
is it base folder or port folder -to delete the hw , modules ,soundfx
i think it's port folder
correct it
Excellent guide
[email protected] said:
HELLO FOLKS,
INTRODUCING A CROSS PLATFORM ROM PORTING GUIDE FOR MTK SOCs
Code:
[SIZE="4"][COLOR="Red"]NOTE : [/COLOR][/SIZE]THIS GUIDE HAS 6 PARTS, ONE FOR THE SYSTEM FOLDER CHANGES AND THE OTHER FOR THE BOOT.IMG MODIFICATIONS.
WARNINGS :-
1) THIS GUIDE IS INTENDED FOR DEVELOPERS ONLY.
2) NEWBIES MAY FIND IT COMPLICATED SO PLEASE DO NOT TRY THIS. (RESEARCH A LITTLE MORE BEFORE YOU TRY THIS)
MTK CROSS PLATFORM ROM PORTING GUIDE ​
REQUIRMENTS:
1. FULLY UNDERSTAND THE ROM PORTING GUIDE (PLEASE FOLLOW THE GUIDE FROM XDA.)
2. THIS GUIDE WILL ONLY WORK FOR MTK SOCs WITH THE SAME GPU.
(EXAMPLE: MT6582 <------>MT6592 (BOTH CHIPSETS HAVE MALI GPU)
3. BASE ROM (STOCK ROM) AND PORT ROM . SHOULD HAVE THE SAME ANDROID SDK LEVEL.
(EXAMPLE: 4.2.x<---->4.2.x , 4.4.x<---->4.4.x ,ETC )
4. A FULLY FUNCTIONING BRAIN AND EXPERTISE
LETS BEGIN :
PART 1 : SYSTEM FOLDER CHANGES
----------------------------------
1.
A) MAKE 2 NEW FOLDERS ON DESKTOP
B)EXTRACT THE STOCK ROM IN THE 1ST FOLDER (NAME IT AS BASE),
C)EXTRACT THE ROM YOU WANT TO PORT TO THE 2ND FOLDER (NAME IT AS PORT)
2.
A) OPEN BASE FOLDER >SYSTEM>BIN>
B) COPY ALL BIN FILES TO THE PORT FOLDER>SYSTEM>BIN> AND PASTE IT REPLACEING ANY EXISTING FILES
(DO NOT DELETE THE FILES THAT HAVE NOT BEEN REPLACED.)
3.
A) OPEN BASE FOLDER >SYSTEM> LIB >
B) DELETE THE HW,MODULE,SOUNDFX FOLDERS
C) COPY HW FOLDER,MODULE FOLDER (IF THIS EXISTS IN YOUR STOCK KK ROM ),SOUNDFX FOLDER TO THE PORT FOLDER >SYSTEM>LIB > PASTE HERE (REMEMBER TO DELETE THE HW,MODULE,SOUNDFX FOLDERS FIRST))
4.
A) OPEN BASE FOLDER >SYSTEM> LIB>
B) COPY ALL LIB FILES(.SO) TO THE PORT FOLDER >SYSTEM>LIB > PASTE HERE AND REPLACE EXISTING FILES
5.
A) OPEN ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B) EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
WE NEED ONLY THE FOLLWOING FILES FOR THE NEXT STEP.
>>libandroid_runtime.so
>>libandroid_servers.so
>>libandroidfw.so
>> libjavacore.so
>> libjavacrypto.so
6. COPY 5 LIBRARY FILES MENTIONED IN STEP 5 AND MOVE IT TO THE PORT FOLDER'S >LIB FOLDER> PASTE THERE AND REPLACE EXISTING FILES
7.
A) OPEN PORT ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B)EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
WE NEED ONLY THE FOLLWOING FILES FOR THE NEXT STEP.
>>libwebp_android.so
>>libwebrtc_audio_preprocessing.so
>>libwebviewchromium.so
>> libwebviewchromium_plat_support.so
(IMPORTANT FILES )
8. COPY THE 4 LIBRARY FILES MENTIONED IN STEP 7 AND MOVE IT TO THE PORT FOLDER'S >LIB FOLDER> PASTE THERE AND REPLACE EXISTING FILES
9. REPLACE THE VENDOR FOLDER IN THE PORT FOLDER WITH THE VENDOR FOLDER FROM THE BASE
10 CHANGE BOOTANIMATION IN THE PORT FOLDER>MEDIA FOLDER> (ACC. TO YOUR SCREEN RESOLUTION USE YOUR STOCK BOOTANIMATION IF YOU DONT HAVE A SIMILAR RESOLUTION BOOT ANIMATION FILE)
11.
A) OPEN THE PORT FOLDER>SYSTEM>ETC > ABD DELETE THE FOLLWOING
FIRMWARE,
MDDB(SOME ROMS MAY NOT HAVE THIS,SO IF YOUR ROM DOES NOT, IGNORE IT)
B) COPY THESE TWO FOLDERS FROM BASE TO PORT>SYSTEM>ETC>
12.
A) OPEN BASE FOLDER >SYSTEM>ETC>
B) COPY AUDIOEFFECT, AUDIOPOLICY, MEDIACODECS FILES TO PORT FOLDER>ETC FOLDER> PASTE THERE REPLACING EXISTING FILES
13.
A) OPEN THE BASE ROM FOLDER'S >SYSTEM>XBIN> FOLDER
B) COPY THE libmnlp_mt65xx(DIFF ACC TO CHIPSET LIKE MT6582,MT6592) FILE TO PORT FOLDER>SYSTEM>XBIN > PASTE IT THERE
C) DELETE PORT ROM'S libmnlp_mt65xx
########################################################################################
PART 2 : EDITING THE BOOT.IMG (CRITICAL)
14.
----------------------------------------------------------------------------------------
(USE DSIXDA'S KITCHEN/ MTK FIRMWARE ADAPTER OR ANY OTHER BOOT.IMG DECOMPILER/COMPILER OF YOUR CHOICE)
>> EXTRACT BOTH BOOT.IMG (BASE AND PORT)
>> OPEN BASE BOOT>INIT.RC AND COMPARE WITH PORT'S INIT.RC AND CHANGE BOOTCLASSPATH IF PRESENT
AND OTHER REGARDING THEMES ETC.
>> OPEN BASE BOOT>PROJECT.RC AND COMPARE IT WITH PORT'S PROJECT.RC AND DO CHANGES WHICH IS EXTRA IN PORT
>> OPEN BASE BOOT>ENVIRONMENT.RC AND COMPARE IT WITH PORT'S ENVIRONMENT.RC AND DO CHANGES WHICH IS EXTRA IN PORT (THIS IS ABSENT IN JB ,SO DON'T WORRY ABOUT IT)
>> PACK IT , COPY NEW BOOT.IMG AND PASTE ,REPLACE IN PORT FOLDER
########################################################################################
PART 3 : Build.prop
15.
A) NOW OPEN PORT FOLDER>SYSTEM>BUILD.PROP> AND CHANGE MT65xx TO YOUR CHIPSET ACC TO UR STOCK BUILD.PROP ,
B) ALSO THE WLAN LINE mT65xx TO UR CHIPSET ACC TO UR STOCK BUILD.PROP
++++++++++++++++++++++++++++++++++++++++++++
mediatek.wlan.chip=CONSYS_MT6582
mediatek.wlan.module.postfix=_consys_mt6582
++++++++++++++++++++++++++++++++++++++++++++
########################################################################################
PART 4: UPDATER-SCRIPT EDIT
16.
A) OPEN META-INF>ANDROID>UPDATER-SCRIPT AS TEXT EDITIOR(IN NOTEPAD++ OR U PREFER ANY OTHER)
B) CHANGE MOUNTPOINT ACC. TO UR STOCK ROM'S UPDATER-SCRIPT
C) ALSO THIS LINE --> symlink("wlan_mt65xx.ko", "/system/lib/modules/wlan.ko"); (MT65XX DEPEND ON UR STOCK ROM UPDATER-SCRIPT)
SAVE IT
########################################################################################
PART 5: FRAMEWORK EDIT
17.
A. GO TO BASE> SYSTEM>FRAMEWORK>COPY SERVICES.JAR(MAKE SURE DEODEXED)
>> USING BASKMALI.JAR UNPACK IT (NAME AS S)
B) DO THE SAME WITH PORT>SYSTEM>FRAMEWORK> SERVICES.JAR(MAKE SURE DEODEXED)
>> USING BASKMALI.JAR UNPACK IT (NAME AS CLASSOUT)
>>NOW OPEN THE S FOLDER>ANDROID>SERVER AND SEARCH OF THESE FILES
MOUNTSMALI** (U WILL GET LOTS OF FILE STARTING WITH MOUNT),COPY THESE FILES
PASTE & REPLACE IN THE CLASSOUT FOLDER>ANDROID>SERVER>HERE
>> PACK THE CLASSOUT FOLDER USING SMALI.JAR
> PUSH IN SERVICES.JAR(PORT) AND PASTE IN SAME LOCATION AS MENTIONED IN STEPS 17.
(IMPORTANT STEPS)
(IMPORTANT STEPS)
########################################################################################
Part 6: CLEANING UP
18. GO TO PORT FOLDER ,DELETE UNWANTED STUFF LIKE, UBOOT.IMG ,SCATTER ETC
########################################################################################
19. MAKE ZIP OF BOOT.IMG,SYSTEM,META-INF AND FLASH VIA UR CWM RECOVERY,TWRP ETC
FAQ :
1. DOES THIS REALLY WORK ?
>> YES ,IT DOES ( I PORTED A MIUI V5 BASED ON KITKAT (BETA),hive ui rom,samsung s5 FROM MT6592 TO MT6582 )
2. WIL I GET LOTS OF BUGS ?
>> YES, ALMOST CERTAINLY YOU WILL. MAY NOT BE MAJOR BUT I DID HAVE BUGS LIKE FCs FOR SOME APPS
NOTE : TAKE A LOGCAT AND TRY TO FIX IT OR ASK HERE
NOTE : PLEASE DO NOT HOLD ME OR THE XDA FORUM RESPONSIBLE FOR ANY DAMAGES CAUSED BY YOU.
IF YOUR DEVICES EXPLODES, GOES TO MARS, GIVES BIRTH TO A DRAGON, CAUSES WAR, MAKES AN OMLETTE OR GETS YOU MARRIED CONSIDER IT FATE AND LIVE WITH IT>
CREDITS :
GOOGLE
XDA
ME([email protected])
Click to expand...
Click to collapse
Hey from which all chipsets can i port roms to my mt6577?? I hav ported frm mt6577 and a few from mt6589 with d help of other guides .. So can u plz tell frm which all can i port wid dis guide?
Papdya said:
Hey from which all chipsets can i port roms to my mt6577?? I hav ported frm mt6577 and a few from mt6589 with d help of other guides .. So can u plz tell frm which all can i port wid dis guide?
Click to expand...
Click to collapse
u can pick up any chipset make sure gpu company is same
Ok thanks.
In step 5:
5.
A) OPEN ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B) EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
Stock or port zip rom?
Thanks!
Worked well after first try. Thanks for this guide
Just one problem so far, My mt6592 Roms got an Power Saving feature for Cpu under Battery Tab in Settings. How can i port this?
Edit: I've looking more into this now, still no process. Really need some thoughts
Traace said:
Worked well after first try. Thanks for this guide
Just one problem so far, My mt6592 Roms got an Power Saving feature for Cpu under Battery Tab in Settings. How can i port this?
Edit: I've looking more into this now, still no process. Really need some thoughts
Click to expand...
Click to collapse
pm u... great to see u ...this guide worked well
what happens if i try do to this with a rom that is not MTK based?
what to do if GPU are differnt ?
that is port rom have mali nd stock have PowerVR
plz help
pepexzz said:
In step 5:
5.
A) OPEN ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B) EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
Stock or port zip rom?
Thanks!
Click to expand...
Click to collapse
Same question. Can you exp clearly for us this step? Thank.
toanlaptop said:
Same question. Can you exp clearly for us this step? Thank.
Click to expand...
Click to collapse
Steps 5 and 6 go together.
Extract the LIB folder of BASE ROM to anywhere you want. Then copy and replace the bolded files below to the PORT ROMs LIB folder.
5.
A) OPEN ROM ZIP FILE WITH WINRAR/WINZIP/7-ZIP/
B) EXTRACT THE LIB FOLDER (PRESENT INSIDE THE SYSTEM FOLDER)> INTO A SEPARATE FOLDER.
WE NEED ONLY THE FOLLWOING FILES FOR THE NEXT STEP.
>>libandroid_runtime.so
>>libandroid_servers.so
>>libandroidfw.so
>> libjavacore.so
>> libjavacrypto.so
6. COPY 5 LIBRARY FILES MENTIONED IN STEP 5 AND MOVE IT TO THE PORT FOLDER'S >LIB FOLDER> PASTE THERE AND REPLACE EXISTING FILES
Click to expand...
Click to collapse
theKramer said:
Steps 5 and 6 go together.
Extract the LIB folder of BASE ROM to anywhere you want. Then copy and replace the bolded files below to the PORT ROMs LIB folder.
Click to expand...
Click to collapse
Thank for your help. I'll try again. I've failure many time
toanlaptop said:
Thank for your help. I'll try again. I've failure many time
Click to expand...
Click to collapse
I havent done this myself. I am just helping to explain what the author wrote..
baksmali was not able to to unpack my stock services.jar then i changed the services.jar extension to .zip and when i opened it there was no classes.dex file inside it. is it ok if i take the services.jar from another rom which i ported successfully with no bugs ?
hey thanks
but after porting rom like this my stats bar is not showing :crying::crying::crying:
Nayeem Hossain said:
but after porting rom like this my stats bar is not showing :crying::crying::crying:
Click to expand...
Click to collapse
Patch systemui.
miuiv6 6582 problem
anyone knows how to fix swap storage in miui v6 in KK mt6582 ? the sdcard0 is phone storage and sdcard0 is memory card .. tnx
Tech N You said:
Patch systemui.
Click to expand...
Click to collapse
How to patch my system ui
would please tell me??
or any guide ???
---------- Post added at 10:45 AM ---------- Previous post was at 10:32 AM ----------
[email protected] said:
pm u... great to see u ...this guide worked well
Click to expand...
Click to collapse
this file is missing on my boot.img PROJECT.RC and ENVIRONMENT.RC
what to do??
lildhiel08 said:
anyone knows how to fix swap storage in miui v6 in KK mt6582 ? the sdcard0 is phone storage and sdcard0 is memory card .. tnx
Click to expand...
Click to collapse
From stock boot.img search for file init_nossd.rc or anyfile related to init then ssd and in boot of port do same open both with notepad++ and then from stock copy whole as it is and replace with port and repack boot.img and flash

[DEV] sdat2img 1.1 - img2sdat 1.7 ◦ Unpack/re-pack android DAT files

Introduction
You probably know already that starting from Android 5.x (Lollipop) compiled roms (aosp,cm,stock) are not compressed anymore the way they used to be on previous android versions. On previous versions all content inside /system folder that has to be extracted within our device was either uncompressed (simple /system folder inside our flashable zip) or compressed in a system.img file, which it is a ext4 compressed file; both of these, anyway, were readable and we could see all system files (app,framework, etc).
The problem comes in >=5.0 versions, this method is not used anymore. Why? Because roms started to be always larger, so it is necessary to compress them even more.
What does new Android zips (full roms, but also otas) contain?
New Android flashable zips are made this way:
boot.img (kernel)
file_contexts (selinux related)
META-INF (folder containing scripts)
system.new.dat (compressed /system partition)
system.patch.dat (for OTAs)
system.transfer.list (see explanation below)​
What does updater-script contains then?
The updater-script uses a brand new function: block_image_update(), this method basically decompresses necessary files inside the device. Let's study it.
From google git source code, if we go inside the new file /bootable/recovery/updater/blockimg.c, we find at the end of it the registration of the function block_image_update() as the method BlockImageUpdateFn() which starts at line 254. Here finally we find all information we need to know about the decompression of the .dat file(s). First file we analyze is system.transfer.list which Google tells us:
The transfer list is a text file containing commands to transfer data from one place to another on the target partition.
Click to expand...
Click to collapse
But what each line means?:
First line is the version number of the transfer list; 1 for android 5.0.x, 2 for android 5.1.x, 3 for android 6.0.x, 4 for android 7.x/8.x
Second line is the total number of blocks being written
Third line is how many stash entries are needed simultaneously (only on versions >= 2)
Fourth line is the maximum number of blocks that will be stashed simultaneously (only on versions >= 2)
Fifth line and subsequent lines are all individual transfer commands.
Click to expand...
Click to collapse
Ok, but how to decompress the system.new.dat file?
All instructions are below. sdat2img, rimg2sdat and img2sdat binaries are involved. Please read carefully step by step.
NOTE for OTAs
If you are looking on decompressing system.patch.dat file or .p files, therefore reproduce the patching system on your PC, check imgpatchtools out by @erfanoabdi.
You can use/modify these files and/or include them in your work as long as proper credits and a link to this thread are given.
If you have questions or problems write here
Are you building from source and want to revert to the old flashing method without DAT files?
Do this (thx @Elluel):
1 - Delete this line
2 - Make sure you have this commit
Thanks
- howellzhu & luxi78 - for initial source codes
- all contributors from github
Ubuntu
Ubuntu 64-bit - Guide
Step 1 - Decompressing = DAT (sparse data) -> EXT4 (raw image)
We're now using sdat2img binary, the usage is very simple (make sure you have python 2.7+ installed):
./sdat2img.py <transfer_list> <system_new_file> [system_img]​- <transfer_list> = input, system.transfer.list from rom zip
- <system_new_file> = input, system.new.dat from rom zip
- [system_img] = output ext4 raw image file
and a quick example:
./sdat2img.py system.transfer.list system.new.dat system.img​by running this command you will get as output the file my_new_system.img which is the raw ext4 image.​
Step 2 - Decompress EXT4 (raw image) -> OUTPUT folder -> Compress EXT4 (raw image)
Now we need to mount or ext4 raw image into an output folder so we can see apks/jars etc.
To do this we need to type this command:
sudo mount -t ext4 -o loop system.img output/​As you can see there is a new folder called output which we can edit/modify/delete your files (not able to? see here)
Now we need to compress it back to a raw ext4 image, to do this we need the make_ext4fs binary. Make sure you have the file_contexts file (taken from the Rom zip) inside the make_ext4fs path. Then type this (got issues? see here)
./make_ext4fs -T 0 -S file_contexts -l 1073741824 -a system system_new.img output/​You will get the new raw ext4 image called 'system_new.img' ready for the next step.​
Step 3 - Converting = EXT4 (raw image) -> IMG (sparse image)
Now we need to convert the ext4 raw image into a sparse image. For this you need img2simg binary you can find here (thx to @A.S._id).
The usage is simple:
img2simg <raw_image_file> <sparse_image_file>​Pretty self-explanatory, the output will be a new sparse image (.img).​
Step 4 - Converting = IMG (sparse image) -> DAT (sparse data)
Now we need the img2sdat binary, the usage is very simple (make sure you have python 2.7+ installed):
./img2sdat.py <system_img>​- <system_img> = name of input sparse image file (from step 3)
As you can see the output is composed by system.transfer.list, (system.patch.dat) & system.new.dat, ready to be replaced inside your Rom zip.​
DOWNLOADs
sdat2img.py
- github.com
make_ext4fs
- mega.co.nz
img2sdat.py
- github.com
Source - Changelog
sdat2img
Repo: https://github.com/xpirt/sdat2img
Changelog: https://github.com/xpirt/sdat2img/commits/master
Source: https://github.com/xpirt/sdat2img/blob/master/sdat2img.py
img2sdat
Repo: https://github.com/xpirt/img2sdat
Changelog: https://github.com/xpirt/img2sdat/commits/master
Source: https://github.com/xpirt/img2sdat/blob/master/img2sdat.py
Windows
Windows 32/64 bit - Guide
Step 1 - Decompressing = DAT (sparse data) -> EXT4 (raw image)
We're now using sdat2img.py binary, the usage is very simple (make sure you have python 3.x installed):
sdat2img.py <transfer_list> <system_new_file> <system_ext4>​- <transfer_list> = input, system.transfer.list from rom zip
- <system_new_file> = input, system.new.dat from rom zip
- <system_ext4> = output ext4 raw image file
and a quick example:
sdat2img.py system.transfer.list system.new.dat system.img​by running this command you will get as output the file my_new_system.img which is the raw ext4 image.​
Step 2 - Decompress EXT4 (raw image) -> OUTPUT folder -> Compress EXT4 (raw image)
Now you should either move to Ubuntu x64/x86 or follow the 2nd step from the Ubuntu guide on cygwin 32 bit.​
Step 3 - Converting = EXT4 (raw image) -> IMG (sparse image)
Now we need to convert the ext4 raw image into a sparse image. For this you need img2simg binary you can find here (thx to @A.S._id).
The usage is simple:
img2simg.exe <raw_image_file> <sparse_image_file>​Pretty self-explanatory, the output will be a new sparse image (.img).​
Step 4 - Converting = IMG (sparse image) -> DAT (sparse data)
Now we need the img2sdat binary, the usage is very simple (make sure you have python 2.7+ installed):
img2sdat.py <system_img>​- <system_img> = name of input sparse image file (from step 3)
As you can see the output is composed by system.transfer.list, (system.patch.dat) & system.new.dat, ready to be replaced inside your Rom zip.​
DOWNLOADs
sdat2img.py
- github.com
make_ext4fs
- mega.co.nz
img2sdat.py
- github.com
Is there any tool to browse (and/or manipulate) these .dat files in Windows?
01 Vlatce said:
Is there any tool to browse (and/or manipulate) these .dat files in Windows?
Click to expand...
Click to collapse
i don't think so, though you can install ubuntu in a virtual machine as 64-bit and decompress there without problems.
edit: windows binaries added to OP.
xpirt said:
i don't think so, though you can install ubuntu in a virtual machine as 64-bit and decompress there without problems.
Click to expand...
Click to collapse
I found one, Ext2Explore, it can browse and extract lollipop .dat files
01 Vlatce said:
I found one, Ext2Explore, it can browse and extract lollipop .dat files
Click to expand...
Click to collapse
Can you explain how to work in more detail ? Thanks.
chihliouma said:
Can you explain how to work in more detail ? Thanks.
Click to expand...
Click to collapse
With that application you can open the system.new.dat file like a zip archive
Sent from my Nexus 5
xpirt said:
i don't think so, though you can install ubuntu in a virtual machine as 64-bit and decompress there without problems.
Click to expand...
Click to collapse
01 Vlatce said:
I found one, Ext2Explore, it can browse and extract lollipop .dat files
Click to expand...
Click to collapse
Confirmed.
Works perfectly..
Thanks a lot! This will save a lot of time theming.. (pulling the system, settings, framework without having to flash the rom first)
Oh, just for s&g's i extracted ("decompiled") the system.new file, the files (app, prive-app, framework, media, etc) all got placed on my desktop -- i deleted the system.new file from the rom -- i then placed the folders and files that got extracted and placed them in the rom -- i flashed it -- it booted! lol.. didnt think it would... but anyways, there's that.
For those who want to try:
--- > its basically self explanatory.
- once downloaded (the link above) extract the contents from the zip (i just went ahead and extracted to my desktop)
- right click the linux penguin
- run as administrator - the window will pop up
- go to file > open image > find your system.new image (should already be extracted from the rom and placed on your desktop)
- click open
- you should now see your image (or path) in the windows -- double click them (i doubled clicked both the right and left side)
- now you should be able to see all the folders
---> if you want to extract those folders
- just go up to the top
- click save and choose an extraction (i chose Desktop)
Hoped i helped -- any questions or confusion, dont be shy to ask -- i probably went too fast, idk lol
Enjoy!
Incredible_Culp said:
Confirmed.
Works perfectly..
Thanks a lot! This will save a lot of time theming.. (pulling the system, settings, framework without having to flash the rom first)
Oh, just for s&g's i extracted ("decompiled") the system.new file, the files (app, prive-app, framework, media, etc) all got placed on my desktop -- i deleted the system.new file from the rom -- i then placed the folders and files that got extracted and placed them in the rom -- i flashed it -- it booted! lol.. didnt think it would... but anyways, there's that.
For those who want to try:
--- > its basically self explanatory.
- once downloaded (the link above) extract the contents from the zip (i just went ahead and extracted to my desktop)
- right click the linux penguin
- run as administrator - the window will pop up
- go to file > open image > find your system.new image (should already be extracted from the rom and placed on your desktop)
- click open
- you should now see your image (or path) in the windows -- double click them (i doubled clicked both the right and left side)
- now you should be able to see all the folders
---> if you want to extract those folders
- just go up to the top
- click save and choose an extraction (i chose Desktop)
Hoped i helped -- any questions or confusion, dont be shy to ask -- i probably went too fast, idk lol
Enjoy!
Click to expand...
Click to collapse
I can't get this to work at all. I'm using Win 7 Pro and I've actually used this app before with stock Nexus 7 factory images and it worked fine.. What file did you actually download? I d/l 2 different versions, one was beta 2.0 and the other was a zip that said 2.2.71 but the about on the exe says 2.1, which is the version I've been using for quite a while.
With the beta 2.0, there's not even an option to open a file and with the 2.1, it errors out every time. After opening system.new.dat image and double clicking, it just hangs and the program stops responding. If I try clicking on it and selecting save, it allows me to select a folder to save it in but I just get a dialog box that says saving files and then hangs at 24% every time, finally crashing with a Microsoft C++ runtime error.
Oh btw, you didn't go too fast LOL, this is really a simple app to use but it's just not working for me with these block image files. Maybe I'm missing something but it's got me scratching my head. :laugh: If you have any ideas, I'm all ears.
Thanks,
Mike T
webdroidmt said:
I can't get this to work at all. I'm using Win 7 Pro and I've actually used this app before with stock Nexus 7 factory images and it worked fine.. What file did you actually download? I d/l 2 different versions, one was beta 2.0 and the other was a zip that said 2.2.71 but the about on the exe says 2.1, which is the version I've been using for quite a while.
With the beta 2.0, there's not even an option to open a file and with the 2.1, it errors out every time. After opening system.new.dat image and double clicking, it just hangs and the program stops responding. If I try clicking on it and selecting save, it allows me to select a folder to save it in but I just get a dialog box that says saving files and then hangs at 24% every time, finally crashing with a Microsoft C++ runtime error.
Oh btw, you didn't go too fast LOL, this is really a simple app to use but it's just not working for me with these block image files. Maybe I'm missing something but it's got me scratching my head. :laugh: If you have any ideas, I'm all ears.
Thanks,
Mike T
Click to expand...
Click to collapse
hmm interesting..
im using windows 8.1
idk how much help i can be because i just downloded the first option (provided by the link above) and went from there.
like you said, theres two.. the .exe and the .zip.. i downloaded the .exe
Incredible_Culp said:
hmm interesting..
im using windows 8.1
idk how much help i can be because i just downloded the first option (provided by the link above) and went from there.
like you said, theres two.. the .exe and the .zip.. i downloaded the .exe
Click to expand...
Click to collapse
So, did you d/l the zip that was modified 2006-8-26, which is version 2.0 beta, or did you click the link which said download latest release?
Mike T
webdroidmt said:
So, did you d/l the zip that was modified 2006-8-26, which is version 2.0 beta, or did you click the link which said download latest release?
Mike T
Click to expand...
Click to collapse
ha! didnt even see there was a latest release..
i downloaded the 2006-8-26 apparently -- didnt even look at that date either LOL
i dont want to try the latest now -- this one works fine for me lmao -- dont want to ruin it.. ah, screw it, im downloading the latest now
EDIT: Ok, i lied.. i just checked my trash.. i did download the lastest release .zip .. the 2271..
@webdroidmt @Incredible_Culp Download from here lol: http://sourceforge.net/projects/ext2read/
Maybe something with my PC setup or Win 7 because the 2006-8-26 version doesn't even give me an option for opening a file image. It actually loads up looking like an incomplete application, it's also a very small filesize. Did you just d/l the ext2explore exe, or did you also d/l ext2read2 beta zip?
Mike T
webdroidmt said:
Maybe something with my PC setup or Win 7 because the 2006-8-26 version doesn't even give me an option for opening a file image. It actually loads up looking like an incomplete application, it's also a very small filesize. Did you just d/l the ext2explore exe, or did you also d/l ext2read2 beta zip?
Mike T
Click to expand...
Click to collapse
Use the download link in the above post and click the green download button, and it should be the correct version, from 2012 rather than 2006.
Lethargy said:
@webdroidmt @Incredible_Culp Download from here lol: http://sourceforge.net/projects/ext2read/
Click to expand...
Click to collapse
That's the one I've been using for quite some time. As mentioned in my previous post, the system.new.dat file just "appears" to be saving but hangs at 24%, then eventually crashes. I'm stumped, should be so easy but it doesn't want to cooperate. LOL
Thanks anyway,
Mike T
webdroidmt said:
That's the one I've been using for quite some time. As mentioned in my previous post, the system.new.dat files just "appear" to be saving but hangs at 24%, then eventually crashes. I'm stumped, should be so easy but it doesn't want to cooperate. LOL
Thanks anyway,
Mike T
Click to expand...
Click to collapse
Weird. Try redownloading the ROM you're trying to extract?
Lethargy said:
Use the download link in the above post and click the green download button, and it should be the correct version, from 2012 rather than 2006.
Click to expand...
Click to collapse
Thanks for trying guys, that is exactly the one I've been using. I downloaded it again a few seconds ago and still getting the same result. :laugh:
Thanks.
Mike T
---------- Post added at 01:09 AM ---------- Previous post was at 01:08 AM ----------
Lethargy said:
Weird. Try redownloading the ROM you're trying to extract?
Click to expand...
Click to collapse
I've actually tried with images from 3 different roms and they all give me the same result. It's cool, I just won't be able to play around as much as I used to porting stuff.
Mike T
---------- Post added at 01:15 AM ---------- Previous post was at 01:09 AM ----------
Lethargy said:
Weird. Try redownloading the ROM you're trying to extract?
Click to expand...
Click to collapse
Just curious, you guys aren't changing the file extension to something other than .dat, right?
Mike T

Categories

Resources