From f572e99f9c3ea4683a92a676e009bffdc683d5a0 Mon Sep 17 00:00:00 2001 From: Harsh Vardhan Date: Tue, 14 Nov 2023 17:06:38 +0530 Subject: [PATCH] chore(INJI-149)!: temporarily disable MMKV encryption for iOS Signed-off-by: Harsh Vardhan --- shared/cryptoutil/cryptoUtil.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shared/cryptoutil/cryptoUtil.ts b/shared/cryptoutil/cryptoUtil.ts index f36c6fb9a9..4ff8f8330e 100644 --- a/shared/cryptoutil/cryptoUtil.ts +++ b/shared/cryptoutil/cryptoUtil.ts @@ -1,3 +1,9 @@ +/** + * NOTE: Encryption for MMKV datastore has been disabled temporarily for + * evaluating an infrequent data loss issue. For more information see + * https://github.com/mosip/inji/pull/1006/files & + * https://mosip.atlassian.net/browse/INJI-149 + */ import {KeyPair, RSA} from 'react-native-rsa-native'; import forge from 'node-forge'; import {DEBUG_MODE_ENABLED, isIOS} from '../constants'; @@ -100,7 +106,7 @@ export async function encryptJson( data: string, ): Promise { // Disable Encryption in debug mode - if (DEBUG_MODE_ENABLED && __DEV__) { + if ((DEBUG_MODE_ENABLED && __DEV__) || isIOS()) { return JSON.stringify(data); } @@ -120,7 +126,7 @@ export async function decryptJson( return ''; } // Disable Encryption in debug mode - if (DEBUG_MODE_ENABLED && __DEV__) { + if ((DEBUG_MODE_ENABLED && __DEV__) || isIOS()) { return JSON.parse(encryptedData); }