New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backup and restore settings, closes #839 #1244
Conversation
@gsantner This works, but we need to review strings etc |
app/src/main/java/net/gsantner/markor/activity/BackupRestoreHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/net/gsantner/markor/activity/BackupRestoreHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/net/gsantner/markor/activity/BackupRestoreHelper.java
Outdated
Show resolved
Hide resolved
what do you think of adding SearchOrCustomDialog after file selection? Data / Data +Settings / Settings and for data, also select & add second folder recursive to zip. I made impression users are interested in data backup too, even more than settings backup. |
I think data backup etc is best handled by an external app.
For example, it's pretty easy to compress a folder using any file manager app.
Feb. 18, 2021 01:03:22 Gregor Santner <notifications@github.com>:
… what do you think of adding SearchOrCustomDialog after file selection?
Data / Data +Settings / Settings
and for data, also add the notebook folder recursive to zip
—
|
1bbe6a0
to
8ed7391
Compare
Ah good catch. I will address this |
basically we need a file::readLines().grep(!.encryption.) @opensource21 |
@gsantner Actually I am not sure why this is happening As far as I can tell, the password should be removed from plaintext as soon as it is written. i.e. it should never be in plaintext
|
IMO, a much cleaner solution would be to use a regular dialog to set the password. That way it is never stored in plaintext and we don't have to do this delete after storing in password manager thing. |
@gsantner @opensource21 I think we are good to go :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry that I have to block this still, but it does not work. Tried it.
- Set 22 as value just above the backup settings. exited app to make sure it saved the 22.
- then made backup
- Changed to 10, exited again to make sure it's saved and not pending.
- Then restored the backup. Checked settings and it's still at 10 - it should be 22 now.
- I also exited / restarted the app multiple times after loading the backup - the value is still at 10, so backup-restore didn't do anything.
https://user-images.githubusercontent.com/6735650/112771640-1da1c080-902d-11eb-9e0e-28bf076ee997.mp4
a.mp4
This is probably the price of converting back-and-forth formats, potential loss of information.
For some reason, the @gsantner could you check importing now? |
To be clear, the issue was not data loss (all data appears to be preserved with 100% fidelity), but that This is fixed now |
It appears we may not even need the system exit now that we are using system APIs to restore the settings. I have removed the exit, and everything seems to work great. Could you test and confirm? |
After much testing, I have decided that I agree with @gsantner and that we should store the file type as strings rather than indices. I will be making these changes later today. |
OK as you prefer, if you think indices is good enough, also OK if it works |
case R.string.action_format_keyvalue: | ||
case R.string.action_format_todotxt: | ||
case R.string.action_format_plaintext: | ||
case R.string.action_format_markdown: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched all type formats to strings
This PR addresses #839.
I have liberally borrowed from OpenLauncher/BackupHelperThis PR now does not export a zip of the shared preference XML files (as openlauncher does). Instead, the preferences are exported as a JSON.