From 400f72a9bf2f51bad34f4e1a77fe9d65c80b801c Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Sun, 1 May 2022 15:28:28 -0400 Subject: [PATCH] Allow */* as mime type filter when restoring, solves #223 --- app/src/main/java/io/heckel/ntfy/backup/Backuper.kt | 1 - app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt | 5 ++++- fastlane/metadata/android/en-US/changelog/27.txt | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/heckel/ntfy/backup/Backuper.kt b/app/src/main/java/io/heckel/ntfy/backup/Backuper.kt index 971f536..f82e400 100644 --- a/app/src/main/java/io/heckel/ntfy/backup/Backuper.kt +++ b/app/src/main/java/io/heckel/ntfy/backup/Backuper.kt @@ -283,7 +283,6 @@ class Backuper(val context: Context) { } companion object { - const val MIME_TYPE = "application/json" private const val FILE_MAGIC = "ntfy2586" private const val FILE_VERSION = 1 private const val TAG = "NtfyExporter" diff --git a/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt index b2f0131..a6a8469 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt @@ -481,7 +481,10 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere } } restore?.onPreferenceClickListener = OnPreferenceClickListener { - restoreResultLauncher.launch(Backuper.MIME_TYPE) + // Overly open mime type filter (because of https://github.com/binwiederhier/ntfy/issues/223). + // This filter could likely be stricter if we'd write the mime type properly in Backuper.backup(), + // but just in case we want to restore from a file we didn't write outselves, we'll keep this "*/*". + restoreResultLauncher.launch("*/*") true } diff --git a/fastlane/metadata/android/en-US/changelog/27.txt b/fastlane/metadata/android/en-US/changelog/27.txt index 2f030a6..bbf623c 100644 --- a/fastlane/metadata/android/en-US/changelog/27.txt +++ b/fastlane/metadata/android/en-US/changelog/27.txt @@ -4,6 +4,7 @@ Features: Bugs: * Accurate naming of "mute notifications" from "pause notifications" (#224, thanks to @shadow00 for reporting) * Make messages with links selectable (#226, thanks to @StoyanDimitrov for reporting) +* Restoring topics or settings from backup doesn't work (#223, thanks to @shadow00 for reporting) **Thanks for testing:**