@onekeyfe/react-native-bundle-crypto 3.0.157-alpha.273 → 3.0.157-alpha.276
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 +25 -6
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# react-native-bundle-crypto
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native update signature verification, file hashing and safe local file operations
|
|
4
|
+
for OneKey on iOS and Android. The caller owns download and installation policy.
|
|
4
5
|
|
|
5
|
-
[Native behavior specification](docs/SPEC.md)
|
|
6
|
+
[Native behavior specification](https://github.com/OneKeyHQ/app-modules/blob/main/native-modules/react-native-bundle-crypto/docs/SPEC.md)
|
|
6
7
|
|
|
7
8
|
## Installation
|
|
8
9
|
|
|
9
10
|
```sh
|
|
10
11
|
npm install @onekeyfe/react-native-bundle-crypto react-native-nitro-modules
|
|
12
|
+
```
|
|
11
13
|
|
|
12
14
|
> `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
|
|
13
|
-
```
|
|
14
15
|
|
|
15
16
|
## Usage
|
|
16
17
|
|
|
@@ -31,6 +32,25 @@ const isSame = ReactNativeBundleCrypto.secureEqualHex(
|
|
|
31
32
|
console.log(isSame);
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
## Verification and file operations
|
|
36
|
+
|
|
37
|
+
`verifyGpgCleartext` and `verifyDetachedAsc` return a validity flag, an optional
|
|
38
|
+
verified hash and a failure reason. Check validity before using the hash.
|
|
39
|
+
`sha256OfFile` returns a digest or a failure reason; it does not establish that
|
|
40
|
+
the file came from a trusted publisher on its own.
|
|
41
|
+
|
|
42
|
+
`hashDir` and `verifyDirAgainstHashes` support directory integrity checks.
|
|
43
|
+
Expected paths must stay inside the directory, and the verifier checks both
|
|
44
|
+
hashes and completeness. `validateExtractedPathSafety` checks extracted paths;
|
|
45
|
+
`atomicWriteFile`, `safeRename` and `listVersionDirs` expose local file helpers.
|
|
46
|
+
The application owns destination selection and sequencing these operations.
|
|
47
|
+
|
|
48
|
+
The complete types are in
|
|
49
|
+
[src/ReactNativeBundleCrypto.nitro.ts](src/ReactNativeBundleCrypto.nitro.ts).
|
|
50
|
+
Install the application's iOS pods and rebuild the native binary after adding
|
|
51
|
+
this Nitro module. Native verification uses the embedded OneKey public key,
|
|
52
|
+
not a caller-provided arbitrary verification key.
|
|
53
|
+
|
|
34
54
|
## Apple Gopenpgp framework
|
|
35
55
|
|
|
36
56
|
The Mac Catalyst slice in the vendored `Gopenpgp.xcframework` uses Gopenpgp
|
|
@@ -55,9 +75,8 @@ gomobile bind \
|
|
|
55
75
|
|
|
56
76
|
## Contributing
|
|
57
77
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
78
|
+
Follow the repository's
|
|
79
|
+
[native development workflow](https://github.com/OneKeyHQ/app-modules/blob/main/docs/NATIVE_MODULE_DEVELOPMENT.md).
|
|
61
80
|
|
|
62
81
|
## License
|
|
63
82
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-bundle-crypto",
|
|
3
|
-
"version": "3.0.157-alpha.
|
|
3
|
+
"version": "3.0.157-alpha.276",
|
|
4
4
|
"description": "react-native-bundle-crypto",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -49,14 +49,15 @@
|
|
|
49
49
|
],
|
|
50
50
|
"repository": {
|
|
51
51
|
"type": "git",
|
|
52
|
-
"url": "git+https://github.com/OneKeyHQ/app-modules
|
|
52
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|
|
53
|
+
"directory": "native-modules/react-native-bundle-crypto"
|
|
53
54
|
},
|
|
54
55
|
"author": "onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
55
56
|
"license": "MIT",
|
|
56
57
|
"bugs": {
|
|
57
|
-
"url": "https://github.com/OneKeyHQ/app-modules/
|
|
58
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
58
59
|
},
|
|
59
|
-
"homepage": "https://github.com/OneKeyHQ/app-modules/react-native-bundle-crypto#readme",
|
|
60
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-bundle-crypto#readme",
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"registry": "https://registry.npmjs.org/"
|
|
62
63
|
},
|