Friday 5 May 2017

[Guide] MTK Sprout Porting Guide - Port Android One ROMs To MT6582/92 [FULL GUIDE WIth Fixes]


Hello Friends, Today i am Going to Share an Guide to Port MTK ROMs From Sprout To generic MT6582/92. This is Best Guide For Sprout ROM Porting Which Includes All The Fixes For all Commmon Issues Which you Will Face After Booting Into ROM.Sprout ROM Porting Guide Involves Fixes Such As RIL FIX,GPS Fix,2nd SIM and Hotspot Fixes and Many More.SO Without Wasting Much Time Here is Full Guide:-


Note= If You Want to Port CM Based ROM Then You Must have to Use CM As Your Base ROM (For E.g= To Port AOKP/RR/AICP You can Use CM13 as Base).

Thanks To/Credits:-

Don’t forget to give credits Whenever You PORT Any Sprout ROM :-

  1. Suraj Lad (Gathered All Fixes For Sprout Bug Fixing And For RIL FIX)
  2. Yazad Madan And Kishan P Patel (for figuring and making common guide - You can Check it out Here )
  3. Fire855 - For His Awesome Work in MTK (CM11/12/12.1/13/14)
  4. All Sprout Developers 
  5. And You :)

SPROUT PORTING GUIDE:-


  1. Copy All FIles in System/lib/HW Folder From Base ROM to Sprout ROM 
  2. Copy And Replace All CM13 Xport Libs Except libAndroid,libAndroidServer,libandroidruntime,libweb* in Sprout ROM 
  3. 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.
  4. Now Copy Folders Such As Usr , Vendor , Xbin From Base ROM To Sprout ROM.
  5. Copy Folders such as Bluetooth,Firmware,Security and WIFI From Etc Folder From Base ROM to Sprout ROM.
  6. Copy Files Such As Media_codecs*.xml , spn-conf.xml,apn-conf,agps_conf From Base ROM And paste It In Sprout ROM
  7. Finally Copy META-INF Of Base ROM to Sprout ROM
  8. In Boot.img,Extract Boot.img And Copy Init.environ.rc  From Sprout ROM To base ROMs Boot.img And Repack The Boot.img. 
  9. 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.

    Hello Friends, I am Suraj Lad, I Like Android And Tech, Here i Present Availble ROMs For Xiaomi Redmi Note 3G and Many Usefull Tutorials/Tricks :)

    2 comments:

    1. It stuck at bootanimation for me. Please tell me how to fix it sir

      ReplyDelete
    2. Im stuck on bootanimation. What should I do?

      ReplyDelete