yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] munjeni:
You need to place firmware folder into the space contain enought free space in mb during firmware extraction by newflasher, the best to do that is to put it inside internal storage, modern device have enought 64 gb and up, on old devices it can be done on external storage. Where you placed it? You must be root and most probably you need to set selinux to permissive mode!
[Sony Cross-Device General] wgg71:
I got "(ep_in) ERROR: n = -1, errno = 110 (Connection timed out)" messages during the "Waiting sync to finish...". Everything else seems fine.

Here is the log:
[Sony Cross-Device General] munjeni:
[MENTION=1989829]wgg71[/MENTION] thanks, thats ok! Your log confirm workaround for previous sync isue is working now :)
[Sony Cross-Device General] John_forsaken:
It’s currently on my internal storage with space over the 10gb needed

Will try install from my sd card

And set selinux to permissive
[Sony Cross-Device General] munjeni:
You must be root for newflasher and selinux permissive, if not you will need to install https://www.xda-developers.com/how-to-install-magisk/ and under magisk manager setting enable "magisk core only mode" with that option checked MagiskSU is enabled, than you have root. So when all is set up cerrectly just type "su" and press enter inside terminal emulator to become root, if terminal emulator display an error you are not root, repet steps for magisk setup. When you setup root is done than you need to disable selinux temporary - type "setenforce 0" and press enter inside terminal emulator, after all that you can type "newflasher" and things. Hope this help.
[Sony Cross-Device General] munjeni:
Version 31 is out!

- version v31 (14.07.2020)

Fix cosmetic bug https://xdaforums.com/showpost.php?p=83056693&postcount=1212 which might confuse somebody

Those link confirms working sync command, and now no more those confusing timeout message.
[Sony Cross-Device General] MartinX3:
thank you for the newflasher ! :)

Sadly it doesn't flash both slots, it seems.

The other slot still had the older bootloader version on my sony xperia xz2.
[Sony Cross-Device General] munjeni:
Hi, newflasher flash only bootloader,bluetooth,dsp,modem,rdimage to booth a,b slots and it is allready resolved and confirmed working https://github.com/newflasher/newflasher/issues/29 , you can dump those partitions and compare its e.g. md5sum
[Sony Cross-Device General] MartinX3:
I wrote bootloader and I did it with V31

I flashed it while slot B was active.

Bootloader got updated according to fastboot.

Then I did a "fastboot set_active a" and reboot into fastboot again.

The "fastboot getvar all" then showed me the previous bootloader version.

It was working on V20 where it asked me to flash both slots.
[Sony Cross-Device General] munjeni:
If it worked on v20 it will work on v31 too, look here please https://github.com/newflasher/newfl...f39f896#diff-aec029f3acba737833e98a88495c1536 , there is nothing changed acording to prompt, just commented out promt and made it mandatory with flash_booth_slots = true;

Can you try again and post detailed step you done?
[Sony Cross-Device General] MartinX3:
That's indeed weird and maybe I had just bad luck.

I downloaded the firmware via xperifirm and put your newflasher binary in it.

I'll look again if it fails again, next time, I have free time to backup/restore my phone again :D
[Sony Cross-Device General] munjeni:
Or maybe you overlooked something. I realy can't see reason why it not be working since nothing is changed regarding a.b. slots, even nothing is changed in flashing routines except sync command and implementation for mac usb, the rest of code is almost the same.
[Sony Cross-Device General] John_forsaken:
Thank you so much for your hard work ??
[Sony Cross-Device General] munjeni:
I didn't had time to test newflasher from android to android, for curiousity did you succed with newflasher from android to android?
[Sony Cross-Device General] John_forsaken:
Gave up Android route always got same no space on my device so used mates comp
[Sony Cross-Device General] John_forsaken:
Do you know what the bootloader in my xz2 is tied to... I had my phone on o2 and it has been unlocked for any sim.. in my service menu it says unlock bootloader no... will that remain the same no matter what firmware version from Xperifirm I flash?
[Sony Cross-Device General] munjeni:
It will remain the same. Don't know bootloader version.
[Sony Cross-Device General] John_forsaken:
Ok so flashing a different carrier/network would not change anything, that sucks
[Sony Cross-Device General] munjeni:
Sorry I not understand your question. What you need to do? Unlock bootloader no (bootloader is not unlocked??), if I understand you correctly you want to unlock your bootloader? If yes folow this https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader .
[Sony Cross-Device General] mehdi_s82:
[MENTION=4120742]munjeni[/MENTION] does Newflasher supports the new Xperia 1 ii? I tried to use it to flash US firmware on my UK model (XQ-AT51) and after flashing when I turn on the phone, it shows phone corrupt error and shuts down
[Sony Cross-Device General] avetny:
try one more time....they updated US firmware
[Sony Cross-Device General] cd993:
Does anyone know of a successful way to update to the latest firmware (I'm using an Xperia 1 II) that is bootloader unlocked & rooted.

Research seems to suggest delete all .TA files aswell as the userdata file and if that works, to flash an extracted/pactched boot.img that I've already prepped. Though some users mention that they then get a decryption error resulting in the need to fully wipe.

If I have to do a clean flash it wouldn't be the end of the world but I would love to avoid the hassle of (even with the usage of Swift Backup etc) and little things like not losing my autobrightness settings which have been learning my usage etc
[Sony Cross-Device General] munjeni:
I don't know how many times I have said that -> https://xdaforums.com/showpost.php?p=83055283&postcount=1206

Backup your private data to your PC , delete persyst.sin and flash every single file, than copy back your private data from PC to phone, thats only I clean way to get all working correctly.
[Sony Cross-Device General] avetny:
We did that because our OP guy recommend it to do that (it went good, i flashed my device without any issues and everything was wiped)

Now im thinking to flash with Your method (just deleting Persyst.sin

I have to say that we flashing AT51 model firmware to AT52 (typically way as on Sony Xperia 1)

Flashtool is not working (because didn't support it yet, thats why our OP recommend it safe way via Newflasher)

But I want to try new way as Munjeni said. Some how i trust him
[Sony Cross-Device General] MeltdownSpectre:
[MENTION=4120742]munjeni[/MENTION]

This happens quite often with v31, at the end of the flash it won't send the power-off signal and instead shows this error (the log is clipped to only show the end). Let me know if you want the full log.

Device: Sony Xperia 1 Dual (J9110)

OS: Windows 10 (2004)

NewFlasher version: v31

Firmwares tested: Customized UK (55.1.A.9.21) and Customized UK (55.1.A.9.52)

Processing bootloader_X_BOOT_SM8150_LA2_0_Q_115_X-FLASH-ALL-A2CD.sin

- setting up inflate...

- infflating, please wait...

......

- inflate returned: 0

- gzpipe: ok.

- gunziped ok.

- Extracting from bootloader_X_BOOT_SM8150_LA2_0_Q_115_X-FLASH-ALL-A2CD.sin

- Extracting signature bootloader.cms

- Uploading signature D:\Android\J9110_Customized UK_1319-2846_55.1.A.9.52_R7B\boot\bootloader.cms

signature:00000896

OKAY.

- Extracting sparse chunk bootloader.000

- Uploading sparse chunk D:\Android\J9110_Customized UK_1319-2846_55.1.A.9.52_R7B\boot\bootloader.000

download:01bc6600

OKAY.

Partition: bootloader have slot: yes

erase:bootloader_b

OKAY.

flash:bootloader_b

OKAY.

- End of bootloader_X_BOOT_SM8150_LA2_0_Q_115_X-FLASH-ALL-A2CD.sin

Set slot 'b' active.

Device is put now out of flash mode.

Sent command: Sync

Waiting sync to finish...

ERROR: TIMEOUT: failed with error code 997 as follows:

Overlapped I/O operation is in progress.

.ERROR: TIMEOUT: failed with error code 997 as follows:

Overlapped I/O operation is in progress.

.ERROR: TIMEOUT: failed with error code 997 as follows:

Overlapped I/O operation is in progress.

.ERROR: TIMEOUT: failed with error code 997 as follows:

Overlapped I/O operation is in progress.

.ERROR: TIMEOUT: failed with error code 997 as follows:

Overlapped I/O operation is in progress.

.ERROR: TIMEOUT: failed with error code 997 as follows:
[Sony Cross-Device General] munjeni:
Thanks! Its simiar to https://xdaforums.com/crossdevice-d...-t3619426/post83163881?nocache=1#post83163881 , I found now I'm fixed only linux version and not darwin and windows version, will try fix right now!
[Sony Cross-Device General] samteeee:
After successfully flashing the US firmware on XQ-AT52 with "NewFlasher",

you CANNOT switch back to a non-US firmware! And will end up "Corrupted"! And you have to flash back to a US firmware! At least in my case. The only thing I haven't tried is with the "FlashTool" software as it is too complicated.

And we already know it isn't possible through Xperia Companion software as you end up with an error.

Hope this info would help you.
[Sony Cross-Device General] avetny:
Ok understood. Lets wait until someone find the way to comeback.
[Sony Cross-Device General] munjeni:
Your device corupted message is happening when you e.g. skip flash userdata. Again, you must whlash every sigle sin file, every single ta file, boot delivery, partitions, all. Delete only persist.sin file, flash all the rest!
[Sony Cross-Device General] munjeni:
New version is out!

- version 32, not yet released

- version 33 (30.07.2020)

Allow bootloader unlocking with newflasher; Try fix sync response bug for win and darwin too

I'm hope no more sync isues.
[Sony Cross-Device General] samteeee:
Thanks for replying.

I only deleted the persist.sin, everything else is there!
[Sony Cross-Device General] avetny:
Try newflasher updated one
[Sony Cross-Device General] samteeee:
I'm about to do it my friend.

Will report back.

---------- Post added at 04:43 PM ---------- Previous post was at 04:31 PM ----------

Flashes successfully but same result: "Your device is corrupted"!

Thank you.
[Sony Cross-Device General] munjeni:
Did you created partition folder and moved partition.sin to partition folder? Partitions doesn't get flashed if it is not done
[Sony Cross-Device General] munjeni:
And please copy whole newflasher window log and post it here or pm me with log
[Sony Cross-Device General] samteeee:
Yes Sir, all were done!
[Sony Cross-Device General] munjeni:
I'm believing you didn't flashed something, userdata.sin, can you prove with log?
[Sony Cross-Device General] samteeee:
Well everything is in the folder, I checked. But can't give you any log as the NewFlasher

closes by itself when finishes.
[Sony Cross-Device General] munjeni:
It is also strange newflasher close itself, it never happen for me, always need to press any key at the end of flashing to close newflasher. Without log sorry I can help.
[Sony Cross-Device General] Winrahr:
If you double click the executable on windows it'll close the window afterwards. Users should open a command window and then execute inside so that log messages can be viewed. Or maybe add a user prompt before the script exits.
[Sony Cross-Device General] samteeee:
Here is a link to the log:

https://docs.google.com/document/d/1fC9QdNrMtje7oPgevaasj8x92_cj7ytMVthIRdlMd5U/edit?usp=sharing
[Sony Cross-Device General] munjeni:
newflasher allready have pause command which wait user to press any key before program close itself. But yes he can run newflasher from command line if pause is not working there.
[Sony Cross-Device General] munjeni:
Post it here or send me via private message, I don't have time to mess with google access sorry.
[Sony Cross-Device General] samteeee:
PM sent!
[Sony Cross-Device General] avetny:
Sony Xperia 1 II

I think is a A51 firmware (USA 58.0.A.3.88) give a problems to comeback to A52 (International) firmware.

Personally I didn't tried to flash it back, but I'm differently believe to Samteeee with the results.

PS why I think is a firmware because first US 58.0.A.3.31 firmware was corrupted to flash. With second US 58.0.A.3.88 there was no more problem to flash it. Besides we can't flash back original firmware.

Sony would never lock for us such a things as that. That's why we all here with Pixels and Sony (freedom)
[Sony Cross-Device General] munjeni:
samteeee didn't gaved me complete log so I can't tell you precise information. We can't gues without whole log. I'm still believing samteeee didn't flashed whole firmware, as a result his device no want to boot, he need to prove with log, without log I can't say anything more.
[Sony Cross-Device General] Winrahr:
I made a TA dump through newflasher and then ran an update process.

During the ta process it seems to process the tadump and then crash.

Processing .ta files...

Processing auto-boot.ta
- Partition: 2
- Unit: 907 (2311)
- Unit size: 0x1
download:00000001
OKAY.
Write-TA:2:2311
OKAY.

Processing cust-reset.ta
- Partition: 2
- Unit: 8A4 (2212)
- Unit size: 0xe
download:0000000e
OKAY.
Write-TA:2:2212
OKAY.

Processing master-reset.ta
- Partition: 2
- Unit: 9F6 (2550)
- Unit size: 0x1
download:00000001
OKAY.
Write-TA:2:2550
OKAY.

Processing osv-restriction.ta
- Partition: 2
- Unit: 91A (2330)
- Unit size: 0x1
download:00000001
OKAY.
Write-TA:2:2330
OKAY.

Processing reset-kernel-cmd-debug.ta
- Partition: 2
- Unit: 9A9 (2473)
- Unit size: 0x1
download:00000001
OKAY.
Write-TA:2:2473
OKAY.

Processing reset-non-secure-adb.ta
- Partition: 2
- Unit: 9B6 (2486)
- Found specific unit which don't contain data.
download:00000000
OKAY.
Write-TA:2:2486
OKAY.

Processing simlock.ta
- Partition: 2
- Unit: 7DA (2010)
- Unit size: 0x13c
- Skipping unit 7DA

Processing tadump_1.ta
- Partition: 1
- Unit: 1074 (4212)
- Unit size: 0x2
download:00000002
OKAY.
Write-TA:1:4212
OKAY.
- Unit: 1359 (4953)
- Unit size: 0x2b
download:0000002b
OKAY.
Write-TA:1:4953
OKAY.
- Unit: 135A (4954)
- Unit size: 0x1f
download:0000001f
OKAY.
Write-TA:1:4954
OKAY.
- Unit: 59C6 (22982)
- Unit size: 0x40c
download:0000040c
OKAY.
Write-TA:1:22982
OKAY.
- Unit: 73B4 (29620)
- Unit size: 0x5638
PS C:\Users\Nihalum\Desktop\Mods\XQ-AT52_Customized HK_1321-8212_58.0.A.3.88_R6A>
[Sony Cross-Device General] munjeni:
Its not reccomend to write back ta dump, ta dump is only and only for emergency in case you hard brick your device, even having ta dump you can't repair phone, you will need hardware tools for repair, even having hardware tools can't guarant you would be abble to sucesfully connect those hardware and comunicate with you device! For example I have easy jtag hw tool but it is useles without having pinout conection for e.g. xperia 10, but I have pinout for e.g. xperia z1c. Can you pm me your tadump_1.ta ?
[Sony Cross-Device General] Winrahr:
Yeah I know, I forgot to move it out before running newflasher again so it tried to flash it haha.
[Sony Cross-Device General] munjeni:
Can I get your ta file? I need it to reproduce error you have and try to fix it
[Sony Cross-Device General] Winrahr:
Can't sent attachments through PM. I'm attaching my ta file here, hopefully it's not too important lol
[Sony Cross-Device General] munjeni:
Thank you soo much! Isue identified but I'm shocked, I never saw that unit size exceeds size of the 0xffff, your unit 000073B2 with size 3336 do not have size 0x3336, instead it contain 0x013336 bytes OMG, I will need to modify whole newflasher trim area routine because of this. I will need to double check this before I modify newflasher, I never saw something like that! I realy need your ta.img if you have it please, I must double check that in your TA.img to be sure it realy have size 0x0x013336 bytes. Good thing is you didn't hard bricked your device because newflasher crashed before it happened :(
[Sony Cross-Device General] avetny:
Oh such a good news !!!!!! ?
[Sony Cross-Device General] Winrahr:
Yeah scary moment haha. How do I get a ta.img?
[Sony Cross-Device General] munjeni:
If you have root you can do it with adb or trought terminal emulator while you are root user:

dd if=/dev/block/bootdevice/by-name/TA of=/data/local/tmp/TA.img

If everything right your TA.img is located inside folder /data/local/tmp . If you do not have root than nevermind. If you have root it would be of good help! I'm added support for 32bit ta unit sizes and it will be available in version 34.
[Sony Cross-Device General] munjeni:
I was shocked when I saw his trim area unit with size 0x013336, I never saw something like that, his device seems first one with that.
[Sony Cross-Device General] Winrahr:
Hmmm
[Sony Cross-Device General] munjeni:
Please keep you trimarea.ta backups! Do you have booth trimarea1.ta and trimarea2.ta? If possible post it here too I will corect them for you and you will need to restore them with newlasher next version
[Sony Cross-Device General] Winrahr:
Is that something I find in /dev/block/bootdevice/by-name/ or somewhere else
[Sony Cross-Device General] avetny:
I never even tried to switch back from AT51 model firmware to AT52....but thinking to sell this phone (returning back to stock)
[Sony Cross-Device General] munjeni:
Mean ta backups created by newflasher! Your trim area is seems broken, I realy have no idea why your phone is not brick at all! How it even work without trim area. Don't reboot your phone please, it might not boot at all, keep it charget and do not reboot it! If you want I can regenerate your trim area but I will need your tadump_2.ta (allready have your tadump_1.ta)
[Sony Cross-Device General] Winrahr:
It didn't make a tadump_2.ta

After I redid the flash process I had the triangle warning with the wrench on the first bootup but the subsequent bootups were fine. Haven't found out what's broken so far.

Edit:

I've not written to random blocks at all haha.

I've tried to backup ta with an earlier version (v20?) and not sure if I backed up anything because it seemed like it hung so I quit it after a few minutes.

I've only flashed 2 firmwares through newflasher on this device and that's all I've done.
[Sony Cross-Device General] munjeni:
It seems to me your trim area was broken allready even before you made trim area dump with newflasher. I found your tadump_1.ta is not a valid ta dump at all, newflasher just dumped your allready broken trim area partition and produced invalid trim area .ta file with wrong sizes because of invalid trim area raw partition data! Error while you tried to flash those backup.ta file to phone with newflasher is related to invalid .ta file produced from broken trim area partition. I can't help you sorry. What you have done with your phone, did you bought it used? Or you played with dd allready?
[Sony Cross-Device General] Winrahr:
I answered your edit questions with an edit haha. What's a normal trim area supposed to look like?
[Sony Cross-Device General] munjeni:
You flashed those incomplete ta dump? Seems yes. If you have an earlier dumps I can try to regenerate at least something from it. Your trim are completelly missing trim area partition 1, and your trim area missing hwconfig, how your phone even boot I realy have no idea. How it even boot with broken trim area that is realy strange. Your phone model is?
[Sony Cross-Device General] Winrahr:
v33 is the first time newflasher successfully made a dump, which is also the first time it tried to flash that dump back. I don't think I've modified the trim area in any way before this.

I have XQ-AT52.
[Sony Cross-Device General] munjeni:
Did you flashed custom roms? Did you tried to boot e.g. an recovery? Did you tried e.g. some exploits to get root.... there is many ways for broking something on your device in our case trim area. Remind yourself to get idea. All I can do now to help you is to make new trim area TA.img but for that I need an eralier dumps and it must be valid.
[Sony Cross-Device General] Winrahr:
Nope, only official firmware. Only things I've flashed are boot images with fastboot (for Magisk), and newflasher for official firmwares. That's why I don't think the trim area has ever been touched.

Only way the TA partition could've been messed up is if newflasher v20 made a bad backup and then restored it. But I don't think that would've happened because either it did not make a dump file or it had a 0 byte dump file that I deleted (can't remember what exactly happened).

Edit: Dug up old logs from my recycling bin, never flashed non official ta files (for example invalid backups).
[Sony Cross-Device General] munjeni:
Ok, maybe sony no more use trim area for example, it might be possible and have sense! TA.img dump from your phone is apsolutly invalid, you phone is alive and not hardbricked, that is impossible for example on xperia 10, hard brick is guaranted. So it have meaning that sony changed a way for storing sensitive data. Whole thing need to be confirmed, I need to see newflasher ta dump from the another phone with the the same model like yours. Do not panic, maybe everything is right with your phone! Is everything right? Can you screenshoot security test window (it open when you call this number *#*#7378423#*#*)?
[Sony Cross-Device General] munjeni:
I'm in contact with some guys, he told me your ta.img is 8mb instead of 2mb, I didn't noticed that until now, that is indication for api changes in trim area! That mean format of the trim area is changed. Again please do not panic and do not try to fix something and do not do something stupid, seems everything is right! Since all that things is news for us, we need to wait somebody confirm first. I'm forwarded url of the our page to some devs via pm, hope we get some news.
[Sony Cross-Device General] munjeni:
Can you tell me when you used newflasher it didn't made tadump_2.ta, only tadump_1.ta right?
[Sony Cross-Device General] Winrahr:
Yeah I've noticed that mines 8MB and not 2MB. I don't think there's anything wrong, just a change of format.

Before I dumped the TA, the last time I flashed anything was on June 29th, so it's been running with the trim area in that state for over a month with no issues.

Security test window looks normal, apart from Suntory blobs [ERROR] which should be expected?

Curiously, I've never overwritten persist but my android attest key is no longer provisioned.

Edit: It only made 1 ta dump

Edit2: HW keys should be lost when bootloader is unlocked right, would make sense if it does.
[Sony Cross-Device General] munjeni:
Yes its ok, attest key is not lost but just disabled when bootloader is unlocked, suntory blobs ckb and hdcp disabled too at least its on my xperia 10 which is unlocked, after I patched secd all my keys is back including attest key (for more info search xperia 10 forum for drm fix), most important thing if you didn't modified persist partition make backup of it with dd and keep it on your pc in case you mess persist partition. Regarding newflasher its strange that only tadump_1.ta is made, but nevermind it might be whole partition 2 is sake protected on xperia 1 mark 2, who knows., so only partition 1 get dumped with newlfasher. Regarding you TA.img I'm checked right now, its valid! Sony changed known trim area format which was inside 2mb partition, block size of the those 2mb trim area was 0x20000 bytes, but now I see xperia 1 mark 2 have 8mb trim area partition with 0x100000 bytes block size, so after check I can confirm your trim area TA.img dump is valid! Keep it somewhere on your pc ! Regarding newflasher I have added support for 32 bit sized ta units and it will be available soon in newflasher v34! Regarding fasle positive about your trim area, you can relax now, all is ok with it! :)

Edit:

even I have verified your trimarea_1.ta dump from newflasher against partition 1 from your TA.img, data part is ok, some sizes is not but it is related to newflasher v33 and older, v34 will be ok.
[Sony Cross-Device General] Winrahr:
Haha I'm not too worried since it's been working. If it works it works :silly:

Backing up persist is a good call, I'm gonna do that now