[TOOL] Xflasher (xperia command line flasher for pre 2017 devices)

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Thank you for your work!
Thank you for your tests and support! We have communication success with newer device, great! I have wrote version 8, it now detects max packet size, some improvements and cleanups, tool can handle one line arguments (but allso multiple line arguments is suported too), in general it probably will work on newer device (need somebody test).

Can you write cache.sin just for test? Use one line argument like (first line is need):
Code:
xflasher    noloader   0  0  0FCE   ADDE  0  0  >xflasher.log
xflasher    cache.sin  0  0  0FCE   ADDE  0  0  >>xflasher.log
 
  • Like
Reactions: dr4go and fluffi444

TexHuk 3

Senior Member
Mar 14, 2016
96
83
0
Yuzhnouralsk
Can you write cache.sin just for test?
Code:
 Xperia Command Line Flasher               
                                                       
                 by Munjeni @ 2014                     
-------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_adde#5&ecb7860&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: Контроллеры USB
Device Instance Id: USB\VID_0FCE&PID_ADDE\5&ECB7860&0&1

Error: unable to open cache.sin!
Error uploading cache.sin!
 
  • Like
Reactions: munjeni

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Code:
 Xperia Command Line Flasher               
                                                       
                 by Munjeni @ 2014                     
-------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_adde#5&ecb7860&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: Контроллеры USB
Device Instance Id: USB\VID_0FCE&PID_ADDE\5&ECB7860&0&1

Error: unable to open cache.sin!
Error uploading cache.sin!
You must put cahe_BLABLxxxxxx.sin which you can extract from an ftf of the your device model and rename to cache.sin and put in the same folder with xflasher! I have reuploaded v8 because forgot to change one line, please redownload v8
 
Last edited:
  • Like
Reactions: TexHuk 3

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Seems ok! cache.sin uploaded sucessfully. What happened when you got timeout?

Edit:
You have only one chance to run xflasher.bat, newer run it twice because of the first command line "noloader or loader.sin" can be run only one time, seccond line and all other lines can run many times!! See README file! In general seems xflasher is ready for newer devices. Seems that timeout happened because you run seccond time that xflasher.bat which produced timeout because noloader parameter is run seccond time. Remember, noloader parameter or loader.sin parameter can be called one time only per "reboot to bootloader" session! Thanks for your time for tests!
 
Last edited:

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
V9 is out! I didn't done scripts for xflasher with one reason - got better idea :) Just use xperifirm to download firmware, than simple put xflasher.exe in the same dir with downloaded and unpacked firmware, double click xflasher.exe it will gnerate xflasher.bat file, if you no want to flash everything modify xflasher.bat for your needs, when you done put your device into flashing mode (remember flashing mode is not fastboot mode! Flashing mode is power+volume down key!), double click xflasher.bat and wait until xflasher flash firmware, done! Enjoy!
 

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
Last edited:
  • Like
Reactions: munjeni

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
---------- Post added at 06:28 PM ---------- Previous post was at 05:39 PM ----------

[/COLOR] @munjeni
Problems with z5 (64 bit device)
https://pastebin.com/7VMmHHfX
Running Windows 7 x64, loader.sin included
Hi thanks! Seems I need to increase global timeout like one for last packet e.g. when device verifies system.sin when that system.sin verification takes minute-two, for system.sin I have set 3 minutes max but seems I realy need to make it for everything at least to 30 sec max since 5 sec seems not enought :(

New version is out!
 
  • Like
Reactions: dr4go

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
Hi thanks! Seems I need to increase global timeout like one for last packet e.g. when device verifies system.sin when that system.sin verification takes minute-two, for system.sin I have set 3 minutes max but seems I realy need to make it for everything at least to 30 sec max since 5 sec seems not enought :(

New version is out!
Cache flashed ok but still a problem with system
Code:
**snip**
Writing crc32 for chunk part: 30
Successfully write 0x4 bytes to handle.
Successfully read 0xd bytes from handle.
Raw input [0xD]:

  00000000  00 00 00 06 00 00 00 01 00 00 00 00 0E           .............

Verifying crc32...
Success: device replied with 0000000600000001000000000E which mean ok.

Successfully read 0x4 bytes from handle.
Raw input [0x4]:

  00000000  00 00 00 00                                      ....

Sending command...
Raw command[0xD]:

  00000000  00 00 00 06 00 00 00 07 00 08 00 00 10           .............

Timeout happened!
Error writing command CMD_WRITE_SIN!
Error uploading system.sin!
 
  • Like
Reactions: munjeni and dr4go

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Cache flashed ok but still a problem with system
Code:
**snip**
Writing crc32 for chunk part: 30
Successfully write 0x4 bytes to handle.
Successfully read 0xd bytes from handle.
Raw input [0xD]:

  00000000  00 00 00 06 00 00 00 01 00 00 00 00 0E           .............

Verifying crc32...
Success: device replied with 0000000600000001000000000E which mean ok.

Successfully read 0x4 bytes from handle.
Raw input [0x4]:

  00000000  00 00 00 00                                      ....

Sending command...
Raw command[0xD]:

  00000000  00 00 00 06 00 00 00 07 00 08 00 00 10           .............

Timeout happened!
Error writing command CMD_WRITE_SIN!
Error uploading system.sin!
Thank you, this realy help! Diferencie between z5 and my z1c is double size of the system.sin which is on z5 a lot bigger than z1c, so definitelly timeout must be increased a lot for newer devices :( Ok, it was 5 min now I set 10 min max, I have improved tool a bit, hope now everything ok, new version is out!
 
Last edited:
  • Like
Reactions: dr4go and shoey63

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
Thank you, this realy help! Diferencie between z5 and my z1c is double size of the system.sin which is on z5 a lot bigger than z1c, so definitelly timeout must be increased a lot for newer devices :( Ok, it was 5 min now I set 10 min max, I have improved tool a bit, hope now everything ok, new version is out!
Froze and exited after several minutes. No dialog in command window either
here is bat file and log entrieshttps://pastebin.com/xAX7CEZK
 
  • Like
Reactions: munjeni

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
Thanks! But I didn't see any error and also no timeouts now! Did it succesfully flashed? Or you interupted it?
It just stopped at where the log ends for a long time then the command window vanished. I'll try again with system only.
Edit: Let it go for 10 minutes and it quit by itself with the usual message https://pastebin.com/hKbzLJ8T @munjeni Time to format and restore my corrupted /system partition again!
 
Last edited:
  • Like
Reactions: dr4go and munjeni

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
It just stopped at where the log ends for a long time then the command window vanished. I'll try again with system only.
Edit: Let it go for 10 minutes and it quit by itself with the usual message https://pastebin.com/hKbzLJ8T @munjeni Time to format and restore my corrupted /system partition again!
Hey thanks a lot! Have no idea why device didn't sends reaply and cause timeout but I will research in next few days for timeout replace, I have missing something definitelly. Are you sure your usb cable is ok? Or maybe you moved phone which cause usb disconnection?
 

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
Hey thanks a lot! Have no idea why device didn't sends reaply and cause timeout but I will research in next few days for timeout replace, I have missing something definitelly. Are you sure your usb cable is ok? Or maybe you moved phone which cause usb disconnection?
Used a different cable and left the phone still until command window vanished, then had a look at the log. In next day or two I will time how long FlashTool takes to flash system.sin for comparison purposes.
 
  • Like
Reactions: munjeni

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Used a different cable and left the phone still until command window vanished, then had a look at the log. In next day or two I will time how long FlashTool takes to flash system.sin for comparison purposes.
Ok it will help for sure. Curently I have implemented asynchronous usb bulk read/write, curently have used things based on timeouts, but probably I will need to look for error codes to see whats going on, probably I will somehow need to integrate more things into usb handle without need for using timeouts it will give xflasher better usb handling probably, when I get free brain and more free time I will try make that better, still have no idea why your z5 gets timeouts :( Appreciate your help!