General 📌 [Shared] TWRP by skkk

Search This thread

NOSS8

Recognized Contributor
This is exactly what Miflash does with the bat file which can be directly executed without Miflash, why bother typing command lines.
The twrp can also with a recovery rom.
https://forum.xda-developers.com/t/flash-tool-guide-use-xiaomi-flash-tool.4262425/
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *zeus" || echo Missmatching image and device
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *zeus" || exit /B 1

::check anti_version
if exist "%~dp0images\anti_version.txt" (for /f "usebackq" %%a in ("%~dp0images\anti_version.txt") do (set CURRENT_ANTI_VER=%%a))
if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
if [%version%] EQU [] set version=0
set anticheck="antirollback check pass"
if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
echo %anticheck% | findstr /r /c:"pass" || @ECHO "Antirollback check error" && exit /B 1

fastboot %* getvar crc 2>&1 | findstr /r /c:"^crc: 1" && if %errorlevel% equ 0 (
fastboot %* flash crclist %~dp0images\crclist.txt || @ECHO "Flash crclist error" && exit /B 1
fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @ECHO "Flash sparsecrclist error" && exit /B 1
)

fastboot %* erase boot_ab || @ECHO "Erase boot error" && exit /B 1
fastboot %* erase opconfig || @ECHO "Erase opconfig error" && exit /B 1
fastboot %* erase opcust || @ECHO "Erase opcust error" && exit /B 1
fastboot %* flash abl_ab %~dp0images/abl.elf || @ECHO "Flash abl error" && exit 1
fastboot %* flash xbl_ab %~dp0images/xbl_s.melf || @ECHO "Flash xbl error" && exit 1
fastboot %* flash xbl_config_ab %~dp0images/xbl_config.elf || @ECHO "Flash xbl_config error" && exit 1
fastboot %* flash shrm_ab %~dp0images/shrm.elf || @ECHO "Flash shrm error" && exit 1
fastboot %* flash aop_ab %~dp0images/aop.mbn || @ECHO "Flash aop error" && exit 1
fastboot %* flash aop_config_ab %~dp0images/aop_devcfg.mbn || @ECHO "Flash aop_config error" && exit 1
fastboot %* flash tz_ab %~dp0images/tz.mbn || @ECHO "Flash tz error" && exit 1
fastboot %* flash devcfg_ab %~dp0images/devcfg.mbn || @ECHO "Flash devcfg error" && exit 1
fastboot %* flash featenabler_ab %~dp0images/featenabler.mbn || @ECHO "Flash featenabler error" && exit 1
fastboot %* flash hyp_ab %~dp0images/hypvmperformance.mbn || @ECHO "Flash hyp error" && exit 1
fastboot %* flash uefi_ab %~dp0images/uefi.elf || @ECHO "Flash uefi error" && exit 1
fastboot %* flash uefisecapp_ab %~dp0images/uefi_sec.mbn || @ECHO "Flash uefisecapp error" && exit 1
fastboot %* flash modem_ab %~dp0images/NON-HLOS.bin || @ECHO "Flash modem error" && exit 1
fastboot %* flash bluetooth_ab %~dp0images/BTFM.bin || @ECHO "Flash bluetooth error" && exit 1
fastboot %* flash dsp_ab %~dp0images/dspso.bin || @ECHO "Flash dsp error" && exit 1
fastboot %* flash keymaster_ab %~dp0images/keymint.mbn || @ECHO "Flash keymaster error" && exit 1
fastboot %* flash qupfw_ab %~dp0images/qupv3fw.elf || @ECHO "Flash qupfw error" && exit 1
fastboot %* flash multiimgoem_ab %~dp0images/multi_image.mbn || @ECHO "Flash multiimgoem error" && exit 1
fastboot %* flash multiimgqti_ab %~dp0images/multi_image_qti.mbn || @ECHO "Flash multiimgqti error" && exit 1
fastboot %* flash cpucp_ab %~dp0images/cpucp.elf || @ECHO "Flash cpucp error" && exit 1
fastboot %* flash rtice %~dp0images\rtice.mbn || @ECHO "Flash rtice error" && exit /B 1
fastboot %* flash logfs %~dp0images/logfs_ufs_8mb.bin || @ECHO "Flash logfs error" && exit 1
fastboot %* flash rescue %~dp0images/rescue.img || @ECHO "Flash rescue error" && exit 1
fastboot %* flash storsec %~dp0images/storsec.mbn || @ECHO "Flash storsec error" && exit 1
fastboot %* flash toolsfv %~dp0images/tools.fv || @ECHO "Flash toolsfv error" && exit 1
fastboot %* flash xbl_ramdump_ab %~dp0images/XblRamdump.elf || @ECHO "Flash xbl_ramdump error" && exit 1
fastboot %* erase imagefv_ab || @ECHO "Erase imagefv error" && exit /B 1
fastboot %* flash imagefv_ab %~dp0images/imagefv.elf || @ECHO "Flash imagefv error" && exit 1
fastboot %* flash super %~dp0images/super.img || @ECHO "Flash super error" && exit 1
fastboot %* flash vendor_boot_ab %~dp0images/vendor_boot.img || @ECHO "Flash vendor_boot error" && exit 1
fastboot %* flash dtbo_ab %~dp0images/dtbo.img || @ECHO "Flash dtbo error" && exit 1
fastboot %* flash vbmeta_ab %~dp0images/vbmeta.img || @ECHO "Flash vbmeta error" && exit 1
fastboot %* flash vbmeta_system_ab %~dp0images/vbmeta_system.img || @ECHO "Flash vbmeta_system error" && exit 1
fastboot %* erase metadata || @ECHO "Erase metadata error" && exit 1
fastboot %* flash metadata %~dp0images/metadata.img || @ECHO "Flash metadata error" && exit 1
fastboot %* flash userdata %~dp0images/userdata.img || @ECHO "Flash userdata error" && exit 1
fastboot %* flash vm-bootsys_ab %~dp0images/vm-bootsys.img || @ECHO "Flash vm-bootsys error" && exit 1
fastboot %* flash cust %~dp0images/cust.img || @ECHO "Flash cust error" && exit 1
fastboot %* flash recovery_ab %~dp0images/recovery.img || @ECHO "Flash recovery error" && exit 1
fastboot %* flash boot_ab %~dp0images/boot.img || @ECHO "Flash boot error" && exit 1
fastboot %* flash misc %~dp0images\misc.img || @ECHO "Flash misc error" && exit /B 1
fastboot %* set_active a || @ECHO "Set active a error" && exit 1
fastboot %* reboot || @ECHO "Reboot error" && exit 1

 

pipa1989

Member
Apr 24, 2017
34
1
This is exactly what Miflash does with the bat file which can be directly executed without Miflash, why bother typing command lines.
The twrp can also with a recovery rom.
https://forum.xda-developers.com/t/flash-tool-guide-use-xiaomi-flash-tool.4262425/
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *zeus" || echo Missmatching image and device
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *zeus" || exit /B 1

::check anti_version
if exist "%~dp0images\anti_version.txt" (for /f "usebackq" %%a in ("%~dp0images\anti_version.txt") do (set CURRENT_ANTI_VER=%%a))
if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
if [%version%] EQU [] set version=0
set anticheck="antirollback check pass"
if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
echo %anticheck% | findstr /r /c:"pass" || @ECHO "Antirollback check error" && exit /B 1

fastboot %* getvar crc 2>&1 | findstr /r /c:"^crc: 1" && if %errorlevel% equ 0 (
fastboot %* flash crclist %~dp0images\crclist.txt || @ECHO "Flash crclist error" && exit /B 1
fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @ECHO "Flash sparsecrclist error" && exit /B 1
)

fastboot %* erase boot_ab || @ECHO "Erase boot error" && exit /B 1
fastboot %* erase opconfig || @ECHO "Erase opconfig error" && exit /B 1
fastboot %* erase opcust || @ECHO "Erase opcust error" && exit /B 1
fastboot %* flash abl_ab %~dp0images/abl.elf || @ECHO "Flash abl error" && exit 1
fastboot %* flash xbl_ab %~dp0images/xbl_s.melf || @ECHO "Flash xbl error" && exit 1
fastboot %* flash xbl_config_ab %~dp0images/xbl_config.elf || @ECHO "Flash xbl_config error" && exit 1
fastboot %* flash shrm_ab %~dp0images/shrm.elf || @ECHO "Flash shrm error" && exit 1
fastboot %* flash aop_ab %~dp0images/aop.mbn || @ECHO "Flash aop error" && exit 1
fastboot %* flash aop_config_ab %~dp0images/aop_devcfg.mbn || @ECHO "Flash aop_config error" && exit 1
fastboot %* flash tz_ab %~dp0images/tz.mbn || @ECHO "Flash tz error" && exit 1
fastboot %* flash devcfg_ab %~dp0images/devcfg.mbn || @ECHO "Flash devcfg error" && exit 1
fastboot %* flash featenabler_ab %~dp0images/featenabler.mbn || @ECHO "Flash featenabler error" && exit 1
fastboot %* flash hyp_ab %~dp0images/hypvmperformance.mbn || @ECHO "Flash hyp error" && exit 1
fastboot %* flash uefi_ab %~dp0images/uefi.elf || @ECHO "Flash uefi error" && exit 1
fastboot %* flash uefisecapp_ab %~dp0images/uefi_sec.mbn || @ECHO "Flash uefisecapp error" && exit 1
fastboot %* flash modem_ab %~dp0images/NON-HLOS.bin || @ECHO "Flash modem error" && exit 1
fastboot %* flash bluetooth_ab %~dp0images/BTFM.bin || @ECHO "Flash bluetooth error" && exit 1
fastboot %* flash dsp_ab %~dp0images/dspso.bin || @ECHO "Flash dsp error" && exit 1
fastboot %* flash keymaster_ab %~dp0images/keymint.mbn || @ECHO "Flash keymaster error" && exit 1
fastboot %* flash qupfw_ab %~dp0images/qupv3fw.elf || @ECHO "Flash qupfw error" && exit 1
fastboot %* flash multiimgoem_ab %~dp0images/multi_image.mbn || @ECHO "Flash multiimgoem error" && exit 1
fastboot %* flash multiimgqti_ab %~dp0images/multi_image_qti.mbn || @ECHO "Flash multiimgqti error" && exit 1
fastboot %* flash cpucp_ab %~dp0images/cpucp.elf || @ECHO "Flash cpucp error" && exit 1
fastboot %* flash rtice %~dp0images\rtice.mbn || @ECHO "Flash rtice error" && exit /B 1
fastboot %* flash logfs %~dp0images/logfs_ufs_8mb.bin || @ECHO "Flash logfs error" && exit 1
fastboot %* flash rescue %~dp0images/rescue.img || @ECHO "Flash rescue error" && exit 1
fastboot %* flash storsec %~dp0images/storsec.mbn || @ECHO "Flash storsec error" && exit 1
fastboot %* flash toolsfv %~dp0images/tools.fv || @ECHO "Flash toolsfv error" && exit 1
fastboot %* flash xbl_ramdump_ab %~dp0images/XblRamdump.elf || @ECHO "Flash xbl_ramdump error" && exit 1
fastboot %* erase imagefv_ab || @ECHO "Erase imagefv error" && exit /B 1
fastboot %* flash imagefv_ab %~dp0images/imagefv.elf || @ECHO "Flash imagefv error" && exit 1
fastboot %* flash super %~dp0images/super.img || @ECHO "Flash super error" && exit 1
fastboot %* flash vendor_boot_ab %~dp0images/vendor_boot.img || @ECHO "Flash vendor_boot error" && exit 1
fastboot %* flash dtbo_ab %~dp0images/dtbo.img || @ECHO "Flash dtbo error" && exit 1
fastboot %* flash vbmeta_ab %~dp0images/vbmeta.img || @ECHO "Flash vbmeta error" && exit 1
fastboot %* flash vbmeta_system_ab %~dp0images/vbmeta_system.img || @ECHO "Flash vbmeta_system error" && exit 1
fastboot %* erase metadata || @ECHO "Erase metadata error" && exit 1
fastboot %* flash metadata %~dp0images/metadata.img || @ECHO "Flash metadata error" && exit 1
fastboot %* flash userdata %~dp0images/userdata.img || @ECHO "Flash userdata error" && exit 1
fastboot %* flash vm-bootsys_ab %~dp0images/vm-bootsys.img || @ECHO "Flash vm-bootsys error" && exit 1
fastboot %* flash cust %~dp0images/cust.img || @ECHO "Flash cust error" && exit 1
fastboot %* flash recovery_ab %~dp0images/recovery.img || @ECHO "Flash recovery error" && exit 1
fastboot %* flash boot_ab %~dp0images/boot.img || @ECHO "Flash boot error" && exit 1
fastboot %* flash misc %~dp0images\misc.img || @ECHO "Flash misc error" && exit /B 1
fastboot %* set_active a || @ECHO "Set active a error" && exit 1
fastboot %* reboot || @ECHO "Reboot error" && exit 1

Because it didn't work for me any other way than that. Neither my flash nor any strange story worked for me, just putting the commands one by one, I don't know why but it worked for me.
 
  • Like
Reactions: NOSS8

NOSS8

Recognized Contributor
Because it didn't work for me any other way than that. Neither my flash nor any strange story worked for me, just putting the commands one by one, I don't know why but it worked for me.
In general Miflash displays the error ,sometimes you have to edit the script but often it comes from the drivers, path, cable, version of Miflash.
Typing fifty commands increases the risk of error.
 
  • Like
Reactions: pipa1989

farmz_inc

Senior Member
Aug 19, 2016
61
7
If already on A13 with no TWRP, will the BOOT version V.5.1 A12 work from fastboot or do I need an A13 boot version? thanks
 

NOSS8

Recognized Contributor
Xiaomi 12 Pro Global 2022-08-15 | Stable Beta Recovery | V13.0.4.0.TLBMIXM

to

Xiaomi 12 Pro EEA Global_V13.2.4.0.TLBEUXM_ae529519f1_13.0
Just a question regarding 13.0.4.0 TLBMIXM is mobile data working? I tested it yesterday and with the sim card, the phone reboots nonstop.

I flashed the A13 version with the latest TWRP A12 but I had to format the data several times.
Try directly with the TWRP A13.
Start by removing the security on the lock screen and restart the system then flash the TWRP in Fastboot mode with:
./fastboot flash recovery_ab twrp.img(powershell)
fastboot flash recovery_ab twrp.img(cmd)
reboot on the twrp with the combination of buttons not with a command.
 

farmz_inc

Senior Member
Aug 19, 2016
61
7
Just a question regarding 13.0.4.0 TLBMIXM is mobile data working? I tested it yesterday and with the sim card, the phone reboots nonstop.

I flashed the A13 version with the latest TWRP A12 but I had to format the data several times.
Try directly with the TWRP A13.
Start by removing the security on the lock screen and restart the system then flash the TWRP in Fastboot mode with:
./fastboot flash recovery_ab twrp.img(powershell)
fastboot flash recovery_ab twrp.img(cmd)
reboot on the twrp with the combination of buttons not with a command.
Mobile data works fine - I've tried chinese and chinese EU roms and my 4G doesnt work, must be some kind of band issue, i'm in Canada so its probably just the bands being used here vs. elsewhere

If I try that and get errors, will i be stuck in fastboot? Last time I tried installing TWRP I blew my phone up... I forgot to remove the screen lock first though 😣
 

NOSS8

Recognized Contributor
Mobile data works fine - I've tried chinese and chinese EU roms and my 4G doesnt work, must be some kind of band issue, i'm in Canada so its probably just the bands being used here vs. elsewhere

If I try that and get errors, will i be stuck in fastboot? Last time I tried installing TWRP I blew my phone up... I forgot to remove the screen lock first though 😣
The bands have nothing to do with the problem since they are at the hardware level and not software.

In case it doesn't work (if you follow the method, no reason) and stay on fastboot, use Miflash to restore the phone.
 

farmz_inc

Senior Member
Aug 19, 2016
61
7
Just a question regarding 13.0.4.0 TLBMIXM is mobile data working? I tested it yesterday and with the sim card, the phone reboots nonstop.

I flashed the A13 version with the latest TWRP A12 but I had to format the data several times.
Try directly with the TWRP A13.
Start by removing the security on the lock screen and restart the system then flash the TWRP in Fastboot mode with:
./fastboot flash recovery_ab twrp.img(powershell)
fastboot flash recovery_ab twrp.img(cmd)
reboot on the twrp with the combination of buttons not with a command.
TWRP flash worked no problem and was able to dirty flash the ROM as well, thanks
 

NOSS8

Recognized Contributor
I'm on A13 and MIUI 13.2.7.0 TLBCNXM. I need to install TWRP.
Is "twrp-3.7.0_12-v6.5_A13-zeus-skkk.img" the correct .img file to download?
Is the correct command to use "fastboot boot twrp.img"?
Nope, it's a REC TWRP not a BOOT.
Use the A13 https://sourceforge.net/projects/recovery-for-xiaomi-devices/files/zeus/
Remove security from the lock screen then restart the system and then phone in Fastboot mode use the command "fastboot flash recovery_ab twrp.img" and reboot on the TWRP with the combination of buttons, not with a command.
 
  • Like
Reactions: toulan

Evo400

Senior Member
May 19, 2022
108
26
Any ideas pls? I donwloaded both A12 and A13 twrp as suggested above.

Im getting error with both of these.

FAILED (remote: Failed to load/authenticate boot image: Bad Buffer Size
 

Top Liked Posts