Hawk Decrypt failed
Hello, I have trouble with getting value in this case:
-
I use init in my Application file
Hawk.init(applicationContext).build() -
When user logouts I deleteAll
Hawk.deleteAll() -
And I delete all application files -
public static void clearApplicationData(Context context){
File cache = context.getCacheDir();
File appDir = new File(cache.getParent());
if (appDir.exists()) {
String[] children = appDir.list();
for (String s : children) {
if (!s.equals("lib")) {
deleteDir(new File(appDir, s));
}
}
}
}
-
And when user log in again (current session) I put user data to Hawk
Hawk.put(KEY_ID, id) -
When app restart method
Hawk.get(KEY_ID)returnsnullAnd in log
E/Hawk: onLog: Hawk.get -> Decrypt failed: The message could not be decrypted successfully.It has either been tampered with or the wrong resource is being decrypted.
E/Hawk: onLog: Hawk.get -> Decrypt failed
But Hawk.contains(KEY_ID) return true
But when after 3 step, restart app, all work fine......
In Your documentation to method deleteAll written
Clears the storage, note that crypto data won't be deleted such as salt key etc.
Use resetCrypto in order to deleteAll crypto information
But I don't find method resetCrypto()
Android version - any; Phone model - any; Version Hawk - 2.0.1;
Thanks.
I'll take a look for this one. 👍
After the app is updated
Decrypt failed: The message could not be decrypted successfully. It has either been tampered with or the wrong resource is being decrypted.
May be the reason for the java bean to add a new field?