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

bigrammy

Senior Member
Apr 8, 2011
2,882
2,511
193
huddersfield
Mediatek phones are not supported
Who says that?
It worked fine on my Sony L1 (MediaTek mt6737) I just didn't have the guts to try flash the "boot area" but for system, fotakernel, boot, oem, and userdata it worked without any issues.
@goku_0729
I guess MediaTek is supported but not fully tested at the moment. The instructions are not very clear on how to use the tool correctly although there is another forum with instruction and screenshots so I will try find that tut and update this post.

I found the excellent tut by @ch3mn3y although I do wish he would post it here as I am sure the OP would link to it. :fingers-crossed:
TUT link Below
TUT Here but in Polish Language so you will have to get google to translate it for you unless your Polish.
PS: My Sony L1 needed "noloader" option. Please proceed with caution as I said It's not FULLY tested as yet.




:fingers-crossed:
 
Last edited:

Sjll

Recognized Developer
Jun 4, 2017
375
381
63
Chongqing
Hey, I meet a problem.
My xperia x performance flashed xz's rom and lose bootloader.
If Xperia devices erase bootloader, it will be recognized as SOMC Flash Device, USB\VID_0FCE&PID_ADE0
But Xflahser will verify the hardware ID which is 0FCE:ADDE.
So I can't flash FTF via xflasher. Can you provide a version which support the hardware ID is 0FCE:ADE0 ?
Thanks !

Here is the xflasher.log:
Code:
-------------------------------------------------------
            Xperia Command Line Flasher v23            
                                                       
                 by Munjeni @ 2014,2017                     
-------------------------------------------------------
Device path: \\?\usb#vid_0fce&pid_ade0#8&2b31f014&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: 通用串行总线控制器
Device Instance Id: USB\VID_0FCE&PID_ADE0\8&2B31F014&0&2

ERROR: TIMEOUT: failed with error code 997 as follows:
重叠 I/O 操作在进行中。

-------------------------------------------------------
            Xperia Command Line Flasher v23            
                                                       
                 by Munjeni @ 2014,2017                     
-------------------------------------------------------

No usb device with vid:0x0fce pid:0xadde !
 

Attachments

Last edited:

bigrammy

Senior Member
Apr 8, 2011
2,882
2,511
193
huddersfield
Hey, I meet a problem.
My xperia x performance flashed xz's rom and lose bootloader.
If Xperia devices erase bootloader, it will be recognized as SOMC Flash Device, USB\VID_0FCE&PID_ADE0
No usb device with vid:0x0fce pid:0xadde
In the xflasher.sh or .bat change the vid: and pid: to match yours
I am not certain if it will work in that mode though. :confused:
 

bigrammy

Senior Member
Apr 8, 2011
2,882
2,511
193
huddersfield
Sony C4 MT6752

@munjeni

I get this error when trying to use xflasher with the C4 any Idea as to the cause?
It works well on my other MediaTek based devices. :confused:
Code:
-------------------------------------------------------
            Xperia Command Line Flasher v23            
                                                       
                 by Munjeni @ 2014,2017                     
-------------------------------------------------------
found device with vid:0x0fce pid:0xadde.
 - Successfully read 0xd bytes from handle.
Raw input [0xD]:

  00000000  00 00 00 00 00 00 00 00 00 00 00 00 00           .............

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

  00000000  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000000A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000000B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000000C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000000D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000000E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000000F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000100  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000110  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000130  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000150  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000180  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000190  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000001A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000001B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000001C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000001D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000001E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000001F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000200  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000210  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000220  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000230  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000240  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000250  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000260  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000270  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000280  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000290  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000002A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000002B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000002C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000002D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000002E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  000002F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000300  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000310  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000320  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000330  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000340  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000350  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000360  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000370  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000380  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  00000390  00 00 00 00 00 00 00 00                          ........

 - (ep_in) ERROR: n = -1, errno = 71 (Protocol error)
 

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Have no idea realy, try with diferent loader.sin, to be honest I lost xflasher source code, its on another hard disk and Iforgot where it is.
 
  • Like
Reactions: bigrammy

bigrammy

Senior Member
Apr 8, 2011
2,882
2,511
193
huddersfield
Have no idea realy, try with diferent loader.sin, to be honest I lost xflasher source code, its on another hard disk and Iforgot where it is.
That's a shame it's my go to flashing tool now. :(
FlashTool seemed to work just fine but I think that uses fsc to flash. :confused:
Does it have to be device specific or could I use one from the Sony XA (MT6755) which I knows works fine with xflasher.
I will experiment and see what I can come up with.
I still have not picked up the courage to flash the boot delivery yet as this is what bricked the C4 and C5's using FlashTool but I think the cause of that is the full set of TEST.sin in the boot folder. :confused:
I noticed on the Sony XA, L1 and XA1 (all mediatek) these Test.sin are not there so I wondered if FlashTool flashed these instead of the Signed.sin's
Code:
[COLOR="Red"]lk_S1-BOOT-TEST-B316-0001-MMC.sin
logo_S1-SW-TEST-B316-0001-MMC.sin
preloader_s1sbl_S1-BOOT-TEST-B316-0001-MMC.sin
secro_S1-SW-TEST-B316-0001-MMC.sin
tee1_S1-SW-TEST-B316-0001-MMC.sin
tee2_S1-SW-TEST-B316-0001-MMC.sin[/COLOR]
[COLOR="Blue"]lk-sign-signed_S1-BOOT-LIVE-4154-0004-MMC.sin
logo-sign-signed_S1-SW-LIVE-4154-PID1-0005-MMC.sin
preloader_s1sbl_PLATFORM-MT6752-LIVE-95CE-OEM1-ROOT_S1-BOOT-LIVE-4154-0004-MMC.sin
secro-sign-signed_S1-SW-LIVE-4154-PID1-0005-MMC.sin
tee1_PLATFORM-MT6752-LIVE-95CE-OEM1-TEEIMG__S1-SW-LIVE-4154-PID1-0005-MMC.sin
tee2_PLATFORM-MT6752-LIVE-95CE-OEM1-TEEIMG__S1-SW-LIVE-4154-PID1-0005-MMC.sin[/COLOR]
 

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Don't use sin files from diferent device, never do that, it might hard brick your device. Anyway it not going to work since all sin files is signed by "model key", model key mean key is diverent for every diferent device model. I realy can't tell you why your log have 0x00, whole with that, might be permission isue on your PC? Try run xflasher as admin and try temporary disable your firewall/antivirus
 
Last edited:
  • Like
Reactions: bigrammy

bigrammy

Senior Member
Apr 8, 2011
2,882
2,511
193
huddersfield
Don't use sin files from diferent device, never do that, it might hard brick your device. Anyway it not going to work since all sin files is signed by "model key", model key mean key is diverent for every diferent device model. I realy can't tell you why your log have 0x00, whole with that, might be permission isue on your PC? Try run xflasher as admin and try temporary disable your firewall/antivirus
Thanks munjeni.
I won't use any other .sin files. :D
As for permissions I am on Linux and I need to use sudo to run xflasher for flashing on my other devices and it works great but the C4 just does not seem to respond after the initial connection and read. It says something like - (ep_in) ERROR: n = -1, errno = 1001 (device took too long to respond) I can't remember the exact errno or I get the error I posted above. :eek:
I tried various usb cables and ports but still get the same results.
If I figure it out I will let you know but it could be the loader.sin that's at fault like you said. :highfive:

BTW Do you know how to decode Sony OTA's (update_package) either on or off device?
 
Last edited:

bigrammy

Senior Member
Apr 8, 2011
2,882
2,511
193
huddersfield
I was interesting to decode ota but ended without done that, it was some years back, now I have no free time for that :)
Ok no problem just wondered if there was anything out there that I may have not found or overlooked.
A lot of devices seem to use encrypted ota's now but Sony seem to have been using them for a long time as the ota I would like to decrypt is for Android 5.1
I will have a look through the fotakernel and see if I can spot anything obvious in there that deals with de-encryption. :fingers-crossed:
 

Jane11

Member
Jul 5, 2013
20
0
1
Xflasher.bat says
:::upload loader.sin (please change this to loader.sin in case your device uses loader.sin)
::: (please change to noloader in case your device don't use loader! )
but how can I know that my device (Sony xperia X compact ) uses loader.sin or not?
 

Da9L

Senior Member
Jan 31, 2007
1,029
24
0
32
I see that with this tool, the bat file created in my case refers to simlock.ta, and I've read elsewhere that this should be excluded. What to do ?

EDIT : Went ahead and flashed my Z2 Tablet using your tool here. Everything went smooth during the process, but the tablet seems to now bootloop. I get a Sony logo, followed by an Android logo, and then some blue waves (standard boot loading animation). Just before the device reboots my PC recognizes the device as "Xperia Z2 Tablet Wifi"..
 
Last edited:

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Im unsure if this old tool have auto exclude for simlock as newflasher does, but for your phone safety remove simlock.ta just for make sure it not get flashed, hope this help
 

Da9L

Senior Member
Jan 31, 2007
1,029
24
0
32
Im unsure if this old tool have auto exclude for simlock as newflasher does, but for your phone safety remove simlock.ta just for make sure it not get flashed, hope this help
Thanks for your assistance! I've now let the device reboot a few times and now it makes it to the first welcome screen, but as soon as I touch the Get started button on screen or the language selection drop down the device reboots. Might have something to do with the firmware i downloaded, so i will try to get another one with XperiFirm tool