Improve the export functionality in numerous ways

This patch improves the export functionality in the following ways:
1. Allow setting a password even if the Aegis vault is not encrypted
2. Display a scary warning when exporting an unencrypted vault
3. Support exporting to a Google Authenticator URI file
4. Option to use Android's share mechanism

<img src="https://alexbakker.me/u/375oh146vz.png" width="300" />
This commit is contained in:
Alexander Bakker 2020-10-25 21:42:26 +01:00
parent 61364b5542
commit 5f2529ea33
27 changed files with 358 additions and 85 deletions

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:text="@string/export_help" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner_export_format"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="5dp" />
<CheckBox
android:id="@+id/checkbox_export_encrypt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="5dp"
android:text="@string/export_encrypted"
android:checked="true" />
<TextView
android:id="@+id/text_export_warning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:layout_marginTop="5dp"
android:text="@string/export_warning_unencrypted"
android:textColor="#FF0000"
android:visibility="gone" />
<CheckBox
android:id="@+id/checkbox_accept"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="5dp"
android:text="@string/export_warning_accept"
android:checked="false"
android:visibility="gone" />
</LinearLayout>