mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-12 12:35:05 -05:00
Added option to kill the application process from the password activity
This commit is contained in:
parent
8b86e15a29
commit
574a56c2e3
@ -197,6 +197,7 @@ namespace keepass2android
|
||||
}
|
||||
|
||||
internal AppTask AppTask;
|
||||
private bool _killOnDestroy;
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
@ -281,6 +282,10 @@ namespace keepass2android
|
||||
.PrepareFileUsage(new FileStorageSetupInitiatorActivity(this, OnActivityResult, null), _ioConnection, 0, false);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*CheckBox checkBox = (CheckBox) FindViewById(Resource.Id.show_password);
|
||||
// Show or hide password
|
||||
checkBox.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs e) {
|
||||
@ -459,6 +464,24 @@ namespace keepass2android
|
||||
{
|
||||
base.OnResume();
|
||||
|
||||
View killButton = FindViewById(Resource.Id.kill_app);
|
||||
if (PreferenceManager.GetDefaultSharedPreferences(this)
|
||||
.GetBoolean(GetString(Resource.String.show_kill_app_key), false))
|
||||
{
|
||||
killButton.Click += (sender, args) =>
|
||||
{
|
||||
_killOnDestroy = true;
|
||||
Finish();
|
||||
|
||||
};
|
||||
killButton.Visibility = ViewStates.Visible;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
killButton.Visibility = ViewStates.Gone;
|
||||
}
|
||||
|
||||
MakePasswordMaskedOrVisible();
|
||||
|
||||
// OnResume is run every time the activity comes to the foreground. This code should only run when the activity is started (OnStart), but must
|
||||
@ -521,6 +544,13 @@ namespace keepass2android
|
||||
SetEditText(Resource.Id.pass_keyfile, _keyFile);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
if (_killOnDestroy)
|
||||
Process.KillProcess(Process.MyPid());
|
||||
}
|
||||
|
||||
/*
|
||||
private void errorMessage(CharSequence text)
|
||||
{
|
||||
|
2023
src/keepass2android/Resources/Resource.designer.cs
generated
2023
src/keepass2android/Resources/Resource.designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -96,10 +96,16 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/keyfileLine" />
|
||||
<Button
|
||||
android:id="@+id/kill_app"
|
||||
android:text="@string/kill_app_label"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/pass_ok" />
|
||||
<CheckBox
|
||||
android:id="@+id/enable_quickunlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/pass_ok"
|
||||
android:layout_below="@id/kill_app"
|
||||
android:text="@string/enable_quickunlock" />
|
||||
</RelativeLayout>
|
@ -84,10 +84,16 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/pass_keyfile" />
|
||||
<Button
|
||||
android:id="@+id/kill_app"
|
||||
android:text="@string/kill_app_label"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/pass_ok" />
|
||||
<CheckBox
|
||||
android:id="@+id/enable_quickunlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/pass_ok"
|
||||
android:layout_below="@id/kill_app"
|
||||
android:text="@string/enable_quickunlock" />
|
||||
</RelativeLayout>
|
@ -46,6 +46,7 @@
|
||||
<string name="algorithm_key">algorithm</string>
|
||||
<string name="app_key">app</string>
|
||||
<string name="app_timeout_key">app_timeout_key</string>
|
||||
<string name="show_kill_app_key">show_kill_app_key</string>
|
||||
<string name="clipboard_timeout_key">clip_timeout_key</string>
|
||||
<string name="db_key">db</string>
|
||||
<string name="rounds_key">rounds</string>
|
||||
|
@ -19,6 +19,9 @@
|
||||
<string name="short_app_name_nonet">KP2A Offline</string>
|
||||
<string name="app_timeout">Application timeout</string>
|
||||
<string name="app_timeout_summary">Time before locking database when the application is inactive.</string>
|
||||
<string name="kill_app_label">Kill application process</string>
|
||||
<string name="show_kill_app">Close-Button</string>
|
||||
<string name="show_kill_app_summary">Show a button in password screen to kill the application process (for paranoid users)</string>
|
||||
<string name="application">Application</string>
|
||||
<string name="application_settings">Application settings</string>
|
||||
|
||||
|
@ -84,6 +84,12 @@
|
||||
android:summary="@string/remember_keyfile_summary"
|
||||
android:defaultValue="@bool/keyfile_default"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/show_kill_app_key"
|
||||
android:title="@string/show_kill_app"
|
||||
android:summary="@string/show_kill_app_summary"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen
|
||||
android:key="@string/display_prefs_key"
|
||||
|
Loading…
Reference in New Issue
Block a user