Delete unencrypted files each time the app is started

This commit is contained in:
Benoit Marty 2020-12-09 12:27:37 +01:00
parent e4968c4119
commit 0956baecf9

View file

@ -71,12 +71,18 @@ class HomeActivityViewModel @AssistedInject constructor(
private var onceTrusted = false private var onceTrusted = false
init { init {
cleanupFiles()
observeInitialSync() observeInitialSync()
mayBeInitializeCrossSigning() mayBeInitializeCrossSigning()
checkSessionPushIsOn() checkSessionPushIsOn()
observeCrossSigningReset() observeCrossSigningReset()
} }
private fun cleanupFiles() {
// Mitigation: delete all cached decrypted files each time the application is started.
activeSessionHolder.getSafeActiveSession()?.fileService()?.clearDecryptedCache()
}
private fun observeCrossSigningReset() { private fun observeCrossSigningReset() {
val safeActiveSession = activeSessionHolder.getSafeActiveSession() ?: return val safeActiveSession = activeSessionHolder.getSafeActiveSession() ?: return