diff --git a/android/app/src/main/java/io/metamask/MainApplication.java b/android/app/src/main/java/io/metamask/MainApplication.java index 371820484ee..36dab198fe5 100644 --- a/android/app/src/main/java/io/metamask/MainApplication.java +++ b/android/app/src/main/java/io/metamask/MainApplication.java @@ -20,6 +20,8 @@ import androidx.multidex.MultiDexApplication; +import android.database.CursorWindow; +import java.lang.reflect.Field; public class MainApplication extends MultiDexApplication implements ShareApplication, ReactApplication { @@ -55,6 +57,15 @@ public ReactNativeHost getReactNativeHost() { @Override public void onCreate() { super.onCreate(); + + try { + Field field = CursorWindow.class.getDeclaredField("sCursorWindowSize"); + field.setAccessible(true); + field.set(null, 10 * 1024 * 1024); //the 10MB is the new size + } catch (Exception e) { + e.printStackTrace(); + } + if (BuildConfig.DEBUG) { WebView.setWebContentsDebuggingEnabled(true); } SoLoader.init(this, /* native exopackage */ false); diff --git a/app/components/Views/Login/index.js b/app/components/Views/Login/index.js index 9cc01080f07..2dad116b037 100644 --- a/app/components/Views/Login/index.js +++ b/app/components/Views/Login/index.js @@ -101,9 +101,13 @@ const styles = StyleSheet.create({ } }); +/* TODO: we should have translation strings for these */ const PASSCODE_NOT_SET_ERROR = 'Error: Passcode not set.'; const WRONG_PASSWORD_ERROR = 'Error: Decrypt failed'; const WRONG_PASSWORD_ERROR_ANDROID = 'Error: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT'; +const VAULT_ERROR = 'Error: Cannot unlock without a previous vault.'; +const CLEAN_VAULT_ERROR = + 'An error has occurred due to storage limit. Your funds are safe. Please re-install the app and import your wallet using your seed phrase.'; /** * View where returning users can authenticate @@ -234,6 +238,11 @@ class Login extends PureComponent { 'In order to proceed, you need to turn Passcode on or any biometrics authentication method supported in your device (FaceID, TouchID or Fingerprint)' ); this.setState({ loading: false }); + } else if (error.toLowerCase() === VAULT_ERROR.toLowerCase()) { + this.setState({ + loading: false, + error: CLEAN_VAULT_ERROR + }); } else { this.setState({ loading: false, error }); }