| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor(flexui-engine): overhaul logging system for security and clarity Phase 1 - Footstone core: - Add TDF_LOG_DEBUG=-1 severity level - Change FOOTSTONE_DLOG from compile-time (#ifndef NDEBUG) to runtime (IsDebugLoggingEnabled()), enabling unified debugMode control - Add SetDebugLoggingEnabled() to adjust min_log_level dynamically - Platform sinks: add DEBUG label, unify tag 'tdf'→'flexui' Phase 2 - ArkTS debugMode wiring: - Add Setting_SetDebugLogEnabled NAPI binding - Wire debugMode/enableLog to both ArkTS LogUtils and C++ DLOG - Single control point: params.enableLog || params.debugMode Phase 3 - JS content leak fixes: - js_driver_utils.cc: 'script content=<full source>' → 'script length=N' - contextify_module.cc: remove 'code=<full module source>' - asset_handler.cc: remove 'file_data=<full file content>' - jsh_vm.cc: ParseJson error JSON truncated to 200 chars Phase 4 - ERROR level correction (30+ sites): - web_socket_channel.cc: 9 normal events ERROR→INFO - jsh_inspector_client_impl.cc: 14 OH_LOG_ERROR→OH_LOG_INFO - js_driver_utils.cc: 6 OH_LOG_ERROR→OH_LOG_INFO - jsh_get_url_connection/debug_connection/devtools_data_source: ERROR→INFO Phase 5 - Bridge communication → debug-gated: - 8 ArkTS files: LogUtils.i→LogUtils.d for sensitive payload data (HTTP body/headers/cookies, storage keys/values, bridge params, callback JSON, env values) Phase 6 - Unified log tags: - LogUtils.ets: hilog domain 0x0002→0x0001 - entry.cc: 'FlexUILog'→'flexui' - ~40 TAG constants: prepend 'flexui:' prefix - Literal tags: 'flexui worker'→'flexui:Worker', 'flexui http'→'flexui:Http' - Fix 3 empty tag sites Phase 7 - Verbose JS console.log cleanup: - FlexUIBridge.ts: remove per-node DFS/sceneBuilder/flushQueue dumps, keep DFS-ORPHAN/dedup/error warnings - NativeBackendContext.ts: remove dumpNodeTree() call (eliminates [TREE]/parent-verification/childOrder per-render dumps), remove per-element flushing logs - dom_node.cc/root_node.cc: per-node DoLayout/SetLayoutSize LOG(INFO)→DLOG(INFO) Co-Authored-By: Claude <noreply@anthropic.com> | 2 个月前 | |
fix(engine): JSVM inspector 动态端口探测 + OpenInspector 失败显性化 真机问题:DevTools 连上后看不到 JS 内容。根因是 OH_JSVM_OpenInspector 写死 9225,而同设备常驻进程(实测 com.huawei.hmsapp.intelligent)占用 127.0.0.1:9225 导致 bind 失败,返回 JSVM_GENERIC_FAILURE(9)(JSVM 打印 "Please check the internet permisson." 为误导性通用提示,与 INTERNET 权限 无关——app 已声明并授予该权限)。 修复: 1. 动态端口探测:CreateInspector 顺序尝试 9225..9234(10 个),取第一个 OH_JSVM_OpenInspector 成功的端口;ConnInspector 的 /json 请求与 ws 中转 url 使用同一实际端口(JSHGetUrlConnection 参数化 port)。释放仍走 OH_JSVM_CloseInspector(env),与端口号无关,动态端口随 env 一并释放。 2. OpenInspector 失败不再静默:CreateInspector 返回 JSVM_Status; EnableScopeDebug(enableDebugFwk=false 延迟路径)失败回调 RUN_SCRIPT_ERROR 带原因(此前无条件回 ok);InitializeScope(enableDebugFwk=true)补 status 日志;SendMessageToJSH 在 debug_conn_ 为 NULL 时丢弃日志带上 inspector_open_status 便于定位。TS 主链路不受影响(调试降级不阻断运行)。 真机验证:9225 被占 → 自动落到 9226 status=0,/json 解析成功, JSHDebugConnection 建立,DevTools 可见 JS 内容。 | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 1 个月前 |