Support of SmartPGP secure messaging

This commit is contained in:
Arnaud Fontaine
2016-10-25 16:45:46 +02:00
parent 05bfd6bc01
commit a6b7b2bf4e
20 changed files with 1769 additions and 9 deletions

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingTop="16dp">
<android.support.design.widget.TextInputLayout
android:id="@+id/smartpgp_authority_alias_edit_text_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<EditText
android:id="@+id/smartpgp_authority_alias_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:ems="10"
android:hint="@string/label_enter_smartpgp_authority_name"
android:imeOptions="actionDone"
android:inputType="textUri" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/smartpgp_authority_filename"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:layout_gravity="center"
android:text="@string/btn_add_files"
style="?android:attr/borderlessButtonStyle"
android:drawableLeft="@drawable/ic_folder_grey_24dp"
android:drawablePadding="16dp"
android:gravity="left|center_vertical" />
</LinearLayout>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/smartpgp_authority_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/outer_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeight">
<LinearLayout
android:id="@+id/smartpgp_authority_layout"
android:padding="6sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:id="@+id/smartpgp_authority_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<View
android:layout_alignParentBottom="true"
style="@style/Divider"/>
</RelativeLayout>

View File

@@ -0,0 +1,17 @@
<?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">
<include
android:id="@+id/toolbar_include"
layout="@layout/toolbar_standalone" />
<FrameLayout
android:id="@+id/smartpgp_authorities_settings_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" />
</LinearLayout>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_add_smartpgp_authority"
android:title="@string/menu_search"
android:icon="@drawable/ic_add_white_24dp"
app:showAsAction="always" />
</menu>

View File

@@ -19,6 +19,7 @@
<string name="title_preferences">"Settings"</string>
<string name="title_api_registered_apps">"Apps"</string>
<string name="title_key_server_preference">"OpenPGP keyservers"</string>
<string name="title_smartpgp_authorities_preference">"SmartPGP authorities"</string>
<string name="title_cache_ttl_preference">"Customize 'Remember' choices"</string>
<string name="title_change_passphrase">"Change Password"</string>
<string name="title_share_fingerprint_with">"Share fingerprint with…"</string>
@@ -187,10 +188,14 @@
<string name="label_keyservers_title">"Keyservers"</string>
<string name="label_keyserver_settings_hint">"Drag to change order, tap to edit/delete"</string>
<string name="label_selected_keyserver_title">"Selected keyserver"</string>
<string name="label_selected_smartpgp_authority_title">"Selected authority"</string>
<string name="label_preferred">"preferred"</string>
<string name="label_enable_compression">"Enable compression"</string>
<string name="label_encrypt_filenames">"Encrypt filenames"</string>
<string name="label_hidden_recipients">"Hide recipients"</string>
<string name="label_smartpgp_verify">SmartPGP verify certificate</string>
<string name="label_smartpgp_verify_summary">"Validate tokens certificates against a set of trusted certification authorities"</string>
<string name="label_smartpgp_roots">SmartPGP trusted authorities</string>
<string name="label_verify_keyserver_connection">"Test connection"</string>
<string name="label_only_trusted_keyserver">"Only trusted keyserver"</string>
@@ -198,6 +203,8 @@
<string name="label_enter_keyserver_onion">"Optional Tor .onion URL"</string>
<string name="label_keyserver_dialog_delete">"Delete keyserver"</string>
<string name="label_theme">"Theme"</string>
<string name="label_enter_smartpgp_authority_name">Name</string>
<string name="label_smartpgp_authority_dialog_delete">"Delete authority"</string>
<string name="pref_keyserver">"OpenPGP keyservers"</string>
<string name="pref_keyserver_summary">"Search keys on selected OpenPGP keyservers (HKP protocol)"</string>
@@ -272,6 +279,11 @@
<item quantity="other">"%d keyservers"</item>
</plurals>
<plurals name="n_authorities">
<item quantity="one">"%d authority"</item>
<item quantity="other">"%d authorities"</item>
</plurals>
<string name="secret_key">"Secret Key:"</string>
<!-- choice -->
@@ -829,6 +841,11 @@
<string name="keyserver_preference_deleted">"%s deleted"</string>
<string name="keyserver_preference_cannot_delete_last">"Cannot delete last keyserver. At least one is required!"</string>
<!-- Add/Edit SmartPGP authority -->
<string name="add_smartpgp_authority_dialog_title">"Add authority"</string>
<string name="show_smartpgp_authority_dialog_title">"Edit authority"</string>
<string name="smartpgp_authority_preference_deleted">"%s deleted"</string>
<!-- Navigation Drawer -->
<string name="nav_keys">"Keys"</string>
<string name="nav_encrypt_decrypt">"Encrypt/Decrypt"</string>

View File

@@ -35,4 +35,14 @@
android:persistent="true"
android:title="@string/label_theme" />
<SwitchPreference
android:defaultValue="false"
android:key="smartpgp_authorities_pref"
android:summary="@string/label_smartpgp_verify_summary"
android:title="@string/label_smartpgp_verify" />
<PreferenceScreen
android:dependency="smartpgp_authorities_pref"
android:key="smartpgp_authorities"
android:title="@string/label_smartpgp_roots" />
</PreferenceScreen>