Skip to content

Commit 3cd70ce

Browse files
committed
Fix crash when attempting to restore invalid backup file.
1 parent 251f95c commit 3cd70ce

File tree

9 files changed

+20
-5
lines changed

9 files changed

+20
-5
lines changed

AuthenticatorPro/Assets/about.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
<h1>About</h1>
1212
<p>
13-
<b>Authenticator Pro - jmh Development</b>
13+
<b>Authenticator Pro - jmh</b>
1414
</p>
15-
<p>2 Factor Authenticator for Android</p>
15+
<p>Open-Source 2 Factor Authenticator for Android</p>
16+
<p><a href="https://github.com/jamie-mh/AuthenticatorPro">https://github.com/jamie-mh/AuthenticatorPro</a></p>
1617

1718
<h2>Open Source Licences</h2>
1819
<h3>Albiero.Base32</h3>
@@ -48,6 +49,9 @@ <h3>Xamarin Support Libraries</h3>
4849
<h3>ZXing.Net.Mobile</h3>
4950
<p>Apache-2.0 Licence</p>
5051

52+
<h3>Xamarin.Essentials</h3>
53+
<p>MIT Licence</p>
54+
5155
<h2>Trademark Notice</h2>
5256
<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>
5357

AuthenticatorPro/AuthenticatorPro.Android.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
<Version>28.0.0.1</Version>
185185
</PackageReference>
186186
<PackageReference Include="Xamarin.Essentials">
187-
<Version>1.1.0</Version>
187+
<Version>1.2.0</Version>
188188
</PackageReference>
189189
<PackageReference Include="ZXing.Net.Mobile">
190190
<Version>2.4.1</Version>

AuthenticatorPro/Properties/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<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">
2+
<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">
33
<uses-sdk android:minSdkVersion="21" />
44
<uses-permission android:name="android.permission.CAMERA" />
55
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

AuthenticatorPro/Resources/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<string name="renameAuth">Rename</string>
1111
<string name="copiedToClipboard">Code copied to clipboard</string>
1212
<string name="warning">Warning</string>
13-
<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>
13+
<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>
1414
<string name="delete">Delete</string>
1515
<string name="add">Add</string>
1616
<string name="rename">Rename</string>

AuthenticatorPro/Source/Activities/ActivityRestore.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ private async Task RestoreBackup(string password = "")
197197
}
198198

199199
var backup = JsonConvert.DeserializeObject<Backup>(contents);
200+
201+
if(backup.Authenticators == null)
202+
{
203+
Toast.MakeText(this, Resource.String.invalidFileError, ToastLength.Short).Show();
204+
return;
205+
}
206+
200207
var authsInserted = 0;
201208
var categoriesInserted = 0;
202209

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix crash when attempting to restore invalid backup file.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix crash when attempting to restore invalid backup file.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix crash when attempting to restore invalid backup file.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix crash when attempting to restore invalid backup file.

0 commit comments

Comments
 (0)