yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] beenoliu:
Hope can help you :)

--------------------------------------------------------
newflasher.exe by Munjeni @ 2017
--------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_b00b#5&26670dd9&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: 通用序列匯流排控制器
Device Instance Id: USB\VID_0FCE&PID_B00B\5&26670DD9&0&2

Product: G8142
Version: 0.4-SONY-0.1
Bootloader version: 1306-5035_X_Boot_MSM8998_LA1.1_N_59-D
Baseband version: 1306-8501_45.0.A.5.1
Serialno: CB512E90ET
Secure: yes
Loader version: XFL-MSM8998-N-36
Phone ID: 0000:35700808085476,0000:35700808085477
Device ID: 8DA4A2BC
Platform ID: 2005E0E1
Max download size: 104857600
Sector size: 4096
Rooting status: ROOTABLE
Ufs info: SAMSUNG,KLUCG4J1ED-B0C1,0200
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.

No .sin files in partition dir.

Processing sin files...
Created ouput folder flash_session

Processing adspso_X.sin
- setting up infflate...
- infflating, please wait...

- infflate returned: 0
- gzpipe: ok.
- gunziped ok.
- Extracting from adspso_X.sin
- Extracting signature flash_session/dsp.cms
- Uploading signature flash_session/dsp.cms
signature:00000531
OKAY.
erase:dsp
OKAY.
- Extracting sparse chunk flash_session/dsp.000
- Uploading sparse chunk flash_session/dsp.000
download:01000000
Processing chunk 1: 0x200000 bytes
Processing chunk 2: 0x200000 bytes
Processing chunk 3: 0x200000 bytes
Processing chunk 4: 0x200000 bytes
Processing chunk 5: 0x200000 bytes
Processing chunk 6: 0x200000 bytes
Processing chunk 7: 0x200000 bytes
Processing chunk 8: 0x200000 bytes
OKAY.
- End of adspso_X.sin
flash:dsp
OKAY.

Device is put now out of flash mode.
Sent command: Sync
ERROR: TIMEOUT: failed with error code 997 as follows:
Overlapped I/O operation is in progress.
- Error reply: less than 4!
Raw input[0x0]:

Press any key to continue . . .
[Sony Cross-Device General] tanipat:
no problem mate, can wait for you no worries :)
[Sony Cross-Device General] munjeni:
Sorry had problem with minizip and unable to solve it so removed extraction of partition.zip, it solved isue, hope all ok now!
[Sony Cross-Device General] munjeni:
Sorry forgot to remove return value :(:(:( , there is 3169 lines of code and its soo hard having full attention on all ,new version is out
[Sony Cross-Device General] munjeni:
Hmm strange! Everything went right but failed on Sync command OMG
[Sony Cross-Device General] tanipat:
i think i successfully flash it but somehow it seem i brick it the phone is not bootup and freeze on sony logo, the log is very long cannot post so i upload it to the link below. Please see and investigate it. i think there is only one error at the end line

https://drive.google.com/open?id=0B-YrlXZxM0jhenBpZVFsYVVJUWM
[Sony Cross-Device General] beenoliu:
- Extracting sparse chunk flash_session/system.047
- Uploading sparse chunk flash_session/system.047
download:04066034
Processing chunk 1: 0x200000 bytes
Processing chunk 2: 0x200000 bytes
Processing chunk 3: 0x200000 bytes
Processing chunk 4: 0x200000 bytes
Processing chunk 5: 0x200000 bytes
Processing chunk 6: 0x200000 bytes
Processing chunk 7: 0x200000 bytes
Processing chunk 8: 0x200000 bytes
Processing chunk 9: 0x200000 bytes
Processing chunk 10: 0x200000 bytes
Processing chunk 11: 0x200000 bytes
Processing chunk 12: 0x200000 bytes
Processing chunk 13: 0x200000 bytes
Processing chunk 14: 0x200000 bytes
Processing chunk 15: 0x200000 bytes
Processing chunk 16: 0x200000 bytes
Processing chunk 17: 0x200000 bytes
Processing chunk 18: 0x200000 bytes
Processing chunk 19: 0x200000 bytes
Processing chunk 20: 0x200000 bytes
Processing chunk 21: 0x200000 bytes
Processing chunk 22: 0x200000 bytes
Processing chunk 23: 0x200000 bytes
Processing chunk 24: 0x200000 bytes
Processing chunk 25: 0x200000 bytes
Processing chunk 26: 0x200000 bytes
Processing chunk 27: 0x200000 bytes
Processing chunk 28: 0x200000 bytes
Processing chunk 29: 0x200000 bytes
Processing chunk 30: 0x200000 bytes
Processing chunk 31: 0x200000 bytes
Processing chunk 32: 0x200000 bytes
Processing chunk 33: 0x66034 bytes
OKAY.
- End of system_X.sin
flash:system
Error, didn't got flash OKAY reply! Got reply: FAILCheck payload hash

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:
- End of system_X-FLASH- ALL-42E5.sin

flash:system

Error, didn't got flash OKAY reply! Got reply: FAILCheck payload hash

Seems isue because partition image is not flashed!?? I think you must flash partition.zip! Thats new firmware right? Please wait going to make new version, done some changes to CreateEvent function, need manual cancel event
[Sony Cross-Device General] munjeni:
Ok, done, updated version!
[Sony Cross-Device General] tanipat:
it is Thai firmware from Xperifirmware. yes i put everything to flash. it is ok man take your time. i will unbrick using xperia companion first seem ok to unbrick it

---------- Post added at 01:34 AM ---------- Previous post was at 01:32 AM ----------

ok after unbrick it i will try straight away. wait for moment
[Sony Cross-Device General] munjeni:
Do not unbrick please, continue using newflasher until we test! New version is out, I have removed that "Processing chunk..." to make not that huge log
[Sony Cross-Device General] munjeni:
I didn't saw "Repartitioning" string in your log which indicate that partition.zip is not processed. You must create dir called partition and extract partition.zip in that dir! :)
[Sony Cross-Device General] tanipat:
ok now trying new version, will report man
[Sony Cross-Device General] beenoliu:
You mean...?

--------------------------------------------------------
newflasher.exe by Munjeni @ 2017
--------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_b00b#5&26670dd9&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: 通用序列匯流排控制器
Device Instance Id: USB\VID_0FCE&PID_B00B\5&26670DD9&0&2

Product: G8142
Version: 0.4-SONY-0.1
Bootloader version: 1306-5035_X_Boot_MSM8998_LA1.1_N_59-D
Baseband version: 1306-8501_45.0.A.5.1
Serialno: CB512E90ET
Secure: yes
Loader version: XFL-MSM8998-N-36
Phone ID: 0000:35700808085476,0000:35700808085477
Device ID: 8DA4A2BC
Platform ID: 2005E0E1
Max download size: 104857600
Sector size: 4096
Rooting status: ROOTABLE
Ufs info: SAMSUNG,KLUCG4J1ED-B0C1,0200
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...

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 partition/0.cms
- Uploading signature partition/0.cms
signature:0000053e
OKAY.
- Extracting sparse chunk partition/0.000
- Uploading sparse chunk partition/0.000
download:00006000
Processing chunk 1: 0x6000 bytes
OKAY.
- End of partition-image-LUN0_X-FLASH-ALL-42E5.sin
Repartitition:0
Error, didn't got Repartitition OKAY reply! Got reply: FAILCommand not supported

Device is put now out of flash mode.
Sent command: Sync
Sent command: powerdown

End.
請按任意鍵繼續 . . .
[Sony Cross-Device General] munjeni:
I told you you must flash partition image, see post above please! :)
[Sony Cross-Device General] munjeni:
Did you tried flashtool? Situation the same like newflasher?
[Sony Cross-Device General] rayga836:
I flashed my xz1c docomo (so-02k) with oreo firmwares, but the camera doesn't works.

But when i flash it with pie firmwares, the camera back to normal.

Do u know how to solve this?

Because i want to use this phone with oreo (it has long lasting battery life & better Wi-Fi link speed)
[Sony Cross-Device General] munjeni:
I don't know, maybe try many more firmware until you find good one
[Sony Cross-Device General] churchner420:
I can't use flashtool with the Xperia 5 II. The flashtool changelog says that it is compatible but it isn't... The 5 II is still missing from the device list inside flashtool even after manual device sync. I think that flashtool itself is compatible but since you can't create ftf bundles with it or download any you can't flash the 5 II. And I don't know any way to contact the dev.... Or do you know any way to do it? Or to flash the device or to create an ftf file without flashtool?
[Sony Cross-Device General] sluo:
Have some other interesting findings: I tried to switch my XQ-AS52 from "Customized EEA" to "Cutomized UK" therefore I downloaded the UK Android 11 firmware using XperiFirm.

Initial flash with everything except the persisten_*.sin went through and Android 11 booted successfully but the Service Menu still showed GLOBALEEA-A2 as software variant.

After some further research I stumbled upon unsin and decided to inspect the sin files included in the UK firmware package:

./unsin oem_X-FLASH-CUST-2389.sin
Extracting sparse files from SIN... Done!
Restoring image from sparse files... Done!
Successfully restored image to /home/XXXXX/Downloads/test/oem_X-FLASH-CUST-2389.ext4

7z x oem_X-FLASH-CUST-2389.ext4

After extraction inspect the file etc/customization/config.prop and there is:

...
#
# VERSION_PROPERTIES
#
ro.semc.version.sw_revision=58.1.A.1.178
ro.semc.version.sw_variant=GLOBALEEA-A2
ro.semc.version.sw_type=user
vendor.somc.syscore.variant.name=GLOBALEEA-A2

Software revision shows up the same as the current UK version but the variant seems not?

Update: Checked against the EE UK variant and the sw_variant field is indeed set to EE.
[Sony Cross-Device General] churchner420:
Thanks for finding that out my friend. Is there anything we can do about that @munjeni? That is probably the reason why unbreading or rebranding or switching the region does not work on the 5 II
[Sony Cross-Device General] sluo:
Correct me if I am wrong but it is my understanding that sin files are cryptographically signed using a private key only known to Sony. Therefor any third party modification would break it thus making a flash impossible/device won't boot up.

It would be interesting what the file content is in earlier version of the firmware. Unfortunately I haven't downloaded them and cannot check the values. The current value there is either on purpose or even a copy and replace mistake by the Sony devs.

It is also possible that branding/region is also stored somewhere else and this is only optical.
[Sony Cross-Device General] churchner420:
I think that we have got an XperiFirm related problem here. Maybe the firmware is not downloaded and signed correctly which might be the reason why there are EEA files in the UK firmware folder
[Sony Cross-Device General] munjeni:
Ofcourse its very possible firmware bug! What about if you manualy change string to UK? E.g. GLOBALUK-A2
[Sony Cross-Device General] munjeni:
Its not possible because sin files is signed! So definitely fw bug.
[Sony Cross-Device General] munjeni:
See here https://github.com/Androxyde/devices/commits/master xperia 5II added last year! Related to flashtool you need flashtool version 0.9.33
[Sony Cross-Device General] sluo:
Think there is no way to repack everything into a working sin file because of private key signing?

Also think it is very unlikely a XperiFirm bug because the manual download links for the file chunks are all the same except for the last digit unless the base link is wrong. After unpacking the fwinfo.xml correctly states that this is "Customized UK".
[Sony Cross-Device General] munjeni:
Yes even its not possible to manualy edit oem partition because of vbmeta protection. I don't think xperifirm is problem because files downloaded by xperifirm is encrypted (from sony server 3 encrypted files), when decrypted produce firmware files. I think bug is inside firmware definitely. You should report problem in xperifirm thread, maybe I'm wrong!
[Sony Cross-Device General] ogi96:
I have successfully downgraded to Android 10 by flashing XQ-AS52 firmware on an XQ-AS72 phone. Thank you very much for the tool and guide!
[Sony Cross-Device General] churchner420:
Yes, I know... It is added officially but still not in the device list in Flashtool itself thus not being compatible
[Sony Cross-Device General] OR7:
Im not able to roll back from Android 11 to 10.

I think there is an anti rollback protection in Android 11

Firmware version: 58.1.A.0.921

I get every time black screen with the following message:

Your Device is corrupted and cannot be trusted

But flashing last version of Android 11 works perfectly in Sony xperia 1ii XQ-AT51

Tools used:

1. Flashtool

2. Newflasher

What am i doing wrong or what should i do?
[Sony Cross-Device General] THISISINSANE:
So I flashed my Xperia 1 ii tonight and for some reason it didn't take; when I restarted post flash I got the device corrupted error. Went to recover using Xperia Companion and it is complaining that I have to charge my device past 50%; although when I shut my device down pre-flash it was at 58%. Also, plugging into a charger causes it to try to boot and it loops the corrupted device screen. Does anyone know if it will actually charge in that state? Otherwise, is there another way to get it to charge?
[Sony Cross-Device General] churchner420:
Normally you can also flash it in Fastboot mode via PC. If the error persists you should try a different cable. I had that problem too. I fixed it by unplugging and plugging in the cable again
[Sony Cross-Device General] churchner420:
Try the software repair with Xperia Companion
[Sony Cross-Device General] OR7:
With Xperia Companion it is only possible to upgrade but i want to downgrade from android 11 to 10. I am not happy with Android 11
[Sony Cross-Device General] churchner420:
That is true but at least you would have got a working device again. I hate A11 as well but your security level will get severely outdated if you don't update ;)
[Sony Cross-Device General] munjeni:
I have allready mentioned ten pages back about rollback protection, I will not repeat so try read it first. Here you can read about rollback protection https://xdaforums.com/t/tool-newflasher-xperia-command-line-flasher.3619426/post-84077083 . So no back to android 10 after upgrading to 11 because of rollback protection! Only a way to bypass rollback protection is -> https://xdaforums.com/t/tool-newflasher-xperia-command-line-flasher.3619426/post-84378969 (solution not confirmed!!! If you going to do that let us know the result!). In short bootloader need to be unlocked, than relocked (to reset roolback index, than reflash 10, and this need confirmation since nobody tried it and nobody confirmed solution. And ofcourse I will not repeat whats happening with device unique key after unlocking bootloader, my hope you read something about it.
[Sony Cross-Device General] OR7:
This is stated on the Sony website:

Unlock Bootloader

What is this?

By unlocking the bootloader, it’s possible to

Certain pre-loaded content on your device may also be inaccessible due to the removal of DRM security keys. For devices running recent software versions, for instance Xperia Z3, the removal of DRM security keys may affect advanced camera functionality. For example, noise reduction algorithms might be removed, and performance when taking photos in low-light conditions might be affected. The secure user data partition may also become inaccessible, and you will not be able to get any more official software upgrades if you unlock the bootloader.

I'm not going to do this
[Sony Cross-Device General] munjeni:
Yes it was a case for old models, new models like mark 2 devices have "oem lock" possibility, with that all drm functionality is back except device unique key is forever deleted from booth trim area & rpmb which probably afect some functionality but I think not that dramatic like in old phone models, in most case it just voids waranty.
[Sony Cross-Device General] Pandemic:
Since the xperia 1/5 and up ^^
[Sony Cross-Device General] munjeni:
Excluding xperia 10. I remembered my unlocked xperia 10 and I learned a leason to not hurry to unlock bootloader before few peoples confirm it realy work.
[Sony Cross-Device General] creezy57:
how about Xperia 10 II? did somebody check?
[Sony Cross-Device General] Pandemic:
Dunno i have xperia 1
[Sony Cross-Device General] churchner420:
I tried flashing my 5 II with flashtool now but that is not working at all... Soooooo, back to newflasher but that is not working either for debranding or changing the region. Any solutions for that yet?
[Sony Cross-Device General] munjeni:
We are in a circle? Is there anything not explained allready for example this -> https://xdaforums.com/t/tool-newflasher-xperia-command-line-flasher.3619426/post-84453313 (firmware bug). There is no solution because vbmeta signature will bootloop your phone if you modify oem partition e.g. you change string. Do not expect anything in newflasher in relation to bug fix, its not newflasher isue and newflasher will stay as a flashing tool only, newflasher now and in futue will not be a tool for fixing firmare bugs, only a tool for flashing as simple as possible.

One question for everybody, does unlocking bootloader disable vbmeta protection?

And one more thing to tell you guys, I'm not in android hobby, and I do not test things frequently anymore, I'm not flashing anything for about two years, and I have less time for xda, but I have some time for newflasher, so please do not reguest a things from me to test something, you need to test and tell me! You need to figure out what is need, not me. Only thing I can do is to implement that what you figure out into newflasher. I not going to figure things buyself! And I don't own mark 2 device! So I can't test anything on mark 2 device, you need to test and figure. If you figure something important let me know and I will try to implement that into newflasher.
[Sony Cross-Device General] MrMmmkay:
With unlocked bootloader you can do this: " fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img "
[Sony Cross-Device General] munjeni:
Thats good to know! So solution to reset vbmeta index (bypass rollback protection) is to unlock bootloader than relock bootloader (relocking bootloader vbmeta index gets zeroed -> more info -> https://xdaforums.com/t/xperia-1-drm-keys-back-after-locking-the-bootloader.4079715/post-83035119 -> currently unconfirmed solution. Than probably we can flash old rom without getting bootloop. All this getting sense for me, e.g. when phone is fully locked (never unlocked) its under full security, rollback protected, vbmeta protected... etc, so to bypass all this only a way is to unlock bootloader. But unlocking bootloader and device unique key is bye bye forewer. Relocking bootloader and widevine and all keys getting back except device unique key which is forever deleted. I don't know whats going on when device is under waranty, probably waranty bye bye too.
[Sony Cross-Device General] suogreen:
can u help me?

signature:0000053c

Error, didn't got signature OKAY reply! Got reply: FAILFailed to verify cms
[Sony Cross-Device General] munjeni:
Full log?
[Sony Cross-Device General] swooc:
recently flashed my xperia 1 j9110 with newflasher. stock 55.2.A.0.630 nordic. no root. everything flashed ok, no errors iirc. not sure if its a rom , hardware or flash problem, but my phone had randomly factory resetted after a couple of days. i've flashed many xperias with flashtool and have never experienced such a thing.
[Sony Cross-Device General] munjeni:
And probably you skiped to flash userdata and some ta files?
[Sony Cross-Device General] swooc:
^i N'd every prompt on the command line and only removed simlock.ta in the firmware. i've always skipped .ta files in flashtool. but i read that they were no longer a problem anymore (and encouraged to add them in) so had included them except for simlock in the firmware dir for newflasher. i always flash userdata for a complete wipe when i do a firmware flash.

i'll be doing another flash sometime this week since there's a new firmware out. will keep a lookout this time for any errors during the flashing.
[Sony Cross-Device General] noahhhh:
I meet same error.
[Sony Cross-Device General] munjeni:
We have found some bugs recently in firmwares, see some this page and some bages back! Probably in most case there is more bugs in firmwares, I don't know, if you flashed all and didn't got any newflasher error it mean no newlfahser related.
[Sony Cross-Device General] swooc:
^fingers crossed.

thanks for making this flasher. i intially started off with flashtool but it wasn't working. found out new phones like the xperia 1 aren't supported. so off to google and ended up here.
[Sony Cross-Device General] Eddy25:
Hy everybody. I'm newbie here and i'm trying to flash my xperia XA2 H3113 using newflasher. Have already downloaded the correct firmware using xperifirm and created the "partition" folder with the "partitin.... .sin file in it. Before going ahead i have one problem : my phone is locked witch means i cannot enable ‘USB debugging’ nor ‘Unknown sources’ . Can i go ahead and try to flash it without theses parameters enabled? If no is there a solution ?
[Sony Cross-Device General] munjeni:
yes you can
[Sony Cross-Device General] Eddy25:
Thanks a lot for replying munjeni. Just to be sure : you mean i can go ahead without enabling "unknown sources" and "usb debugging" ?
[Sony Cross-Device General] Eddy25:
WAW . It worked flawlessly. You are a champion. Thanks again.
[Sony Cross-Device General] 1xz1c:
@munjeni or anybody, can you help me fill in my noob knowledge gaps for using Newflasher on Linux (Mint 20.1)? I downloaded the .zip from github, extracted to desktop, and then did:

`sudo apt-get install gcc libexpat-dev libz-dev make`

`git clone https://github.com/newflasher/newflasher.git ~/.local/share/newflasher`

`make -C ~/.local/share/newflasher`

`ln -s ~/.local/share/newflasher/newflasher ~/bin`

but I'm a little confused by this:

`make newflasher.[exe/x64/i386/arm32/arm64/arm64_pie]`

I take it to mean that I should do `make newflasher.x64` since I'm on Linux, right? (Still huge gaps in my Terminal experience.)

Then apparently I'm supposed to move "the executable" to the firmware folder I downloaded (for XZ1 Compact), but...I don't see an executable anywhere.

Please forgive my ignorance...
[Sony Cross-Device General] munjeni:
Your executable is inside folder ~/.local/share/newflasher e.g. /home/yourusername/.local/newflasher , and you have symlined executable to your bin folder e.g. /home/yourusername/bin , so what you need to do is to use path e.g. /home/yourusername/bin/newflasher while you are cd first to the firmware folder e.g:

cd /home/yourusername/Desktop/firmwarefolder

than call newflasher to start flashing:

/home/yourusername/bin/newflasher

Forget cross comilation for newflasher if you are not familiar with it, what you need to do is to just compile newlfasher folowing tutorial from newflasher git