@onekeyfe/react-native-app-update 1.1.26 → 1.1.27
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/build.gradle
CHANGED
|
@@ -39,6 +39,14 @@ android {
|
|
|
39
39
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
40
40
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
41
41
|
|
|
42
|
+
// When ONEKEY_ALLOW_SKIP_GPG_VERIFICATION env var is set to a non-empty, non-'false' value,
|
|
43
|
+
// enable the skip-GPG code paths. Without this flag, BuildConfig.ALLOW_SKIP_GPG_VERIFICATION
|
|
44
|
+
// is false and all skip-GPG logic is gated behind an immutable compile-time constant.
|
|
45
|
+
def allowSkipGPG = System.getenv('ONEKEY_ALLOW_SKIP_GPG_VERIFICATION') != null &&
|
|
46
|
+
System.getenv('ONEKEY_ALLOW_SKIP_GPG_VERIFICATION') != '' &&
|
|
47
|
+
System.getenv('ONEKEY_ALLOW_SKIP_GPG_VERIFICATION') != 'false'
|
|
48
|
+
buildConfigField("boolean", "ALLOW_SKIP_GPG_VERIFICATION", allowSkipGPG.toString())
|
|
49
|
+
|
|
42
50
|
externalNativeBuild {
|
|
43
51
|
cmake {
|
|
44
52
|
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
|
package/android/src/main/java/com/margelo/nitro/reactnativeappupdate/ReactNativeAppUpdate.kt
CHANGED
|
@@ -349,6 +349,7 @@ class ReactNativeAppUpdate : HybridReactNativeAppUpdateSpec() {
|
|
|
349
349
|
|
|
350
350
|
/** Returns true if the skip-GPG-verification toggle is enabled via MMKV storage. */
|
|
351
351
|
private fun isSkipGPGEnabled(): Boolean {
|
|
352
|
+
if (!BuildConfig.ALLOW_SKIP_GPG_VERIFICATION) return false
|
|
352
353
|
return try {
|
|
353
354
|
val context = NitroModules.applicationContext ?: return false
|
|
354
355
|
MMKV.initialize(context)
|
|
@@ -559,11 +560,11 @@ class ReactNativeAppUpdate : HybridReactNativeAppUpdateSpec() {
|
|
|
559
560
|
val filePath = filePathFromUrl(params.downloadUrl)
|
|
560
561
|
OneKeyLog.info("AppUpdate", "verifyASC: filePath=$filePath")
|
|
561
562
|
|
|
562
|
-
// Skip GPG verification only when both DevSettings and skip-GPG toggle are enabled
|
|
563
|
-
val devSettings = isDevSettingsEnabled()
|
|
564
|
-
val skipGPGToggle = isSkipGPGEnabled()
|
|
563
|
+
// Skip GPG verification only when BuildConfig allows it AND both DevSettings and skip-GPG toggle are enabled
|
|
564
|
+
val devSettings = if (BuildConfig.ALLOW_SKIP_GPG_VERIFICATION) isDevSettingsEnabled() else false
|
|
565
|
+
val skipGPGToggle = if (BuildConfig.ALLOW_SKIP_GPG_VERIFICATION) isSkipGPGEnabled() else false
|
|
565
566
|
OneKeyLog.info("AppUpdate", "verifyASC: GPG check: devSettings=$devSettings, skipGPGToggle=$skipGPGToggle")
|
|
566
|
-
if (devSettings && skipGPGToggle) {
|
|
567
|
+
if (BuildConfig.ALLOW_SKIP_GPG_VERIFICATION && devSettings && skipGPGToggle) {
|
|
567
568
|
OneKeyLog.warn("AppUpdate", "verifyASC: GPG verification skipped (DevSettings + skip-GPG enabled)")
|
|
568
569
|
return@async
|
|
569
570
|
}
|