- Copy All FIles in System/lib/HW Folder From Base ROM to Sprout ROM
- Copy And Replace All CM13 Xport Libs Except libAndroid,libAndroidServer,libandroidruntime,libweb* in Sprout ROM
- Now Copy All Bins From Sprout and Paste it Base ROM, It Will ask to Replace That Time Skip Them And Now Copy All Bins From Base ROM and paste it in Sprout ROM.
- Now Copy Folders Such As Usr , Vendor , Xbin From Base ROM To Sprout ROM.
- Copy Folders such as Bluetooth,Firmware,Security and WIFI From Etc Folder From Base ROM to Sprout ROM.
- Copy Files Such As Media_codecs*.xml , spn-conf.xml,apn-conf,agps_conf From Base ROM And paste It In Sprout ROM
- Finally Copy META-INF Of Base ROM to Sprout ROM
- In Boot.img,Extract Boot.img And Copy Init.environ.rc From Sprout ROM To base ROMs Boot.img And Repack The Boot.img.
- Now Repack The Sprout ROM To AnyFILENAME.Zip And Flash It
If You Followed All Steps Properly,It Should Boot into ROM With Some Bugs To Fix Them Follow The Following Fixes And Repack And Flash.
========================
BUG Fixes in PORTING
========================
NOTE:- For BugFixes I Suggest to Keep WinMerge And TickleMyAndroid Softwares in Your PC Those Helps a lot.
1) Fix 2nd SIM And Implement MTK RIL :-
- Extract Telephony_common.jar Of Both ROMs and Replace MediaTekRIL From CM to Sprout + 2 Lines in Build.prop.
2 Lines are :-
ro.telephony.ril_class=MediaTekRIL
ro.telephony.ril.config=fakeiccid
- Also Replace Smalies like SIMRecords, UICCCard1 , UICCCard2 , UICCCard , Subscriptioninfoupdater From Telephony --> No Sim FIX
2) Fix RIL in AOSP ROMs [COMPLICATED]
Extract Telephony_common Of Both ROMs ( Take Base as AOSPA ) And Merge Vacant Spaces in Files Accordingly.
- Phone.smali
- PhoneBase.smali
- PhoneFactory.smali
- PhoneProxy.smali
- RIL$1.smali (1 Line Only )
- RIL$2.smali (1 Line Only )
- RIL$RILReceiver.smali (All)
- RIL.smali
- SubscriptionInfoUpdater.smali (All)
Now In Uicc Folder Merge Everything In Following Smalis
- UiccCard.smali
- UiccCard$2.smali
- SIMRecords.smali
- IccCardProxy.smali
Now to Fix USSD :-
- In Uicc Folder
- Gsmphone.smali ( add onUssdFinished Method ( Compare DU Tele) )
- Now Add mtkRil And SProut RIL(if Not Added previously) and Repack Telephony And Add two MtkRIL lines in Build.prop ( of fakeiccd )
3) AutoRotation Fix And Hotspot Fix:-
For AutoRotation:-
Extract Framework-res.apk, Values> Bool ( <Boot>Rotation Sensor= true)
For Hotspot:-
Extract Framework-res.apk, Values> arrays( <arrays>wlan Change To ap )
4) For FM RADIO Fix :-
- Copy All LibFm* , LibMediaplayer , libmtkplayer , libaudioflinger
- Copy Mediaplayer.smali ( From CM or AOSP based ROM ) ( If PORT ROM Is CM Based Then take All From CM Based ROM Else If Its AOSP based Then Take libs form AOSP ROMs)
- Copy FM Radio app From Any Other Working ROM and Add it in Your ROM (System/Apps)
5) Fix Home Button To Show Recent And Back Lit Of Buttons
Decompile framework-res.apk And Go To Values And Add Following Lines
To Show Recent:-
<integer name="config_longPressOnHomeBehavior">1</integer>
For Backlit:-
<bool name="config_button_brightness_support">true</bool>
6) GPS Fix
- Delete libmnlp in xbin
- add libmnl and libcurl in libs From Your Base ROM
- Replace mtk_agpsd in bin
- remove all gps.**.so in hw leaving only gps.mtxx.so
That All Forks For Now, Happy Porting Dont Forget To say Thanks And If You Have Any Doubts Or Queries, Do Ask Them In Our Comment Section And Visit Again For More Tech Tips and Tricks.