chore(app): 真机调试配套——调试签名(.ohos 证书)/应用名美搭/新图标/默认地址改局域网 8666;构建门禁脚本 .build-gate.bat(签名打包需 JBR java,README 记录 spawn java ENOENT 系旧 hvigor 守护进程缓存坏 PATH 所致);.gitignore 收录 .hvigor 构建缓存

This commit is contained in:
xsl
2026-08-16 11:41:06 +08:00
parent 83fd48b910
commit 312ef2b716
11 changed files with 44 additions and 9 deletions
+3
View File
@@ -19,3 +19,6 @@ graphify-out/.graphify_python
graphify-out/.graphify_root
graphify-out/.vocab.txt
graphify-out/cache/
# hvigor 构建缓存
.hvigor/
+10
View File
@@ -0,0 +1,10 @@
@echo off
set "PATH=C:\Program Files\Huawei\DevEco Studio\jbr\bin;%PATH%"
set "DEVECO_SDK_HOME=C:\Program Files\Huawei\DevEco Studio\sdk"
echo [preflight] where java:
where java
echo [preflight] node spawn test:
"C:\Program Files\Huawei\DevEco Studio\tools\node\node.exe" D:\meida\app\.spawn-test.js
cd /d D:\meida\app
echo [build] start
"C:\Program Files\Huawei\DevEco Studio\tools\node\node.exe" "C:\Program Files\Huawei\DevEco Studio\tools\hvigor\bin\hvigorw.js" --mode module -p module=entry@default assembleHap --analyze=false --daemon=false
@@ -2,7 +2,7 @@
"string": [
{
"name": "app_name",
"value": "app"
"value": "美搭"
}
]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 12 KiB

+14 -6
View File
@@ -6,15 +6,23 @@
## 命令行构建(Agent/CI 用的门禁)
```bash
cd G:/meida/app
export DEVECO_SDK_HOME="C:/Program Files/Huawei/DevEco Studio/sdk"
"C:/Program Files/Huawei/DevEco Studio/tools/node/node.exe" \
"C:/Program Files/Huawei/DevEco Studio/tools/hvigor/bin/hvigorw.js" \
> 工程配了真机调试签名(`.ohos/config` 下证书)后,PackageHap/SignHap 需要 java:
> PATH 里须有 DevEco 自带 JBR(`jbr/bin`),且**不能有带旧环境的 hvigor 守护进程残留**
> (守护进程会缓存启动时的 PATH,报 `spawn java ENOENT` 时先
> `taskkill /F /PID <hvigor daemon的node进程>` 再重试)。
```bat
(等价于仓库根的 app/.build-gate.bat)
set "PATH=C:\Program Files\Huawei\DevEco Studio\jbr\bin;%PATH%"
set "DEVECO_SDK_HOME=C:\Program Files\Huawei\DevEco Studio\sdk"
cd /d <repo>\app
"C:\Program Files\Huawei\DevEco Studio\tools\node\node.exe" ^
"C:\Program Files\Huawei\DevEco Studio\tools\hvigor\bin\hvigorw.js" ^
--mode module -p module=entry@default assembleHap --analyze=false --daemon=false
```
`BUILD SUCCESSFUL` 即门禁通过(未签名 HAP 正常——签名等 AGC 证书)。运行/调试用 DevEco Studio 打开本工程点 Run(模拟器或真机,真机需先配签名)。
`BUILD SUCCESSFUL` 即门禁通过;产物 `entry/build/default/outputs/default/entry-default-signed.hap`
(已用调试证书签名,可直接 `hdc install` 到真机)。
## 代码约定
+15 -1
View File
@@ -1,6 +1,20 @@
{
"app": {
"signingConfigs": [],
"signingConfigs": [
{
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "C:\\Users\\youmi\\.ohos\\config\\default_app_7oyN4SmerXoqWpORnThdj7HJQc-Uvz9AusJXlFjQgt4=.cer",
"keyAlias": "debugKey",
"keyPassword": "0000001BE20911DD8845DD093D7A01CBE5481C81764769809C9BF80D93020A1FDCEB9432FB5C08DDEF808B",
"profile": "C:\\Users\\youmi\\.ohos\\config\\default_app_7oyN4SmerXoqWpORnThdj7HJQc-Uvz9AusJXlFjQgt4=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "C:\\Users\\youmi\\.ohos\\config\\default_app_7oyN4SmerXoqWpORnThdj7HJQc-Uvz9AusJXlFjQgt4=.p12",
"storePassword": "0000001BDD82AF3B7F4DC062470C6F6831D38E94E5BC584F4E4439362CDE8E950D873B51744CA0614B4D94"
}
}
],
"products": [
{
"name": "default",
+1 -1
View File
@@ -32,7 +32,7 @@ interface AuthWireResp {
const PREF_NAME = 'meida_auth'
const KEY_TOKENS = 'tokens'
const KEY_BASE_URL = 'base_url'
export const DEFAULT_BASE_URL = 'http://127.0.0.1:8000'
export const DEFAULT_BASE_URL = 'http://192.168.3.25:8666'
export class AuthStore {
private static tokens: TokenPair | undefined
Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 12 KiB