[TUT] How to easily port CM7,CM9,CM10 Based ROMs to HTC Aria

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
Easiest and best way to port CM7,CM9,CM10 Based ROMs to HTC Aria/Intruder/Gratia

Code:
I do not guarantee any successful porting.
I am not responsible for [B]bricked devices, dead SD cards, or a broken device[/B]. 
[B]YOU[/B] are choosing to make these modifications,
and if you point the finger at me for messing up your device,
 I will laugh at you. 
->Copied from some xda thread.
*****

But a rom, no matter how bad should *not* do any physical non recoverable harm to your device,flashing a rom or restoring a nandroid backup via cwm *should* immediately fix any problems what so ever.
And I will try to help in any ways I can.​

I am NOT a developer, I can not code,compile,etc, I am only an android enthusiast with half a brain able to follow specific instructions.

This guide is actually somewhat a good combination of various "how to port roms"
guides found here on xda suited and very slightly modified for our beloved Aria.
Thanks to all of those threads and their writers.
Actual Tutorial starts here:
I will try to make this guide as straight forward as possible.

PORT ROM:
First you need to figure out what rom you are going to be porting.
For our Aria, The rom you want to port should belong to a device that has:
  • HTC brand (optional but recommended)
  • A ArmV6 CPU (VVVV important)
  • A HVGA Resolution (optional, any mdpi should do,if not just open the system apk files using 7zip and resize all the BIG images.)
The Rom needs to be:
  • CM7 BASED OR CM10 BASED OR CM9 BASED.
  • The full zip size less than 150MB(Recommended).

What Does Port Mean:
This simply refers to the rom you will be trying to port.

Recommended device to port from is the HTC Wildfire S a.k.a Marvel.
But any other device

BASE ROM:
What Does Based Mean:
It means that the rom should have similar sources and stuff,
Meaning you can only attempt to port a android 2.3 rom if you already have a 2.3 rom on the device.(In our case cm7).
So,
For porting 2.3 roms, chose cyanogenmod 7.2 as BASE.
For porting 4.0 roms, chose cyanogenmod 9 as BASE.
For porting 4.1 roms, chose cyanogenmod 10 as BASE.
ETC... I hope you get the point.

:fingers-crossed:
 
Last edited:

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
Thing you will need:
  • A good Zip extractor and compressor. (I use 7zip, its free. If you have winrar or something else,it will also do.)
  • Notepad++ (This thingy is awesome! And you need it for some stuff)
  • Android SDK(Not the whole thing, just adb zip from our sticky thread will do.)
  • Some Basic Android Knowledge, Root knowledge.
  • Mostly Common Sense.
Step 1:
Extract our device rom zip and name the folder AriaRom,
Extract our Port rom zip and name the folder PortRom.

Step 2:
Delete the following folders on the AriaRom/system folder:
  1. App(You can keep some non conflicting indepent apps if you want)
  2. Framework
  3. Fonts
  4. Media

Step 3:
Go to
Code:
PortRom folder/system
and copy:
  1. App(You can keep some non conflicting indepent apps if you want)
  2. Framework
  3. Fonts
  4. Media

    and then paste them to AriaRom/system.

Step 4:
You need to open these two folders side by side(on windows, open both folders then right click on the task bar and click "Tile windows vertically").
The two Folders are:
Code:
[LIST]
[*]AriaRom/system/etc
[*]PortRom/system/etc
[/LIST]
In
Code:
etc/permission
folder copy all the permissions files in PortRom to your AriaROM folder except
Code:
platform
handheld_hardware
Then open init.d Folder in AriaRom and Delete Everything except
Code:
banner
and then copy all the files inside init.d folder of PortRom to init.d folder of AriaRom.

Step 5:
Now
Code:
AriaRom/system/buid.prop
and
PortRom/system/buid.prop
files using Notepad++

On AriaRom Build.prop make changes as you wish.
Code:
[LIST]
[*]ro.build.id=
[*]ro.build.display.id=
[*]ro.build.date=
[*]ro.modversion=
[/LIST]
Copy and replace these values from PortRom buildprop to Aria rom buildprop.
ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=

Also Copy anything you Find Extra and important-ish in ADDITIONAL BUILD PROPERTIES using common sense.(Not much major stuff, but if bootlooped, copy whole thingy.)

IMPORTANT Step of commons sense:
Open up both
Code:
 META-INF/com/google/android/updater-script
using Notepad++.

Compare AriaRom AND PortRom line by line(on two tabs in notepad++ easily done).
Copy extra/additional lines from PortRom which are not present in AriaRom to aria roms updater script.

Step 6:
If You find any extra file or folder in system folder of PORTrom than copy them to your Ariarom system folder.

Finally, zip the
Code:
META-INF
system
boot.img
data(if exists).
folders/files togather and use "normal" compression if asked.
Name the zip to whatever you want, and walla you have successfully ported the rom!
 
Last edited:

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
:fingers-crossed:
Doing the above steps should land you a pretty solid rom, as solid as the base rom.


Still,Incase of problems:
If the ported rom does not boot:
  • Stuck at boot screen
  • Bootlooping
Then copy system/lib/
Code:
    libandroid_runtime.so
    libandroid_servers.so
    libmedia_jni.so
files from PortRom to AriaRom system/lib.

It should boot, if it still doesnt, check the above steps and find out what you did wrong.
Common reasons could be:
  • Build.prop mess up
  • Updater Script mess up
  • Forgot to delete or copy file

After it boots,
  • Everything that worked on Base rom, should work on Ported.
  • Every problem on Base Rom will exist on Ported.

In case of root related problems(settings not being saved,system app FCs,etc), install a root app like titanium backup or something and check if it works,if it doesnt its surely root issue,just download and flash latest superuser zip.

If some FC,Port rom funciton not working,etc issues appear, you need to decompile framework-res.apk using apktool and change device specific xml files to ours.This is a part where I have the most trouble and suck at.

Just search xda for
How to Logcat,
this will help you to find the problems and search xda to solve them. Ask me if you want on this thread, & I will try to help, but I dont think I will be able to help much as I have very limited knowledge on compile De-compile stuff.
If someone is good at framework-res and framework decompile & recompile stuff, please help us.

Thanks for reading this,I hope you port over some awesome roms to our device.
:highfive:
 

dansou901

Recognized Contributor
Apr 10, 2012
3,120
1,209
243
30
Aachen
I just tried to port the PACman ROM from Samsung Galaxy Ace to the Aria, but I am stuck at boot screen after following your tut, which is awesome by the way. Could you post a working build.prop and updater-script for this ROM? Maybe this will help me get it booting...
 

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
I just tried to port the PACman ROM from Samsung Galaxy Ace to the Aria, but I am stuck at boot screen after following your tut, which is awesome by the way. Could you post a working build.prop and updater-script for this ROM? Maybe this will help me get it booting...
That's an Armv7 device.
Still I'm gonna download it & try.
In the meantime take a look at bootclass path.
Why are SMARTphones soo... Freaking Dumb?
 

dansou901

Recognized Contributor
Apr 10, 2012
3,120
1,209
243
30
Aachen
That's an Armv7 device.
Still I'm gonna download it & try.
In the meantime take a look at bootclass path.
I don't think so... the Samsung Galaxy Ace with device number S5830 should be Armv6, but in the Galaxy Ace Forums there is also a place for the Galaxy Ace II, which is Armv7. Maybe that's a bit confusing. But nims11 PAC-Man Rom is definitely for the Armv6 device.
 

rami.ejle

Senior Member
Apr 8, 2012
153
22
0
24
Aleppo
hey man thnx for the tut :D but i tried porting the paranoid rom like you but i keep getting this error while flashing ( set_perm: some changes failed) i think it have something to do with the updater-script, could u upload the build.prop and the updater-script for me ? :D and btw why do we need the sdk ??

---------- Post added at 02:43 AM ---------- Previous post was at 02:03 AM ----------

actually now i tried not to change the updater-script and the rom flashed but stock at boot :( pleaaase help me i really want to try the paranoid rom (ive been trying to port the "pa_marvel-2.54-beta1-08NOV2012-164651" )
 
Last edited:

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
hey man thnx for the tut :D but i tried porting the paranoid rom like you but i keep getting this error while flashing ( set_perm: some changes failed) i think it have something to do with the updater-script, could u upload the build.prop and the updater-script for me ? :D and btw why do we need the sdk ??

---------- Post added at 02:43 AM ---------- Previous post was at 02:03 AM ----------

actually now i tried not to change the updater-script and the rom flashed but stock at boot :( pleaaase help me i really want to try the paranoid rom (ive been trying to port the "pa_marvel-2.54-beta1-08NOV2012-164651" )
Here you go,
http://pastebin.com/62hbaQwL
on THAT ROM,
IF you follow the guide & use my posted script,
100% assurance rom will boot and work. except cm
The sdk is for getting the logcat when a problem occurs.

Why are SMARTphones soo... Freaking Dumb?
 
Last edited:

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
I don't think so... the Samsung Galaxy Ace with device number S5830 should be Armv6, but in the Galaxy Ace Forums there is also a place for the Galaxy Ace II, which is Armv7. Maybe that's a bit confusing. But nims11 PAC-Man Rom is definitely for the Armv6 device.
In that case you'll need to unpack both boot.img aka the kernel , fix bootclass path in init.RC by replacing it with the value from port roms init.rc.
Ill try to port that rom soon and upload a fixed boot.img (if I can get it to boot),if you don't beat me to it. it looks cool.

Why are SMARTphones soo... Freaking Dumb?
 
Last edited:

dansou901

Recognized Contributor
Apr 10, 2012
3,120
1,209
243
30
Aachen
Bootclasspath is the same on both roms. So there must be a mistake in updater-script and / or build.prop. I've just messed up my updater-script, I guess, so I'll make a new one and post it later together with the build.prop.
 

dansou901

Recognized Contributor
Apr 10, 2012
3,120
1,209
243
30
Aachen
Sadly, I didn't get any time to try so far. But on Sunday I lost my Gratia, so I won't continue this project; I've upgraded to the HTC Desire X.
 

aster190

Senior Member
Jan 27, 2012
108
13
0
Sadly, I didn't get any time to try so far. But on Sunday I lost my Gratia, so I won't continue this project; I've upgraded to the HTC Desire X.
That's a shame. Similar thing happened to me. I lost my Aria right before i had a chance to try this, and upgraded to the Nexus 4.
 

sifat3d

Senior Member
Nov 2, 2012
202
75
0
Chittagong
sohanchy.com
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