Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[DEVDB][TWRP][PhilZ Touch][CWM] XZDualRecovery 2.8.1-RELEASE

OP [NUT]

View First Unread
Announcement from [NUT]: UNANNOUNCED BETA'S ON THE DOWNLOAD SITE CAN LEAD TO UNEXPECTED BEHAVIOR, PLEASE BE CAREFUL!!
3rd May 2013, 02:26 AM   |  #1  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
-=[XZDualRecovery]=-
PhilZ Touch 6.59.0 & CWM 6.0.5.0 & TWRP 2.8.4.0
*** For Locked and Unlocked BOOTLOADERS! ***

I proudly present you the first and only DUAL RECOVERY for locked boot loaders on our lovely Xperia phones!

If you have an unlocked bootloader and chose to keep the STOCK Sony kernel, you can also use this MOD.

Currently supported XPERIA models:
These are also links to the device specific Q&A threads.
Xperia Z: SO-02E, C6602, C6603, C6606, C6616
Xperia ZL: C6502, C6503, C6506
Xperia Tablet Z: SO-03E, SGP311, SGP312, SGP321, SGP351
Xperia Z Ultra: C6802, C6806, C6833, C6843
Xperia Z1: C6902, C6903, C6906, C6943, C6916
Xperia Z1 Compact: D5502, D5503, D5506
Xperia Z2: D6502, D6503, D6506, D6543, D6563
Xperia Tablet Z2: SGP511, SGP512, SGP521, SGP551, SGP561
Xperia ZR: C5602, C5603, C5606
Xperia T, TX, TL and V: LT30p, LT29, LT30at, LT25i
Xperia S: LT26i
Xperia SP: C5302, C5303
Xperia T2 Ultra: D5303, D5322
Xperia Z3: D6603, D6633, D6643, D6653, D6616
Xperia Z3 Compact: D5803, D5833
Xperia Tablet Z3 Compact: SGP621, SGP641, SGP651

I will be adding more and more devices to the list in the near future, keep your eyes on this thread for them to be released
I will also start a Q&A thread for each of the models officially supported, once released from the experimental stage.

RomAur users read this post first before flashing XZDualRecovery!

UNANNOUNCED BETA'S ON THE DOWNLOAD SITE CAN LEAD TO UNEXPECTED BEHAVIOR, PLEASE BE CAREFUL WITH THEM!

INSTALLER: How to install using the installer:
  1. Make sure you have USB debugging turned ON.
  2. download XZ/ZL/TabZ/Z1/ZU-lockeddualrecovery[VERSION]-BETA.installer.zip from http://nut.xperia-files.com
  3. Windows:
    1. unpack at C: or somewhere you will remember!
    2. navigate to the resulting directory and look for install.bat, double click it to run;
  4. Linux:
    1. unpack in your home folder with 'unzip XZ/ZL/TabZ/Z1/ZU-lockeddualrecovery[VERSION]-BETA.installer.zip'
    2. navigate to the resulting directory and 'chmod +x install.sh', then execute it, follow instructions.
  5. Your phone WILL reboot when installation has completed and it will go into the default recovery for the first boot.
  6. Reboot to system from recovery to allow the installer to clean up after installation (it is safe to skip this step).
  7. Enjoy DUAL RECOVERY!


How to install or update using a previously installed (XZDualRecovery) recovery:
Create a backup of /system/bin/chargemon and keep it somewhere safe, then just flash XZ/ZL/TabZ/Z1/ZU-lockeddualrecovery[VERSION]-BETA.flashable.zip from http://nut.xperia-files.com using CWM or TWRP.

How to remove:

Delete the following files:
/system/bin/recovery.twrp.cpio.lzma (or .tar)
/system/bin/recovery.cwm.cpio.lzma (or .tar)
/system/bin/recovery.philz.cpio.lzma
/system/bin/charger
/system/bin/ric
/system/bin/chargemon
/system/bin/dualrecovery.sh

Then inside */system/bin/ rename chargemon.stock to chargemon check its permissions (should be 755 or otherwise visible as -rwxr-x-r-x). Done!


How to revert back to original single recovery:

This recovery MOD leaves your original recovery.tar in place.
You can overwrite the chargemon executable in /system/bin/ from this MOD with your backup made earlier and change its permissions to 755 (-rwxr-x-r-x).
You can then remove /system/bin/dualrecovery.sh (if it is there), /system/bin/recovery.twrp.cpio.lzma (or .tar), /system/bin/recovery.philz.cpio.lzma and /system/bin/recovery.cwm.cpio.lzma (or .tar) and reboot.


When installing custom ROMs:
Be sure to flash XZ/ZL/TabZ/Z1/ZU-lockeddualrecovery[VERSION]-BETA.flashable.zip from http://nut.xperia-files.com after installing the ROM and before you reboot, this way you will not lose recovery!

How to use:
At boot, once you feel the phone vibrate and while you see the green led burn:
- press VOL-UP for PhilZ Touch;
- press VOL-DOWN for TWRP.

To enter Vanilla CWM, you will need to use the (free) NDRUtils app from the Play store

2.x Features:
  • When you have a SDCard1 and the XZDualRecovery is able to use it, you can put a file called 'donotrun' inside the XZDualRecovery log folder to make XZDualRecovery escape following boot attempts.
    If you find yourself in a bootloop situation, take out your SDCard1 and put that file in the directory if it exists using a PC. Reboot your phone with Power+Vol-UP and you will be able to boot your phone as if there was no recovery there!
  • XZDualRecovery will signal the escape or any reason why it would not be able to continue normal operation with a 2 second burn of your LED in the color RED. A reason would be a broken /cache and no SDCard1 or a busybox in /system/xbin which does not support the lzcat command. If you see that, check /tmp/XZDualRecovery for a logfile there, it will tell you why.
  • XZDualRecovery will try to use your SDCard1 for logging and functionality, if it has been formatted with ext2/4, FAT16/32 or exFAT. NTFS is currently unsupported.
  • XZDualRecovery now prevents the RIC service from starting up, this means when running XZDualRecovery the Remount-Reboot fix is no longer needed.


Defaults:
  • The default on first boot with the boot-to-recovery flag set by any recovery is TWRP.
  • In your XZDualRecovery folder in either /cache or /storage/sdcard1 you will find a file called XZDR.prop. Set dr.default.recovery=cwm to dr.default.recovery=philz to change the default recovery to TWRP. The button choice however takes precedence, so you can always overrule the default!
  • You can also change back to 'Vanilla CWM' if you wish by changing dr.vanilla.cwm=false to dr.vanilla.cwm=true in the XZDR.prop file.
  • Init.d support is disabled by default, set dr.enable.initd to true to enable it.
  • Insecure ramdisk support is disabled by default, set dr.insecure.ramdisk to true to enable it, set to 'power' to boot it by pressing the power button at boot.


Error reporting:
Please, when reporting errors or problems:
  • Put up a notice in this thread providing the package name you used to install or update;
  • Include ROM name and/or FW version numbers;
  • Include what SU apk you are using (SuperUser or SuperSU)
  • Send me the contents of all the log files from right after a failed boot attempt or a link to an archive containing these logs by PM (that's including the .old rotation logs!). If you have no website or online location to store the logs, PM me for an email address to send them to.
  • Logs can be found inside:
    • /cache/recovery
    • /tmp/XZDualRecovery
    • /storage/sdcard1/XZDualRecovery
    • /cache/XZDualRecovery (if the previous exists, this one will not!)
    NOTE: I need them ALL!
I really need them to troubleshoot what failed and what worked OK. Thank you!

Future plans:
  • Creating a self-contained installer for Linux and making that work on Apple MacOS X

Suggestions?
Please do post, I've got loads of ideas myself but you might have the best one yourself!

Special Thanks:
  • DooMLoRD for all his excellent work on our much loved Sony phones!
  • The Team Win developers for TWRP
  • The ClockWorkMod developers for CWM
  • @alexocean for his awesome job testing almost all FW releases and the discovery of SuperSU causing problems for the installation of this recovery!
  • @RoberM for testing
  • @surdu_petru for testing and handy pointers
  • @Androxyde for allowing to use his linux and mac adb binaries.
  • @lancebukkake for finding the TWRP 'fix' to use exFAT formatted sdcards!
  • @delewer for the final fix for TWRP and its use of exFAT formatted sdcards
  • @DevShaft for some code help on the windows installer (the menu!)
  • @Androxyde again, but now for his bash code/script suggestions... oh boy this guy is a genius!
  • @Tamirwig and @shoey63 for their excellent job at testing early BETA's (Xperia Z)
  • @gregbradley for his extensive testing on the Xperia Z1

GitHub Repository:
https://github.com/xNUTx/XZDualRecovery

Downloads:
All past, current and future releases will appear on http://nut.xperia-files.com/ for download, also providing a QR code for easy downloading on your mobile The flashable file will bring any previous version to the latest release.

Well, enjoy!

The origins of this XZDualRecovery package are in the packages done by:
Krabappel2548, Cpasjuste and DooMLoRD
Thank you for your excellent work guys!

Your thanks (and donations) should (also) go out to them, they deserve it!

XDA:DevDB Information
XZDualRecovery, Tool/Utility for the Sony Xperia Z

Contributors
[NUT], AngelBob , shoey63 , Olivier, Krabappel2548, DooMLoRD, Cpasjuste, Tungstwenty, sijav
Source Code: https://github.com/xNUTx/XZDualRecovery


Version Information
Status: Stable
Current Stable Version: 2.8.1
Stable Release Date: 2015-01-27
Current Beta Version: 2.9.0
Beta Release Date: 2015-02-01

Created 2013-07-18
Last Updated 2015-01-27
Attached Thumbnails
Click image for larger version

Name:	image1resize.jpg
Views:	52005
Size:	37.7 KB
ID:	2315159   Click image for larger version

Name:	image2resize.jpg
Views:	46576
Size:	35.8 KB
ID:	2315160   Click image for larger version

Name:	image3resize.jpg
Views:	27362
Size:	34.7 KB
ID:	2315161   Click image for larger version

Name:	image4vlv.jpg
Views:	25647
Size:	30.6 KB
ID:	2315162   Click image for larger version

Name:	image5resize.jpg
Views:	23987
Size:	40.7 KB
ID:	2315163   Click image for larger version

Name:	image6resize.jpg
Views:	19149
Size:	29.3 KB
ID:	2315164   Click image for larger version

Name:	image7resize.jpg
Views:	22354
Size:	28.3 KB
ID:	2315165   Click image for larger version

Name:	sigpic4666971_18.gif.png
Views:	17435
Size:	44.7 KB
ID:	2315166   Click image for larger version

Name:	eIDZ.png
Views:	21922
Size:	17.4 KB
ID:	2315168   Click image for larger version

Name:	fYob.png
Views:	21158
Size:	33.8 KB
ID:	2315170   Click image for larger version

Name:	WujW.png
Views:	16429
Size:	26.5 KB
ID:	2315171   Click image for larger version

Name:	AgsV.png
Views:	33495
Size:	16.9 KB
ID:	2315173  
Last edited by [NUT]; 18th July 2013 at 02:03 AM.
The Following 430 Users Say Thank You to [NUT] For This Useful Post: [ View ]
3rd May 2013, 02:26 AM   |  #2  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Known Issues and Frequently Asked Questions
Known Issues:
All known issues in PhilZ, TWRP and CWM on locked boot loaders apply, see their respective threads for more information.

Busybox Updater/Installer: If you have XZDualRecovery installed, un-install any Busybox updating app/tool as most if not all of them will install a version of busybox which does not support the lzma compression applets XZDualRecovery depends on. The version installed together with XZDualRecovery is very stable and I have yet to hear anyone complain about it's stability.

Be especially careful with the cache partition when using CWM. Hopefully version 2.0 solved the cache issues but in case of problems with /cache use the FTF in my files to restore the cache partition if yours ever stops mounting due to the CWM issues, read this and this for more info on that.

exFAT Warning: If you are using an exFAT formatted sdcard there are 2 things to take in to account: CWM currently does not know how to handle them at all. In TWRP it could be that it can't mount it, though it can use it: you need to eject the card and reinsert it, you will be able to mount and use it afterwards.

device configuration: both recoveries think they are running on an Xperia Z ("yuga"), so users of a ZL or Tablet Z might run in to a ROM or MOD which checks the device ID and will claim it's not an "odin" (ZL) or "pollux_windy" (TabZ)... this is something I will fix in some future release.


Frequently Asked Questions:

How to set the correct time & date in PhilZ 6.59.0
  • Boot to PhilZ Touch;
  • Tap 'Recovery Settings';
  • Tap 'Gui Preferences';
  • Tap 'Time Settings';
  • Tap 'Change date and time';
  • Tic one of the last 3 options in this menu to try it;
  • Reboot to PhilZ Touch to see if it sticks, if not, try another and reboot to see if it helped, do this for all options to try them;
  • If one of them does help but does not stick at reboot, tic 'Try Force Persist on Reboot' once (it will un-tic itself after a reboot).
  • Done!

NOTE: if it's close to being correct (max 15h difference before or after your time) you need to correct the timezone.


About TWRP 2.6 and the use of INTERNAL STORAGE
Quote:
Originally Posted by jdjta

[snip]...but permissions are set like: Srw-Srw-r (644) (It seems like the 'S' is the problem, I'm sure GID and UID are ticked)...[snip]

A workaround for this issue is to use TWRP's advanced options, after creating a backup you wish to move to the PC:
  1. go back to the main menu
  2. go to advanced
  3. go to filemanager
  4. navigate to /data/media/0/TWRP/BACKUPS/*SERIAL*/*BACKUPNAME*
  5. select one of the backup files
  6. press chmod button (the one without 755)
  7. type 0664 and press go
  8. repeat 5->7 for each of the files in the backup, you can skip boot and the md5 files.
  9. reboot to system and you should be able to copy the files without problems.

Alternatively you can install adbd Insecure by @Chainfire (non-free app from Play, or for free from it's XDA thread) and run ADBd itself as root, which elevates the rights and omits the issue all together.

I think it's a feature and not a bug (as it secures your backups), but I'll try to convince Team Win to make the setuid/setguid a choice rather then a default.


Installation of XZDualRecovery on UNROOTED devices
The installer package uses Easy Root Tool for various Xperia phones, it is able to gain root on all of the currently supported devices, allowing to install XZDR.

Confirmed working:
  • Z - C6603
  • Z1 Compact - D5503 (doesn't seem to work on JellyBean), SO-01F (docomo)
  • Z1 - C6903,
  • Z Ultra - C6802, C6833
  • ZR, C5502
  • Z2 - D6503
  • Z2 Tablet - SGP511, SGP512
  • ZL2 - SOL25

If you want to help me perfect this list, use the tool done by @zxz0O0 in his topic and try to root your device. When testing also try older ROM versions, the latest FW versions may have been patched.

Thanks @zxz0O0 for the initial list.

The rootless installation has been made possible by:
  • @geohot: Root exploit
  • @MohammadAG: Disable RIC kernel module (Link)
  • @cubeundcube: Disable RIC on Z2 phone (findricaddr/writekmem)
  • @zxz0O0: for creating the initial tool where I have based this unrooted install option on.

Thanks for your hard work guys!
Last edited by [NUT]; 27th January 2015 at 12:11 PM.
The Following 82 Users Say Thank You to [NUT] For This Useful Post: [ View ]
3rd May 2013, 02:26 AM   |  #3  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Change log
RELEASE Change log:
Version 2.8.1:
  • Added missing Z3/Z3C ROM versions to the disable ric install script
  • Hopefully fixed TWRP touch operation on the T2 Ultra
  • Updated TWRP to 2.8.4.0. TWRP Changelog:

    What's new in 2.8.4.0:
    • Add flashing of boot and recovery images via the TWRP GUI (Find the Images button on the Install page)
    • Fix some MTP related crashes and bugs
    • Eliminate TWRP toggling USB IDs during boot if MTP is enabled
    • Fix various adb sideload issues
    • Improve threading of actions
    • Eliminate separate thread for screen timeout
    • Update libblkid to 2.25.0
    • Use power button as back button on watch themes for easier navigation
    • Add mutex locking to data manager
    • Improve custom theme handling on encrypted devices
    • Allow the stock theme to be offset by build flags so we can center a lower res theme on a higher res screen especially for watches with round screens
Version 2.8.0:
  • 2.7.160 BETA moved in to 2.8 tree with only one change:
  • Updated the Linux/MacOS installer to fix a bug in the usage of 'tr' which is used to analyze the output of the adb'ed installation script.

BETA Change log:
2.7 BETA packages are no longer available on the downloads page.

Version 2.7.154 -> 2.7.160:
  • Fixed TWRP font/theme on the Xperia SP and then for the T2 Ultra
  • XZDR Kernel update for the Z1 and Z3 Compact, FW updates required a new kernel version.
  • Updated TWRP on all devices to 2.8.2.0 and then to 2.8.3.0.
  • Updated PhilZ to 6.59.0, thanks to @shoey63
Last edited by [NUT]; 26th January 2015 at 11:47 AM.
The Following 72 Users Say Thank You to [NUT] For This Useful Post: [ View ]
3rd May 2013, 07:16 AM   |  #4  
krabappel2548's Avatar
Recognized Contributor / Recognized Developer
Flag Zichem
Thanks Meter: 15,817
 
6,376 posts
Join Date:Joined: Nov 2011
Donate to Me
More
I'll give you twrp 2.5.0.0

Sent from my C6603 using xda app-developers app
The Following 21 Users Say Thank You to krabappel2548 For This Useful Post: [ View ]
3rd May 2013, 07:33 AM   |  #5  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by krabappel2548

I'll give you twrp 2.5.0.0

Sent from my C6603 using xda app-developers app

Thanks, that would be great

Sent from my C6603 using xda app-developers app
The Following 9 Users Say Thank You to [NUT] For This Useful Post: [ View ]
3rd May 2013, 09:20 AM   |  #6  
Michealtbh's Avatar
Senior Member
Flag Belfast
Thanks Meter: 844
 
2,723 posts
Join Date:Joined: Nov 2010
More
Will this also work with unlocked bootloaders, or is there anything similar for unlocked bootloaders?

Apologies if this is a silly question but I'm new to XZ and I'm still trying to get my head around the weird recovery situation
3rd May 2013, 09:25 AM   |  #7  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by Michealtbh

Will this also work with unlocked bootloaders, or is there anything similar for unlocked bootloaders?

Apologies if this is a silly question but I'm new to XZ and I'm still trying to get my head around the weird recovery situation

Yes, it should work with unlocked bootloaders when you are still clinging on to the stock kernel. DooMLoRD's DooMKernel v6 has the same functionality built in, so when using his kernel this package will not be needed.
The Following 3 Users Say Thank You to [NUT] For This Useful Post: [ View ]
3rd May 2013, 10:54 AM   |  #8  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Installer released!
The Following 2 Users Say Thank You to [NUT] For This Useful Post: [ View ]
3rd May 2013, 04:49 PM   |  #9  
venky716's Avatar
Senior Member
Flag Mumbai
Thanks Meter: 320
 
663 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by [NUT]

Installer released!

Man u r fast !!
3rd May 2013, 05:46 PM   |  #10  
[NUT]'s Avatar
OP Recognized Contributor
Flag Cyberspace and the Universe
Thanks Meter: 6,577
 
4,274 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by venky716

Man u r fast !!

Having a good and clean base by Krabappel2548 helps to get started, it's basically his installer package modified to support this dual recovery.

Sent from my C6603 using xda app-developers app

The Following 3 Users Say Thank You to [NUT] For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
cwm, doomkernel, locked bootloader, recovery, twrp
Previous Thread Next Thread