Guides

Port Your Android Roms in a Easy Way

Hey guys, In this tutorial im going to show you guys how to Port Roms to your Android Device in just 9 Simple Steps.
Please comment below if you have any issues in understanding.

Note: This is just a tutorial and i am not responsible to whatever happens to your device.
Risk Involved.

Ok Lets start off

Firstly you will need the following:

1. Windows OS or Linux OS
2. ROM (that u wanna port to your device)
3. Dev Tools (like pack/unpack boot.img, which you can easily get on google.)

Steps to be Followed:

1. Unpack ur boot.img

2. Change file on ramdisk (init.model.rc -> init.gt-s5830.rc), (ueventd.model.rc -> ueventd.gt-s5830.rc)

3. Change model.rc -> COOPER.rle

4. init.rc need to change -> (unpack the boot img from the rom u wanna port and then open init.rc and copy the stuff after BOOTPATH)

5. Change ramdisk/lib/modules to your modules.

6. And the last step, Repack ramdisk boot.img

7. In your build.prop
Change model to your model (For example -> If xperia x8, then change to GT-S5830, & change galaxy to cooper) plus wifi modules has taken to your ROM (port)
libs and, bin files, like superuser or busybox

8. Then add/replace these in the rom itself the following files (copy from stock or cm7)

/lib/libril.so
/lib/libsecril-client.so
/lib/libsec-ril.so
/lib/libdiag.so
/system/hw
/system/modules
/system/etc/firmware , ppp, security, wifi, permission vold.stab
/system/user/keychars, keylayout

9. Remember: If u use an mdpi phone or ldpi and u want to port a ROM from a higher resolution u will need to resize all pngs too.


To  know your device ARM versions for look like roms
Check it

In Detail

AS i dont have a device to port and test roms...so use this guide to port roms and test it
Here you have it people , I may be wrong at some places so please excuse me

Requirements :
winzip
any file explorer on your desktop
 2 ROMs

Suggestions :
 Use ROMs from Phones like
 which have same features


Method:
Just do these changes to the files and have a Port which boots up

Delete :
/data folder
boot.img
/system/etc/firmware
/system/etc/init.d

Copy & Paste :
in /system/bin -

akmd2
am
bmgr
chargemon
charger
fix_permissions
hci_qcomm_init
hci_attach
ime
input
monkey
pm
port-bridge
qumxd
rild
updatemiscta
wlanmac
wlantool
ramdisk.tar/.gz

/system/etc :

replace all files in -
bluetooth
dhcpcd
wifi
firmware

copy the files -
apns-conf.xml
dbus.conf
DualMicControl
gps.conf
hosts
init* files
media-profiles.xml
resolv.conf
sensors.conf
sysctl.conf
vold.fstab

/system/lib folder :

delete and replace all files in:
/system/lib/modules
/system/lib/hw

copy the following files
in /system/lib/egl :
All EXCEPT libGLES_android.so

copy & replace these files :
libauth.so
libcm.so
libdiag.so
libdbus.so
libdss.so
libdsm.so
libgsl.so
libgstk_exp.so
libmiscta.so
libmmgsdilib.so
libmmipl.so
libmmjpeg.so
libnv.so
liboem_rapi.so
liboemcamera.so
liboncrpc.so
libpbmlib.so
libqmi.so
libqueue.so
libril.so
libril-qc-1.so
libuim.so
libwms.so
libwmsts.so

/system/usr/keychars -
es209ra_keypad.kcm
and delete the original file (example : passion_keypad.kcm OR bravo_keypad.kcm)

/system/usr/keylayout -
es209ra*.kl
do the same as with.kcm

Replace :-
Build.prop
META-INF folder

Cautions :-
Use the same version of android to port
You will need to change the build.prop to whatever you desire
You may need to edit the update-script

Porting gets over here !!!!!
Many People want to know this right ?

Bro , Dude , Buddy , friend , mate WHICH FILES ARE FOR WHAT ??
what does akmd2 do ? what is it for ????

Here , I will try to provide you as many answers as I can :-

# Prebuilt kl keymaps
/system/usr/keylayout/es209ra_keypad.kl
/system/usr/keylayout/es209ra_handset.kl
/system/usr/keychars/es209ra_keypad.kcm.bin

## RIL related stuff [Responsible For GSM/DATA and Sim card]
/system/lib/libril.so
/system/bin/port-bridge
/system/bin/qmuxd
/system/lib/libauth.so
/system/lib/libcm.so
/system/lib/libdiag.so
/system/lib/libdll.so
/system/lib/libdsm.so
/system/lib/libdss.so
/system/lib/libgsdi_exp.so
/system/lib/libgstk_exp.so
/system/lib/libmmgsdilib.so
/system/lib/libnv.so
/system/lib/liboem_rapi.so
/system/lib/liboncrpc.so
/system/lib/libpbmlib.so
/system/lib/libqmi.so
/system/lib/libqueue.so
/system/lib/libuim.so
/system/lib/libril-qc-1.so
/system/lib/libwms.so
/system/lib/libwmsts.so

## Camera proprietaries
/system/lib/liboemcamera.so
/system/lib/libmmjpeg.so
/system/lib/libmmipl.so
/system/lib/libcamera.so
/system/lib/libopencore_common.so


## FIRMWARE
/system/etc/firmware/yamato_pfp.fw
/system/etc/firmware/yamato_pm4.fw
/system/etc/firmware/camfirm.bin

## ATHEROS WIFI [ WIFI modules for X10 ]
/system/lib/modules/athwlan.bin.z77
/system/lib/modules/data.patch.hw2_0.bin
/system/bin/wlan_mac
/system/bin/wlan_tool

## BT proprietary [ Bluetooth for X10 ]
/system/bin/hci_qcomm_init
/system/bin/hciattach

## Adreno 200 files [ Responsible for display i.e. the GPU ]
/system/lib/libgsl.so
/system/lib/egl/libGLESv1_CM_adreno200.so
/system/lib/egl/libq3dtools_adreno200.so
/system/lib/egl/libEGL_adreno200.so
/system/lib/egl/libGLESv2_adreno200.so

## Other libraries and proprietary binaries
/system/etc/vold.fstab [ SD Card ]
/system/etc/sensors.conf [Proximity sensors , etc]
/system/bin/akmd2

#offline charger
/system/bin/chargemon
/system/bin/updatemiscta
/system/lib/libmiscta.so

#hw [The lights between the HOME , Menu and back button ]
/system/lib/hw/copybit.qsd8k.so
/system/lib/hw/sensors.default.so



How-To: Decompile/Recompile apk's with ApkTool

------------------------------------------------------------------------------------------------------------
Requirements:

ApkTool
Java JDK/JRE 32 bit
Basic Cmd/terminal knowledge

------------------------------------------------------------------------------------------------------------
Download ApkTool here

ApkTool.zip

first you need to extract that zip folder to anywhere you choose, preferably on root of c/drive ie: C:/android/apktool extracting the files to 'apktool' folder

Now place the STOCK framework-res.apk & whatever other apk's you would like to modify into the 'apktool' folder

------------------------------------------------------------------------------------------------------------
Getting to CMD directory


Open up a Cmd Prompt (terminal) and get to the 'apktool' directory ie:

Quote:
Your cmd will probly look like this..

C:\users\yourname>

so type in

cd.. (yes include the '..' and press enter after you type each command)

this will get you to back directory so now you will see

C:\users>

so type again

cd..

you should now see this:

C:\>

now type in:

cd 'apktoo'l/'directory'

for me it looks like:

cd android/apktool

now you should see:

C:/android/apktool>

and you are in the apktool directory

------------------------------------------------------------------------------------------------------------
Installing Framework

Now that you are in directory we need to install the device's framework to your system for it to compile correctly so type this:

apktool if framework-res.apk

this will install the devices framework to your system (need to do this)

------------------------------------------------------------------------------------------------------------
Decompiling

now to decompile the apk you want to edit.. type this:

apktool d framework-res.apk framework1

or

apktool d music.apk music

music.apk is the apk your decompiling
music is the folder you're creating for the decompiled apk

now make your edits DO NOT Change/Edit ANY PNG's

------------------------------------------------------------------------------------------------------------
Recompiling/Finished Product

now to recompile your new apk type this:

apktool b music music-new.apk

or

apktool b framework1 framework-res-new.apk

framework1 is the folder with your edited files
framework-res-new.apk is your new apk file

Now we are NOT done... we cannot use the new apk's... we have to take what we did and add it back to the original apk file to keep proper signature

use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk

now the apk is ready to flash with your new changes
------------------------------------------------------------------------------------------------------------

Hope this helped some of you new themers out there!!!




Useful sites for more

How to Port Android to Another Device

Use APKTool to Decompile, Edit, Translate and Recompile an APK

How I port

Guide: Porting AOSP ROMs made simple

How to port Stock, GB, CM7, CM9 Based ROMS


2 comments:

  1. Thanks for this.. may i have a favor?? please create a video tutorial on how to.. port a rom? thanks...

    ReplyDelete
  2. mate can you provide video tutorials on how to port a rom? thanks.. please? for some people who cant understand.. please..

    ReplyDelete