| || |
[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