Skip to content

Commit

Permalink
Eliminar regex para nombre de archivo al restaurar backup. Fix #7
Browse files Browse the repository at this point in the history
  • Loading branch information
juanro49 committed Nov 25, 2024
1 parent 0496c10 commit ef0bb08
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,12 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
Uri backupUri = data.getData();
if (backupUri != null) {
if (!backupUri.getPath().
matches(".*[/:](cr-[0-9]+-[0-9]+-[0-9]+\\.db|autumandu\\.backup)$")) {
Toast.makeText(getActivity(), R.string.pref_summary_restore_file_seems_wrong,
Toast.LENGTH_LONG).show();
Log.v(TAG, "Restoring from URI "+ backupUri.toString());
if (mBackup.restore(backupUri)) {
Toast.makeText(getActivity(), R.string.toast_restore_succeeded,
Toast.LENGTH_SHORT).show();
} else {
Log.v(TAG, "Restoring from URI "+ backupUri.toString());
if (mBackup.restore(backupUri)) {
Toast.makeText(getActivity(), R.string.toast_restore_succeeded,
Toast.LENGTH_SHORT).show();
} else {
showError(getString(R.string.alert_restore_failed));
}
showError(getString(R.string.alert_restore_failed));
}
} else {
Toast.makeText(getActivity(), R.string.pref_summary_restore_file_seems_wrong,
Expand Down

0 comments on commit ef0bb08

Please sign in to comment.