BonnyInTheBox Guide: All in 1 porting Rom guide [Port Any Rom]

BonnyInTheBox Guide: All in 1 porting Rom guide

BonnyInTheBox Guide: All in 1 porting Rom guide

INDEX:
GUIDE FOR MTK
MTK BUG FIXING
RECOVERY PORTING
QUALCOMM BUG FIXING
Update:-

BonnyInTheBox Guide: All in 1 porting Rom guide [Port Any Rom]

This is for all those users who want to port roms and use them in their devices.

But , before porting any rom,here are some of the main things you should keep in mind.

1)Base Rom :-
What is a Base Rom?

Code:
Base Rom is reffered to the Stock rom or the Default Rom of your device or sometimes the rom from which you will take base files(libs,apns,modem etc).

2)Port Rom
What is a Port Rom?

Code:
Port Rom is the rom which you will port for your device.
like if you are working a rom of another device having similar specifications and porting it for your device then it is called PORT ROM.

3)Kernel
What is a Kernel?

Code:
The kernel is a computer program that is the core of a computer's operating system, with complete control over everything in the system.
the central or most important part of something
In easy words kernel acts as the middle man between the Software and the Hardware

When porting a rom , you should check the Kernel version of the Port Rom and the Base Rom

They both should be similar,
like you can port from :

3.18.xx to 3.18.xx only
3.10.xx to 3.10.xx only


BUGS IN THE BASE ROM OR IN THE PORT ROM.

Yes , our Base Rom and the Port roms may contain bugs,
Those bugs will exist in our final Ported Rom also so , fixing those is not possible – Its always recommended to use a Stable or near to Stable Roms but hi, Custom Roms are made for pleasure only and these roms can’t take place of stock roms.
Many users don’t like Stock Rom (i.e Default Rom) so , they look for a Custom Rom.

Now let’s talk about the main topic for which YOU ARE HERE!
PORTING A ROM!

Also READ  Facebook And Google Were conned out of $100m in Phishing Scheme


In this Guide, i will tell one of the most easy way to BOOT UP THE ROM.
So, lets begin,
This guide will focus on MT6735/MT6753 porting.
Device i used is Coolpad Note 3 Lite
CPU:MT6735

But, it will work mostly on all MT675X SoCs , this can also be useful for MT67XX series but , My main focus is on MT675X

Without any delay let’s talk about how you should port a ROM and what should be your focus at

YOU SHOULD FOCUS ON BOOTING THE ROM INSTEAD OF BUG FIXING AND DOING OTHER THINGS.

WHEN YOU PORT A ROM CHANGE FILES WISELY

DONT JUST COPY PASTE

PORTING A ROM CAN GET TOUGH ACCORDING TO THE ROM, LIKE PORTING AN AOSP BUILD CAN BE EASY BUT PORTING A MIUI BUILD IS CONSIDERED ONE OF THE MOST TOUGHED AND IRRITATING THING.

RESPECT THE EFFORTS BY THE PREVIOUS DEV.

CREDITS, WHEN YOU PORT A ROM THAT ROM WAS MADE BY SOMEONE , PORTED BY SOMEONE or BUG FIXED BY SOMEONE – SO BY ANY MEANS IF YOU KNOW THE SOURCE AND THE DEV OR TEAM WHOSE BUILD YOU ARE PORTING PLEASE GIVE CREDIT.

THANKS.

NOW , FINALLY. LET’S TALK ABOUT THE PORTING GUIDE WHICH YOU ALL ARE WAITING FOR.

What you guys need:-

Code:
1)Base Rom
2)Port Rom
3)Any good Notepad
4)Any Boot.img repack or unpack tool
5)Brain

Now , if you have all the above mentioned things , Lets proceed.

BOOT.IMG :-

BOOT.IMG contains all the magic , it has the KERNEL inside which is one of the main thing.

Porting from Same CPU & GPU:-

NOTE:- When you are porting from a Similar device having same chipset like porting from:-
MT6753 TO MT6753
MT6735 TO MT6735

Use this method (95% times working ):-

System/lib & lib64 :-

Code:
libaudiocomponentengine.so
libaudiocustparam.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libcustom_nvram.so

System/etc :-

Code:
/Firmware folder
/apnconfig
/spnconfig
/agps_profile_conf2
/media_codecs.xml

BLACK SCREEN AFTER LOGO???
REPLACE THIS LIB:- libcam.paramsmgr

To Fix Camera ( sometimes bootloop so try one by one ) :-

from System/lib & lib64 replace all libs starting like this:-

Code:
libcamera.mt6735 (mt6735 is according to my CPU )

 libcameracustom.lib etc
libcamalgo.lib


Unpack Boot.img of both Base & Port Rom

Code:
replace kernel
and init.mt6735.rc ( not recommended always)
and Fstab.mt6735

System/Lib(/64)/HW*

Done , Now zip em and flash.

Also READ  The PWN Phone - The Smartphone Made For Hackers - See Specifications and How To Make Yours

90% Rom will boot with BUGS! ( NO ROM IS THERE WITHOUT BUGS, LOL)


==>READ BUG FIX METHOD ALSO{Later in this Guide}<==

For Cross Porting Like:-

MT6752 etc to MT6753/MT6735

DO REMEMBER TO CHANGE :-

Code:
System/xbin/mnld
System/mddb
System/etc/firmware
System/etc/Apnconf
System/etc/spnconf

In lib(/64)/HW :- add files accordingly to your CPU or rename them.

BLACK SCREEN AFTER LOGO :-

Code:
libcam.paramsmgr

BOOT.IMG PORTING:-

UNPACK both Base Rom and Port Rom Boot.img

In PORT ROM BOOT.IMG:-

Code:
replace the boot.img-kernel

and in ramdisk folder add these files from Base Boot.img to Port Boot.img

 

Code:
fstab.mt6735
init.mt6735.rc
init.mt6735.usb.rc

Note:- Name may differ a little according to your CPU

REPACK THE BOOT IMAGE

NOTE:- If u get WIFI AND BLUETOOTH NOT SWITCHING ON OR BATTERY PERCENTAGE THEN REPLACE

Code:
init.project.rc

Done , You have succesfully ported Boot.img

Now , Lets focus on BUG FIXING

Bug Fixing isnt easy as it seems.
Replacing any wrong file or not supported file can easily give you bootloops.

It depends from ROM to ROM.

BonnyInTheBox Guide: All in 1 porting Rom guide

BUG FIXING[MTK]

Let’s Begin.
If any lib missing in Base leave that – DONT WORRY


NOTE:- CHANGE LIB FILES FROM BOTH lib & lib64 folders

[I][SIZE=”3″]

If you face “This rom is for Coolpad Note 3 Lite and your device is “K4Note”
To remove this delete the assertlines in Updater-script

ALWAYS CHANGE DPI IN BUILD.PROP ACCORDING TO YOUR STOCK ROM

Bootloop when porting

Code:
*libandroid_runtime.so
*libandroid_servers.so
*libmedia_jni.so

*Repack boot.image (properly)

RadioFM

Code:
\system\bin\fmradio
\system\etc\firmware\mt6620_patch_e3_hdr.bin
\system\etc\firmware\mt6620_patch_e6_hdr.bin 
\system\etc\firmware\WMT.CFG 
\system\lib(/64)\libfmcust.so
/system/lib(/64)/libfmjni.so

Sensors

Code:
/system/bin/akmd*
/system/lib/libsensors.so
/system/lib/libms3c_yamaha.so ( acc. To device)
/system/etc/firmware (folder)
/system/bin/servicemanager
/system/bin/sensorservice
System/bin/msensord

system/etc/permissions/:-
android.hardware.sensor.xxxxx.xml


FIX Offline charging:-

Code:
In Boot.img -> sbin/healthd

System/Lib(/64):-
Showlogo

System/bin:-
Kpoc_charger


Bluetooth\Wifi not turning On\Off(old)

Code:
\system\lib\module\mtk_stp_wmt

Wifi

Code:
/system/etc/wifi (folder)

/system/bin/netcfg
/system/bin/dhcpcd
/system/bin/ifconfig
/system/bin/hostap
/system/bin/hostapd
/system/bin/hostapd_bin
/system/bin/pcscd
/system/bin/wlan*
/system/bin/wpa*


/system/lib(/64)/libhardwarelegacy.so

Hotspot:-

Code:
/system/bin/netd

*follow Wifi fix also*

Camera

Code:
 firstly try one by one:
\system\lib(/64)\libcameracustom.so
\system\lib(/64)\libcameraservice.so
System/lib(/64)/camalgo
/system/etc/media_profiles.xml
/system/lib(/64)/libcamera.so
/system/lib(/64)/liboemcamera.so
\system\lib(/64)\hw\camera.default.so
\system\lib(/64)\libcamera_client.so
\system\lib(/64)\libcamer aprofile.so
\system\lib(/64)\libmhal.so
\system\lib(/64)\libmhalcontent.s o
\system\lib(/64)\libmhaldrv.so
\system\lib(/64)\libmhalmdp.so
\system\lib(/64)\libmhalpipe.so
\system\lib(/64)\libmhalscenario.so
\system\lib(/64)\libmhalutility.so
\system\etc\permission\android.hardware.camera.front.xml

Other cam files if any
*try one by one*

Also READ  How To Change IP Address of your Android Phone Using Psiphon Pro and Uc Browser

CamCoder/HwDecoder

Code:
\system\lib\libOmx*.so 
system/etc/media_codecs
 
Green/pink Camera / video lagging
system/lib(/64)/libdpframework.so


SD card/Memory

Code:
mt67**.fstab in boot.img

/system/bin/vold
/System/bin/pq

System/bin/sdcard

WhatsApp Media Fix:-

Code:
from System/bin/  replace these files:-
Media
mediaserver
netd
service
servicemanager
surfaceflinger

BonnyInTheBox Guide: All in 1 porting Rom guide
GPS

Code:
\system\xbin\libmnlp 
/system/etc/gps.conf

Touch Screen(Haptic)

Code:
/system/usr
/system/usr\keylayout\Generic.kl ->fix HomeKey

NFC ( experimental)

Code:
System/etc/: Nfc files 
System/etc/permissions/ nfc files
System/lib/libnfc****** ( all starting from nfc )

Sim1/2 (RIL)

((Trustbin.bin flash it accordingly to LP or MM etc of stock rom))

Code:
\system\etc\firmware\modem.img
\system\etc\permission (RIL)

Try these aswell if ( you may suffer Bootloop )

/System/bin/mtkrild
/System/bin/mtkrildm1

/system/bin/stmd

EXPERIMENTAL FIX for ril:-

Code:
System/ Lib(/64)/ :-
Nvram
Nvram_sec
Nvram_platform
Nvrammagentclient

System/bin:-
Gsm*** 

System/etc/trustzone

Lib(/64):-
Libril
Libc2k***
Librilmtk

Audio/Sound:-

Code:
\system\lib\libaudio* .so
system/lib(/64)/libaudiocustomparam
system/lib(/64)/libaudiopolicymanager
system/lib(/64)/libaudiopolicyservice
system/etc/audio_effects
system/etc/audio_policy
System/lib(/64)/soundfx

Sometimes if Sound isn’t working fully :::::

Code:
System/lib(/64)/hw/audioxxxxxxxxx (audio files)

Bluetooth:-

Code:
system/etc/bluetooth
System/etc/permissions/android.hardware.bluetooth.xml

/system/bin/uim*
/system/bin/bluetooth*
/system/lib(/64)/libbluetooth_mtk.so
/system/lib(/64)/libbluetoothem_mtk.so

BonnyInTheBox Guide: All in 1 porting Rom guide
Ads

Code:
/system/etc/hosts ->replace with new files or use tweak.


=====>>ADVANCE BUG FIXING:-


Volte Fixing

( Will only work if your Base Rom , Port Rom and Kernel supports VOLTE )

Code:
Boot.img:-
Zimage ( kernel - volte supported )
init.volte.rc

==THIS SHOULD NORMALLY FIX but if it doesn’t try :- ==

Code:
System Folder:-
bin/volte_stack
bin/volte_imcb
bin/volte_ua

lib(/64)/volte_imsm

build.prop(Not always required):-

ro.mtk_volte_support=1
persist.mtk.volte.enable=1

FingerPrint:-

[Try one by one][If any file missing leave it]
Usual way to fix :-

Code:
System/etc/permissions/android.hardware.fingerprint.xml
System/lib(/64)/libgatekeeper.so
System/lib(/64)/hw/gatekeeper.mt6735.so
System/(/64)/libmcgatekeeper.so

System/lib(/64)/hw/fingerprint.default.so ( can break FP in some devices)

Advanced ( if usual doesn’t work ):-

Code:
System/bin/:-
fingerprintd
Gx_fpd
tee_deamon

Lib64/lib:- ( if any missing leave that)
Fpclient
Fpalgorithm
Fphal
FPservice


IF ROM DOESNT BOOT TAKE LOG ( From ADB)
adb shell logcat > log.txt
and check what is causing issue


Code:
*Updated Bug Fix Guide for MTK
*Added SNAPDRAGON Bug fix guide.
*Guide to port TWRP also updated.
*Improved the thread.
*Added more fixes.
*Qualcomm porting guide added.

BonnyInTheBox Guide: All in 1 porting Rom guide

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *