[Android Software Development] Samer Diab:
How To Port a Rom

Most efficiant way .​

Hello Guys i have been triying a lot of methods to port roms and i found this method brilliant and a 100% Working on HTC And samsung devices 90% On others as i did not test them myself

Let us start .First you need the following :

1.DsiXDA Android Kichen.

2.Kernel Sooting the rom that you want to port to device .

3.A little knowlege on how to port roms.

4.Device with same resolution to port rom from.

5.Note pad++ Or adobe dreamware.

6.Winrar Zip archieve.

Ok so now make 2 folders one named base and the other named port.

Copy the rom that you want to port to your device to port folder and copy a rom that works on device to base folder.

In Port folder delete USR Folder and replace it with USR Folder from base folder.

Now lets open bin in port folder And in base folder.

Copy and replace the following from base to port.

[SIZE="3"]1.rmt_storage.
2.vold
3.wpa_cli
4.wpa_supplicant[/SIZE].

Again lets open ect folder in base and port folder.

Now Delete the following in port folder:

[SIZE="3"]1.hw folder .
2.modules folder. [/SIZE]

And Replace them with HW And modules folder from base folder.

Now copy and replace the following lib files from base rom to port.

[SIZE="3"]1.libhardware_legacy.so
2.libhtc_ril.so
3.libhtc_ril_switch.so
4.libril.so[/SIZE]

Now lets open ect folder in port and base folders.

Delete the following folders from port rom:

[SIZE="3"]1.Firmware.
2.init.d
3.Sound Image. [/SIZE]

And replace them with the following from base rom:

[SIZE="3"]1.Firmware.
2.init.d
3.Sound Image[/SIZE]

Now copy and replace the following in ect folder from base rom to port rom:

[SIZE="3"]1.AdieHWCodec
2.AIC3254_REG
3.AIC3254_REG_XD
4.AudioBTID
5.CodecDSPID
6.TPA2051_CFG
:You might not find them all So dont panic.[/SIZE]

Now If your your using "adreno processor or any processor" and the port rom has "lets say portprocessor" in ect of base rom you will find "yourprocessor_config" Copy and paste it in ect of port rom now delete "Portprocessor_config"

Now copy and replace vold.fstab from base rom to port.

Last step delete boot.img in port and replace it with the one from base.

:if both devices have same storage mods "I mean both need sd cards"You can continue if one of them has "SD CARD AND THE OTHER NO SD CARD MAKE SURE!!! to copy and replace ext.jar from framewrok folder in base rom to framework folder in port rom.

Now lets open customize folder in port rom

Customize/MNS/default.xml

And search for the following code:

[SIZE="3"]

[COLOR="Red"]HTC_Sensation_xl[/COLOR]/1.0

[/SIZE]

Now i am using htc sensation xl rom as a base as base and need to port it to desire hd replace code with this:

[SIZE="3"]

[COLOR="Red"]HTC_Desire_HD[/COLOR]/1.0

[/SIZE]

Exit and save

Ok now open customice/cid/default.xml with the note pad ++ or adobe dreameware and find the following code :

[SIZE="3"]

[COLOR="Red"]HTC Sensation xl with beats audio[/COLOR]

and replace it with this code:

[COLOR="Red"]HTC Desire HD with Beats Audio[/COLOR]

[/SIZE]

Exit and save

now lets open Build.prop in port folder and in base folder with note pad ++ or adobe dreamware

no find the following codes:

[SIZE="3"]# ro.build.product is obsolete; use ro.product.device
ro.build.product="Replace with one of base rom"
ro.build.product="Replace with one of base rom" [MENTION=522570 [MENTION=1065870 [MENTION=1879310]@@@[/MENTION][/MENTION]@@[/MENTION]@@
ro.product.processor="Replace with one of base rom"
ro.product.ram="Replace with one of base rom"
ro.product.display_resolution="Replace with one of base rom"
ro.product.main_camera="Replace with one of base rom"
ro.product.front_camera="Replace with one of base rom"
ro.product.bluetooth="Replace with one of base rom"
ro.product.wifi="Replace with one of base rom" [MENTION=522570 [MENTION=1065870 [MENTION=1879310]@@@[/MENTION][/MENTION]@@[/MENTION]@@
ro.build.host="Replace with one of base rom"
ro.product.model="Replace with one of base rom"
ro.product.brand="Replace with one of base rom"
ro.product.name="Replace with one of base rom"
ro.product.device="Replace with one of base rom"
ro.product.board="Replace with one of base rom"
ro.product.cpu.abi="Replace with one of base rom"
ro.product.cpu.abi2="Replace with one of base rom"
ro.product.manufacturer="Replace with one of base rom"
ro.product.version="Replace with desired name"
ro.build.id="Replace with desired name"
ro.build.display.id="Replace with desired name" [/SIZE]

Exit and save

Now delete Meta-inf folder in port and replace it with one from base

Now you can open updater script and change some name like name of rom......

Like my work ?Donate to me and help me expand:) or you can just hit the thanks button Thanks{Pleaze list donations on thread}

Thanks The Epik Dude For Figuring Out Some Mistakes and Helping me In Tests​