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

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Will get back to you later. I unlocked the bootloader again before checking for soft brick. LB is too much hard work ?
Edit: How do you unlock/ relock bootloader with xflasher?
Simple put your unlock key like this e.g:

Code:
xflasher.exe  noloader  0  [COLOR="Red"]AABBCCDDEEFFGGHH[/COLOR]  0FCE  ADDE  0  0
Tool will check everything possible to check if key is valid, only if key is valid tool will unlock bootloader without userdata wipe. You can try on z5 since we need to fix tool a bit for newer device which use noloader (because maybe something will go wrong like thing happened for your kernel.sin :(), curently have no idea why failed on kernel.sin, need to see somebody flashtool debug log to get idea :(
 
Last edited:
  • Like
Reactions: shoey63

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Great! It works. Only what I will need... can you please, when you get free time, give me flashtool debug log by flashing that kernel which failed on xflasher?
 

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
OK, retested on X Nougat.
Here is FlashTool DEBUG log for kernel.sin
https://pastebin.com/fpcTZC0w
Here is Xflasher v19 log for kernel.sin
https://pastebin.com/Y56Km3hh
There is NO bootloop or soft brick after failed kernel.sin flash by Xflasher!
I am realy expected that, thank you a lot! Version 20 I think will be fully working, just need to modify tool a bit for that case of the noloader and that last packet thing, it will work I think finaly!
 
  • Like
Reactions: shoey63

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
v20 is out, hope final one :) Added arm pie and without pie (note: pie is not a real pie, hex modified one just to satisfy some android warnings e.g "only platform independent version can run on this machine", just modified 17th byte, changed 0x02 to 0x03 to satisfy that warning on newer androids, in case it didn't run on you android please try non pie version, but I am pretty sure pie will run).
 
Last edited:

shoey63

Recognized Contributor
Jun 5, 2012
4,003
3,982
253
Somewhere in Oz...
v20 is out, hope final one :) Added arm pie and without pie (note: pie is not a real pie, hex modified one just to satisfy some android warnings e.g "only platform independent version can run on this machine", just modified 17th byte, changed 0x02 to 0x03 to satisfy that warning on newer androids, in case it didn't run on you android please try non pie version, but I am pretty sure pie will run).
Kernel and cache successfully flashed! (xflasher.x64)
Edit: Flashed everything except FOTAKernel and userdata. 100% success:good:
Log attached as a matter of interest http://pasted.co/6d6102e5
Great job! No more FlashTool for me;)
Edit: You are right FSC scripts are BS:D
 
Last edited:

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Kernel and cache successfully flashed! (xflasher.x64)
Edit: Flashed everything except FOTAKernel and userdata. 100% success:good:
Log attached as a matter of interest http://pasted.co/6d6102e5
Great job! No more FlashTool for me;)
Edit: You are right FSC scripts are BS:D
Thank you a lot for your time testing xflasher! Now it is complete and hope very easy for use. Enjoy! :good:
 
Last edited:

tanipat

Senior Member
Nov 22, 2011
275
80
0
trying to flash this according to instruction to flash my xz premium. but got empty log file and nothing done. please correct me if i am wrong

1. downloaed firmware from xperifirm as rar file
2. put xflasher.exe to the same directory of firmware rar file
3. click xflasher.exe to create .bat
4. click . bat and i got empty log and nothing done
i also try to extract it and put xflasher.exe to firmware folder still no go. what have i done wrong? thanks for help
 
  • Like
Reactions: munjeni

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Linux or Windows version? If you are on Linux probably you must run tool as a root. Xperifirm do not produce rar file as I know, it creates firmware folder which contain e.g. system.sin, userdata.sin boot folder with boot delivery .ta files and .sin files... I can help you but please give more details

Edit:
This is xperifirm tool https://forum.xda-developers.com/cr...xperifirm-xperia-firmware-downloader-t2834142 , use it to download firmware for your device, when firmware gets downloaded you will see firmware folder e.g. G8231_Commercial and Journalists_1307-1644_41.2.A.0.191_R1D , you need to put xflasher in that downloaded firmware folder! Please ask everything, I will try to help better :)
 
Last edited:

tanipat

Senior Member
Nov 22, 2011
275
80
0
Linux or Windows version? If you are on Linux probably you must run tool as a root. Xperifirm do not produce rar file as I know, it creates firmware folder which contain e.g. system.sin, userdata.sin boot folder with boot delivery .ta files and .sin files... I can help you but please give more details

Edit:
This is xperifirm tool https://forum.xda-developers.com/cr...xperifirm-xperia-firmware-downloader-t2834142 , use it to download firmware for your device, when firmware gets downloaded you will see firmware folder e.g. G8231_Commercial and Journalists_1307-1644_41.2.A.0.191_R1D , you need to put xflasher in that downloaded firmware folder! Please ask everything, I will try to help better :)
i use windows version, i downloaded G8142_ Customized_TH_1309-2178_45.0.A.1.229_R3A. then i downloaded xflasher.zip and extracted it. then i put xflasher.exe to the firmware folder, i double click it then it create xflasher.bat. i put device in to flashmode and double click xflasher.bat still it just create me the empty log and it do not flash anything. is it because i missing on some driver? i did install xperia companion and my device shows normally, i use flashtools drivers to install flashmode and fastboot driver already. the problem i think it is weird is volume down and connected phone for this device bring me the mode with greed led (should be blue if i have no mistaken), but the volume up will boot with blue led. anyhow try boot mode to flash also get same result.

Please correct me if i am wrong in any step do i need to put all files from xflasher.zip to firmware folder? or i missing on some drivers?
 

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
You just need single .exe and flashtool driver, nothing more. But how is possible that xflasher log is empty? It must contain some text, e.g. "no device with vid pid...". Can you post your log?
 

tanipat

Senior Member
Nov 22, 2011
275
80
0
You just need single .exe and flashtool driver, nothing more. But how is possible that xflasher log is empty? It must contain some text, e.g. "no device with vid pid...". Can you post your log?
it just create log with nothing inside at all. seems nothing done on process at all. so i think it should be something wrong here, i do not know is it because of my device is not support or not

---------- Post added at 02:02 PM ---------- Previous post was at 01:47 PM ----------

@munjeni below is xflasher.bat and attached photos http://imgur.com/a/6gFEw my phone and pc shows the firmware downloaded and xflasher after I done everything you can see the log on the right hand side, please see if I done things wrong? thank you very much for your help
@Setlocal enableextensions enabledelayedexpansion

:::NOTE:
::: first command must write loader to the device! Or in case newer sony device which doesn't have loader
::: first parameter must be noloader instead of loader.sin!
::: All next commands set argument 0 as a loader since loader or noloader is need only in first command!
::: Next command in this example make s1 dump to file called tadump.ta.
:::
::: Remember, loader or noloader must be first parameter and no more than one time, and must be first parameter!
::: 0 mean skip command from table!
::: unlock bootloader parameter is 0 for skip unlocking, or unlock bootloader KEY for unlocking!
::: dump ta parameter 0 is for skip s1 dumping, or 1 for dumping s1, dump will be stored in file caled tadump.ta
::: Enjoy tool!
:::
:::Table of commands with example steps for using xflasher tool:
:::-----------------------------------------------------------------------------------------------------------------------------------------------------
:::xflasher | send loader? | dump ta? | unlock bootloader? KEY | USB_VID | USB_PID | FLASH BOOT DELIVERY? | flash ta file? | write log to file
:::-----------------------------------------------------------------------------------------------------------------------------------------------------

:::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! )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe noloader 0 0 0FCE ADDE 0 0 >xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )

:::flash sin files
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe adspso_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe amss_fsg_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe amss_fs_1_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe amss_fs_2_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe appslog_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe bluetooth_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe cache_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe diag_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe elabel-G8142-row-row_201705190523696.1_45.0.A.1.229_X-FLASH-LTALABEL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe fotakernel_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe kernel_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe modem_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe oem_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe persist_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe Qnovo_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe ramdump_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe ssd_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe system_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe userdata_X-FLASH-ALL-42E5.sin 0 0 0FCE ADDE 0 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )

:::flash ta files
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 auto-boot.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 cust-reset.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 fota-reset.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 master-reset.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 osv-restriction.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 reset-kernel-cmd-debug.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 reset-non-secure-adb.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 reset-wipe-reason.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 0 simlock.ta >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )

:::flash boot delivery
C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe 0 0 0 0FCE ADDE 1 0 >>xflasher.log & if %ERRORLEVEL% neq 0 ( exit %ERRORLEVEL% )
 
  • Like
Reactions: munjeni

munjeni

Senior Member
Jun 2, 2011
9,019
21,774
263
Thanks a lot! I forgot an very banal thing aka "" so for example if folder contain space like:

C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe

will produce excatly the same bug, omg. It must be like this:

"C:\Users\TANI SB PB 1TB\Desktop\G8142_Customized TH_1309-2178_45.0.A.1.229_R3A\xflasher.exe"

Please wait v21, going to make new version right now and it will work for sure!