From 5494b981662af2ab858d75e3591f122af7088ebe Mon Sep 17 00:00:00 2001 From: Hakuin123 <108911712+Hakuin123@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:48:25 +0800 Subject: [PATCH] v1.5 --- ...0\257\345\212\250\357\274\201- GB2312.bat" | 118 ++++++++++-------- ...20\257\345\212\250\357\274\201- UTF-8.bat" | 118 ++++++++++-------- CHANGELOG.md | 17 +++ README.md | 3 +- 4 files changed, 147 insertions(+), 109 deletions(-) diff --git "a/ADB\357\274\214\345\220\257\345\212\250\357\274\201- GB2312.bat" "b/ADB\357\274\214\345\220\257\345\212\250\357\274\201- GB2312.bat" index ba57957..2d3977e 100644 --- "a/ADB\357\274\214\345\220\257\345\212\250\357\274\201- GB2312.bat" +++ "b/ADB\357\274\214\345\220\257\345\212\250\357\274\201- GB2312.bat" @@ -1,7 +1,7 @@ @echo off chcp 936 > nul -::如果出现乱码请尝试使用UTF-8版本 -title ADB,启动! v1.4 by 白隐Hakuin +:: 如果出现乱码请尝试使用 UTF-8 版本 +title ADB,启动! v1.5 by 白隐Hakuin :setVar :: 开启“延迟环境变量扩展” @@ -19,10 +19,10 @@ set Act_PermissionDog="/storage/emulated/0/Android/data/com.web1n.permissiondog/ :check echo = 检查 ADB 环境 = adb version -if not %errorlevel%==0 ( +if not %errorlevel% == 0 ( echo [错误] 未找到 ADB(Android Debug Bridge)!请检查此脚本是否和 ADB 相关工具放在同一文件夹下,或确保这台计算机拥有 ADB 运行环境(可参考网络教程) - echo Android SDK 平台工具:https://googledownloads.cn/android/repository/platform-tools-latest-windows.zip - echo 请使用浏览器打开上面的链接,下载并解压 'platform-tools' 文件夹,将此.bat文件放在该文件夹下,再次运行此.bat文件 + echo [提示] Android SDK 平台工具:https://googledownloads.cn/android/repository/platform-tools-latest-windows.zip + echo [提示] 请使用浏览器打开上面的链接,下载并解压 'platform-tools' 文件夹,将此.bat文件放在该文件夹下,再次运行此.bat文件 pause exit ) @@ -31,11 +31,11 @@ echo. :start echo = 启动 ADB 服务 = adb start-server -if not %errorlevel%==0 ( - if %IGNORE_ERROR%==1 ( +if not %errorlevel% == 0 ( + if %IGNORE_ERROR% == 1 ( echo [强制执行] 已选择强制执行模式,忽略错误并继续... ) - goto :fix + goto :fix-adb ) echo 等待设备连接... echo [提示] 请使用 USB 数据线连接设备,可能需要在设备上手动允许 USB 调试 @@ -49,19 +49,19 @@ adb devices -l :wireless echo = 启动无线调试 = adb tcpip 5555 -if not %errorlevel%==0 ( - if %IGNORE_ERROR%==1 ( +if not %errorlevel% == 0 ( + if %IGNORE_ERROR% == 1 ( echo [强制执行] 已选择强制执行模式,忽略错误并继续... ) - goto :fix + goto :fix-adb ) echo [注意] 无线调试启用后有一定风险,请勿允许来历不明的 ADB 调试请求 -echo 等待重新连接... +echo 等待自动重新连接... adb wait-for-device echo. :force -if %IGNORE_ERROR%==1 ( +if %IGNORE_ERROR% == 1 ( echo [强制执行] 已选择强制执行模式,直接执行所有启动及激活命令... adb shell sh %Act_Shizuku% %Act_Scene% %Act_IceBox% %Act_Brevent% %Act_Stopapp% %Act_PermissionDog% goto :end @@ -71,9 +71,9 @@ if %IGNORE_ERROR%==1 ( :shizuku :: 检查是否安装 Shizuku adb shell pm list packages | findstr /i "moe.shizuku.privileged.api" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 已安装 Shizuku,执行启动命令... - adb shell sh %Act_Shizuku% || goto :fix + adb shell sh %Act_Shizuku% || goto :fix-app ) else ( echo 未安装 Shizuku,跳过启动 ) @@ -82,9 +82,9 @@ echo. :scene adb shell pm list packages | findstr /i "com.omarea.vtools" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 已安装 Scene,执行激活命令... - adb shell sh %Act_Scene% || goto :fix + adb shell sh %Act_Scene% || goto :fix-app ) else ( echo 未安装 Scene,跳过激活 ) @@ -93,9 +93,9 @@ echo. :icebox adb shell pm list packages | findstr /i "com.catchingnow.icebox" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 已安装 冰箱,执行激活命令... - adb shell sh %Act_IceBox% || goto :fix + adb shell sh %Act_IceBox% || goto :fix-app ) else ( echo 未安装 冰箱,跳过激活 ) @@ -104,9 +104,9 @@ echo. :brevent adb shell pm list packages | findstr /i "me.piebridge.brevent" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 已安装 黑阈,执行激活命令... - adb shell sh %Act_Brevent% || goto :fix + adb shell sh %Act_Brevent% || goto :fix-app ) else ( echo 未安装 黑阈,跳过激活 ) @@ -116,21 +116,19 @@ echo. :stopapp adb shell pm list packages | findstr /i "web1n.stopapp" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 已安装 小黑屋,执行激活命令... adb shell sh %Act_Stopapp% > nul - if %errorlevel%==0 ( + if %errorlevel% == 0 ( echo 小黑屋 激活成功 echo 鉴于小黑屋执行激活命令后无论是否成功都会显示完整日志,此处已隐藏回显 ) else ( echo 小黑屋 激活失败,重试并输出日志... adb shell sh %Act_Stopapp% echo [注意] 小黑屋可能无法正常激活 - adb shell dumpsys package web1n.stopapp | findstr /C:"versionCode" - echo 若“versionCode”小于 297 请尝试更新应用至最新版本 - set /p IGNORE_ERROR="请按回车键继续执行,或输入 0 打开常规自动修复功能:" + set /p IGNORE_ERROR="[提示] 请按回车键继续执行,或输入 0 打开常规自动修复功能:" if "%IGNORE_ERROR%" == "0" ( - goto :fix + goto :fix-app ) ) ) else ( @@ -140,19 +138,19 @@ echo. :permissiondog adb shell pm list packages | findstr /i "com.web1n.permissiondog" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 已安装 权限狗,执行激活命令... adb shell sh %Act_PermissionDog% > nul - if %errorlevel%==0 ( + if %errorlevel% == 0 ( echo 权限狗 激活成功 echo 鉴于权限狗执行激活命令后无论是否成功都会显示完整日志,此处已隐藏回显 ) else ( echo 权限狗 激活失败,重试并输出日志... adb shell sh %Act_PermissionDog% echo [注意] 权限狗可能无法正常激活 - set /p IGNORE_ERROR="请按回车键继续执行,或输入 0 打开常规自动修复功能:" + set /p IGNORE_ERROR="[提示] 请按回车键继续执行,或输入 0 打开常规自动修复功能:" if "%IGNORE_ERROR%" == "0" ( - goto :fix + goto :fix-app ) ) ) else ( @@ -176,46 +174,58 @@ echo. echo ============ SUCCESS! ============ echo == 全部执行完成,关闭 ADB 服务 == adb kill-server -echo 请按任意键退出... +echo [提示] 请按任意键退出... pause > nul exit -:fix -echo == 执行遇到错误,尝试修复 == +:fix-adb +echo == 执行遇到错误(ADB),尝试修复 == echo 尝试关闭正在运行的所有 ADB.exe 进程防止冲突... taskkill /F /IM adb.exe || echo 若提示没有找到进程说明无 ADB 进程冲突,忽略即可 echo. - -echo 检查 ADB 默认端口(5037)是否被占用... -netstat -aon | findstr 5037 -if %errorlevel%==0 ( - echo [注意] 5037 端口可能已被其他进程占用 - echo [注意] 请关闭计算机上正在运行的“手机助手”类软件,如“360手机助手”“鲁大师手机助手”等 - echo [注意] 若不能准确定位进程,上方回显最右侧为该进程对应 PID,请在任务管理器中手动将其关闭 +echo 检查 ADB 端口占用情况... +for /f "tokens=5 delims= " %%a in ('netstat -ano ^| findstr :5037 ^| findstr "LISTENING"') do ( + set process_pid=%%a + if not !process_pid! == 0 ( + echo [注意] 检测到有进程占用 ADB 默认端口(5037),该进程 PID 为 !process_pid! + for /f "tokens=1*" %%b in ('tasklist /NH /FI "PID eq !process_pid!"') do ( + set "process_name=%%b" + echo [注意] 占用端口的进程名为:!process_name! + ) + echo 尝试强制结束该进程... + taskkill /F /PID !process_pid! + if !errorlevel! == 0 ( + echo 已强制结束占用 5037 端口的进程,请尝试重新执行 + ) else ( + echo [注意] 强制结束进程失败,请尝试手动关闭该进程对应的程序,然后重新执行 + ) + ) ) echo. +echo [提示] 若运行时提示“adb server version (xxx) doesn't match this client (xxx); killing...”,请关闭计算机上正在运行的“手机助手”类软件,如“360手机助手”“鲁大师手机助手”等 +goto :restart +:fix-app +echo == 执行遇到错误(应用),尝试修复 == echo 检查应用激活脚本是否存在... set "NOT_FOUND=" -adb shell ls "%Act_Shizuku%" || set "NOT_FOUND=!NOT_FOUND! Shizuku" -adb shell ls "%Act_Scene%" || set "NOT_FOUND=!NOT_FOUND! Scene" -adb shell ls "%Act_IceBox%" || set "NOT_FOUND=!NOT_FOUND! 冰箱" -adb shell ls "%Act_Brevent%" || set "NOT_FOUND=!NOT_FOUND! 黑阈" -adb shell ls "%Act_Stopapp%" || set "NOT_FOUND=!NOT_FOUND! 小黑屋" -adb shell ls "%Act_PermissionDog%" || set "NOT_FOUND=!NOT_FOUND! 权限狗" +adb shell ls "%Act_Shizuku%" > nul || set "NOT_FOUND=!NOT_FOUND! Shizuku" +adb shell ls "%Act_Scene%" > nul || set "NOT_FOUND=!NOT_FOUND! Scene" +adb shell ls "%Act_IceBox%" > nul || set "NOT_FOUND=!NOT_FOUND! 冰箱" +adb shell ls "%Act_Brevent%" > nul || set "NOT_FOUND=!NOT_FOUND! 黑阈" +adb shell ls "%Act_Stopapp%" > nul || set "NOT_FOUND=!NOT_FOUND! 小黑屋" +adb shell ls "%Act_PermissionDog%" > nul || set "NOT_FOUND=!NOT_FOUND! 权限狗" if not "%NOT_FOUND%" == "" ( - echo [注意] 下列应用未找到激活脚本:%NOT_FOUND% + echo [注意] 下列应用未找到激活脚本:%NOT_FOUND% (若未安装请忽略) echo [注意] 请尝试在设备上启动一次上述应用,并将运行模式设置为 ADB 模式 - echo [注意] 若仍未解决问题,请尝试更新上述应用至最新版本 + echo [注意] 若仍未解决问题,请尝试更新上述应用至最新版本,部分旧版激活可能出现问题 ) -echo. +goto :restart -echo == 常见问题 == -echo 1. 激活某个应用时若提示“no such file or directory”,请先在设备上启动一次该应用并选择对应的模式 -echo 2. 若提示“adb server version (xxx) doesn't match this client (xxx); killing...”,请关闭计算机上正在运行的“手机助手”类软件,如“360手机助手”“鲁大师手机助手”等 +:restart echo. -set /p IGNORE_ERROR="请按回车键重新执行,或输入 1 忽略错误并重新执行:" +set /p IGNORE_ERROR="[提示] 请按回车键重新执行,或输入 1 进入忽略错误并重新执行(强制执行模式):" if "%IGNORE_ERROR%" == "1" ( cls goto :start diff --git "a/ADB\357\274\214\345\220\257\345\212\250\357\274\201- UTF-8.bat" "b/ADB\357\274\214\345\220\257\345\212\250\357\274\201- UTF-8.bat" index a8e7d5a..bde999a 100644 --- "a/ADB\357\274\214\345\220\257\345\212\250\357\274\201- UTF-8.bat" +++ "b/ADB\357\274\214\345\220\257\345\212\250\357\274\201- UTF-8.bat" @@ -1,7 +1,7 @@ @echo off chcp 65001 > nul -::濡傛灉鍑虹幇涔辩爜璇峰皾璇曚娇鐢℅B2312鐗堟湰 -title ADB锛屽惎鍔紒 v1.4 by 鐧介殣Hakuin +:: 濡傛灉鍑虹幇涔辩爜璇峰皾璇曚娇鐢 GB2312 鐗堟湰 +title ADB锛屽惎鍔紒 v1.5 by 鐧介殣Hakuin :setVar :: 寮鍚滃欢杩熺幆澧冨彉閲忔墿灞曗 @@ -19,10 +19,10 @@ set Act_PermissionDog="/storage/emulated/0/Android/data/com.web1n.permissiondog/ :check echo = 妫鏌 ADB 鐜 = adb version -if not %errorlevel%==0 ( +if not %errorlevel% == 0 ( echo [閿欒] 鏈壘鍒 ADB锛圓ndroid Debug Bridge锛夛紒璇锋鏌ユ鑴氭湰鏄惁鍜 ADB 鐩稿叧宸ュ叿鏀惧湪鍚屼竴鏂囦欢澶逛笅锛屾垨纭繚杩欏彴璁$畻鏈烘嫢鏈 ADB 杩愯鐜锛堝彲鍙傝冪綉缁滄暀绋嬶級 - echo Android SDK 骞冲彴宸ュ叿锛歨ttps://googledownloads.cn/android/repository/platform-tools-latest-windows.zip - echo 璇蜂娇鐢ㄦ祻瑙堝櫒鎵撳紑涓婇潰鐨勯摼鎺ワ紝涓嬭浇骞惰В鍘 'platform-tools' 鏂囦欢澶癸紝灏嗘.bat鏂囦欢鏀惧湪璇ユ枃浠跺す涓嬶紝鍐嶆杩愯姝.bat鏂囦欢 + echo [鎻愮ず] Android SDK 骞冲彴宸ュ叿锛歨ttps://googledownloads.cn/android/repository/platform-tools-latest-windows.zip + echo [鎻愮ず] 璇蜂娇鐢ㄦ祻瑙堝櫒鎵撳紑涓婇潰鐨勯摼鎺ワ紝涓嬭浇骞惰В鍘 'platform-tools' 鏂囦欢澶癸紝灏嗘.bat鏂囦欢鏀惧湪璇ユ枃浠跺す涓嬶紝鍐嶆杩愯姝.bat鏂囦欢 pause exit ) @@ -31,11 +31,11 @@ echo. :start echo = 鍚姩 ADB 鏈嶅姟 = adb start-server -if not %errorlevel%==0 ( - if %IGNORE_ERROR%==1 ( +if not %errorlevel% == 0 ( + if %IGNORE_ERROR% == 1 ( echo [寮哄埗鎵ц] 宸查夋嫨寮哄埗鎵ц妯″紡锛屽拷鐣ラ敊璇苟缁х画... ) - goto :fix + goto :fix-adb ) echo 绛夊緟璁惧杩炴帴... echo [鎻愮ず] 璇蜂娇鐢 USB 鏁版嵁绾胯繛鎺ヨ澶囷紝鍙兘闇瑕佸湪璁惧涓婃墜鍔ㄥ厑璁 USB 璋冭瘯 @@ -49,19 +49,19 @@ adb devices -l :wireless echo = 鍚姩鏃犵嚎璋冭瘯 = adb tcpip 5555 -if not %errorlevel%==0 ( - if %IGNORE_ERROR%==1 ( +if not %errorlevel% == 0 ( + if %IGNORE_ERROR% == 1 ( echo [寮哄埗鎵ц] 宸查夋嫨寮哄埗鎵ц妯″紡锛屽拷鐣ラ敊璇苟缁х画... ) - goto :fix + goto :fix-adb ) echo [娉ㄦ剰] 鏃犵嚎璋冭瘯鍚敤鍚庢湁涓瀹氶闄╋紝璇峰嬁鍏佽鏉ュ巻涓嶆槑鐨 ADB 璋冭瘯璇锋眰 -echo 绛夊緟閲嶆柊杩炴帴... +echo 绛夊緟鑷姩閲嶆柊杩炴帴... adb wait-for-device echo. :force -if %IGNORE_ERROR%==1 ( +if %IGNORE_ERROR% == 1 ( echo [寮哄埗鎵ц] 宸查夋嫨寮哄埗鎵ц妯″紡锛岀洿鎺ユ墽琛屾墍鏈夊惎鍔ㄥ強婵娲诲懡浠... adb shell sh %Act_Shizuku% %Act_Scene% %Act_IceBox% %Act_Brevent% %Act_Stopapp% %Act_PermissionDog% goto :end @@ -71,9 +71,9 @@ if %IGNORE_ERROR%==1 ( :shizuku :: 妫鏌ユ槸鍚﹀畨瑁 Shizuku adb shell pm list packages | findstr /i "moe.shizuku.privileged.api" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 宸插畨瑁 Shizuku锛屾墽琛屽惎鍔ㄥ懡浠... - adb shell sh %Act_Shizuku% || goto :fix + adb shell sh %Act_Shizuku% || goto :fix-app ) else ( echo 鏈畨瑁 Shizuku锛岃烦杩囧惎鍔 ) @@ -82,9 +82,9 @@ echo. :scene adb shell pm list packages | findstr /i "com.omarea.vtools" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 宸插畨瑁 Scene锛屾墽琛屾縺娲诲懡浠... - adb shell sh %Act_Scene% || goto :fix + adb shell sh %Act_Scene% || goto :fix-app ) else ( echo 鏈畨瑁 Scene锛岃烦杩囨縺娲 ) @@ -93,9 +93,9 @@ echo. :icebox adb shell pm list packages | findstr /i "com.catchingnow.icebox" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 宸插畨瑁 鍐扮锛屾墽琛屾縺娲诲懡浠... - adb shell sh %Act_IceBox% || goto :fix + adb shell sh %Act_IceBox% || goto :fix-app ) else ( echo 鏈畨瑁 鍐扮锛岃烦杩囨縺娲 ) @@ -104,9 +104,9 @@ echo. :brevent adb shell pm list packages | findstr /i "me.piebridge.brevent" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 宸插畨瑁 榛戦槇锛屾墽琛屾縺娲诲懡浠... - adb shell sh %Act_Brevent% || goto :fix + adb shell sh %Act_Brevent% || goto :fix-app ) else ( echo 鏈畨瑁 榛戦槇锛岃烦杩囨縺娲 ) @@ -116,21 +116,19 @@ echo. :stopapp adb shell pm list packages | findstr /i "web1n.stopapp" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 宸插畨瑁 灏忛粦灞嬶紝鎵ц婵娲诲懡浠... adb shell sh %Act_Stopapp% > nul - if %errorlevel%==0 ( + if %errorlevel% == 0 ( echo 灏忛粦灞 婵娲绘垚鍔 echo 閴翠簬灏忛粦灞嬫墽琛屾縺娲诲懡浠ゅ悗鏃犺鏄惁鎴愬姛閮戒細鏄剧ず瀹屾暣鏃ュ織锛屾澶勫凡闅愯棌鍥炴樉 ) else ( echo 灏忛粦灞 婵娲诲け璐ワ紝閲嶈瘯骞惰緭鍑烘棩蹇... adb shell sh %Act_Stopapp% echo [娉ㄦ剰] 灏忛粦灞嬪彲鑳芥棤娉曟甯告縺娲 - adb shell dumpsys package web1n.stopapp | findstr /C:"versionCode" - echo 鑻モ渧ersionCode鈥濆皬浜 297 璇峰皾璇曟洿鏂板簲鐢ㄨ嚦鏈鏂扮増鏈 - set /p IGNORE_ERROR="璇锋寜鍥炶溅閿户缁墽琛岋紝鎴栬緭鍏 0 鎵撳紑甯歌鑷姩淇鍔熻兘锛" + set /p IGNORE_ERROR="[鎻愮ず] 璇锋寜鍥炶溅閿户缁墽琛岋紝鎴栬緭鍏 0 鎵撳紑甯歌鑷姩淇鍔熻兘锛" if "%IGNORE_ERROR%" == "0" ( - goto :fix + goto :fix-app ) ) ) else ( @@ -140,19 +138,19 @@ echo. :permissiondog adb shell pm list packages | findstr /i "com.web1n.permissiondog" > nul -if %errorlevel%==0 ( +if %errorlevel% == 0 ( echo 宸插畨瑁 鏉冮檺鐙楋紝鎵ц婵娲诲懡浠... adb shell sh %Act_PermissionDog% > nul - if %errorlevel%==0 ( + if %errorlevel% == 0 ( echo 鏉冮檺鐙 婵娲绘垚鍔 echo 閴翠簬鏉冮檺鐙楁墽琛屾縺娲诲懡浠ゅ悗鏃犺鏄惁鎴愬姛閮戒細鏄剧ず瀹屾暣鏃ュ織锛屾澶勫凡闅愯棌鍥炴樉 ) else ( echo 鏉冮檺鐙 婵娲诲け璐ワ紝閲嶈瘯骞惰緭鍑烘棩蹇... adb shell sh %Act_PermissionDog% echo [娉ㄦ剰] 鏉冮檺鐙楀彲鑳芥棤娉曟甯告縺娲 - set /p IGNORE_ERROR="璇锋寜鍥炶溅閿户缁墽琛岋紝鎴栬緭鍏 0 鎵撳紑甯歌鑷姩淇鍔熻兘锛" + set /p IGNORE_ERROR="[鎻愮ず] 璇锋寜鍥炶溅閿户缁墽琛岋紝鎴栬緭鍏 0 鎵撳紑甯歌鑷姩淇鍔熻兘锛" if "%IGNORE_ERROR%" == "0" ( - goto :fix + goto :fix-app ) ) ) else ( @@ -176,46 +174,58 @@ echo. echo ============ SUCCESS! ============ echo == 鍏ㄩ儴鎵ц瀹屾垚锛屽叧闂 ADB 鏈嶅姟 == adb kill-server -echo 璇锋寜浠绘剰閿鍑... +echo [鎻愮ず] 璇锋寜浠绘剰閿鍑... pause > nul exit -:fix -echo == 鎵ц閬囧埌閿欒锛屽皾璇曚慨澶 == +:fix-adb +echo == 鎵ц閬囧埌閿欒锛圓DB锛夛紝灏濊瘯淇 == echo 灏濊瘯鍏抽棴姝e湪杩愯鐨勬墍鏈 ADB.exe 杩涚▼闃叉鍐茬獊... taskkill /F /IM adb.exe || echo 鑻ユ彁绀烘病鏈夋壘鍒拌繘绋嬭鏄庢棤 ADB 杩涚▼鍐茬獊锛屽拷鐣ュ嵆鍙 echo. - -echo 妫鏌 ADB 榛樿绔彛锛5037锛夋槸鍚﹁鍗犵敤... -netstat -aon | findstr 5037 -if %errorlevel%==0 ( - echo [娉ㄦ剰] 5037 绔彛鍙兘宸茶鍏朵粬杩涚▼鍗犵敤 - echo [娉ㄦ剰] 璇峰叧闂绠楁満涓婃鍦ㄨ繍琛岀殑鈥滄墜鏈哄姪鎵嬧濈被杞欢锛屽鈥360鎵嬫満鍔╂墜鈥濃滈瞾澶у笀鎵嬫満鍔╂墜鈥濈瓑 - echo [娉ㄦ剰] 鑻ヤ笉鑳藉噯纭畾浣嶈繘绋嬶紝涓婃柟鍥炴樉鏈鍙充晶涓鸿杩涚▼瀵瑰簲 PID锛岃鍦ㄤ换鍔$鐞嗗櫒涓墜鍔ㄥ皢鍏跺叧闂 +echo 妫鏌 ADB 绔彛鍗犵敤鎯呭喌... +for /f "tokens=5 delims= " %%a in ('netstat -ano ^| findstr :5037 ^| findstr "LISTENING"') do ( + set process_pid=%%a + if not !process_pid! == 0 ( + echo [娉ㄦ剰] 妫娴嬪埌鏈夎繘绋嬪崰鐢 ADB 榛樿绔彛锛5037锛夛紝璇ヨ繘绋 PID 涓 !process_pid! + for /f "tokens=1*" %%b in ('tasklist /NH /FI "PID eq !process_pid!"') do ( + set "process_name=%%b" + echo [娉ㄦ剰] 鍗犵敤绔彛鐨勮繘绋嬪悕涓猴細!process_name! + ) + echo 灏濊瘯寮哄埗缁撴潫璇ヨ繘绋... + taskkill /F /PID !process_pid! + if !errorlevel! == 0 ( + echo 宸插己鍒剁粨鏉熷崰鐢 5037 绔彛鐨勮繘绋嬶紝璇峰皾璇曢噸鏂版墽琛 + ) else ( + echo [娉ㄦ剰] 寮哄埗缁撴潫杩涚▼澶辫触锛岃灏濊瘯鎵嬪姩鍏抽棴璇ヨ繘绋嬪搴旂殑绋嬪簭锛岀劧鍚庨噸鏂版墽琛 + ) + ) ) echo. +echo [鎻愮ず] 鑻ヨ繍琛屾椂鎻愮ず鈥渁db server version (xxx) doesn't match this client (xxx); killing...鈥濓紝璇峰叧闂绠楁満涓婃鍦ㄨ繍琛岀殑鈥滄墜鏈哄姪鎵嬧濈被杞欢锛屽鈥360鎵嬫満鍔╂墜鈥濃滈瞾澶у笀鎵嬫満鍔╂墜鈥濈瓑 +goto :restart +:fix-app +echo == 鎵ц閬囧埌閿欒锛堝簲鐢級锛屽皾璇曚慨澶 == echo 妫鏌ュ簲鐢ㄦ縺娲昏剼鏈槸鍚﹀瓨鍦... set "NOT_FOUND=" -adb shell ls "%Act_Shizuku%" || set "NOT_FOUND=!NOT_FOUND! Shizuku" -adb shell ls "%Act_Scene%" || set "NOT_FOUND=!NOT_FOUND! Scene" -adb shell ls "%Act_IceBox%" || set "NOT_FOUND=!NOT_FOUND! 鍐扮" -adb shell ls "%Act_Brevent%" || set "NOT_FOUND=!NOT_FOUND! 榛戦槇" -adb shell ls "%Act_Stopapp%" || set "NOT_FOUND=!NOT_FOUND! 灏忛粦灞" -adb shell ls "%Act_PermissionDog%" || set "NOT_FOUND=!NOT_FOUND! 鏉冮檺鐙" +adb shell ls "%Act_Shizuku%" > nul || set "NOT_FOUND=!NOT_FOUND! Shizuku" +adb shell ls "%Act_Scene%" > nul || set "NOT_FOUND=!NOT_FOUND! Scene" +adb shell ls "%Act_IceBox%" > nul || set "NOT_FOUND=!NOT_FOUND! 鍐扮" +adb shell ls "%Act_Brevent%" > nul || set "NOT_FOUND=!NOT_FOUND! 榛戦槇" +adb shell ls "%Act_Stopapp%" > nul || set "NOT_FOUND=!NOT_FOUND! 灏忛粦灞" +adb shell ls "%Act_PermissionDog%" > nul || set "NOT_FOUND=!NOT_FOUND! 鏉冮檺鐙" if not "%NOT_FOUND%" == "" ( - echo [娉ㄦ剰] 涓嬪垪搴旂敤鏈壘鍒版縺娲昏剼鏈細%NOT_FOUND% + echo [娉ㄦ剰] 涓嬪垪搴旂敤鏈壘鍒版縺娲昏剼鏈細%NOT_FOUND% 锛堣嫢鏈畨瑁呰蹇界暐锛 echo [娉ㄦ剰] 璇峰皾璇曞湪璁惧涓婂惎鍔ㄤ竴娆′笂杩板簲鐢紝骞跺皢杩愯妯″紡璁剧疆涓 ADB 妯″紡 - echo [娉ㄦ剰] 鑻ヤ粛鏈В鍐抽棶棰橈紝璇峰皾璇曟洿鏂颁笂杩板簲鐢ㄨ嚦鏈鏂扮増鏈 + echo [娉ㄦ剰] 鑻ヤ粛鏈В鍐抽棶棰橈紝璇峰皾璇曟洿鏂颁笂杩板簲鐢ㄨ嚦鏈鏂扮増鏈紝閮ㄥ垎鏃х増婵娲诲彲鑳藉嚭鐜伴棶棰 ) -echo. +goto :restart -echo == 甯歌闂 == -echo 1. 婵娲绘煇涓簲鐢ㄦ椂鑻ユ彁绀衡渘o such file or directory鈥濓紝璇峰厛鍦ㄨ澶囦笂鍚姩涓娆¤搴旂敤骞堕夋嫨瀵瑰簲鐨勬ā寮 -echo 2. 鑻ユ彁绀衡渁db server version (xxx) doesn't match this client (xxx); killing...鈥濓紝璇峰叧闂绠楁満涓婃鍦ㄨ繍琛岀殑鈥滄墜鏈哄姪鎵嬧濈被杞欢锛屽鈥360鎵嬫満鍔╂墜鈥濃滈瞾澶у笀鎵嬫満鍔╂墜鈥濈瓑 +:restart echo. -set /p IGNORE_ERROR="璇锋寜鍥炶溅閿噸鏂版墽琛岋紝鎴栬緭鍏 1 蹇界暐閿欒骞堕噸鏂版墽琛岋細" +set /p IGNORE_ERROR="[鎻愮ず] 璇锋寜鍥炶溅閿噸鏂版墽琛岋紝鎴栬緭鍏 1 杩涘叆蹇界暐閿欒骞堕噸鏂版墽琛岋紙寮哄埗鎵ц妯″紡锛夛細" if "%IGNORE_ERROR%" == "1" ( cls goto :start diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d8d4b..f37d070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # CHANGELOG +## v1.5 +- 闅愯棌鈥滄鏌ュ簲鐢ㄦ縺娲昏剼鏈濅腑杈撳嚭 +- 鑷姩淇瑙﹀彂鏉′欢鍒嗙锛岀幇鍦ㄤ細鍒嗕袱绉嶆儏鍐佃Е鍙戝搴旇嚜鍔ㄤ慨澶 +- 鈥滃父瑙侀棶棰樷濇暣鍚堣嚦鑷姩淇 +- 瀹屽杽鈥滄鏌 ADB 绔彛鍗犵敤鎯呭喌鈥濆姛鑳 +- 褰 ADB 榛樿绔彛琚崰鐢ㄦ椂缁欏嚭璇︾粏鎻愮ず +- 鑷姩灏濊瘯缁撴潫鍗犵敤 ADB 绔彛鐨勮繘绋 +- 缇庡寲 if 鏍煎紡 +- 璋冩暣骞惰鑼冮儴鍒嗘枃瀛楁弿杩 +- 绉婚櫎涓嶅畬鍠勭殑灏忛粦灞嬬増鏈娴嬪姛鑳斤紙鍘熷洜瑙佷笅锛 + +> 鍏充簬绉婚櫎閮ㄥ垎搴旂敤鐗堟湰妫娴嬪姛鑳斤細浠讳綍搴旂敤婵娲绘椂閮藉彲鑳藉洜涓虹郴缁熸垨搴旂敤鐗堟湰绛夊師鍥犻亣鍒版棤娉曟縺娲荤殑鎯呭喌锛屼笖姝ゅ唴瀹瑰叿鏈夋椂鏁堟с傛鏃跺缁堝缓璁皾璇曟洿鏂板簲鐢ㄧ増鏈潵瑙e喅锛屾垨鑰呭悜寮鍙戣呮彁渚涘弽棣 + +> `[娉ㄦ剰]`锛氭墽琛岄亣鍒伴敊璇侀渶瑕佺敤鎴锋敞鎰忔垨浼氬鐢ㄦ埛閫犳垚涓瀹氬奖鍝嶆椂浣跨敤锛屽鎻愮ず椋庨櫓銆佽嚜鍔ㄥ叧闂繘绋嬬瓑 + +> `[鎻愮ず]`锛氬湪鐢ㄦ埛鍙兘闇瑕佹墜鍔ㄦ鏌ユ垨鎵ц鏌愪簺鎿嶄綔鏃朵娇鐢紝濡傛鏌ョ姸鎬併侀夋嫨妯″紡銆侀鍑虹▼搴忕瓑 + ## v1.4 - 淇寮哄埗鎵ц妯″紡閬楁紡婵娲婚粦闃堢殑闂 - 淇 UTF-8 鐗堟湰`chcp`璁剧疆浠嶄负 GB2312 鐨勯棶棰 diff --git a/README.md b/README.md index c0a23fc..bb152ab 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ - 鑷姩璇嗗埆骞惰烦杩囨縺娲绘湭瀹夎鐨勫簲鐢 - 鏈壘鍒 ADB 宸ュ叿鏃舵彁閱掑苟缁欏嚭瑙e喅鏂规 - 鎵ц閬囧埌閿欒鏃跺皾璇曞叧闂鍦ㄨ繍琛岀殑鍏跺畠 ADB 杩涚▼闃叉鍐茬獊 +- 妫鏌ュ簲鐢ㄦ縺娲昏剼鏈槸鍚﹀瓨鍦 - 鎵ц閬囧埌閿欒鏃舵彁渚涚枒闅捐В绛 - 鍙夊拷鐣ユ姤閿欑户缁墽琛 - 鎵ц瀹屾瘯鍚庢坊鍔犱娇鐢ㄦ妧宸ф彁绀 @@ -38,7 +39,7 @@ Tips锛氬綋杩炴帴鐨勮澶囨湭瀹夎鐩爣搴旂敤鏃讹紝灏嗚烦杩囨縺娲汇 娉細缁忚瘎浼板悗鍐冲畾**涓嶅姞鍏**`婵娲昏澶囩鐞嗗憳妯″紡`鍔熻兘锛屽師鍥犺瑙乕姝ゅ](https://github.com/Hakuin123/ADB-Launcher/issues/1)銆傛帹鑽愪娇鐢╗绉嬩箣鐩抅(https://atmb.top/guide/basic/dpm/)瀹炵幇姝ゅ姛鑳姐 -~~- [Dhizuku](https://github.com/iamr0s/Dhizuku)~~ +- ~~[Dhizuku](https://github.com/iamr0s/Dhizuku)~~ > 闇瑕佸熷姪璁惧鎵鏈夎呮潈闄愮殑搴旂敤鏁伴噺绻佸锛屼絾Android 绯荤粺璁惧畾鍏锋湁`璁惧鎵鏈夎卄鏉冮檺鐨勫簲鐢ㄦ湁涓斾粎鑳芥湁涓涓侱hizuku 鍙傝 Shizuku 鐨勮璁℃濇兂锛屽垎浜 DeviceOwner (璁惧鎵鏈夎) 鏉冮檺缁欏叾浣欏簲鐢