From 3cd70cea828fa6718a534fe30081dac0eb5385e0 Mon Sep 17 00:00:00 2001 From: Jamie Hodgson Date: Wed, 14 Aug 2019 16:02:47 +0200 Subject: [PATCH] Fix crash when attempting to restore invalid backup file. --- AuthenticatorPro/Assets/about.html | 8 ++++++-- AuthenticatorPro/AuthenticatorPro.Android.csproj | 2 +- AuthenticatorPro/Properties/AndroidManifest.xml | 2 +- AuthenticatorPro/Resources/values/strings.xml | 2 +- AuthenticatorPro/Source/Activities/ActivityRestore.cs | 7 +++++++ fastlane/metadata/android/en-US/changelogs/200015.txt | 1 + fastlane/metadata/android/en-US/changelogs/300015.txt | 1 + fastlane/metadata/android/en-US/changelogs/400015.txt | 1 + fastlane/metadata/android/en-US/changelogs/500015.txt | 1 + 9 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/200015.txt create mode 100644 fastlane/metadata/android/en-US/changelogs/300015.txt create mode 100644 fastlane/metadata/android/en-US/changelogs/400015.txt create mode 100644 fastlane/metadata/android/en-US/changelogs/500015.txt diff --git a/AuthenticatorPro/Assets/about.html b/AuthenticatorPro/Assets/about.html index 23c047048b..8bd0e62eb8 100644 --- a/AuthenticatorPro/Assets/about.html +++ b/AuthenticatorPro/Assets/about.html @@ -10,9 +10,10 @@

About

- Authenticator Pro - jmh Development + Authenticator Pro - jmh

-

2 Factor Authenticator for Android

+

Open-Source 2 Factor Authenticator for Android

+

https://github.com/jamie-mh/AuthenticatorPro

Open Source Licences

Albiero.Base32

@@ -48,6 +49,9 @@

Xamarin Support Libraries

ZXing.Net.Mobile

Apache-2.0 Licence

+

Xamarin.Essentials

+

MIT Licence

+

Trademark Notice

All product names, trademarks and registered trademarks are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names,trademarks and brands does not imply endorsement.

diff --git a/AuthenticatorPro/AuthenticatorPro.Android.csproj b/AuthenticatorPro/AuthenticatorPro.Android.csproj index 9f7cb90a53..ed0a7155e5 100644 --- a/AuthenticatorPro/AuthenticatorPro.Android.csproj +++ b/AuthenticatorPro/AuthenticatorPro.Android.csproj @@ -184,7 +184,7 @@ 28.0.0.1 - 1.1.0 + 1.2.0 2.4.1 diff --git a/AuthenticatorPro/Properties/AndroidManifest.xml b/AuthenticatorPro/Properties/AndroidManifest.xml index c30fffa92a..69d7f5fe24 100644 --- a/AuthenticatorPro/Properties/AndroidManifest.xml +++ b/AuthenticatorPro/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/AuthenticatorPro/Resources/values/strings.xml b/AuthenticatorPro/Resources/values/strings.xml index 7d67c93cc5..2cc8b9e69f 100644 --- a/AuthenticatorPro/Resources/values/strings.xml +++ b/AuthenticatorPro/Resources/values/strings.xml @@ -10,7 +10,7 @@ Rename Code copied to clipboard Warning - Removing this authenticator will prevent you from generating codes for this account.\nThis does not mean that two factor authentication is disabled on your account.\n\nDeleting this authentication may prevent you from accessing your account.\nPlease make sure that either two factor authentication is disabled or that you have the recovery codes.\n\nAre you sure you want to continue? + Removing this authenticator will prevent you from generating codes for this account.\nThis does not mean that two factor authentication is disabled on your account.\n\nDeleting this authenticator may prevent you from accessing your account.\nPlease make sure that either two factor authentication is disabled or that you have the recovery codes.\n\nAre you sure you want to continue? Delete Add Rename diff --git a/AuthenticatorPro/Source/Activities/ActivityRestore.cs b/AuthenticatorPro/Source/Activities/ActivityRestore.cs index 479d2afa9b..37f249dd52 100644 --- a/AuthenticatorPro/Source/Activities/ActivityRestore.cs +++ b/AuthenticatorPro/Source/Activities/ActivityRestore.cs @@ -197,6 +197,13 @@ private async Task RestoreBackup(string password = "") } var backup = JsonConvert.DeserializeObject(contents); + + if(backup.Authenticators == null) + { + Toast.MakeText(this, Resource.String.invalidFileError, ToastLength.Short).Show(); + return; + } + var authsInserted = 0; var categoriesInserted = 0; diff --git a/fastlane/metadata/android/en-US/changelogs/200015.txt b/fastlane/metadata/android/en-US/changelogs/200015.txt new file mode 100644 index 0000000000..bdac527eca --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/200015.txt @@ -0,0 +1 @@ +Fix crash when attempting to restore invalid backup file. \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/300015.txt b/fastlane/metadata/android/en-US/changelogs/300015.txt new file mode 100644 index 0000000000..bdac527eca --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/300015.txt @@ -0,0 +1 @@ +Fix crash when attempting to restore invalid backup file. \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/400015.txt b/fastlane/metadata/android/en-US/changelogs/400015.txt new file mode 100644 index 0000000000..bdac527eca --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/400015.txt @@ -0,0 +1 @@ +Fix crash when attempting to restore invalid backup file. \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/500015.txt b/fastlane/metadata/android/en-US/changelogs/500015.txt new file mode 100644 index 0000000000..bdac527eca --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/500015.txt @@ -0,0 +1 @@ +Fix crash when attempting to restore invalid backup file. \ No newline at end of file