Files
ykxmz/_build/bump_to_150.py
T
xmz7891 b705216e4a ykxmz 1.5.0锛氫慨澶嶆墜琛ㄧ TLS 璇佷功鏍¢獙 + MTU 淇缃戠粶绋冲畾鎬?
琚帶绔?- 淇 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 + 鍙岃繛鎺?
鏂囨。
- 璁稿彲鍗忚 / 瀹夎鍓嶅繀璇?/ 瀹夎鍚庨』鐭ワ紙浣滆€咃細灏忛害瀛愶級
2026-10-06 19:01:05 +08:00

125 lines
4.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
r"""精准升级版本号 1.4.0 -> 1.5.0。
**不能全局替换** —— 项目里有 40 多个文件含 "1.4.0",其中大部分是:
* 测试用的数据(配对码、设备版本号字段)
* HTTP User-Agent "LanRemote/1.4.0"
(Cloudflare 的 Browser Integrity Check 认这个,
而且 20 多个测试都在断言它 —— 动它要同步改一大片)
* _build/ 下的一次性脚本(历史记录,不用改)
所以只改**用户能看到版本号的地方**:
1. android/build_apk.ps1 APK 文件名 + manifest 版本
2. docs/*.txt 三份文档
3. windows/lanremote/__init__.py __version__
4. 会断言版本号的测试
UA 保持 "LanRemote/1.4.0" 不动(它是协议标识,不是产品版本)。
"""
from __future__ import annotations
import re
import sys
from pathlib import Path
ROOT = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote")
OLD, NEW = "1.4.0", "1.5.0"
# 逐文件、逐模式改,写清楚每一处为什么改
PLAN = [
# (文件, 旧片段, 新片段, 说明)
("android/build_apk.ps1",
'$apkName = "ykxmz-watch-1.4.0.apk"',
'$apkName = "ykxmz-watch-1.5.0.apk"',
"APK 文件名"),
("android/build_apk.ps1",
'--version-code 3 `',
'--version-code 5 `',
"versionCode"),
("android/build_apk.ps1",
'--version-name "1.4.0" `',
'--version-name "1.5.0" `',
"versionName"),
("windows/lanremote/__init__.py",
'"1.4.0"',
'"1.5.0"',
"__version__"),
]
# 文档:把"版本 1.4.0"之类改掉
DOC_PATTERNS = [
(r"1\.4\.0", "1.5.0"),
]
# 测试里断言成品文件名的
TEST_PATTERNS = [
("ykxmz-1.4.0", "ykxmz-1.5.0"),
("ykxmz-watch-1.4.0", "ykxmz-watch-1.5.0"),
]
def main() -> int:
changed = []
# ---- 1. 精准替换 ----
for rel, old, new, why in PLAN:
path = ROOT / rel
if not path.is_file():
print(f" [跳过] {rel} 不存在")
continue
text = path.read_text(encoding="utf-8")
if old not in text:
print(f" [跳过] {rel}: 找不到 {old[:40]!r}(可能已改)")
continue
path.write_text(text.replace(old, new, 1),
encoding="utf-8", newline="\n")
changed.append(f"{rel}({why})")
# ---- 2. 文档 ----
for path in sorted((ROOT / "docs").glob("*.txt")):
raw = path.read_bytes()
had_bom = raw.startswith(b"\xef\xbb\xbf")
text = raw.decode("utf-8-sig")
new_text = re.sub(r"1\.4\.0", "1.5.0", text)
if new_text != text:
path.write_bytes((b"\xef\xbb\xbf" if had_bom else b"")
+ new_text.replace("\r\n", "\n").encode("utf-8"))
changed.append(f"docs/{path.name}")
# ---- 3. 断言成品文件名的测试 ----
for name in ("test_package_remote.py", "test_apk_contents.py",
"acceptance.py"):
path = ROOT / "_tests" / name
if not path.is_file():
continue
text = path.read_text(encoding="utf-8")
original = text
for old, new in TEST_PATTERNS:
text = text.replace(old, new)
if text != original:
path.write_text(text, encoding="utf-8", newline="\n")
changed.append(f"_tests/{name}")
print(f" 共改了 {len(changed)} 处:")
for item in changed:
print(f" {item}")
print()
print(" 注意:HTTP User-Agent 仍是 \"LanRemote/1.4.0\"(协议标识,不是产品版本)。")
# ---- 复核 ----
print()
print(" 复核关键位置:")
for rel, needle in (("android/build_apk.ps1", "ykxmz-watch-1.5.0.apk"),
("android/AndroidManifest.xml", '1.5.0'),
("_build/package_remote.py", '"1.5.0"')):
path = ROOT / rel
if path.is_file():
ok = needle in path.read_text(encoding="utf-8")
print(f" {rel}: {'✓' if ok else '✗'} 含 {needle}")
return 0
if __name__ == "__main__":
sys.exit(main())