64BIT ROM PORTING TUTORIAL

 https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtcuQ8_uTekJS_HicYNW_TJeivstr8FlDG0KtQr1ReUqREE3nK2AHe9eigguX8OCs0LNPNEEAr8BmF6kPAJbVrZhyYddORPlm5qh05spVnAZQarLbiWlD2WqbpJDQWoTjvZ55GK1-JUBQ/s1600/_20150605_165300.JPG





IF you love roms and you wanna try porting one then here is a quick guide for porting 64bit roms

NOTE: THIS does not apply to 32bit devices

If anyone finds additional items or wants to complete this guide please feel free to add it in here.

To use this tutorial then you should know how to work around roms and SYSTEM IMGS
Droidtek360 wont be responsible for whatever happens to your device if you use this tutorial

NOTE: ALWAYS REMOVE RECOVERY-FROM-BOOT.P before you do anything else.

CROSS PORTING GUIDE

SO THE FILES NEEDED TO REPLACE FROM STOCK TO PORT:

BIN FOLDER MODIFICATION:
afm_server
akmd09911
applysig
audiocmdservice_atci
climax
custom_sn
encfs
factory
factory_reset.sh
fusermount
gzip_static
ipod
kpoc_charger
mtkbt
nvram_proximity
seeder
updater
vold

IF SOME OF THE ABOVE FILES ARE ABSENT, DONT WORRY JUST SKIP THEM

FOR ETC FOLDER:
take the whole firmware folder from system/etc/
take the whole mddb folder from system/etc/

LIB FOLDER:
lib3a.so
libacdk.so
libbluetoothdrv.so
libbluetooth_mtk.so
libbypass.so
libcam.camadapter.so
libcam.camnode.so
libcam.camshot.so
libcam.client.so
libcam.device1.so
libcam.device3.so
libcam.exif.so
libcam.exif.v3.so
libcam.hal3a.v3.so
libcam.halsensor.so
libcam.iopipe.so
libcam.jni.lomohaljni.so
libcam.metadataprovider.so
libcam.paramsmgr.so
libcam.sdkclient.so
libcam.utils.so
libcam3_app.so
libcam3_hwnode.so
libcam3_hwpipeline.so
libcam3_pipeline.so
libcam3_utils.so
libcamalgo.so
libcamdrv.so
libcameracustom.so
libcamera_client_mtk.so
libcam_hwutils.so
libcam_platform.so
libcustom_nvram.so
libdpframework.so
libfeatureio.so
libfeatureiodrv.so
libhardware_legacy.so
libimageio.so
libimageio_plat_drv.so
libipod.so
libJpgDecPipe.so
libJpgEncPipe.so
liblocSDK5c.so
liblocSDK_2_5OEM.so
libm4u.so
libMA3-wavesfx-Coretex_A9.so
libmhalImageCodec.so
libMiraVision_jni.so
libmtkjpeg.so
libmtk_drvb.so
libnetworklocation.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libshowlogo.so
libtfa9897_interface.so
libvc1dec_sa.ca7.so
libvcodecdrv.so
libvcodec_oal.so
libvcodec_utility.so
libweibosdkcore.so
mtk-ril.so <= IF U GET BOOT LOOP TRY WITHOUT REPLACING THIS FILE
mtk-rilmd2.so <= IF U GET BOOT LOOP TRY WITHOUT REPLACING THIS FILE

And this subfolder with these libs:
drm\libfwdlockengine.so
egl\egl.cfg
egl\libGLES_mali.so
hw\audio.primary.mt6752.so
hw\audio_policy.default.so
hw\bluetooth.default.so
hw\camera.mt6752.so
hw\gps.default.so
hw\gralloc.mt6752.so
hw\hwcomposer.mt6752.so
hw\lenovopower.default.so
hw\lights.default.so
hw\sensors.mt6752.so
soundfx\libdownmix.so
soundfx\libmaxxeffect-cembedded.so

LIB64 Folder:
lib3a.so
libacdk.so
libbluetoothdrv.so
libbluetooth_mtk.so
libcam.camadapter.so
libcam.camnode.so
libcam.camshot.so
libcam.client.so
libcam.device1.so
libcam.device3.so
libcam.exif.so
libcam.exif.v3.so
libcam.hal3a.v3.so
libcam.halsensor.so
libcam.iopipe.so
libcam.jni.lomohaljni.so
libcam.metadata.so
libcam.metadataprovider.so
libcam.paramsmgr.so
libcam.sdkclient.so
libcam.utils.sensorlistener.so
libcam.utils.so
libcam1_utils.so
libcam3_app.so
libcam3_hwnode.so
libcam3_hwpipeline.so
libcam3_pipeline.so
libcam3_utils.so
libcamalgo.so
libcamdrv.so
libcameracustom.so
libcamera_client_mtk.so
libcamera_metadata.so
libcam_hwutils.so
libcam_mmp.so
libcam_platform.so
libcam_utils.so
libcustom_nvram.so
libdpframework.so
libfeatureio.so
libfeatureiodrv.so
libhardware_legacy.so
libimageio.so
libimageio_plat_drv.so
libJpgDecPipe.so
libJpgEncPipe.so
libm4u.so
libmhalImageCodec.so
libMiraVision_jni.so
libmtkjpeg.so
libmtk_drvb.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libtfa9897_interface.so
libvcodecdrv.so
libvcodec_utility.so

And this subfolder with these libs:

drm\libfwdlockengine.so
egl\libGLES_mali.so
hw\audio.primary.mt6752.so
hw\audio_policy.default.so
hw\camera.mt6752.so
hw\gps.default.so
hw\gralloc.mt6752.so
hw\hwcomposer.mt6752.so
hw\lenovopower.default.so
hw\lights.default.so
hw\mmsdk.default.so
hw\sensors.mt6752.so
soundfx\libdownmix.so

VENDOR FOLDER:
system\vendor\etc\audio_effects.conf
system\vendor\etc\default.mps

FOR DIFFERENT CHIPSET (i.e. 6795 to 6752)

Proceed as above THEN

open build.prop
EDIT THESE LINES

ro.mediatek.platform=MT6795 to MT6752

mediatek.wlan.chip=MT6630to CONSYS_MT6752
mediatek.wlan.module.postfix=_mt6630to _consys_mt6752

FOR BOOT IMG
Unpack both stock and port boots from CarlivImageKitchen Tool
Now
In port boot.img
replace the boot.img-kernel with stock's

and in ramdisk folder copy the following from stock

    fstab.mt6752
    init.mt6752.rc
    init.mt6752.usb.rc


AND DELETE THOSE with mt6795 and mt6595 words.

REPACK THE KERNEL

COPY NEW BOOT IMG TO PORT ROM FOLDER

ZIP AND FLASH YOUR ROM

If u get WIFI AND BLUETOOTH NOT SWITCHING ON OR BATTERY PERCENTAGE WRONG THEN REPLACE init.project.rc

NOW FOR SAME CHIPSET PORTING i.e [ MT6580 > MT6580 ]


Just replace

etc/firmware
etc/mddb

and from LIB,LIB64 and HW folder replace all libs named like this camera.mt6752.so
and replace audio_policy.default.so from  HW folder

from lib and lib64
replace
libcameracustom.so
libaudiocomponentengine.so
libaudiocustparam.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libcustom_nvram.so

Modify your boot img, build prop[if necessary]
zip your rom and flash


Credits: XDA