public static SharedWrapper with(@NonNull Context context, @NonNull String name) { if (secretSingleton == null || ivSingleton == null) { synchronized (SharedWrapper.class) { if (secretSingleton == null) { secretSingleton = Crypt.AES.generateSecret(Digest.SHA256.getRaw(DeviceInfo.getDeviceToken(context))); } if (ivSingleton == null) { ivSingleton = Crypt.AES.generateIV(Digest.MD5.getRaw(DeviceInfo.getDeviceToken(context))); } } } return new SharedWrapper(context, name, secretSingleton, ivSingleton); }