started reworking the key creation

This commit is contained in:
Dominik 2012-04-12 19:44:00 +02:00
parent 1a33f4d886
commit 2008c2608e
18 changed files with 364 additions and 289 deletions

View File

@ -75,7 +75,8 @@
android:name=".ui.EditKeyActivity" android:name=".ui.EditKeyActivity"
android:configChanges="keyboardHidden|orientation|keyboard" android:configChanges="keyboardHidden|orientation|keyboard"
android:label="@string/title_editKey" android:label="@string/title_editKey"
android:uiOptions="splitActionBarWhenNarrow" > android:uiOptions="splitActionBarWhenNarrow"
android:windowSoftInputMode="stateHidden" >
<intent-filter> <intent-filter>
<action android:name="org.apg.intent.EDIT_KEY" /> <action android:name="org.apg.intent.EDIT_KEY" />

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<size
android:height="2dp"
android:width="1000dp" />
<solid android:color="@color/emphasis" />
</shape>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> <!--
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,51 +15,59 @@
limitations under the License. limitations under the License.
--> -->
<ScrollView <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent" >
android:layout_width="fill_parent">
<TableLayout <TableLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:stretchColumns="1" android:layout_height="wrap_content"
android:layout_marginRight="?android:attr/scrollbarSize" android:paddingLeft="16dp"
android:paddingLeft="6dip"> android:paddingRight="16dp"
android:stretchColumns="1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="4dp"
android:text="@string/keyCreationElGamalInfo" />
<TableRow> <TableRow>
<TextView android:id="@+id/label_algorithm" <TextView
android:text="@string/label_algorithm"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="10dip"/> android:padding="4dp"
android:text="@string/label_algorithm" />
<Spinner <Spinner
android:id="@+id/algorithm" android:id="@+id/create_key_algorithm"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:padding="4dp" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView android:id="@+id/label_size" <TextView
android:text="@string/label_keySize"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_vertical"
android:paddingRight="10dip"/>
<EditText android:id="@+id/size"
android:text="1024"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_gravity="center_vertical"
android:gravity="right" android:padding="4dp"
android:numeric="integer"/> android:text="@string/label_keySize" />
</TableRow>
<EditText
android:id="@+id/create_key_size"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:numeric="integer"
android:padding="4dp"
android:text="1024" />
</TableRow>
</TableLayout> </TableLayout>
<!-- </LinearLayout> -->
</ScrollView> </ScrollView>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> <!--
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,52 +15,45 @@
limitations under the License. limitations under the License.
--> -->
<LinearLayout <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:paddingTop="5dip" android:fillViewport="true"
android:fillViewport="true"> android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1">
<LinearLayout
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_marginRight="?android:attr/scrollbarSize">
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<View <TextView
android:layout_width="0dip" style="@style/SectionHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"/> android:padding="4dp"
android:text="@string/label_passPhrase" />
<CheckBox
android:id="@+id/edit_key_no_passphrase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_noPassPhrase" />
<Button <Button
android:id="@+id/btn_change_pass_phrase" android:id="@+id/edit_key_btn_change_pass_phrase"
android:layout_width="0dip" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="2" android:padding="4dp"
android:text="@string/btn_setPassPhrase"/> android:text="@string/btn_setPassPhrase" />
<View <LinearLayout
android:layout_width="0dip" android:id="@+id/edit_key_container"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"/> android:orientation="vertical" >
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </ScrollView>
</ScrollView>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> <!--
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,130 +15,120 @@
limitations under the License. limitations under the License.
--> -->
<org.apg.ui.widget.KeyEditor <org.apg.ui.widget.KeyEditor xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical" >
android:paddingLeft="5dip">
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"/>
<LinearLayout <LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:orientation="horizontal"> android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableLayout <TableLayout
android:layout_height="wrap_content"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="16dip" android:stretchColumns="1" >
android:stretchColumns="1">
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_keyId" android:id="@+id/label_keyId"
android:text="@string/label_keyId"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="10dip"/> android:paddingRight="10dip"
android:text="@string/label_keyId" />
<TextView <TextView
android:id="@+id/keyId" android:id="@+id/keyId"
android:text="00000000 00000000"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="5dip" android:paddingRight="5dip"
android:typeface="monospace"/> android:text="00000000 00000000"
android:typeface="monospace" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_algorithm" android:id="@+id/label_algorithm"
android:text="@string/label_algorithm"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="10dip"/> android:paddingRight="10dip"
android:text="@string/label_algorithm" />
<TextView <TextView
android:id="@+id/algorithm" android:id="@+id/algorithm"
android:text="Name"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingRight="5dip"/> android:layout_height="wrap_content"
android:paddingRight="5dip"
android:text="Name" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_creation" android:id="@+id/label_creation"
android:text="@string/label_creation"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="10dip"/> android:paddingRight="10dip"
android:text="@string/label_creation" />
<TextView <TextView
android:id="@+id/creation" android:id="@+id/creation"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_expiry" android:id="@+id/label_expiry"
android:text="@string/label_expiry"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="10dip"/> android:paddingRight="10dip"
android:text="@string/label_expiry" />
<Button <Button
android:id="@+id/expiry" android:id="@+id/expiry"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_usage" android:id="@+id/label_usage"
android:text="@string/label_usage"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="10dip"/> android:paddingRight="10dip"
android:text="@string/label_usage" />
<Spinner <Spinner
android:id="@+id/usage" android:id="@+id/usage"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content" />
</TableRow> </TableRow>
</TableLayout> </TableLayout>
<ImageButton <ImageButton
android:id="@+id/delete" android:id="@+id/delete"
style="@style/MinusButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/MinusButton" android:layout_gravity="center_vertical" />
android:layout_gravity="center_vertical"/>
</LinearLayout> </LinearLayout>
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
</org.apg.ui.widget.KeyEditor> </org.apg.ui.widget.KeyEditor>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> <!--
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,53 +15,43 @@
limitations under the License. limitations under the License.
--> -->
<org.apg.ui.widget.SectionView <org.apg.ui.widget.SectionView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical" >
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"/>
<LinearLayout <LinearLayout
android:id="@+id/header" android:id="@+id/header"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="14dip" android:clickable="true"
android:layout_marginTop="2dip"
android:layout_marginBottom="2dip"
android:orientation="horizontal"
android:gravity="center_vertical"
android:focusable="true" android:focusable="true"
android:clickable="true"> android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:text="Section Name" style="@style/SectionHeader"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal"/> android:fadingEdge="horizontal"
android:singleLine="true"
android:text="Section Name" />
<ImageView <ImageView
style="@style/PlusButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:duplicateParentState="true" android:duplicateParentState="true" />
style="@style/PlusButton"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/editors" android:id="@+id/editors"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="6dip" android:orientation="vertical"
android:orientation="vertical"/> android:paddingBottom="6dip" />
</org.apg.ui.widget.SectionView> </org.apg.ui.widget.SectionView>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> <!--
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,102 +15,93 @@
limitations under the License. limitations under the License.
--> -->
<org.apg.ui.widget.UserIdEditor <org.apg.ui.widget.UserIdEditor xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical" >
android:paddingLeft="5dip">
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"/>
<RadioButton <RadioButton
android:id="@+id/isMainUserId" android:id="@+id/isMainUserId"
android:text="@string/label_mainUserId"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="20dip"/> android:layout_height="wrap_content"
android:text="@string/label_mainUserId" />
<LinearLayout <LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:orientation="horizontal"> android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableLayout <TableLayout
android:layout_height="wrap_content"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_weight="1" android:layout_height="wrap_content"
android:layout_marginLeft="16dip"> android:layout_weight="1" >
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_name" android:id="@+id/label_name"
android:text="@string/label_name"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingRight="5dip"/> android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingRight="5dip"
android:text="@string/label_name" />
<EditText <EditText
android:id="@+id/name" android:id="@+id/name"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:inputType="textPersonName|textCapWords"/> android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="textPersonName|textCapWords" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_email" android:id="@+id/label_email"
android:text="@string/label_email"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingRight="5dip"/> android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingRight="5dip"
android:text="@string/label_email" />
<EditText <EditText
android:id="@+id/email" android:id="@+id/email"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:inputType="textEmailAddress"/> android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="textEmailAddress" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/label_comment" android:id="@+id/label_comment"
android:text="@string/label_comment"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:paddingRight="5dip"/> android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingRight="5dip"
android:text="@string/label_comment" />
<EditText <EditText
android:id="@+id/comment" android:id="@+id/comment"
android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent"/> android:layout_weight="1" />
</TableRow> </TableRow>
</TableLayout> </TableLayout>
<ImageButton <ImageButton
android:id="@+id/delete" android:id="@+id/delete"
style="@style/MinusButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/MinusButton" android:layout_gravity="center_vertical" />
android:layout_gravity="center_vertical"/>
</LinearLayout> </LinearLayout>
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
</org.apg.ui.widget.UserIdEditor> </org.apg.ui.widget.UserIdEditor>

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="5dip"
android:paddingRight="5dip">
<EditText
android:id="@+id/passPhrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"/>
<EditText
android:id="@+id/passPhraseAgain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"/>
</LinearLayout>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:stretchColumns="1" >
<TableRow>
<TextView
android:id="@+id/passphrase_label_passphrase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="4dp"
android:text="@string/label_passPhrase" />
<EditText
android:id="@+id/passphrase_passphrase"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:padding="4dp" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/passphrase_label_passphrase_again"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="4dp"
android:text="@string/label_passPhraseAgain" />
<EditText
android:id="@+id/passphrase_passphrase_again"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:padding="4dp" />
</TableRow>
</TableLayout>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="emphasis">#31b6e7</color>
<color name="bg_gray">#cecbce</color>
</resources>

View File

@ -25,13 +25,13 @@
<string name="title_selectSignature">Select Signature</string> <string name="title_selectSignature">Select Signature</string>
<string name="title_encrypt">Encrypt</string> <string name="title_encrypt">Encrypt</string>
<string name="title_decrypt">Decrypt</string> <string name="title_decrypt">Decrypt</string>
<string name="title_authentication">Pass Phrase</string> <string name="title_authentication">Passphrase</string>
<string name="title_createKey">Create Key</string> <string name="title_createKey">Create Key</string>
<string name="title_editKey">Edit Key</string> <string name="title_editKey">Edit Key</string>
<string name="title_preferences">Preferences</string> <string name="title_preferences">Preferences</string>
<string name="title_keyServerPreference">Key Server Preference</string> <string name="title_keyServerPreference">Key Server Preference</string>
<string name="title_changePassPhrase">Change Pass Phrase</string> <string name="title_changePassPhrase">Change Passphrase</string>
<string name="title_setPassPhrase">Set Pass Phrase</string> <string name="title_setPassPhrase">Set Passphrase</string>
<string name="title_sendEmail">"Send Mail..."</string> <string name="title_sendEmail">"Send Mail..."</string>
<string name="title_encryptToFile">Encrypt To File</string> <string name="title_encryptToFile">Encrypt To File</string>
<string name="title_decryptToFile">Decrypt To File</string> <string name="title_decryptToFile">Decrypt To File</string>
@ -76,8 +76,8 @@
<string name="btn_noDate">None</string> <string name="btn_noDate">None</string>
<string name="btn_okay">Okay</string> <string name="btn_okay">Okay</string>
<string name="btn_clearFilter">Clear Filter</string> <string name="btn_clearFilter">Clear Filter</string>
<string name="btn_changePassPhrase">Change Pass Phrase</string> <string name="btn_changePassPhrase">Change Passphrase</string>
<string name="btn_setPassPhrase">Set Pass Phrase</string> <string name="btn_setPassPhrase">Set Passphrase</string>
<string name="btn_search">Search</string> <string name="btn_search">Search</string>
<string name="btn_export_to_server">Export To Server</string> <string name="btn_export_to_server">Export To Server</string>
@ -106,7 +106,8 @@
<string name="label_sign">Sign</string> <string name="label_sign">Sign</string>
<string name="label_message">Message</string> <string name="label_message">Message</string>
<string name="label_file">File</string> <string name="label_file">File</string>
<string name="label_passPhrase">Pass Phrase</string> <string name="label_noPassPhrase">No Passphrase</string>
<string name="label_passPhrase">Passphrase</string>
<string name="label_passPhraseAgain">Again</string> <string name="label_passPhraseAgain">Again</string>
<string name="label_algorithm">Algorithm</string> <string name="label_algorithm">Algorithm</string>
<string name="label_asciiArmour">ASCII Armour</string> <string name="label_asciiArmour">ASCII Armour</string>
@ -117,8 +118,8 @@
<string name="label_encryptionAlgorithm">Encryption Algorithm</string> <string name="label_encryptionAlgorithm">Encryption Algorithm</string>
<string name="label_hashAlgorithm">Hash Algorithm</string> <string name="label_hashAlgorithm">Hash Algorithm</string>
<string name="label_asymmetric">Public Key</string> <string name="label_asymmetric">Public Key</string>
<string name="label_symmetric">Pass Phrase</string> <string name="label_symmetric">Passphrase</string>
<string name="label_passPhraseCacheTtl">Pass Phrase Cache</string> <string name="label_passPhraseCacheTtl">Passphrase Cache</string>
<string name="label_messageCompression">Message Compression</string> <string name="label_messageCompression">Message Compression</string>
<string name="label_fileCompression">File Compression</string> <string name="label_fileCompression">File Compression</string>
<string name="label_forceV3Signature">Force V3 Signatures</string> <string name="label_forceV3Signature">Force V3 Signatures</string>
@ -182,13 +183,13 @@
<string name="errorMessage">Error: %s</string> <string name="errorMessage">Error: %s</string>
<!-- sentences --> <!-- sentences -->
<string name="wrongPassPhrase">Wrong pass phrase.</string> <string name="wrongPassPhrase">Wrong passphrase.</string>
<string name="usingClipboardContent">Using clipboard content.</string> <string name="usingClipboardContent">Using clipboard content.</string>
<string name="keySaved">Key saved.</string> <string name="keySaved">Key saved.</string>
<string name="setAPassPhrase">Set a pass phrase first.</string> <string name="setAPassPhrase">Set a passphrase first.</string>
<string name="noFilemanagerInstalled">No compatible file manager installed.</string> <string name="noFilemanagerInstalled">No compatible file manager installed.</string>
<string name="passPhrasesDoNotMatch">The pass phrases didn\'t match.</string> <string name="passPhrasesDoNotMatch">The passphrases didn\'t match.</string>
<string name="passPhraseMustNotBeEmpty">Empty pass phrases are not allowed.</string> <string name="passPhraseMustNotBeEmpty">Empty passphrases are not allowed.</string>
<string name="passPhraseForSymmetricEncryption">Symmetric encryption.</string> <string name="passPhraseForSymmetricEncryption">Symmetric encryption.</string>
<string name="passPhraseFor">%s</string> <string name="passPhraseFor">%s</string>
<string name="fileDeleteConfirmation">Are you sure you want to delete\n%s?</string> <string name="fileDeleteConfirmation">Are you sure you want to delete\n%s?</string>
@ -197,7 +198,7 @@
<string name="decryptionSuccessful">Successfully decrypted.</string> <string name="decryptionSuccessful">Successfully decrypted.</string>
<string name="encryptionSuccessful">Successfully encrypted.</string> <string name="encryptionSuccessful">Successfully encrypted.</string>
<string name="encryptionToClipboardSuccessful">Successfully encrypted to clipboard.</string> <string name="encryptionToClipboardSuccessful">Successfully encrypted to clipboard.</string>
<string name="enterPassPhraseTwice">Enter the pass phrase twice.</string> <string name="enterPassPhraseTwice">Enter the passphrase twice.</string>
<string name="selectEncryptionKey">Select at least one encryption key.</string> <string name="selectEncryptionKey">Select at least one encryption key.</string>
<string name="selectEncryptionOrSignatureKey">Select at least one encryption key or a signature key.</string> <string name="selectEncryptionOrSignatureKey">Select at least one encryption key or a signature key.</string>
<string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string> <string name="specifyFileToEncryptTo">Please specify which file to encrypt to.\nWARNING! File will be overwritten if it exists.</string>
@ -246,14 +247,14 @@
<string name="error_mainUserIdMustNotBeEmpty">main user id must not be empty</string> <string name="error_mainUserIdMustNotBeEmpty">main user id must not be empty</string>
<string name="error_keyNeedsMasterKey">need at least a master key</string> <string name="error_keyNeedsMasterKey">need at least a master key</string>
<string name="error_expiryMustComeAfterCreation">expiry date must come after creation date</string> <string name="error_expiryMustComeAfterCreation">expiry date must come after creation date</string>
<string name="error_noEncryptionKeysOrPassPhrase">no encryption key(s) or pass phrase given</string> <string name="error_noEncryptionKeysOrPassPhrase">no encryption key(s) or passphrase given</string>
<string name="error_signatureFailed">signature failed</string> <string name="error_signatureFailed">signature failed</string>
<string name="error_noSignaturePassPhrase">no pass phrase given</string> <string name="error_noSignaturePassPhrase">no passphrase given</string>
<string name="error_noSignatureKey">no signature key given</string> <string name="error_noSignatureKey">no signature key given</string>
<string name="error_invalidData">not valid encryption data</string> <string name="error_invalidData">not valid encryption data</string>
<string name="error_corruptData">corrupt data</string> <string name="error_corruptData">corrupt data</string>
<string name="error_noSymmetricEncryptionPacket">couldn\'t find a packet with symmetric encryption</string> <string name="error_noSymmetricEncryptionPacket">couldn\'t find a packet with symmetric encryption</string>
<string name="error_wrongPassPhrase">wrong pass phrase</string> <string name="error_wrongPassPhrase">wrong passphrase</string>
<string name="error_savingKeys">error saving some key(s)</string> <string name="error_savingKeys">error saving some key(s)</string>
<string name="error_couldNotExtractPrivateKey">could not extract private key</string> <string name="error_couldNotExtractPrivateKey">could not extract private key</string>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2012 Dominik Schürmann <dominik@dominikschuermann.de>
Copyright (C) 2010 Thialfihar <thi@thialfihar.org> Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
@ -38,4 +39,14 @@
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
</style> </style>
<style name="SectionHeader">
<item name="android:drawableBottom">@drawable/section_header</item>
<item name="android:drawablePadding">4dp</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/emphasis</item>
<item name="android:textSize">14sp</item>
</style>
</resources> </resources>

View File

@ -31,6 +31,7 @@ import android.content.DialogInterface.OnClickListener;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
public class AskForSecretKeyPassPhrase { public class AskForSecretKeyPassPhrase {
@ -69,9 +70,14 @@ public class AskForSecretKeyPassPhrase {
LayoutInflater inflater = (LayoutInflater) context LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.pass_phrase, null); View view = inflater.inflate(R.layout.passphrase, null);
final EditText input = (EditText) view.findViewById(R.id.passPhrase); final EditText input = (EditText) view.findViewById(R.id.passphrase_passphrase);
final EditText inputNotUsed = (EditText) view.findViewById(R.id.passPhraseAgain);
final TextView labelNotUsed = (TextView) view
.findViewById(R.id.passphrase_label_passphrase_again);
labelNotUsed.setVisibility(View.GONE);
final EditText inputNotUsed = (EditText) view
.findViewById(R.id.passphrase_passphrase_again);
inputNotUsed.setVisibility(View.GONE); inputNotUsed.setVisibility(View.GONE);
alert.setView(view); alert.setView(view);

View File

@ -1,4 +1,5 @@
/* /*
* Copyright (C) 2012 Dominik Schürmann <dominik@dominikschuermann.de>
* Copyright (C) 2010 Thialfihar <thi@thialfihar.org> * Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -44,9 +45,13 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TableRow;
import android.widget.Toast; import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import java.io.IOException; import java.io.IOException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
@ -149,17 +154,32 @@ public class EditKeyActivity extends BaseActivity {
} }
} }
mChangePassPhrase = (Button) findViewById(R.id.btn_change_pass_phrase); mChangePassPhrase = (Button) findViewById(R.id.edit_key_btn_change_pass_phrase);
mChangePassPhrase.setOnClickListener(new OnClickListener() { mChangePassPhrase.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
showDialog(Id.dialog.new_pass_phrase); showDialog(Id.dialog.new_pass_phrase);
} }
}); });
// disable passphrase when no passphrase checkobox is checked!
final CheckBox noPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase);
noPassphrase.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
mChangePassPhrase.setVisibility(View.GONE);
} else {
mChangePassPhrase.setVisibility(View.VISIBLE);
}
}
});
// Build layout based on given userIds and keys // Build layout based on given userIds and keys
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout container = (LinearLayout) findViewById(R.id.container); LinearLayout container = (LinearLayout) findViewById(R.id.edit_key_container);
mUserIds = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false); mUserIds = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false);
mUserIds.setType(Id.type.user_id); mUserIds.setType(Id.type.user_id);
mUserIds.setUserIds(userIds); mUserIds.setUserIds(userIds);
@ -203,9 +223,9 @@ public class EditKeyActivity extends BaseActivity {
alert.setMessage(R.string.enterPassPhraseTwice); alert.setMessage(R.string.enterPassPhraseTwice);
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.pass_phrase, null); View view = inflater.inflate(R.layout.passphrase, null);
final EditText input1 = (EditText) view.findViewById(R.id.passPhrase); final EditText input1 = (EditText) view.findViewById(R.id.passphrase_passphrase);
final EditText input2 = (EditText) view.findViewById(R.id.passPhraseAgain); final EditText input2 = (EditText) view.findViewById(R.id.passphrase_passphrase_again);
alert.setView(view); alert.setView(view);

View File

@ -53,12 +53,10 @@ public class PublicKeyListActivity extends KeyListActivity {
.setIcon(R.drawable.ic_menu_search_list) .setIcon(R.drawable.ic_menu_search_list)
.setShowAsAction( .setShowAsAction(
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
menu.add(0, Id.menu.option.import_keys, 3, R.string.menu_importKeys) menu.add(0, Id.menu.option.import_keys, 3, R.string.menu_importKeys).setShowAsAction(
// .setIcon(R.drawable.ic_suggestions_add) MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT); menu.add(0, Id.menu.option.export_keys, 4, R.string.menu_exportKeys).setShowAsAction(
menu.add(0, Id.menu.option.export_keys, 4, R.string.menu_exportKeys) MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
// .setIcon(R.drawable.ic_menu_share_holo_light)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true; return true;
} }

View File

@ -49,17 +49,14 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
menu.add(3, Id.menu.option.search, 0, R.string.menu_search) menu.add(3, Id.menu.option.search, 0, R.string.menu_search)
.setIcon(R.drawable.ic_menu_search_list) .setIcon(R.drawable.ic_menu_search)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
menu.add(1, Id.menu.option.create, 1, R.string.menu_createKey) menu.add(1, Id.menu.option.create, 1, R.string.menu_createKey)
// .setIcon(R.drawable.ic_suggestions_add)
.setShowAsAction( .setShowAsAction(
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys) menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys)
// .setIcon(R.drawable.ic_menu_find_holo_light)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT); .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys) menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys)
// .setIcon(R.drawable.ic_menu_find_holo_light)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT); .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true; return true;

View File

@ -37,9 +37,13 @@ import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TableRow;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -176,11 +180,10 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
View view = mInflater.inflate(R.layout.create_key, null); View view = mInflater.inflate(R.layout.create_key, null);
dialog.setView(view); dialog.setView(view);
dialog.setTitle(R.string.title_createKey); dialog.setTitle(R.string.title_createKey);
dialog.setMessage(R.string.keyCreationElGamalInfo);
boolean wouldBeMasterKey = (mEditors.getChildCount() == 0); boolean wouldBeMasterKey = (mEditors.getChildCount() == 0);
final Spinner algorithm = (Spinner) view.findViewById(R.id.algorithm); final Spinner algorithm = (Spinner) view.findViewById(R.id.create_key_algorithm);
Vector<Choice> choices = new Vector<Choice>(); Vector<Choice> choices = new Vector<Choice>();
choices.add(new Choice(Id.choice.algorithm.dsa, getResources().getString(R.string.dsa))); choices.add(new Choice(Id.choice.algorithm.dsa, getResources().getString(R.string.dsa)));
if (!wouldBeMasterKey) { if (!wouldBeMasterKey) {
@ -202,7 +205,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
} }
} }
final EditText keySize = (EditText) view.findViewById(R.id.size); final EditText keySize = (EditText) view.findViewById(R.id.create_key_size);
dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface di, int id) { public void onClick(DialogInterface di, int id) {
@ -275,6 +278,24 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
this.updateEditorsVisible(); this.updateEditorsVisible();
} }
// TODO !!!
public void createInitialKey() {
mEditors.removeAllViews();
// create initial key
// PGPSecretKey key = new PGPSecretKey();
// for (PGPSecretKey key : list) {
KeyEditor view = (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item, mEditors, false);
view.setEditorListener(this);
boolean isMasterKey = (mEditors.getChildCount() == 0);
// view.setValue(key, isMasterKey);
mEditors.addView(view);
// }
this.updateEditorsVisible();
}
private void createKey() { private void createKey() {
mProgressDialog = new ProgressDialog(getContext()); mProgressDialog = new ProgressDialog(getContext());
mProgressDialog.setMessage(getContext().getString(R.string.progress_generating)); mProgressDialog.setMessage(getContext().getString(R.string.progress_generating));

View File

@ -40,7 +40,7 @@ public class ApgIntentHelper {
* *
* @param userIds * @param userIds
* value to specify prefilled values for user that should be created * value to specify prefilled values for user that should be created
* @return true when user presses save, false when user presses cancel * @return true when activity was found and executed successfully
*/ */
public boolean createNewKey(String userIds) { public boolean createNewKey(String userIds) {
Intent intent = new Intent(Constants.Intent.EDIT_KEY); Intent intent = new Intent(Constants.Intent.EDIT_KEY);
@ -60,7 +60,7 @@ public class ApgIntentHelper {
/** /**
* Opens APG activity to create new key * Opens APG activity to create new key
* *
* @return true when user presses save, false when user presses cancel * @return true when activity was found and executed successfully
*/ */
public boolean createNewKey() { public boolean createNewKey() {
return createNewKey(null); return createNewKey(null);
@ -70,7 +70,7 @@ public class ApgIntentHelper {
* Opens APG activity to edit already existing key based on keyId * Opens APG activity to edit already existing key based on keyId
* *
* @param keyId * @param keyId
* @return true when user presses save, false when user presses cancel * @return true when activity was found and executed successfully
*/ */
public boolean editKey(long keyId) { public boolean editKey(long keyId) {
Intent intent = new Intent(Constants.Intent.EDIT_KEY); Intent intent = new Intent(Constants.Intent.EDIT_KEY);
@ -88,7 +88,7 @@ public class ApgIntentHelper {
/** /**
* Opens APG activity to select the signature key. * Opens APG activity to select the signature key.
* *
* @return true when user presses okay, false when user presses cancel * @return true when activity was found and executed successfully
*/ */
public boolean selectSecretKey() { public boolean selectSecretKey() {
Intent intent = new Intent(Constants.Intent.SELECT_SECRET_KEY); Intent intent = new Intent(Constants.Intent.SELECT_SECRET_KEY);
@ -112,7 +112,7 @@ public class ApgIntentHelper {
* long[] that holds the ids of the encryption keys * long[] that holds the ids of the encryption keys
* @param signatureKeyId * @param signatureKeyId
* id of the signature key * id of the signature key
* @return * @return true when activity was found and executed successfully
*/ */
public boolean encrypt(String data, long[] encryptionKeyIds, long signatureKeyId) { public boolean encrypt(String data, long[] encryptionKeyIds, long signatureKeyId) {
Intent intent = new Intent(Constants.Intent.ENCRYPT_AND_RETURN); Intent intent = new Intent(Constants.Intent.ENCRYPT_AND_RETURN);
@ -136,7 +136,7 @@ public class ApgIntentHelper {
* @param activity * @param activity
* @param data * @param data
* @param pgpData * @param pgpData
* @return success or failure * @return true when activity was found and executed successfully
*/ */
public boolean decrypt(String data) { public boolean decrypt(String data) {
Intent intent = new Intent(Constants.Intent.DECRYPT_AND_RETURN); Intent intent = new Intent(Constants.Intent.DECRYPT_AND_RETURN);
@ -168,6 +168,7 @@ public class ApgIntentHelper {
switch (requestCode) { switch (requestCode) {
case Constants.SELECT_SECRET_KEY: case Constants.SELECT_SECRET_KEY:
if (resultCode != Activity.RESULT_OK || data == null) { if (resultCode != Activity.RESULT_OK || data == null) {
// user canceled!
break; break;
} }
apgData.setSignatureKeyId(data.getLongExtra(Constants.EXTRA_KEY_ID, 0)); apgData.setSignatureKeyId(data.getLongExtra(Constants.EXTRA_KEY_ID, 0));
@ -225,7 +226,7 @@ public class ApgIntentHelper {
* *
* @param emails * @param emails
* The emails that should be used for preselection. * The emails that should be used for preselection.
* @return false when activity could not be found! * @return true when activity was found and executed successfully
*/ */
public boolean selectEncryptionKeys(String emails) { public boolean selectEncryptionKeys(String emails) {
return selectEncryptionKeys(emails, null); return selectEncryptionKeys(emails, null);
@ -238,7 +239,7 @@ public class ApgIntentHelper {
* The emails that should be used for preselection. * The emails that should be used for preselection.
* @param apgData * @param apgData
* ApgData with encryption keys and signature keys preselected * ApgData with encryption keys and signature keys preselected
* @return false when activity could not be found! * @return true when activity was found and executed successfully
*/ */
public boolean selectEncryptionKeys(String emails, ApgData apgData) { public boolean selectEncryptionKeys(String emails, ApgData apgData) {
Intent intent = new Intent(Constants.Intent.SELECT_PUBLIC_KEYS); Intent intent = new Intent(Constants.Intent.SELECT_PUBLIC_KEYS);