回复 5# yakeyun
源码第二部分:- cls
- color 1f
- echo.
- echo.已连上机器;正在处理。。。
- echo.
- echo.盒子型号:%model%
- echo.CPU 型号:%cpu%
- echo.软件版本:%ver%
- echo.
- echo.-------------------------------------------------------
- echo.
- echo.前期处理过程漫长且无聊,等着吧 。。。
- set tt=/data/local/update
- set t1=.\update\META-INF\com\google\android
- set t2=.\update\META-INF\com\android
- %bin%\adb shell rm -rf %tt% >nul 2>&1
- %bin%\adb shell "mkdir -p %tt%" >nul 2>&1
- %bin%\adb shell "make_ext4fs -l %system%M -s %tt%/system.img /system" >nul 2>&1
- %bin%\adb shell "%busybox% cat %dev%/%boot% >%tt%/boot.img" >nul 2>&1
- %bin%\adb shell "%busybox% cat %dev%/logo >%tt%/logo.img" >nul 2>&1
- %bin%\adb shell "%busybox% cat %dev%/recovery >%tt%/recovery.img" >nul 2>&1
- %bin%\adb shell "%busybox% cat %dev%/baseparam >%tt%/baseparam.img" >nul 2>&1
- %bin%\adb shell "%busybox% cat %dev%/fastboot >%tt%/fastboot.img" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"start...\");'>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"Made By QQ:334238313\");'>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'set_progress(\"1\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'show_progress(\"1\",\"50\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"check_rw......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ifelse(is_mounted(\"/data\"),(ui_print(\"data_rw......\");),ui_print(\"settings_rw......\");mount(\"ext4\", \"EMMC\", \"%dev%/%data%\", \"/data\"));'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"update fastboot......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo '#package_extract_file(\"fastboot.img\", \"%dev%/fastboot\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"update recovery......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'package_extract_file(\"recovery.img\", \"%dev%/recovery\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"update baseparam......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'package_extract_file(\"baseparam.img\", \"%dev%/baseparam\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"update logo......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'package_extract_file(\"logo.img\", \"%dev%/logo\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"update boot.....\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'package_extract_file(\"boot.img\", \"%dev%/%boot%\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"update system......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'format(\"ext4\", \"EMMC\", \"%dev%/system\", \"0\", \"/system\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'package_extract_file(\"system.img\", \"/data/system.img\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'write_ext4sp_img(\"/data/system.img\", \"%dev%/system\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'delete(\"/data/system.img\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"clear cache......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'wipe_cache();'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"clear data......\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'unmount(\"/data\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'format(\"ext4\", \"EMMC\", \"%dev%/%data%\", \"0\", \"/data\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'set_progress(\"1\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'ui_print(\"QQ GROUP:878756654\");'>>%tt%/updater-script" >nul 2>&1
- %bin%\adb shell "echo 'post-build=%fingerprint%'>%tt%/metadata" >nul 2>&1
- %bin%\adb shell "%busybox% httpd -p 8686 -h %tt%"
- %bin%\adb shell sync
- rd /s /q .\update >nul 2>&1
- md .\update
- %bin%\adb shell "ls %tt% >/cache/tmp.txt"
- %bin%\adb pull /cache/tmp.txt .\update\tmp.txt >nul 2>&1
- for /f "delims=:" %%a in ('echo %ip%') do (set ip1=%%a)
- set "aa=%%a"
- certutil -hashfile %bin%\wget.exe|find /i "a5a1d20bb1456bcbefc689f16f38b0710259b414" >nul 2>&1||goto erro1
- for /f "delims=" %%a in (.\update\tmp.txt) do (%bin%\wget -q -c -O .\update\%aa% http://%ip1%:8686/%aa%)
- %bin%\adb shell rm -f /cache/tmp.txt >nul
- del /f /q .\update\tmp.txt >nul
- for %%a in (".\update\system.img") do (if %%~za equ 0 set filenul=1)
- if not exist .\update\updater-script (set filenul=1)
- if "%filenul%" == "1" (
- rd /s /q .\update > nul 2>&1
- echo.回传文件失败,使用备用方法处理。。
- %bin%\adb pull %tt% .\update >nul 2>&1)
- %bin%\adb shell rm -rf %tt% >nul 2>&1
- %bin%\adb shell "%busybox% pkill -9 busybox" >nul 2>&1
- %bin%\adb shell rm -rf %busybox% >nul 2>&1
- if not exist .\update\updater-script goto erro1
- certutil -hashfile %bin%\script|find /i "1fa914cc45908d9e0808160300ef3f2e8a82c33f" >nul 2>&1||goto erro1
- md %t1%
- md %t2%
- copy %bin%\script %t1%\update-binary /y >nul 2>&1
- move .\update\updater-script %t1%\updater-script >nul 2>&1
- move .\update\metadata %t2%\metadata >nul 2>&1
- if not exist .\update\system.img goto erro1
- for %%a in (".\update\system.img") do (if %%~za equ 0 goto erro1)
- echo.
- echo.正在整理文件以及打包、签名中。。。
- (echo 机器信息:
- echo CPU:%cpu%
- echo 机器型号:%model%
- echo 软件版本:%ver%)>.\update\info.txt
- echo 分区信息:%partinfo% >>.\update\info.txt
- (echo.
- echo.
- echo 此固件由"一键制作卡刷固件/线刷包"工具自动生成
- echo 工具制作:暴风骤雨 QQ:334238313
- echo 反馈请加QQ群:878756654
- echo 更多可浏览:http://www.kaixindianshi.com)>>.\update\info.txt
- cd .\update
- .%bin%\7za a -tzip ..\update.zip -r * >nul 2>&1
- cd ..
- rd /S /Q .\update >nul 2>&1
- if not exist .\update.zip goto erro1
- certutil -hashfile %bin%\signapk.jar|find /i "0a6dc7f65c52537d8f552c608c586d650d829cfb" >nul 2>&1||goto erro1
- certutil -hashfile %bin%\testkey.pk8|find /i "92de052cb804dea75f9815a66d7d3f6f911cdb63" >nul 2>&1||goto erro1
- certutil -hashfile %bin%\testkey.x509.pem|find /i "ef543a467d830d9975ccf0d569a7841c8b5df988" >nul 2>&1||goto erro1
- java -Xmx2048m -Xms2048m -Xmn512m -jar %bin%\signapk.jar -w %bin%\testkey.x509.pem %bin%\testkey.pk8 .\update.zip .\%model%_%cpu%_update.zip >nul 2>&1
- del /f /q .\update.zip >nul 2>&1
- if not exist .\%model%_%cpu%_update.zip goto erro1
- echo.
- echo.恭喜,固件制作成功! ^^_^^ ^^_^^
- echo.
- echo.已生成%model%_%cpu%_update.zip
- echo.
- echo.具体信息查看固件包内的info.txt
- echo.
- echo.%model%|findstr /i "6109 6110 Q21 Q22 860" >nul &&echo.此机型固件也许需要作者的专用工具刷入!
- echo.
- echo.反馈交流可加QQ群:878756654
- echo.
- echo.全部工作完成,程序正在退出。。
- %bin%\adb kill-server >nul 2>&1
- ping 127.1 -n 10 >nul
- exit
- :erro
- cls
- color 0a
- echo.
- echo.-------------------------------------------------------
- echo.
- echo.哦噢!
- echo.
- echo.连接不上盒子或者已连上但没有adb root权限
- echo.
- echo.排除后再试。。
- echo.
- echo.
- echo.
- echo.
- echo.准备罢工退出。。。
- echo.
- echo.
- %bin%\adb kill-server >nul 2>&1
- ping 127.1 -n 8 >nul
- exit
-
- :erro1
- rd /S /Q .\update >nul 2>&1
- del /f /q .\*update.zip >nul 2>&1
- cls
- color 0a
- echo.
- echo.不要修改及更换%bin%内任何文件!
- echo.
- echo.检查解压路径是否有空格或特殊字符
- echo.
- echo.
- echo.也可能盒子系统没有所需的必要组件
- echo.
- echo.或许是电脑原因等各种因数固件制作失败!
- echo.
- echo.如果有安装360请先卸载重启电脑再试!
- echo.
- echo.
- echo.
- echo.按任意键退出。。。
- pause >nul
- exit
- :java
- cls
- color 0a
- echo.
- echo.
- echo.
- echo.检测不到系统有已正确安装配置的JAVA
- echo.
- echo.
- echo.
- echo.
- echo.按任意键退出。。。
- pause >nul
- exit
- :recovery
- cls
- echo.
- echo.体验版没有相应功能或者无法对目标处理!
- echo.
- echo.完整版也许有相应功能。。。
- echo.
- echo.
- echo.
- echo.按任意键退出。。。
- pause >nul
- exit
- :erro2
- cls
- echo.
- echo.
- echo.输入或拖入的什么呢
- echo.
- echo.仅支持拖入晶晨的IMG包或输入正确IP
- echo.
- echo.
- echo.
- ping 127.1 -n 8 >nul
- exit
复制代码
|