How to avoid TWRP Errors related to wrong Firmware for custom ROM & prepare FIRMWARE - Xiaomi Mi 6 Guides, News, & Discussion

How to avoid TWRP Errors related to wrong Firmware for custom ROM & prepare FIRMWARE
One of the most frequent question related to flash custom ROM is what firmware should I use to this particular ROM
That is probably because you had, or you would like to avoid ERROR 7 during flashing in TWRP which is caused while the ROM’s updater script file checks to see if the phone model of your phone is compatible with the ROM you are installing
At the begging of flashing process updater-script check this:
Code:
getprop("ro.product.device") == "sagit" || abort("E3004: This package is for "sagit" devices; this is a "" + getprop("ro.product.device") + "".");
and trustzone
Code:
assert(sagit.verify_trustzone("TZ.BF.4.0.6-00124") == "1"); *
*(this version of TZ.BF is only example, I will describe that in the end)
Sometimes Developer allow to use wider TZBF like:
Code:
assert(sagit.verify_trustzone("TZ.BF.4.0.6-00124","TZ.BF.4.0.6-00130") == "1");
I assume that you fulfill the first condition (you have sagit, right?), so we will take to look deeper into second condition
How to know what trustzone is in the phone?
There are three methods:
1) when you lately flashed your phone with downloaded firmware or full miui rom (fastbooot or recovery) just unzip rom file (7-zip recommended) and look for tz.mbn file (see below)
2) Use app like Kernel Adiutor -> Statistics -> Device -> Trustzone (recommended method)
3) pull tz.mbn file directly from your phone
to do that you need adb tool, so under TWRP:
Code:
adb shell
cd /dev/block/bootdevice/by-name
ls -all
you should see list list of partition but what we looking for is that:
Code:
lrwxrwxrwx 1 root root 16 May 28 1970 tz -> /dev/block/sde15
copy partition to your storage
Code:
dd if=/dev/block/sde15 of=/sdcard/tz.img
now exit adb shell
Code:
exit
and copy tz.img to computer
Code:
adb pull /sdcard/tz.img
now we need hex editor to open tz.img or tz.mbn file
I use https://mh-nexus.de/en/hxd/ but you can your favorite hex editor
open tz file, press find and write TZ.BF, there is only one TZ.BF
QC_IMAGE_VERSION_STRING=TZ.BF.4.0.6-00124...IMAGE
Now, check what trust zone is needed in ROM which you would like to flash
It should be written in TrustZone requirements file named board-info.txt. It should be in github in root
In our case :
require version-trustzone=TZ.BF.4.0.6-00124
It's also written in your ROM file META-INF\com\google\android\updater-script
Despite of that you could use one of the firmware which have the same trustzone as needed I recommend that you follow firmware demanded/recommended by your ROM's Developer
version of TZBF in particular firmware:
8.2.2.0.NCAMIEC TZ.BF.4.0.6-00105
7.8.31 global TZ.BF.4.0.6-00124
7.8.31 china TZ.BF.4.0.6-00124
7.9.7 global TZ.BF.4.0.6-00124
7.9.8 china TZ.BF.4.0.6-00124
7.9.14 china TZ.BF.4.0.6-00124
7.9.22 global TZ.BF.4.0.6-00130
7.10.12 china TZ.BF.4.0.6-00130
7.10.12 global TZ.BF.4.0.6-00130
7.10.19 china TZ.BF.4.0.6-00130
China or Global?
In attached file.md5 there are md5sums of firmware files which I checked.
It seems, there is no difference between China or Global files from the same week (miui name ROM pattern version.mm.dd)
Do it at your Own Risk. I am not responsible for any loss or damage
EDIT 2017.11.14
Now its time to prepare your firmware based on XIAOMI ROM FILE
Choose version you need and download full ROM (not fastboot) from XIAOMI servers here
extract all files
go to extracted folder and delete all files/folders except folder firmware-update and META-INF
open META-INF/com and delete folder miui
download and extract updater-script from this tutorial
open \META-INF\com\google\android and repleace updater-script with this attached (mentioned above,downloaded and extracted)
Open it with eg notepad++ and correct /7.11.13 with version with you have and save it
go to main folder with firmware-update and META-INF and mark it, click righ mouse button and choose 7zip add to achrive
choose archive format zip, compression level store
copy to your phone and flash it with TWRP
that's it

Great information, thanks!
Following this information, I checked tz.mbn of xiaomi.eu rom 7.10.19. It provides firmware TZ.BF.4.0.6-00130.
Is this a correct conclusion? Or does the xiaomi.eu rom require TZ.BF.4.0.6-00130 and not provide it?

wian said:
Great information, thanks!
Following this information, I checked tz.mbn of xiaomi.eu rom 7.10.19. It provides firmware TZ.BF.4.0.6-00130.
Is this a correct conclusion? Or does the xiaomi.eu rom require TZ.BF.4.0.6-00130 and not provide it?
Click to expand...
Click to collapse
you dont have to worry about firmware in miui.eu ROM as they come with built in firmware,as stock MIUI ROM

deleted, double post, sorry

1. Flash my file: https://drive.google.com/open?id=1z9LbjzloH2Bjz-j8NfOc2e1-VImvMLIT
2. Wipe > format data > yes > enter > go back to main menu > reboot recovery
3. Flash your custom rom. Enjoy!

Related

[Guide]How To Port & Modify Roms For Mediatek[Everything]

PORTING ROMS FOR MEDIATEK​
FEATURE OF THIS GUIDE- NOOB -> EXPERT
I DONT KNOW THE METHOD I USE TO PORT WILL WORK FOR OTHER CHIPSET DEVICES OR NOT AS I ONLY USED MEDIATEK DEVICE.
IF YOU ARE IN A HURRY THEN SEE HERE MY 1-MIN PORTING GUIDE.
AND YOU CAN FIND HERE MY TRICKY CONCEPT- "X" TO SAVE MONEY,TIME,NET DATA.
Credits
@dsixda for awesome android kitchen @rua1 for Mtk Dorid Tools @knzo for tweaks @https://www.otaupdatecenter.pro/ and their team for OTA. @tech mashido As Helper
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WORK BEGINS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
THINGS NEEDED​
(INSTALL BELOW THINGS AS PER YOUR OS BIT VERSION,IF YOU HAVE 32 BIT OS THEN INSTALL 32 BIT STUFFS AND IF YOU HAVE 64 BIT OS THEN CHOOSE 64 BIT STUFFS.
WIndows Running PC or Laptop.
JAVA - Download
Cygwin - Download
7zip Compressor-Download
Notepad++ -Download
Android Kitchen- 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)
APKTOOL- DOWNLOAD
SP_Flash Tools to Unbrick In case Device Get Bricked- Download
SETTING UP IMPORTANT THINGS FIRST​
JAVA
Download Java From Above link as per your OS type.
Install it by running its setup like normal softwares.
CYGWIN
Download Cygwin From Above link.
Extract the Zip
By default it will be installed at c:\cygwin .i also recommend to install at default location.
Run Setup and Select "Install from Local Directory"
Then is will ask for packages location.Verify it.
Hit next-next and finish at the end.
Now you see a Cygwin folder under "C" drive and a shortcut Icon at desktop.
*For some 64 BIT users this method might not work,they can download setup from here-Download & install it from internet instead from local packages and select all packages during installation.
7ZiP
Download 7Zip From Above link as per your OS type.
Install it by running its setup like normal softwares.
Notepad++
Download Notepad++ From Above link as per your OS type.
Install it by running its setup like normal softwares.
dsixda's Android Kitchen
Download dsixda's Android Kitchen From Above link.
Extract it and then it will be like this- Android-Kitchen-0.224\Android-Kitchen-0.224\orgianal_update,tools etc....
Now open Android-Kitchen-0.224 folder and you will again find Android-Kitchen-0.224 folder,then rename it to only " kitchen " (small letters).
Now directory will look like this- Android-Kitchen-0.224\kitchen\orgianal_update,tools etc....
Now copy that kitchen folder which we renamed and paste to c:\cygwin\home"your_username""paste here"
Now your cygwin directory will look like this- C:\cygwin\home\your_username\kitchen\orignal_update,tools,etc.....
To check Kitchen is working,open cygwin from desktop and type - "cd kitchen" and hit enter(small letters).
If no error shown then you have sucessfully installed it or if error like- bash:cd :kitchen:No such file or dirctory hen you should check above steps again.
>>OPENING KITCHEN- open cygwin,type "cd kitchen" hit enter,now type " ./menu " and hit enter.Now kitchen will load.
PORTING CWM RECOVERY(PORT IF YOUR DEVICE DO NOT HAVE IT)- ROOT REQUIRE
Download and install ADB drivers on PC first.DOWNLOAD
Get MTK Droid tools From Here and Extract-HERE
Now go to developers option and enable USB debugging.If you cant find Developers option then go to settings/about Phone and press 7 times on BUILD NUMBER then you will see Developers option under settings.
Open MTK Droid tools on pc and then plug your device(turned on) via usb cable.Now the tool will recognise your device and connect to it(if asked for root permission on device then grant).
If the colour indicator in the bottom left corner is green in MTK Droid Tools,then you already have root shell,and can go on to the next step, if it is yellow, click on the root button at the bottom, and wait for the progress bar, if the indicator stays yellow, or you get an error message, this probably means you do not have Busybox installed, you can install it from the Google play store. When the indicator turns to green you have root shell which is necessary for this operation.
Now click on 'root,backup,recovery' and then select 'to use boot from phone'
Now click on 'recovery and boot'
Then you will see a dialogue box will appear asking if you want to 'make cwm recovery automatically' click yes.
The tool will then create the recovery and then another dialogue box will appear asking to 'install created recovery to phone', click yes.
Now you reboot into recovery mode and check that it is working fine or not.
You can find generated cwm recovery under MTK Droid Tools location.
If you want to revert to stock recovery then take recovery.img from your stock rom(sp_tools) and paste into sd card.And then install mobileuncletools from playstore and click on update recovery and select your stock recovery from SD.Same method for installing CWM recovery.
WHICH ROMS YOU CAN PORT​
Port rom should be of same android version as your stock rom.Like if your stock rom is 4.2 then you should only try with 4.2.In some cased you can port higher versions like kikat too,it will require Custom kernel but we are skipping that.
The device from you porting should have same chipset,like if your device is MT6589 then you shoul only try with MT6589 chip-sets.You can port from MT6589T to MT6589 or MT659M but you cannot port from MT6592.
Choose the port rom from most close specification device,like screen size,screen resolution,dual-sim,etc....higher resolution to lower resolution resolution or lower to higher can be ported but not all boots up.
Some Sites To get Port Rom:-
anzhuodiy.com
romzj.com
dashi.com
shendu.com
needrom.com
Porting begins
MAKING PORTING ENVIRONMENT​
Registering Your Device To Kitchen:-This step will help to write updater script automatically.
Open kitchen and select option 0(advance options) and then select option 12(tools for unpack and repack boot.img etc.) and press "a"(Extract kernel+ramdisk from boot.img,recovery.img etc.) and hit enter.
Now a folder will be created Under kitcehn directory named like this- bootimg_040714_132352
Now copy your CWM recovery.img for your device to this folder and check that the name must be - recovery.img if not then rename it. and hit enter in kitchen terminal.It will extract your recovery in that folder.
Open up boot.img-ramdisk folder, and look for /system/etc/recovery.fstab or /etc/recovery.fstab or similar FSTAB file location. Open this file by notepad++ to find the mount points.
Download below file and paste it to C:\cygwin\home\username\kitchen\tools\edify_defs .Now rename it to your device code name.Mine is A110Q so i used this file. You can use as your choice also.
Then open this file and recovery.fstab with notepad++ and compare and replace mount points and save it.Means copy mount points from recovery.fstab and paste/replace into Your device codenamed file.
Now if you done all above steps right then kitchen will make updater script for you.
If you porting for Micromax A110Q then just Download the below File and paste it.No need to edit.Just paste it.
>>>>>>Micromax A110Q file - http://d-h.st/Qa5
>>>>>>IF you have any confusion or you are unable to create this file then PM me your recovery.fstab file and i will make it.
GET BOTH ROMS- STOCK AND PORT
STOCK-Your stock rom which was provided by device manufacturer.
PORT- The Rom you selected to port after comparing your device to port device.
GETTING STOCK ROM SYSTEM FOLDER
IF your Stock ROM is in already in form of CWM flashable zip then create a Stock Folder in any drive of Computer and extract it for further Use.
Basic Strurture od CWM FLASHABLE ZIPs
META-INF
SYSTEM
DATA
boot.img
IF YOUR ROM IS SP_TOOLS FLASHABLE THEN DO THESE TO EXTRACT SYSTEM FOLDER FROM IT:-
Basically IN SP_TOOLS flashable zips the folder structure is-
DATABASE
boot.img
cache.img
EBR1
EBR2
IK.bin
logo.bin
MBR
MT65xx_Android_scatter_emmc.txt
Preloaded_xxxxxx.bin
recovery.img
secro.img
system.mg
userdata.img
[STEPS]
Extract system.img from stock rom zip to C;\cygwin\home\username\kitchen\original_update
*You should add kitchen folder to favorites panel in my computer as you will be using this folder very frequent.
Now open cygwin,type "cd kitchen" hit enter,now press- " ./menu " then android kitchen will load with lots of functions numbering from 1 to ...
Press 1 to setup working folder now again hit Enter.Now it will ask you to choose an option to select working folder.Select system.img one folder by pressing its value and hitting enter.
Now it will ask about changing working folder name,leave it as default and hit enter.So kitchen will now start copying rom to working folder.
After Copying files it will auto prompt and open Ext2Explore application.In some cases it will show that error message that "unable to read disk,please make sure you are running appliacation with administrative rights."But don't worry,click ok.
Now after Ext2Explore opened,click on "FILE" on upper left corner and click on "OPEN IMAGE".Now browse to kitchen directory and go through newly created working folder and you will find "ext4_system.img" under system folder.Select it.
Right click on file selected in Ext2Explore and Click on SAVE,now browse to same folder where "ext4_system.img" was.Means newly created working folder/system under kitchen directory.
Then it will extract "ext4_system.img" to same folder.After finishing extraction close the Ext2Explore application.Now hit Enter in kitchen,again it will say "warning,no boot.img found" .Do not worry,HIT ENTER and go with default.
It will ask to view Rom info,you can skit this.
So finally you got system folder under working folder.So copy that system folder to any drive and rename it to Stock rom folder for further use.
[TIP:-]
>>IF your Rom is odexed then you should deodexed it before copying to any other drive for further use.<<
HOW TO CHECK THE ROM IS ODEXED:-
GO TO SYSTEM/APP and SYSTEM/FRAMEWORK folder and see that for every file there is clone file ending with .odex .If there is then your rom is odexed.
WHAT IS DEMAERIT OF ODEXED ROM FOR DEVELOPERS-
You will not able to theme and modify your rom if system and framework is odexed so better deodex the rom.Deodexing will combine file and its clone .odex to one unit.
DEODEXING:-
AFTER SETTING UP WORKING FOLDER AND DOING ALL ABOVE STEPS,now hit 0 in kithcen and select 11 option and hit enter.
IT will show number of odex files in your Rom.Now Select "b" option to deodexing all files,it will take some time.
After done,it will show that "0" files left odexed in Rom,now exit kitchen and Now you should copy your system folder to any drive for furter use.
GETTING STOCK ROM BOOT.IMG EXTRACTED
[STEPS]
Now open Kitchen and select 0(advance options) and Hit enter,now select option 12(tools for unpack and repack boot.img etc.)
Under 12th option,press "a"(Extract kernel+ramdisk from boot.img,recovery.img etc.) and hit Enter
Now a folder will be created Under kitcehn directory named like this- bootimg_040714_132352 Now copy your boot.img and paste into this folder.
Now switch to Kitchen Terminal and press Enter.Then it will do some process and extract your boot.img,Now copy that folder and save it to any drive and Rename it to stock boot for further use.
NOW DOWNLOAD PORT ROM YOU CHOOSED TO PORT AND MOVE TO NEXT STEP BELOW.​
PORTING
PORTING​
>>>>Follow STEP I if you have port rom flashable via cwm.To check that your rom is flashable vai cwm see above post for structure.Those who having SP Tools flashable port rom follow StepII directly.<<<<
First we will port and check that rom boots or not by simple way,then if it boots then we will modify it and tweak it by using kithcen.Or you can skip this step I and directly follow step II but you have to do almost all things from step I in Step II except modifying updater script.If you do these things in step I then no need to do in Step II.
STEP I​
[*]Make a folder and name it as you want and copy and paste your port rom zip in it,means make a clone file of it and we will be working with clone zip,always keep in mind.I said to copy paste as if your rom did not boot up then you have a backup of clean port rom.
[*]Now create a folder under original update of kitchen- " WORKING_XXXX "
[*]Then open zip using 7zip(make 7zip is as default app) and drag drop boot.img to " WORKING_XXXX " folder.Now Open kitchen and Press 1 to setup working Folder.And go with default in all steps forward.(keep 7zip opened,you will need to drag back boot.img in it)
[*]After working folder setuped.Now press 0 for advance option and hit enter.Now press 12 and hit enter.Now you press "w" to extract boot.img from working folder.
[*]After sucessful extraction you will find a folder under kitchen named BOOT EXTRACTED.
[*]Now you have to copy zImage from stock boot extracted folder(which was created by you in second post last step) to this BOOT EXTRACTED folder and replace it.
[*]Then switch to kitchen and press "b" to build boot.img from BOOT EXTRACTED folder then after repacking boot.img finish,you have to drag and drop only boot.img(kitchen/working folder)(not meta-inf) to port rom zip.
[*]Now Open System Folder In port Zip and drag drop build.prop file out of it to anywhere you wish.
[*]Now edit it with Notepad++.
[*]Add this line if you are porting from a higher resolution device- ro.sf.lcd.density=220 .Change its value after rom boots as to your display resolution.If after rom boots up and everything looking large then reduce the value and if looking small then increase it.
[*]You can Edit These Values as desired:-
Code:
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=
[*]EDIT BELOW LINES TO SET YOUR TIMEZONE AND AREA REGION.You can find your default details in your stock rom's build.prop which you extracted earlier.
Code:
ro.product.locale.language=(en for English,ru for Russian and other similar codes for other language)
ro.product.locale.region=(us for usa, IN for india etc.)
persist.sys.timezone=( Asia/kolkata for india,Asia/... different for different regions)
[*]Now after editing done drag build.prop to port zip.
[*]Now keep opened port zip one side and open stock rom system folder which we extracted in post 2.
[*]Open System/etc/firmware in both zip and stock folder.Now drag modem.img from stock folder to zip and drop it.
[*]Now head to lib folder in both.Here you have to drag and drop libcamercustom.so file to port zip.
[*]Go to system/lib/modules now,here drag and drop mtk_stp_wmt.ko file to port zip.If rom did not boots forward then you should drag and drop whole modules folder under system/lib of port zip.
[*]Go to usr/keylayout in both and drag drop Generic.kl file from stock to port zip.
[*]Lastly drag and drop a launcher like nova,apex or any to system/app/ of port zip in case port launcher did not worked.
[*]IF you rom did not booted by applying all above steps then replace these folder/files from stock to port:-
1)system/etc/firmware
2)system/lib/hw
3)system/lib/modules
4)system/vendor
[*]If your cwm port rom zip have these files then delete those.
---uboot.bin
---preloader
---logo.bin(you can keep it but you need your stock logo.bin which is available in sptool flahable roms.I will also tell you how to create own logo.bin and bootanimation in below post.)
[*]Your zip should look like this-
--Meta-inf
--system
--boot.img
--data (in some roms)
[*]After deleting the extra files you need to modify the updater script which can be found under,Meta-inf/com/google/android/updater-script...we are modifying by own only this time as we have to check only.During building rom from kitchen,it will be automatically created
as we registered our device.If we do not register our device in kitchen then during making roms from kithcen our current updater script will converted to update script which will be again converted to updater script and that will cause installation aborted error.
[*]Now drag and drop updater script from zip to anywhere and open it with notepad++,now find lines below-
Code:
format("ext4", "EMMC", "/dev/block/[COLOR="DarkOrange"]mmcblk0p7[/COLOR]", "0");
format("ext4", "EMMC", "/dev/block/[COLOR="DarkOrange"]mmcblk0p5[/COLOR]", "0");
mount("ext4", "EMMC", "/dev/block/[COLOR="Red"]mmcblk0p7[/COLOR]", "/data");
mount("ext4", "EMMC", "/dev/block/[COLOR="Red"]mmcblk0p5[/COLOR]", "/system");
[*]Here you have to deal with text in red.Your updater script may be different so use your brain and understand what i am saying forward.Text in red is mount point.In above mmcblk0p7 is mount point of data folder and mmcblk0p5 is mount point of system folder.So you need to replace mount points of updater script with your device mount points.You must found mount points of your device during registering device to kitchen.So open recovery.fstab or that kitchen/tool/edify_defs/your file with notepad++ and copy replace mount points from your device file to updater-script of port zip.If you find those lines any more places in updater script then also replace there.Here you only need some mind to use.For example if you edited and replaced red text then you must also replace orange text as they are also same.
[*]Remove the lines of the files which you removed in zip if there,like uboot.bin,logo.bin,preloader etc...they will look like below codes,you only need to find the line matching to the file you removed and deleat that.
Code:
package_extract_file("uboot.bin", "/dev/uboot");
or
assert(package_extract_file("uboot.img", "/tmp/uboot.img"),
write_raw_image("/tmp/uboot.img", "uboot"),
delete("/tmp/uboot.img"));
or
assert(package_extract_file("preloader.img", "/tmp/preloader.img"),
write_raw_image("/tmp/preloader.img", "preloader"),
delete("/tmp/preloader.img"));
[*]And replace this line
Code:
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "bootimg"),
delete("/tmp/boot.img"));
From this if any error occurs during installtion like boot.img assert failed.
Code:
package_extract_file("boot.img", "/dev/boot");
[*]Drag back the updater-script to zip from where it was taken from.
What we have done above is that we drag and drop some stock files from stock rom to port zip without extrating it.​
Now you are good to flash your ported rom.Make CWM backup if you want to go back to previous rom or rom did not booted.After that wipe data factory reset,wipe cache partition,wipe dalvic cahce under advance option and then format system under mount and storage OF CWM RECOVEY then install zip from sd card and install your zip.I said SD card in first post if your rom did not booted and you understood your mistake and modified your port rom zip then you can do that directly by transferring zip to sd and flash instead of installing or restoring another rom.But for the users with not sd card must save their CWM backup or a working cwm flahable Rom zip otherwise they will have to reflash the rom by SP tools if rom didnot booted.
STEP II​
NOTES BEFORE BEGINNING STEP II :-
If you ported your ROM using STEP I and booted then for modifying use this STEP II.
If you tried porting rom using STEP I but it is showing installation aboted then follow this STEP II directly.
IF you have SP Flash tools format port rom and you extracted system folder and boot.img from your stock rom using my method then Follow STEP II directly.
STEP II contains some steps from STEP I,so if you already did those steps in STEP I and using same zip here then you can skip steps here.If you get confused then again do all steps.
STEP(A)- ADDING A WORKING FOLDER IN KITCHEN
FOR CWM ROM:-
Create a folder " WORKING_XXXX " under kitchen/original _update if you haven't.If you having it then check that it is empty.
Now open your port zip (or zip you ported through STEP I and was booted) and extract its System and boot.img to "WORKING_XXXX " folder.
Open kitchen and press "1" to setup a working folder.
Press Enter and select "WORKING_XXXX " folder by it assigned digit and hitting Enter
Now it will ask for name,you may change it or leave it,it does not matter.Skip it by pressing Enter.
It will start copying files to a working folder,wait sometime.
After it will ask to view Rom info,then press Y and see its info as your wish.
Now you have a working folder setup-ed.
FOR SP TOOLS ROM:-
Extract system.img & boot.img from port rom zip to C;\cygwin\home\username\kitchen\original_update
Run Kitchen and press "1" to setup working folder and hit enter.
Now again hit Enter,this time it will ask you to choose an option to select working folder,Select system.img&boot.img one folder by pressing its value and hitting enter.
Now it will ask about changing working folder name,leave it as default and hit enter.So kitchen will now start copying rom to working folder.
After Copying files it will auto prompt and open Ext2Explore application.In some cases it will show that error message that "unable to read disk,please make sure you are running appliacation with administrative rights."But don't worry,click ok.
Now after Ext2Explore opened,click on "FILE" on upper left corner and click on "OPEN IMAGE".Now browse to kitchen directory and go through newly created working folder and you will find "ext4_system.img" under system folder.Select it.
Right click on file selected in Ext2Explore and Click on SAVE,now browse to same folder where "ext4_system.img" was.Means newly created working folder/system under kitchen directory.
Then it will extract "ext4_system.img" to same folder.After finishing extraction close the Ext2Explore application.Now hit Enter in kitchen and go with default then Press y to view ROM info as per your wish.
Now you have a working folder setup-ed.
STEP(B)-Porting Rom
PATCHING BOOT.IMG:-
After successful creation of working folder you will find a new folder created named like-"WORKING_041214_135729".
Open kitchen then Press 0 for advance option and hit enter.Now press 12 and hit enter.Now you press "w" to extract boot.img from working folder.
After sucessful extraction you will find a folder under kitchen named BOOT EXTRACTED.
Now you have to copy zImage from stock boot extracted folder(which was created by you in second post last step) to this BOOT EXTRACTED folder and replace it.
Now switch to kitchen and press "b" to build boot.img from BOOT EXTRACTED folder then after repacking boot.img finish press x to exit and back to main menu.
Editing Build Prop:-
you will find build.prop under kitchen/your_working_folder/system/
Edit build.prop with notepad++
You can Edit These Values as desired:-
Code:
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=[B][U][COLOR="Red"]NAME OF FILE WHICH YOU USED TO REGISTER YOUR DEVICE TO KITCHEN[/COLOR][/U][/B]
ro.product.manufacturer=
ro.build.bluetooth.name=
EDIT BELOW LINES TO SET YOUR TIMEZONE AND AREA REGION.You can find your default details in your stock rom's build.prop which you extracted earlier.
Code:
ro.product.locale.language=(en for English,ru for Russian and other similar codes for other language)
ro.product.locale.region=(us for usa, IN for india etc.)
persist.sys.timezone=( Asia/kolkata for india,Asia/... different for different regions)
Add this line if you are porting from higher resolution deice or lower resolution device.If from higher to lower then put lower values and if lower to higher then put higher values.
Code:
ro.sf.lcd_density=xxx
Now after editing done save it and exit.
Patching Rom With Some STOCK Rom Files:-
Copy modem.img from stock Rom- System/etc/firmware to kitchen/working_folder/system/etc/firmware and replace it.
Copy libcamercustom.so file from stock Rom- System/lib to kitchen/working_folder/system/lib and replace it.
Copy mtk_stp_wmt.ko file from stock Rom- System/lib/modules to kitchen/working_folder/system/lib/modules and replace it.If ROM not booted then replace whole modules.
Copy Generic.kl file from stock Rom- System/usr/keylayout to kitchen/working_folder/system/usr/keylayout and replace it.
Download any launcher apk from net link nova,apex etc and paste into kitchen/working_folder/system/app/
If after Building rom from next step,your rom did not booted then replace these files from stock to port then build rom.
1)system/etc/firmware
2)system/lib/hw
3)system/lib/modules
4)system/vendor
Building Rom
After all above steps done,now switch to kitchen and press 99 to build ROM.
But before pressing 99 check that you put name of file by which you registered your device to kitchen in build.prop/ro.product.device="".If you registered with name x then put like this-ro.product.device="x"
If you have not done above step then you will get installation aborted error during installation.If you are confused to register device send me required fies as asked by me in above post.
After all checked now press 99
Select Build Option 1 then hit Enter
Now it will ask to zip-lang the apk,do as your wish.
After that step it will convert Updater Script and ask two option,Proceed or cancel,then Proceed by pressing "y".
It will then start making update.zip.Wait some time.
Next it will ask to sign the zip or not?You should go with default by signing update zip by hitting Enter or Pressing "y" then pressing enter.It will take some time.
After that if you want to change your ROM name then put desired name by pressing y or leave as it is by hitting Enter or 'N' then enter.
Collect you rom.zip from Output_zip folder created under kitchen directory.
Flash it and check it.
If you find some bugs then see post below to solve bugs or if you are not able to find bug solution below then post it.I will tell you how to solve it if i know.
I have ported 10+ Roms using this method,this should work for you too.Hopes that your ROM will boot.Good Luck.​
SOLVING BUGS​
BUG SOLVING USES HIT AND TRIAL METHOD.I mentioned one or more ways to solve,you try one by one and see which works for you.
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:-
->Unpack boot.img again and go to BOOT-EXTRACTED/boot.img-ramdisk/init.project.rc and edit with notepad++,also open stock bootextracted/ramdisk/init.project.rc.Now find camera permissions and replace whole camera line with stock camera lines.
->then open init.rc of both port and stock and find camera lines and copy/replace camera lines from stock to port.
->Now repack boot.img
OR
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.
Storage mount Problem Fix:-
copy paste sytem/etc/vold.fstab from stock to port
USB NOT MOUNTING IN PC FIX:-
copy init.usb.rc from stock boot.img extracted to port and repack.
Audio Problem Fix:-
copy paste sytem/lib/all audio lib file from stock to port.(search by ctrl+f)
ICON RESIZER:-
see these
http://forum.xda-developers.com/showthread.php?t=2219584
http://forum.xda-developers.com/showthread.php?t=2380513
DATE AND TIME ERROR FIX:-
check build prop region and compare and replace from stock build prop.
or
Use gravity box date and time fix
Minimum Brightness:-
ro.init.screen_brightness=110 in build prop
If App Force Closing:-
Use Updated App or if only rooted apps are getting Force close then Check Root
If nothing helped then removed that apk from system folder.
If a weird image Showing Between Boot logo and boot animation:-
Use stock rom's system/media/images/boot_logo in port.
TWEAKING&MODIFICATION​
BUILD.PROP TWEAKS
HOW TO ADD:-Open Build.prop with Notepad++ and copy and paste these tweaks lines and save it.
Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
VM Heapsize; higher the RAM, higher the hp can be.
Code:
dalvik.vm.heapsize=48m
Render UI with GPU
Code:
debug.sf.hw=1
Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
Fix some application issues
Code:
ro.kernel.android.checkjni=0
Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
Init.d TWEAKS
HOW TO ADD:-
-->>For adding init.d tweaks you must add init.d support from kitchen by using option "14" then you will see a new folder will be created under system/etc/"init.d"
-->>Now open a empty file with notepad++ and add- " #!/system/bin/sh " at top and then add below lines then save it with name as you wish.Make separate file for each tweak.
[*]Strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
[*]Internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
[*]Vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
[*]misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
[*]Battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
[*]EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
[*]Perfect mount options
Code:
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
[*]Flags blocks as non-rotational and increases cache size
Code:
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "2048" > $j/queue/read_ahead_kb;
done
[*]MicroSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
[*]Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
[*]Remove logger
Code:
rm /dev/log/main
[*]Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
[*]Auto change governor and I/O Scheduler
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
[*]Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
[*] Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
GPS.conf TWEAKS
How To:-Create or edit your /system/etc/gps.conf with a Notepad++.
Benefit:-For improving GPS lock time and signal.
-->>SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Or DOWNLOAD this patched gps.config
APN TWEAKS
-->>apns-conf.xml located at system/etc/"apns-conf.xml"
-->>Edit apns-conf.xml with notepad++ to add desired apns.
-->>Use CyanogenMOD's APN list file - it's one of the most complete.Download from google.
-->>You can use Mine one too- Downlaod
ADS BLOCK TWEAK
(Lots of developers are supported Through it so please think twice before adding it.)
-->>You can use mine hosts file.Download
-->>You can refer these url for getting file content-
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
-->>hosts file are located to system/etc/"hosts"
USE LATEST SUPERUSER APP AND SU BINARY
Downlaod From here
USE PORTED APPS IN YOUR ROM
HERE IS LINK OF HUGE COLLECTION OF PORTED APPS:-CLICK
How to Implemant Ported Apps?
->Download it and open its zip.
->Now open system folder in zip and drag and drop all files to port rom means copy all system folder contents only to port system folder.
More things will be added soon.
THEMING​
I will discuss very short on Theming,rest search on Google.
[START]
SETTING UP APKTOOL:-
->>If you have installed apktool and java then you can start.
->>Now go to the extracted apktool folder and hold "SHIFT" keyboard button and then right click mouse.
->>Here select-Open command window Here" option.
->>For Theming you need to decompile the apk which you want to theme,so grab those apks first and put into apktool folder.
-->>Also take framework-res.apk and medaitek-res.apk and put these also in apktool folder.
->>For decompiling system folder apk,you need to install framework-res.apk and medaitek-res.apk first.So in command window input-
Code:
apktool if framework-res.apk
apktool if mediatek-res.apk
->>hit enter one after one.So you will get message that apk installed to....for both apks.
->>Always write words carefully in command terminal,write same words as apks in apktool folder.
NOW YOU CAN DECOMPILE SYSTEM APKS OF THE ROM WHOSE FRAMEWORK YOU HAVE INSTALLED.IF YOU DONE WITH THAT ROM AND WANT TO MODIFY NEXT ROM APKS THEN
GO TO C:\users\yourusername\apktool and delete all present apks.
Lets start Decompiling:-
->>Open command terminal under apktool,if you already opened then good.
Lets assume that you are decompiling launcher.apk then,
->>Type this below command to decompile apk.You need to replace only apk name....
Code:
apktool d launcher.apk
->>and hit enter.It will decompile in same apktool folder.
->>Now open it and modify it as you wish.
->>For editing its images and theme and look,go to drawable-hdpi folder replace pngs with same resolution pics or edit with photoshop or gimp etc.
->>You can do major modification in thems with systemUI.apk
->>And for rest take help from google.I will update this and add more stuffs when i get time.
->>Now after all modifications done,now lets compile apk.Use command below and replace apk name....
Code:
apktool b launcher.apk
->>Hit enter.Now you have to drag and drop meta-inf and AndroidManifest.xml of launcher.apk which was placed under apktool directory for decompiling(use 7 zip to open apk and drag files from it) to apktool directory/launcher/build/apk/ and replace when prompt.
->>Now again repeat this command in command bar-
Code:
apktool b launcher.apk
->>hit enter,Now this time you can collect you compiled apk from- apktool directory/launcher/dist/"launcher.apk"
->>I know you may get confused by all these steps so watch an awesome video by nero young to clear your confusions-VIDEO
MAKING PATCHES ZIP​
IT WILL BE VERY EASY FOR YOU TO MAKE PATCHES ZIP IF YOU DOWNLOAD THESE BELOW 4 FILES :-
1) ONLY BOOT.IMG PATCH ZIP
2) ONLY SYSTEM FOLDER PATCH ZIP
3) SYSTEM FOLDER + BOOT.IMG PATCH ZIP
4) KERNEL ZIP & KEREL REVERT ZIP.
Download above Zips.
First zip is for extracting only boot.img patch .
Second zip will patch system folder's all folder.
Third Zip will allow you to patch both boot.img and system folder contents of your rom.
Fourth one will allow you to flash any custom kernel if available for your device.
How to use all above patches.zip?
->For first one open zip using 7zip and drag the boot.img you want to patch to it then flash it with cwm
->For second one,if you want to add an apk or any other lib files or replce lib file or any other system folder files to your rom then drag and drop that file to second zip with correct folder path.
->Third one will allow first and second to flash at once.
->Fourth zip is for custom kernel,Custom kernel contains two part,boot.img and another system/lib/modules/lots of file.For custom kernel flashing or reverting with stock kernel,you need to drag and drop boot.img and system/lib/modules/ to fouth zip and flash via cwm.
IF YOU WANT TO ADD UBOOT.BIN TO ROM OR FLASH UBOOT.BIN THEN USE BELOW LINE IN UPDATER SCRIPT:-
package_extract_file("uboot.bin", "/dev/uboot");
Click to expand...
Click to collapse
ADDING OTA UPDATE​
You will need to download its apk first- OTA_UPDATER_DWONLAOD
You will also require all 4 patch zips from above post.
STEPS TO ADD OTA UPDATE :-
Put OTAUpdater-1.0.5.apk in system/app folder.
Edit build prop by notepad++ and add these three lines:-
Code:
otaupdater.otaid=<ROM ID any you can pick>
otaupdater.otatime=<Date/time of this build in yyyymmdd-hhmm format>
otaupdater.otaver=<The human-readable version number/name>
EXAMPLE FROM MY ROM:-
Code:
otaupdater.otaid=xos
otaupdater.otatime=20130930-1553
otaupdater.otaver=1.0
Now you are good to receive and send OTA update to your Rom....but first you have to setup account online.
Registering Device Online
Go to https://www.otaupdatecenter.pro/ and Register there.
After successful registration,click on +Add Rom.A form will be opened then.Fill it.
1)Enter Rom name same as you written in build prop display id.
2)Enter ROM OTA ID (as in build.prop)
3)Enter ROM version (as in build.prop)
4)Enter OTA date/time here (yyyymmdd-hhmm, as in build.prop).
5)Enter download url.(put any URL right now,we are just adding rom first)
6)Enter MD5 file-hash.(put any file md5 check sum.we will edit it when we provide update)
7)Put any Change log...write anything
8)On last column put the name of your device same as in build prop "ro.product.device= ".In my case i use a110q and here is my code in build prop:-
Code:
ro.product.device=a110q
Lastly do not tick on check box as it will make OTA private.
Now your device is registered.
PROVIDING OTA UPDATE:-
Create update using any of my 4 files which you need to update.Lets assume you want to update an apk or add an apk,so you will use my only system folder patch zip.
Now open my provide zip using 7zip and drag and drop your apk with its path.As i provided patch with only system folder and no path forward.So open system folder and right click and create folder,name it "app" and then open app and drag apk in it.
If you were updating bootanimation then you should create media folder under system folder of my zip.
Now after making patches done.Download the Sign-em! from HERE and extract it anywhere.
You will get input,output and some more files....put your zip in input and run "sign-em.bat",it will sign your update zip and also give you its md5checksum.Signing your update is necessary.
After signing zip upload it to drop-box (suggested and tested) and after upload finished,click on download button and copy its url which is generated after that.Means copy url which is prompt in download manager if you using.If you do not use this url then OTA will not work.
Again open https://www.otaupdatecenter.pro/ and go to rom list and click on update rom.
This time put download URL which was generated after clicking download button on dropbox in URL box and also put its md5 checsum which was generated in output folder text file of sign-em!!
And change version also,put 2.0 in version if earlier 1.0,you can also put 1.1 or 1.2 any you want but change it.
And lastly put new date and time as per its format and give your update description if you want.
Check all things then click Update.All done you are good to get update.
Your mobile should have data connection enabled all time during this process.
if any confusion ask me or see faq on https://www.otaupdatecenter.pro/
WIP
ADDING CUSTOM KERNEL​
CUSTOM KERNEL ZIP STRUCTURE:-
->>Meta-inf
->>system/lib/modules
->>boot.img
For Adding it to your rom extract your kernel zip or drag and drop system/lib/modules/all files to port rom and replace all.
Then switch to kitchen and press "0" for advance option and then 12 for extracting boot.img.Here press "a" for extracting boot.img from any folder.Hit enter,you will see a folder created named like "bootimg_041114_230352" and put your custom kernel boot.img in it.
Now press Enter then kitchen will extract it in same folder.
Then back to kitchen 12 th menu of extraction of boot.img,here press "w" to extract boot.img from working folder,so it will extract boot.img from port rom(which is present in working folder) to BOOT-EXTRACTED folder under Kitchen.
Now copy zImage from previous extracted folder "bootimg_041114_230352" to BOOT-EXTRACTED folder and replace it.
Press b in kitchen to repack boot.img.All done.
What we have done above- We used zImage(from boot.img) of custom kernel in port rom boot.img and used all system/lib/modules folder from Custom kernel zip.
ADDING SMALL BUT COOL STUFFS​
ADDING DESIRED TEXT DURING ROM INSTALLATION:-
After Finishing your Rom,drag and drop Meta-inf/com/google/android/"Updater-script" to anywhere in your pc.
Now open it with Notepad++,and use this code to dislpay your texts in installation:-
Code:
ui_print(" ");
Put any alphabet or symbol or digit between (" ") and it will show during Installation.
For generating cool Ui prints you can search Google about text to ASCII converter websites and put your text and get cool texts for installation window.
After all modifications done,drag and drop back updater script to zip.
For Example:-
Code:
ui_print("========STARTING INSTALLATION===========");
ui_print("========================================");
ui_print(" |\ _,--------._ / | ");
ui_print(" | `.,' `. / | ");
ui_print(" ` ' BEAST ,-' ' ");
ui_print(" \/_ _ ( / ");
ui_print(" (,-.`. ,',-.`. `__,' ");
ui_print(" |/*\ ),-','*\`= ,'.` | ");
ui_print(" `._/) -'.\_,' ) ))| ");
ui_print(" / (_.)\ . -'// ");
ui_print(" ( /\____/\ ) )`'\ ");
ui_print(" \ |V----V|| ' , \ ");
ui_print(" |`- -- -' ,' \ \ _____ ");
ui_print(" ___ | .' \ \ `._,-' `- ");
ui_print(" `.__,`---^---' \ ` -' ");
ui_print(" -.______ \ . / ______,- ");
ui_print(" `. ,' ");
ui_print("=== STOCK BEAST ROM BY DIGYVIJAY KR. ===");
ADDING AROMA INSTALLER:-
Take help from HERE
And here is an HELPFUL VIDEO.
I will explain these stuffs later
ADDING CUSTOM BOOT ANIMATION & SHUT-ANIMATION:-
You Can find bootanimation and shutanimation under system/media folder.If you ported from larger resolution device or smaller resolution device then animation will look weird.so you need to resize it or add own made one.
[*]For adding own or editing previous boot-animation you will need this software-Download thanks to @despotovski01 for this)
[*]Now install it.You will also need to know your mobile resolution for making or resizing boot-animation or shut-animation to your size.
FOR RESIZING BOOT-ANIMATION & Shutanimation:-
[*]Take bootanimation.zip from system/media and extract it to any folder.
[*]Now you will see lots of images in it under its sub folder like part0 part1...
[*]Resize all images to your screen resolution.You can use some softwares to resize them easily.Find on Google.(do not mess with serial number order)
[*]Now make a New folder and make another folder under it named- "part0" and put your all resized pngs to it.(from all folders you have in your bootanimation.zip)
[*]Start Boot Animation Factory and Click on "create a new boot-animation",then choose "folder" and click OK.
[*]Now click choose folder button and browse your created folder in which you put part0 folder.DO not choose part0 folder,choose is outer folder.
[*]Here Click on add loop then select part0 folder in prompt dialog box and click on add.
[*]If you want to repeat animation then tick repeat.Now you should preview it first before saving.you can adujust animation speed by clciking on text above your loop created,and click to edit it and then edit FPS according to need.Here is the example line:-30 is FPS here and rest is reso...
Code:
480,854,30
[*]If everything fine then click save boot-animation and save it with name same as in sytem/medaia folder and then replace it.Its all done.
[*]Same process for shut-animation.
FOR CREATING BOOT-ANIMATION & Shutanimation:-
You will have to use own creativity skill for creating its frames.Some knowledge of Photoshop required.
Design your boot animation frames and manage it serially.
Create a folder with any name and create another sub folder in it named "part0" and put all your designed pngs in it.
Start Boot Animation Factory and Click on "create a new boot-animation",then choose "folder" and click OK.
Now click choose folder button and browse your created folder in which you put part0 folder.DO not choose part0 folder,choose is outer folder.
Here Click on add loop then select part0 folder in prompt dialog box and click on add.
If you want to repeat animation then tick repeat.Now you should preview it first before saving.you can adujust animation speed by clciking on text above your loop created,and click to edit it and then edit FPS according to need.Here is the example line:-30 is FPS here and rest is reso...
Code:
480,854,30
If everything fine then click save boot-animation and save it with name same as in sytem/medaia folder and then replace it.Its all done.
Same process for shut-animation.
ADDING DESIRED BOOT LOGO:-
Download logo builder-Download And install.
Get Stock logo.bin -Get the file from your device (/dev/logo) or from stock Rom sp tools flasher.
Open Logo-builder and Click Create New Project
.,? ,1
Now Select the logo.bin file you extracted from the device or took from stock rom.
Make a new folder for the project, any name will work
0Select the folder and click on OK
You will see a progress bar running down. After finishing, you will get a whole bunch of images in the above selected folder
After that,Open the folder containing all the images which you made earlier.
Here Edit or replace" img1.png and img39.png " but keep one thing in mind that use same name and same resolution and same format(png) for replacing.
Click on "make" button on LogoBuilder and you will get update.zip in the folder you made for this project.You can flash this update.zip directly via cwm or you can add to your rom by using below step.
For using logo in your rom,extract logo.bin from update.zip and drag and drop to port rom zip or you can also put this in working folder of kitchen before making Rom.After that,add below code in updater-script to extract your logo-
Code:
package_extract_file("logo.bin", "/dev/logo");
Reserved.
Great Guide
Best Guide Thanks For Helping New Developer like me
yes best guide ever seen for Mediatek devices ....please add seperate section in this thread for MIUI and Lewa os framework and bug solving:fingers-crossed:
excellent guide
Not booting
Everything i done mentioned by you .... But, after flashing with the ported rom created by me , my device stucks in booting.... i don't understand where is the problem actually....
I just ported to this rom
http://forum.xda-developers.com/can...-april-note-3-chrizelnotethree-v3-7a-t2707462
for my mmx canvas 2 plus a110q....
plz help me.....
sawankumar2012 said:
Everything i done mentioned by you .... But, after flashing with the ported rom created by me , my device stucks in booting.... i don't understand where is the problem actually....
I just ported to this rom
http://forum.xda-developers.com/can...-april-note-3-chrizelnotethree-v3-7a-t2707462
for my mmx canvas 2 plus a110q....
plz help me.....
Click to expand...
Click to collapse
remove uboot.bin if present.And also try replacing bootclasspath from stock init.rc to port init.rc
srinath2912 said:
yes best guide ever seen for Mediatek devices ....please add seperate section in this thread for MIUI and Lewa os framework and bug solving:fingers-crossed:
Click to expand...
Click to collapse
Ok i will add them next time i modify the post.....all suggestions are welcome,,,
chanti548 said:
excellent guide
Click to expand...
Click to collapse
thank-you my friend.......
DevendraMilmile121 said:
Best Guide Thanks For Helping New Developer like me
Click to expand...
Click to collapse
thanks milee
digyvijaykumar123 said:
remove uboot.bin if present.And also try replacing bootclasspath from stock init.rc to port init.rc
Click to expand...
Click to collapse
In which directory i found init.rc & bootclasspath .........
sawankumar2012 said:
In which directory i found init.rc & bootclasspath .........
Click to expand...
Click to collapse
under extracted boot.img/ramdisk/init.rc.........you will find bootclass path there.
sawankumar2012 said:
In which directory i found init.rc & bootclasspath .........
Click to expand...
Click to collapse
I'm uploading some screenshot here... It may help u to find my problem... these are the port roms screenshot which i wanna port for my mmx a110Q

[HOW TO] Flash PAC-ROM to Cricket / AIO (jflteaio) running I337ZTUUBND3

Hello all,
Using TWRP, I successfully flashed PAC-ROM to my Cricket 'jflteaio' or SGH-i337z ... I337ZTUUBND3, Galaxy S4.
A bit of helpful info for noobs: I rooted with 'towelroot' app --- Google it
And installed TWRP 2.7 from here
At this point...MAKE A BACKUP in TWRP!!! I AM NOT LIABLE FOR BRICKED DEVICES!
Now on to the real fun stuff! Follow these steps to flash Pac-Man ROM:
1. Download the GENERAL jflte rom 'zip' file and not the 'md5sum' from the PAC ROM website:
Download the zip HERE
2. Extract the zipped jflte pac rom into a new folder anywhere in Windows. In the new folder, navigate to this location:
\META-INF\com\google\android\
3. Download and install the free Windows program, NotePad++ --- Google it
4. Right-click on 'updater-script' in the folder \META-INF\com\google\android\
(IMPORTANT: Leave the 'update-binary' file alone; only modify the 'updater-script')
5. click on "Edit with NotePad++".
6. In NotePad++, Under the first word/command "assert" you will see a bunch of commands that start with 'getprop'. Find a spot where it reads '||' and make a new line directly after this. you will see many jflte codenames, so making your new line after you see 2 of the same codename and '||' will do.
7. Make sure the new line you made does not cut any commands in half and copy/paste in these lines of code:
Code:
getprop("ro.product.device") == "jflteaio" ||
getprop("ro.build.product") == "jflteaio" ||
(NOTE: This code will allow install of PAC-ROM on jflteaio)
8. Make sure to save the changes in the file. Close NotePad++.
9. Zip all the files you extracted from the original back up with 7zip or winrar... make sure the file extention is not '.7z' or '.rar'. Must be '.zip' to work. And the files you just zipped have to be in the root location of the zip file. In other words, make sure when you open your new zip, the first folder you see is 'META-INF'... for example in 7zip, you have to select all the elements(there are 5 in total...3 folders and 2 files) in the new folder you created earlier, and right-click and choose 7zip and 'add to archive'.
10. You can now flash the rom in TWRP from an sdcard by following the instructions HERE on XDA
(FINAL NOTE: By the way, make sure NOT to install the AT&T SafeStrap Kernel during the flash, as it may cause the ROM not to boot, and as always, make a TWRP BACKUP before you attempt flashing!)
I do not own any of the software in this guide. A special thanks to all the devs out there who make our lives better!
Best of skill (and luck) to you all!
raydantheman

TWRP 2.8.7 Recovery for including in Boot Image

This is TWRP 2.8.7, i.e. ramdisk-recovery..cpio built from source including the latest commit fixing failure to back to external SD. See here.: https://github.com/omnirom/android_bootable_recovery/commit/85161af11117431ff3a1d6b845e8faf35ef07b2c . I have also reduced annoyingly loud default vibration values...
This is not FOTA image, but rather a pre-built cpio ready to be included in your boot.img. It is built specifically for Xperia Z1 with all the appropriate flags.
Instructions:
1. Unzip the attached image, if you don't, you'll have a bootloop
2. Use Archi Kitchen to unpack your boot.img. Download from here: http://forum.xda-developers.com/showthread.php?t=2597220
3. Unpack kitchen, open terminal in that directory and do chmod a+x archi; then execute ./archi
4. Follow script directions and create a new project
5. Put your boot.img where the script tells you to
6. Execute ku to unpack kernel: you will have kernel directory in your project;
7. Go to /kernel/boot.img-ramdisk/sbin: you will see ramdisk-recovery.cpio file; just replace it with the attached one and execute kr to re-pack kernel.
8. You will have the new boot.img in project directory ready to be fastboot flashed.
9. If you touch anything else in unpacked kernel, your phone won't boot
10. From now and on, when you open archi kitchen, just pick (e) option for existing project and you can use any other boot.img to do the same.
optimumpro said:
This is TWRP 2.8.7, i.e. ramdisk-recovery..cpio built from source including the latest commit fixing failure to back to external SD. See here.: https://github.com/omnirom/android_bootable_recovery/commit/85161af11117431ff3a1d6b845e8faf35ef07b2c . I have also reduced annoyingly loud default vibration values...
This is not FOTA image, but rather a pre-built cpio ready to be included in your boot.img. It is built specifically for Xperia Z1 with all the appropriate flags.
Thanks. That is what I'm searching for for 2 days.
But it would be much better, if i could get totally rid of build in recovery.(TWRP will probabliy update.)
Click to expand...
Click to collapse
Click to expand...
Click to collapse

[guide][how to port roms][snapdragon][windows/linux]

HOW TO PORT ROMS IN WINDOWS​
WARNING :- I AM NOT RESPONSIBLE FOR BRICKED DEVICES, DEAD SD CARDS OR ANY OTHER STUFFS HAPPEN WITH YOU.
WARNING:- THIS IS FOR SNAPDRAGON DEVICES ONLY.
YOU NEED A WORKING A PC AND SOME SOFTWARES LIKE:-​
WINRAR (https://www.win-rar.com/download.html?&L=0)
NOTEPAD++ (https://notepad-plus-plus.org/)
ANDROID IMAGE KITCHEN (https://mega.nz/#F!P5AA3azC!AijFT4S-dAwbt88eKkTIMA)
EXTRACTOR 4.0 (https://mega.nz/#F!y0YhwT5D!SX6cQ7lPv7XGiH7GLDXLyw)
MELD (https://download.gnome.org/binaries/win32/meld/?_e_pi_=7,PAGE_ID10,4038285101)
SO HERE WE GO,
STEP 1
EXTRACT YOUR BASE ROM AND PORT ROM IN TWO DIFFERENT FOLDER.
STEP 2
MAKE TWO DIFFERENT FOLDER AND NAME THEM PORT BOOT IMAGE AND BASE BOOT IMAGE.
(NOT INSIDE THE ROM FOLDER)
STEP 3
COPY THE BASE BOOT IMAGE IN BASE BOOT IMAGE FOLDER
AND COPY THE PORT BOOT IMAGE IN PORT BOOT IMAGE FOLDER
STEP 4
USING ANDROID IMAGE KITCHEN
EXTRACT BOTH BOOT IMAGE (BASE AND PORT)
STEP 5
REPLACE [/SPLIT_IMG/boot.img-zImage](AFTER EXTRACTION )
REPLACE [/SPLIT_IMG/boot.img-dtb](AFTER EXTRACTION )
(FROM BASE BOOT IMAGE TO PORT BOOT IMAGE)
STEP 6
USING MELD,
COMPARE FILES [RAMDISK/INIT.RC]
COMPARE FILES [RAMDISK/FSTAB.QCOM]
(FROM BASE BOOT IMAGE TO PORT BOOT IMAGE)
STEP 7
USING ANDROID IMAGE KITCHEN
REPACK YOUR BOOT IMAGE.
FINALLY WE HAVE PORTED BOOT IMAGE !!!​STEP 8
EDIT YOUR UPDATE SCRIPT PRESENT IN [PORT ROM/META-INF/COM/GOOGLE/ANDROID/UPDATE SCRIPT]
ERASE
getprop("ro.product.device") == "XXXXXXX" || abort("This package is for "XXXXXX"" devices; this is a "" + getprop("ro.product.device")
FROM THE UPDATE SCRIPT
STEP 9
EDIT YOUR BUILD.PROP USING NOTEPAD++
COMPARE LCD DENSITY IN BUILD.PROP [PORT ROM/SYSTEM][WITH BASE ROM/SYSTEM/BUILD.PROP]
CHANGE YOUR MODEL NO. IN THESE LINES [IN PORT ROM'S BUILD.PROP]
ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.device=
STEP 10
REPACK YOUR PORT ROM USING WINRAR
DONE !!!
HOW TO PORT ROM IN LINUX​
FIRST STEP :-- INSTALL PACKAGES
ZIP, UNZIP, PYTHON,ADB, FASTBOOT, MELD
FOR DEBIAN BASED LINUX
Code:
sudo apt update; sudo apt install zip adb meld fastboot python unzip zip
DOWNLOAD THESE AND EXTRACT IT IN SEPERATE FOLDER
SUPERR 'S KITCHEN (https://forum.xda-developers.com/ap...chen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434)
AIK-LINUX (https://forum.xda-developers.com/showthread.php?t=2073775) EXTRACT THIS 2 TIME AND NAME IT PORT BOOT AND STOCK BOOT
IF YOU HAVE SYSTEM FOLDER THEN
MAKE TWO FOLDER NAME STOCK AND PORT
FOR MAKING FOLDER
Code:
mkdir stock port
(YOU CAN REPLACE THE NAME)
HERE WE GOT TWO FOLDERS, COPY YOUR STOCK ROM IN STOCK FOLDER AND PORT IN PORT FOLDER
THEN EXTRACT BOTH FILES BY UNZIP LIKE
Code:
[email protected]:~/path/to/your/rom/stock$ unzip *.zip
SAME FOR PORT ROM
Code:
[email protected]:~/path/to/your/rom/port$ unzip *.zip
NOW WE HAVE TO PORT THE BOOT IMAGE
GO TO WHERE YOU HAVE EXTRACTED AIK-LINUX , COPY THE STOCK BOOT IMAGE IN STOCK BOOT FOLDER AND PORT IN PORT BOOT FOLDER
NOW EXTRACT BOOT IMAGE
Code:
[email protected]:~/path/to/your/aik-linux/stock boot$ ./unpackimg.sh
AND SAME WITH PORT
Code:
[email protected]:~/path/to/your/aik-linux/port boot$ ./unpackimg.sh
NOW REPLACE, (FROM STOCK TO PORT
Code:
/SPLIT_IMG/BOOT.IMG-ZIMAGE
/SPLIT_IMG/BOOT.IMG-DTB
AFTER THAT USE MELD FOR COMPARING RAMDISK FILES, FOR MELD WRITE THIS IN TERMINAL
Code:
sudo meld
COMPARE,(FROM STOCK TO PORT
Code:
/ramdisk/fstab.qcom
/ramdisk/init.rc
/ramdisk/uneventd.rc
/ramdisk/uneventd.qcom.rc
NOW REPACK THE PORT BOOT IMAGE BY
Code:
[email protected]:~/path/to/your/aik-linux/port boot$ ./repackimg.sh
NOW WE HAVE SUCCESSFULLY PORTED THE BOOT IMAGE
PLACE IT IN YOUR PORT ROM
NOW THROUGH MELD, COMPARE YOUR BUILD.PROP FOR LCD DENSITY AND DEVICE NAME AND BRAND (FROM STOCK TO PORT
NOW OPEN YOUR UPDATER-SCRIPT PATH:- PORT ROM/META-INF/COM/GOOGLE/ANDROID
REMOVE THESE LINES IF IT HAVE
Code:
getprop("ro.product.device") == "XXXXXXX" || abort("This package is for "XXXXXX"" devices; this is a "" + getprop("ro.product.device")
AND REPLACE YOUR MOUNT SYSTEM,FORMAT SYSTEM AND BOOT.IMG FLASHING LINE FROM YOUR STOCK UPDATER-SCRIPT
REPACK YOUR ROM BY
Code:
[email protected]:~/path/to/your/port rom$ zip -r $ROMNAME meta-inf system boot.img
REPLACE $ROMNAME WITH YOUR ROM ZIP NAME AND IF YOU HAVE FOLDER TO COMPRESS JUST ADD THOSE AFTER META-INF WITH SPACE BETWEEN EACH FOLDER
DONE !!!
IF YOU HAVE SYSTEM.IMG OR SYSTEM.NEW.DAT.BR OR SYSTEM.NEW.DAT
USE SUPERR KITCHEN TO EXTRACT THOSE AND USE METHOD WRITTEN A BIT ABOVE​
bro i am totally new in porting field....however i tried porting MIUI 9 for yu yunique.....but no succeed....can you plz tell is it possible to port miui 9 custom rom for yu yunique... i Take port rom for redmi 2 and base rom MIUI 8 by Xinid for yu yunique........however i tried all the tuitorial on xda but not even single was helped... i soft bricked my deice more than 15 times....Is it compatible for yu yunique?? i found both devices has almost same configuration and android version also same.... Whats wrong??/
@AYUSH KUMAR
Hi,
Can you make a video for that? I can't do it because I don't speak English. I'm thinking of uploading the Miui 10 to Asus Ze552kl.
Bye.
Chakari said:
@AYUSH KUMAR
Hi,
Can you make a video for that? I can't do it because I don't speak English. I'm thinking of uploading the Miui 10 to Asus Ze552kl.
Bye.
Click to expand...
Click to collapse
Sorry I dont have a youtube video
@KumarAyush after Porting twrp shows this message
help me to port rom
sarthak darshan said:
@KumarAyush after Porting twrp shows this message
help me to port rom
Click to expand...
Click to collapse
That's Mount line in updater-script change it according to stock
can i port lineageos 15.1 from xperia v with msm8960 1gb ram to samsung s3 d2 with 14.1 and same chipset but 2 gb ram?
hi help me to port oneplus 5 rom to zenfone 4 pro(ZS551KL) thank you
Hi, first i want to thank you because making this tutorial, however because i'm new to this porting world, i'm stuck on a problem, the problem is, after following your steps, zipped it and flashed it on my phone, it goes to recovery back again and again when i press the reboot button, and i don't know how to solve this. can you help me? here some details about my port ROM:
ROM i want to Port: RR 5.8.5 [7.1.2_r29] [N] [OFFICIAL][LENOVO A6000]
ROM i use as Base: AOSP_RRO_Rev3 [6.0.1] [M] [UNOFFICIAL][C46B2G] (an Indonesian Phone, i think you don't know about it)
plis reply bro i'm stuck
hi,
I'm trying to port an Android 10 rom to an original that is Android 7 based. I don't see a vendor partition on this Nubia N3 original scripts (just a bunch of others).
Any idea how to fix that?
Do I need to repartition?
It's not treble ready. I am trying to port Redmi Note Pro 6 Android 10 pixel experience to an NX608J.
Any tips are greatly appreciated.
It working well i ported from Galaxy On7 to J5 2015 on miui 9 rom But touch screen not working : ( i flashed again and my phone is really dead : ( after flashed the rom!
Hey guys please suggest me similar devices to lenovo tab 10 tbx-103f. 1gb ram and 16 GB storage. Please. Anyone.
kumarayush2104 said:
HOW TO PORT ROMS IN WINDOWS​
WARNING :- I AM NOT RESPONSIBLE FOR BRICKED DEVICES, DEAD SD CARDS OR ANY OTHER STUFFS HAPPEN WITH YOU.
WARNING:- THIS IS FOR SNAPDRAGON DEVICES ONLY.
YOU NEED A WORKING A PC AND SOME SOFTWARES LIKE:-​
WINRAR (https://www.win-rar.com/download.html?&L=0)
NOTEPAD++ (https://notepad-plus-plus.org/)
ANDROID IMAGE KITCHEN (https://mega.nz/#F!P5AA3azC!AijFT4S-dAwbt88eKkTIMA)
EXTRACTOR 4.0 (https://mega.nz/#F!y0YhwT5D!SX6cQ7lPv7XGiH7GLDXLyw)
MELD (https://download.gnome.org/binaries/win32/meld/?_e_pi_=7,PAGE_ID10,4038285101)
SO HERE WE GO,
STEP 1
EXTRACT YOUR BASE ROM AND PORT ROM IN TWO DIFFERENT FOLDER.
STEP 2
MAKE TWO DIFFERENT FOLDER AND NAME THEM PORT BOOT IMAGE AND BASE BOOT IMAGE.
(NOT INSIDE THE ROM FOLDER)
STEP 3
COPY THE BASE BOOT IMAGE IN BASE BOOT IMAGE FOLDER
AND COPY THE PORT BOOT IMAGE IN PORT BOOT IMAGE FOLDER
STEP 4
USING ANDROID IMAGE KITCHEN
EXTRACT BOTH BOOT IMAGE (BASE AND PORT)
STEP 5
REPLACE [/SPLIT_IMG/boot.img-zImage](AFTER EXTRACTION )
REPLACE [/SPLIT_IMG/boot.img-dtb](AFTER EXTRACTION )
(FROM BASE BOOT IMAGE TO PORT BOOT IMAGE)
STEP 6
USING MELD,
COMPARE FILES [RAMDISK/INIT.RC]
COMPARE FILES [RAMDISK/FSTAB.QCOM]
(FROM BASE BOOT IMAGE TO PORT BOOT IMAGE)
STEP 7
USING ANDROID IMAGE KITCHEN
REPACK YOUR BOOT IMAGE.
FINALLY WE HAVE PORTED BOOT IMAGE !!!
​STEP 8
EDIT YOUR UPDATE SCRIPT PRESENT IN [PORT ROM/META-INF/COM/GOOGLE/ANDROID/UPDATE SCRIPT]
ERASE
getprop("ro.product.device") == "XXXXXXX" || abort("This package is for "XXXXXX"" devices; this is a "" + getprop("ro.product.device")
FROM THE UPDATE SCRIPT
STEP 9
EDIT YOUR BUILD.PROP USING NOTEPAD++
COMPARE LCD DENSITY IN BUILD.PROP [PORT ROM/SYSTEM][WITH BASE ROM/SYSTEM/BUILD.PROP]
CHANGE YOUR MODEL NO. IN THESE LINES [IN PORT ROM'S BUILD.PROP]
ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.device=
STEP 10
REPACK YOUR PORT ROM USING WINRAR
DONE !!!
HOW TO PORT ROM IN LINUX
FIRST STEP :-- INSTALL PACKAGES
ZIP, UNZIP, PYTHON,ADB, FASTBOOT, MELD
FOR DEBIAN BASED LINUX
Code:
sudo apt update; sudo apt install zip adb meld fastboot python unzip zip
DOWNLOAD THESE AND EXTRACT IT IN SEPERATE FOLDER
SUPERR 'S KITCHEN (https://forum.xda-developers.com/ap...chen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434)
AIK-LINUX (https://forum.xda-developers.com/showthread.php?t=2073775) EXTRACT THIS 2 TIME AND NAME IT PORT BOOT AND STOCK BOOT
IF YOU HAVE SYSTEM FOLDER THEN
MAKE TWO FOLDER NAME STOCK AND PORT
FOR MAKING FOLDER
Code:
mkdir stock port
(YOU CAN REPLACE THE NAME)
HERE WE GOT TWO FOLDERS, COPY YOUR STOCK ROM IN STOCK FOLDER AND PORT IN PORT FOLDER
THEN EXTRACT BOTH FILES BY UNZIP LIKE
Code:
[email protected]:~/path/to/your/rom/stock$ unzip *.zip
SAME FOR PORT ROM
Code:
[email protected]:~/path/to/your/rom/port$ unzip *.zip
NOW WE HAVE TO PORT THE BOOT IMAGE
GO TO WHERE YOU HAVE EXTRACTED AIK-LINUX , COPY THE STOCK BOOT IMAGE IN STOCK BOOT FOLDER AND PORT IN PORT BOOT FOLDER
NOW EXTRACT BOOT IMAGE
Code:
[email protected]:~/path/to/your/aik-linux/stock boot$ ./unpackimg.sh
AND SAME WITH PORT
Code:
[email protected]:~/path/to/your/aik-linux/port boot$ ./unpackimg.sh
NOW REPLACE, (FROM STOCK TO PORT
Code:
/SPLIT_IMG/BOOT.IMG-ZIMAGE
/SPLIT_IMG/BOOT.IMG-DTB
AFTER THAT USE MELD FOR COMPARING RAMDISK FILES, FOR MELD WRITE THIS IN TERMINAL
Code:
sudo meld
COMPARE,(FROM STOCK TO PORT
Code:
/ramdisk/fstab.qcom
/ramdisk/init.rc
/ramdisk/uneventd.rc
/ramdisk/uneventd.qcom.rc
NOW REPACK THE PORT BOOT IMAGE BY
Code:
[email protected]:~/path/to/your/aik-linux/port boot$ ./repackimg.sh
NOW WE HAVE SUCCESSFULLY PORTED THE BOOT IMAGE
PLACE IT IN YOUR PORT ROM
NOW THROUGH MELD, COMPARE YOUR BUILD.PROP FOR LCD DENSITY AND DEVICE NAME AND BRAND (FROM STOCK TO PORT
NOW OPEN YOUR UPDATER-SCRIPT PATH:- PORT ROM/META-INF/COM/GOOGLE/ANDROID
REMOVE THESE LINES IF IT HAVE
Code:
getprop("ro.product.device") == "XXXXXXX" || abort("This package is for "XXXXXX"" devices; this is a "" + getprop("ro.product.device")
AND REPLACE YOUR MOUNT SYSTEM,FORMAT SYSTEM AND BOOT.IMG FLASHING LINE FROM YOUR STOCK UPDATER-SCRIPT
REPACK YOUR ROM BY
Code:
[email protected]:~/path/to/your/port rom$ zip -r $ROMNAME meta-inf system boot.img
REPLACE $ROMNAME WITH YOUR ROM ZIP NAME AND IF YOU HAVE FOLDER TO COMPRESS JUST ADD THOSE AFTER META-INF WITH SPACE BETWEEN EACH FOLDER
DONE !!!
IF YOU HAVE SYSTEM.IMG OR SYSTEM.NEW.DAT.BR OR SYSTEM.NEW.DAT
USE SUPERR KITCHEN TO EXTRACT THOSE AND USE METHOD WRITTEN A BIT ABOVE​
Click to expand...
Click to collapse
I am stuck at this here:
"
REPLACE [/SPLIT_IMG/boot.img-zImage](AFTER EXTRACTION )
REPLACE [/SPLIT_IMG/boot.img-dtb](AFTER EXTRACTION )"
those two files aren't there when i try to extract the boot image for the galaxy s5

Searching TWRP for the SM-A515F

Hi,
I would like install at the Samsung SM-A515F the Lineage OS and the TWRP. I found only TWRP for the SM-A50. And the flashing dose not work for this phone.
I has try it with Heimdall and Odin.
The recovery I had downloaed from this Page:
https://www.droidthunder.com/install-twrp-recovery-on-galaxy-a51/
Need help or better information, if there exist an TWRP and lineage for this device.
Regards tiptel170
No need to flash twrp,u can flash aosp rom or even gsi with the help of odin only.Go to s10 page
sankhauaa said:
No need to flash twrp,u can flash aosp rom or even gsi with the help of odin only.Go to s10 page
Click to expand...
Click to collapse
s 10 page? which one is that? can u please provide the link?
Go here for odin flash method without twrp
sankhauaa said:
No need to flash twrp,u can flash aosp rom or even gsi with the help of odin only.Go to s10 page
Click to expand...
Click to collapse
sankhauaa said:
Go here for odin flash method without twrp
Click to expand...
Click to collapse
so does this method work for lineage os on A515F too?
After the long searching in the web, I found this:
A515F-TWRP
Link: https://firmware.gem-flash.com
After paying, you can download this TRWP. No idea, if this works. Maybe some one, will be use it.
ibtsam3301 said:
so does this method work for lineage os on A515F too?
Click to expand...
Click to collapse
I m not tried. But someone in this a51 group tried.Its working. But not so easy .
---------- Post added at 09:11 AM ---------- Previous post was at 09:09 AM ----------
tiptel170 said:
After the long searching in the web, I found this:
A515F-TWRP
Link: https://firmware.gem-flash.com
After paying, you can download this TRWP. No idea, if this works. Maybe some one, will be use it.
Click to expand...
Click to collapse
Don't pay.Its fake
tiptel170 said:
After the long searching in the web, I found this:
A515F-TWRP
Link: https://firmware.gem-flash.com
After paying, you can download this TRWP. No idea, if this works. Maybe some one, will be use it.
Click to expand...
Click to collapse
of course it would be fake
How can I open the img-files in the Linux desktop?
Found here this link, for the Magisk in the A515F:
https://forum.xda-developers.com/ga...w-to-root-samsung-a51-sm-a515f-t4032389/page2
I'll found this:
1. https://www.androlite.com/2020/01/twrp-root-samsung-galaxy-a51.html
2. https://appslova.com/install-twrp-on-samsung-galaxy-a51/
This links look likes good, because, my phone will not start or the heimdall goes into the error (likes in de page one, the screenshots ).
I found this, and I used basic from this page: https://forum.xda-developers.com/showpost.php?p=82241115&postcount=70
My first steps to install the lineage os 17 on the SM-A515F
Lineage: https://sourceforge.net/projects/andyyan-gsi/
All commands in the linux terminal, the path please use your own paths you like it!
Unpack lineage****.xz:
unxz lineage*.xz
1) Extract the AP_file.tar.md5 from your firmware.zip file using 7zip
2) Extract the super.img.lz4 file from the AP_file.tar.md5 file using 7zip
3) Put super.img.lz4 file in LZ4 folder and run in CMD the command
lz4 -d super.img.lz4 superLZ4.img
4) Put superLZ4.img file in Simg2img folder and run in CMD the command
chmod 777 ~/bin/otatools/bin/simg2img
~/bin/otatools/bin/simg2img superLZ4.img superSIMG.img
In Linux OR Bash shell:
1) Put superSIMG.img in otatools/bin folder and extract it in Linux terminal using the command
chomd 777 ~/bin/otatools/bin/lpunpack
~/bin/otatools/bin/lpunpack --slot=0 superSIMG.img ~/1
2) Put, in the folder where you extracted superSIMG.img, the GSI file you downloaded and rename it to system.img. Now you should have odm.img, system.img, vendor.img and product.img files in the same folder.
You may also need to delete/remane the original system.img file before renaming the GSI file.
3) Now you’re going to make a brand new super.img file containing all 4 files of the previous step. This is a critical and tricky step. Run Linux terminal and type:
chomd 777 ~/bin/otatools/bin/lpmake
~/bin/otatools/bin/lpmake ~/bin/otatools/bin/lpmake --metadata-size 65536 --super-name super --metadata-slots 2 --device super:4294967296 --group main:4293513600 --partition system:readonly:1959841792:main --image system=./system.img --partition vendor:readonly:680239104:main --image vendor=./vendor.img --partition odm:readonly:4349952:main --image odm=./odm.img --sparse --output ./super.img
4) Make an tar file:
tar -H ustar -c super.img > lineageos17.1_SMA515F.tar
5) Goto Windows -> Odin -> AP, put the file lineageos17.1_SMA515F.tar in to the AP-slot -> Start
This is what I has done:
But, by the compiling, I got this error:
Code:
lpmake I 07-15 20:18:20 92568 92568 builder.cpp:1012] [liblp]Partition system will resize from 0 bytes to 1959841792 bytes
lpmake I 07-15 20:18:20 92568 92568 builder.cpp:1012] [liblp]Partition vendor will resize from 0 bytes to 680239104 bytes
lpmake I 07-15 20:18:20 92568 92568 builder.cpp:1012] [liblp]Partition odm will resize from 0 bytes to 4349952 bytes
Invalid sparse file format at header magic
Invalid sparse file format at header magic
And the phone is into the boot-loop, it will not starting the system.
Any help please...
Update:
System requirements:
- Fedora 32 with current kernel
- VirtualBox 6.1 with USB support
- Windows 7
- ODIN 3.14
Enable Root:
I) On mobile phone
1. carry out firmware update
1.1 Set up device, WITHOUT Google Accounts, WITHOUT security settings, set up WLAN only
1.2 Settings -> Phone info -> Software information -> Build number (press 7x )
1.3 Settings -> developer option -> enable OEM unlocking and USB debugging
2. copy the files from the root directory to the external SD card
2.1 Install MagiskManager
2.2 Starting MagiskManager
2.3 Installing Magisk Select
II) In the Fedora area
3. unpack the boot.img from the AP***.tar, on the PC
3.1 lz4 -d boot.img.lz4 boot.img
3.2 Copy the boot.img to the SD card from the phone
4. patching the boot.img in MagikMager
4.1 Select the boot.img, wait until "Done" appears.
4.2 Then copy the magisk_patch.img to the workstation (Fedora)
5.1 Rename the original boot.img to boot_original.img
5.2 renaming magisk_patch.img to boot.img
5.3 Transfer the new boot.img to the PC for the ODIN or HEIMDALL
5.4 Convert the boot.img to boot.tar: tar -H ustar -c boot.img > boot.tar (here for ODIN)
III) Virtual environment Win7
6.1 Copy the boot.tar from the Fedora workstation to the Odin directory of Win7
6.2 Open the boot.tar in the AP slot, Auto Reboot must be off
6.3 Press Vol + & Vol - simultaneously and plug in the USB cable (On SM-A515F), then click on "Start" in the ODIN.
IV) On the Mobile Phone
7.1 If ready, restart with Vol - & Hold PWR for more than 7 sec
7.2 Putting the device into recovery mode (switch off, press vol up and pwr simultaneously, Samsunglog appears, release pwr again)
7.3 Wipe your data: Wiped data/factury reset
Note: Device makes a boot loop for the first time - is normal. The first start takes quite long, be patient!
7.4 Settings -> Phone info -> Software information -> Build number (press 7x )
7.5 Settings -> Developer option -> Enable OEM unlock, USB debugging and system auto update to OFF
7.6 Installing and starting MagiskManger
The device will restart once!
Check it: Whether root is present
Fedora workstation:
Call Terminal, enter adb shell followed by su
If everything went well, the MagiskManager should answer the phone and ask for authorization.
These steps works well with the firmware: SM-A515F R58N60BLPAZ
Where are the exactly steps for installing the TWRP?
I has installed the TWRP-10.0(A51).zip with the heimdall and the phone will not booting. And I'm not entering the TWRP. And finally I has reinstalled the revcovery.img (heimdall) from the APxxxx.zip file, and the phone starting normally.
All things with the AOSP10 etc, I has tried and the other steps for an alternative system will not work on this phone.
Thanks God, the root is now working. And I have to work with the ugly Samsung system.
tiptel170 said:
Update:
System requirements:
- Fedora 32 with current kernel
- VirtualBox 6.1 with USB support
- Windows 7
- ODIN 3.14
Enable Root:
I) On mobile phone
1. carry out firmware update
1.1 Set up device, WITHOUT Google Accounts, WITHOUT security settings, set up WLAN only
1.2 Settings -> Phone info -> Software information -> Build number (press 7x )
1.3 Settings -> developer option -> enable OEM unlocking and USB debugging
2. copy the files from the root directory to the external SD card
2.1 Install MagiskManager
2.2 Starting MagiskManager
2.3 Installing Magisk Select
II) In the Fedora area
3. unpack the boot.img from the AP***.tar, on the PC
3.1 lz4 -d boot.img.lz4 boot.img
3.2 Copy the boot.img to the SD card from the phone
4. patching the boot.img in MagikMager
4.1 Select the boot.img, wait until "Done" appears.
4.2 Then copy the magisk_patch.img to the workstation (Fedora)
5.1 Rename the original boot.img to boot_original.img
5.2 renaming magisk_patch.img to boot.img
5.3 Transfer the new boot.img to the PC for the ODIN or HEIMDALL
5.4 Convert the boot.img to boot.tar: tar -H ustar -c boot.img > boot.tar (here for ODIN)
III) Virtual environment Win7
6.1 Copy the boot.tar from the Fedora workstation to the Odin directory of Win7
6.2 Open the boot.tar in the AP slot, Auto Reboot must be off
6.3 Press Vol + & Vol - simultaneously and plug in the USB cable (On SM-A515F), then click on "Start" in the ODIN.
IV) On the Mobile Phone
7.1 If ready, restart with Vol - & Hold PWR for more than 7 sec
7.2 Putting the device into recovery mode (switch off, press vol up and pwr simultaneously, Samsunglog appears, release pwr again)
7.3 Wipe your data: Wiped data/factury reset
Note: Device makes a boot loop for the first time - is normal. The first start takes quite long, be patient!
7.4 Settings -> Phone info -> Software information -> Build number (press 7x )
7.5 Settings -> Developer option -> Enable OEM unlock, USB debugging and system auto update to OFF
7.6 Installing and starting MagiskManger
The device will restart once!
Check it: Whether root is present
Fedora workstation:
Call Terminal, enter adb shell followed by su
If everything went well, the MagiskManager should answer the phone and ask for authorization.
These steps works well with the firmware: SM-A515F R58N60BLPAZ
Where are the exactly steps for installing the TWRP?
I has installed the TWRP-10.0(A51).zip with the heimdall and the phone will not booting. And I'm not entering the TWRP. And finally I has reinstalled the revcovery.img (heimdall) from the APxxxx.zip file, and the phone starting normally.
All things with the AOSP10 etc, I has tried and the other steps for an alternative system will not work on this phone.
Thanks God, the root is now working. And I have to work with the ugly Samsung system.
Click to expand...
Click to collapse
It is work ???
GreggBorowski said:
It is work ???
Click to expand...
Click to collapse
--------------------------------------------------------------------------------------
These steps works well with the firmware: SM-A515F R58N60BLPAZ
Where are the exactly steps for installing the TWRP?
I has installed the TWRP-10.0(A51).zip with the heimdall and the phone will not booting. And I'm not entering the TWRP. And finally I has reinstalled the revcovery.img (heimdall) from the APxxxx.zip file, and the phone starting normally.
All things with the AOSP10 etc, I has tried and the other steps for an alternative system will not work on this phone.
Thanks God, the root is now working. And I have to work with the ugly Samsung system.
sankhauaa said:
I m not tried. But someone in this a51 group tried.Its working. But not so easy .
---------- Post added at 09:11 AM ---------- Previous post was at 09:09 AM ----------
Don't pay.Its fake
Click to expand...
Click to collapse
sar please send me a51 group
Mehran` said:
sar please send me a51 group
Click to expand...
Click to collapse
Go to s10 page
sankhauaa said:
Go here for odin flash method without twrp
Click to expand...
Click to collapse
Not working. I has done step by step in this guide.
ibtsam3301 said:
so does this method work for lineage os on A515F too?
Click to expand...
Click to collapse
No. Withe manipulation from the vbmeta.img, the system is unwilling to start. It gos in to the bootloader, with error-codes. Like in first thread I describe. Olny the SAMSUNG original system works with the kernel modification for the MagiskManager.
I saw black for the future, there will be exist an custom rom for this device.
I have no idea, what can I do for this device. But I use and spend a lot of time for modification, without an good result. Has anyone an idea what can I do? But it look likes, it has an great secure system intern for not using an customer rom. This is my intention.

Categories

Resources