@onekeyfe/react-native-bundle-update 1.1.21 → 1.1.23
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/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt
CHANGED
|
@@ -575,12 +575,12 @@ object BundleUpdateStoreAndroid {
|
|
|
575
575
|
/**
|
|
576
576
|
* Returns true if the OneKey developer mode (DevSettings) is enabled.
|
|
577
577
|
* Reads the persisted value from MMKV storage (key: onekey_developer_mode_enabled,
|
|
578
|
-
* instance: onekey-app-setting) written by the JS ServiceDevSetting layer.
|
|
578
|
+
* instance: onekey-app-dev-setting) written by the JS ServiceDevSetting layer.
|
|
579
579
|
*/
|
|
580
580
|
fun isDevSettingsEnabled(context: Context): Boolean {
|
|
581
581
|
return try {
|
|
582
582
|
MMKV.initialize(context)
|
|
583
|
-
val mmkv = MMKV.mmkvWithID("onekey-app-setting") ?: return false
|
|
583
|
+
val mmkv = MMKV.mmkvWithID("onekey-app-dev-setting") ?: return false
|
|
584
584
|
mmkv.decodeBool("onekey_developer_mode_enabled", false)
|
|
585
585
|
} catch (e: Exception) {
|
|
586
586
|
false
|
|
@@ -590,12 +590,12 @@ object BundleUpdateStoreAndroid {
|
|
|
590
590
|
/**
|
|
591
591
|
* Returns true if the skip-GPG-verification toggle is enabled in developer settings.
|
|
592
592
|
* Reads the persisted value from MMKV storage (key: onekey_bundle_skip_gpg_verification,
|
|
593
|
-
* instance: onekey-app-setting).
|
|
593
|
+
* instance: onekey-app-dev-setting).
|
|
594
594
|
*/
|
|
595
595
|
fun isSkipGPGEnabled(context: Context): Boolean {
|
|
596
596
|
return try {
|
|
597
597
|
MMKV.initialize(context)
|
|
598
|
-
val mmkv = MMKV.mmkvWithID("onekey-app-setting") ?: return false
|
|
598
|
+
val mmkv = MMKV.mmkvWithID("onekey-app-dev-setting") ?: return false
|
|
599
599
|
mmkv.decodeBool("onekey_bundle_skip_gpg_verification", false)
|
|
600
600
|
} catch (e: Exception) {
|
|
601
601
|
false
|
|
@@ -63,7 +63,8 @@ P2Q5dClenjjjVA==
|
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
65
|
// Public static store for AppDelegate access (called before JS starts)
|
|
66
|
-
|
|
66
|
+
@objcMembers
|
|
67
|
+
public class BundleUpdateStore: NSObject {
|
|
67
68
|
private static let bundlePrefsKey = "currentBundleVersion"
|
|
68
69
|
private static let nativeVersionKey = "nativeVersion"
|
|
69
70
|
|
|
@@ -197,16 +198,16 @@ public class BundleUpdateStore {
|
|
|
197
198
|
public static func isDevSettingsEnabled() -> Bool {
|
|
198
199
|
// Ensure MMKV is initialized (safe to call multiple times)
|
|
199
200
|
MMKV.initialize(rootDir: nil)
|
|
200
|
-
guard let mmkv = MMKV(mmapID: "onekey-app-setting") else { return false }
|
|
201
|
+
guard let mmkv = MMKV(mmapID: "onekey-app-dev-setting") else { return false }
|
|
201
202
|
return mmkv.bool(forKey: "onekey_developer_mode_enabled", defaultValue: false)
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
/// Returns true if the skip-GPG-verification toggle is enabled in developer settings.
|
|
205
206
|
/// Reads the persisted value from MMKV storage (key: onekey_bundle_skip_gpg_verification,
|
|
206
|
-
/// instance: onekey-app-setting).
|
|
207
|
+
/// instance: onekey-app-dev-setting).
|
|
207
208
|
public static func isSkipGPGEnabled() -> Bool {
|
|
208
209
|
MMKV.initialize(rootDir: nil)
|
|
209
|
-
guard let mmkv = MMKV(mmapID: "onekey-app-setting") else { return false }
|
|
210
|
+
guard let mmkv = MMKV(mmapID: "onekey-app-dev-setting") else { return false }
|
|
210
211
|
return mmkv.bool(forKey: "onekey_bundle_skip_gpg_verification", defaultValue: false)
|
|
211
212
|
}
|
|
212
213
|
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# react-native-bundle-update
|
|
2
|
-
|
|
3
|
-
react-native-bundle-update
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install react-native-bundle-update react-native-nitro-modules
|
|
9
|
-
|
|
10
|
-
> `react-native-nitro-modules` is required as this library relies on [Nitro Modules](https://nitro.margelo.com/).
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import { ReactNativeBundleUpdate } from 'react-native-bundle-update';
|
|
17
|
-
|
|
18
|
-
// ...
|
|
19
|
-
|
|
20
|
-
const result = await ReactNativeBundleUpdate.hello({ message: 'World' });
|
|
21
|
-
console.log(result); // { success: true, data: 'Hello, World!' }
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Contributing
|
|
25
|
-
|
|
26
|
-
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
27
|
-
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
28
|
-
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
29
|
-
|
|
30
|
-
## License
|
|
31
|
-
|
|
32
|
-
MIT
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|