yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] jamchu1988:
--------------------------------------------------------
newflasher.exe v36 by Munjeni @ 2017/2020
--------------------------------------------------------

Determining available free space by GetDiskFreeSpaceEx:

Available space to caller = 27626 MB
Total space on current drive = 976632 MB
Free space on drive = 27626 MB

Reboot mode at the end of flashing:
typa 'a' for reboot to android, type 'f' for reboot to fastboot, type 's' for reboot to same mode, type 'p' for poweroff, and press ENTER.
a

Optional step! Type 'y' and press ENTER if you need GordonGate flash driver, or type 'n' to skip.
This creates GordonGate driver installer in the same dir with newflasher.exe!
n
Device path: \\?\usb#vid_0fce&pid_b00b#5&28b1272&0&4#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: SOMC Flash Device
Device Instance Id: USB\VID_0FCE&PID_B00B\5&28B1272&0&4

Optional step! Type 'y' and press ENTER if you want dump trim area, or type 'n' and press ENTER to skip.
Do in mind this doesn't dump drm key since sake authentifiction is need for that! But it is recommend to have dump in case hard brick!
y
ERROR: TIMEOUT: failed with error code 997 as follows:
Overlapped I/O operation is in progress.
- Error write! Need nBytes: 0xd but done: 0x0
nBytes[0x0]:

Error dumping trimarea partition 1 !!

Hi, sorry if this has been answered already. I have error 997. I have tried running as admin. Flashtool was working for me, until it didn't so I'm trying the newflasher. I have an XZ3 and I'm trying to flash H8416_Vodafone LC Not Net Locked_52.1.A.3.92-R8C

It's currently softbricked (I hope) and am trying to flash any working firmware on it. If you would like any info please ask :o

Also bootloader is unlocked. It currently hangs on the SONY logo if I try to boot in Recovery it gives the dead android and "No command"

If I try flashing TWRP it gives a red exclamation and corrupt data.

I'm also reading through the replies in this thread with error 997 so I'll edit this post if I find any solutions for my case... Ok so I tried flashing just the partition folder and that worked... I'll be back!

WOW!!! THANK YOU SO MUCH GUYS. I've managed to get my phone to boot thanks to everyone here and munjeni for making this awesome program! Hopefully everything works with this firmware, modem etc. Maybe I'll try rooting and getting TWRP back, just very thankful I didn't hard brick. :) :) :)
[Sony Cross-Device General] churchner420:
Very interesting. Trying a differrent cable right now as well. What exaclty did you exclude? And did you say 'no' to all the questions newflasher asked during the flash?

I always exclude partition and userdata. Btw you can't use flashtool cause flashtool doesn't even know the Xperia 5 II yet. I created an ftf file with it and changed the device name in the Meta inf folder to XQ-AS52 but then flashtool doesn't even show the firmware anymore...

This is definitely a newflasher issue and not depending on the cable or the usb port... [MENTION=4120742]munjeni[/MENTION]

Edit: tried a different cable but that does not change anything... Still looping on the Sony logo. Can't even get to the bootanimation.
[Sony Cross-Device General] munjeni:
Haha seems system sin is for that purpose?

New version is out, implemented partition.zip flashing! Now we have remaining ta files processor and boot delivery processor :)
[Sony Cross-Device General] munjeni:
It work!
[Sony Cross-Device General] thrash001:
problem i must repair my phone with pc companion an the telekom firmware have a new verion out. therefore i know the oem...-sin is not the file for debrand with the sony tool
[Sony Cross-Device General] munjeni:
Did you checked xperifirm for new fw? I think you can flash new fw using newflasher, ta files and bootdelivery will stay unflashed until I implement but anyway I think ta files and bootdelivery is the same on new fw anyway

Edit:

you can compare crc of the bootdelivery to be sure :)

Edit:

new version is out, done some small cosmetic changes for partition flashing (changed command log string flash to string repartition)
[Sony Cross-Device General] thrash001:
how?
[Sony Cross-Device General] munjeni:
Simple open e.g. bootloader_X_BOOT_MSM8998_LA1_1_N_59_A_X-FLASH-ALL-42E5.sin using 7z and you can see crc of the file
[Sony Cross-Device General] munjeni:
New version is out, implemented almost everything except bootdelivery (only simulation for boot delivery by now since I don't have sniff log for boot delivery flashing so I'm not sure what is need for it, its danger and can produce hard brick!), waiting somebody try :fingers-crossed:

Do in mind tool will flash all files found in the same folder (all .sin and all .ta)!!! So if you no want to flash all just put files out of that folder!
[Sony Cross-Device General] tanipat:
How to get log for boot delivery? Can i help some here?
[Sony Cross-Device General] thrash001:
i have today no time to test...
[Sony Cross-Device General] tanipat:
will try tonight
[Sony Cross-Device General] thrash001:
the file crc are different between old and new firmware
[Sony Cross-Device General] munjeni:
Ok thanks! Found bootloader sniff log, will integrate it till after somebody provide me full log of the current version!
[Sony Cross-Device General] munjeni:
Done. Integrated everything! :) This is first beta version, let see! :)
[Sony Cross-Device General] tanipat:
how to get the full log for you? just flash your new version with all of the firmware in the same folder?
[Sony Cross-Device General] munjeni:
Yes, no need full log, last readable part of the log is enought! :) Simple put newflasher into firmware folder and duble click it :fingers-crossed:

Edit:

Did you checked free space size on your hard disk? Last time inflate failed for you on system.sin! You need at least 10gb free space on your disk, please check that first! Thats only one feature which I need to integrate to make things more safer :)
[Sony Cross-Device General] tanipat:
Thanks mate, just happy you developed one at last anyhow i do not know what i have done wrong please see log below

--------------------------------------------------------

newflasher.exe by Munjeni @ 2017

--------------------------------------------------------

Device path: \\?\usb#vid_0fce&pid_b00b#6&3a757eec&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}

Class Description: Universal Serial Bus controllers

Device Instance Id: USB\VID_0FCE&PID_B00B\6&3A757EEC&0&1

Product: G8142

Version: 0.4-SONY-0.1

Bootloader version: 1306-5035_X_Boot_MSM8998_LA1.1_N_59-A

Baseband version: 1306-8501_45.0.A.1.244

Serialno: CB512E66JV

Secure: yes

Loader version: XFL-MSM8998-N-35

Phone ID: 0000:35700808021756,0000:35700808021757

Device ID: BC5D534D

Platform ID: 2005E0E1

Max download size: 104857600

Sector size: 4096

Rooting status: ROOTABLE

Ufs info: TOSHIBA,THGAF4G9N4LBAIRB,0100

Emmc info: FAILEmmc-info not supported

Default security: ON

Keystore counter: 1

Security state: BA1894F07A55612C78DAADBA68D953CB4B3D2133

Sake root: D159

S1 root: S1_Root_e69c

Root key hash: C30DEC2471CEA311E6918657367B51068A39583BBF89FD68B379BCD5A709AB1B

Device is put now in flash mode.

Repartitioning...

extracting: partition-image-LUN0_X-FLASH-ALL-42E5.sin

extracting: partition-image-LUN1_X-FLASH-ALL-42E5.sin

extracting: partition-image-LUN2_X-FLASH-ALL-42E5.sin

extracting: partition-image-LUN3_X-FLASH-ALL-42E5.sin

extracting: partition-image-LUN4_X-FLASH-ALL-42E5.sin

extracting: partition-image-LUN5_X-FLASH-ALL-42E5.sin

No .sin files in partition dir.

Processing sin files...

Using existing folder flash_session

Processing partition-image-LUN0_X-FLASH-ALL-42E5.sin

- setting up infflate...

- infflating, please wait...

- infflate returned: 0

- gzpipe: ok.

- gunziped ok.

- Extracting from partition-image-LUN0_X-FLASH-ALL-42E5.sin

- Extracting signature flash_session/0.cms

- Uploading signature flash_session/0.cms

signature:0000053e

OKAY.

erase:0

Error, didn't got erase OKAY reply! Got reply: FAILCommand not authenticated

Device is put now out of flash mode.

Sent command: Sync

Sent command: powerdown

End.

Press any key to continue . . .
[Sony Cross-Device General] munjeni:
Going to check that :(
[Sony Cross-Device General] munjeni:
Withing one hour I will solve that! Development need your logs so without logs I can't continue! Now I can continue since I have your log, thanks for it!!! :)
[Sony Cross-Device General] tanipat:
sure will wait to test, HK firmware have now update version. i will hold it just in case they change anything in new fw. :)
[Sony Cross-Device General] munjeni:
Ok, new version is out! Please use code tag while you post log :)

[code]log here[/code]
[Sony Cross-Device General] churchner420:
I created a bug report on the Github site for the XQ-AS52 issue. I hope that's ok ;)
[Sony Cross-Device General] munjeni:
You need to flash everything except persist.sin, that mean you need to flash partition and userdata too! Only file which you can remove from firmware is persist.sin, simlock do not need to be removed since newflasher will skip it by default, the rest of files please flash all including partitions and userdata, in that case it will boot. Bootloop you have is because of not flashed userdata and partition, in most case because incopatibility between new firmware and your userdata partition, there is many reasons for example selinux labels... so please flash all! All xperias mark 2 is cofirmed working with newflasher and apsolutly problem is not newflasher. If nothing help read this post https://xdaforums.com/t/tool-newflasher-xperia-command-line-flasher.3619426/page-68#post-83883385 , so set slot A active, than reboot device again to flash mode and than try again to reflash all. Hope this help.
[Sony Cross-Device General] churchner420:
Ok thank you man. I will try flashing my device shortly.

Btw what about the qestions newflasher asks during the flash process. I usually answer everything with 'no', is that correct?

If it is still not working I will post another reply. Stay safe ;)
[Sony Cross-Device General] munjeni:
You ansvering with 'n' not with 'no' ! I can sugest you, start newflasher and confirm with 'y' when it ask you for gordon gate driver, it will extract driver exe in the same folder with newflasher, install new driver, reboot pc (important), than do steps above this post. Waiting your reply...
[Sony Cross-Device General] churchner420:
i reinstalled the flash drivers and then flashed the device skipping persist.sin. Well, that worked, sort of... Iwas on customized EEA and wanted to switch to customized UK but after I flashed UK it still said GLOBALEEA in the service menu PLUS I could not repair the device with Xperia Companion anymore which I usually do after changing the firmware customisation. It seems to me that the device is stuck somewhere between EEA and UK...

Now I tried to flash back EEA and now the device doesn't boot because of corruption... I really don't know wha to do anymore...
[Sony Cross-Device General] frozenwaffles:
Hi, i am getting this error. Can you help please?

Repartitioning...

Found partition_delivery.xml in partition folder.

Determining LUN0 size...

- Error, no DATA reply!
[Sony Cross-Device General] munjeni:
Double click newflasher and confirm with 'y' whien it ask you for gordon gate driver, install gordon gate, reboot your pc, try again
[Sony Cross-Device General] munjeni:
Did you try diferent UK firmware? What I'm believing your device might have hardware fault, why I think that because even sony pc companion is unable to repair your phone, thats not possible otherwise. Is your bootloader unlocked? See "RIsk" section here -> https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/ I realy have no other ideas what might be problem because two-three devices mark 2 reported problem but tousens of other devices have no problem with newflasher
[Sony Cross-Device General] churchner420:
Nope the device is not unlocked hence Xperia companion should work. I think I know what the problem is. The firmware is still somehow stuck at Customized EEA which is what I can see in the service menu. But I am using the latest build number from Customized UK which is not yet available for Custimozed EEA but only for the UK and some other regions. Therefore I can't download, flash or repair the firmware with Xperia Companion cause the new build number doesn't even exist for the region the device is stuck on yet. I will see what happens when Sony releases the new firmware for EEA.

That sounds like a plausible explanation to me.

And that should also be the reason for my device's software corruption issue when reflashing the old EEA firmware cause that is a downgrade. That also sounds like newflasher isn't flashing every file from the firmware folder or is skipping a random step. That would explain why the device is still on customized EEA although I flashed UK successfully. Btw my phone runs on the UK firmware now but is still shown as EEA haha... Meaning, I am running a firmware that doesn't even exist yet... The problem should definitely lie within the flashing process of newflasher cause otherwise the downgrade should work es well... Hope you can work out what the problem is there cause I reinstalled all the drivers and Xperia Companion but everything I tried did not work.
[Sony Cross-Device General] munjeni:
If sony companion see your phone corupt, that definitely mean you got something from UK firmware, e.g. modified some partitions which normaly didn't exist/get flashed trought UEE fw. If you do not have backup its non reversible changes. One partition modification and fota-ua is no more working, thats at least what we have found (for refernce https://xdaforums.com/t/xz1c-xz1-xz...eys-implemented.3795510/page-67#post-80599561 start read from that page)

Nope. Newflasher design is to flash everything from inside a folder, every single .sin file, every single .ta file, partition folder and boot folder. You should provide newflasher log so we try analyse it!

If you see nothing in newflasher log it mean there is no failure on newflasher side! There is .ta file something like reset-customisations.ta if I'm not wrong, if those file is flashed customisation string from trim area is removed so on next boot it get filed with new customiation. But it looks like your phone got "mixed": things e.g. bootloader and some things from UK custom fw and some things from EEA. You should provide folder list from EEA and folder list from UK so we try compare. Also newflasher log from booth flashings so we try analyse and compare what is flashed and what is not. Without it we can't gues, to be honest I no want to continue further without logs / folder lists since I'm sure newflasher is ok here.
[Sony Cross-Device General] jdilla1987:
Hello,

I recently flashed my firmware to the EE UK 58.0.A.28.25 from XperiFirm and everything went smoothly.

I wanted to try different ones so I attempted to flash others (as well as trying to go back to stock 58.0.A.22.21) but this ended up giving me the dreaded 'Your device is corrupt' bootloop.

I thought I had bricked my phone but I can flash the initial EE UK 58.0.A.28.25 and everything works fine again.

Am I missing something? It's been a while since I dabbled in flashing phones but the process seems pretty straight forward.

I always dumped the TA files and never touched the backup persist partition.

My phone is currently working but now I'm a bit weary to proceed with future flashes as I don't know what exactly the issue is. Is it not good practice to flash previous firmware versions?

Any help would be greatly appreciated!

Sony Xperia 5 ii

XQ-AS52
[Sony Cross-Device General] munjeni:
Hi, you must flash whole rom including userdata, partition, boot delivery, all ta files, only file to delete is persist.sin, if that not help I realy have no idea without newflasher log. Here is allready discusion on this page related to UK firmware and xperia 5 II, I'm unsure right now whats going on
[Sony Cross-Device General] churchner420:
Yep that is the exact issue I am running into... If you try repairing your phone with Xperia Companion it will say that your device is temporairly incompatible during tthe flash process.
[Sony Cross-Device General] churchner420:
That is not a user related problem here. That definitely has to do something with newflasher cause that is the exact same issue I am having when I try to flash back to Customized EEA.
[Sony Cross-Device General] churchner420:
The files were all provided by XperiFirm. Just download the latest UK and EEA firmware. I didn't delete, modify or change anything in any way. I just took the folder XperiFirm created and flashed everything inside (skipping persist.sin). Maybe you can download both firmwares and have a look at the files in both folders maybe al well at the customisation files. Cause indeed there seems to be a problem with the customisation files.

I'm sorry that I can't deliver any log files cause really need my phone now and I will only reset it once more to get everything running properly.

There is another problem because of that mixed firmware I am running now: the Play Store security update is from May which is very old.
[Sony Cross-Device General] munjeni:
You can't blame newflasher for 100 percent sure, might be firmware isue?? If you do not see any error in newflasher session it mean no problem with newflasher. Every single step in newflasher is with fully debug window, there is no chance for something to happen without displaying it inside main window. One more thing, maybe Sony tampered bootloader e.g. not allowing to install old bootloader over new bootloader ;) I don't know, e.g.while you try to go back to UEE fw bootloader remain from UK fw. Remember one thing, last commandin newflasher is 'sync', when sync happen changes is aplied but we do not know whats happening on phone side, thats a question for bootloader notfor newflasher, newflasher just doing flash & handle every single step, whats going on after sync I don't care, thing which I care is to have no errors during flashing, the rest of things is question for developers. Even Sony pc companion fail to repair phone, so we can't blame booth, its question for fw developers why booth fail.
[Sony Cross-Device General] churchner420:
Ok thanks for your replies. I was just trying to go back to EEA cause Xperia Companion doesn't work and on the old fw is was. But now when I go back to the old EEA version Xperia Companion is still showing the new UK build number when it says that the device is temporarily incompatible when the flashing procedure starts.

Can you please have a look at the fw files? I really don't know what to do cause if the phone really is somewhere in between the two customisations OTA updates might not work anymore and I don't want to see that happen hence I switched to the UK fw cause that one gets updates quicker
[Sony Cross-Device General] munjeni:
Compare folder from UK and UEE fw and let me know if you find some extra/missing files
[Sony Cross-Device General] churchner420:
I did that. Both folders look exactly identical. I really don't know what else to do...
[Sony Cross-Device General] munjeni:
Can you give me output of those commandline newflasher commands?

newflasher Read-TA:2:2202
newflasher Read-TA:2:2205
newflasher Read-TA:2:2206
newflasher Read-TA:2:2207
newflasher Read-TA:2:2475
newflasher Read-TA:2:2498

Or if you have no idea how to do it please give me trim area dump via pm
[Sony Cross-Device General] churchner420:
The problem is I deleted the old fw folders permanently cause I redownloaded them to compare them. Therefore I can't give you any logs ortrim area dump. Have you got an Xperia 5 II to try it yourself? Or maybe you can ask @jdilla1987 to send you a log. He might still have it.
[Sony Cross-Device General] churchner420:
Ok I have dumped trim area. The ta files are attached
[Sony Cross-Device General] munjeni:
Ok, I'm downloaded so please delete archive from your post because it have sensitive data
[Sony Cross-Device General] munjeni:
This is what is curently on your device:

SW_VERSION: 58.0.A.28.25

CUST_VERSION: Unknown: Nov 2 2020/19:18:21

FS_VERSION: Unknown: Nov 2 2020/19:18:21

S1_BOOTLOADER_VERSION: 1320-2827_X_Boot_SM8250_LA1.0.1_Q_51

this is all recent customisations you have done:

NEW_VERSION: erased_user_data:true, variant:user, s1boot_version:1320-2827_X_Boot_SM8250_LA1.0.1_Q_51, cdf_version:Unknown: Aug 28 2020/19:47:21, fs_version:Unknown: Aug 28 2020/19:47:21, sw_version:58.0.A.10.21
NEW_VERSION: erased_user_data:true, variant:user, s1boot_version:1320-2827_X_Boot_SM8250_LA1.0.1_Q_51, cdf_version:Unknown: Sep 25 2020/13:51:23, fs_version:Unknown: Sep 25 2020/13:51:23, sw_version:58.0.A.12.23
NEW_VERSION: erased_user_data:false, variant:user, s1boot_version:1320-2827_X_Boot_SM8250_LA1.0.1_Q_51, cdf_version:Unknown: Sep 30 2020/11:17:26, fs_version:Unknown: Sep 30 2020/11:17:26, sw_version:58.0.A.22.21
NEW_VERSION: erased_user_data:true, variant:user, s1boot_version:1320-2827_X_Boot_SM8250_LA1.0.1_Q_51, cdf_version:Unknown: Nov 2 2020/19:18:21, fs_version:Unknown: Nov 2 2020/19:18:21, sw_version:58.0.A.28.25

What I have found is CUST and FS version is unknown, probably main isue here in relation to sony pc companion is because CDF version is missing so sony pc companion fail because do not have idea which cdf to chose during fw download. Did versions match with your current fw? What I see bootloader is the same seems in all firmwares.
[Sony Cross-Device General] munjeni:
Can you atach here all xml files from EEA fw? And which version your phone display now?
[Sony Cross-Device General] churchner420:
Ok but as far as I know there is no way to fix that :/
[Sony Cross-Device General] churchner420:
Here are the xml files from both firmwares as well as a screenshot from the software info from the service menu
[Sony Cross-Device General] munjeni:
Its easy to change, there is two choice, choice 1 me to implement it in newflasher, choice 2 you to make some extra .ta file while flashing, I will give you more detail when I take a look into your xml files. What I can see on your screenshoots it match current version from UK.
[Sony Cross-Device General] munjeni:
Xml files from fw seems not contain CDF version, so I will not be able to implement it directly in newflasher, but what can be done is manualy making extra .ta file to update CUST and FS version strings in trim area, needed info can be extraced from for example from xperifirm window (for idea compare it with newflasher log from my xperia 10), so extra .ta file can be made easy with some manual work with hex editor and file editor and it would look like this for example for my xperia 10 I can create this ta file to change CUST and FW thing in trim area:

e.g. my_own_customisation.ta

// partition
02

// this write 1317-7500_R12C in CUST version
0000089d 000e 31 33 31 37 2D 37 35 30 30 5F 52 31 32 43

// this write GENERIC_53.1.A.3.34 into FS version
0000089e 0013 47 45 4E 45 52 49 43 5F 35 33 2E 31 2E 41 2E 33 2E 33 34

Format of this is:

ta_unit - hex_string_size - hex_string

So you will be need to extract some info from xperifirm window and do some conversion from string to hex string while making .ta file, do in mind you must NOT write it wrong e.g. size of the hex string because dealing with trim area is extremely dangerous! For example one byte changes in trim area & hard brick happen, so take it right & double check if you want to write/change something in trim area! Don't use ta file above since its for my xperia 10, construct your own, use info as a reference!
[Sony Cross-Device General] churchner420:
Oh sh*t ok... Can you please implement that into newflasher?