[RECOVERY][3.3.1][WORKING DECRYPT][LR.Team]Unofficial TWRP for OnePlus 7 Pro

Status
Not open for further replies.
Search This thread

Sarieri

Member
Jul 11, 2018
30
36
This is a twrp developed by a chinese team-LR.Team. It's not developed by me, but I will update with the developer wzsx150 on a daily basis (He said he is too busy to post here). So basically, this post is just for your convenience because the original thread was on the official chinese oneplus forum (which is of course all in chinese), and the link provided there was impossible for people here to download.

Instruction:
1. Download the twrp.rar file and unzip it. There should be one folder in the rar, "TWRP-3.3.1-0527-ONEPLUS7PRO-CN-wzsx150-", and a photo"Pic4".
3. Download stock boot.img here: Link removed due to non-compliance with GPL
3. Rename the boot image into "boot.img" and place it in the root directory of the folder("TWRP-3.3.1-0527-ONEPLUS7PRO-CN-wzsx150-") you just unzipped.
4. Reboot your phone into fastboot mode and connect to computer (you must have already unlocked your bootloader).
5. Run recovery-twrp_flash.bat and you should see bunch of chinese characters.
5. Hit enter 3 times and you should see something like Pic4.
6. Press 2 on your keyboard and hit Enter twice.
7. Wait for about 10 seconds and you should see the following on screen:
"Sending 'boot_a' (52560 KB) OKAY [ 1.136s]
Writing 'boot_a' OKAY [ 0.292s]
Finished. Total time: 1.440s
Sending 'boot_b' (52560 KB) OKAY [ 1.132s]
Writing 'boot_b' OKAY [ 0.156s]
Finished. Total time: 1.300s"
Rebooting
Finished. Total time: 0.003s
8. Your phone will automatically reboot twice and you will end up in twrp.
9. Enter your pin for decryption (maybe change the language to English) and install root in "ADCANCED".
10. Reboot.

Download Link:
Link removed due to non-compliance with GPL

Passcode:APBWgGrR65hGGjVvdvEsNb3_SaalCFwyp9Tq7wZvBw4

Again, all credits goes to wzsx150. I'm only here to help you understand chinese lol.


UPDATE:
Here is the actual coding inside the bat file. All credit goes to H1442060767555 on Oneplus forum.

Code:
@ECHO on&@endlocal&@cls
@Echo off
set device_name=OnePlus 7 Pro
set rec_name=TWRP
set rec_ver=3.3.0-0526
set rec_auth=wzsx150
set rec_team=LR.Team
set rec_date=2019.05.26
set rec_img_name=recovery-TWRP-3.3.0-0526-ONEPLUS7PRO-CN-wzsx150.img
set rec_img=%rec_img_name%-tmp
set rec_img_tmp=%rec_img%-%random%
set rec_boot_need=
TITLE %device_name% 一键刷入recovery工具 --by wzsx150
color 3f
:LOGO
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.              RECOVERY基本信息
ECHO.
ECHO.              REC名称 :%rec_name%
ECHO.              REC版本 :%rec_ver%
ECHO.              适配机型:%device_name%
ECHO.              编译作者:%rec_auth%
ECHO.              团队名称:%rec_team%
ECHO.              编译时间:%rec_date%
ECHO.
ECHO.     (支持开机状态刷入和fastboot模式刷入)
ECHO.
ECHO.   (需要提供当前系统相同版本的boot.img文件)
ECHO.***********************************************
ECHO.
ECHO.按任意键继续...
pause>nul
:PATCHBOOT
CLS
ECHO.
ECHO.           处理并生成TWRP的镜像文件
ECHO.***********************************************
ECHO.
ECHO.  请将你当前手机内系统相同版本的boot.img文件
ECHO.                复制到本目录下!
ECHO.
ECHO.
ECHO.    可以从%rec_auth%发布%rec_name%的百度云网盘里下载
ECHO.            也可以从官方刷机包中提取
ECHO.
ECHO.
ECHO.          (操作完毕后,按任意键继续)
ECHO.***********************************************
ECHO.
pause>nul
del /f "*.img-tmp-*" 2>nul
dir /a-d /b "boot*.img" 2>nul | findstr /ei ".img" >nul || goto PATCHBOOT_NOBOOTIMG
for /f "delims=" %%a in ('dir /a-d /b "boot*.img" ^| findstr /ei ".img"') do [user=352992]@set[/user] "rec_boot_need=%%a"
:PATCHBOOT_FILE
CLS
ECHO.
ECHO.           处理并生成TWRP的镜像文件
ECHO.***********************************************
ECHO.
ECHO.     发现boot镜像文件:%rec_boot_need%
ECHO.
ECHO.
ECHO.
ECHO.     请确认该文件是否为当前手机内系统相同
ECHO.   版本的boot镜像文件,如果不是请退出本工具
ECHO.
ECHO.           (确认后,按任意键继续)
ECHO.***********************************************
timeout /t 1 /nobreak >NUL
ECHO.请确认...
pause>nul
cd AIK || goto PATCHBOOT_FAILED
del /f "*.img" 2>nul
del /f "zImage" 2>nul
copy /y .."%rec_boot_need%" boot.img-tmp
goto PATCHBOOT_DOING
:PATCHBOOT_NOBOOTIMG
CLS
ECHO.
ECHO.           处理并生成TWRP的镜像文件
ECHO.***********************************************
ECHO.        未找到boot镜像文件,生成失败!
ECHO.
ECHO.
ECHO.  请确认已经将boot***.img文件复制到了本目录后
ECHO.               再重新运行本工具
ECHO.
ECHO.
ECHO.             (按任意键退出程序)
ECHO.***********************************************
ECHO.
pause >NUL
EXIT
:PATCHBOOT_DOING
CLS
ECHO.
ECHO.           处理并生成TWRP的镜像文件
ECHO.***********************************************
ECHO.
ECHO.            正在生成TWRP镜像文件...
ECHO.
ECHO.
ECHO.
ECHO.                  (请稍等)
ECHO.***********************************************
ECHO.
call "cleanup.bat" >nul 2>&1
rem 解包官方boot
call "unpackimg-abslot.bat" boot.img-tmp >nul 2>&1
if not exist "split_img\*-zImage" goto PATCHBOOT_FAILED
for /f "delims=" %%a in ('dir /b "split_img\*-zImage"') do [user=352992]@set[/user] "tmp_kernela=%%a"
copy /y "split_img\%tmp_kernela%" zImage
call "cleanup.bat" >nul 2>&1
rem 解包twrp
copy /y "..\%rec_img%" recovery.img-tmp
call "unpackimg-abslot.bat" recovery.img-tmp >nul 2>&1
rem 替换kernel
if not exist "split_img\*-zImage" goto PATCHBOOT_FAILED
for /f "delims=" %%a in ('dir /b "split_img\*-zImage"') do [user=352992]@set[/user] "tmp_kernelb=%%a"
copy /y zImage "split_img\%tmp_kernelb%"
rem 打包twrp
call "repackimg-abslot.bat" >nul 2>&1
rem 如果系统没有jave环境,签名会失败,现在想办法规避这种情况
if exist image-new.img (
  copy /y image-new.img .."%rec_img_tmp%"
) else (
  if not exist unsigned-new.img goto PATCHBOOT_FAILED
  copy /y unsigned-new.img .."%rec_img_tmp%"
  ECHO.
  ECHO.    【你的电脑系统可能需要安装java环境】
  ECHO.       【虽然这并不影响此次刷入%rec_name%】
  ECHO.
  timeout /t 5 /nobreak >NUL
)
ECHO.
ECHO.          生成TWRP的镜像文件成功!
ECHO.***********************************************
ECHO.%rec_img_tmp%
rem ECHO.
timeout /t 5 /nobreak >NUL
call "cleanup.bat" >nul 2>&1
del /f "*.img" 2>nul
del /f "zImage" 2>nul
cd .. || goto PATCHBOOT_FAILED
goto MENU
:PATCHBOOT_FAILED
CLS
ECHO.
ECHO.           处理并生成TWRP的镜像文件
ECHO.***********************************************
ECHO.                  生成失败!
ECHO.
ECHO.
ECHO.       请尝试重新下载并解压后运行本程序
ECHO.
ECHO.     若仍旧无法成功,请联系作者:%rec_auth%
ECHO.
ECHO.             (按任意键退出程序)
ECHO.***********************************************
ECHO.
pause >NUL
EXIT
:MENU
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.             您手机的当前状态:
ECHO.
ECHO.              1.开机状态
ECHO.
ECHO.              2.fastboot模式
ECHO.
ECHO.              3.其他状态
ECHO.
ECHO.
ECHO.***********************************************
ECHO.
set choice=
set /p choice=请直接输入对应数字回车:
if not "%choice%"=="" set choice=%choice:~0,1%
if /i "%choice%"=="1" goto IN_SYSTEM
if /i "%choice%"=="2" goto FASTBOOT_MODE
if /i "%choice%"=="3" goto OTHERS
ECHO.
ECHO.输入无效,请重新输入...
timeout /t 2 /nobreak >NUL
ECHO.
goto MENU
:eek:THERS
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.             请先将手机处于
ECHO.
ECHO.               【开机状态】
ECHO.                  或者
ECHO.             【fastboot模式】
ECHO.
ECHO.(按任意键返回上级菜单,若无操作则6秒后自动返回)
ECHO.***********************************************
ECHO.
timeout /t 6 >nul
echo.
goto MENU
:IN_SYSTEM
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.          请您将手机正确连接到电脑:
ECHO.
ECHO.            请确保:
ECHO.      【1.手机bootloader未锁】
ECHO.      【2.手机处于开机状态】
ECHO.      【3.手机开启USB调试】
ECHO.      【4.电脑上已经正确安装驱动】
ECHO.      【5.手机提示USB调试授权时勾选始终点击授权】
ECHO.
ECHO.            (按下任意键继续)
ECHO.***********************************************
ECHO.
pause>nul
ECHO.        正在检查设备是否正常连接...
ECHO.
ECHO.   (若长时间停留在此界面,请检查上述几项)
ECHO.           (并重启该工具)
ECHO.***********************************************
ECHO.
timeout /t 2 /nobreak >NUL
adb.exe wait-for-device >NUL 2>NUL
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.
ECHO.
ECHO.             手机重启中...
ECHO.
ECHO.
ECHO.***********************************************
ECHO.
ECHO.   (若长时间停留在此界面,请重启该工具)
ECHO.
adb.exe reboot bootloader >NUL 2>NUL
timeout /t 3 /nobreak >NUL
goto FLASHING
:FASTBOOT_MODE
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.          请您将手机正确连接到电脑:
ECHO.
ECHO.          请确保:
ECHO.        【1.手机bootloader未锁】
ECHO.        【2.手机处于fastboot模式】
ECHO.        【3.电脑上已经正确安装驱动】
ECHO.
ECHO.            (按下任意键继续)
ECHO.***********************************************
ECHO.
pause>nul
goto FLASHING
:FLASHING
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.
ECHO.          正在检查设备是否正常连接...
ECHO.
ECHO.
ECHO.      (如果长时间停留在此界面,请检查:)
ECHO.
ECHO.      【1.USB线是否正确连接】
ECHO.      【2.电脑驱动是否正确安装并识别】
ECHO.      【3.手机是否进入fastboot模式】
ECHO.
ECHO.             (并重启该工具)
ECHO.***********************************************
timeout /t 2 /nobreak >NUL
fastboot.exe wait-for-device >NUL 2>NUL
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.
ECHO.
ECHO.             正在刷入recovery...
ECHO.
ECHO.
ECHO.***********************************************
ECHO.
ECHO.      (若出现 OKAY 刷入成功,否则失败)
ECHO.
ECHO.    (若长时间停留在此界面,请重启该工具)
ECHO.
rem fastboot.exe flash boot %rec_img_tmp%
fastboot.exe flash boot_a "%rec_img_tmp%" || goto FLASH_FAILED
fastboot.exe flash boot_b "%rec_img_tmp%"
fastboot.exe flash misc misc.bin >NUL 2>NUL
timeout /t 6 /nobreak >NUL
goto FLASH_OVER
:FLASH_FAILED
ECHO.
ECHO. !!出错!!
timeout /t 6 /nobreak >NUL
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.
ECHO.                   刷入失败!
ECHO.
ECHO.           1.请检查手机型号是否正确
ECHO.           2.请确认fastboot是否正常
ECHO.           3.解压后重新运行本程序,
ECHO.             若还不成功,请联系作者
ECHO.
ECHO.           %rec_auth%感谢您使用本工具
ECHO.
ECHO.            (按任意键退出程序)
ECHO.***********************************************
ECHO.
timeout /t 1 /nobreak >NUL
pause >NUL
EXIT
:FLASH_OVER
CLS
ECHO.
ECHO.         %device_name% 一键刷入recovery工具
ECHO.***********************************************
ECHO.
ECHO.             刷写recovery完成
ECHO.
ECHO.
ECHO.        手机将重启进入%rec_name%的rec模式
ECHO.            (可能会重启1-2次)
ECHO.
ECHO.
ECHO.           %rec_auth%感谢您使用本工具
ECHO.
ECHO.           (按任意键关闭此窗口)
ECHO.***********************************************
ECHO.
fastboot.exe reboot
pause >NUL
EXIT
 
Last edited by a moderator:

Marco589

Senior Member
Dec 3, 2013
284
52
Como
OnePlus 9 Pro
just flashed on my 7pro , it Works! :D
thanks a lot

Right after the TWRP flashing, i was in recovery bootloop, but via TWRP I installed the latest Magisk and I solve the issue :)
FW: 9.5.5
 
Last edited:

reaper000

Senior Member
Aug 3, 2009
1,471
1,159
OnePlus 9
Does it matter which version of patched boot.img is used? 9.5.3 vs 9.5.4 vs 9.5.5?
I'm assuming that if I'm running oos 9.0.5.3, I should use that boot.img's patched version.
Finally, is there a TWRP installer zip included anywhere in this to flash right after a ROM zip so both slots get TWRP a flash?
Thanks!
 

Sarieri

Member
Jul 11, 2018
30
36
Does it matter which version of patched boot.img is used? 9.0.5.3 vs 9.0.5.4 vs 9. 0.5.5?
I'm assuming that if I'm running oos 9.0.5.3, I should use that boot.img's patched version.
Finally, is there a TWRP installer zip included anywhere in this to flash right after a ROM zip so both slots get TWRP a flash?
Thanks!

It MATTERS which version of boot.img you are using. Some one in this forum started a post including all versions of boot.img of all variant. Just download from there.
There is no installer zip. I'm not the developer of this twrp. I asked the developer before, but he rather have our twrp installed this way.
 
  • Like
Reactions: reaper000

reaper000

Senior Member
Aug 3, 2009
1,471
1,159
OnePlus 9
It MATTERS which version of boot.img you are using. Some one in this forum started a post including all versions of boot.img of all variant. Just download from there.
There is no installer zip. I'm not the developer of this twrp. I asked the developer before, but he rather have our twrp installed this way.

Thanks for putting this thread up, it's great that there's a working decrypt and kudos to you for facilitating translation. It takes some effort to make long posts, and it's appreciated.

I'm really hoping someone can throw together a script that utilizes this twrp to use as an installer zip, because otherwise we're sort of tethered to a pc to send twrp via fastboot after every ROM flash...
 

_Hinnie_

Senior Member
Dec 29, 2014
77
26
Moto G 2014
Lenovo P2
Ye, just install root in ADVANCED from TWRP.

I tried doing that, however I'm still in a recovery bootloop.
I can only ever get to the system when I use fastboot boot xxx.img (using the image from the other twrp thread), but when I do that my wifi doesn't work.
I already tried flashing stock boot and patched stock boot images, but I can't boot with them either.
 

Sarieri

Member
Jul 11, 2018
30
36
I tried doing that, however I'm still in a recovery bootloop.
I can only ever get to the system when I use fastboot boot xxx.img (using the image from the other twrp thread), but when I do that my wifi doesn't work.
I already tried flashing stock boot and patched stock boot images, but I can't boot with them either.

Try to boot to system with the boot xxx.img in the other twrp thread and install OTA from /sdcard in system update. After that try to follow the instructions in the other twrp thread and see if the wifi is functional. You should have your wifi fixed after reinstall the OTA update. You can try this one after that.

Most likely the wifi is broken because you flash EU firmware onto global version phones.
 
Last edited:

Marco589

Senior Member
Dec 3, 2013
284
52
Como
OnePlus 9 Pro
I tried doing that, however I'm still in a recovery bootloop.
I can only ever get to the system when I use fastboot boot xxx.img (using the image from the other twrp thread), but when I do that my wifi doesn't work.
I already tried flashing stock boot and patched stock boot images, but I can't boot with them either.
Use the magisk installer as I did
 

Sarieri

Member
Jul 11, 2018
30
36
Thanks for putting this thread up, it's great that there's a working decrypt and kudos to you for facilitating translation. It takes some effort to make long posts, and it's appreciated.

I'm really hoping someone can throw together a script that utilizes this twrp to use as an installer zip, because otherwise we're sort of tethered to a pc to send twrp via fastboot after every ROM flash...

You have the option to install twrp retention script in magisk everytime after OTA so that you don't need to reinstall twrp, but only magisk.
 
  • Like
Reactions: reaper000

_Hinnie_

Senior Member
Dec 29, 2014
77
26
Moto G 2014
Lenovo P2
Try to boot to system with the boot xxx.img in the other twrp thread and install OTA from /sdcard in system update. After that try to follow the instructions in the other twrp thread and see if the wifi is functional. You should have your wifi fixed after reinstall the OTA update. You can try this one after that.

Most likely the wifi is broken because you flash EU firmware onto global version phones.

Trying the local update as we speak. I do have an EU version, gm1913 so I chose the right ota.
I installed it by sideloading within the old twrp, maybe that was the issue? I'll see if this local update fixes everything.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    This is a twrp developed by a chinese team-LR.Team. It's not developed by me, but I will update with the developer wzsx150 on a daily basis (He said he is too busy to post here). So basically, this post is just for your convenience because the original thread was on the official chinese oneplus forum (which is of course all in chinese), and the link provided there was impossible for people here to download.

    Instruction:
    1. Download the twrp.rar file and unzip it. There should be one folder in the rar, "TWRP-3.3.1-0527-ONEPLUS7PRO-CN-wzsx150-", and a photo"Pic4".
    3. Download stock boot.img here: Link removed due to non-compliance with GPL
    3. Rename the boot image into "boot.img" and place it in the root directory of the folder("TWRP-3.3.1-0527-ONEPLUS7PRO-CN-wzsx150-") you just unzipped.
    4. Reboot your phone into fastboot mode and connect to computer (you must have already unlocked your bootloader).
    5. Run recovery-twrp_flash.bat and you should see bunch of chinese characters.
    5. Hit enter 3 times and you should see something like Pic4.
    6. Press 2 on your keyboard and hit Enter twice.
    7. Wait for about 10 seconds and you should see the following on screen:
    "Sending 'boot_a' (52560 KB) OKAY [ 1.136s]
    Writing 'boot_a' OKAY [ 0.292s]
    Finished. Total time: 1.440s
    Sending 'boot_b' (52560 KB) OKAY [ 1.132s]
    Writing 'boot_b' OKAY [ 0.156s]
    Finished. Total time: 1.300s"
    Rebooting
    Finished. Total time: 0.003s
    8. Your phone will automatically reboot twice and you will end up in twrp.
    9. Enter your pin for decryption (maybe change the language to English) and install root in "ADCANCED".
    10. Reboot.

    Download Link:
    Link removed due to non-compliance with GPL

    Passcode:APBWgGrR65hGGjVvdvEsNb3_SaalCFwyp9Tq7wZvBw4

    Again, all credits goes to wzsx150. I'm only here to help you understand chinese lol.


    UPDATE:
    Here is the actual coding inside the bat file. All credit goes to H1442060767555 on Oneplus forum.

    Code:
    @ECHO on&@endlocal&@cls
    @Echo off
    set device_name=OnePlus 7 Pro
    set rec_name=TWRP
    set rec_ver=3.3.0-0526
    set rec_auth=wzsx150
    set rec_team=LR.Team
    set rec_date=2019.05.26
    set rec_img_name=recovery-TWRP-3.3.0-0526-ONEPLUS7PRO-CN-wzsx150.img
    set rec_img=%rec_img_name%-tmp
    set rec_img_tmp=%rec_img%-%random%
    set rec_boot_need=
    TITLE %device_name% 一键刷入recovery工具 --by wzsx150
    color 3f
    :LOGO
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.              RECOVERY基本信息
    ECHO.
    ECHO.              REC名称 :%rec_name%
    ECHO.              REC版本 :%rec_ver%
    ECHO.              适配机型:%device_name%
    ECHO.              编译作者:%rec_auth%
    ECHO.              团队名称:%rec_team%
    ECHO.              编译时间:%rec_date%
    ECHO.
    ECHO.     (支持开机状态刷入和fastboot模式刷入)
    ECHO.
    ECHO.   (需要提供当前系统相同版本的boot.img文件)
    ECHO.***********************************************
    ECHO.
    ECHO.按任意键继续...
    pause>nul
    :PATCHBOOT
    CLS
    ECHO.
    ECHO.           处理并生成TWRP的镜像文件
    ECHO.***********************************************
    ECHO.
    ECHO.  请将你当前手机内系统相同版本的boot.img文件
    ECHO.                复制到本目录下!
    ECHO.
    ECHO.
    ECHO.    可以从%rec_auth%发布%rec_name%的百度云网盘里下载
    ECHO.            也可以从官方刷机包中提取
    ECHO.
    ECHO.
    ECHO.          (操作完毕后,按任意键继续)
    ECHO.***********************************************
    ECHO.
    pause>nul
    del /f "*.img-tmp-*" 2>nul
    dir /a-d /b "boot*.img" 2>nul | findstr /ei ".img" >nul || goto PATCHBOOT_NOBOOTIMG
    for /f "delims=" %%a in ('dir /a-d /b "boot*.img" ^| findstr /ei ".img"') do [user=352992]@set[/user] "rec_boot_need=%%a"
    :PATCHBOOT_FILE
    CLS
    ECHO.
    ECHO.           处理并生成TWRP的镜像文件
    ECHO.***********************************************
    ECHO.
    ECHO.     发现boot镜像文件:%rec_boot_need%
    ECHO.
    ECHO.
    ECHO.
    ECHO.     请确认该文件是否为当前手机内系统相同
    ECHO.   版本的boot镜像文件,如果不是请退出本工具
    ECHO.
    ECHO.           (确认后,按任意键继续)
    ECHO.***********************************************
    timeout /t 1 /nobreak >NUL
    ECHO.请确认...
    pause>nul
    cd AIK || goto PATCHBOOT_FAILED
    del /f "*.img" 2>nul
    del /f "zImage" 2>nul
    copy /y .."%rec_boot_need%" boot.img-tmp
    goto PATCHBOOT_DOING
    :PATCHBOOT_NOBOOTIMG
    CLS
    ECHO.
    ECHO.           处理并生成TWRP的镜像文件
    ECHO.***********************************************
    ECHO.        未找到boot镜像文件,生成失败!
    ECHO.
    ECHO.
    ECHO.  请确认已经将boot***.img文件复制到了本目录后
    ECHO.               再重新运行本工具
    ECHO.
    ECHO.
    ECHO.             (按任意键退出程序)
    ECHO.***********************************************
    ECHO.
    pause >NUL
    EXIT
    :PATCHBOOT_DOING
    CLS
    ECHO.
    ECHO.           处理并生成TWRP的镜像文件
    ECHO.***********************************************
    ECHO.
    ECHO.            正在生成TWRP镜像文件...
    ECHO.
    ECHO.
    ECHO.
    ECHO.                  (请稍等)
    ECHO.***********************************************
    ECHO.
    call "cleanup.bat" >nul 2>&1
    rem 解包官方boot
    call "unpackimg-abslot.bat" boot.img-tmp >nul 2>&1
    if not exist "split_img\*-zImage" goto PATCHBOOT_FAILED
    for /f "delims=" %%a in ('dir /b "split_img\*-zImage"') do [user=352992]@set[/user] "tmp_kernela=%%a"
    copy /y "split_img\%tmp_kernela%" zImage
    call "cleanup.bat" >nul 2>&1
    rem 解包twrp
    copy /y "..\%rec_img%" recovery.img-tmp
    call "unpackimg-abslot.bat" recovery.img-tmp >nul 2>&1
    rem 替换kernel
    if not exist "split_img\*-zImage" goto PATCHBOOT_FAILED
    for /f "delims=" %%a in ('dir /b "split_img\*-zImage"') do [user=352992]@set[/user] "tmp_kernelb=%%a"
    copy /y zImage "split_img\%tmp_kernelb%"
    rem 打包twrp
    call "repackimg-abslot.bat" >nul 2>&1
    rem 如果系统没有jave环境,签名会失败,现在想办法规避这种情况
    if exist image-new.img (
      copy /y image-new.img .."%rec_img_tmp%"
    ) else (
      if not exist unsigned-new.img goto PATCHBOOT_FAILED
      copy /y unsigned-new.img .."%rec_img_tmp%"
      ECHO.
      ECHO.    【你的电脑系统可能需要安装java环境】
      ECHO.       【虽然这并不影响此次刷入%rec_name%】
      ECHO.
      timeout /t 5 /nobreak >NUL
    )
    ECHO.
    ECHO.          生成TWRP的镜像文件成功!
    ECHO.***********************************************
    ECHO.%rec_img_tmp%
    rem ECHO.
    timeout /t 5 /nobreak >NUL
    call "cleanup.bat" >nul 2>&1
    del /f "*.img" 2>nul
    del /f "zImage" 2>nul
    cd .. || goto PATCHBOOT_FAILED
    goto MENU
    :PATCHBOOT_FAILED
    CLS
    ECHO.
    ECHO.           处理并生成TWRP的镜像文件
    ECHO.***********************************************
    ECHO.                  生成失败!
    ECHO.
    ECHO.
    ECHO.       请尝试重新下载并解压后运行本程序
    ECHO.
    ECHO.     若仍旧无法成功,请联系作者:%rec_auth%
    ECHO.
    ECHO.             (按任意键退出程序)
    ECHO.***********************************************
    ECHO.
    pause >NUL
    EXIT
    :MENU
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.             您手机的当前状态:
    ECHO.
    ECHO.              1.开机状态
    ECHO.
    ECHO.              2.fastboot模式
    ECHO.
    ECHO.              3.其他状态
    ECHO.
    ECHO.
    ECHO.***********************************************
    ECHO.
    set choice=
    set /p choice=请直接输入对应数字回车:
    if not "%choice%"=="" set choice=%choice:~0,1%
    if /i "%choice%"=="1" goto IN_SYSTEM
    if /i "%choice%"=="2" goto FASTBOOT_MODE
    if /i "%choice%"=="3" goto OTHERS
    ECHO.
    ECHO.输入无效,请重新输入...
    timeout /t 2 /nobreak >NUL
    ECHO.
    goto MENU
    :eek:THERS
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.             请先将手机处于
    ECHO.
    ECHO.               【开机状态】
    ECHO.                  或者
    ECHO.             【fastboot模式】
    ECHO.
    ECHO.(按任意键返回上级菜单,若无操作则6秒后自动返回)
    ECHO.***********************************************
    ECHO.
    timeout /t 6 >nul
    echo.
    goto MENU
    :IN_SYSTEM
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.          请您将手机正确连接到电脑:
    ECHO.
    ECHO.            请确保:
    ECHO.      【1.手机bootloader未锁】
    ECHO.      【2.手机处于开机状态】
    ECHO.      【3.手机开启USB调试】
    ECHO.      【4.电脑上已经正确安装驱动】
    ECHO.      【5.手机提示USB调试授权时勾选始终点击授权】
    ECHO.
    ECHO.            (按下任意键继续)
    ECHO.***********************************************
    ECHO.
    pause>nul
    ECHO.        正在检查设备是否正常连接...
    ECHO.
    ECHO.   (若长时间停留在此界面,请检查上述几项)
    ECHO.           (并重启该工具)
    ECHO.***********************************************
    ECHO.
    timeout /t 2 /nobreak >NUL
    adb.exe wait-for-device >NUL 2>NUL
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.
    ECHO.
    ECHO.             手机重启中...
    ECHO.
    ECHO.
    ECHO.***********************************************
    ECHO.
    ECHO.   (若长时间停留在此界面,请重启该工具)
    ECHO.
    adb.exe reboot bootloader >NUL 2>NUL
    timeout /t 3 /nobreak >NUL
    goto FLASHING
    :FASTBOOT_MODE
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.          请您将手机正确连接到电脑:
    ECHO.
    ECHO.          请确保:
    ECHO.        【1.手机bootloader未锁】
    ECHO.        【2.手机处于fastboot模式】
    ECHO.        【3.电脑上已经正确安装驱动】
    ECHO.
    ECHO.            (按下任意键继续)
    ECHO.***********************************************
    ECHO.
    pause>nul
    goto FLASHING
    :FLASHING
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.
    ECHO.          正在检查设备是否正常连接...
    ECHO.
    ECHO.
    ECHO.      (如果长时间停留在此界面,请检查:)
    ECHO.
    ECHO.      【1.USB线是否正确连接】
    ECHO.      【2.电脑驱动是否正确安装并识别】
    ECHO.      【3.手机是否进入fastboot模式】
    ECHO.
    ECHO.             (并重启该工具)
    ECHO.***********************************************
    timeout /t 2 /nobreak >NUL
    fastboot.exe wait-for-device >NUL 2>NUL
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.
    ECHO.
    ECHO.             正在刷入recovery...
    ECHO.
    ECHO.
    ECHO.***********************************************
    ECHO.
    ECHO.      (若出现 OKAY 刷入成功,否则失败)
    ECHO.
    ECHO.    (若长时间停留在此界面,请重启该工具)
    ECHO.
    rem fastboot.exe flash boot %rec_img_tmp%
    fastboot.exe flash boot_a "%rec_img_tmp%" || goto FLASH_FAILED
    fastboot.exe flash boot_b "%rec_img_tmp%"
    fastboot.exe flash misc misc.bin >NUL 2>NUL
    timeout /t 6 /nobreak >NUL
    goto FLASH_OVER
    :FLASH_FAILED
    ECHO.
    ECHO. !!出错!!
    timeout /t 6 /nobreak >NUL
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.
    ECHO.                   刷入失败!
    ECHO.
    ECHO.           1.请检查手机型号是否正确
    ECHO.           2.请确认fastboot是否正常
    ECHO.           3.解压后重新运行本程序,
    ECHO.             若还不成功,请联系作者
    ECHO.
    ECHO.           %rec_auth%感谢您使用本工具
    ECHO.
    ECHO.            (按任意键退出程序)
    ECHO.***********************************************
    ECHO.
    timeout /t 1 /nobreak >NUL
    pause >NUL
    EXIT
    :FLASH_OVER
    CLS
    ECHO.
    ECHO.         %device_name% 一键刷入recovery工具
    ECHO.***********************************************
    ECHO.
    ECHO.             刷写recovery完成
    ECHO.
    ECHO.
    ECHO.        手机将重启进入%rec_name%的rec模式
    ECHO.            (可能会重启1-2次)
    ECHO.
    ECHO.
    ECHO.           %rec_auth%感谢您使用本工具
    ECHO.
    ECHO.           (按任意键关闭此窗口)
    ECHO.***********************************************
    ECHO.
    fastboot.exe reboot
    pause >NUL
    EXIT
    5
    System img
    Vendor img
    Data
    Boot

    Restored these (except boot) for testing purposes and all went well. Gotta love the speed as well, restoring 10GB in just over a minute is tinkering heaven :good:

    3
    To anyone who has issues with broken wifi, I suggest you try flashing SkyDragon kernel. It worked for me on 9.5.5!
    2
    Worked like a charm, on 9.5.5. Data mounts and backups fine (restore untested yet) and Wifi still fine as well.

    Finally able to mess around without too many problems if one f's up :good:

    2
    I would suggest you not trying to flash it...I don't have a t-mobile variant and really can't help you out here. Sorry

    Can confirm it works on the tmobile variant