简单的window的批处理.bat脚本编辑实例,用于笔记,不喜勿喷。
@echo off
echo -----------TDZ IS PLEASURE TO ASSIST YOU :)-----------
echo.
echo.
echo -----------Choose your platform!!!-----------
echo.
echo.
set message=[1]Amlogic 4.4/5.1/6.0, [2]Amlogic 7.1, [3]Amlogic 9.0 CTS, ^
[4]RK, [5]RTD1295
set meta_info_dir_name=META-INF
set meta_info_dir_Amlogic445160=meta_info\4.4,5.1,6.0
set meta_info_dir_Amlogic71=meta_info\7.1
set meta_info_dir_Amlogic90CTS=meta_info\META_INF_Amlogic90CTS
set meta_info_dir_RK=meta_info\RK
set meta_info_dir_RTD1295=meta_info\RTD1295
::set main_dir=%~dp0
::F:\GeniatechPatchTools\patch_tools_20181112_xuenian\
::echo %main_dir%
set update_dir=update\%meta_info_dir_name%
set update_file_updater_script_path=%update_dir%\com\google\android\updater-script
choice /C 12345 /M "%message% :"
if %errorlevel%==1 goto Amlogic445160
if %errorlevel%==2 goto Amlogic71
if %errorlevel%==3 goto Amlogic90CTS
if %errorlevel%==4 goto RK
if %errorlevel%==5 goto RTD1295
:Amlogic445160
xcopy %meta_info_dir_Amlogic445160%\%meta_info_dir_name% /E /R /I /Y /C %update_dir%
echo -----------copy Amlogic445160 success!!!Press any key to modify updater-script!!!-----------
pause > nul
goto finish_choose_platform
:Amlogic71
xcopy %meta_info_dir_Amlogic71%\%meta_info_dir_name% /E /R /I /Y /C %update_dir%
echo -----------copy Amlogic71 success!!!Press any key to modify updater-script!!!-----------
pause > nul
goto finish_choose_platform
:Amlogic90CTS
xcopy %meta_info_dir_Amlogic90CTS%\%meta_info_dir_name% /E /R /I /Y /C %update_dir%
echo -----------copy Amlogic90CTS success!!!Press any key to modify updater-script!!!-----------
pause > nul
goto finish_choose_platform
:RK
xcopy %meta_info_dir_RK%\%meta_info_dir_name% /E /R /I /Y /C %update_dir%
echo -----------copy RK success!!!Press any key to modify updater-script!!!-----------
pause > nul
goto finish_choose_platform
:RTD1295
xcopy %meta_info_dir_RTD1295%\%meta_info_dir_name% /E /R /I /Y /C %update_dir%
echo -----------copy RTD1295 success!!!Press any key to modify updater-script!!!-----------
pause > nul
goto finish_choose_platform
:finish_choose_platform
::echo %update_file_updater_script_path%
notepad %update_file_updater_script_path%
echo -----------Close and save your script file first then press any key to continue!!!-----------
pause > nul
echo.
echo.
echo -----------:)Input your platform box name!!!(as:ATV370,ATV390R,495MAX...)-----------
set /p platform=:
echo.
echo.
echo -----------:)Input your platform system version!!!(as:...7.1,8.0,8.1...)-----------
set /p android_version=:
echo.
echo.
echo -----------:)Input your custom name!!!(as: AA,CC...)-----------
set /p custom_name=:
echo.
echo.
set patch_name=patch_%platform%_%android_version%_%custom_name%_ %date:~0,4%%date:~5,2%%date:~8,2%.img
echo Your output file name will be as %patch_name%
choice /C:YN /M Yes,No
if %errorlevel%==1 goto Yes
if %errorlevel%==2 goto No
:Yes
echo yes!!!!
cd update
..\sign_on_win\7z.exe a ..\update.zip *
cd ..\
java -Xms700m -Xmx1024m -jar sign_on_win\signapk.jar -w sign_on_win\testkey.x509.pem sign_on_win\testkey.pk8 update.zip update.img
ren "update.img" "%patch_name%"
del update.zip
echo.
echo.
echo -----------Congratulate,please exit via any key,it is time to say goodbye,love you!!!(crying)-----------
pause > nul
goto No
:No
echo no!!!!
exit