@seayoo-web/app-info 0.2.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # app-info
2
2
 
3
- 读取 `.apk` `.ipa` `.app` 的应用元信息,需要同时安装 `jszip@^3.10.1`
3
+ 读取 `.apk` `.ipa` `.app` 的应用元信息
4
4
 
5
5
  ## 读取 apk 文件
6
6
 
@@ -25,6 +25,8 @@ if (appInfo instanceof Error) {
25
25
  "manifest": {...}
26
26
  */
27
27
  }
28
+
29
+ const fileContent = await parser.readFile("AndroidManifest.xml", "text");
28
30
  ```
29
31
 
30
32
  ## 读取 ipa 文件
@@ -59,12 +61,7 @@ if (frameworkPlist instanceof Error) {
59
61
  }
60
62
 
61
63
  // 读取指定文件
62
- const fileContent = await parser.readFile("ComboConfig.json");
63
- if (fileContent instanceof Error) {
64
- console.log("ComboConfig.json parse error", fileContent.message);
65
- } else {
66
- console.log(fileContent); // fileContent 类型为 ArrayBuffer
67
- }
64
+ const fileContent = await parser.readFile("ComboConfig.json", "text");
68
65
  ```
69
66
 
70
67
  ## 读取鸿蒙 app 文件
@@ -89,4 +86,9 @@ if (appInfo instanceof Error) {
89
86
  }
90
87
  */
91
88
  }
89
+ // 读取 app 下文件
90
+ const fileContent = await parser.readFile("pack.info", "blob");
91
+
92
+ // 读取主包下的文件
93
+ const fileContent = await parser.readEntryHapFile("pkgInfo.json", "text");
92
94
  ```