[GUIDE] How I port
Okay, so there have been many many many requests on porting ever since I've ported things. Instead of getting requests all the time to port things, I'm going to give you my knowledge on porting. Sorry if it is scrambled everywhere, but I like to get off topic a lot
First of all, you're going to need to know a zip file inside and out. That means what all the files mean, especially the .so files. These are a matter of boot or not on a ROM.
Second, of course, you're going to need to know obviously which version of the ROM you are trying to port. So if it is a GB ROM, try to use CM7 as your base. Or even our new AOSP gingerbread (thanks redbaron )
Third, there's three folders in a zip that are the most important ones you're going to deal with. The apps, frameworks, and media folders. These are what makes the ROM (especially themed ROMs) so cool. All the features, options, etc.
Fourth, patience and adb are going to be your best friends. If it doesn't boot, you're going to need to read the adb to see the problems and patience, because a lot of pulled batteries are going to be needed in these situations.
Fifth, I'm going to be referring to the ROM you are basing it off of, be it tdm's CM9, any of the IHOs, as BASE. I'm going to be referring to the ROM you are porting as PORT. Just to simplify things and not let things get a little confusing.
So, if you're wanting to port a regular ol' CM7 themed ROM from another phone, you're going to do this -
Delete the apps, framework, and media folder from BASE. Replace them with the folders from the PORT. Then it should boot.
If it doesn't boot, there's usually one .so file in /system/lib that determines boot or not. That file is 60% of the time libandroid_runtime.so. Delete it from BASE and replace it with PORT.
That is a plain port. Simple.
Now, for CM9, there is a little bit of a difference. There are two important files located in BASE in /system/media called LMprec_508.emd and LMprec_600.emd that are VERY important. Without these, I couldn't get MIUIv4 to boot. It took a little while to figure this out, lol. So just make sure when you port CM9 based ROMs that you have the originals in there.
Now don't go off thinking you can do this with just any ROMs. There are limits. For example, you can't port Sense, TW, MotoBlur, or any other ROMs that big for that matter. If it is based off of CM7, then you can port it. If it is based off CM9, then you can port it.
Remember- This isn't full proof. I have encountered problems with CM9 based ROMs with this method (phone FC) and a few other problems with other ROMs.
Some fixes I've run into that might be note worthy
For LeWa, for data, I've had to replace the apn.xml from the framework-res.apk (/res/xml). from BASE to PORT
For MIUIv4, for phone FC, I had to decompile the framework.jar in /system/framework (for both BASE and PORT) and go to com/internal/android/telephony/cdma and replace all the files with the ones from BASE.
For 99% of ROMs
To fix MMS on almost all ROMs, you're going to have to do this:
decompile the framework.jar (use apktool), go into the folder I mentioned for the phone FC fix for MIUIv4, and replace a file called CdmaSMSDispatcher.smali with the one from the BASE.
Now hopefully this causes two things:
-More of an option of ROMs available
-Me stop getting requests
Last edited by gannon5197; 04-01-2012 at 03:35 PM.
Re: [GUIDE] How I portFor the Hardcore advanced wannabe porters only!I thought that I would throw this guide in here because I made it for another person and it somewhat belongs. I made this for a person porting Sense to the Triumph and thought some of you could contribute. You could most likely use this to port ROMs such as Sense, TW, MotoBlur, etc.
How to port Sense.
This is a very difficult process that I hope you'll understand.
First step is to find a device that is preferably VERY similar to your device, in this instance I guess we would use the htc thunderbolt, which I've been told multiple times that it is used for the MT.
You're going to want to use CM7 for parts. Simple enough.
I will be referring the Sense ROM to SENSE and CM7 as BASE to simple things up. So remember that.
When I say replace, I would recommend deleting from one and adding it with the other
Open up Sense and Base in different windows.
Put in the boot.img from Base into Sense (make sure you put the original boot.img in some other place that you'll remember)
go into /system/usr on both
replace keylayouts and keychars from Base into Sense (this is just your keys)
download dsixda's kitchen (http://forum.xda-developers.com/showthread.php?t=633246)
Get the ROM you have so far set up in it and what not (I'm a little fuzzy at this part)
Once you get done with that, run the menu in terminal and navigate your way to decompile the boot.img (action key- "a") and then run the same thing except run the action key "w" to decompile the original boot.img. So the key here is to decompile both boot.img's.
Go into the ramdisk on both and go into init.rc
THE MOST IMPORTANT PART IN THIS (THE MATTER OF BOOT AND BOOTLOOP) IS THE LINE
"export BOOTCLASSPATH" near the top. It will have a bunch of lines after it. Now in the Base's boot.img, delete this whole line. Replace it with the lines from Sense's boot.img.
Now you can add anything else you want that looks like it belongs (preferably anything sense related)
Don't recompile the boot.img yet.
Now we add a2sd. To do this, just follow this guide (https://www.facebook.com/note.php?no...58823170833688)
The only thing you do in there is the edits to the init.rc, don't listen to the decompiling/recompiling mentions. Now you can go back into the menu for the kitchen and recompile the boot.img (action key - "b"). Now don't compile the WHOLE ROM, just take the new boot.img in working_** and put it into the Sense zip.
Now you're going to want to download my ROM (sorry, just don't feel like uploading each individual file) http://gannon5197.blogspot.com/2012/...se-booted.html
And go into the /system/bin on both
these are the files you're going to need: a2sd, bash, apps2sd.hlp, busybox.a2sd, chka2sd, jita2sd, launcha2sd, starta2sd, and maybe possibly sh (try once without it)
And you're going to want to set permissions for each one of these in the updater-script (look at mine for references)
Now also look at my zip and you'll see move_cache_sd. Put that in yours and set permissions for it in updater-script (use mine for references)
After that, the other stuff is mainly just getting rid of all the bloatware, (look in /system/app and /system/media) I wouldn't delete any libs as of right now. If you try to flash it and it reboots recovery then it is too big.
If it is too big, you're probably going to want to move a lot of the apps to data. To do this, just make a file called data/app/put_your_apps_here on the root of the zip. You're going to have to set permissions for it in the updater-script, but use the test.zip I sent you in the original.
This will most likely get you booted. Nothing will likely work. Which is expected. If you have any problems, just use logcat. It will be your bestfriend. Have fun porting
Last edited by gannon5197; 04-01-2012 at 04:32 PM.
- 04-01-2012, 05:27 PM #3
- 04-01-2012, 09:14 PM #4
- 04-01-2012, 09:30 PM #6
- 04-01-2012, 09:33 PM #8
- 04-01-2012, 09:36 PM #10
- 04-01-2012, 10:10 PM #12
Re: [GUIDE] How I port
I'm not a dev, but I'd like to add that anyone who ports something please think VERY hard before posting / releasing it. Be prepared to support it, be as detailed as possible about problems / issues and realize the responsibility you undertake by distributing software for others to use. Yes, it's their choice, but there are those who flash blindly.
- 04-01-2012, 11:25 PM #13
- 910 Posts
- IHOCM7.2 || AOKP
- 04-01-2012, 11:49 PM #14
- 04-02-2012, 12:40 AM #15
- 04-02-2012, 02:54 AM #16
Re: [GUIDE] How I port
If it turns for the worse I can just take down the guide.
But after all, this is where I started so maybe others could blossom from this?
- 04-02-2012, 05:35 PM #19
- 04-03-2012, 04:23 PM #20
- 04-07-2012, 09:54 AM #21
- 04-07-2012, 12:42 PM #22Themer. You've seen them
- 2,120 Posts
I thought I'd share http://www.google.com/gwt/x?gl=us&cl...evelopers.html
Its all about deodexing and I noticed at the bottom it says that apps deodexed using scripts will force close if they have sound files because the files are compressed and they malfunction. It suggests manually deodexing them instead (using baksmali). I thought this was interesting since I know alot of you people that are porting are experiencing force closes with apps.
- 04-07-2012, 01:42 PM #23
- 04-15-2012, 12:13 AM #24
- 825 Posts
- OV:quattrimus OM:BACKside
This is how I port to the optimus m, it has the list of all the files needed to be changed and I think I may need to add that one lib file gannon was talking about because there was a couple of roms I couldn't get to boot....
- 04-16-2012, 12:10 AM #25