@onekeyfe/hd-core 1.2.0-alpha.78 → 1.2.0-alpha.79

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.
Files changed (38) hide show
  1. package/__tests__/check-all-firmware-release-protocol-v2.test.ts +12 -71
  2. package/__tests__/protocol-v2-resources.test.ts +102 -222
  3. package/__tests__/protocol-v2.test.ts +110 -380
  4. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  5. package/dist/api/FirmwareUpdateV4.d.ts +0 -6
  6. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  7. package/dist/api/UploadPortfolio.d.ts.map +1 -1
  8. package/dist/data-manager/DataManager.d.ts +1 -2
  9. package/dist/data-manager/DataManager.d.ts.map +1 -1
  10. package/dist/index.d.ts +74 -32
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +255 -499
  13. package/dist/inject.d.ts.map +1 -1
  14. package/dist/protocols/protocol-v2/resources.d.ts +31 -28
  15. package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
  16. package/dist/types/api/checkAllFirmwareRelease.d.ts +1 -0
  17. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  18. package/dist/types/api/export.d.ts +1 -0
  19. package/dist/types/api/export.d.ts.map +1 -1
  20. package/dist/types/api/index.d.ts +2 -0
  21. package/dist/types/api/index.d.ts.map +1 -1
  22. package/dist/types/api/protocolV2ResourceManifest.d.ts +17 -0
  23. package/dist/types/api/protocolV2ResourceManifest.d.ts.map +1 -0
  24. package/dist/types/settings.d.ts +30 -21
  25. package/dist/types/settings.d.ts.map +1 -1
  26. package/package.json +4 -4
  27. package/src/api/CheckAllFirmwareRelease.ts +5 -34
  28. package/src/api/FirmwareUpdateV4.ts +48 -220
  29. package/src/api/UploadPortfolio.ts +18 -0
  30. package/src/data-manager/DataManager.ts +2 -6
  31. package/src/index.ts +6 -0
  32. package/src/inject.ts +2 -0
  33. package/src/protocols/protocol-v2/resources.ts +193 -324
  34. package/src/types/api/checkAllFirmwareRelease.ts +1 -0
  35. package/src/types/api/export.ts +4 -0
  36. package/src/types/api/index.ts +2 -0
  37. package/src/types/api/protocolV2ResourceManifest.ts +19 -0
  38. package/src/types/settings.ts +30 -36
@@ -64,48 +64,42 @@ export type IProtocolV2FirmwareComponent = {
64
64
  version?: IVersionArray;
65
65
  };
66
66
 
67
- export type IProtocolV2ResourceType =
68
- | 'images'
69
- | 'animation'
70
- | 'wallpaper'
71
- | 'translations'
72
- | 'roobert'
73
- | 'noto'
74
- | 'firmware_logo';
75
-
76
- /** Pro2 RES package descriptor. Hashes identify content without a human-managed version. */
77
- export type IProtocolV2Resource = {
78
- type: IProtocolV2ResourceType;
79
- url: string;
80
- /** Complete okpkg file size in bytes. */
81
- size: number;
82
- /** SHA-256 of the complete okpkg file. */
83
- fileHash: string;
84
- /** SHA3-512 header_hash from the signed okpkg header. */
85
- headerHash: string;
67
+ export type IProtocolV2ResourceSource = {
68
+ manifestUrl: string;
86
69
  };
87
70
 
88
- /** A file from the Protocol V2 resource manifest, written directly with FileWrite. */
89
- export type IProtocolV2ResourceFile = {
90
- name?: string;
91
- url: string;
92
- devicePath: string;
93
- size: number;
94
- /** SHA-256 of the complete file. */
95
- fileHash: string;
71
+ export type IProtocolV2Resources = {
72
+ source: IProtocolV2ResourceSource;
96
73
  };
97
74
 
98
- /** Optional Protocol V2 boot resources restored as individual files. */
99
- export type IProtocolV2BootResources = {
100
- required: false;
101
- target: 'RES';
102
- manifestUrl?: string;
103
- files: IProtocolV2ResourceFile[];
75
+ export type IProtocolV2ResourceManifestFile = {
76
+ archive_path: string;
77
+ original_name: string;
78
+ device_path: string;
79
+ size: number;
80
+ sha256: string;
81
+ signed: true;
82
+ sig_algo: 'ed25519' | 'mldsa65';
83
+ payload_version: string | null;
104
84
  };
105
85
 
106
- export type IProtocolV2Resources = {
107
- stable: IProtocolV2Resource[];
108
- boot?: IProtocolV2BootResources;
86
+ export type IProtocolV2ResourceManifest = {
87
+ schema: 1;
88
+ artifact_name: string;
89
+ release_name: string;
90
+ variant: 'resource';
91
+ commit: string;
92
+ short_sha: string;
93
+ timestamp_utc: string;
94
+ core_version: string;
95
+ key_set: string;
96
+ device_root: 'vol0:';
97
+ restore_mode: 'bootloader_update';
98
+ trees: Array<{
99
+ path: string;
100
+ device: string;
101
+ }>;
102
+ files: IProtocolV2ResourceManifestFile[];
109
103
  };
110
104
 
111
105
  /** Pro2 RESC bundle okpkg descriptor for incremental FileWrite synchronization. */