Easy Magic PhilZ Touch Installer for MediaTek Devices ONLY (Developers ONLY)

Status
Not open for further replies.
Search This thread

yuweng

Senior Member
Feb 5, 2012
1,172
4,226

* * * * * * * * * * * * * * * * * * * * * * * * *
PhilZ Touch 6 Recovery
CWM Advanced Edition 6.x
* * * * * * * * * * * * * * * * * * * * * * * * *

PhilZ Touch CWM Advanced Edition is developed by XDA Recognized Developer Phil3759 now fully supports MediaTek devices . . .
rclxms_zps452ba9d3.gif


Supports Five generations of MediaTek SoC in One-Porting-Tool. :cool:
  1. Arm11
  2. Cortex-A9
  3. Cortex-A7
  4. big.LITTLE
  5. Cortex-A53
Video Preview
For full features & functions, refer to Main Thread here . . . :good:

Credits
Phil3759
Michfood
suhas.holla
shoxxy
Last but not least, my Master Shifu Carliv who has taught me how to compile & continuously guiding me to the right direction & also many DEVs that shared & published their findings on the World Wide Web on various subject . . . . . .
salute_zps09342dc6.gif


Updated Credits - Added support for MTK big.LITTLE & Cortex-A53
Huge Credits to . . .
Russian Master Shifu Javum
Master Shifu Carliv

Huge Thanks to Xpeca1 for confirming all the porting tool features & functions is working correctly on his Cortex-A53 & not forgetting NiksSkersts too . . . :highfive:

This updates has the most beta-tester, never the less, thanks for all their contributions too . . .

XDA:DevDB Information
Easy Magic PhilZ Touch Installer for MediaTek Devices ONLY (Developers ONLY), Tool/Utility for all devices (see above for details)

Contributors
yuweng
Source Code: https://github.com/PhilZ-cwm6/philz_touch_cwm6


Version Information
Status: Stable
Current Stable Version: Final Release 6.59.0
Stable Release Date: 2015-03-09

Created 2014-05-11
Last Updated 2015-04-09
 

Attachments

  • 1.png
    1.png
    75.1 KB · Views: 790,636
  • 2.png
    2.png
    71.7 KB · Views: 593,969
  • 3.png
    3.png
    68.7 KB · Views: 591,367
  • 4.png
    4.png
    97.9 KB · Views: 589,352
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Terms & Conditions of Use

codeworkx said:
DEAR KANGERS
If you're going to reuse our work, which we're doing for free, be fair and give proper credits.
This is the only payment we're really demanding and we deserve it to be mentioned because of the countless hours we've put into this project.
Open-Source doesn't meant Out-of-Respect!!!

Thanks to all contributors!!!
As Master Shifu codeworkx says, the same applies here . . .

All i'm asking is for you to give proper credits to me & the DEVs that i mentioned on the porting tool, without them sharing, this porting tool wouldn't have exists !

i have seen many that took my work, got a ported working PhilZ Touch on their MTKs & shared it directly even here on XDA ! while some at other forum threads BUT not a single word mentioning this thread, me or the porting tool or the DEVs that has contributed to this project . . .

Many just make a new thread with the ported PhilZ Touch & shared it with their followers, fooling their followers by not mentioning credits so that their followers thinking that the ported PhilZ Touch is built from source & is their own work, collected all the Thanks & that will make them look cool while some even solicit for Donations !

Anyone can just download this porting tool, run the exe & they will get a ported PhilZ Touch on their MTK, what is so cool about that . . .

Do you know how many hours i have put into this, not mentioned is the time studying & building PhilZ Touch from source, PC hardware upgrading, broadband fee, electricity fee, time to study & building this porting tool exe & i'm sharing this all for FOC & i don't solicit for Donations or Thanks in return, i don't even post my Donate button . . .

If you wanna start a new thread to support specific MTK devices with the ported PhilZ Touch, i have absolutely no problem with that, it will be your responsibility to response & provide support to your followers but pls give proper credits . . .

If you think this porting tool is too complicated & you would wanna start a new thread/ guide/ video or whatever either here or else where, again i have absolutely no problem with that BUT pls pls don't mirror the porting tool. i'm sure you have seen this all the time at XDA here by other DEVs, the logic is very simple, when you mirror the files, there is no way of tracking which version has bugs. Most importantly, i need direct feedback from users & when you mirror the files, your followers will download that version from your link & they complain & feedback to you but you won't be able to fix it so pls put a link direct to this thread so that i can improve on this porting tool.

If you wanna post this porting tool on your blog, website or anything at all, again i have absolutely no problem with that BUT again post a link directly to this thread so that users can always post a bug report here & they will always get the new, bug free porting tool as i will fix it when i receive bug report.

Credits mentioning & redirecting link to original threads won't make you low standard, in fact your followers will be thanking you for sharing with them a great new tool that you found. Credits mentioning & redirecting link to original threads also means that you give respect & honor the original DEVs of the tool, this would also enable feedbacks on new ideas, new features & improvement of that particular tool too.

If you are a company then pls get my permission first or the least you can do is Donate to Phil3759 for a job well done & if you are an end user, you are also encourage to do so too, fyi, i did . . .
Features

Auto mode
- You don't need to know a thing & it'll port a working PhilZ Touch for your MTK & that is why it is called Magic . . .
brows_zpsda58f2fa.gif


Manual mode
- Let you choose either to use your boot.img or recovery.img for porting.
- Let you manually choose your device res, MTK fixes, Flip screen/ Flip Touch, different font size & uses all files from your stock recovery when using recovery.img. For boot.img porting, this tool will only use its kernel only. Refer to here for more info . . .
- device resolutions
- flipped screen

UnPack/ RePack mode
- Let you mod whatever you want with option to install it right away to your MTK

Requirement
- Requires Root
- Install adb driver
- Enable USB debugging
- Disable UAC
- Disable driver signature
- Works from Gingerbread to Lollipop but NOT on encrypted data partition on Lollipop but why you enable it back ?
- No need ro.secure=0 to run
recovery.fstab How-to


Preface
As mentioned few times, i don't own all the MTK devices available on the market so a few things might not work on your MTK. So use the UnPack/ RePack mode to edit necessary files typically the init.rc & recovery.fstab.

UnPack other MTK PhilZ Touch by other DEVs & see how they did it.

As mentioned few times, the porting tool now is AIO so go ahead & play with it.

Intro
What is recovery.fstab

The actual require backup partition for MTKs or any android devices are actually ONLY just the boot, cache, data & system partition.

When you encounter any problems such as doesn't boot/ bootloop issues after a new app installation or anything at all, a Wipe Data/ Factory Reset or Restore with ONLY the system & data partition & you'll be able to revert to previous working state in a short while. Thats why its very important to make a backup before modding anything at all !

For bootloop issues with new firmware installation (update.zip) then its best to restore everything. Having said that, if you flash preloader using SP Flash Tool then PhilZ Touch restore would not be able to restore it or for that matter, your device wouldn't even be able to boot at all (brick), thats why it is important to backup your Factory ROM with MTK Droid Root & Tools first.

For latest MTK armv8
Since the latest MTK armv8 is using direct device path, below is possible as i've seen it on msm devices but personally i think it is unnecessary to have those partition backed up as it will take alot of space & typically you only brick the system or data partition but then again, that is entirely up to you on what you wanna backup. Below example is taken from Master Shifu Carliv github, added all various armv8 devices direct device path partition for reference. To find out the actual MTK armv8 partition info on your device, use the command adb shell cat /proc/partinfo & adb shell ls -al /dev/block/platform/mtk-msdc.0/by-name
Code:
# Android fstab file.

# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#<src>                                        <mnt_point> <type><mnt_flags and options><fs_mgr_flags>
/dev/block/platform/mtk-msdc.0/by-name/boot      /boot      emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/nvram     /nvram     emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/flashinfo /flashinfo emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/expdb     /expdb     emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/recovery  /recovery  emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/secro     /secro     ext4 relatime wait,check
/dev/block/platform/mtk-msdc.0/by-name/seccfg    /seccfg    emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/proinfo   /proinfo   emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/para      /para      emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/logo      /logo      emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/tee1      /tee1      emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/tee2      /tee2      emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/otp       /otp       emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/lk        /lk        emmc defaults defaults
/dev/block/platform/mtk-msdc.0/by-name/system    /system    ext4 ro,noatime wait
/dev/block/platform/mtk-msdc.0/by-name/preload   /preload   ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check
/dev/block/platform/mtk-msdc.0/by-name/cache     /cache     ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check
/dev/block/platform/mtk-msdc.0/by-name/userdata  /data      ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,resize,encryptable=/dev/block/platform/mtk-msdc.0/by-name/metadata
/dev/block/platform/mtk-msdc.0/by-name/protect1  /protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,autoformat
/dev/block/platform/mtk-msdc.0/by-name/protect2  /protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,autoformat
/dev/block/platform/mtk-msdc.0/by-name/persist   /persist   ext4 relatime wait,check
/dev/block/platform/mtk-msdc.0/by-name/custom    /custom    ext4 relatime wait,check

/devices/mtk-msdc.0/11240000.MSDC1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
To manually make a SP Flash Tool backup of your MTK armv8 Factory ROM then refer to here & you can also use the following empty cache secro userdata since a Factory Reset/ Wipe Data will wipe data partition anyway.

Updates
Refer to here & here for custom partition backup/ restore on armv8 Thanks to Katinatez . . . :good:

Refer to this the only lead shared by BachMinuetInG . . . :good:

Aroma File Manager
It is a known problem that aromafm will not to work properly on flip-screen, this is not a PhilZ Touch problem as it has never been updated for almost a year.

Flip Screen/ Flip Touch/ Font size

It is a known problem that MTK manufacturer uses non-standard design & uses different Flip Screen/ Non-Flip LCD with different combinations of Flip/ Non-Flip Touch Screen on various Portrait & especially Landscape Android devices.

There is absolutely no way that the porting tool could detect whether your MTK's Touch is FlipX or FlipY or SwapXY so i build all possible combinations into the porting tool -> Manual-mode -> Try all combinations one at a time until one that works for your device.

Typical Flip Screen device then choose either Flip Screen Only or Flip Screen FlipX-FlipY. For Landscape devices (tabs), typically is SwapXY FlipY.

As said, i don't own all MTK devices so i donno which font size is suitable for your device so again, you'll need to play around with the different selection. Below are available fonts as demonstrated on my 480x854 res . . .

font_7x16.png font_10x18.png courier_extended_15x24.png roboto_10x18.png roboto_15x24.png roboto_23x41.png fonten55_33x84.png
Bug report <- No support if you don't attach it to your post.

Please always attach recovery.log & log.txt from the porting tool or i'll be giving the wrong advice based on assumption & that might brick your device !

How to obtain recovery log
  1. adb pull /tmp/recovery.log -> Attach to your post
  2. At PhilZ Touch -> Advanced Functions -> Report Error -> Copy log from /sdcard/clockworkmod/philz_recovery.log -> Attach to your post

If you don't see me replying means either the answer is already at this thread so start reading every page, its not like there are 100 over pages, as of 18 March 2015, there are only 14 pages . . .

The 2nd reason you don't see me replying is i donno the answer then head up to PhilZ Touch development thread & get help from Phil3759 directly . . .
Questions & Answers

Q : Your tool doesn't work.
A : Its already explained at the OP, pls read EVERYTHING at Page 1 !

Q : I can't get adb to work on my PC.
A : Then get one of your device forum DEV to look at this porting tool.

Q : I have a MTK model xxx SoC YYY, does your porting tool support it.
A : The title already said it, for all MediaTek Devices ONLY

Q : I have a MTK but i'm afraid the porting tool would brick my device.
A : Then don't use it ! Its for Developers ONLY !

Q : OP said DO NOT USE IT ON LOCKED BOOTLOADER but the link doesn't say much for MTK devices.
A : There isn't any guide to identify locked bootloader on MTKs, generally you'll have to flash the recovery.img to find out whether it bricks ! However, farenheith has confirmed by flashing back the original stock 3e recovery.img & his locked bootloader MTK Motorola boots back !

To check your bootloader
Code:
adb reboot-bootloader [COLOR="Blue"]or[/COLOR] adb reboot bootloader [COLOR="blue"]or[/COLOR] adb reboot fastboot
fastboot getvar all
Code:
(bootloader)  unlocked: NO
To unlock it, use below command.
Code:
fastboot oem unlock
Source

As explained BRANDED at the OP, UNBRANDED MTKs are generally MTKs directly from China, have unlock bootloaders.

Updates
MTK armv7/ armv8 LP refer to this workaround, make sure to unlock your bootloader first !

List of supported MTK devices . . .
 
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Installation

Installation How-to

Where is the Downloads . . .

Downloads_zps57cc2266.jpg
WARNING

Even though wrong installation of custom recovery normally will bricks the recovery only however it is better to be safe than sorry.

PhilZ Touch is packed with many features so typically it will work on MTK devices with above 6Mb recovery partition however you can try your luck.

Tested working perfectly on my legacy MTK device, MT6573 & MT6577.
  1. Make a Factory ROM backup first with MTK Droid Tools. My old guide here.
  2. Install Flashify & make another backup of your current recovery first & also the boot.img too
  3. Extract, double-click PhilZ Setup & follow the on-screen for instructions.
YOUR TOOL DOESN'T WORK . . .
i've seen this at many threads & also mentioned this many times at my other threads, most frequent reply is it doesn't work, you have given nothing at all to figure out what went wrong . . .
alamak_zps2e31ed77.gif


Please list out as many info as possible then it'll be easier to trouble-shoot & read EVERYTHING before hands-on, fyi, tested working on XP to Win10 Technical Preview . . .
  1. What OS you are using on the PC & your MTK...
  2. Did you disable UAC & Anti-Virus
  3. Did you execute the porting tool at C: drive if you're using XP else then at your Desktop
  4. Did you try Run as Administrator
  5. Could it be some other software that you installed that interfere with the porting tool then uninstall it
  6. Did you try it on other PC with other version OS or even different USB port
  7. Try uninstall all previous adb driver -> Device Manager -> View -> Show hidden devices -> uninstall all ADB Interface/ Android device -> reboot -> re-install. Refer to screenshot -> View attachment 3018860
  8. Did you try latest google ADB driver while for XP try this one
 
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Known problems on MTK devices

Known problems on MTK devices

E: failed to mount /cache
  • Mostly older intermediate MediaTek devices such as MT6589, MT6572 that comes with only 6Mb recovery partition, most probably won't work. However, it works on my legacy MT6573, MT6577 because its kernel is much smaller. There has been feedback from fellow xda members that some latter MediaTek devices comes with 7Mb & 8Mb. Latest MT6592 has a recovery partition of more than 8Mb.

  • PhilZ Touch does not support ubifs

  • PhilZ Touch does not support MTK Alcatel devices with /custpack partition. Added support at beta version

  • Haven't identify latest voldmanaged mount points for Internal SD that uses /storage/usbdisk voldmanaged=usbdisk:auto so it won't mount Internal SD on such layouts. Thanks to adhamamar for sharing the solution. :good:

  • In the past, there has been reports that Touch doesn't work at recovery on some MTK devices, try using different releases of kernels from your device. Recovery is independent so GB, ICS or JB kernel will work provided they are from your device.

  • Thanks to shoxxy for the tip, flip screen works on PhilZ Touch with added Flip screen flag. However, it has a small glitches that is the screen will flashes & flip upside down when using the virtual keys. Since Touch is fully working either don't use the virtual keys or just disable it permanently. PhilZ Settings -> GUI Preferences -> Toggle Virtual Keys

    Updates
    Fixed flip screen flickering, Thanks to Teamwin updated flip screen codes . . . :good:

  • # Even though the MTK SoC is designed by MediaTek but the one that produces it is hundreds if not thousands of factories so some might use other combinations to boot up the recovery. It is a known problem that some MTK doesn't wanna boot up PhilZ Touch the normal way so try Popey900 technique. Standard procedure : Take out the battery, wait a while, put it back, hold Volume Up or Down, don't let go then press the Power button until it boots up PhilZ Touch #

  • Do not try this on lock bootloader MTK devices as there has been confirmed cases that it will brick it, refer to here for more info.
---------------------------------------
This tool will auto-install Aroma FileManager & it is a known problem on some MTK devices that Aroma FileManager refuses to start & complains about E:Can't make /tmp/update_binary -> Installation aborted . . .

On Flip screen MTK device, Aromafm will always be flipped & the answer is here

Work around - Built-in to porting tool
  1. Use the Auto mode first & it will auto make a backup of your current recovery.
  2. Pull out the USB cable & use the Manual mode, copy recovery.img from BackUp-MTK-Recovery folder to Stock & it will ask you to plug-in the USB to PC.
  3. Now open Stock/recovery/rmdisk/init.rc with Notepad++ & add the line as below & save it.
  4. Plug-in USB cable to PC, press OK, select your device res & it'll auto install it.
    Code:
        mkdir /emmc
        mkdir /system
        mkdir /data
        mkdir /cache
        [COLOR="blue"][B]mkdir /tmp[/B][/COLOR]  [COLOR="Red"]<- add this line to init.rc[/COLOR]
        mount tmpfs tmpfs /tmp
    
        chown root shell /tmp
        chmod 0775 /tmp
  5. Aroma FileManager shall work now.
---------------------------------------
On my friend's old ICS 4.0.4 MT6577 with 480x854 res, ported PhilZ Touch doesn't boot & later i found out its something to do with the kernel not supporting PhilZ res more than 320x480.


Work around - Built-in to porting tool
  • At Windows Explorer -> Show Hidden Files & Folders -> MTK_PhilZ -> bin -> extract out 240x320_bg.png from res.7z, rename it to stitch.png
  • Plug-in the USB cable & use the manual mode, select your device res & it will ask whether you have flipped screen.
  • Copy & paste extracted 240x320 stitch.png to Stock/recovery/rmdisk/res/images folder to replace it & answer the flipped screen question
  • At PhilZ Settings -> GUI Preferences -> Change Background -> Reset Koush Background


 
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Trouble-shooting

Trouble-shooting the mount USB storage
Huge credits to suhas.holla, the fstab v2 AKA unified fstab has been demystified for MTK devices & mount both sdcard at PhilZ Touch is working perfecty now. . . :laugh:
i don't own every MediaTek devices out there so most probably some will not mount USB storage for both of the storage while at recovery b'cos of different voldmanaged path.

Updates - Built-in to porting tool
Refer to below on how to identify it & correct this problem.
Open a new Notepad & save the below to MTK_PhilZ folder for unpack/ repack of ported PhilZ Touch recovery.img.

MTK_unpack.bat
Code:
@echo off
cd %~dp0
chcp 1251
if (%1)==() (
	echo Select image
		goto end
)

setlocal enabledelayedexpansion
COLOR 0A
mode con:cols=65 lines=31
bin\sfk166.exe hexfind %1 -pat -bin /88168858/ -case >bin\offset.txt
bin\sfk166.exe hexfind %1 -pat -bin /FFFFFFFF1F8B08/ -case >>bin\offset.txt 
bin\sfk166.exe find bin\offset.txt -pat offset>bin\off2.txt
bin\sfk166.exe replace bin\off2.txt -binary /20/0A/ -yes

if exist %~N1 rd /s /q %~N1 >nul

set /A N=0
:loop
FOR /F %%G IN (bin\off2.txt) DO (
	if !N!==1 (
		set /A ofs1=%%G
		set /A N+=1
	)
	if !N!==3 (
		set /A ofs2=%%G
		set /A N+=1
	)
	if !N!==5 (
		set /A ofs3=%%G+4
		set /A N+=1
	)	
	if `%%G` EQU `offset` (
		set /A N+=1
	)
)
FOR %%i IN (%1) DO ( set /A boot_size=%%~Zi )
echo.
echo - size of %1 %boot_size% byte
echo - kernel offset     - %ofs1%
echo - ram_header offset - %ofs2%
echo - ram_disk offset   - %ofs3%
echo.

del bin\offset.txt
del bin\off2.txt
md %~N1
echo - extracting kernel_header...
bin\sfk166.exe partcopy %1 -fromto 0x0 %ofs1% %~N1\kernel_header -yes
echo - extracting kernel...
bin\sfk166.exe partcopy %1 -fromto %ofs1% %ofs2% %~N1\kernel -yes
echo - extracting ram_header...
bin\sfk166.exe partcopy %1 -fromto %ofs2% %ofs3% %~N1\ram_header -yes
echo - extracting ram_disk...
bin\sfk166.exe partcopy %1 -fromto %ofs3% %boot_size% %~N1\ram_disk.gz -yes

echo - unpack ram_disk.gz...

bin\7za.exe -tgzip x -y %~N1\ram_disk.gz -o%~N1 >nul
echo - unpack ram_disk.cpio...

md %~N1\rmdisk
cd %~N1
cd rmdisk
%~dp0bin\cpio.exe -i <../ram_disk
cd ..
cd ..

copy %1 %~N1 
echo.
echo - Done ^^!
echo.
pause
:end
MTK_pack.bat
Code:
@echo off
cd %~dp0
chcp 1251
if (%1)==() (
	echo Select folder
	goto end
)
setlocal enabledelayedexpansion
COLOR 0A
mode con:cols=60 lines=39
set pt=%~N1%~X1
echo %pt%
copy %pt%\ram_header %~N1\new_ram_with_header >nul
cd %pt%
%~dp0bin\chmod og=xr rmdisk
cd rmdisk

echo - pack rmdisk to cpio...
%~dp0bin\find . | %~dp0bin\cpio.exe -o -H newc -F ../new_ram_disk.cpio >nul
move ..\ram_disk ..\ram_disk_old >nul
copy ..\new_ram_disk.cpio ..\ram_disk
echo - pack rmdisk to gzip...
%~dp0bin\gzip -n -f ../ram_disk
echo - add header...
%~dp0bin\dd if=../ram_disk.gz >> ../new_ram_with_header
FOR %%i IN (../ram_disk.gz) DO ( set /A size=%%~Zi )
echo - new ramdisk %size% byte
%~dp0bin\sfk166 hex %size% -digits=8 >../../size.txt
FOR %%i IN (../../size.txt) DO ( set /A size=%%~Zi )
%~dp0bin\sfk166 split 1 ../../size.txt ../../1 >nul
FOR /F  %%i IN (../../1.part7) DO (set a1=%%i)
FOR /F  %%i IN (../../1.part8) DO (set a2=%%i)

FOR /F  %%i IN (../../1.part5) DO (set a3=%%i)
FOR /F  %%i IN (../../1.part6) DO (set a4=%%i)

FOR /F  %%i IN (../../1.part3) DO (set a5=%%i)
FOR /F  %%i IN (../../1.part4) DO (set a6=%%i)

FOR /F  %%i IN (../../1.part1) DO (set a7=%%i)
FOR /F  %%i IN (../../1.part2) DO (set a8=%%i)
echo %a7%%a8%>size.txt
echo %a5%%a6%>>size.txt
echo %a3%%a4%>>size.txt
echo %a1%%a2%>>size.txt
echo - add new size in header 0x%a1%%a2% 0x%a3%%a4% 0x%a5%%a6% 0x%a7%%a8%
%~dp0bin\sfk166.exe echo %a1%%a2% %a3%%a4% %a5%%a6% %a7%%a8% +hextobin ../../tmp1.dat
%~dp0bin\sfk166.exe partcopy ../../tmp1.dat 0 4 ../new_ram_with_header 4 -yes>nul

echo - make image...
%~dp0bin\mkbootimg.exe --kernel ../kernel --ramdisk ../new_ram_with_header -o ../new_image.img 
del size.txt >nul
copy ..\new_image.img %~dp0\new_image.img
move ..\ram_disk_old ..\ram_disk >nul
cd ..
cd ..
del size.txt >nul
del tmp1.dat>nul
del 1.part*>nul

echo.
echo - Done ^^!
echo.
pause
:end
Just Drag&Drop ported PhilZ Touch recovery.img to MTK_unpack.bat to unpack it & Drag&Drop unpack recovery folder to MTK_pack.bat to repack it back. Disable UAC first.

Or you can also download the original Boot/Recovery repack utils for WINDOWS to unpack/ repack the ported PhilZ Touch recovery. Basically it operates exactly the same except for this porting tool, it is using the standalone 7za.exe instead of 7z.exe that requires the 7z.dll to operate.


Huge Credits to Russian Master Shifu Michfood for sharing his unpack/ repack MTK boot/ recovery algorithm or this porting tool would not have exists & you will have do all this on a NIX box . . . :laugh:

recovery.fstab for MT65xx
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#<src>         <mnt_point>   <type>   <mnt_flags and options>               <fs_mgr_flags>
/dev/bootimg    /bootimg      emmc     defaults                               defaults
/dev/recovery   /recovery     emmc     defaults                               defaults
/dev/uboot      /uboot        emmc     defaults                               defaults
/emmc@android   /system       ext4     ro,noatime                             wait
/emmc@cache     /cache        ext4     noatime,nosuid,nodev,noauto_da_alloc   wait
/emmc@usrdata   /data         ext4     noatime,nosuid,nodev,noauto_da_alloc   wait,encryptable=footer

# For MT6577
/devices/platform/mtk-sd.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:[COLOR="blue"][B][SIZE="4"]6[/SIZE][/B][/COLOR] 
/devices/platform/mtk-sd.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto

Code:
# For MT65[B]xx[/B]
[COLOR="Blue"]/devices/platform/mtk-msdc.0/mmc_host/mmc0[/COLOR] auto auto defaults voldmanaged=sdcard0:[COLOR="blue"][B][SIZE="4"]6[/SIZE][/B][/COLOR] 
[COLOR="blue"]/devices/platform/mtk-msdc.1/mmc_host/mmc1[/COLOR] auto auto defaults voldmanaged=sdcard1:auto
To identify your MTK voldmanaged path for sdcard -> adb shell find /sys -name mmc0. You don't need to include the first path /sys so it should start with /devices

To identify your internal sdcard partition no. -> adb shell cat /proc/dumchar_info & look at fat partition block /dev/block/mmcblk0p6 & update it accordingly . . .

Update it to fstab.${ro.hardware} too.

The correct way to check ${ro.hardware} -> adb shell getprop ro.hardware -> mt6577 then it should be rename to fstab.mt6577
------------------------------------------------
Updates - Built-in to porting tool
Some MTK don't use fat mount points for Internal sdcard then this tool will fail to identify it & ported PhilZ Touch will not boot/ bootloop . . . :cowboy:

Code:
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:    [COLOR="Red"]<- Empty[/COLOR]
/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto

Solution - Put a # at the beginning of that line or just delete it & it'll boot . . .

Code:
[B][SIZE="3"][COLOR="Blue"]#[/COLOR][/SIZE][/B]/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:    [COLOR="Red"]<- Empty[/COLOR]
/devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
------------------------------------------------

To identify USB voldmanaged mount points for Internal SD -> adb shell su -c "ls -R" > c:\users\YOUR USER NAME\desktop\usb.txt

Look for anything usb in it & try it at the fstab.${ro.hardware} & also update it to recovery.fstab too. Both must be identical or it will not work.

An example below, confirmed by shoxxy that can be view at PhilZ Touch -> Install Zip but doesn't mount it at mount USB storage.

Code:
/devices/platform/mt_usb/usb1 auto auto defaults voldmanaged=usbdisk:auto

Also look for various example here on voldmanaged for USB storage & hopefully someone will get it working one day.

if yours is a /data/media device then it would not work . . .

Refer to here credits to RD chrmhoffmann
As mentioned many times, i don't own all MTK devices out there so some features might not work. To fix it & to learn more about modding recovery refer to my Master Shifu thread here & here . . . :good:

When everything fails then try your hands on building one yourself with the optional build flags here for your MTK . . . :cool:
 
Last edited:

Popey900

Senior Member
Jun 23, 2011
61
3
Hi there. Does it work with the Jiayu G5S ?

Is there a simple guide?


Gesendet von meinem JY-G5S mit Tapatalk
 
  • Like
Reactions: clio94

pavan kr

Senior Member
Aug 24, 2013
76
65
Banglore
manual porting ?

SIR Thanks a lot for creating the tool :good:

BTW I tried on my mt6577 in both the ways but it says recovery.img is too large and it is aborting

my question is How to do manual porting for this recovery as we did for carliv touch recovery ( i tried to merge the A9,7z with my ramdisk but it didnt worked)

so pls assist me Sir :crying:
 

Attachments

  • err.png
    err.png
    15.3 KB · Views: 2,047
  • Like
Reactions: ba_alwy and yuweng

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Updates - Built-in to porting tool

Temporary work around is to use the same technique at post #3 most bottom . . . :cowboy: When ask whether you have flipped screen, that is the time to delete the files. Binary files at Stock/recovery/rmdisk/sbin as listed below are safe to be deleted to save some space. List below starts with less critical to critical & i have absolutely no idea what will happened in the long run but definitely it'll boots.

Most of them are utilities for formatting the sdcard while at recovery. Try one at a time starting with Item 1, if still it complains about oversize then delete 1+2 , 1+2+3 & so on until it auto-install . . . :fingers-crossed:
  1. Parted
  2. sdparted
  3. fb2png
  4. mount.exfat
  5. adbd
  6. e2fsck & tune2fs

Updates
You can also try tinypng.com the tips from EnerJon to resize all images at Stock\recovery\rmdisk\res\images to a much smaller size that might just be enough for it to boot PhilZ Touch on your MTK . . . :fingers-crossed:
--------------------------------
Refer to updates of the updates here . . . :good:
 
Last edited:

ladalgigi

Senior Member
Little problem

Hi

First, thank you for porting Philz cwm recovery to our mediatek devices.

:confused: I have a zte blade q mini rooted with framaroot but when i want to use your tool, it says ro.secure=1 so no way to port recovery for me.

Any idea or workaround ?

Thank you
ladalgigi

---------- Post added at 02:59 PM ---------- Previous post was at 02:58 PM ----------



You have to go on the top of OP, you can see Discussion and Download tab...
 
  • Like
Reactions: yuweng

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Update info . . .

but, i can't see download ling of Philz.exe . . . can give me Download Link ?
ro.secure=1 so no way to port recovery for me. Any idea or workaround ?
---------- Post added at 02:59 PM ---------- Previous post was at 02:58 PM ----------
You have to go on the top of OP, you can see Discussion and Download tab...
i donno why so many cannot see the Downloads, updated info here . . . :cool:

For ro.secure=1 solution is also at the same post & since you already gain root, refer to here . . . :good:

My experience is that you'll have to EXIT MTK Droid Tools first then start the PhilZ.exe or both will be conflicting using the adb shell at the same time . . . :cowboy:

Updates
To others facing the same problem & still you cannot make ro.secure=0 then follow the guide here on how to upload your boot.img & let MTK Droid Tools automatically make the boot.img to ro.secure=0 for you . . . :good: You can also let MTK Droid Tools automatically make & install CWM for you first then use PhilZ.exe to updates it to PhilZ Touch . . . :laugh:

WARNING
Be careful, wrong steps & you'll end up with a soft-brick MTK . . . :eek: Make a Factory ROM backup first, read & continue reading then only hands on !
 
Last edited:

Popey900

Senior Member
Jun 23, 2011
61
3
Hi yuweng,

I have root shell right.
but the program says I need root shell.

what can I do?


see my attached file
 

Attachments

  • root.jpg
    root.jpg
    142.2 KB · Views: 682
  • Unbenannt.jpg
    Unbenannt.jpg
    177 KB · Views: 710

Popey900

Senior Member
Jun 23, 2011
61
3
Hi !
I tried the manual mode an put my recovery.img in the right folder.
But it gets the same error.

How i can make my boot.img to ro.secure=0 ?
 

Popey900

Senior Member
Jun 23, 2011
61
3
Hi all.
Now i have a Boot.img with ro.secure=0 (Thank you to hanuma) :eek:

Now i have the next Problem.

After installing, (Congratulation now you have PhilZ.... Boot into recovery? Yes or No)

And he cant't boot into the recovery.
Only Bootlogo.
 
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
And he cant't boot into the recovery.
In the past, users feedback the same for my other porting tool & then they manually installed it & it works . . . :cowboy: Ported recovery.img is at PhilZ folder.

If still it doesn't boot then upload your stock recovery.img here & i'll have a look at it . . . :fingers-crossed:
Can you please check, if the backup / Restore of boot.img / system are done correctly ?
Hey, and i though you followed the news back at the CTR thread then you would've know this . . . :laugh:

CWM/ PhilZ Touch never boots on MTK since last year on the release of cm10.2 & cm11 b'cos we are not using fstab v2 . . . :eek:

And just got PhilZ Touch fully supported on MTK devices, Phil3759 just a few days ago announces retirement & releases all the close source to the world . . .
ids_emoticon_wilted_zps9728bd64.gif
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 125

    * * * * * * * * * * * * * * * * * * * * * * * * *
    PhilZ Touch 6 Recovery
    CWM Advanced Edition 6.x
    * * * * * * * * * * * * * * * * * * * * * * * * *

    PhilZ Touch CWM Advanced Edition is developed by XDA Recognized Developer Phil3759 now fully supports MediaTek devices . . .
    rclxms_zps452ba9d3.gif


    Supports Five generations of MediaTek SoC in One-Porting-Tool. :cool:
    1. Arm11
    2. Cortex-A9
    3. Cortex-A7
    4. big.LITTLE
    5. Cortex-A53
    Video Preview
    For full features & functions, refer to Main Thread here . . . :good:

    Credits
    Phil3759
    Michfood
    suhas.holla
    shoxxy
    Last but not least, my Master Shifu Carliv who has taught me how to compile & continuously guiding me to the right direction & also many DEVs that shared & published their findings on the World Wide Web on various subject . . . . . .
    salute_zps09342dc6.gif


    Updated Credits - Added support for MTK big.LITTLE & Cortex-A53
    Huge Credits to . . .
    Russian Master Shifu Javum
    Master Shifu Carliv

    Huge Thanks to Xpeca1 for confirming all the porting tool features & functions is working correctly on his Cortex-A53 & not forgetting NiksSkersts too . . . :highfive:

    This updates has the most beta-tester, never the less, thanks for all their contributions too . . .

    XDA:DevDB Information
    Easy Magic PhilZ Touch Installer for MediaTek Devices ONLY (Developers ONLY), Tool/Utility for all devices (see above for details)

    Contributors
    yuweng
    Source Code: https://github.com/PhilZ-cwm6/philz_touch_cwm6


    Version Information
    Status: Stable
    Current Stable Version: Final Release 6.59.0
    Stable Release Date: 2015-03-09

    Created 2014-05-11
    Last Updated 2015-04-09
    45
    Terms & Conditions of Use

    codeworkx said:
    DEAR KANGERS
    If you're going to reuse our work, which we're doing for free, be fair and give proper credits.
    This is the only payment we're really demanding and we deserve it to be mentioned because of the countless hours we've put into this project.
    Open-Source doesn't meant Out-of-Respect!!!

    Thanks to all contributors!!!
    As Master Shifu codeworkx says, the same applies here . . .

    All i'm asking is for you to give proper credits to me & the DEVs that i mentioned on the porting tool, without them sharing, this porting tool wouldn't have exists !

    i have seen many that took my work, got a ported working PhilZ Touch on their MTKs & shared it directly even here on XDA ! while some at other forum threads BUT not a single word mentioning this thread, me or the porting tool or the DEVs that has contributed to this project . . .

    Many just make a new thread with the ported PhilZ Touch & shared it with their followers, fooling their followers by not mentioning credits so that their followers thinking that the ported PhilZ Touch is built from source & is their own work, collected all the Thanks & that will make them look cool while some even solicit for Donations !

    Anyone can just download this porting tool, run the exe & they will get a ported PhilZ Touch on their MTK, what is so cool about that . . .

    Do you know how many hours i have put into this, not mentioned is the time studying & building PhilZ Touch from source, PC hardware upgrading, broadband fee, electricity fee, time to study & building this porting tool exe & i'm sharing this all for FOC & i don't solicit for Donations or Thanks in return, i don't even post my Donate button . . .

    If you wanna start a new thread to support specific MTK devices with the ported PhilZ Touch, i have absolutely no problem with that, it will be your responsibility to response & provide support to your followers but pls give proper credits . . .

    If you think this porting tool is too complicated & you would wanna start a new thread/ guide/ video or whatever either here or else where, again i have absolutely no problem with that BUT pls pls don't mirror the porting tool. i'm sure you have seen this all the time at XDA here by other DEVs, the logic is very simple, when you mirror the files, there is no way of tracking which version has bugs. Most importantly, i need direct feedback from users & when you mirror the files, your followers will download that version from your link & they complain & feedback to you but you won't be able to fix it so pls put a link direct to this thread so that i can improve on this porting tool.

    If you wanna post this porting tool on your blog, website or anything at all, again i have absolutely no problem with that BUT again post a link directly to this thread so that users can always post a bug report here & they will always get the new, bug free porting tool as i will fix it when i receive bug report.

    Credits mentioning & redirecting link to original threads won't make you low standard, in fact your followers will be thanking you for sharing with them a great new tool that you found. Credits mentioning & redirecting link to original threads also means that you give respect & honor the original DEVs of the tool, this would also enable feedbacks on new ideas, new features & improvement of that particular tool too.

    If you are a company then pls get my permission first or the least you can do is Donate to Phil3759 for a job well done & if you are an end user, you are also encourage to do so too, fyi, i did . . .
    Features

    Auto mode
    - You don't need to know a thing & it'll port a working PhilZ Touch for your MTK & that is why it is called Magic . . .
    brows_zpsda58f2fa.gif


    Manual mode
    - Let you choose either to use your boot.img or recovery.img for porting.
    - Let you manually choose your device res, MTK fixes, Flip screen/ Flip Touch, different font size & uses all files from your stock recovery when using recovery.img. For boot.img porting, this tool will only use its kernel only. Refer to here for more info . . .
    - device resolutions
    - flipped screen

    UnPack/ RePack mode
    - Let you mod whatever you want with option to install it right away to your MTK

    Requirement
    - Requires Root
    - Install adb driver
    - Enable USB debugging
    - Disable UAC
    - Disable driver signature
    - Works from Gingerbread to Lollipop but NOT on encrypted data partition on Lollipop but why you enable it back ?
    - No need ro.secure=0 to run
    recovery.fstab How-to


    Preface
    As mentioned few times, i don't own all the MTK devices available on the market so a few things might not work on your MTK. So use the UnPack/ RePack mode to edit necessary files typically the init.rc & recovery.fstab.

    UnPack other MTK PhilZ Touch by other DEVs & see how they did it.

    As mentioned few times, the porting tool now is AIO so go ahead & play with it.

    Intro
    What is recovery.fstab

    The actual require backup partition for MTKs or any android devices are actually ONLY just the boot, cache, data & system partition.

    When you encounter any problems such as doesn't boot/ bootloop issues after a new app installation or anything at all, a Wipe Data/ Factory Reset or Restore with ONLY the system & data partition & you'll be able to revert to previous working state in a short while. Thats why its very important to make a backup before modding anything at all !

    For bootloop issues with new firmware installation (update.zip) then its best to restore everything. Having said that, if you flash preloader using SP Flash Tool then PhilZ Touch restore would not be able to restore it or for that matter, your device wouldn't even be able to boot at all (brick), thats why it is important to backup your Factory ROM with MTK Droid Root & Tools first.

    For latest MTK armv8
    Since the latest MTK armv8 is using direct device path, below is possible as i've seen it on msm devices but personally i think it is unnecessary to have those partition backed up as it will take alot of space & typically you only brick the system or data partition but then again, that is entirely up to you on what you wanna backup. Below example is taken from Master Shifu Carliv github, added all various armv8 devices direct device path partition for reference. To find out the actual MTK armv8 partition info on your device, use the command adb shell cat /proc/partinfo & adb shell ls -al /dev/block/platform/mtk-msdc.0/by-name
    Code:
    # Android fstab file.
    
    # The filesystem that contains the filesystem checker binary (typically /system) cannot
    # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
    
    #<src>                                        <mnt_point> <type><mnt_flags and options><fs_mgr_flags>
    /dev/block/platform/mtk-msdc.0/by-name/boot      /boot      emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/nvram     /nvram     emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/flashinfo /flashinfo emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/expdb     /expdb     emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/recovery  /recovery  emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/secro     /secro     ext4 relatime wait,check
    /dev/block/platform/mtk-msdc.0/by-name/seccfg    /seccfg    emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/proinfo   /proinfo   emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/para      /para      emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/logo      /logo      emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/tee1      /tee1      emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/tee2      /tee2      emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/otp       /otp       emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/lk        /lk        emmc defaults defaults
    /dev/block/platform/mtk-msdc.0/by-name/system    /system    ext4 ro,noatime wait
    /dev/block/platform/mtk-msdc.0/by-name/preload   /preload   ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check
    /dev/block/platform/mtk-msdc.0/by-name/cache     /cache     ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check
    /dev/block/platform/mtk-msdc.0/by-name/userdata  /data      ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,resize,encryptable=/dev/block/platform/mtk-msdc.0/by-name/metadata
    /dev/block/platform/mtk-msdc.0/by-name/protect1  /protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,autoformat
    /dev/block/platform/mtk-msdc.0/by-name/protect2  /protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,autoformat
    /dev/block/platform/mtk-msdc.0/by-name/persist   /persist   ext4 relatime wait,check
    /dev/block/platform/mtk-msdc.0/by-name/custom    /custom    ext4 relatime wait,check
    
    /devices/mtk-msdc.0/11240000.MSDC1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
    To manually make a SP Flash Tool backup of your MTK armv8 Factory ROM then refer to here & you can also use the following empty cache secro userdata since a Factory Reset/ Wipe Data will wipe data partition anyway.

    Updates
    Refer to here & here for custom partition backup/ restore on armv8 Thanks to Katinatez . . . :good:

    Refer to this the only lead shared by BachMinuetInG . . . :good:

    Aroma File Manager
    It is a known problem that aromafm will not to work properly on flip-screen, this is not a PhilZ Touch problem as it has never been updated for almost a year.

    Flip Screen/ Flip Touch/ Font size

    It is a known problem that MTK manufacturer uses non-standard design & uses different Flip Screen/ Non-Flip LCD with different combinations of Flip/ Non-Flip Touch Screen on various Portrait & especially Landscape Android devices.

    There is absolutely no way that the porting tool could detect whether your MTK's Touch is FlipX or FlipY or SwapXY so i build all possible combinations into the porting tool -> Manual-mode -> Try all combinations one at a time until one that works for your device.

    Typical Flip Screen device then choose either Flip Screen Only or Flip Screen FlipX-FlipY. For Landscape devices (tabs), typically is SwapXY FlipY.

    As said, i don't own all MTK devices so i donno which font size is suitable for your device so again, you'll need to play around with the different selection. Below are available fonts as demonstrated on my 480x854 res . . .

    font_7x16.png font_10x18.png courier_extended_15x24.png roboto_10x18.png roboto_15x24.png roboto_23x41.png fonten55_33x84.png
    Bug report <- No support if you don't attach it to your post.

    Please always attach recovery.log & log.txt from the porting tool or i'll be giving the wrong advice based on assumption & that might brick your device !

    How to obtain recovery log
    1. adb pull /tmp/recovery.log -> Attach to your post
    2. At PhilZ Touch -> Advanced Functions -> Report Error -> Copy log from /sdcard/clockworkmod/philz_recovery.log -> Attach to your post

    If you don't see me replying means either the answer is already at this thread so start reading every page, its not like there are 100 over pages, as of 18 March 2015, there are only 14 pages . . .

    The 2nd reason you don't see me replying is i donno the answer then head up to PhilZ Touch development thread & get help from Phil3759 directly . . .
    Questions & Answers

    Q : Your tool doesn't work.
    A : Its already explained at the OP, pls read EVERYTHING at Page 1 !

    Q : I can't get adb to work on my PC.
    A : Then get one of your device forum DEV to look at this porting tool.

    Q : I have a MTK model xxx SoC YYY, does your porting tool support it.
    A : The title already said it, for all MediaTek Devices ONLY

    Q : I have a MTK but i'm afraid the porting tool would brick my device.
    A : Then don't use it ! Its for Developers ONLY !

    Q : OP said DO NOT USE IT ON LOCKED BOOTLOADER but the link doesn't say much for MTK devices.
    A : There isn't any guide to identify locked bootloader on MTKs, generally you'll have to flash the recovery.img to find out whether it bricks ! However, farenheith has confirmed by flashing back the original stock 3e recovery.img & his locked bootloader MTK Motorola boots back !

    To check your bootloader
    Code:
    adb reboot-bootloader [COLOR="Blue"]or[/COLOR] adb reboot bootloader [COLOR="blue"]or[/COLOR] adb reboot fastboot
    fastboot getvar all
    Code:
    (bootloader)  unlocked: NO
    To unlock it, use below command.
    Code:
    fastboot oem unlock
    Source

    As explained BRANDED at the OP, UNBRANDED MTKs are generally MTKs directly from China, have unlock bootloaders.

    Updates
    MTK armv7/ armv8 LP refer to this workaround, make sure to unlock your bootloader first !

    List of supported MTK devices . . .
    27
    Known problems on MTK devices

    Known problems on MTK devices

    E: failed to mount /cache
    • Mostly older intermediate MediaTek devices such as MT6589, MT6572 that comes with only 6Mb recovery partition, most probably won't work. However, it works on my legacy MT6573, MT6577 because its kernel is much smaller. There has been feedback from fellow xda members that some latter MediaTek devices comes with 7Mb & 8Mb. Latest MT6592 has a recovery partition of more than 8Mb.

    • PhilZ Touch does not support ubifs

    • PhilZ Touch does not support MTK Alcatel devices with /custpack partition. Added support at beta version

    • Haven't identify latest voldmanaged mount points for Internal SD that uses /storage/usbdisk voldmanaged=usbdisk:auto so it won't mount Internal SD on such layouts. Thanks to adhamamar for sharing the solution. :good:

    • In the past, there has been reports that Touch doesn't work at recovery on some MTK devices, try using different releases of kernels from your device. Recovery is independent so GB, ICS or JB kernel will work provided they are from your device.

    • Thanks to shoxxy for the tip, flip screen works on PhilZ Touch with added Flip screen flag. However, it has a small glitches that is the screen will flashes & flip upside down when using the virtual keys. Since Touch is fully working either don't use the virtual keys or just disable it permanently. PhilZ Settings -> GUI Preferences -> Toggle Virtual Keys

      Updates
      Fixed flip screen flickering, Thanks to Teamwin updated flip screen codes . . . :good:

    • # Even though the MTK SoC is designed by MediaTek but the one that produces it is hundreds if not thousands of factories so some might use other combinations to boot up the recovery. It is a known problem that some MTK doesn't wanna boot up PhilZ Touch the normal way so try Popey900 technique. Standard procedure : Take out the battery, wait a while, put it back, hold Volume Up or Down, don't let go then press the Power button until it boots up PhilZ Touch #

    • Do not try this on lock bootloader MTK devices as there has been confirmed cases that it will brick it, refer to here for more info.
    ---------------------------------------
    This tool will auto-install Aroma FileManager & it is a known problem on some MTK devices that Aroma FileManager refuses to start & complains about E:Can't make /tmp/update_binary -> Installation aborted . . .

    On Flip screen MTK device, Aromafm will always be flipped & the answer is here

    Work around - Built-in to porting tool
    1. Use the Auto mode first & it will auto make a backup of your current recovery.
    2. Pull out the USB cable & use the Manual mode, copy recovery.img from BackUp-MTK-Recovery folder to Stock & it will ask you to plug-in the USB to PC.
    3. Now open Stock/recovery/rmdisk/init.rc with Notepad++ & add the line as below & save it.
    4. Plug-in USB cable to PC, press OK, select your device res & it'll auto install it.
      Code:
          mkdir /emmc
          mkdir /system
          mkdir /data
          mkdir /cache
          [COLOR="blue"][B]mkdir /tmp[/B][/COLOR]  [COLOR="Red"]<- add this line to init.rc[/COLOR]
          mount tmpfs tmpfs /tmp
      
          chown root shell /tmp
          chmod 0775 /tmp
    5. Aroma FileManager shall work now.
    ---------------------------------------
    On my friend's old ICS 4.0.4 MT6577 with 480x854 res, ported PhilZ Touch doesn't boot & later i found out its something to do with the kernel not supporting PhilZ res more than 320x480.


    Work around - Built-in to porting tool
    • At Windows Explorer -> Show Hidden Files & Folders -> MTK_PhilZ -> bin -> extract out 240x320_bg.png from res.7z, rename it to stitch.png
    • Plug-in the USB cable & use the manual mode, select your device res & it will ask whether you have flipped screen.
    • Copy & paste extracted 240x320 stitch.png to Stock/recovery/rmdisk/res/images folder to replace it & answer the flipped screen question
    • At PhilZ Settings -> GUI Preferences -> Change Background -> Reset Koush Background


    27
    Trouble-shooting

    Trouble-shooting the mount USB storage
    Huge credits to suhas.holla, the fstab v2 AKA unified fstab has been demystified for MTK devices & mount both sdcard at PhilZ Touch is working perfecty now. . . :laugh:
    i don't own every MediaTek devices out there so most probably some will not mount USB storage for both of the storage while at recovery b'cos of different voldmanaged path.

    Updates - Built-in to porting tool
    Refer to below on how to identify it & correct this problem.
    Open a new Notepad & save the below to MTK_PhilZ folder for unpack/ repack of ported PhilZ Touch recovery.img.

    MTK_unpack.bat
    Code:
    @echo off
    cd %~dp0
    chcp 1251
    if (%1)==() (
    	echo Select image
    		goto end
    )
    
    setlocal enabledelayedexpansion
    COLOR 0A
    mode con:cols=65 lines=31
    bin\sfk166.exe hexfind %1 -pat -bin /88168858/ -case >bin\offset.txt
    bin\sfk166.exe hexfind %1 -pat -bin /FFFFFFFF1F8B08/ -case >>bin\offset.txt 
    bin\sfk166.exe find bin\offset.txt -pat offset>bin\off2.txt
    bin\sfk166.exe replace bin\off2.txt -binary /20/0A/ -yes
    
    if exist %~N1 rd /s /q %~N1 >nul
    
    set /A N=0
    :loop
    FOR /F %%G IN (bin\off2.txt) DO (
    	if !N!==1 (
    		set /A ofs1=%%G
    		set /A N+=1
    	)
    	if !N!==3 (
    		set /A ofs2=%%G
    		set /A N+=1
    	)
    	if !N!==5 (
    		set /A ofs3=%%G+4
    		set /A N+=1
    	)	
    	if `%%G` EQU `offset` (
    		set /A N+=1
    	)
    )
    FOR %%i IN (%1) DO ( set /A boot_size=%%~Zi )
    echo.
    echo - size of %1 %boot_size% byte
    echo - kernel offset     - %ofs1%
    echo - ram_header offset - %ofs2%
    echo - ram_disk offset   - %ofs3%
    echo.
    
    del bin\offset.txt
    del bin\off2.txt
    md %~N1
    echo - extracting kernel_header...
    bin\sfk166.exe partcopy %1 -fromto 0x0 %ofs1% %~N1\kernel_header -yes
    echo - extracting kernel...
    bin\sfk166.exe partcopy %1 -fromto %ofs1% %ofs2% %~N1\kernel -yes
    echo - extracting ram_header...
    bin\sfk166.exe partcopy %1 -fromto %ofs2% %ofs3% %~N1\ram_header -yes
    echo - extracting ram_disk...
    bin\sfk166.exe partcopy %1 -fromto %ofs3% %boot_size% %~N1\ram_disk.gz -yes
    
    echo - unpack ram_disk.gz...
    
    bin\7za.exe -tgzip x -y %~N1\ram_disk.gz -o%~N1 >nul
    echo - unpack ram_disk.cpio...
    
    md %~N1\rmdisk
    cd %~N1
    cd rmdisk
    %~dp0bin\cpio.exe -i <../ram_disk
    cd ..
    cd ..
    
    copy %1 %~N1 
    echo.
    echo - Done ^^!
    echo.
    pause
    :end
    MTK_pack.bat
    Code:
    @echo off
    cd %~dp0
    chcp 1251
    if (%1)==() (
    	echo Select folder
    	goto end
    )
    setlocal enabledelayedexpansion
    COLOR 0A
    mode con:cols=60 lines=39
    set pt=%~N1%~X1
    echo %pt%
    copy %pt%\ram_header %~N1\new_ram_with_header >nul
    cd %pt%
    %~dp0bin\chmod og=xr rmdisk
    cd rmdisk
    
    echo - pack rmdisk to cpio...
    %~dp0bin\find . | %~dp0bin\cpio.exe -o -H newc -F ../new_ram_disk.cpio >nul
    move ..\ram_disk ..\ram_disk_old >nul
    copy ..\new_ram_disk.cpio ..\ram_disk
    echo - pack rmdisk to gzip...
    %~dp0bin\gzip -n -f ../ram_disk
    echo - add header...
    %~dp0bin\dd if=../ram_disk.gz >> ../new_ram_with_header
    FOR %%i IN (../ram_disk.gz) DO ( set /A size=%%~Zi )
    echo - new ramdisk %size% byte
    %~dp0bin\sfk166 hex %size% -digits=8 >../../size.txt
    FOR %%i IN (../../size.txt) DO ( set /A size=%%~Zi )
    %~dp0bin\sfk166 split 1 ../../size.txt ../../1 >nul
    FOR /F  %%i IN (../../1.part7) DO (set a1=%%i)
    FOR /F  %%i IN (../../1.part8) DO (set a2=%%i)
    
    FOR /F  %%i IN (../../1.part5) DO (set a3=%%i)
    FOR /F  %%i IN (../../1.part6) DO (set a4=%%i)
    
    FOR /F  %%i IN (../../1.part3) DO (set a5=%%i)
    FOR /F  %%i IN (../../1.part4) DO (set a6=%%i)
    
    FOR /F  %%i IN (../../1.part1) DO (set a7=%%i)
    FOR /F  %%i IN (../../1.part2) DO (set a8=%%i)
    echo %a7%%a8%>size.txt
    echo %a5%%a6%>>size.txt
    echo %a3%%a4%>>size.txt
    echo %a1%%a2%>>size.txt
    echo - add new size in header 0x%a1%%a2% 0x%a3%%a4% 0x%a5%%a6% 0x%a7%%a8%
    %~dp0bin\sfk166.exe echo %a1%%a2% %a3%%a4% %a5%%a6% %a7%%a8% +hextobin ../../tmp1.dat
    %~dp0bin\sfk166.exe partcopy ../../tmp1.dat 0 4 ../new_ram_with_header 4 -yes>nul
    
    echo - make image...
    %~dp0bin\mkbootimg.exe --kernel ../kernel --ramdisk ../new_ram_with_header -o ../new_image.img 
    del size.txt >nul
    copy ..\new_image.img %~dp0\new_image.img
    move ..\ram_disk_old ..\ram_disk >nul
    cd ..
    cd ..
    del size.txt >nul
    del tmp1.dat>nul
    del 1.part*>nul
    
    echo.
    echo - Done ^^!
    echo.
    pause
    :end
    Just Drag&Drop ported PhilZ Touch recovery.img to MTK_unpack.bat to unpack it & Drag&Drop unpack recovery folder to MTK_pack.bat to repack it back. Disable UAC first.

    Or you can also download the original Boot/Recovery repack utils for WINDOWS to unpack/ repack the ported PhilZ Touch recovery. Basically it operates exactly the same except for this porting tool, it is using the standalone 7za.exe instead of 7z.exe that requires the 7z.dll to operate.


    Huge Credits to Russian Master Shifu Michfood for sharing his unpack/ repack MTK boot/ recovery algorithm or this porting tool would not have exists & you will have do all this on a NIX box . . . :laugh:

    recovery.fstab for MT65xx
    Code:
    # Android fstab file.
    # The filesystem that contains the filesystem checker binary (typically /system) cannot
    # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
    
    #<src>         <mnt_point>   <type>   <mnt_flags and options>               <fs_mgr_flags>
    /dev/bootimg    /bootimg      emmc     defaults                               defaults
    /dev/recovery   /recovery     emmc     defaults                               defaults
    /dev/uboot      /uboot        emmc     defaults                               defaults
    /emmc@android   /system       ext4     ro,noatime                             wait
    /emmc@cache     /cache        ext4     noatime,nosuid,nodev,noauto_da_alloc   wait
    /emmc@usrdata   /data         ext4     noatime,nosuid,nodev,noauto_da_alloc   wait,encryptable=footer
    
    # For MT6577
    /devices/platform/mtk-sd.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:[COLOR="blue"][B][SIZE="4"]6[/SIZE][/B][/COLOR] 
    /devices/platform/mtk-sd.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto

    Code:
    # For MT65[B]xx[/B]
    [COLOR="Blue"]/devices/platform/mtk-msdc.0/mmc_host/mmc0[/COLOR] auto auto defaults voldmanaged=sdcard0:[COLOR="blue"][B][SIZE="4"]6[/SIZE][/B][/COLOR] 
    [COLOR="blue"]/devices/platform/mtk-msdc.1/mmc_host/mmc1[/COLOR] auto auto defaults voldmanaged=sdcard1:auto
    To identify your MTK voldmanaged path for sdcard -> adb shell find /sys -name mmc0. You don't need to include the first path /sys so it should start with /devices

    To identify your internal sdcard partition no. -> adb shell cat /proc/dumchar_info & look at fat partition block /dev/block/mmcblk0p6 & update it accordingly . . .

    Update it to fstab.${ro.hardware} too.

    The correct way to check ${ro.hardware} -> adb shell getprop ro.hardware -> mt6577 then it should be rename to fstab.mt6577
    ------------------------------------------------
    Updates - Built-in to porting tool
    Some MTK don't use fat mount points for Internal sdcard then this tool will fail to identify it & ported PhilZ Touch will not boot/ bootloop . . . :cowboy:

    Code:
    /devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:    [COLOR="Red"]<- Empty[/COLOR]
    /devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto

    Solution - Put a # at the beginning of that line or just delete it & it'll boot . . .

    Code:
    [B][SIZE="3"][COLOR="Blue"]#[/COLOR][/SIZE][/B]/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:    [COLOR="Red"]<- Empty[/COLOR]
    /devices/platform/mtk-msdc.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
    ------------------------------------------------

    To identify USB voldmanaged mount points for Internal SD -> adb shell su -c "ls -R" > c:\users\YOUR USER NAME\desktop\usb.txt

    Look for anything usb in it & try it at the fstab.${ro.hardware} & also update it to recovery.fstab too. Both must be identical or it will not work.

    An example below, confirmed by shoxxy that can be view at PhilZ Touch -> Install Zip but doesn't mount it at mount USB storage.

    Code:
    /devices/platform/mt_usb/usb1 auto auto defaults voldmanaged=usbdisk:auto

    Also look for various example here on voldmanaged for USB storage & hopefully someone will get it working one day.

    if yours is a /data/media device then it would not work . . .

    Refer to here credits to RD chrmhoffmann
    As mentioned many times, i don't own all MTK devices out there so some features might not work. To fix it & to learn more about modding recovery refer to my Master Shifu thread here & here . . . :good:

    When everything fails then try your hands on building one yourself with the optional build flags here for your MTK . . . :cool:
    16
    MT6572 7MB Recovery MOD!

    MediaTek MT6572 7MB Recovery MOD!

    Hello Guys...Does it say recovery image is bigger than the partition Size No Worries...(Other than MT6572 Users Refer to Previous Posts by @yuweng)

    Lets Get Started...

    There is a very Simple Trick to use this MOD....Most MTK Devices comes with 4.5MB Boot Partition
    (Decompile and Recompile your Boot IMG to Get the Perfect Size of your Recovery)
    Soo What we are going to do is, The Boot partition is of 6MB we will reduce it to 5MB...and then increase Recovery Partition from 6MB to 7MB
    -:Things Needed :-
    MT6572 Scatter File
    Notepad ++
    A Noob Brain!​

    -:INSTRUCTIONS :-

    #1.Open your Scatter File with Notepad ++ for editing...


    #2. Locate Recovery and Boot partition Info!


    attachment.php


    (Underlined RED are the Things we have to Deal With!)


    #3 Change :-

    BootIMG Partitons
    Partition Size from 0x600000 > 0x500000
    Recovery Partitions
    Partition Size from 0x600000 > 0x700000
    Linear Start Address
    Now Subtract 0x100000 from the linear Start Address ex.- 0x2980000 - 0x100000 = 0x2880000


    #4 That's It Now save the Scatter File and Flash the ROM with the New Scatter!




    VOILA!!! 7MB Recovery Partiton:cool:

    Thanks to @yuweng for the Support :highfive:

    PRESS THANKS GUYS THAT WILL HELP...I DON'T HAVE ANY IDEA HOW! :D