Skip to content

Commit

Permalink
Fix crash when attempting to restore invalid backup file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie-mh committed Aug 14, 2019
1 parent 251f95c commit 3cd70ce
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 5 deletions.
8 changes: 6 additions & 2 deletions AuthenticatorPro/Assets/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

<h1>About</h1>
<p>
<b>Authenticator Pro - jmh Development</b>
<b>Authenticator Pro - jmh</b>
</p>
<p>2 Factor Authenticator for Android</p>
<p>Open-Source 2 Factor Authenticator for Android</p>
<p><a href="https://github.com/jamie-mh/AuthenticatorPro">https://github.com/jamie-mh/AuthenticatorPro</a></p>

<h2>Open Source Licences</h2>
<h3>Albiero.Base32</h3>
Expand Down Expand Up @@ -48,6 +49,9 @@ <h3>Xamarin Support Libraries</h3>
<h3>ZXing.Net.Mobile</h3>
<p>Apache-2.0 Licence</p>

<h3>Xamarin.Essentials</h3>
<p>MIT Licence</p>

<h2>Trademark Notice</h2>
<p>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.</p>

Expand Down
2 changes: 1 addition & 1 deletion AuthenticatorPro/AuthenticatorPro.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<Version>28.0.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials">
<Version>1.1.0</Version>
<Version>1.2.0</Version>
</PackageReference>
<PackageReference Include="ZXing.Net.Mobile">
<Version>2.4.1</Version>
Expand Down
2 changes: 1 addition & 1 deletion AuthenticatorPro/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.0" package="me.jmh.authenticatorpro" android:installLocation="auto" android:versionCode="14">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.1" package="me.jmh.authenticatorpro" android:installLocation="auto" android:versionCode="15">
<uses-sdk android:minSdkVersion="21" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
2 changes: 1 addition & 1 deletion AuthenticatorPro/Resources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<string name="renameAuth">Rename</string>
<string name="copiedToClipboard">Code copied to clipboard</string>
<string name="warning">Warning</string>
<string name="confirmAuthenticatorDelete">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?</string>
<string name="confirmAuthenticatorDelete">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?</string>
<string name="delete">Delete</string>
<string name="add">Add</string>
<string name="rename">Rename</string>
Expand Down
7 changes: 7 additions & 0 deletions AuthenticatorPro/Source/Activities/ActivityRestore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ private async Task RestoreBackup(string password = "")
}

var backup = JsonConvert.DeserializeObject<Backup>(contents);

if(backup.Authenticators == null)
{
Toast.MakeText(this, Resource.String.invalidFileError, ToastLength.Short).Show();
return;
}

var authsInserted = 0;
var categoriesInserted = 0;

Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/200015.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash when attempting to restore invalid backup file.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/300015.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash when attempting to restore invalid backup file.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/400015.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash when attempting to restore invalid backup file.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/500015.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash when attempting to restore invalid backup file.

0 comments on commit 3cd70ce

Please sign in to comment.