allow to disable check for secure screen to solve #1501

This commit is contained in:
Philipp Crocoll
2020-12-12 14:14:05 +01:00
parent eee24819d5
commit 3767450343
3 changed files with 20 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ using Android.App;
using Android.Content; using Android.Content;
using Android.Content.PM; using Android.Content.PM;
using Android.OS; using Android.OS;
using Android.Preferences;
using Android.Runtime; using Android.Runtime;
using Android.Support.V7.App; using Android.Support.V7.App;
using Android.Views; using Android.Views;
@@ -34,6 +35,18 @@ namespace keepass2android
{ {
AppSettingsActivity.Launch(this); AppSettingsActivity.Launch(this);
}; };
FindViewById<Button>(Resource.Id.disable_secure_screen_check).Click += (sender, args) =>
{
var prefs = PreferenceManager.GetDefaultSharedPreferences(Application.Context);
prefs.Edit()
.PutBoolean("no_secure_display_check", true)
.Commit();
Finish();
};
FindViewById<Button>(Resource.Id.btn_close).Click += (sender, args) =>
{
Finish();
};
var toolbar = FindViewById<AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.mytoolbar); var toolbar = FindViewById<AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.mytoolbar);

View File

@@ -21,5 +21,8 @@
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<Button android:id="@+id/btn_goto_settings" android:text="@string/IconVisibilityInfo_Android8_btnSettings" android:layout_width="match_parent" <Button android:id="@+id/btn_goto_settings" android:text="@string/IconVisibilityInfo_Android8_btnSettings" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<Button android:id="@+id/disable_secure_screen_check" android:text="@string/disable_secure_screen_check" android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button android:id="@+id/btn_close" android:text="@string/menu_close" android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>

View File

@@ -608,9 +608,9 @@ namespace keepass2android
public static void MakeSecureDisplay(Activity context) public static void MakeSecureDisplay(Activity context)
{ {
if (SecureDisplayConfigured(context)) if (SecureDisplayConfigured(context) && PreferenceManager.GetDefaultSharedPreferences(context).GetBoolean("no_secure_display_check", false))
{ {
var hasUnsecureDisplay = HasUnsecureDisplay(context); var hasUnsecureDisplay = HasUnsecureDisplay(context);
if (hasUnsecureDisplay) if (hasUnsecureDisplay)
{ {
var intent = new Intent(context, typeof(NoSecureDisplayActivity)); var intent = new Intent(context, typeof(NoSecureDisplayActivity));