[GUIDE]How To Port ROMS to Your Device [AOSP]

ArjunrambZ

Senior Member
Jul 28, 2013
1,285
1,160
0
some where in INDIA
Code:
/*
 * ~ DO READ THIS BEFORE ATTEMPTING~
 
 * Iam not here to guarantee any successful PORTING. nor i am responsible
   for bricked devices, dead SD cards, or a broken device. YOU are
   choosing to make these modifications, and if you point the finger
   at me for messing up your device, I will laugh at you. But I will try
   my best to explain all the necessities, so you won't mess up your Device.
 *
   ~END
*/

Hello XDA'S Today i'm back with a useful guide/tutorial for ANDROID ROM PORTING

may have tried porting roms to their phones and has been succefull but most of the case is that we being end up in bootloops or cwm errors

So i'm dedicating this post for all users how are having a craze of rom porting or for atleast those wgo wanted to try rom porting

SO LETS START
There are two phases or rom porting
1) Its finding the correct port and source roms for ROM PORTING copying the files which is explained here
2) After a succefull port also the rom may not work properly ,we have to sort out the bugs to for a rom to become perfectly working

So with no more blahh blahh blahh Lets start the PORTING procedure :fingers-crossed: :fingers-crossed:
And lastly Before you a port a ROM, make sure you asked permission from the Developer!

What you'll need:
  1. WinRAR/7zip
  2. Notepad++ (When developing, always use this)
  3. Android SDK (For Logcatting & DDMS)
    Some basic knowledge about Android
    If you are on Linux/Unix/BSD use your favorite Archiving Tool & Text Editor.


What is base Rom:

The ROM which is Developed For your Mobile..
You can use either CM or any other AOSP roms as your Base ROM
What is Port Rom:

The Rom Which you want to port to your Device.
Make sure that the rom has most of the hardware specifications as of your base rom
STEP1;

Take any clean CM9, AOSP, CM7, CM10 ROM which is running on your device as Base ROM
STEP2:

Extract it Using Winrar.
STEP3:

Take the ROM you want to port. This Port ROM. Extract it also using Winrar.

STEP4:

Delete app, Framework, Fonts and Media folder in System Folder of Base ROM.


STEP5:

Now copy app, Framework, Fonts and Media folder in System Folder from Port rom to base rom system folder.


STEP6:

Now open etc folder in both the ROMs folder.

STEP7:

In etc folder of base ROM open permissions folder and copy all the permissions files in Port rom to your base ROM folder except platform and handheld_hardware
STEP 8: .And Then open init.d Folder in Base ROM and Delete Every thing except banner and then copy all the files inside init.d folder of port ROM to Base ROM.
STEP9:

Now open buid.prop file using Notepad++ and make changes to these of Base Rom as you wish.

ro.build.id=
ro.build.display.id=
ro.build.date=
ro.modversion=

STEP10:

In build.prop file change these to same as Port Rom build.prop values.

ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=
ro.cmversion=
ro.modversion=

Also Copy anything you Find Extra in ADDITIONAL BUILD PROPERTIES related to theme..

STEP11:

COPY THE set_perm Lines in META-INF/com/google/android/updater-script From Port to Base ROM After Deleting set_perm lines in Base ROM's Updater-Script.

STEP12:

If You find any extra file or folder in system folder of PORT rom than copy them to your base rom system folder.
STEP 13:


Last Step to ZIP THE FOLDERS IN ONE..
SELECT META-INF, system, boot.img(if it is having), data(if it is having).
Right Click and Select Add to Archive..
Select Zip..
Type the Name.
Click OK..
HERE THE BASIC ROM PORTING IS OVER BUT FOR SOME SPECIFIC COSTUME ROMS WE NEED LITTLE MORE STUFFS TO WORK ON ,THEY ARE SHOWN BELOW

ONLY FOR MIUI ROMS :

Copy telocation.db and yellowpage.db From /system/etc folder to yours..

Copy content-types.properties file From /system/lib to yours..

Copy invoke-as from miui4 rom to /system/xbin and give it permissions on updater-script
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
Note:It is needed for backup & themes app to work

Copy liblbesec.so from miui 4 to /system/lib and give permission on updater-script
set_perm(0, 0, 0755, "/system/lib/liblbesec.so");
It is needed for superuser app from miui to work

Change values Some of the Values in build.prop of your ROM:
ro.build.id=MIUI
ro.build.display.id=MIUI
ro.build.version.incremental=2.x.x (version number)

ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg

FOR ParanoidAndroid And PAC:

Copy paranoid folder inside system/etc to yours..
Go to META-INF/com/google/android/Updater-Script of your base ROM and open it with Notepad++
Copy this line:

set_perm(1000, 1000, 0644, "/system/etc/paranoid/properties.conf");


Specially For PA:

Now Open Build.prop in /system with Notepad++
Copy these lines in Additional Properties of Build.prop:

Depends on Resolution Of your device can be pa_hdpi/pa_mdpi/pa_xhdpi. Change it according to your device.
ro.pa.family=pa_mdpi
Depend on pa version. Replace x.xx with the version of PA you are porting.
ro.pa.version=x.xx
Specially For PAC Rom:
Now Open Build.prop in /system with Notepad++
Copy these lines in Additional Properties of Build.prop:

Replace the x.x.x with your PAC Rom version
ro.pac.version=x.x.x
Customize these lines according to your wish.
ro.pacrom.version=mesona_PAC_jb-alpha-v19.0.0
ro.modversion=mesona_PAC_jb-alpha-v19.0.0
Depends on Resolution Of your device can be pa_hdpi/pa_mdpi/pa_xhdpi. Change it according to your device.
ro.pa.family=pa_mdpi
Depend on pa version. Replace x.xx with the version of PA you are porting.
ro.pa.version=x.xx
Modify this line according to your AOKP version
ro.aokp.version=mesona_jb-Milestone-1
Modify it according to your base ROM's build.prop
ro.cm.version=xxxxxxxxxxxx
Replace any line in Your build.prop which appear twice mainly ro.cm.version and ro.modversion
FOR SPECIFIC MANUFACTURE DEVICE
For HTC Devices:

To fix network auto select-

Decompile framework-res.apk
Go to \framework-res\res\values\bools.xml and change change <bool name="skip_restoring_network_selection">true</bool> to false

To Fix Graphichal issues:
Code:
Decompile framework.jar
Change these files with your base
smali\smali\android\os
Environment
SystemProperties
smali\smali\android\view
HardwareCanvas
HardwareRenderer$Gl20Renderer
HardwareRenderer$GlRenderer
HardwareRenderer
IF YOU ARE HAVING BOOTLOOP THEN COPY THESE LIB FILES TO BASE ROM FROM PORT ROM:

libandroid_runtime.so
libandroid_servers.so
libmedia_jni.so

IF YOUR BASE ROM HAS ISSUES LIKE CAMERA ISSUE THAN YOUR PORTED ROM TOO WILL HAVE ISSUES.

NOW ZIP YOUR ROM AND POST IT BUT DON'T FORGET TO GIVE CREDITS TO THE DEVELOPER OF PORT ROM..

TROUBLESHOOTING AFTER SUCCEFULL PORT

After a succefull port also there can be many bugs present which has to soved logically
here are somethings which can help in DEBUGGING

1) IF GALLERY FC :
open the system/framework and find framework-res.apk file[can use any extracting app]
in both the roms and go to res folder then to xml subfolder and copy and replace the storage_list.xml file from source to port rom
( framework-res.apk\res\xml\storage_list.xml)

Porting Wallpapers | Lockscreen Wallpapers | bootanimation

Usually you get a wallpaper/bootanimation that doesn't fit your device. Here's a quick tutorial on how to port it to your device.

Download & Install FreeImageConverter then launch it.
For Wallpapers & Lockscreen Wallpapers:
Click Add Folder... and add the folder were the wallpapers are
Then click Advanced Convert...
Select Exact Size and set the image quality to 100
Set your Width and Height resolutions for your device.
Uncheck Add "Converted by www.freeimageconverter.com"
Select Leave the same file name and leave the Postfix & Prefix empty. Then set your output in a folder.

For bootanimation:
Extract /system/media/bootanimation.zip OR /data/local/bootanimation.zip OR /system/customize/resource/bootanimation.zip (For Oxygen ROM, the bootanimation is built into the framework-res)
Do the steps above
Move the new resized folder(s) into your bootanimation workspace
Edit the desc.txt to match your device resolutions
Zip the contents ( folder_name desc.txt )
Set compression method to Store
Delete the extracted bootanimation files
Make sure this new bootanimation.zip is in PORTED
Credits & Thanks to

# rishabh.raj37
# Peteragent5



Happy porting! :cowboy::cowboy::cowboy:
:laugh:
 
Last edited:

HitBobLer

Senior Member
Jan 28, 2013
102
6
0
Liverpool
Arjunramb456651 said:
Code:
/*
 * ~ DO READ THIS BEFORE ATTEMPTING~
 
 * Iam not here to guarantee any successful PORTING. nor i am responsible
   for bricked devices, dead SD cards, or a broken device. YOU are
   choosing to make these modifications, and if you point the finger
   at me for messing up your device, I will laugh at you. But I will try
   my best to explain all the necessities, so you won't mess up your Device.
 *
   ~END
*/

Hello XDA'S Today i'm back with a useful guide/tutorial for ANDROID ROM PORTING

may have tried porting roms to their phones and has been succefull but most of the case is that we being end up in bootloops or cwm errors

So i'm dedicating this post for all users how are having a craze of rom porting or for atleast those wgo wanted to try rom porting

SO LETS START


And lastly Before you a port a ROM, make sure you asked permission from the Developer!












































HERE THE BASIC ROM PORTING IS OVER BUT FOR SOME SPECIFIC COSTUME ROMS WE NEED LITTLE MORE STUFFS TO WORK ON ,THEY ARE SHOWN BELOW

ONLY FOR MIUI ROMS :




FOR ParanoidAndroid And PAC:



Specially For PAC Rom:


FOR SPECIFIC MANUFACTURE DEVICE





IF YOUR BASE ROM HAS ISSUES LIKE CAMERA ISSUE THAN YOUR PORTED ROM TOO WILL HAVE ISSUES.

NOW ZIP YOUR ROM AND POST IT BUT DON'T FORGET TO GIVE CREDITS TO THE DEVELOPER OF PORT ROM..

TROUBLESHOOTING AFTER SUCCEFULL PORT

After a succefull port also there can be many bugs present which has to soved logically
here are somethings which can help in DEBUGGING

1) IF GALLERY FC :
open the system/framework and find framework-res.apk file[can use any extracting app]
in both the roms and go to res folder then to xml subfolder and copy and replace the storage_list.xml file from source to port rom
( framework-res.apk\res\xml\storage_list.xml)





Credits & Thanks to

# rishabh.raj37
# Peteragent5



Happy porting! :cowboy::cowboy::cowboy:
:laugh:
Can you port an AOSP/CM based rom using a Manufacturer/maufacturer based ROM as the base (i.e. touchwiz rom)?
 

Neozx25

Senior Member
Feb 28, 2012
212
56
28
Pittsburgh
So i own a Galaxy Tab 2 10.1 from AT&T... If i wanted to port a 4.2.2 Touchwiz rom to my tablet, would the steps vary much from those you've listed?

Sent from my SGH-I337 using XDA Premium 4 mobile app

---------- Post added 16th November 2013 at 12:02 AM ---------- Previous post was 15th November 2013 at 11:59 PM ----------

So i own a Galaxy Tab 2 10.1 from AT&T... If i wanted to port a 4.2.2 Touchwiz rom to my tablet, would the steps vary much from those you've listed? I would be using a rom that runs on another tab 2 10.1 but not for AT&T. Or even if i wanted an AOSP rom, would be that difficult?

Sent from my SGH-I337 using XDA Premium 4 mobile app


Sent from my SGH-I337 using XDA Premium 4 mobile app
 

ArjunrambZ

Senior Member
Jul 28, 2013
1,285
1,160
0
some where in INDIA
Arjunramb456651 said:
Code:
/*
 * ~ DO READ THIS BEFORE ATTEMPTING~
 
 * Iam not here to guarantee any successful PORTING. nor i am responsible
   for bricked devices, dead SD cards, or a broken device. YOU are
   choosing to make these modifications, and if you point the finger
   at me for messing up your device, I will laugh at you. But I will try
   my best to explain all the necessities, so you won't mess up your Device.
 *
   ~END
*/

Hello XDA'S Today i'm back with a useful guide/tutorial for ANDROID ROM PORTING

may have tried porting roms to their phones and has been succefull but most of the case is that we being end up in bootloops or cwm errors

So i'm dedicating this post for all users how are having a craze of rom porting or for atleast those wgo wanted to try rom porting

SO LETS START


And lastly Before you a port a ROM, make sure you asked permission from the Developer!












































HERE THE BASIC ROM PORTING IS OVER BUT FOR SOME SPECIFIC COSTUME ROMS WE NEED LITTLE MORE STUFFS TO WORK ON ,THEY ARE SHOWN BELOW

ONLY FOR MIUI ROMS :




FOR ParanoidAndroid And PAC:



Specially For PAC Rom:


FOR SPECIFIC MANUFACTURE DEVICE





IF YOUR BASE ROM HAS ISSUES LIKE CAMERA ISSUE THAN YOUR PORTED ROM TOO WILL HAVE ISSUES.

NOW ZIP YOUR ROM AND POST IT BUT DON'T FORGET TO GIVE CREDITS TO THE DEVELOPER OF PORT ROM..

TROUBLESHOOTING AFTER SUCCEFULL PORT



Can you port an AOSP/CM based rom using a Manufacturer/maufacturer based ROM as the base (i.e. touchwiz rom)?
no i dont think so,because cm /pa have modified source code ,which differ from manufacture rom hence ,,not possible ,u will possibly end in boot loop
 

ArjunrambZ

Senior Member
Jul 28, 2013
1,285
1,160
0
some where in INDIA
So i own a Galaxy Tab 2 10.1 from AT&T... If i wanted to port a 4.2.2 Touchwiz rom to my tablet, would the steps vary much from those you've listed?

Sent from my SGH-I337 using XDA Premium 4 mobile app

---------- Post added 16th November 2013 at 12:02 AM ---------- Previous post was 15th November 2013 at 11:59 PM ----------





Sent from my SGH-I337 using XDA Premium 4 mobile app






So i own a Galaxy Tab 2 10.1 from AT&T... If i wanted to port a 4.2.2 Touchwiz rom to my tablet, would the steps vary much from those you've listed?

Sent from my SGH-I337 using XDA Premium 4 mobile app

---------- Post added 16th November 2013 at 12:02 AM ---------- Previous post was 15th November 2013 at 11:59 PM ----------





Sent from my SGH-I337 using XDA Premium 4 mobile app
yes of course ,this methode is for aosp or for cm roms and not for manufacture roms,,there are other guids for porting manufacture roms ,go search the forum
 

Mustafa Mubashir

Senior Member
Jul 21, 2013
321
225
0
karachi
only boot loop no progress!!!

i had tried this method more then 4 times but it didnt worked....
rom is not booting up and its stucked on boot animation and shows no progress although i left it for an hour but still stucked....
any idea??:confused:

and for details...
i am porting chameleon OS built for htc one s just see this....-
android v is 4.2.2
so i used aokp 4.2.2(stable) first as base rom but i failed more then 2-4 times then i tried cm10.1 as base rom but still i am at bootanimation.
i had also used the three libs from the port rom and base rom as mentioned in the guide but still nothing is going good......:crying:

can you tell me that am i missing something or i should try other guides?:confused:
if your answer is that i should try other guides so please lead me to a guide.....
thanks.:D
regards:playboydroid
 

ArjunrambZ

Senior Member
Jul 28, 2013
1,285
1,160
0
some where in INDIA
i had tried this method more then 4 times but it didnt worked....
rom is not booting up and its stucked on boot animation and shows no progress although i left it for an hour but still stucked....
any idea??:confused:

and for details...
i am porting chameleon OS built for htc one s just see this....-
android v is 4.2.2
so i used aokp 4.2.2(stable) first as base rom but i failed more then 2-4 times then i tried cm10.1 as base rom but still i am at bootanimation.
i had also used the three libs from the port rom and base rom as mentioned in the guide but still nothing is going good......:crying:

can you tell me that am i missing something or i should try other guides?:confused:
if your answer is that i should try other guides so please lead me to a guide.....
thanks.:D
regards:playboydroid
bro firstof all,, porting is not that easy as to read,,, here logcat is your only friends,,, get me the logcat
 

jokerpoker1

Senior Member
Aug 10, 2012
327
81
0
Good evening to all, first of all thanks for the guide.
The rom part, it works most of the things, porting is a rom for nexus 5 to take on g2.
I have problems with wifi, vpn and security in the setting menu.
Practically the vpn and security go on crash, while the wifi is active but can not find anything.
Do you have suggestions?
thanks
Sorry for my bad english
 

ArjunrambZ

Senior Member
Jul 28, 2013
1,285
1,160
0
some where in INDIA
Good evening to all, first of all thanks for the guide.
The rom part, it works most of the things, porting is a rom for nexus 5 to take on g2.
I have problems with wifi, vpn and security in the setting menu.
Practically the vpn and security go on crash, while the wifi is active but can not find anything.
Do you have suggestions?
thanks
Sorry for my bad english
it would only b possible if you could get a logcat about the problem,, and if the problem persist in the base rom,then its sure to be in ur port too,
 
  • Like
Reactions: jokerpoker1

jokerpoker1

Senior Member
Aug 10, 2012
327
81
0
it would only b possible if you could get a logcat about the problem,, and if the problem persist in the base rom,then its sure to be in ur port too,
thanks for the reply, it is the first time I use logcat, this is what I said when I port ROM.un my friend was telling me That might be the update script.
Thanks


Inviato dal mio LG-D802 utilizzando Tapatalk
 

ArjunrambZ

Senior Member
Jul 28, 2013
1,285
1,160
0
some where in INDIA
thanks for the reply, it is the first time I use logcat, this is what I said when I port ROM.un my friend was telling me That might be the update script.
Thanks


Inviato dal mio LG-D802 utilizzando Tapatalk
yes when it coms to porting logcat is ur only friend,, well updater script doesn't have any relations with the rom actually its like a process to installing the rom as said, and fixing permision,,,
and please tell me when was this logcat obtained and this time get me a full logcat
 
  • Like
Reactions: jokerpoker1
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone