Curtis1973
Android Expert
[GUIDE] [PORTING] [CM BASED ROMS]
This Is NOT A 100% Sure Shot For Every Port. No Guide Is.
- Requirements -
Experience Level : NOT NOVICE
Somewhere Above This Level Is A Nice Place To Begin LOL..
![Smile :) :)](/styles/smilies/google/smilie.png)
Winrar
Notepad ++
Base Rom From Your Device That Works
Port Rom With Similar Hardware Specifications To Your Device That Works...Mostly.
(meaning processor type,on board memory of all types,proper display size isn't to much of a biggie as long as the port rom is built using same dpi as your device..)
(meaning processor type,on board memory of all types,proper display size isn't to much of a biggie as long as the port rom is built using same dpi as your device..)
Some Patience
Ability To Diagnose Problems
Testing Potential Ports And Finding Errors And Fixing If Possible
(Some Cant Be...)
(Some Cant Be...)
- Definitions -
Base Rom Is Any CM Based Rom On Your Device That Has Already Been Built And Works,This Will Be Used As Base For The Port
Port Rom Is What You Want Working On Your Device From Another Device Of Similar Type..There Are Many Out There.
Let's Begin...
Step 1. Extract All Contents Of Base Rom To A Folder On Your Work PC Called "Base"
Step 2. Extract All Contents Of Port Rom To A Folder On Your Work PC Called "Port"
Step 3. We Will Start With Editing The Updater-Script (Located In Meta-Inf/Com/Google/Android Folder Of Base And Port Roms... First Open The Base Rom Updater Script In Notepad++. We Want To Edit All Lines You See In The Provided Picture Below (Mainly The Setting Permissions Lines..But You May See Something Near End Or Even At Start...Usually A Line Your Experience Tells You Needs To Be In The Base Roms Edited Updater-Script...Experience Here Is A Big Plus...). Open The Port Rom Updater-Script And Copy The Same Lines And Paste Them..Replacing The Base Roms Lines With Those From The Port Rom..Now There May Be Other Pertinent Items As All Roms Are Different. But In General These Are The Ones You Want To Change. You Will Have To Examine The Scripts. Anything That Looks As If It Needs To Be Added. Try It. May Result In Failure Of Script. But This Is What Porting Is. You Have To Try Many Things. Feel Free To Experiment.
Step 4. Now We Want To Move On To Replacing The Files And Folders In System That Need To Be Replaced In Base Rom From Port Rom. First Delete From Base Rom folders App,Priv-app,Media,Fonts, And Framework. Now Copy Over The Same Folders From Port Rom To Base Rom.
Step 5. We Want To Enter Etc Folder Of Base Rom And Replace All Files In Permissions Folder Except Platform.xml and Handheld_core_hardware.xml With All Files Except Platform.xml and Handheld_core_hardware.xml From Port Rom.
(Now...In Some Port Tries..You Will Find You Just Need To Leave Original Base Rom Files In Permissions And ONLY Add Files From Port Roms Permissions Folder That Do Not Exist In Base Roms Permissions Folder....Trial And Error Folks.. In Some Ports This Step Causes Issues With Data,Hardware,Other..But In Some Ports It Will Cause Same Issues If You Do Not Do Step 5. No Hard And Fast Rule Here. Trial And Error. Must Do It To See If You Get Issues. And There Will Be Some I Assure You. And Some Wont Be Related To This Step But Some Will.)
Step 6. Now We Want To Copy Over All Files In Etc/Init.d To Base Rom From Port Rom Except 00banner. You May Encounter Issues Here With Items Associated With Key Layout,NFC And Other Depending On What Files Are In Init.d. Use Best Judgement To Decide After Opening These Files To See What They Are Trying To Accomplish As To Whether Or Not They Will Adversely Effect System. I Personally Leave Them Then Diagnose The Issues As I Go Along. If I Think One Or More Made Things Funky..I Remove It And Try Another Build.)
Step 7. This Step Is Important. Examine The Port Rom For Folders That Are Not In Base Rom..No Matter Where They Are. And Put Them In Base Rom In Same Location As They Were In Port Rom.
Step 8. Now We Want To Fix Framework-res.apk. Of Port Rom With A Few Files From Base Roms Framework-res.apk. Open Base Rom Framework.apk That You Swapped Over From Port In A Window Of Winrar And Navigate To XML Folder. Drag These Files In To The Apk From Original Base Framework-res.apk : Vendors.xml,Storage_list.xml,Power_profile.xml,Eri.xml And Apns.xml. Winrar Will Repack As You Go. Once Done Just Exit The Winrar Window And The New Files Will Be In Place.
Step 9. Here Is Where We Have To Experiment A Bit. First Do A Build WITHOUT Doing This. But If Calling Fails Or Phone Crashes,Etc..Do This... Copy Back To Base Rom Its Own Original Files From Framework Folder...The Files Are Telephony-common.jar,Telephony-msim.jar,Mms-common.jar,Input.jar and Ime.jar. Depending On The Issue. Replace One Or More Of The Files Listed.
Step 10. Now We Want To Edit The Build.prop To Reflect Changes Made. In General These Are The Lines You Want Right. But Each Rom Has Lines Specific To It...Use Your Head And Examine The Port Roms Build.prop For All Lines You May Need.
Needed Lines From Port To Base Build.prop
(There May Be Other Lines That Are Obvious To You That Need To Be There..These Are In General. All Roms Have Specific Build.prop Properties. Some Knowledge Here Is Extremely Helpful To Potential Porter.)
ro.build.id=
ro.build.display.id=
ro.product.name=
ro.product.locale.language=
ro.product.locale.region=
ro.config.alarm_alert=
ro.config.ringtone=
ro.config.notification_sound=
Can Edit These
ro.build.date=
ro.build.user=
ro.build.host=
Step 10. Now We Want To Zip Up Our Project And Try Booting It Up. Use Winrar To Zip All FIles In ROOT Of Base Rom Folder.
Step 11. Reboot To Recovery And See What You Get.
Now. You Will Inevitably Encounter Errors. So Get To Doing Some Detective Work. "Ok...My Hardware Keys Are Acting Funky..Could It Be Something In Init.d? Or Maybe Input.jar In Framework?...) This Kind Of Thing. In The End. You May Get It Going Fine. But Expect That Some Just Wont Work.
May Revise This Guide As I And Others Find New Methods For Doing Something That Will Replace A Step Above Of Improve A Step Above Or Even Add A Step Above.
Last edited: