yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] Nasheich Xfiles:
Hello XDA members, in this guide, i'll give you the easiest way to porting rom for your device, i've broken my porting record by ported 5 roms in less than 1 hour using this method, have enjoy and hope it'll works for you too :)

What you need ?

- Rom base (CM or AOSP)

- Rom port (any roms that you like to port)

- Apktool (for compiling .apk and .jar files)

- Note++ (for editing .txt and .xml files)

- Winrar or 7zip (for extracting and repacking rom)

- dsixda's Android Kitchen, you really need this to Port MIUI, PAC, and Slimrom

- Open mind and never give up to trying ;)

Rules

1. Find the rom port with similar CPU like your device, clock speed doesn't matter here, the important is the number of CPU Cores, if your device is single core, find the single core rom, dual-core with dual-core, etc

2. Forget about screen sizes(4, 5, or 7 inci), the important is screen DPI(pixels destiny) you can port rom from tablet or devices that have bigger/smaller screen sizes

example

> LDPI & LDPI

> MDPI & MDPI

> HDPI & HDPI

> xHDPI & xHDPI

> etc

3. Same Android SDK version(Check in build.prop)

Example, you can port Android 4.4.3 using Android 4.4.2

4. GSM and GSM, CDMA and CDMA

Step by step

Extract booth of the roms(rom base and rom port)

> In rom port folder <

1. Delete all files and folders except "system" folder

2. Delete these folders and files in system

> tts

> usr

> vendor

> build.prop

3. Delete these folders in system/etc

> Bluetooth

> Firmware (if exist)

> Wifi

4. Delete these folders in system/lib

> hw

> modules

5. Go to system/framework

> Open framework-res.apk

> Go to res/xml

> Replace storage-list.xml with your rom base

> In rom base folder <

1. Copy all files and folders except "system" to rom port folder

2. Copy these folders and files in system folder to rom port system folder

> tts

> usr

> vendor

> build.prop

3. Copy these folders in system/etc to rom port system/etc

> Bluetooth

> Firmware (if exist)

> Wifi

4. Copy these folders in system/lib to rom port system/lib

> hw

> modules

Repack the rom then flash it in the recovery

Now the rom port should booted(to menu) now, not stuck on bootanimation anymore :p

if you still stuck on bootanimation, check bootclasspath in boot.img, unpack it, and check in "init.environ.rc", use note++ to edit it, there's must be something miss there ;)

If the rom doesn't boot to menu or stuck on manufacturer logo(LG, Sony, Samsung, etc), find the same rom port from other devices. I've this experience while porting Liquid Smooth, then i used other devices and it's booted :D

Notes :

If you successful ported the rom, please do these before your releasing your ROM

> Ask the permission from the developers of the rom base and rom port

> Give credit for them

> And give credit for me too if you using this guide :p

> And don't forget to hit THANKS button ;)

For porting MIUI Kitkat, you need to unpack boot.img from both roms, then do these

- Copy paste init.miui.rc from rom port to rom base ramdisk folder

- Open init.rc from both roms, then compare it, there's some line you need to be edited...
[Sony Cross-Device General] Nasheich Xfiles:
Troubleshooting

Now, to fix some issues in rom port, do these...

1. Information about rom

Open build.prop from booth of the rom then edit information just like the rom port

You can edit these lines in build.prop

# begin build properties

# autogenerated by buildinfo.sh

ro.build.display.id=

ro.build.date=

ro.build.user=

ro.build.host=

ro.product.name=

ro.product.locale.language=

ro.product.locale.region=

ro.cm.device=

# end build properties

#

# ADDITIONAL_BUILD_PROPERTIES

#

persist.sys.root_access=

ro.modversion= > replace with rom port

ro.cm.version= > you can delete this

ro.config.ringtone=

ro.config.notification_sound=

ro.config.alarm_alert=

ro.sf.lcd_density=

and the other lines relating information about rom

2. RIL

Replace these files in rom port with your rom base files

system/bin/rild

system/lib/libreference-ril.so

system/lib/libril.so

system/lib/librilutils.so

system/lib/libsec-ril.so

system/lib/libsecril-client.so

And add any files with "ril" in the name of file

3. Sensor

Replace these files in rom port with your rom base files

system/bin/sensord

system/bin/sensorservice

system/lib/libsensorservice.so

system/lib/libhardware.so

system/lib/libhardware_legacy.so

4. WiFi

Replace these files in rom port with your rom base files

system/bin/wifimac

system/bin/wpa_cli

system/bin/wpa_supplicant

system/lib/libwpa_client.so

5. Missing files

You have to copy the rest of files in base rom to port rom to make rom better, but don't replace it if the files/folders was exist

6. Files can be replace in your ported rom using files from base rom

Bin

>adb

>dalvikvm

>debuggerd

>dhcpcd

>dnsmasq

>drmserver

>gdbserver

>glgps

>hostapd

>hostapd_cli

>ime

>ip

>ip6tables

>iptables

>logcat

>logwrapper

>media

>mediaserver

>mtpd

>ndc

>netcfg

>netd

>ntfs-3g

>ping

>ping6

>pppd

>radiooptions

>rild

>screenshot

>sdcard

>sensord

>sensorservice

>service

>servicemanager

>toolbox

>vdc

>vold

>wifimac

>wpa_cli

>wpa_supplicant

Lib

>lge-ril.so (for LG devices)

>libbluetooth_jni.so

>libbt-hci.so

>libbt-utils.so

>libhardware.so

>libhardware_legacy.so

>liblgehdmi.so

>libnfc.so

>libnfc_jni.so

>libnfc_ndef.so

>libreference-ril.so

>libril.so

>librilutils.so

>libsensorservice.so

>libwpa_client.so

>

>

7. Video streaming

> libstagefright.so

and all libs with "libstagefright" of the lib's name
[Sony Cross-Device General] Nasheich Xfiles:
Rom that can be ported

What roms can be ported using this guide ?

This guide should can port any costum roms base on AOSP or CM, not manufacturer roms, not yet...

My experience, I've ported these roms

Mokee Open Source Project

Carbon Rom

Paranoid Android

Xperience

SDK NX v1

AOKP

Hellfire

Codename Lungo

AOSB Project

OMNI Rom

SlimKat

PAC man

SOKP

AICP

MIUI V5 Kitkat

Rom ported by XDA Members using this guide

- Liquid Smooth

Bonus :

Need Aroma Installer on your rom ?

please go to this thread
[Sony Cross-Device General] Nasheich Xfiles:
If this guide helping you, please do these

> Donate to me

> Hit my THANKS button

> Rate the thread

> Poll the thread

> Hit "Tip us" ? to make this thread on portal, so many people will know it the easiest way to porting any costum rom

> Mention me (@Nasheich Xfiles) at your rom thread

> Keep this thread at first page with your posting

> Like this thread at Facebook, Google+ and Twitter

Best Regards

Nasheich
[Sony Cross-Device General] Nasheich Xfiles:
Credits

> Nasheich Xfiles : it's me :p

>ZduneX25
[Sony Cross-Device General] NewBieSS:
Very nice bro :good::good::good:
[Sony Cross-Device General] Sangeet007:
Thanks for this Awesome Guide :D

Will Try and let u know ;)
[Sony Cross-Device General] royalva:
Great guide.. is there a way we can get Tmobile Z1S stock rom (with wifi calling) to Z ultra? I am ready to do it myself with some guidance.
[Sony Cross-Device General] Aaskereija:
Great guide, ported a hellkat rom with it
[Sony Cross-Device General] D-SHEL:
Thanks for the guide but it's more interesting to port KitKat (4.4.x) to Jelly Bean (4.3.x), like Xperia ZR 4.4 ROM to Xperia SP with only 4.3 available. It's Qualcomm, many things possible with it. Any ideas?
[Sony Cross-Device General] Black_Eyes:
No You can't

Try using AOSP binaries (4.4) to port ZR 4.4 Rom

Sent from a Beast :')

---------- Post added at 04:57 AM ---------- Previous post was at 04:54 AM ----------

Rules

1. Find the rom port with similar CPU like your device, clock speed doesn't matter here, the important is the number of CPU Cores, if your device is single core, find the single core rom, dual-core with dual-core, etc

2. Forget about screen sizes(4, 5, or 7 inci), the important is screen DPI(pixels destiny) you can port rom from tablet or devices that have bigger/smaller screen sizes

example

> LDPI & LDPI

> MDPI & MDPI

> HDPI & HDPI

> xHDPI & xHDPI

> etc

In fact you can PORT Custom Roms from an HDPI Device to MDPI Device if they shares the same CPU core :rolleyes:

Sent from a Beast :')
[Sony Cross-Device General] nisu4717:
Can I port 4.4.2 lg optimus l9 ii using 4.4.3 pure aosp.
[Sony Cross-Device General] pepitoff:
Is it possible to port XperiaOverlay ROM for Arc S (LT18i) to any build of CM11 LX ROM for Arc S with this guide?!?! :confused:

XperiaOverlay ROM is AOSP based but I think that XeperiaOverlay will running better if it is merged to CM11 LX...

Thanks in advance for all suggestions! :good:
[Sony Cross-Device General] MT27i:
Haish, AOSP is smoother than CM11 because it's not modified (Pure android).

Btw, you can't get anything diffirent if you rebased overlay to CM11
[Sony Cross-Device General] pepitoff:
OK. But is it possible to port XperiaOverlay to CM11 LX with this guide?
[Sony Cross-Device General] Black_Eyes:
It's Kinda Possible !!

But Chances are 40-45%

Since XO uses AOSP binaries ;)
[Sony Cross-Device General] Nasheich Xfiles:
Yes, let me know, I'll do my best to help you

just try it, and let me kbow

Nice :)

no, you can't, different files system between JB and KK

Yes, you can port lower LCD destiny and Lower CPU too, i just make a simple explanation

yes, you can, I've ported many rom base on AOSP, and you can ported 4.4.2 using 4.4.3, cause it has same Android SDK version (check on build.prop)

Yes, there's always possibility to port any rom, cause the fact is 80% of Android files is same ..
[Sony Cross-Device General] allinkiran:
Sorry if this sounds idiotic, but can I port SOKP from nexus 5 to xperia z1 using this method since they share the same chipset?
[Sony Cross-Device General] Nasheich Xfiles:
yes, you can, if the specification of the hardware just like what I've wrote, not just the same chipset, but RAM too
[Sony Cross-Device General] allinkiran:
Thank you. Would try tomorrow since nexus has son many roms that I want to try on my z1 :)
[Sony Cross-Device General] [Fenix]:
Nice guide bro, really clear and useful [emoji106] [MENTION=4792862]Nasheich Xfiles[/MENTION]

Hey mate...just a suggestion...I'm not saying do not try, but soon honami will be officially supported from SOKP ;)

Inviato dal mio C6903 utilizzando Tapatalk
[Sony Cross-Device General] Nasheich Xfiles:
Are you one of SOKP team ?

if yes, please support my device (LG L9 P760) too
[Sony Cross-Device General] joecool666:
hi, will this need unlocked bootloader to work ,kind regards joe
[Sony Cross-Device General] nule4:
need help.

i tried to port rom from anzu to iyokan following your rules ( c-rom 7.1 for anzu to latest legacyxperia for iyokan, both are kk 4.4.4).

phone boot up,but i get crash com.android.systemui, com.android.phone, com.android.media, com.android.apollo, etc...

both phone share same platform, what should i do? please help

thanks in advance.
[Sony Cross-Device General] Nasheich Xfiles:
depending on the phone, Samsung devices usually doesn't need unlock bootloader, but the other brands need it..

unpack boot.img of both rom, then find init.environ.rc, edit with text editor, then replace bootclasspath line with rom port
[Sony Cross-Device General] jerbear294:
I just ported MIUIv6 to my tablet with this! Thanks for the awesome guide!
[Sony Cross-Device General] nisu4717:
I have boot.elf file in base ROM.and boot.IMG in port ROM. Port ROM is HTC.

How can I convert .elf to .IMG for editing.

Thanks
[Sony Cross-Device General] Aaskereija:
tried to port a Paranoid Android version from Sola to go. Not worked.. boots to kernel screen then freeze.
[Sony Cross-Device General] sublinker:
Nice guide, gonna try it some day. :D
[Sony Cross-Device General] Nasheich Xfiles:
are you serious ?

miui v6 isn't even out :confused:

never heard about boot.elf before, no clue

I was ported Paranoid from 3 different devices to my device, and never failed, you must do something wrong, read again my guide carefully...

tell me if you have a problem, I'll do my best to help you ;)
[Sony Cross-Device General] ManzzaShahi:
ported successfully but getting crash com.android.systemui, com.android.media

i don't have linux machine and when i unpack boot.img in windows i can't find init.environ.rc in there

so i uploaded both boot.img files from port and base rom

i am porting slimkat rom

can you please take a look at boot.img and help me

thanks in advance :(:(

https://docs.google.com/file/d/0BwK_qVw3n7FSMW01NlpqUzN2OFE/edit
[Sony Cross-Device General] Nasheich Xfiles:
your crash is totally cause by bootclasspath didn't same like rom port,

i don't have Linux too, i use dsixda's Android Kitchen, use it to unpack and repack boot.img

if you want me to do it, upload to somewhere else, devhost, mediafire, or etc, i hate Google doc link, hard/can't download from phone
[Sony Cross-Device General] ManzzaShahi:
i tried but i didnt find bootclasspath so it would be helpful if you check it out for me

thanks and here mediafire link

http://www.mediafire.com/download/o744pcnstjcpp77/boot.zip
[Sony Cross-Device General] jerbear294:
MIUI 6 isn't out for phones. Technically speaking, MIUI Tablet Edition is MIUI 6. Search "miui 6 port" and you'll see quite a few of them.

I'm having an issue with WiFi on the port. I did the troubleshooting steps but wifimac isn't in the base ROM or the port ROM.
[Sony Cross-Device General] Nasheich Xfiles:
I'll edit it, please be patient, cause i have many projects
[Sony Cross-Device General] Aaskereija:
yep, forgot to change the files in init.d , But still dont start. i found out that i must stay on the original lines in updater-script so the rom boot to bootscreen, but still bootloop, if i use the lines from PA it gives me an error like befor. Dunno what i had to do, i used the PA 4.44 rom of sola as Port and CM11 build 7 as Base, both of Team STE. I carefully did what your guide says (beside the updater-script), could you give a try if you can make it?
[Sony Cross-Device General] black87:
What if the chipset is different but with same core count?
[Sony Cross-Device General] Nasheich Xfiles:
don't do anything with updater-script, keep using meta-inf folder from the base, don't change anything inside it

if you still get bootloop, replace bootclasspath in boot.img

no problem, i was ported many roms from different chip...
[Sony Cross-Device General] ReadReadz:
Only 1 question

Example: the xperia z1 have White balance feature or Stamina Mode. Is it need sony kernel tweaks to work ?

If yes, when I ported Z1 firmware, what things will happen ? Thanks for nice guide :laugh:
[Sony Cross-Device General] Nasheich Xfiles:
sorry disappointed you, i was trying to compile your kernel, but failed, I'm not familiar with file ramdisk.cpio, i can't compile it, the init.environ is in there, don't know how to compile it...

This guide is for porting custom rom like Mokee Open Source, AOSPA, PAC, MIUI and etc, not for stock rom,
[Sony Cross-Device General] jancsessz:
This guide working http://xdaforums.com/showthread.php?t=2799730 port Xperia overlay to Xperia Sp cm11 for locked bootloader?
[Sony Cross-Device General] Nasheich Xfiles:
Xperia overlay is for unlock bootloader,

but you may can port it since overlay is base on cm11...
[Sony Cross-Device General] jancsessz:
Xperia Sp CM11 avalibe for locked bootload or port Xperia overlay rom to Xperia Sp UBL CM11?
[Sony Cross-Device General] Nasheich Xfiles:
if your base doesn't need unlock bootloader, then your ported rom doesn't need it too...

but you may have to play harder on xperia overlay, you must modify the kernel to make it boot, i was tried to port overlay to my device, but failed,
[Sony Cross-Device General] zoldyck:
hey brother , any idea how to unpack repack boot.img miui base kitkat ?

I tried to port miui kitkat several times but stuck on boot animation

and also tried to edit bootclass etc after repack boot.img again its black ..kernel is not even booting

#sorry kepanjangan kk :v
[Sony Cross-Device General] Nasheich Xfiles:
i usually used dsixda's Android Kitchen to unpack and repack boot.img,

You have to edit init.rc to added some miui stuff and added init.miui.rc to boot.img to make it boot

without two those things, you won't be able to make it miui boot into your device
[Sony Cross-Device General] khojim:
For easy way, unpack boot.img from working rom and then compare init.rc and init.miui.rc. See what you got. (just my opinion) :D
[Sony Cross-Device General] zoldyck:
I know that bro dunno what cause kernel doesn't boot , I just add those bloody miui file , not else -_-

what I got is black screen and some vibration kk :v :fingers-crossed:
[Sony Cross-Device General] Nasheich Xfiles:
compare both of the init.rc, you should find something different...
[Sony Cross-Device General] black87:
Does it mean i can port from different brand of chipset?
[Sony Cross-Device General] Superwitschi:
Can i port Miui to Huawei P7 with this guide? Maybe somone could port it for me?
[Sony Cross-Device General] nauman284:
will this work on other devices, like lg g2, and across variants?
[Sony Cross-Device General] Nasheich Xfiles:
Yes, it is...

Just try it, you'll never know if you're not trying...

Yes, this guide is for any devices, not just Sony, but please remember, this guide is for porting custom rom, not manufacturer rom...
[Sony Cross-Device General] kin9nothin9:
what about Chameleon OS?

should it work

will try it for my nozomy when i have time and report

that if i found enough time to finish it
[Sony Cross-Device General] joecool666:
can this work on the z1 locked bootloader C6903, regards joe
[Sony Cross-Device General] Nasheich Xfiles:
yes, you can port any custom rom, whatever it is...

This is a guide, not a rom, for locked or unlocked bootloader it's depending on your base rom...
[Sony Cross-Device General] Black_Eyes:
Any idea about message sending, tethering settings Fc

it's in Every Rom i port :(
[Sony Cross-Device General] nisu4717:
Have u replaced WiFi libs from base ROM to port ROM
[Sony Cross-Device General] lozohcum:
For MIUI use "Definitive FAQ for newest MIUI porting"

So far I haven't found method to port LewaOS 5, always stays on bootlogo. Also I never managed to make adb work
[Sony Cross-Device General] Black_Eyes:
Help Please

i have ported a Rom and it's booted too but whenever i try to open any app it soft reboot itself :(
[Sony Cross-Device General] jerbear294:
Isn't that guide out of date? I attempted that one and it resulted in a bootloop.
[Sony Cross-Device General] lozohcum:
This is official one - up to date http://en.miui.com/thread-1464-1-1.html

if your port doesn't boot it's probably your fault - I bet wrongly chosed MIUI base or some mistakes in porting procedure.

So far I have ported every JB rom excluding LevaOS and AOSP. This method is the best for all roms, not only miui.
[Sony Cross-Device General] david makarove:
Wow

Just i can't believe you are human like us o.O

you share your awesome and very very helpful information

i don't know how to thank you for that

i will give it a try after build from source fails with me

i just have some questions

i know that i can port if both phones have same CPU cores but what about if not have same GPU

in my case i wanna port liquid smooth from galaxy nexus to my xperia L

they have some difference ( please check phones specs in gsm arena) and tell me if that possible or not

Depending on your answer i will get answers to many questions in my head

Thanks again for the great guide :)
[Sony Cross-Device General] Black_Eyes:
It's Possible just give it a try :)
[Sony Cross-Device General] Nasheich Xfiles:
make sure you have replace all bins, lib, etc just like post 2(troubleshooting)
[Sony Cross-Device General] Black_Eyes:
i got it fixed

It's related to Graphics Hacked libs
[Sony Cross-Device General] david makarove:
i done most things but have tow problems

1.there is firmware folder in rom base but no in rom port and same thing with modules folder it founded in rom base but no in rom port (So , i copied them from rom base to rom port ) , thats right ?

2.i can't decompile framwork-res.apk with apktool , i got follwing problem

waiting for help
[Sony Cross-Device General] Black_Eyes:
No , youu don't have any need to decompile the framework-res.apk

just open framework-res.apk of PORT and BASE and replace storage.xml from base framework-res.apk to PORT framework-res..apk
[Sony Cross-Device General] david makarove:
Thanks

i do that

But now i won't flash through TWRP (didn't try cwm )

Just show can't flash and exit :(

EDIT : same thing with meta-info folder from ROM port :(
[Sony Cross-Device General] Black_Eyes:
Check the zip file :confused:
[Sony Cross-Device General] Nasheich Xfiles:
To port MIUI(specially MIUI KitKat base), you need to edit init.rc inside boot.img to make it boot

1. yes, copy firmware and module folder from you base to your ROM port,

2. compile using PC, don't use apktool for phone

There's a link on the first page to APKTOOL thread, and there's a guide on that thread too(if you didn't know about compiling apk and jar
[Sony Cross-Device General] david makarove:
Thanks

But i used z archiver For replace storage_list.xml

And then flashed ROM on clean install

i got it stuck at kernel boot logo

is that the reason ? Because i didn't decompile and recompile framework after edit

Or that's normal ?

Thanks again and sorry for a lot questions
[Sony Cross-Device General] Black_Eyes:
how you port Mokee

i just got systemUi crash on StartUp
[Sony Cross-Device General] Nasheich Xfiles:
Like i said, compile using apktool for PC, not every rom can be simply replace the storage-list.xml

Replace bootclasspath inside boot.img to fix it
[Sony Cross-Device General] Superwitschi:
I failed to port to Huawei P7[emoji25]
[Sony Cross-Device General] Black_Eyes:
How you able to port AOKP ?

i have tried BOOTCLASSPATH too but it didn't boot

have you added init file of AOKP to Port AOKP?
[Sony Cross-Device General] Nasheich Xfiles:
what rom that you want to port ?

and from what device ?

i didn't anything on boot.img while porting AOKP
[Sony Cross-Device General] Superwitschi:
Miui to Huawei P7

in base rom i dont have file_contexts
[Sony Cross-Device General] Nasheich Xfiles:
from which device you port miui ?
[Sony Cross-Device General] Superwitschi:
Nexus 5 Miui 4.8.8

---------- Post added at 03:34 PM ---------- Previous post was at 03:25 PM ----------

Nexus 5 Miui 4.8.8
[Sony Cross-Device General] Fiso:
If boot.img doesnt boot.

source:

http://xdaforums.com/showthread.php?t=1477845
[Sony Cross-Device General] Black_Eyes:
i don't have linux..

Running those commands on Cygwin but After Unpacking , unable to Extract Ramdisk folder
[Sony Cross-Device General] Nasheich Xfiles:
Have you edit init.rc in boot.img ?

MIUI kk need it, unpack boot.img then compare all files inside it

Porting doesn't really need Linux, i did it all on Windows, old Windows XP
[Sony Cross-Device General] Superwitschi:
I think iam to stupid il give up
[Sony Cross-Device General] allinkiran:
Hi. Will this guide work with Color OS, flyme OS or Ubuntu mobile OS?

Would the steps be same if I am to port from nexus 5 to xperia z1? Thanks
[Sony Cross-Device General] Black_Eyes:
Try it Bro

;) :D
[Sony Cross-Device General] Nasheich Xfiles:
i would say no, cause it's all stock roms, but if it's ported rom with CM or AOSP as the base, you can re-port again. ..
[Sony Cross-Device General] langeveld024:
How it's possible to port from different chipsets?

For example: I'm porting slim based miui from S3 and using cm11 for Yuga as Base..

Both are quadcore but s3 is Mali and Yuga is adreno..

What do I do with /system/lib/egl?

Also, when I'm unpacking some boot.img, let's say boot.img from cm11 Yuga, why I don't see any init.rc files?

Only sbin folder, init file (with only few numbers in it), and some "logo"file.

Other than that, Nice guide! :thumbup:
[Sony Cross-Device General] Nasheich Xfiles:
cause 80% files in (any) custom rom are the same files,

I did ported miui v5 kitkat from s3 to my device (p760, dual-core cpu) and it's booted after I played with boot.img to add miui files,,

for xperia device, after unpack boot.img, you have to unpack again ramdisk.cpio, then you'll find it...

but don't ask me how to repack it, I never have xperia device, so I still don't know how to repack it :D