Skip to content

Commit

Permalink
chore(INJI-149)!: temporarily disable MMKV encryption for iOS
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Vardhan <[email protected]>
  • Loading branch information
vharsh committed Nov 15, 2023
1 parent 2152c98 commit f572e99
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shared/cryptoutil/cryptoUtil.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -100,7 +106,7 @@ export async function encryptJson(
data: string,
): Promise<string> {
// Disable Encryption in debug mode
if (DEBUG_MODE_ENABLED && __DEV__) {
if ((DEBUG_MODE_ENABLED && __DEV__) || isIOS()) {
return JSON.stringify(data);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit f572e99

Please sign in to comment.