修正 app_data.js 三处字段与 Android 不一致(H5 零改动)

§4.2 配置项接口逻辑审计发现 app_data.js 注入有三处偏离原 Android
inith5data(weclomeactivity1/NewwebviewActivity 两处实测一致):

1. app_version:Android 硬编码 `var app_version=1;`(数字常量,"初始化框架
   加载方式"标志,非资源版本);原实现误用 res.localVersion()(如 "261" 且成
   字符串)。改为固定数字字面量 1。契约文档 §6 此处亦误录为"version.xml 的
   version",一并纠正。
2. app_gamename:Android 取 getAllFilename("gamestart")(即 'gamehall');原
   实现误用 version.xml 的 <game name>(如"友乐游戏")。改为 config.gamestart。
3. app_getwifisignalLevel:Android 硬编码 `=1`(数字);原实现为字符串 '0'。
   改为固定数字字面量 1。

buildValues 签名随之简化为 (config, launchtype),去掉不再需要的 version/
gameName 入参;大厅(StartupOrchestrator '0')、子游戏(BridgeGameContainer '1')
两调用点同步更新。buildJs 对 app_version/app_getwifisignalLevel 输出数字字面量
(无引号),其余字符串字段保持引号,逐字对齐 Android。

其余审计结论一致:11 个本地配置键读取一致(servertype/gameserver 契约标
"无代码读取"已正确省略);桥 handler getmarketname→market、getOther→other、
getothername→按名取配置(lookupConfig 全键 + 未知返回'')均与 Android getAllFilename
对齐。真机回归:大厅 V1.261 正常加载渲染。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lanterngamescn
2026-06-27 09:31:22 +08:00
co-authored by Claude Opus 4.8
parent 600378f723
commit d335a589b6
4 changed files with 33 additions and 24 deletions
@@ -183,7 +183,7 @@ export struct BridgeGameContainer {
}
const subDir: string = `${res.paths().urlpath}/${d.dir}`;
// 子游戏目录自带 app_data.jsH5 同步读),launchtype='1'
const values: AppDataValues = AppDataInjector.buildValues(cfg.getLocal(), `${res.localVersion()}`, '1', res.localGameName());
const values: AppDataValues = AppDataInjector.buildValues(cfg.getLocal(), '1');
AppDataInjector.inject(subDir, values);
this.slotL?.deactivate();
this.slotS = new WebSlot('subgame', new webview.WebviewController(), true, this.uploadServer);