关闭

Android 高通平台刷机脚本

716人阅读 评论(0) 收藏 举报

@echo off

cd /d %~dp0

set case=default
goto case_%1

:case_
  adb reboot bootloader
  set te=
  set count=0

:empty
  set /a count=count+1
  fastboot devices >temp.t

 type temp.txt
  set /p te=<temp.txt

if defined te (

   fastboot flash boot boot.img

   fastboot flash system system.img

   fastboot flash userdata userdata.img

   fastboot flash persist persist.img

  fastboot flash cache cache.img

  fastboot flash recovery recovery.img

   fastboot reboot

) else (
    if not "%count%" equ "500" (

 goto :empty
    ) else (
      set count=0

echo device not found
    )
  )
  del temp.txt

pause
  goto :case_end

:case_start
  adb reboot bootloader

echo case start
  cd /d %~dp0

goto :case_end

:case_all

set te=
  set count=0

 :all

 set  /a  count=count+1
  fastboot devices >temp.txt

type temp.txt
  set /p te=<temp.txt

if defined te (
    fastboot flash boot boot.img

fastboot flash system system.img

fastboot flash userdata userdata.img

fastboot flash persist persist.img

fastboot flash cache cache.img

fastboot flash recovery recovery.img

fastboot reboot

) else (

if not "%count%" equ "500" (

goto :all

) else (

set count = 0

 echo device not found

)

)

del temp.txt
  goto :case_end

:case_boot
  set te=
  set count=0

:boot
  set /a count=count+1

 fastboot devices >temp.txt
  type temp.txt

 set /p te=<temp.txt


  if defined te (

 fastboot flash boot boot.img
  ) else (

 if not "%count%" equ "500" (
      goto :boot
    ) else (

 set count=0
      echo device not found

  )
  )
  del temp.txt
  goto :case_end

:case_system
  set te=
  set count=0

:system
  set /a count=count+1
  fastboot devices >temp.txt

type temp.txt
  set /p te=<temp.txt

if defined te (
    fastboot flash system system.img

) else (
    if not "%count%" equ "500" (

 goto :system
    ) else (

 set count=0
      echo device not found
    )
  )

del temp.txt
  goto :case_end

:case_userdata
  set te=
  set count=0

:userdata
  set /a count=count+1

 fastboot devices >temp.txt
  type temp.txt

set /p te=<temp.txt

 if defined te (
    fastboot flash userdata userdata.img

 ) else (
    if not "%count%" equ "500" (

 goto :userdata
    ) else (

  set count=0
      echo device not found

)
  )
  del temp.txt
  goto :case_end

:case_persist
  set te=
  set count=0

 :persist
  set /a count=count+1

 fastboot devices >temp.txt
  type temp.txt

set /p te=<temp.txt

 if defined te (
    fastboot flash persist persist.img

) else (
    if not "%count%" equ "500" (

  goto :persist
    ) else (

set count=0
      echo device not found

)
  )
  del temp.txt
  goto :case_end

:case_cache
  set te=
  set count=0

:cache
  set /a count=count+1

 fastboot devices >temp.txt
  type temp.txt

set /p te=<temp.txt


  if defined te (

 fastboot flash cache cache.img
  ) else (

 if not "%count%" equ "500" (
      goto :cache
 ) else (
      set count=0
      echo device not found

)
  )
  del temp.txt

goto :case_end


:case_recovery
  set te=
  set count=0

:recovery
  set /a count=count+1

fastboot devices >temp.txt

 type temp.txt
  set /p te=<temp.txt

 if defined te (
    fastboot flash recovery recovery.img

 ) else (
    if not "%count%" equ "500" (

 goto :recovery
    ) else (
      set count=0

 echo device not found
    )
  )

del temp.txt
  goto :case_end

:case_reboot
  set te=
  set count=0

 :reboot
  set /a count=count+1

 fastboot devices >temp.txt
  type temp.txt

 set /p te=<temp.txt

 if defined te (
    fastboot reboot
  ) else (

 if not "%count%" equ "500" (
      goto :reboot
    ) else (

 set count=0
      echo device not found
    )
  )

del temp.txt
  goto :case_end


:case_end

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:19312次
    • 积分:417
    • 等级:
    • 排名:千里之外
    • 原创:24篇
    • 转载:15篇
    • 译文:0篇
    • 评论:3条
    最新评论