yashsingh1/xdaforums huggingface dataset:
[Xperia Z3 Android Development] JuanMnz93:
Is there a way of installing this recovery through Terminal emulator? I have only root because PCs recognize my z3 as "Unknown Device (Device Descriptor Request Failed" and I don't have recovery after installing andropluskernel
[Xperia Z3 Android Development] nailyk:
flash recovery on running system

Hi,

Sure, you can use the 'dd' method. But double check your command line as a typo can be a disaster.

First you need to check your 'recovery' partition name. It should be 'FOTAKernel':

ll /dev/block/platform/msm_sdcc.1/by-name/FOTAKernel

If it is ok you can flash it by entering:

su
dd if=/storage/sdcard0/download/recovery.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel

(change path according to your needs. Also this flashing procedure will work for every recovery you can found as binary image)

if you put the recovery under /storage/sdcard1/recovery.img and your partition name is FOTAKernel you can use this script

Hope this can help you.

P.S.: you can reflash kernel this way too:

dd if=/storage/sdcard0/download/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot

but if have no kernel and no recovery you wont be able to boot your phone anymore ;)
[Xperia Z3 Android Development] visnescire:
Hi nailyk,

Is there any chance you would be willing to run a build for amami/z1c? I'd love to get encryption support back, for much the same reason that you listed.
[Xperia Z3 Android Development] nailyk:
Hi visnescire,

I'm working on it but for somes reasons I need to switch back on a cyanogenmod tree (can't build for multiples phones with the same omnirom tree and my homeserver's disks are full).

As temporary workaround you can try this recoveries. I think twrp was recompiled by [MENTION=5075064]optimumpro[/MENTION] on his z1 rom (but can't remember the name of this rom).

Also I don't own z1 or z1c so I need testers :D

I will keep you informed when a test build is done.
[Xperia Z3 Android Development] nailyk:
twrp test 3.0.0-1 amami

Here it is! (md5: 3ea0894ecd969a9dea845524ab8bc4ef )

This is a experimental build. I test it on my z3 and, obviously, some things doesn't work =) (display)

But pass-phrase seems to be ask as I can type on a keyboard (the phone was vibrating), brightness sensors seems also to be working.

I cannot test further as I cannot decrypt.

Be prepared as it won't work at all but give me your feedback please :)

Thanks in advance.

P.S.: I tune a lot the cpu governor so can you keep an eye on the temperature of your device?

Edit:

[MENTION=4763242]Micha_Btz[/MENTION] maybe you can be interested.
[Xperia Z3 Android Development] TomChiverton:
"it is only for z3 and unlocked bootloaders. "

I didn't want to unlock my bootloader. I already have (via XZDuelRecovery) TWRP 2.8.7 recovery installed (and root in Android 5.1 stock O/S). Do I really need the unlocked bootloader and updated bootloader from Sony ?
[Xperia Z3 Android Development] nailyk:
Thank for the interest your port to my build.

This build is based on a cyanogenmod kernel so it is really risky with a unlocked bootloader.

With the old version of the bootloader it should work but some person report bootloop when trying to enter recovery.

As my bootloader is upgraded I can't test anymore. So if your are not really comfortable with bootloop, reflashing all the phone, etc... I think you shouldn't use this build, sorry.
[Xperia Z3 Android Development] TomChiverton:
If I understand right, upgrading to the new Sony bootloader shouldn't change anything - I can still boot my existing recovery and OS ? If so, that seems safe to try ; I can always reflash the existing recovery via adb right ? Same goes for if there's a bootloop with the recovery - I can still get into the main OS or reflash a newer recovery if you need to try something ?
[Xperia Z3 Android Development] shoey63:
No you don't have to unlock the bootloader.

Rename the attached file to recovery.twrp.cpio.lzma and use a root enabled file explorer to replace the one in /system/.XZDualRecovery/xbin

That should do the trick.View attachment 3702773

Edit: it's [MENTION=6979267]nailyk[/MENTION]'s twrp ramdisk
[Xperia Z3 Android Development] visnescire:
Hi, sorry for the delay. Many thanks for your time & efforts.

I can't currently get it to work, but I'm unsure whether that's a product of my incompetence or something with your build.

I've tried flashing your image to both boot and FOTAKernel partitions, both of which results in a bootloop (LED: purple, yellow, reboot), even if I poweroff and powerup with volume-down. I've also made sure my boot partition contains a recent CM-12.1 boot.img.

Is there anything I should be doing? I'd gladly provide with any logging if possible, but I'm afraid I'll be needing some references to the sort of information you would require and the method of obtaining it.
[Xperia Z3 Android Development] nailyk:
Sorry, I was not really clear.

To get the new bootloader you need an unlocked one.

For me it is really important to get the new bootloader:

- with the old one, the boot process pass only by the boot partition (in normal or recovery mode). So if your kernel is broken you won't be able to enter recovery anymore. But that is not the point.

You should be right. If your kernel support the 'extract_elf_ramdisk'/recovery in the FOTAKernel partition, you could use this one. But as my phone is unlocked, I never test.

[MENTION=4675598]shoey63[/MENTION]'s solution is interesting and I can't wait to know how it happened :D
[Xperia Z3 Android Development] nailyk:
It is all right.

Sorry it doesn't work for you.

You are right, it is build for the FOTAKernel partition.

In theory it should work with the cyanogenmod kernel. I double check the kernel cmdline but forget to change the led color.

I hope your phone is now starting fine. Can you give me the result of (as root):

cat /proc/cmdline

Warning, it show your serial number and imei. I'm only interested in the part with the s1 bootloader information (ex: oemandroidboot.s1boot=1286-7314_S1_Boot_MSM8974AC_L13.0_L_37).

Just to be sure: is your bootloader unlocked? (as you have a cyanogenmod installed it should be ;) )

I'm busy this week but I will make another build for you asap.
[Xperia Z3 Android Development] visnescire:
Err, of course I meant to say recovery and FOTAKernel partitions.

oemandroidboot.s1boot=1270-3115_S1_Boot_MSM8974_Rhine1.2_LA1.04_19

Yes, it is.

Awesome. I have all the time in the world; will watch this thread for updates.
[Xperia Z3 Android Development] TomChiverton:
Great, thanks
[Xperia Z3 Android Development] Micha_Btz:
[MENTION=6979267]nailyk[/MENTION]

i will test it today/tomorrow. thanks
[Xperia Z3 Android Development] benzo:
I'm on MM beta, TWRP 2.8.7, Locked Bootloader, can i use this method to update the recovery?

Thanks
[Xperia Z3 Android Development] shoey63:
Not working yet on mm-beta for LB. Still trying to sort out some bugzz
[Xperia Z3 Android Development] benzo:
Ok I need to wait to use the recovery with encrypted partition. Thank you
[Xperia Z3 Android Development] lostdream:
So now its work with locked bootloader? What about if i use this to mm or lp? Fast response plz. Thank you
[Xperia Z3 Android Development] nailyk:
What is not working with locked bootloader? Do you have some informations? Maybe I can adjust some compilation parameters.

Also I can provide the recovery-ramdisk generated by the compilation.

Otherwise, as I build on a CM13 tree, all the 'old-init-process' (/init.sh, /boot.txt) is removed. I am working on it to restore compatibility with old bootloader. Maybe that-is it?

Did you try with the 2.8.7 version? It was build on a CM12.1 tree which include this boot process.

Thank all for your help!
[Xperia Z3 Android Development] shoey63:
It bootloops on the "keep system read only?" screen. I build from omni sources, but as you use cm like NUT does, I will see if your twrp ramdisk is more compatible.

Edit: Twrp 3.0.2.0 is up on omnirom github btw;)
[Xperia Z3 Android Development] nailyk:
Interresting. Is the twrp screen leaving and going back or the phone reboot?

If it is the twrp screen I can build a ramdisk with adb enabled. On this way it is possible to get the logs.

Sure but encryption was broken on 3.0.1. :(
[Xperia Z3 Android Development] nailyk:
After a bit of work I maybe know why:

All my 3.0.x-1 versions of twrp are based on a 3.10 kernel. In my case (upgraded unlocked bootloader), it doesn't matters my rom and my recovery had different kernel version.

Just now I try to start the recovery, pushing volume-rocker, with the cm-12.1 3.4 kernel and it bootloop. I flash my 3.10 kernel on the boot partition, press the volume rocker and be able to enter recovery. Also the restart recovery work. Obviously the cyanogenmod was not working anymore.

I will check if a can build both version: 3.10 based kernel and 3.4 based kernel.

What do you think about?
[Xperia Z3 Android Development] nailyk:
I deal with a lot of compilation problem and it is almost done. I'm stuck at the dtb.img creation problem.

My 3.4 kernel (https://github.com/CyanogenMod/android_kernel_sony_msm8974/tree/cm-13.0) wont generate the needed folder:

${KERNEL_OBJ}/obj/KERNEL_OBJ/arch/arm/boot/dts

Building DTBs
DTC arch/arm/boot/msm8974pro-ac-shinano_leo.dtb
[...]
Target DT image: /home/nailyk/cyanogen/13.0/out/target/product/z3/dt.img
DTB combiner:
Input directory: '/home/nailyk/cyanogen/13.0/out/target/product/z3/obj/KERNEL_OBJ/arch/arm/boot/dts/'
Output file: '/home/nailyk/cyanogen/13.0/out/target/product/z3/dt.img'
Failed to open input directory '/home/nailyk/cyanogen/13.0/out/target/product/z3/obj/KERNEL_OBJ/arch/arm/boot/dts/'
=> Found -1 unique DTB(s)
[...]
nailyk@rimmon2 :) % ll obj/KERNEL_OBJ/arch/arm/boot ~/cyanogen/13.0/out/target/product/z3
total 19M
drwxrwxr-x 2 nailyk nailyk 4,0K avril 6 00:26 compressed
-rwxrwxr-x 1 nailyk nailyk 16M avril 6 00:26 Image
-rw-rw-r-- 1 nailyk nailyk 269K avril 6 00:26 msm8974pro-ac-shinano_leo.dtb
-rwxrwxr-x 1 nailyk nailyk 4,3M avril 6 00:26 zImage

I suppose it is a missing flag when switching kernel but can't figure which one :(

Did someone have an idea?

Otherwise the recovery-ramdisk.cpio is generated. Maybe you can do some tests with it? (md5 8679065f5f51ffe816f308ec5032a5df )
[Xperia Z3 Android Development] nailyk:
Yes, there is not yes official twrp port for z3.

As I know there is two cases:

- unlocked & upgraded bootloader,

- locked or not upgraded bootloader.

In case of unlocker & upgraded bootloader you can use the version you want because you will get a real recovery boot process (actually mine is made for this case)

In case of not upgraded bootloader the recovery is started by the rom kernel. Some provide a recovery, some provide a functionality which load the recovery from the FOTAKernel partition (extract_elf_ramdisk). In this case the both should be compatible (most should be)

I suppose an upgraded bootloader can't be re-locked but, imo, it is really important to upgrade bootloader and have the ability to boot something else that your kernel rom, even if the upgrade process is really heavy.

I hope my answer can help you.
[Xperia Z3 Android Development] shoey63:
Actually, it just occurred to me that kernel version is irrelevant. NUTs recovery only uses the twrp ramdisk, which runs on top of whatever the kernel is.

Anyway, tried your latest ramdisk and it wouldn't boot into recovery. Clearly it's something to do with a commit that has been intoduced some where since 2.8.7.0. It will take a lot of investigating to find the culprit :eek:
[Xperia Z3 Android Development] nailyk:
Thanks for this information on the kernel version. As I change my build tree from a CM12.1 to a CM13.0 I was supposing the libraries can be in different version, causing this problem.

I forget to mention but the ramdisk I post this night had ro.adbsecure=0 & ro.secure=0.

I try to compile a kernel with the same secure options for my cm12.1 and make some debugs to find out what is happening when my /init is loaded. (I do all the /sbin/init.sh process by hand and the crash append when launching the /init of my twrp ramdisk).
[Xperia Z3 Android Development] nailyk:
selinux?

I rerun the process with strace and seems this is a selinux conflict. My ramdisk try to mount "/sys/fs/selinux" which is already mounted and busy.

I don't know how to disable it (tried in the kernel, with ro.build.selinux=0) for debugging purpose but selinux is always present.

I'm looking for a way to change the mount point but I think it will be hard. What do you think about it?
[Xperia Z3 Android Development] h4waii:
Is there a thread for the z3c image? I'm looking to get data decryption working.
[Xperia Z3 Android Development] nailyk:
Not by me for now.

Actually I'm trying to restore compatibility with locked bootloaders / not upgraded bootloaders and [MENTION=4675598]shoey63[/MENTION] is helping me. Until is done we will see to build other twrp version with encryption support. (amami and honami are also planned). Also if someone help me to clean up my build tree I will try pushing to the official twrp gerrit and, maybe, get it supported on an official way :D
[Xperia Z3 Android Development] nailyk:
Sorry for late but it take me a looot of time to find what is happening.

Can you give a try with this ramdisk please?

Otherwise sorry all, as I work on this I totally forget to post the twrp3.0.2-1 version on the first post. I will make it asap (maybe with two version: one for new bl and another for old/locked one )
[Xperia Z3 Android Development] nailyk:
Any feedback?
[Xperia Z3 Android Development] shoey63:
Well, none from me, sorry. I've already switched back to concept rom lol. My hacks from NUT are working, but I agree, there must be a cleaner way. Hopefully some advanced user on MM official will try it:fingers-crossed:
[Xperia Z3 Android Development] nailyk:
New release

No problem. I'm just surprised: almost 100 downloads

and no comment ;)

What is the deal with concept rom and this recovery?

I also made a selinux trick to get it working back again.

Thank for your time.

----------

Releasing twrp 3.0.2-1 right now.

Should restore compatibility with old bootloaders.

Feedback are welcome and if it work I can build for other models (amami/honami/aries and other rhine & shinano variant if needed).
[Xperia Z3 Android Development] yogendrang:
Has anyone tested this against 23.5.A.0.570 on d6653?
[Xperia Z3 Android Development] cmonty14:
[Q] Latest version download link

Hello!

I found this thread when I was searching for a solution to troubleshoot the issue that TWRP 3.0.1 cannot decrypt data of CM12 / CM12.1.

I do have some questions:

1. Is the latest version of TWRP 3.0.2-1 provided her for download including the fix as communicated here:

"Fix a bug with the input box that affected masked inputs (passwords). This fixes decrypt of full device encryption on devices that support decrypt. This bug also impacts encrypted backups. Users are highly encouraged to stop using 3.0.1 if you use encrypted backups or if you need decrypt of data in TWRP."

2. Could you please confirm if additional modification is required as communicated in the installation instructions TWRP for Sony Xperia Z3 Compact:

"[...] The Xperia devices have a recovery-in-boot arrangement. This means that the recovery is booted using the regular kernel / boot image in the device. Team Win has worked with the FreeXperia device maintainers to come up with a way to extract the ramdisk from the FOTAKernel partition and use the ramdisk from that partition instead of the recovery that is included in the boot image of your device.[...]"

THX for your great work!

---------- Post added at 11:39 AM ---------- Previous post was at 11:02 AM ----------

Could you please share some additional information how to encrypt the phone via adb?

THX
[Xperia Z3 Android Development] nailyk:
Hi,

This version is installed on my D6603 with upgraded bootloader which run stock 23.5.A.0.570. As usual my recovery provided is a FOTAKernel version so it can't be booted from the stock kernel.

I wrote a guide to explain this boot process.

Hi,

1. yes this fix is included. All repo I use for builds are on github and the source code for twrp is official so always the latest on the build date. Commit pushed 2016/04/10 and build dated on 2016/04/14 (mistake on the first post release date. Correct it asap): see file name.

2. This modifications are NOT included. This recoveries are only FOTAKernel partition, so it should be extracted or launched by another process (your kernel or your bootloader). Here is my guide for full detailed instruction of the boot process. (and report me back any mistakes :o )

3. last think: as asked here sony stock based rom seems to use a modified version of the encryption. I cannot figure out it is implemented so, for now, I'm not able to decrypt with this build.

4. Here is a process to change your boot password.

Also [MENTION=5075064]optimumpro[/MENTION] wrote a guide to do this. Seems it is not working anymore on MM. Another solution (tested on slimrom 4.9).

Edit: 2bis: So you need a kernel which support extract_elf_ramdisk or an upgraded bootloader to be able to boot FOTAKernel recoveries. (cyanogenmod and omnirom provides extracted_ramdisk), other threads provides tricks to boot recoveries in other ways.
[Xperia Z3 Android Development] cmonty14:
After booting in recovery mode, TWRP is asking if System should be kept Read Only.

Question:

What is the recommended setting here?

Read Only or Allow Modifications?

Smartphone encryption with adb shell and command vdc cryptfs enablecrypto wipe password <password> fails.

I know this is not related to this thread, but maybe somebody can give advice how to setup encryption with password that is different from lock screen.
[Xperia Z3 Android Development] nailyk:
For the ro parameter, in my case I tick no. If a update.zip should update files on /system it will be mounted rw. This option just ad impact on automounted partition when twrp is started.

Did you have a failure message with the vdc command? Did you try with the cryptfs application on f-droid? With this application I was able to change sony stock 5.1.1 and CM12.1.

Here is the excellent [mention=5075064]optimumpro. [/mention]'s guide.

Also, to change password, imho the command line should be:

vdc cryptfs changepw password 'new password'

But cannot remember if new password should be hexencoded.

Good luck!
[Xperia Z3 Android Development] skul9x:
How to enter this recovery?
[Xperia Z3 Android Development] nailyk:
howto enter xperia Z3 FOTAKernel recoveries

Hi,

With FOTAKernel recoveries it depends on some points:

-

if your bootloader is upgraded

: shutdown your phone, wait a few seconds, then push vol down and power, until sony logo appears. (preferred)

-

if your kernel's rom support extrect_elf_ramdisk

: boot up your phone normaly, then after sony logo appears, push/release volume rockers until led status color change (depending of the rom used).

As this two ways are independents, if you had a upgraded bootloader with CM (for ex), both way works.
[Xperia Z3 Android Development] flatpedals:
Coming from 'TWRP 3.0.0-mm by shoey@XDA', I've flashed this on N preview 3. It works, I can boot into it using a rebooter app or from bootloader screen (v up+plug usb).

But when I select 'reboot system' from TWRP it reboots back into TWRP.

The only way out I figured is to shut down, then enter bootloader screen (v up+plug usb) and select START.

N preview will start and reboot fine after that.

But everytime I want to leave this ver. of TWRP I have to do this.
[Xperia Z3 Android Development] nailyk:
Weird... With android, 5.1/6.0, without a supported kernel that was the opposite: reboot into twrp doesn't work, everytime the rom start...

As I have not my z3 anymore I cannot make startup dev easily, sorry. I'm trying to buy another one to improve this twrp version but it cost a lot of € :(

Can you: enter twrp with the button combination, tap reboot to system, paste me your full cmdline (without serial number/imei)

'cat /proc/cmdline > /sdcard/cmdline_reboot_bug.txt' should do the trick

and your full recovery-log please?
[Xperia Z3 Android Development] flatpedals:
Weird indeed. It was a false alarm or some mess up. I reflashed N preview 3 for the log in the other thead and now this problem doesn't exist anymore, it reboots into system just fine.

Forget about it :)
[Xperia Z3 Android Development] nailyk:
Glad it work now.
[Xperia Z3 Android Development] Omario-242:
Works fine on my end as well on Preview 3.

You can also reboot into recovery by typing:

su

reboot recovery

in a terminal emulator.
[Xperia Z3 Android Development] nailyk:
Glad to read that!

So the s1 bootloader from n preview was corrected!
[Xperia Z3 Android Development] frabe8378910:
So, two weeks ago I reflashed stock via EMMA to get the new bootloader. I'd to use Windows for that - what a nightmare ... ;). After that I flashed your latest recovery via flashtool still from Windows... ;)

Reboot recovery, flashed latest CM12 + SuperSU, reboot - done. After that I encrypted the phone. Recovery still worked - perfect!!

So now I have the new bootloader, your latest recovery and encryption working.

Still hoping that someone provides a CM13 for Z3.

Thanks for your work so far.

Gesendet von meinem Xperia Z3 mit Tapatalk
[Xperia Z3 Android Development] nailyk:
Thanks for your feedback. Is your bootloader now the 'hero' one? If you own this version, does the 'reboot into recovery' functions works?

I get my phone back, so i will work on a new release. Should be released in a few weeks.
[Xperia Z3 Android Development] frabe8378910:
How to find out whether it's the 'hero one'?

Gesendet von meinem Xperia Z3 mit Tapatalk
[Xperia Z3 Android Development] nailyk:
You can check your cmdline (/cat/proc/cmdline): the bootloader version is near the 's1boot' variable.

ex for me:

root@z3:/ # cat /proc/cmdline
[...] oemandroidboot.s1boot=1286-7314_S1_Boot_MSM8974AC_LA3.0_L_37 [...]

Also, with the 'L_hero', you should get information screen when in fastboot mode:
[Xperia Z3 Android Development] nailyk:
Here it is :)
[Xperia Z3 Android Development] cmonty14:
RU referring to the unofficial version?
[Xperia Z3 Android Development] nailyk:
Yes, afaik there is no official versions for D6603.
[Xperia Z3 Android Development] frabe8378910:
So, no I don't think so:

oemandroidboot.s1boot=1286-7314_S1_Boot_MSM8974AC_LA3.0_M_2

I flashed with EMMA and afterwards I flashed the latest stock with flashtool.

So how could I install Hero and what is the advantage of it?

Gesendet von meinem Xperia Z3 mit Tapatalk
[Xperia Z3 Android Development] nailyk:
s1 bootloaders versions

From my experience there is 3 versions of the s1 bootloader for D66x3:

s1 D66x3 features:

LA3.0_L_15.4 : provide basic boot functionality, you can only boot in your boot partition.

LA3.0_L_37 : provide normal boot & recovery boot functonality (boot partition & FOTAKernel partition) but doesn't provide reboot to recovery functionality.

LA3.0_L_Hero_17 : (not yet tested): same as l_37 but correct the reboot in recovery bug.​

s1 D66x3 installation:

LA3.0_L_15.4 : is preinstalled. (.200 and above)

LA3.0_L_37 : is installed with M (.575)

LA3.0_L_Hero_17 : is installed with N preview (.?)​

So upgrading to L_37 sounds pretty important to me: if, for some reasons, your system or kernel gets broken, you can get your phone back by starting a recovery. This version had some issues due to the lack of reboot to recovery function. For ex, cm ota update could fail. CM devs implement a trick in the boot partition to workaround this but it is another story (link not yet update with 'L_Hero').

I hope this make the s1 and boot xperia boot process a little more understandable and answer to your question =)
[Xperia Z3 Android Development] frabe8378910:
Thanx. But what kind of version is then my LA3.0_M_2?

BTW: Reboot to recovery from the boot menu does work, recovery from key press does work too.

As I just flashed the recovery through flashtool after flashing stock after EMMA and was able to boot to recovery it must function independent of a FOTAkernel or anything else except your flashed recovery it's partition.

Gesendet von meinem Xperia Z3 mit Tapatalk