Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,452 Members 42,435 Now Online
XDA Developers Android and Mobile Development Forum
Announcement from yuweng: Easy Magic PhilZ Touch Installer for MediaTek Devices ONLY

Easy Magic PhilZ Touch Installer for MediaTek Devices ONLY

Tip us?
 
yuweng
Old
(Last edited by yuweng; 20th May 2014 at 07:33 AM.) Reason: Update info . . .
#1  
yuweng's Avatar
Senior Member - OP
Thanks Meter 2221
Posts: 719
Join Date: Feb 2012
Default Easy Magic PhilZ Touch Installer for MediaTek Devices ONLY


* * * * * * * * * * * * * * * * * * * * * * * * *
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 . . .

Supported MediaTek devices - 3 generation of MTK SoC - Arm11, Cortex-A9, Cortex-A7

Screenshot
 
Video Preview
For full features & functions, refer to Main Thread here . . .

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 . . . . . .

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

Contributors
yuweng

Version Information
Status: Stable
Current Stable Version: 6.50.6
Stable Release Date: 2014-07-24

Created 2014-05-11
Last Updated 2014-07-23
The Following 27 Users Say Thank You to yuweng For This Useful Post: [ Click to Expand ]
 
yuweng
Old
(Last edited by yuweng; 23rd July 2014 at 06:50 PM.) Reason: Update info . . .
#2  
yuweng's Avatar
Senior Member - OP
Thanks Meter 2221
Posts: 719
Join Date: Feb 2012
Default Installation

Installation How-to
 

Where is the Downloads . . .
 


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 downloaded files to your Desktop, disable UAC & restart PC, double-click PhilZ.exe & follow the on-screen for instructions.
 
If you still can't get it to work then refer to here . . .
The Following 14 Users Say Thank You to yuweng For This Useful Post: [ Click to Expand ]
 
yuweng
Old
(Last edited by yuweng; 27th July 2014 at 09:38 AM.) Reason: Update info . . .
#3  
yuweng's Avatar
Senior Member - OP
Thanks Meter 2221
Posts: 719
Join Date: Feb 2012
Default Known problems on MTK devices

Known problems on MTK devices
 
  • 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 currently does not support ubifs
  • PhilZ Touch currently does not support MTK Alcatel devices with /custpack partition.
  • 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.
  • 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
  • # 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:
    Select Code
        mkdir /emmc
        mkdir /system
        mkdir /data
        mkdir /cache
        mkdir /tmp  <- add this line to init.rc
        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
  1. At Windows Explorer -> Show Hidden Files & Folders -> MTK_PhilZ -> bin -> extract out 240x320_bg.png from res.7z, rename it to stitch.png
  2. Plug-in the USB cable & use the manual mode, select your device res & it will ask whether you have flipped screen.
  3. Copy & paste extracted 240x320 stitch.png to Stock/recovery/rmdisk/res/images folder to replace it & answer the flipped screen question
  4. At PhilZ Settings -> GUI Preferences -> Change Background -> Reset Koush Background



The Following 10 Users Say Thank You to yuweng For This Useful Post: [ Click to Expand ]
 
yuweng
Old
(Last edited by yuweng; 23rd July 2014 at 07:07 PM.) Reason: Update info . . .
#4  
yuweng's Avatar
Senior Member - OP
Thanks Meter 2221
Posts: 719
Join Date: Feb 2012
Default 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. . .
 
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:
Select 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:
Select 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 . . .

recovery.fstab for MT65xx
Code:
Select 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:6 
/devices/platform/mtk-sd.1/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto
Code:
Select Code
# For MT65xx
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:6 
/devices/platform/mtk-msdc.1/mmc_host/mmc1 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 . . .

Code:
Select Code
/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:    <- Empty
/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:
Select Code
#/devices/platform/mtk-msdc.0/mmc_host/mmc0 auto auto defaults voldmanaged=sdcard0:    <- Empty
/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:
Select 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 . . .
The Following 12 Users Say Thank You to yuweng For This Useful Post: [ Click to Expand ]
 
Gauraav
Old
#5  
Senior Member
Thanks Meter 30
Posts: 128
Join Date: Jul 2013
Location: New Delhi
This is awesome man....
Hits Thanks If I helped U...
The Following User Says Thank You to Gauraav For This Useful Post: [ Click to Expand ]
 
suhas.holla
Old
#6  
suhas.holla's Avatar
Recognized Contributor
Thanks Meter 884
Posts: 627
Join Date: Mar 2011
Location: Bangalore

 
DONATE TO ME
Yeah...Finally a support thread of philz touch for mediatek devices ...Great initiative by master @yuweng for bringing simple tool to install philz touch on many mediatek devices

Sent from my A250 using Tapatalk
My works:

Worked On:
Micromax A60 || Samsung Galaxy Ace || Spice Stellar Mi-425 || Micromax A110 || Micromax A116 Canvas HD || Canvas Turbo
Currently Working On:
Moto G

DONT FORGET TO HIT THANKS IF U THINK I HELPED U
The Following 3 Users Say Thank You to suhas.holla For This Useful Post: [ Click to Expand ]
 
Popey900
Old
#7  
Popey900's Avatar
Member
Thanks Meter 2
Posts: 53
Join Date: Jun 2011
Hi there. Does it work with the Jiayu G5S ?

Is there a simple guide?


Gesendet von meinem JY-G5S mit Tapatalk
Galaxy S3 (i9300)-->CM11 Temasek (Boeflla Kernel Omni)
Jiayu G5S --> YouTube Video <-- The best 4,5" Smartphone for 230 ???
 
yuweng
Old
#8  
yuweng's Avatar
Senior Member - OP
Thanks Meter 2221
Posts: 719
Join Date: Feb 2012
Bro, everything is already stated clearly at post #1 to 4, make backup x3, double-click PhilZ.exe & follow on-screen instructions, that's the guide . . .
The Following 5 Users Say Thank You to yuweng For This Useful Post: [ Click to Expand ]
 
pavan kr
Old
#9  
Member
Thanks Meter 23
Posts: 56
Join Date: Aug 2013
Location: Banglore
Default manual porting ?

SIR Thanks a lot for creating the tool

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
Attached Thumbnails
Click image for larger version

Name:	err.png
Views:	385
Size:	15.3 KB
ID:	2740844  
The Following 2 Users Say Thank You to pavan kr For This Useful Post: [ Click to Expand ]
 
yuweng
Old
(Last edited by yuweng; 23rd July 2014 at 07:04 PM.) Reason: Update info . . .
#10  
yuweng's Avatar
Senior Member - OP
Thanks Meter 2221
Posts: 719
Join Date: Feb 2012
Updates - Built-in to porting tool
 

Temporary work around is to use the same technique at post #3 most bottom . . . 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 . . .
  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 . . .
--------------------------------
Refer to updates of the updates here . . .

The Following 8 Users Say Thank You to yuweng For This Useful Post: [ Click to Expand ]
Tags
mediatek, mtk, philz touch, porting tool, recovery
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes