yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] RoberM:
Hi!

First, thanks to the developer of this great tool, i have been successfully using it for more than a year to make all my prerooted roms for all my Xperia devices i have had (Xperia Z, Z2, Z2 tablet, and Z5)

But yesterday, when i tried to update my SGP-512 (Xperia Z2 tablet 32GB), the latest v1.2 gave me a lot of headaches because it creates bad flashes for this device.

I had firmware 23.4.A.0.546 running on the device, which had been created with PRFcreator 0.9 (with superSU and Nut's dual recovery) and it was working perfectly, but it was time to update. So i downloaded the latest PRFcreator (1.2), the latest SuperSU, and the latest dual recovery and created the prerooted flashable based on firmware 23.4.A.1.264, and flashed it using TWRP.

At first everything looked fine, then i realized Wi-Fi was not working i was unable to even activate it, Bluetooth and NFC icons were showing but not connecting to anything. So i had an offline tablet... Then i tried to restore factory defaults, flash various times with CWM and TWRP, re-create the flashable prerooted, nothing worked. then i downgraded to 23.4.A.0.546 creating it again with PRFcreator 1.2, using the old dual recovery and the old SuperSU i used when i created the good flash many months ago, in order to put it as it was before updating, but... Nothing, still no communications. i also tried with some intermediate firmwares with the same result. At this point i was worried, the next logical step would have been to "repair" the tablet with PC Companion and lose root, and if that does not work, send it for repair. But first i gave the good old PRFcreator 0.9 a go. i created the zip file based on 23.4.A.0.546 with old supersu and old dualrecovery, flashed it, and Wi-Fi, BT, everything was working again!, then i created the zip with PRFcreator 0.9, based on the latest 23.4.A.1.264, with the latest SuperSU, and the latest Dual Recovery, and it worked like a charm again...

...So PRFcreator 1.2 was the problem. It seems some nasty, nasty bug was introduced somewhere between 1.0 and 1.2, that affects the SGP512. I saw no errors while creating the Zips or while flashing. Also i restored factory defaults after every flash to isolate the problem.
[Sony Cross-Device General] zxz0O0:
Upon reviewing the code I found a bug in the sha256 calculation. This bug was most likely introduced in v1.2. Did you try using v1.0 or v1.1? Do you have the recovery log?
[Sony Cross-Device General] zxz0O0:
Yeah this is the bug I mentioned in the post above yours. You should be able to use v1.1 until I released v1.3 with the bug fixed.
[Sony Cross-Device General] ralphel:
Marshmallow has been released for Z3+, Z4 tablet and Z5

any brave warriors able to test whether flashing the pre-rooted Marshmallow f/w created using the tool here will work?
[Sony Cross-Device General] Rootk1t:
it's better to wait for v1.3 release first.:)

[MENTION=3975929]zxz0O0[/MENTION]

Please specify on the OP, that v.1.2 is buggy, because not everybody reads this thread, and they'll have headache figuring out where the problem is.
[Sony Cross-Device General] Fragmentation:
Well, I've just tried. The PRFCreator just showed a warning "Flashable zip size is bigger than 2GB! It may be possible that flashing fails". Nevertheless I tried to flash the resulting zip by TWRP, but there was an error "Error flashing system.sin".

Seems there should be an update to the PRFCreator.
[Sony Cross-Device General] zxz0O0:
Which firmware did you use to try? Do you have recovery log?
[Sony Cross-Device General] Fragmentation:
Downloaded by XperiFirm (integrated into the latest Flashtool) E6883_32.1.A.1.163_1299-4828_R4C.ftf — customized RU. The phone is Z5 Premium Dual, E6883. By the way, just edited my previous post to indicate PRFCreator throwed a warning about 2 GB limit. The final zip is huge at 2.25 GB. May this be the case?

As for the log, do you mean one from TWRP? I've got this:

=====================================
| *** Pre-Rooted Firmware *** |
| Blah-blah-blah |
=====================================
Extracting files...
PRF is using sinflash
Installing firmware. This might take a while...
Error flashing system.sin
Updating partition details...
...done

If you are interested in adapting your tool for the latest Sony release, you can use my help, my phone is a brick now anyway, lol (not PRFCreator's fault, I deliberately wiped all in beforehand, left just TWRP in place). I mean feel free to ask if you need some beta testing.
[Sony Cross-Device General] zxz0O0:
Thanks I will check it. It's weird that it was even possible to flash the firmware if it was over 2GB. I thought TWRP has limit for zip files to be 2GB.

The recovery log is in TWRP under Advanced (there is "Copy log to SD"). This log is more detailed and has some useful info for debugging.
[Sony Cross-Device General] Fragmentation:
Ah, got it. Here you go: http://pastebin.com/yW47rV6z
[Sony Cross-Device General] zxz0O0:
I identified the issue and now I am looking with the library developers to resolve this :good:
[Sony Cross-Device General] ralphel:
thanks for the replies guys :D

I'm still patiently waiting for Sony to release the marshmallow update for Z3C

hoping zxz0O0 will release the update along with Sony

cheers
[Sony Cross-Device General] Fragmentation:
Sounds good, will stay on 5.1 for a while and will test PRFCreator once it will be updated.

Thanks!
[Sony Cross-Device General] sxtester:
Same here, tried -but finally decided to completely skip- LP (don't like it for various reasons) and still perfectly run my Z3C on (pre-) rooted KK (23.0.1.A.5.77) ever since zxz0O0 found/developed the exploit back in Jan/Feb 2015 :good:

Though there's no App known/important to me that requires >KK API to run yet, I'd definitely give 6.x a try once after it can be pre-rooted by PRFcreator and flashed via TWRP. So, count me in as tester :)
[Sony Cross-Device General] zxz0O0:
Updated to v1.3, would be nice if you can test :)

Thanks to Calystos, RoberM and Fragmentation for reporting issues

For next version I'm working on making it more modular so more files can be included. I saw that E6883 has new files like diag, oem, ramdump, ssd, etc.
[Sony Cross-Device General] Fragmentation:
Just tried 1.3. I noticed you slightly changed the warning message if the zip is greater than 2 GB, suggesting TWRP 3.0 or newer. Since there is no official 3.0 TWRP for Z5P, I took my chances and tried to flash it anyway with my current 2.8.7.0. No luck. Here is the log: http://pastebin.com/D4hmseQ7

I'll try to find TWRP 3.0 for my phone and try once again.
[Sony Cross-Device General] zxz0O0:
Well flashing system worked. Did it not boot at all or was root just not working?

There are a few errors:

Couldn't find partition with matching uuid
run_program: child exited with status 1
Error flashing ltalabel.sin

You can probably fix this issue by flashing partiton image in flashtool

Some SuperSU error messages, no idea about them

Extra Apps not working because of the unzip utility in busybox (have to find something else)
[Sony Cross-Device General] Fragmentation:
Tried again with the beta SuperSU (2.68). SuperSU issues are gone, but still no luck: the boot stuck at the initial Sony Xperia logo with the white background.

And after the whole flashing procedure, TWRP is gone (or probably just inaccessible).
[Sony Cross-Device General] zxz0O0:
You are using a custom kernel right? Then it's clear that TWRP is gone if you overwrite it with the stock kernel and don't include recovery zip. If you use dualrecovery kernel, simply include the XZDR Kernel zip in "Recovery zip".

For the bootloop, did you wipe data / cache? Did you wait long enough? Sometimes it takes 5 min to boot after updating. And you can also try flashing the firmware in flashtool but excluding system and kernel.
[Sony Cross-Device General] Fragmentation:
Okay what I did exactly.

I got boot.img from here (AndroPlus's repository): https://dl.androplus.org/Xperia Z5 Premium_E6853/Z5PDual_AndroPlusKernel_v5b.zip

and TWRP from here: https://dl.androplus.org/Xperia Z5_E6653/twrp-3.0.0-0-E6653-20160220.img (it's actually TWRP 3.0 from the Z5 section, but works well)

all installed via fastboot.exe commands:

./fastboot.exe flash boot boot.img
./fastboot.exe flash recovery twrp-3.0.0-0-E6653-20160220.img

Then I grabbed the latest firmware from Sony via Flashtool and XperiFirm, the resulting file is E6883_32.1.A.1.163_1299-4828_R4C.ftf.

I combined this .ftf with the latest beta SuperSU (2.68) with latest PRFCreator, all checkboxes checked (Kernel, FOTAKernel, Modem, LTALabel). Sign zip and Legacy mode are unchecked.

The last part is flashing from TWRP. At first I boot into TWRP and wipe all except Micro SDCard and USB OTG. Then I actually install the zip generated by the PRFCreator. Wiped Cache/Dalvik afterwards.

The boot didn't make it through the initial logo, I waited for 5 minutes (or even more) for sure.

Sorry, can you instruct me a little how do I do that? I didn't knew it is possible to flash zip via Flashtool.

What caught my attention when I stalked across the internet is this thread: http://xdaforums.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605/ Probably I should use this too?
[Sony Cross-Device General] caqo71:
No you don't have to flash the zip in flashtool (it can't be flashed that way). You have to flash in flashtool the same FTF which you used to make the prerooted zip, but before flashing, you have to exclude SYSTEM and KERNEL.
[Sony Cross-Device General] zxz0O0:
You are not using Concept Rom right? I didn't know stock rom has recovery partition.

Anyway the kernel will get overwritten because you included in in the PRF zip. If the AndroKernel is compatible with your firmware, you better uncheck kernel and in "Recovery zip" you add Z5PDual_AndroPlusKernel_v5b.zip. The TWRP recovery image can be flashed afterwards manually or you can create a custom flashable zip and add it under Extra Files in PRFCreator

You flash the FTF firmware in flashtool. But on the right side there is a list "Exclude". You can check "System" and "Kernel" (maybe also "Recovery" if available). That way all other components like bootloader will get updated properly because not everything can be flashed with PRFCreator yet (usually it's also not necessary).
[Sony Cross-Device General] sxtester:
As far as I know, Sony's MM Concept Rom is available for Z3 and Z3C only and [MENTION=6800595]Fragmentation[/MENTION] seems trying on a Z5 Premium Dual-SIM with unlocked BL (since not rootable otherwise). E6883_32.1.A.1.163_1299-4828_R4C.ftf is the latest FW for Z5 Premium Dual-SIM, RU customization, Android 6.0. Also, the size of the Concept Rom is comparatively small (< 1 GB), hence no issues with any 2 GB limit over here anyway.

Someone to correct me, but my understanding of the "Systemless Root" approach (since SuperSU 2.56 Beta) actually is to avoid having to use a custom kernel with dm-verity off because SuperSU automatically patches kernel for root. Got this impression from here: http://xdaforums.com/z3/development/kernel-ub-t3231710.

Now, if that holds true, then why don't you ( [MENTION=6800595]Fragmentation[/MENTION]) try to create a pre-rooted ROM by only including...

- E6883_32.1.A.1.163_1299-4828_R4C.ftf

- SuperSU 2.68

- TWRP 3.0 (the one you downloaded)

Use PRFcreator again with Kernel, FOTAKernel, Modem and LTALabel checked, Sign-zip and Legacy-mode unchecked.

Assumed you'll place the resulting flashable-prerooted.zip on SD card, just wipe everything via TWRP (including system, data, cache etc. but not SD card :p) and then flash/install the pre-rooted ZIP.
[Sony Cross-Device General] Fragmentation:
Okay guys, thanks for all the comments, will try what [MENTION=6027866]sxtester[/MENTION] suggests first.
[Sony Cross-Device General] zxz0O0:
I checked the kernel you're using now. Seems this is abandoned and not updated. Marshmallow most likely won't boot with a Lollipop kernel so you have to find an alternative.

This here looks interesting, you can try it: http://xdaforums.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605

It also includes TWRP, no idea though if it supports Marshmallow.

So the steps are:

- Flash the Marshmallow FTF in flashtool and exclude System and Kernel

- Flash recovery kernel in fastboot

- Create PRF flashable zip and simply add the zip linked above under "Recovery zip" and check Kernel, FOTAKernel, LTALabel and Modem under Include
[Sony Cross-Device General] Fragmentation:
Understood all the instructions except of "Flash recovery kernel in fastboot", I should flash some .img? Which one? Suppose it is https://dl.androplus.org/Xperia Z5_E6653/twrp-3.0.0-0-E6653-20160220.img

Did as you suggested, but after the whole procedure the phone suppose to start after the initial vibration signal, but display is not turning on and nothing boots. Seems like it shuts down after the startup immediately.

---------- Post added at 03:58 AM ---------- Previous post was at 03:26 AM ----------

How do I include TWRP 3.0 (.img I presume?) with PRFCreator? I believe it accepts only .zip or .apk.
[Sony Cross-Device General] sxtester:
[MENTION=6800595]Fragmentation[/MENTION]:

Sorry, didn't realize that the TWRP is a ".bin" and not a ZIP. Not sure how exactly to pack a ".bin" into something that PRFcreator would accept. [MENTION=3975929]zxz0O0[/MENTION] to comment.

Anyway, just leave out the TWRP while creating the PRF for now, so only add the FTF and SuperSU, then install the ZIP with TWRP you already installed via fastboot earlier. Of course, after that you'd have to do the "./fastboot.exe flash recovery twrp-3.0.0-0-E6653-20160220.img" again from command line.

What zxz0O0 suggested above...

http://xdaforums.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605

...will unfortunately not help (for now) because it contains TWRP V. 2.8.7.0 only, so you would run into the > 2GB issue with that.
[Sony Cross-Device General] zxz0O0:
Can you upload the recovery log again and the flashable zip generated by PRFCreator?

I think that TWRP image is made for the FOTA partition. So that would need a custom kernel to boot from which he doesn't have.

It should still work with TWRP 2.8.7 because the flash script is included in the start of the zip and for the rest I use my own unzip utility which supports large files.
[Sony Cross-Device General] sxtester:
Ahh, do you mean to say that PRFcreator is embedding its own unzip-library into the pre-rooted ZIP?
[Sony Cross-Device General] zxz0O0:
Yes, well it's based on libarchive. Because of the file order in the zip, the recovery can still extract the necessary files to start off
[Sony Cross-Device General] Fragmentation:
Okay, the whole procedure once again from the ground up.

Prerequisites: Z5P flashed with vanilla Sony's Android 6.0 (via FlashTool and XperiFirm) without root and without custom anything.

At first I flashed AndroPlus's custom boot.img (which [MENTION=3975929]zxz0O0[/MENTION] assumed is a Lollipop one but whatever, I don't have a proper Marshmallow boot for now) and TWRP 3.0 .img (and [MENTION=5169444]AndroPlus[/MENTION] himself told me it should work well with Z5P, despite it is actually built for a regular Z5). All this flashed via fastboot method.

Booted into TWRP and wiped all except of Micro SD and USB OTG (I don't have the latter).

Flashed .ftf via Flashtool excluding SYSTEM and KERNEL.

Once again flashed TWRP 3.0 .img via fastboot. TWRP is usable now.

PRFCreator time. Added original .ftf, beta SuperSU 2.68 and stock kernel repack (by [MENTION=357342]tobias.waldvogel[/MENTION]) under the Recovery Zip section. Checked all checkboxes from the Include section. Left Sign zip and Legacy mode unchecked.

Copied flashable-prerooted.zip onto a SD card, started TWRP and initiated its (.zip's) installation. After the completion, copied log to the SD card.

After the process end, rebooting the phone, but now it isn't starts at all, not even the display powers on. Seems like the phone shuts down immediately after the power on button pressed, passing only through the vibration signal step.

Here are the flashable-prerooted.zip and the TWRP log you requested.
[Sony Cross-Device General] zxz0O0:
Thanks I will check it out soon. I quickly looked at the log, there are some issues with SuperSU and systemless root.

Can you do the same steps as you wrote above but with those differences

- Do it one time without the "stock kernel repack" and see if it boots

- If not, do it one time but do not include SuperSU zip. Instead, use "stock kernel repack" under "SuperSU Zip" in PRFCreator and see if it boots
[Sony Cross-Device General] sxtester:
[MENTION=6800595]Fragmentation[/MENTION]:

On top of what zxz0O0 suggested, I'm not clear on the purpose of following specific steps you made:

Why you want a custom kernel? I mean, there are certainly many reasons to have/use one :), but for this topic/matter I wouldn't know what for.

This steps seems unnecessary to me because you already have a working TWRP in step no. 2.
[Sony Cross-Device General] Fragmentation:
I want custom kernel to have TWRP to perform a wipe.

---------- Post added at 07:00 PM ---------- Previous post was at 06:36 PM ----------

1. Did so, the system stuck at the boot logo "Sony Xperia". Unfortunately forgot to save the log.

2. The system didn't booted at all, log here: http://pastebin.com/bhwQQqas
[Sony Cross-Device General] zxz0O0:
Hm really weird. Can you try a last time with this empty flashable zip as "SuperSU Zip"

https://www.mediafire.com/?sac8727kyucbh72

Don't add anything under "Recovery Zip" and check Kernel, FOTAKernel, LTALabel and Modem.

If that doesn't work I guess you'd have to wait until my Z3C receives the Marshmallow update so I can debug it myself.
[Sony Cross-Device General] juanpirulo:
I think supersu Its not working under mm on Sony devices only in nexus. I Just try With the beta on z3 With unlocked bootloader ando refused to install because needs a boot.img i think Gustavo Its working on it. Cheers

Enviado desde mi D6603 mediante Tapatalk
[Sony Cross-Device General] Fragmentation:
It still stuck at the "Sony Xperia" initial logo. Log: http://pastebin.ca/3399004
[Sony Cross-Device General] tobias.waldvogel:
I still have to adapt my kernel repack tool to Marshmallow.

There is a slight change in how to repack the new kernel.

The .153 kernel is compiled with the "appended dtb" option. It took me quite a while to figure this out. So basically instead of running mkbootimg with kernel, ramdisk and dtb you have to

- gzip kernel

- cat dtb >>kernel.gz

and then mkboootimg only with kernel and ramdisk.

I'm on vacation until Monday, then I will publish a new repack tool

Cheers,

Tobias
[Sony Cross-Device General] zxz0O0:
Basically you now only flashed vanilla system. According to the log it was successful. I'm afraid we have to wait until Z3C gets Marshmallow update so I can debug the issue and check the hashes.
[Sony Cross-Device General] sxtester:
It won't be long till MM arrives for Z3C, guess it'll be here any moment from now. Only wonder how come [MENTION=3975929]zxz0O0[/MENTION] has not played around with the Concept MM as yet ;) Just kidding!

Also looked into what [MENTION=357342]tobias.waldvogel[/MENTION] has done/developed for the Xperia community, especially his Sony credentials restore after unlocking the bootloader. Wow! Seriously, this has definitely made me hang on to Sony devices again. I was really p..... with this DRM thingy for I'm personally not going to buy any phone from any OEM without root or loss of functionality.

I've been closely watching how quick the new Galaxy S7 got root without losing any (well, except Samsung Pay, anybody cares?!) functionality in no time... Sony, you need to do something quickly! Sorry, I'm diverting from the topic...
[Sony Cross-Device General] Pandemic:
[MENTION=6027866]sxtester[/MENTION]

Well Z3 comes lil earlier as Z3c i think

Well that is because of that Samsung have an unlocked bl and Sony not due the DRM keys like bravia engine, track id etc what samsung dont have !

But indeed we true Sony users dont totally care what crapsung do ^^
[Sony Cross-Device General] sxtester:
Haha, that's right. Yet, it's a little annoying getting completely ignored by our beloved OEM while making suggestions to overcome or relax the limits they introduced... http://xdaforums.com/showpost.php?p=64038010
[Sony Cross-Device General] hamzxoxo:
Is there any way of flashing the rooted firmware zip via flashtool?
[Sony Cross-Device General] zippy01:
No no way at all if we could there be no reason to find exploits
[Sony Cross-Device General] juanpirulo:
Hi [MENTION=3975929]zxz0O0[/MENTION] could it be posible to implement a security line in the script to check if the build is for the specific device? So in case i am going to flash a rom for example to the Xperia z1 onto z3 it gives me an error and stop flashing?. Cheers

Enviado desde mi C6903 mediante Tapatalk
[Sony Cross-Device General] zippy01:
Wouldn't that be up to the user that is flashing to actually take note what they are downloading and flashing to their device? I think the only reason that would be useful is mislabled titles you not think?
[Sony Cross-Device General] juanpirulo:
Yep but some of US we own diferents devices and we are flashing roms everyday. I ve got a brick on my z3 because of this, i know is my fault because i was in a hurry and i made a mistake, so i would like to make this preroot zips more secure.[emoji12]

Enviado desde mi C6903 mediante Tapatalk
[Sony Cross-Device General] zippy01:
Bit of a silly mistake really I also own different devices and have never flashed a wrong firmware it wasn't a backlash I was wondering why such a feature was needed by anyone thinking of how much work it would probably need to include idk md5 checks on every new firmware almost impossible to keep track off :)
[Sony Cross-Device General] juanpirulo:
I wasnt thinking in checking firmwares, Just compare build.props before wiping system. Anyway i was just asking if There is such a posibility. I ve been making roms even before prfcreator was implemented and never had any problem too, but always there is a First time for clumsy people like me. [emoji12]

Enviado desde mi C6903 mediante Tapatalk
[Sony Cross-Device General] nitzero:
I kinda rooted my phone but I can't seem to get SuperSU binary to update itself since I got no recovery and it fails otherwise, if I make a FTF with a custom recovery do I need to unlock the bootloader? Sorry for the Q, I did this on my Z1 long time ago but I forgot.

Currently doing it on a Z3 with Lolipop 23.4.A.1.232

I do not intend to play with custom kernels.

Thanks.
[Sony Cross-Device General] ralphel:
since you have root, you should be able to install TWRP and flash the supersu zip file in recovery

down the zip from

https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip?retrieve_file=1
[Sony Cross-Device General] zxz0O0:
It's a good idea. I'll see if it's possible to get the device name from the FTF manifest.mf
[Sony Cross-Device General] nitzero:
Thanks I forgot how I did root the device, I think I brought it over from kitkat, or something, I kinda got lost in modding I don't do any heavy modding since my Arc S and Galaxy S3, Android got kinda boring to me, the Gapps bloatware, the lack of customization we used to tweak so much in the lacking gingerbreak/ICS UI and everything became so universal nowadays. I also got kinda sad with Lolipop - It's so restricting and suffocating.

It's already rooted and got the recovery installed, thanks to your insight.