M2(领域层): ConfigManager/VersionResolver/ResourceManager/AppDataInjector/StartupOrchestrator

T-M2-05 ConfigManager:本地 rawfile/app_config.json(§4.2 实测值)、远程 URL 拼装('-'→'/'+.txt+?a=ts 禁缓存)、
        长度<30 走 showmessage 阻断、二级 url 二次请求(语义待真机校验)、产出版本决策
T-M2-06 VersionResolver:纯函数,agentlist/gamelist 两棵树 + agent→channel→market→game 后层覆盖 +
        两树取更高 version(§4.4)。单测 8 用例全通过,覆盖率 81.8%(≥80%)
T-M2-07 ResourceManager:沙箱路径规范、内置包拷贝解压、version.xml 解析(@ohos.xml)、远程 zip 下载/删旧/解压、版本比较
T-M2-09 AppDataInjector:加载前写 <gameDir>/app_data.js(§6 全局变量同名同义,JSON.stringify 安全字面量)
T-M2-11 StartupOrchestrator:INIT→…→ENTER_HALL 状态机,远程失败降级本地、showmessage 阻断、weburl 空/非空入口规则
配套:module.json5 声明 ohos.permission.INTERNET + reason_internet 字符串

devecocli build 通过;scripts/test.sh 单测全通过(修复 PermissionRequestResult 顶层导入)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lanterngamescn
2026-06-25 18:29:45 +08:00
parent ecb0e4642a
commit d2da223c8d
15 changed files with 953 additions and 5 deletions
+10
View File
@@ -46,6 +46,16 @@
}
],
}
],
"requestPermissions": [
{
"name": "ohos.permission.INTERNET",
"reason": "$string:reason_internet",
"usedScene": {
"abilities": ["EntryAbility"],
"when": "inuse"
}
}
]
}
}
@@ -11,6 +11,10 @@
{
"name": "EntryAbility_label",
"value": "label"
},
{
"name": "reason_internet",
"value": "用于下载游戏资源与获取远程配置"
}
]
}
@@ -0,0 +1,13 @@
{
"agent": "veRa0qrBf0df2K1G4de2tgfmVxB2jxpv",
"channel": "FtJf073aa0d6rI1xD8J1Y42fINTm0ziK",
"gamedir": "FtJf073aa0d6rI1xD8J1Y42fINTm0ziK",
"gamestart": "gamehall",
"appversion": "49",
"market": "3",
"gameid": "",
"weburl": "",
"gameconfig": "tsgames.daoqi88.cn-config_test-update_jsonv2_test",
"other": "",
"tuiguang": ""
}