docs: image url

This commit is contained in:
FantasticLBP
2026-01-02 10:28:57 +08:00
parent 7ac7513900
commit 7843661458
29 changed files with 719 additions and 719 deletions

View File

@@ -1,7 +1,7 @@
## 写给 iOSer 的鸿蒙开发 tips
## 下载问题
![](./../assets/DevEco-Studio-DownloadNetworkErrror.png)
![](https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/DevEco-Studio-DownloadNetworkErrror.png)
The other possible cause is that the system language of the PC is English and the region code is US. You could try to perform the following operations to change the region code to CN. Before changing the region code, close DevEco Studio.
@@ -104,7 +104,7 @@ For Mac OS: ~/Library/Application Support/Huawei/DevEcoStudio3.0/options/country
参考鸿蒙 RN 团队在1月份的方案使用 stack 组件内部forEach 循环渲染子组件。适配初期,在嵌套不深的页面没有发现问题,整体上打通了从 JS 代码到引擎渲染的核心流程。
<img src='./../assets/HarmonyCrossPlatformArch.png' style="zoom:40%" />
<img src='https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyCrossPlatformArch.png' style="zoom:40%" />
左侧的 UI 树和右侧的 Model 树,通过 `@ObjectLink``@Observed` 来进行数据渲染和刷新。
@@ -224,23 +224,23 @@ Apsect.hookMethod({
无统一修改点场景三:`router.pushUrl`,编译时 + 运行时组合实现偷梁换柱。
<img src="./../assets/HarmonyHookWithInstrument.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyHookWithInstrument.png" style="zoom:40%" />
如何实现编译时替换?
鸿蒙提供了 Hvigor Plugin 编译时自定义插件,用于实现定制化构建。思路:直接利用 Hvigor Plugin hook 某个编译 task
<img src="./../assets/HarmonyHookStep1.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyHookStep1.png" style="zoom:40%" />
那到底 hook 哪个编译 task
<img src="./../assets/HarmonyHookCompileTask.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyHookCompileTask.png" style="zoom:40%" />
问题:
- output 修改无效
<img src="./../assets/HarmonyCannotChangeOutputFile.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyCannotChangeOutputFile.png" style="zoom:40%" />
@@ -252,7 +252,7 @@ Apsect.hookMethod({
- input 无法 hookHvigor plugin 暂未开放相关能力
<img src="./../assets/HarmonyHookWithChangeInput.png" style="zoom:30%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyHookWithChangeInput.png" style="zoom:30%" />
Hvigor 目前开放的能力有限,仅支持在默认的 task 前后加一些钩子函数。但无法修改 input。此路不通
@@ -260,7 +260,7 @@ Apsect.hookMethod({
思路copy -> modify -> revert
<img src="./../assets/HarmonyHookWithAST.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyHookWithAST.png" style="zoom:40%" />
@@ -302,13 +302,13 @@ Apsect.hookMethod({
于是,整个流程就变成了
<img src="./../assets/HarmonyHookWithAST.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyHookWithAST.png" style="zoom:40%" />
可以利用 [Typescript AST Viewer](https://github.com/dsherret/ts-ast-viewer) 来查看 AST 抽象语法树信息。可以在线查看 AST官网地址为[Typescript AST Viewer](https://ts-ast-viewer.com)
<img src="./../assets/HarmonyFunctionHook.png" style="zoom:40%" />
<img src="https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/master/assets/HarmonyFunctionHook.png" style="zoom:40%" />