From: Soren Stoutner Date: Fri, 9 Oct 2020 21:43:55 +0000 (-0700) Subject: Include the version number in the default file name when exporting setting. https... X-Git-Tag: v3.6~16 X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff_plain;h=f99c5299aced4335017a59423fb491b84c9a6970 Include the version number in the default file name when exporting setting. https://redmine.stoutner.com/issues/609 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java index 53c1109c..d740552a 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java @@ -58,6 +58,7 @@ import androidx.fragment.app.DialogFragment; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.textfield.TextInputLayout; +import com.stoutner.privacybrowser.BuildConfig; import com.stoutner.privacybrowser.R; import com.stoutner.privacybrowser.dialogs.StoragePermissionDialog; import com.stoutner.privacybrowser.helpers.DownloadLocationHelper; @@ -191,7 +192,7 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe DownloadLocationHelper downloadLocationHelper = new DownloadLocationHelper(); // Get the default file path. - String defaultFilePath = downloadLocationHelper.getDownloadLocation(this) + "/" + getString(R.string.settings_pbs); + String defaultFilePath = downloadLocationHelper.getDownloadLocation(this) + "/" + getString(R.string.settings) + " " + BuildConfig.VERSION_NAME + ".pbs"; // Set the other default file paths. String defaultPasswordEncryptionFilePath = defaultFilePath + ".aes"; @@ -668,9 +669,9 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe // Set the initial export file name according to the encryption type. if (encryptionSpinner.getSelectedItemPosition() == NO_ENCRYPTION) { // No encryption is selected. - exportBrowseIntent.putExtra(Intent.EXTRA_TITLE, getString(R.string.settings_pbs)); + exportBrowseIntent.putExtra(Intent.EXTRA_TITLE, getString(R.string.settings) + " " + BuildConfig.VERSION_NAME + ".pbs"); } else { // Password encryption is selected. - exportBrowseIntent.putExtra(Intent.EXTRA_TITLE, getString(R.string.settings_pbs) + ".aes"); + exportBrowseIntent.putExtra(Intent.EXTRA_TITLE, getString(R.string.settings) + " " + BuildConfig.VERSION_NAME + ".pbs.aes"); } // Set the initial directory if the minimum API >= 26. @@ -809,7 +810,7 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe case OPENPGP_EXPORT_RESULT_CODE: // Get the temporary unencrypted export file. - File temporaryUnencryptedExportFile = new File(getApplicationContext().getCacheDir() + "/" + getString(R.string.settings_pbs)); + File temporaryUnencryptedExportFile = new File(getApplicationContext().getCacheDir() + "/" + getString(R.string.settings) + " " + BuildConfig.VERSION_NAME + ".pbs"); // Delete the temporary unencrypted export file if it exists. if (temporaryUnencryptedExportFile.exists()) { @@ -833,7 +834,7 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe // Get the export and temporary unencrypted export files. File exportFile = new File(exportFileString); - File temporaryUnencryptedExportFile = new File(getApplicationContext().getCacheDir() + "/" + getString(R.string.settings_pbs)); + File temporaryUnencryptedExportFile = new File(getApplicationContext().getCacheDir() + "/" + getString(R.string.settings) + " " + BuildConfig.VERSION_NAME + ".pbs"); // Create an export status string. String exportStatus; @@ -1012,7 +1013,7 @@ public class ImportExportActivity extends AppCompatActivity implements StoragePe case PASSWORD_ENCRYPTION: // Use a private temporary import location. - File temporaryUnencryptedImportFile = new File(getApplicationContext().getCacheDir() + "/" + getString(R.string.settings_pbs)); + File temporaryUnencryptedImportFile = new File(getApplicationContext().getCacheDir() + "/" + getString(R.string.settings) + " " + BuildConfig.VERSION_NAME + ".pbs"); try { // Create an encrypted import file input stream. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index dbd8f44d..d1ab8d24 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -364,7 +364,6 @@ Die Datei existiert bereits. Wenn Sie fortfahren, wird sie überschrieben. Für die OpenPGP-Verschlüsselung muss OpenKeychain installiert sein. Die unverschlüsselte Datei muss in einem weiteren Schritt importiert werden, nachdem sie entschlüsselt wurde. - Einstellungen.pbs Datei-Ordner durchsuchen exportieren diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 4a8ab0a0..877d49c3 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -361,7 +361,6 @@ El archivo ya existe. Si procede, se sobrescribirá. El cifrado OpenPGP requiere que esté instalado OpenKeychain. El archivo sin cifrar tendrá que ser importado en un paso separado después de ser descifrado. - Configuración.pbs Ubicación del archivo Navegar Exportar diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0a424c3e..60b36f26 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -361,7 +361,6 @@ Le fichier existe déjà. Si vous continuez, il sera écrasé. Le chiffrement OpenPGP nécessite l\'installation d\'OpenKeychain. Le fichier non-chiffré devra être importé dans un deuxième temps, après son déchiffrement. - Settings.pbs Emplacement du fichier Parcourir Exporter diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3c040eb3..7d279c9a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -360,7 +360,6 @@ Il file è già esistente. Se si decide di procedere sarà sovrascritto. La cifratura OpenPGP richiede l\'installazione di OpenKeychain. Il file non cifrato deve essere importato in un secondo momento dopo che è stato decriptato. - Impostazioni.pbs Posizione del File Sfoglia Esporta diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index bea89298..c96e4f83 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -355,7 +355,6 @@ O arquivo já existe. Se você continuar, ele será sobrescrito. A criptografia OpenPGP requer que o OpenKeychain seja instalado. O arquivo não criptografado terá que ser importado em uma etapa separada após ser descriptografado. - Settings.pbs Localização do Arquivo Navegar Exportar diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 184a8d0c..0af2e1f7 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -357,7 +357,6 @@ Файл уже существует. Если вы продолжите, он будет перезаписан. Для использования шифрования OpenPGP необходимо приложение OpenKeychain. Незашифрованный файл должен быть импортирован на отдельном шаге после его дешифрования. - Настройки.pbs Расположение файла Обзор Экспорт diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index b6570695..6780b43e 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -333,7 +333,6 @@ Android KitKat sürümünde parola şifrelemesi çalışmaz. OpenPGP şifrelemesinin çalışması için OpenKeychain yüklü olmalıdır. Şifresi çözüldükten sonra, şifrelenmemiş dosya ayrı bir adımda içeri aktarılmak zorundadır. - Ayarlar.pbs Dosya Konumu Gözat Dışarı aktar diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 517fb268..fb87dbc2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -366,7 +366,6 @@ The file already exists. If you proceed it will be overwritten. OpenPGP encryption requires that OpenKeychain be installed. The unencrypted file will have to be imported in a separate step after it is decrypted. - Settings.pbs File Location Browse Export