100% 复刻 lzyzsd/JsBridge(对照原 Android com.tagmae.jsbridge 逐字): - IWebController + WebviewControllerAdapter(emitter UI 线程守卫,§5.5) + FakeWebController(单测用) - Message(5字段,undefined省略) + MessageCodec(toJson/toArray + dispatchMessage 两次正则转义逐字复刻) - HandlerRegistry + 空实现 DefaultHandler 兜底(H5 调用永不报错最后防线) - BridgeController:onLoadIntercept(decode→yy://return/yy://)/callHandler/send/onPageEnd/ flushMessageQueue(_fetchQueue 经 yy://return 回传,非 runJavaScript 返回值)/handleReturnData/ 启动队列补发;对能力零感知、纯逻辑可测 - build 编译通过(ArkTS 严格) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
80 lines
2.0 KiB
JSON
80 lines
2.0 KiB
JSON
{
|
|
"app": {
|
|
"signingConfigs": [
|
|
{
|
|
"name": "default",
|
|
"type": "HarmonyOS",
|
|
"material": {
|
|
"certpath": "C:\\Users\\Joywayer\\.ohos\\config\\default_gamelobby_Tg3dZWT2uE_yyJID0XfKtliH7uuF1dWWNM21ecODP2A=.cer",
|
|
"keyAlias": "debugKey",
|
|
"keyPassword": "0000001BB88B945FF086A71E48E2000AC023983A9F3246CAC3CDD481C5ECCE32627C982DD892BD85A5FBC7",
|
|
"profile": "C:\\Users\\Joywayer\\.ohos\\config\\default_gamelobby_Tg3dZWT2uE_yyJID0XfKtliH7uuF1dWWNM21ecODP2A=.p7b",
|
|
"signAlg": "SHA256withECDSA",
|
|
"storeFile": "C:\\Users\\Joywayer\\.ohos\\config\\default_gamelobby_Tg3dZWT2uE_yyJID0XfKtliH7uuF1dWWNM21ecODP2A=.p12",
|
|
"storePassword": "0000001B3D659D26D98202CB916B9A08D909956365FC114D150ECBBDDDDB9CC07E454FDF9E65AC7A5198EC"
|
|
}
|
|
}
|
|
],
|
|
"products": [
|
|
{
|
|
"name": "default",
|
|
"signingConfig": "default",
|
|
"targetSdkVersion": "6.1.1(24)",
|
|
"compatibleSdkVersion": "6.1.1(24)",
|
|
"runtimeOS": "HarmonyOS",
|
|
"buildOption": {
|
|
"strictMode": {
|
|
"caseSensitiveCheck": true,
|
|
"useNormalizedOHMUrl": true
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"buildModeSet": [
|
|
{
|
|
"name": "debug",
|
|
},
|
|
{
|
|
"name": "release"
|
|
}
|
|
]
|
|
},
|
|
"modules": [
|
|
{
|
|
"name": "entry",
|
|
"srcPath": "./entry",
|
|
"targets": [
|
|
{
|
|
"name": "default",
|
|
"applyToProducts": [
|
|
"default"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "contracts",
|
|
"srcPath": "./contracts"
|
|
},
|
|
{
|
|
"name": "common",
|
|
"srcPath": "./common"
|
|
},
|
|
{
|
|
"name": "platform",
|
|
"srcPath": "./platform"
|
|
},
|
|
{
|
|
"name": "domain_resource",
|
|
"srcPath": "./domain_resource"
|
|
},
|
|
{
|
|
"name": "feature_bridge",
|
|
"srcPath": "./feature_bridge"
|
|
},
|
|
{
|
|
"name": "feature_capabilities",
|
|
"srcPath": "./feature_capabilities"
|
|
}
|
|
]
|
|
} |