Post by Edmon E. Gabonilas on Sept 29, 2015 20:29:40 GMT 8
HOW TO CREATE CUSTOM ROMS/PORTING CUSTOM ROMS
(For Questions reply nalang po kayo, tested ko na yung tutorial na to, ang dami ko na custom roms )
---------------------------------------------------------------------------------------------------------
PLEASE DO IT AT YOUR OWN RISK
This Guide is so Easy
Make Backup First!
REQUIREMENTS:
• WIndows Running PC or Laptop.
• 7zip Compressor-Download
• Notepad++ -Download
• Time(as per you how much take to understand)
• Your Base Rom(stock Rom,in any format-CWM flashable or SP_tools Flashable,Prefer to have Both)
• CWM Recovery
• SD card & Card Reader.(some phones do not have SD slot so no worry for them,i have alternative way)
• SP_Flash Tools to Unbrick In case Device Get Bricked- Download
Yung ROM na Kukunin nyo ay dapat same chipset ng sa inyo. ( Ex: MT6572 to MT6572 or SC6820 to SC6820)
FOR MEDIATEK DEVICES
PORTING For Same SoCs ( Ex: MT6572 to MT6572)
Ito ang pinakamadali sa lahat. Dito, kahit di na kailangang gumamit pa ng Android Kitchen or Bootimg Unpack/Repack Tools. 7zip, Notepad++, Stock Rom/CWM Backup and Porting Rom will do. Pwede nyo gawin ito gawin kahit sa Mobile Phones nyo. Root Explorer, CWM Backup, Porting Rom and 920Text Editor lang kakailanganin nyo.
PC MODE
1. Gawa muna kayo working area nyo o working folder nyo. (Ex: WORKING_XXXX), Sa loob ng folder nayan ay gumawa pa kayo ng dalawang folder and name it STOCK and PORT.
2. Copy and Paste nyo yung Stock boot.img nyo sa STOCK folder. Yung boot.img ay pwede nyo makuha sa CWM Backup.
3. Copy these folders/files from your phone to STOCK folder:
*system/vendor
*system/usr/keylayout
system/usr/keychars
*system/lib/modules
system/lib/hw
system/lib/drm
system/lib/soundfx
system/lib/libncurses.so
*system/etc/firmware
system/etc/vold.fstab
system/etc/vold.fstab.nand
system/etc/bluetooth
system/etc/permissions
system/etc/security
system/etc/wifi
4. Ang laman dapat ng Stock folder nyo ay yung boot.img at system folder, kung wala pa kayong system folder ay gumawa kayo at dun nyo ilagay lahat ng files na kinuha nyo sa phone nyo. NOTE: kung saang folder nyo kinuha yung mga files ay dapat gumawa rin kayo ng folder sa STOCK folder.
5. Copy and Paste nyo yung Porting Rom o yung Custom Rom na nakuha nyo sa PORT folder. NOTE: dapat naka zip ito.
6. Open nyo yung Custom Rom gamit ang 7zip. NOTE: Open lang, don’t Extract.
7. Goto to system folder and find these folder and DELETE:
system/etc/firmware
8. Now, i-drag mo ngayon yung firmware folder na kinuha mo sa Phone mo (How to drag: Just CLICK and HOLD gamit ang mouse at itapat lang sa 7zip kung saan nakaopen anf Custom Rom)
9. Gawin ang Step 8 sa mga natitirang files/folder. NOTE: kahit di nyo i-delete yung file sa Custom Rom.
10. Goto system folder again (Still in 7zip), drag out nyo yung build.prop sa kahit anong folder.
11. Open nyo yung build.prop gamit ang Notepad++, pwede nyo iedit to:
ro.build.id=
ro.build.display.id=
ro.custom.build.version=
ro.build.version.release=This is Andriod version That Displays in Settings
ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.device=
ro.product.manufacturer=
ro.build.bluetooth.name=
12. Save mo ngayon yung build.prop kung may binago ka man, at i-drag mo ito pabalik sa 7zip (Custom Rom) para mapalitan.
13. Pwede mo na ngayon icopy ito sa SDCard at I-Flash.
PORTING For Different SoCs ( Ex: MT6582 to MT6572)
To be update soon ..
Or just follow this link ..
forum.xda-developers.com/show....php?t=2707438
or
forum.xda-developers.com/show....php?t=2701283
Kung may part kayo na di maintindihan sa mga tutorial nila pwede kayo magtanong sakin para matulungan ko kayo
FIXING BUGS:
FM NOT WORKING:
COPY THESE FILES FROM STOCK TO PORT:-
\system\lib\libaudio.a2dp.default.so
\system\lib\libaudio.primary.default.so
\system\lib\libaudiocompensationfilter.so
\system\lib\libaudiocustparam.so
\system\lib\libaudioeffect_jni.so
\system\lib\libaudioflinger.so
\system\lib\libaudiosetting.so
\system\lib\libfmar1000.so
\system\lib\libfmcust.so
\system\lib\libfmjni.so
\system\lib\libfmmt6616.so
\system\lib\libfmmt6620.so
\system\lib\libfmmt6626.so
\system\lib\libfmmt6628.so
OR try this
system/etc/firmware/mt6620_patch_e3_hdr.bin
system/etc/firmware/mt6620_patch_e6_hdr.bin-> If yours is MT6628, you'll need to patch all mt6628_fm_*_*.bin too
system/etc/firmware/WMT.CFG-> This is the antenna cfg, without this, FMradio cannot receive clearly
system/lib/modules/mtk_fm_drv.ko
system/lib/libfmcust.so
For WiFi Bluethooth:
system/lib/modules/mtk_wmt_wifi.ko -> After patching, both works & can be individually switch on/ off
system/lib/libbluetooth_mtk.so
system/lib/libbluetoothem_mtk.so -> MTK Engineering will show MT6628 if not patch...
system/etc/firmware -> if yours is MT6628, you'll need to patch all WIFI_RAM_CODE_* too
For GPS:
->>>> system/xbin/libmnlp
or, If you porting From MT6628 to MT6620, some apps at system/vendor/operator/ is blocking GPS so just delete all apps & use MTK Engineering mode to confirmed it...
Edit in build.prop
fmradio.driver.chip=1 -> if yours is MT6628 then change it to 3
mediatek.wlan.chip=MT6620 -> if yours is MT6628 then change last digit to 8
mediatek.wlan.module.postfix=_mt6620 -> if yours is MT6628 then change last digit to 8
For Camera:
copy these from stock to port
system\lib\hw\camera.default.so --- (if you have two files like camera.goldfish.so delete this the one with the goldfish)
\system\lib\libcamera_client.so
\system\lib\libcameracustom.so
\system\lib\libcameraprofile.so
\system\lib\libcameraservice.so
or
copy from system/lib of stock to port.
- libmhal.so
- libmhalcontent.so
- libmhaldrv.so
- libmhalmdp.so
- libmhalpipe.so
- libmhalscenario.so
- libmhalutility.so
or
Put libcamdrv.so of rom only or campare the file of size of your porting rom file and the base rom then whose size is same leave it and whose size is greater in ur stock rom jst add and replace that file only.
or
lib3a.so
liba3m.so
libacdk.so
libaudioflinger.so
libc.so
libcam.camadapter.so
libcam.campipe.so
libcam.camshot.so
libcam.client.so
libcam.paramsmgr.so
libcam.utils.so
libcam_camera_exif.so
libcamalgo.so
libcamdrv.so
libcamera_client.so
libcamera_jni_eglfence.so
libcamera_metadata.so
libcameracustom.so
libcameraservice.so
libgn_camera_feature.so
libexif
libfeatureio.so
libfrsdk.so
libft.so
libgcomm_jni.so
libgoggles_clientvision.so
libgui.so
libimageio.so
libja3m.so
libjni_mosaic.so
(Skip if any missing)
or
Replace camera.apk in sysyem/app
And do a ctrl+f search in system/lib for anything called 'camera', 'camrecorder', or just 'cam' and replace those.
Audio Problem Fix:
copy paste sytem/lib/all audio lib file from stock to port.(search by ctrl+f)
FOR SPREADTRUM DEVICES
How to port Roms and make it Universal
1. Make Sure na yung Custom Rom/Rom na kinuha nyo ay same ng chipset sa phone nyo. (Ex: SC6820 to SC6820)
2. Create your Working folder. Then extract mo dun yung Custom Rom/Rom na nakuha mo.
3. Ngayon kunin mo ang mga files na ito sa Custom Rom/Rom:
/app (whole folder)
/framework (whole folder)
/media (whole folder)
/etc/permissions/ (whole folder except hardware_handheld & platform)
/fonts (whole)
libandroid_runtime.so , libwebcore.so (from /system/lib/)
/oem (whole folder if exists,most of the roms does not contain oem)
build.prop
4. Gumawa ka ngayon ng bagong folder name it MYROM o kahit anong gusto mo, sa loob ng MYROM ay gumawa ka ulit ng folder and name it system, sa loob ng system folder ay gumawa ka ulit ng dalawang folder, name it ‘lib’ and ‘etc’.
5. Paste mo ngayon jan lahat ng files na kinuha mo sa Custom Rom, make sure na tama ang pagkakalagay ng files sa kanikanilang folders.
6. Balik ka ngayon sa Custom Rom folder yung extracted, at i-copy mo yung Meta-inf folder at i-paste mo sa loob ng MYROM na folder.
7. Ang laman lag dapat ng MYROM na folder ay yung ‘system’ na folder at Meta-inf folder.
8. Now open updater script from Meta-inf\com\google\android\ & open it with notpad++, and make it blank, just select all and delete.
9. Copy these to updater scipt:
ui_print("**************************************** ");
ui_print("* >>>>>>>>>universal rom<<<<<<<<<< *");
ui_print("**************************************** ");
show_progress(1.000000, 0);
ui_print("mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);
ui_print("deleting files...");
delete_recursive("/system/framework");
delete_recursive("/system/app");
delete_recursive("/system/media");
delete_recursive("/system/fonts");
ui_print("extracting files...");
package_extract_dir("system", "/system");
set_progress(0.300000);
ui_print("setting permissions...");
set_perm(0, 0, 0644, "/system/lib/libandroid_runtime.so");
set_perm(0, 0, 0644, "/system/lib/libwebcore.so");
set_progress(0.400000);
set_progress(0.500000);
set_progress(0.700000);
# unmounting filesystems...
Run_program("/sbin/busybox", "umount", "/system");
set_progress(0.900000);
set_progress(1.000000);
ui_print("**************************************** ");
ui_print("* install complete! *");
ui_print("* reboot your device *");
ui_print("**************************************** ");
10. Save mo na ngayon ang updater script, then i-zip mo na ngayon ang MYROM na folder. Copy to SDCARD then FLASH.
Fixing known Issues/Bugs
boot
libandroid_runtime.so ( if rom did not boot with port lib)
libandroid_servers.so
wifi
libhardware_legacy.so - it contains the driver path of wifi
from modules 8723as.ko or unifi_sdio.ko or may be other - these are the drivers to load wifi
if u are confused what is ur wifi driver then do these steps
>open libhardware_legacy.so in notepad++ & search for /system/lib/modules/ the name(*****.ko) u will find after that is ur wifi driver
libeng_wifi_ptest.so :- important to work wifi properly
from binaries(/system/bin) copy these
wpa_supplicant - for this u can scan networks
synergy_wifi_attach - important
synergy_service
netd
eng_setbtwifiaddr
engmodemclient
engservice
engtest
from /etc/
dhcpcd- for this u will be able to find networks
wifi - important
firmware - most important
bluetooth
libhardware_legacy.so
libbluedroid.so
libbluetoothd.so
libbluetooth.so
from binaries
bluetoothd
synergy_service
netd
eng_setbtwifiaddr
engmodemclient
engservice
engtest
from /system/etc/
bluetooth
firmware
headset
headset.ko from /system/lib/modules
rotation
libsensorservice.so
sensors.sprdbp.so (from /system/lib/hw)
android.hardware.sensor.proximity.xml (from /etc/permissions)
gpu
egl folder (from /system/lib)
mali.ko (from modules)
gralloc.mali.so (from hw)
hardkeys/softkeys
usr folder (from /system)
touch
sps folder (from /system)
for more info just follow this link ..
forum.xda-developers.com/andr...atrum-t2998862
Kung may part kayo na di maintindihan sa mga tutorial nila pwede kayo magtanong sakin para matulungan ko kayo
CREDITS TO XDA-Developers for the GUIDES and TUTORIALS
Notes :
- All Softwares And Tutorials Are Made By Various Aurhors From XDA Developers Forum And Internet,So All Credits Are Going To Them.
- All Aplications Are Tested By Me And Working
- I'm Not Responsible For Any Eventual Errors And Misbehaving Of Yours Devices.