@echo off
title 中兴U830手机批处理程序

@echo\ 
@echo 提示：请将手机与电脑连接，USB模式选择ADB
adb wait-for-device

@echo\
@echo 获取授权......
adb push ./Root/psneuter /data/local/tmp
adb shell chmod 755 /data/local/tmp/psneuter
@echo\
@echo 如果程序进行不下去，请断开并重新连接
@echo 也可以在 adb 和 同步  之间互换一下 
@echo         不要关闭本窗口
@echo\
@echo\
adb shell /data/local/tmp/psneuter

adb kill-server
adb start-server
adb wait-for-device

:menu
cls
set Choice=""
@echo\ 
@echo\ 
@echo **********************************************************
@echo *                ZIE-T U830 ADB批处理程序                *
@echo *  程序制作：XGC  QQ:405610005  Email:405610005@QQ.COM   *
@echo **********************************************************
@echo *　　　               功能菜单                           *
@echo *　　                                                    *
@echo *　　　　　　1.一键ROOT(获取超级管理权限) 　　           *
@echo *　　　　　　2.刷中文recovery  　　                      *
@echo *　　　　　　3.刷原版recovery  　　                      *
@echo *　　　　　　4.安全退出　　　  　　                      *
@echo *　　                                                    *
@echo **********************************************************
echo.
set /P Choice=         选择(1-4),然后回车：
if /I "%Choice%"=="" Goto menu
if /I "%Choice%"=="1" goto menu1
if /I "%Choice%"=="2" goto menu2
if /I "%Choice%"=="3" goto menu3
if /I "%Choice%"=="4" goto menu4

goto menu

:menu1
@echo\
rem **********************************************************
rem *               模块：获取超级管理权限                   *
rem **********************************************************
@echo\
@echo 正在提取ROOT权限......
adb shell mount -o remount rw /system
adb shell mount -o remount rw /opl
adb push ./Root/su /system/bin/
adb shell chmod 06755 /system/bin/su
rem adb shell rm -f -r /system/xbin/su
adb shell ln -s /system/bin/su /system/xbin/su
adb push ./Root/com.noshufou.android.su.apk /system/app
adb shell chmod 0644 /system/app/com.noshufou.android.su.apk
adb push ./Root/com.speedsoftware.rootexplorer.apk /opl/apps/apk
adb shell chmod 0644 /opl/apps/apk/com.speedsoftware.rootexplorer.apk
adb shell mount -o remount ro /system
@echo 成功提取ROOT权限，按任意键返回主菜单......& pause>nul
@echo\
rem @echo 手机正在重启，请稍候......
rem adb reboot
goto menu


:menu2
@echo\
rem **********************************************************
rem *               模块：刷中文recovery                     *
rem **********************************************************
@echo\
@echo 正在刷写中文recovery......
adb push ./cwm中文版0410.img /data/local/tmp/recovery.img
adb push ./flash_image /data/local/tmp
adb shell chmod 0777 /data/local/tmp/flash_image
adb shell /data/local/tmp/flash_image recovery /data/local/tmp/recovery.img
adb shell rm /data/local/tmp/flash_image
adb shell rm /data/local/tmp/recovery.img
@echo 中文recovery刷写完毕，按任意键返回主菜单......& pause>nul
goto menu

:menu3
@echo\
rem **********************************************************
rem *               模块：刷原版recovery                     *
rem **********************************************************
@echo\
@echo 正在刷写原版recovery......
adb push ./recovery830原版.img /data/local/tmp/recovery.img
adb push ./flash_image /data/local/tmp
adb shell chmod 0777 /data/local/tmp/flash_image
adb shell /data/local/tmp/flash_image recovery /data/local/tmp/recovery.img
adb shell rm /data/local/tmp/flash_image
adb shell rm /data/local/tmp/recovery.img
@echo 原版recovery刷写完毕，按任意键返回主菜单......& pause>nul
goto menu


:menu4
rem -------清除临时文件----------------
@echo\
@echo 清除用过的临时文件......
adb shell rm /data/local/tmp/psneuter
@echo\
@echo 结束安装，按任意键安全退出......& pause>nul
exit




