添加设备支持列表

This commit is contained in:
zw
2025-08-28 15:46:17 +08:00
parent 93db41c3ae
commit 17c692b6c7
50 changed files with 206 additions and 10 deletions

2
.idea/iOSAI.iml generated
View File

@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.12 (IOS-AI)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.12" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

2
.idea/misc.xml generated
View File

@@ -3,5 +3,5 @@
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.12" /> <option name="sdkName" value="Python 3.12" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (IOS-AI)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
</project> </project>

59
.idea/workspace.xml generated
View File

@@ -5,9 +5,56 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="ai 开始测试"> <list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="ai 开始测试">
<change afterPath="$PROJECT_DIR$/SupportFiles/15.0/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.0/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.1/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.1/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.2/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.2/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.3.1/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.3.1/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.3/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.3/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.4/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.4/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.5/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.5/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.6.1/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.6.1/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.6/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.6/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.7/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.7/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.8/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/15.8/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.0/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.0/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.1/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.1/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.2/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.2/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.3.1/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.3.1/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.3/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.3/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.4/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.4/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.5/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.5/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.6/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.6/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.7/DeveloperDiskImage.dmg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/SupportFiles/16.7/DeveloperDiskImage.dmg.signature" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Utils/DevDiskImageDeployer.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/iOSAI.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/iOSAI.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Entity/Variables.py" beforeDir="false" afterPath="$PROJECT_DIR$/Entity/Variables.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Entity/Variables.py" beforeDir="false" afterPath="$PROJECT_DIR$/Entity/Variables.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Utils/Requester.py" beforeDir="false" afterPath="$PROJECT_DIR$/Utils/Requester.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Module/DeviceInfo.py" beforeDir="false" afterPath="$PROJECT_DIR$/Module/DeviceInfo.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Module/Main.py" beforeDir="false" afterPath="$PROJECT_DIR$/Module/Main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.bat" beforeDir="false" afterPath="$PROJECT_DIR$/build.bat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/03cb0d61638ab919e9c9c5e016b969ff40925b0c/bgv.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resources/833c034d29ee6b79e1dfd88dc1d454f3da1e8a3d/bgv.png" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -49,13 +96,14 @@
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent"><![CDATA[{
"keyToString": { "keyToString": {
"ASKED_ADD_EXTERNAL_FILES": "true",
"Python.123.executor": "Run", "Python.123.executor": "Run",
"Python.Main.executor": "Run", "Python.Main.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true", "SHARE_PROJECT_CONFIGURATION_FILES": "true",
"git-widget-placeholder": "main", "git-widget-placeholder": "main",
"javascript.nodejs.core.library.configured.version": "20.17.0", "javascript.nodejs.core.library.configured.version": "22.18.0",
"javascript.nodejs.core.library.typings.version": "20.17.58", "javascript.nodejs.core.library.typings.version": "22.18.0",
"last_opened_file_path": "F:/company code/AI item/20250820/iOSAI", "last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
"node.js.detected.package.eslint": "true", "node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true", "node.js.detected.package.tslint": "true",
@@ -164,6 +212,8 @@
<workItem from="1756124879602" duration="580000" /> <workItem from="1756124879602" duration="580000" />
<workItem from="1756184656258" duration="24292000" /> <workItem from="1756184656258" duration="24292000" />
<workItem from="1756271781908" duration="26153000" /> <workItem from="1756271781908" duration="26153000" />
<workItem from="1756303414374" duration="1018000" />
<workItem from="1756361418986" duration="4904000" />
</task> </task>
<task id="LOCAL-00001" summary="ai 开始测试"> <task id="LOCAL-00001" summary="ai 开始测试">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -183,11 +233,12 @@
<option featureType="com.intellij.fileTypeFactory" implementationName="*.bat" /> <option featureType="com.intellij.fileTypeFactory" implementationName="*.bat" />
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="ai 开始测试" /> <MESSAGE value="ai 开始测试" />
<option name="LAST_COMMIT_MESSAGE" value="ai 开始测试" /> <option name="LAST_COMMIT_MESSAGE" value="ai 开始测试" />
</component> </component>
<component name="com.intellij.coverage.CoverageDataManagerImpl"> <component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/iOSAI$Main.coverage" NAME="Main 覆盖结果" MODIFIED="1756302588713" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" /> <SUITE FILE_PATH="coverage/iOSAI$Main.coverage" NAME="Main Coverage Results" MODIFIED="1756366476180" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
<SUITE FILE_PATH="coverage/iOSAI$123.coverage" NAME="123 覆盖结果" MODIFIED="1756300694280" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" /> <SUITE FILE_PATH="coverage/iOSAI$123.coverage" NAME="123 覆盖结果" MODIFIED="1756300694280" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
</component> </component>
</project> </project>

View File

@@ -3,7 +3,7 @@ from typing import Dict, Any
from Entity.AnchorModel import AnchorModel from Entity.AnchorModel import AnchorModel
# wda apple bundle id # wda apple bundle id
WdaAppBundleId = "com.yoloAgant.wda.xctrunner" WdaAppBundleId = "com.yoloAgent.wda.xctrunner"
# 全局主播列表 # 全局主播列表
anchorList: list[AnchorModel] = [] anchorList: list[AnchorModel] = []
# 线程锁 # 线程锁

View File

@@ -54,9 +54,9 @@ class Deviceinfo(object):
cwd=str(self.iproxy_dir), cwd=str(self.iproxy_dir),
shell=False, shell=False,
text=True, text=True,
creationflags=self._creationflags,
encoding="utf-8", encoding="utf-8",
bufsize=1, bufsize=1,
creationflags=self._creationflags,
) )
# 3) 准备一个“启动器”(闭包):仅接受 (udid, local_port, remote_port) 参数 # 3) 准备一个“启动器”(闭包):仅接受 (udid, local_port, remote_port) 参数

View File

@@ -4,6 +4,7 @@ from pathlib import Path
from Module.DeviceInfo import Deviceinfo from Module.DeviceInfo import Deviceinfo
from Module.FlaskSubprocessManager import FlaskSubprocessManager from Module.FlaskSubprocessManager import FlaskSubprocessManager
from Utils.DevDiskImageDeployer import DevDiskImageDeployer
from Utils.LogManager import LogManager from Utils.LogManager import LogManager
# 确定 exe 或 py 文件所在目录 # 确定 exe 或 py 文件所在目录
@@ -26,8 +27,9 @@ if "--role=flask" in sys.argv:
# 项目入口 # 项目入口
if __name__ == "__main__": if __name__ == "__main__":
# 清空日志等
# LogManager.clearLogs() deployer = DevDiskImageDeployer(verbose=True)
deployer.deploy_all()
# 启动 Flask 子进程 # 启动 Flask 子进程
manager = FlaskSubprocessManager.get_instance() manager = FlaskSubprocessManager.get_instance()

Binary file not shown.

View File

@@ -0,0 +1 @@
<19>8!<21>=Y<01>

Binary file not shown.

View File

@@ -0,0 +1,2 @@
<EFBFBD>j#
<EFBFBD>8Q<EFBFBD>_<EFBFBD>jl<EFBFBD><EFBFBD>~<03><><EFBFBD>y<EFBFBD><79>=<3D><58><C487><EFBFBD><EFBFBD>_<>{,<08><><EFBFBD><EFBFBD><EFBFBD>ϋL<CF8B>Rm<52>0<EFBFBD>^<5E><>W<EFBFBD>SMF{[^<5E>f<><66><EFBFBD><EFBFBD><><CCA7><EFBFBD>ʼ<><CABC>辮($⊬Ei<18>{<7B><>Wq4e<>-ɿ

Binary file not shown.

View File

@@ -0,0 +1,2 @@
<EFBFBD>j#
<EFBFBD>8Q<EFBFBD>_<EFBFBD>jl<EFBFBD><EFBFBD>~<03><><EFBFBD>y<EFBFBD><79>=<3D><58><C487><EFBFBD><EFBFBD>_<>{,<08><><EFBFBD><EFBFBD><EFBFBD>ϋL<CF8B>Rm<52>0<EFBFBD>^<5E><>W<EFBFBD>SMF{[^<5E>f<><66><EFBFBD><EFBFBD><><CCA7><EFBFBD>ʼ<><CABC>辮($⊬Ei<18>{<7B><>Wq4e<>-ɿ

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
<EFBFBD><1B><><EFBFBD>i<>{<7B><><EFBFBD><EFBFBD>l<EFBFBD>̞d+3B<1B>s
<EFBFBD><EFBFBD><EFBFBD>NMÅ<EFBFBD><EFBFBD><01><>|<7C><06><><1E>)<11><>!<21><><EFBFBD>%<25><>o<EFBFBD>O

Binary file not shown.

View File

@@ -0,0 +1,2 @@
<EFBFBD><1B><><EFBFBD>i<>{<7B><><EFBFBD><EFBFBD>l<EFBFBD>̞d+3B<1B>s
<EFBFBD><EFBFBD><EFBFBD>NMÅ<EFBFBD><EFBFBD><01><>|<7C><06><><1E>)<11><>!<21><><EFBFBD>%<25><>o<EFBFBD>O

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
e#|?<3F><><EFBFBD><EFBFBD>WO<16>"m<>lW<6C>0 qf<71>=N<>`<60><>x<EFBFBD><78><03><>`<60>q<EFBFBD><71>y<EFBFBD><04><><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD>f<EFBFBD>@<40><><EFBFBD>^<5E><04><>tg<74><67><EFBFBD>ka1D<31>I'<27><><EFBFBD><01>
j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2@<40><>a<12><>P\<5C>y~Ru<52>r2¤<1D>Q<EFBFBD><01><<><E8AFB0>4<EFBFBD><34><EFBFBD><EFBFBD>

Binary file not shown.

View File

@@ -0,0 +1,2 @@
e#|?<3F><><EFBFBD><EFBFBD>WO<16>"m<>lW<6C>0 qf<71>=N<>`<60><>x<EFBFBD><78><03><>`<60>q<EFBFBD><71>y<EFBFBD><04><><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD>f<EFBFBD>@<40><><EFBFBD>^<5E><04><>tg<74><67><EFBFBD>ka1D<31>I'<27><><EFBFBD><01>
j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2@<40><>a<12><>P\<5C>y~Ru<52>r2¤<1D>Q<EFBFBD><01><<><E8AFB0>4<EFBFBD><34><EFBFBD><EFBFBD>

Binary file not shown.

View File

@@ -0,0 +1,2 @@
e#|?<3F><><EFBFBD><EFBFBD>WO<16>"m<>lW<6C>0 qf<71>=N<>`<60><>x<EFBFBD><78><03><>`<60>q<EFBFBD><71>y<EFBFBD><04><><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD>f<EFBFBD>@<40><><EFBFBD>^<5E><04><>tg<74><67><EFBFBD>ka1D<31>I'<27><><EFBFBD><01>
j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2@<40><>a<12><>P\<5C>y~Ru<52>r2¤<1D>Q<EFBFBD><01><<><E8AFB0>4<EFBFBD><34><EFBFBD><EFBFBD>

Binary file not shown.

View File

@@ -0,0 +1 @@
+<19><><EFBFBD><EFBFBD><EFBFBD>F<<3C><><EFBFBD>n<EFBFBD>И<<|<7C>٠3#

Binary file not shown.

View File

@@ -0,0 +1 @@
+<19><><EFBFBD><EFBFBD><EFBFBD>F<<3C><><EFBFBD>n<EFBFBD>И<<|<7C>٠3#

Binary file not shown.

View File

@@ -0,0 +1 @@
7e<37>k$#5@<02>΍mj<04><><EFBFBD><EFBFBD>P:/<2F> r<><72>̮9R<39><52><EFBFBD>)<29><>z<EFBFBD>*c4<63><03><><EFBFBD>߯<EFBFBD><DFAF><EFBFBD><EFBFBD><EFBFBD> <20><>u&<26><>7Q{F<7A><D383>[Qs<><73><EFBFBD><17>ZۊHnIֵ1<D6B5>kHVMP<4D>O".<2E><><7F><15><<3C><><EFBFBD>6?<3F>I<EFBFBD>&|<7C>0

Binary file not shown.

View File

@@ -0,0 +1 @@
7e<37>k$#5@<02>΍mj<04><><EFBFBD><EFBFBD>P:/<2F> r<><72>̮9R<39><52><EFBFBD>)<29><>z<EFBFBD>*c4<63><03><><EFBFBD>߯<EFBFBD><DFAF><EFBFBD><EFBFBD><EFBFBD> <20><>u&<26><>7Q{F<7A><D383>[Qs<><73><EFBFBD><17>ZۊHnIֵ1<D6B5>kHVMP<4D>O".<2E><><7F><15><<3C><><EFBFBD>6?<3F>I<EFBFBD>&|<7C>0

View File

@@ -0,0 +1,123 @@
# support_deployer.py
import os
import re
import shutil
from pathlib import Path
from dataclasses import dataclass, field
from typing import Iterable, Optional
VERSION_RE = re.compile(r"^\d+(?:\.\d+)*$") # 15 / 15.6 / 16.7 / 16.7.1
def _find_support_root(hint: Optional[Path]) -> Optional[Path]:
"""
1) 优先:显式传入的 hint
2) 其次:环境变量 SUPPORT_DDI_DIR
3) 再次:从 __file__ 所在目录向上搜索 3 层,找名为 'SupportFiles' 的目录
"""
# 1) 显式参数
if hint and hint.exists():
return hint.resolve()
# 2) 环境变量
env = os.environ.get("SUPPORT_DDI_DIR")
if env:
p = Path(env).expanduser()
if p.exists():
return p.resolve()
# 3) 向上搜索
here = Path(__file__).resolve().parent
for i in range(4): # 当前目录 + 向上 3 层
cand = here / "SupportFiles"
if cand.exists():
return cand.resolve()
here = here.parent
return None
@dataclass
class DevDiskImageDeployer:
"""
同步 SupportFiles/<version>/... 到 ~/.tidevice/device-support/<version>/...
- 自动定位 SupportFiles显式参数/环境变量/向上搜索)
- 已存在则跳过,不存在才复制
- 详细日志
"""
project_support_root: Optional[Path] = None # 可不传,自动发现
cache_root: Optional[Path] = None # 默认 ~/.tidevice/device-support
verbose: bool = True
dry_run: bool = False
overwrite: bool = False
_src_dir: Path = field(init=False, repr=False)
_cache_dir: Path = field(init=False, repr=False)
def __post_init__(self):
src = _find_support_root(self.project_support_root)
if src is None:
raise FileNotFoundError(
"未找到 SupportFiles 目录。"
"可传入 project_support_root或设置环境变量 SUPPORT_DDI_DIR"
"或确保在当前文件上层 3 级目录内存在名为 'SupportFiles' 的目录。"
)
self._src_dir = src
if self.cache_root is None:
self._cache_dir = Path.home() / ".tidevice" / "device-support"
else:
self._cache_dir = Path(self.cache_root).expanduser().resolve()
self._cache_dir.mkdir(parents=True, exist_ok=True)
if self.verbose:
print(f"[INFO] resolved SupportFiles = {self._src_dir}")
print(f"[INFO] cache_dir = {self._cache_dir}")
# 打印一眼能看见的兄弟目录,防路径误判
parent = self._src_dir.parent
try:
siblings = ", ".join(sorted(p.name for p in parent.iterdir() if p.is_dir()))
print(f"[INFO] SupportFiles parent = {parent}")
print(f"[INFO] siblings = {siblings}")
except Exception:
pass
def deploy_all(self):
candidates = list(self._iter_version_dirs(self._src_dir))
if self.verbose:
if not candidates:
print("[WARN] 未发现任何版本目录(仅匹配 15 / 15.6 / 16.7 / 16.7.1 这种名字)")
else:
print("[INFO] 发现版本目录:")
for c in candidates:
print(f" - {c.name}")
copied = skipped = 0
for ver_dir in candidates:
dst = self._cache_dir / ver_dir.name
if dst.exists() and not self.overwrite:
if self.verbose:
print(f"[SKIP] 已存在:{dst}")
skipped += 1
continue
if dst.exists() and self.overwrite:
if self.verbose:
print(f"[INFO] 覆盖模式,删除:{dst}")
if not self.dry_run:
shutil.rmtree(dst)
if self.verbose:
print(f"[COPY] {ver_dir} -> {dst}")
if not self.dry_run:
shutil.copytree(ver_dir, dst)
copied += 1
if self.verbose:
print(f"[SUMMARY] copied={copied}, skipped={skipped}, total={copied+skipped}")
# -------- helpers --------
def _iter_version_dirs(self, root: Path) -> Iterable[Path]:
for p in sorted(root.iterdir()):
if p.is_dir() and VERSION_RE.match(p.name):
yield p

View File

@@ -18,6 +18,7 @@ python -m nuitka Module/Main.py ^
--include-module=urllib3 ^ --include-module=urllib3 ^
--include-module=certifi ^ --include-module=certifi ^
--include-module=idna ^ --include-module=idna ^
--include-data-dir="E:/Code/python/iOSAI/SupportFiles=SupportFiles" ^
--include-data-dir="E:/Code/python/iOSAI/resources=resources" ^ --include-data-dir="E:/Code/python/iOSAI/resources=resources" ^
--include-data-files="E:/Code/python/iOSAI/resources/iproxy/*=resources/iproxy/" ^ --include-data-files="E:/Code/python/iOSAI/resources/iproxy/*=resources/iproxy/" ^
--windows-icon-from-ico=resources/icon.ico --windows-icon-from-ico=resources/icon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB