How to Fix Anti Rollback

Search This thread

Eugi35

Member
Dec 15, 2018
10
0
Are these lines? Can be removed safely? Thanx :)

::check anti_version
if exist %~dp0images\anti_version.txt (for /f "delims==" %%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
 

Manjotbenipal

Senior Member
May 26, 2022
55
7
Redmi Note 9
Are these lines? Can be removed safely? Thanx :)

::check anti_version
if exist %~dp0images\anti_version.txt (for /f "delims==" %%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
Yes you can remove them.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Don't think format data wipes the system partition does it?
    Unless Xiaomi have really changed things, data should be completely separate. Format data should wipe the internal storage only which includes cache partition.

    Twrp can wipe system, but shouldn't do unless specifically chosen to do so via several steps, not a single button press.
    no data format dont touch system
    1
    Hi,

    this happens because your system partition is "broken".

    If you go to "Wipe" and select "Format Data" there it will delete all partitions and the system of your device.

    Then you start again in the TWRP and connect the device via USB to a PC or via OTG to a stick on which you have the operating system of your choice and drag it to your device.

    Then select the ZIP / OS in the TWRP under "Install" and have it installed. It also creates the new partitions that he could not find with you. ;)

    I wish you success:fingers-crossed:

    Don't think format data wipes the system partition does it?
    Unless Xiaomi have really changed things, data should be completely separate. Format data should wipe the internal storage only which includes cache partition.

    Twrp can wipe system, but shouldn't do unless specifically chosen to do so via several steps, not a single button press.
    1
    Yes, of course not the whole system partition, sorry.
    From German into English is sometimes not that easy.?
    In this case, TWRP will of course only delete the data as it stands there.
    Otherwise everyone will find a step by step guide for almost every device a thousand times, thanks to you. So it should be also possible for everyone here.
    Best regards and thank you two.:highfive:
    1
    Its very simple to bypass the Anti rollback on miflash, just download the fastboot version of the ROM you want to install, unzip it and you'll have to edit this file (flash_all.bat), with for instance note++. And you remove 5 or 6 lines that does not begin by FASTBOOT. You can't miss it.
    You can close and save.
    Afterwards, just flash that same file that you just edited, and no more anti rollback error!
    A second tip that I have when you just can't install custom firmwares on the mi 10, just flash stock firmware with miflash, reboot and flash TWRP. Transfer your custom firmware to your phone, flash it and ONLY format data afterwards! It was the only way to get a custom firmware on my mi10. It's my 5th xiaomi device and never experienced something like this...tried all TWRP available for the mi 10, but only by doing this way, I was able to succesfully install xiaomi.eu.
    Good luck!