From 2a3c748964ad5ae9f5c0a27e497da8cd4bcba4d7 Mon Sep 17 00:00:00 2001 From: butubb <1422726308@qq.com> Date: Thu, 20 Aug 2026 10:40:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=85=B7=E9=A1=B5=E5=89=AA?= =?UTF-8?q?=E8=B4=B4=E6=9D=BF=E6=B3=A8=E5=85=A5=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?=E2=80=94=E2=80=94injectClipboard=20=E5=87=BD=E6=95=B0=E5=9C=A8?= =?UTF-8?q?=E9=98=B6=E6=AE=B53=E6=B8=85=E7=90=86=E6=97=B6=E8=A2=AB?= =?UTF-8?q?=E8=AF=AF=E5=88=A0=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8C=89=E9=92=AE?= =?UTF-8?q?=20JS=20=E6=8A=A5=E9=94=99=EF=BC=9B=E8=A1=A5=E5=85=A8=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=88=E6=A0=A1=E9=AA=8C=E2=86=92ClipInject=20?= =?UTF-8?q?=E9=80=9A=E9=81=93=20API=E2=86=92=E9=80=90=E5=8F=B0=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E8=A1=A8+toast=20=E6=B1=87=E6=80=BB=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=88=E5=90=8C=E6=AD=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/admin/tools.js | 27 +++++++++++++++++++++++++++ templates/admin/monitor.html | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/static/admin/tools.js b/static/admin/tools.js index 376278c..f262ee1 100644 --- a/static/admin/tools.js +++ b/static/admin/tools.js @@ -44,6 +44,33 @@ function toggleClipDevice(cb){ else _clipSelected.delete(cb.value); } +// 注入剪贴板(ClipInject APK 通道,Android 10+ 可用): +// am start 透明 Activity 写入 + u2 读回比对验证;结果逐台渲染 + toast 汇总 +function injectClipboard(){ + const text = document.getElementById('clip-text').value; + const serials = [..._clipSelected]; + if(!serials.length){showToast('请先勾选目标设备','error');return;} + if(!text.trim()){showToast('请输入注入内容','error');return;} + const btn = Array.from(document.querySelectorAll('#tools-sub-clipboard .btn-primary')) + .find(b=>b.textContent.includes('注入剪贴板')); + if(btn){btn.disabled = true; const old = btn.textContent; btn.textContent = '注入中...'; btn._old = old;} + apiPost('/api/tools/clipboard/set', {serials, text}).then(r=>{ + if(!r){showToast('请求失败','error');return;} + const rows = Object.entries(r.results||{}).map(([s,v])=>{ + const ok = !!v.ok; + return '