From 8fc98df53bf2135b9c023ab6d7573acfafb16118 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Mon, 11 Jan 2016 20:58:42 +0100 Subject: [PATCH] start implementing Xamarin.Insights based error reports --- .../KeePassLib2Android.csproj | 12 +++ src/KeePassLib2Android/Kp2aLog.cs | 9 +++ .../Serialization/IOConnection.cs | 2 +- .../Io/AndroidContentStorage.cs | 2 +- src/Kp2aBusinessLogic/Io/IoUtil.cs | 2 +- .../Kp2aBusinessLogic.csproj | 14 ++++ .../SelectStorageLocationActivityBase.cs | 2 +- src/Kp2aBusinessLogic/database/edit/LoadDB.cs | 6 +- src/Kp2aBusinessLogic/database/edit/SaveDB.cs | 4 +- src/keepass2android/ChallengeInfo.cs | 2 +- src/keepass2android/CreateDatabaseActivity.cs | 2 +- src/keepass2android/EntryActivity.cs | 2 +- src/keepass2android/EntryEditActivity.cs | 3 +- src/keepass2android/ExportDatabaseActivity.cs | 2 +- .../FingerprintSamsungIdentifier.cs | 2 +- src/keepass2android/GroupBaseActivity.cs | 2 +- src/keepass2android/LockCloseActivity.cs | 2 +- src/keepass2android/LockCloseListActivity.cs | 2 +- .../LockingClosePreferenceActivity.cs | 2 +- src/keepass2android/NfcOtpActivity.cs | 2 +- src/keepass2android/PasswordActivity.cs | 52 +++++++++++-- .../QueryCredentialsActivity.cs | 4 +- src/keepass2android/QuickUnlock.cs | 2 +- .../Resources/layout/password.xml | 3 +- .../Resources/values/strings.xml | 19 +++++ .../Totp/TrayTotpPluginAdapter.cs | 2 +- src/keepass2android/Utils/ActivityDesign.cs | 2 +- src/keepass2android/Utils/LoadingDialog.cs | 4 +- src/keepass2android/Utils/Util.cs | 2 +- .../addons/OtpKeyProv/OtpInfo.cs | 2 +- src/keepass2android/app/App.cs | 76 ++++++++++++++++++- .../fileselect/FileChooserFileProvider.cs | 8 +- src/keepass2android/icons/DrawableFactory.cs | 5 +- src/keepass2android/keepass2android.csproj | 11 +++ src/keepass2android/packages.config | 1 + src/keepass2android/search/SearchProvider.cs | 2 +- src/keepass2android/search/SearchResults.cs | 2 +- .../settings/DatabaseSettingsActivity.cs | 8 +- 38 files changed, 228 insertions(+), 53 deletions(-) diff --git a/src/KeePassLib2Android/KeePassLib2Android.csproj b/src/KeePassLib2Android/KeePassLib2Android.csproj index 2ce28673..f100ebca 100644 --- a/src/KeePassLib2Android/KeePassLib2Android.csproj +++ b/src/KeePassLib2Android/KeePassLib2Android.csproj @@ -14,6 +14,7 @@ KeePassLib2Android v6.0 True + 8482b288 True @@ -54,6 +55,9 @@ + + ..\packages\Xamarin.Insights.1.11.3\lib\MonoAndroid10\Xamarin.Insights.dll + @@ -146,6 +150,7 @@ + @@ -163,4 +168,11 @@ + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + + \ No newline at end of file diff --git a/src/KeePassLib2Android/Kp2aLog.cs b/src/KeePassLib2Android/Kp2aLog.cs index 4327a443..84728988 100644 --- a/src/KeePassLib2Android/Kp2aLog.cs +++ b/src/KeePassLib2Android/Kp2aLog.cs @@ -16,6 +16,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. */ using System; +using System.Collections.Generic; using System.IO; using Android.Preferences; using KeePassLib.Serialization; @@ -68,5 +69,13 @@ namespace keepass2android return (bool) _logToFile; } } + public static event EventHandler OnUnexpectedError; + + public static void LogUnexpectedError(Exception exception) + { + Log(exception.ToString()); + if (OnUnexpectedError != null) + OnUnexpectedError(null, exception); + } } } \ No newline at end of file diff --git a/src/KeePassLib2Android/Serialization/IOConnection.cs b/src/KeePassLib2Android/Serialization/IOConnection.cs index 575bbf45..60cfe0b4 100644 --- a/src/KeePassLib2Android/Serialization/IOConnection.cs +++ b/src/KeePassLib2Android/Serialization/IOConnection.cs @@ -251,7 +251,7 @@ namespace KeePassLib.Serialization Kp2aLog.Log(e.ToString()); } catch (Exception e) { - Kp2aLog.Log(e.ToString()); + Kp2aLog.LogUnexpectedError(e); Debug.Assert(false); } } diff --git a/src/Kp2aBusinessLogic/Io/AndroidContentStorage.cs b/src/Kp2aBusinessLogic/Io/AndroidContentStorage.cs index 6d24fa10..5bf85f3e 100644 --- a/src/Kp2aBusinessLogic/Io/AndroidContentStorage.cs +++ b/src/Kp2aBusinessLogic/Io/AndroidContentStorage.cs @@ -164,7 +164,7 @@ namespace keepass2android.Io } catch (Exception e) { - Kp2aLog.Log(e.ToString()); + Kp2aLog.LogUnexpectedError(e); return false; } diff --git a/src/Kp2aBusinessLogic/Io/IoUtil.cs b/src/Kp2aBusinessLogic/Io/IoUtil.cs index 6098a0e5..74368c36 100644 --- a/src/Kp2aBusinessLogic/Io/IoUtil.cs +++ b/src/Kp2aBusinessLogic/Io/IoUtil.cs @@ -69,7 +69,7 @@ namespace keepass2android.Io } catch (Exception e) { - Kp2aLog.Log(e.ToString()); + Kp2aLog.LogUnexpectedError(e); return false; } diff --git a/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj b/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj index 5c3bc088..962b5a25 100644 --- a/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj +++ b/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj @@ -14,6 +14,7 @@ Off v6.0 False + 06ffb71c true @@ -53,6 +54,9 @@ + + ..\packages\Xamarin.Insights.1.11.3\lib\MonoAndroid10\Xamarin.Insights.dll + @@ -138,7 +142,17 @@ TwofishCipher + + + + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + +