mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-26 16:56:09 +00:00
This adds a recovery mechanism for (probably extremely rare) cases where the app may be killed before it is finished writing the vault file to disk. In the example below, we see that AtomicFile moved ``aegis.json`` to ``aegis.json.bak`` before writing to ``aegis.json``. ``` bonito:/ # ls -lah /data/data/com.beemdevelopment.aegis.debug/files total 27M drwxrwx--x 2 u0_a306 u0_a306 3.4K 2020-02-02 13:22 . drwx------ 6 u0_a306 u0_a306 3.4K 2020-02-01 19:51 .. -rw------- 1 u0_a306 u0_a306 19M 2020-02-02 13:22 aegis.json -rw------- 1 u0_a306 u0_a306 34M 2020-02-02 13:21 aegis.json.bak ``` Because the app was killed before it could finish writing, it is only 19M in size, instead of the expected 34M. The next time the app starts, AtomicFile will notice that the .bak file is still present, and use that instead of the corrupted ``aegis.json`` file. |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
build.gradle | ||
proguard-rules.pro |