@seayoo-web/app-info 0.1.0 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/app-info",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "app info parser",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -24,8 +24,8 @@
24
24
  "jszip": "^3.10.1",
25
25
  "tsx": "^4.21.0",
26
26
  "@seayoo-web/scripts": "^3.1.6",
27
- "@seayoo-web/utils": "^4.1.3",
28
- "@seayoo-web/tsconfig": "^1.0.5"
27
+ "@seayoo-web/tsconfig": "^1.0.5",
28
+ "@seayoo-web/utils": "^4.1.3"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "jszip": "^3.10.1"
@@ -1,15 +1,19 @@
1
1
  import type { AppCommonInfo, FileInput, ParserOptions } from "./utils/base";
2
- import type { Application, CollapsedAttributes, Manifest } from "./utils/manifest";
3
- export type { Manifest, CollapsedAttributes, CollapsedValue, Application, Provider, Component, IntentFilter, } from "./utils/manifest";
2
+ import type { Manifest } from "./utils/manifest";
3
+ export type { Manifest, CollapsedAttributes, Application } from "./utils/manifest";
4
4
  /**
5
- * Android APK 应用信息接口
5
+ * Android APK 应用信息
6
6
  */
7
- export interface ApkInfo extends AppCommonInfo {
7
+ export interface AndroidAppInfo extends AppCommonInfo {
8
8
  /** Manifest 信息 */
9
9
  manifest: Manifest;
10
- /** Manifest.Application 信息 */
11
- application?: Application;
12
- /** Manifest.Application.metaData 信息 */
13
- metaData?: CollapsedAttributes[];
14
10
  }
15
- export declare function parseApk(file: FileInput, options?: ParserOptions): Promise<ApkInfo | Error>;
11
+ export declare class AndroidAppParser {
12
+ private zip;
13
+ constructor(file: FileInput);
14
+ parse(options?: ParserOptions): Promise<AndroidAppInfo | Error>;
15
+ /**
16
+ * 读取指定文件的内容
17
+ */
18
+ readFile(filePath: string | RegExp): Promise<ArrayBuffer | Error>;
19
+ }
@@ -1,13 +1,16 @@
1
1
  import type { FileInput, AppCommonInfo, ParserOptions } from "./utils/base";
2
- import type { PackageInfo, Summary } from "./utils/pack.info";
3
- export type { HosAppPackInfo, Summary, PackageInfo, AppInfo, ModuleInfo, DeviceType } from "./utils/pack.info";
2
+ import type { HosAppPackInfo } from "./utils/pack.info";
3
+ export type { HosAppPackInfo, Summary, PackageInfo, DeviceType } from "./utils/pack.info";
4
4
  export interface HosAppInfo extends AppCommonInfo {
5
- /** 摘要信息 */
6
- summary: Summary;
7
- /** 包信息列表,描述各个模块的安装和交付配置 */
8
- packages: PackageInfo[];
5
+ /** 包体信息 */
6
+ pack: HosAppPackInfo;
7
+ }
8
+ export declare class HosAppParser {
9
+ private zip;
10
+ constructor(file: FileInput);
11
+ parse(options?: ParserOptions): Promise<HosAppInfo | Error>;
12
+ /**
13
+ * 读取指定文件的内容
14
+ */
15
+ readFile(filePath: string | RegExp): Promise<ArrayBuffer | Error>;
9
16
  }
10
- /**
11
- * 分析鸿蒙 app 应用的 pack.info 文件
12
- */
13
- export declare function parseHosApp(file: FileInput, options?: ParserOptions): Promise<HosAppInfo | Error>;
@@ -1,29 +1,26 @@
1
1
  import type { AppCommonInfo, FileInput, ParserOptions } from "./utils/base";
2
2
  import type { PlistInfo } from "./utils/plist";
3
- export type { PlistInfo, PlistValue } from "./utils/plist";
3
+ export type { PlistInfo } from "./utils/plist";
4
4
  /**
5
5
  * iOS IPA 应用信息接口
6
6
  */
7
7
  export interface IosAppInfo extends AppCommonInfo {
8
8
  /** Info.plist 原始数据 */
9
- plist?: PlistInfo;
10
- /** 额外的模块 plist 信息 */
11
- frameworks?: Record<string, PlistInfo | Error | undefined>;
12
- /** 额外的文件信息 */
13
- files?: Record<string, ArrayBuffer | Error | undefined>;
9
+ plist: PlistInfo;
14
10
  }
15
- /**
16
- * 解析 iOS IPA 文件
17
- * @param file IPA 文件输入
18
- * @returns Promise<IosAppInfo | Error>
19
- */
20
- export declare function parseIpa(file: FileInput, options?: ParserOptions & {
11
+ export declare class IosAppParser {
12
+ private zip;
13
+ constructor(file: FileInput);
21
14
  /**
22
- * 查找更多模块的 plist 信息,传入模块名称,比如 "ComboSDKSentry"
15
+ * 解析应用 plist 信息
23
16
  */
24
- frameworks?: string[];
17
+ parse(options?: ParserOptions): Promise<IosAppInfo | Error>;
25
18
  /**
26
- * 读取更多文件信息,比如 "ComboSDK.json"
19
+ * 读取指定模块的 plist 信息
27
20
  */
28
- files?: string[];
29
- }): Promise<IosAppInfo | Error>;
21
+ parseFramework(name: string): Promise<PlistInfo | Error>;
22
+ /**
23
+ * 读取指定文件的内容
24
+ */
25
+ readFile(filePath: string | RegExp): Promise<ArrayBuffer | Error>;
26
+ }
@@ -1,8 +1,11 @@
1
+ import type { PromiseValue } from "@seayoo-web/utils";
2
+ import type { loadAsync } from "jszip";
1
3
  export type FileInput = Uint8Array | ArrayBuffer | Blob;
2
4
  export type ParserOptions = {
3
5
  /** 是否忽略图标,设置为 true 可以节约解析时间 */
4
6
  ignoreIcon?: boolean;
5
7
  };
8
+ export type JSZip = PromiseValue<ReturnType<typeof loadAsync>>;
6
9
  export interface AppCommonInfo {
7
10
  /** 包名 */
8
11
  package: string;