mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 21:50:44 +00:00
琚帶绔?- 淇 MTU 闂锛氬す MSS + 璺緞 MTU 鎺㈡祴锛堝叕缃戝彲鐢ㄧ巼 48% -> 100%锛?- 澶嶇敤 HTTP 杩炴帴锛堝厤鎺夋瘡娆℃柊寤?TLS 鐨?30% 鎻℃墜澶辫触锛?- 姣忓垎閽熷洖澶存壘灞€鍩熺綉锛岃嚜鍔ㄥ垏鍥炲揩 400 鍊嶇殑璺緞 - 鐢婚潰蹇冭烦甯э細闈欐鏃剁渷娴侀噺锛屽鎴风浠嶇煡閬撴祦鏄椿鐨?- 閿佸睆鏃剁粰鍑哄彲鎿嶄綔鐨勬彁绀? 鎵嬭〃绔?- 鍐呯疆 GTS Root R4 / GlobalSign Root CA锛屼慨 SSLHandshakeException - 杩炴帴閿欒缈昏瘧鎴愪汉璇濓紙璇佷功/鏃堕棿/瑙f瀽/瓒呮椂鍒嗗埆鎻愮ず锛?- 缁忎腑杞繛涓婂悗鐢ㄦ湇鍔″櫒鎶ョ殑鍦板潃鍒锋柊宸查厤瀵硅褰?- 鏂板灞€鍩熺綉杩炴帴椤甸潰銆佹湇鍔″櫒寤惰繜妫€娴? 鏈嶅姟鍣ㄧ - 鏀寔 chunked 璇锋眰浣擄紙淇瘡 16 绉掍竴娆$殑杩炴帴閿欎贡涓庡ぇ闈㈢Н 502锛?- 缃戠粶璋冧紭鑴氭湰 net-tune.sh锛堝紑鏈鸿嚜鍔ㄥ簲鐢級 - 绠$悊椤碉細鎵归噺鍒犻櫎銆佺綉缁滀綋妫€銆佷笅杞藉尯 - 闅ч亾鏀?HTTP/2 + 鍙岃繛鎺? 鏂囨。 - 璁稿彲鍗忚 / 瀹夎鍓嶅繀璇?/ 瀹夎鍚庨』鐭ワ紙浣滆€咃細灏忛害瀛愶級
113 lines
3.7 KiB
Python
113 lines
3.7 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""把活代码里的 LanRemote-Agent 统一改成 ykxmz。
|
||
|
||
跳过 _build/patch_*.py —— 那些是历史补丁的记录,改了反而对不上账。
|
||
"""
|
||
from __future__ import annotations
|
||
|
||
import re
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
ROOT = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote")
|
||
|
||
# 替换规则(注意顺序:长的先来)
|
||
RULES = [
|
||
("LanRemote-Agent.exe", "ykxmz.exe"),
|
||
("LanRemote-Agent-Windows.zip", "ykxmz-Windows.zip"),
|
||
('dist_exe" / "LanRemote-Agent"', 'dist_exe" / "ykxmz"'),
|
||
("dist_exe\\LanRemote-Agent", "dist_exe\\ykxmz"),
|
||
("dist_exe/LanRemote-Agent", "dist_exe/ykxmz"),
|
||
("LanRemote-Agent\\", "ykxmz\\"),
|
||
('"LanRemote-Agent"', '"ykxmz"'),
|
||
("LanRemote-Agent 那个目录", "ykxmz 那个目录"),
|
||
("LanRemote-Agent 目录", "ykxmz 目录"),
|
||
]
|
||
|
||
# 要改的文件(活代码)
|
||
TARGETS = [
|
||
ROOT / "windows" / "run_agent.py",
|
||
ROOT / "windows" / "lanremote" / "ui.py",
|
||
ROOT / "windows" / "lanremote" / "netcheck.py",
|
||
ROOT / "windows" / "lanremote" / "features.py",
|
||
ROOT / "windows" / "lanremote" / "firewall.py",
|
||
ROOT / "_build" / "package_remote.py",
|
||
ROOT / "_build" / "package.py",
|
||
ROOT / "_build" / "make_fix_bat.py",
|
||
ROOT / "_build" / "make_toolbox.py",
|
||
ROOT / "_build" / "rename_tools.py",
|
||
ROOT / "_build" / "make_exe_fix.py",
|
||
ROOT / "_build" / "test_resolve.py",
|
||
ROOT / "_build" / "test_resolve2.py",
|
||
ROOT / "_build" / "test_file_pull.py",
|
||
ROOT / "_tests" / "test_e2e_features.py",
|
||
ROOT / "_tests" / "test_package_remote.py",
|
||
ROOT / "_tests" / "test_clip_push_safe.py",
|
||
ROOT / "_tests" / "diag_all_commands.py",
|
||
ROOT / "_tests" / "acceptance.py",
|
||
ROOT / "_tests" / "test_firewall.py",
|
||
]
|
||
|
||
|
||
def main() -> int:
|
||
total = 0
|
||
touched = []
|
||
for path in TARGETS:
|
||
if not path.is_file():
|
||
continue
|
||
text = path.read_text(encoding="utf-8")
|
||
original = text
|
||
for old, new in RULES:
|
||
if old in text:
|
||
text = text.replace(old, new)
|
||
if text != original:
|
||
path.write_text(text, encoding="utf-8", newline="\n")
|
||
count = sum(original.count(o) for o, _ in RULES
|
||
if o in original)
|
||
touched.append((path.name, count))
|
||
total += count
|
||
|
||
for name, count in touched:
|
||
print(f" {name}: {count} 处")
|
||
print(f" 合计 {total} 处,{len(touched)} 个文件")
|
||
|
||
# 语法检查(只查 Python)
|
||
import ast
|
||
bad = []
|
||
for path in TARGETS:
|
||
if path.suffix != ".py" or not path.is_file():
|
||
continue
|
||
try:
|
||
ast.parse(path.read_text(encoding="utf-8"))
|
||
except SyntaxError as exc:
|
||
bad.append((path, exc))
|
||
if bad:
|
||
for path, exc in bad:
|
||
print(f" [坏] {path.name}: 行 {exc.lineno}: {exc.msg}")
|
||
return 1
|
||
print(" 所有 Python 文件语法正常")
|
||
|
||
# 确认活代码里没有残留(排除历史补丁)
|
||
left = []
|
||
for path in ROOT.rglob("*.py"):
|
||
rel = str(path.relative_to(ROOT))
|
||
if rel.startswith("_build") and path.name.startswith("patch_"):
|
||
continue
|
||
if rel.startswith("_build") and path.name.startswith(
|
||
("add_", "fix_", "rename_to_", "rename_tools")):
|
||
continue
|
||
text = path.read_text(encoding="utf-8", errors="replace")
|
||
if "LanRemote-Agent.exe" in text:
|
||
left.append(rel)
|
||
if left:
|
||
print(f" 还有 {len(left)} 个文件残留 LanRemote-Agent.exe:")
|
||
for item in left[:10]:
|
||
print(f" {item}")
|
||
else:
|
||
print(" 没有残留 ✓")
|
||
return 0
|
||
|
||
|
||
if __name__ == "__main__":
|
||
sys.exit(main())
|