From 79fb23b095fba273d77066204ee44d2b8d1edf8d Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Sun, 22 Jun 2014 16:31:28 +0200
Subject: Improve file more, Part 1
- Use Uris where it makes sense, Use File class to clarify it's a file (and not whatever else a string could be)
- Show sdcard in side menu in storage API #665
- Propose filename with gpg ending when storing it using the storage API #665
- Don't show output dialog on Android 4.4 #665
- Only show filename on Android < 4.4 #665
TODO:
- File deletion for Android < 4.4
- Testing (especially with Android < 4.4)
- Batch-encryption
- UI
- Temporary content provider (see #665 discussion)
---
.../org/sufficientlysecure/keychain/Constants.java | 7 +-
.../keychain/KeychainApplication.java | 5 +-
.../keychain/helper/ExportHelper.java | 63 +++----
.../keychain/helper/FileHelper.java | 149 +++++++++--------
.../keychain/service/KeychainIntentService.java | 21 ++-
.../keychain/ui/DecryptActivity.java | 21 +--
.../keychain/ui/DecryptFileFragment.java | 171 ++++++-------------
.../keychain/ui/EncryptActivity.java | 29 +---
.../keychain/ui/EncryptFileFragment.java | 181 ++++++---------------
.../keychain/ui/ImportKeysFileFragment.java | 2 +-
.../keychain/ui/KeyListFragment.java | 8 +-
.../keychain/ui/ViewKeyActivity.java | 4 +-
.../ui/dialog/DeleteFileDialogFragment.java | 38 ++---
.../keychain/ui/dialog/FileDialogFragment.java | 87 ++++------
OpenKeychain/src/main/res/values/strings.xml | 1 +
15 files changed, 291 insertions(+), 496 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index 319ac2873..8074ad2ee 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -27,6 +27,8 @@ import org.sufficientlysecure.keychain.ui.DecryptActivity;
import org.sufficientlysecure.keychain.ui.EncryptActivity;
import org.sufficientlysecure.keychain.ui.KeyListActivity;
+import java.io.File;
+
public final class Constants {
public static final boolean DEBUG = BuildConfig.DEBUG;
@@ -52,9 +54,8 @@ public final class Constants {
public static boolean KITKAT = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
public static final class Path {
- public static final String APP_DIR = Environment.getExternalStorageDirectory()
- + "/OpenKeychain";
- public static final String APP_DIR_FILE = APP_DIR + "/export.asc";
+ public static final File APP_DIR = new File(Environment.getExternalStorageDirectory(), "OpenKeychain");
+ public static final File APP_DIR_FILE = new File(APP_DIR, "export.asc");
}
public static final class Pref {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
index 5d6a62f9c..d28c4d63c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
@@ -26,11 +26,9 @@ import android.graphics.drawable.Drawable;
import android.os.Environment;
import org.spongycastle.jce.provider.BouncyCastleProvider;
-import org.sufficientlysecure.keychain.helper.ContactHelper;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.PRNGFixes;
-import java.io.File;
import java.security.Provider;
import java.security.Security;
@@ -70,8 +68,7 @@ public class KeychainApplication extends Application {
// Create APG directory on sdcard if not existing
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- File dir = new File(Constants.Path.APP_DIR);
- if (!dir.exists() && !dir.mkdirs()) {
+ if (!Constants.Path.APP_DIR.exists() && !Constants.Path.APP_DIR.mkdirs()) {
// ignore this for now, it's not crucial
// that the directory doesn't exist at this point
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java
index 16ef28311..ae9438148 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java
@@ -30,7 +30,6 @@ import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
@@ -39,9 +38,10 @@ import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
+import java.io.File;
+
public class ExportHelper {
- protected FileDialogFragment mFileDialog;
- protected String mExportFilename;
+ protected File mExportFile;
ActionBarActivity mActivity;
@@ -68,47 +68,30 @@ public class ExportHelper {
/**
* Show dialog where to export keys
*/
- public void showExportKeysDialog(final long[] masterKeyIds, final String exportFilename,
+ public void showExportKeysDialog(final long[] masterKeyIds, final File exportFile,
final boolean showSecretCheckbox) {
- mExportFilename = exportFilename;
-
- // Message is received after file is selected
- Handler returnHandler = new Handler() {
- @Override
- public void handleMessage(Message message) {
- if (message.what == FileDialogFragment.MESSAGE_OKAY) {
- Bundle data = message.getData();
- mExportFilename = data.getString(FileDialogFragment.MESSAGE_DATA_FILENAME);
-
- exportKeys(masterKeyIds, data.getBoolean(FileDialogFragment.MESSAGE_DATA_CHECKED));
- }
- }
- };
+ mExportFile = exportFile;
- // Create a new Messenger for the communication back
- final Messenger messenger = new Messenger(returnHandler);
-
- DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
- public void run() {
- String title = null;
- if (masterKeyIds == null) {
- // export all keys
- title = mActivity.getString(R.string.title_export_keys);
- } else {
- // export only key specified at data uri
- title = mActivity.getString(R.string.title_export_key);
- }
-
- String message = mActivity.getString(R.string.specify_file_to_export_to);
- String checkMsg = showSecretCheckbox ?
- mActivity.getString(R.string.also_export_secret_keys) : null;
+ String title = null;
+ if (masterKeyIds == null) {
+ // export all keys
+ title = mActivity.getString(R.string.title_export_keys);
+ } else {
+ // export only key specified at data uri
+ title = mActivity.getString(R.string.title_export_key);
+ }
- mFileDialog = FileDialogFragment.newInstance(messenger, title, message,
- exportFilename, checkMsg);
+ String message = mActivity.getString(R.string.specify_file_to_export_to);
+ String checkMsg = showSecretCheckbox ?
+ mActivity.getString(R.string.also_export_secret_keys) : null;
- mFileDialog.show(mActivity.getSupportFragmentManager(), "fileDialog");
+ FileHelper.saveFile(new FileHelper.FileDialogCallback() {
+ @Override
+ public void onFileSelected(File file, boolean checked) {
+ mExportFile = file;
+ exportKeys(masterKeyIds, checked);
}
- });
+ }, mActivity.getSupportFragmentManager() ,title, message, exportFile, checkMsg);
}
/**
@@ -125,7 +108,7 @@ public class ExportHelper {
// fill values for this action
Bundle data = new Bundle();
- data.putString(KeychainIntentService.EXPORT_FILENAME, mExportFilename);
+ data.putString(KeychainIntentService.EXPORT_FILENAME, mExportFile.getAbsolutePath());
data.putBoolean(KeychainIntentService.EXPORT_SECRET, exportSecret);
if (masterKeyIds == null) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
index e0c94b947..2898c7030 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
@@ -26,12 +26,19 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Messenger;
+import android.provider.OpenableColumns;
import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
import android.widget.Toast;
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.util.Log;
+import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
+import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
+
+import java.io.File;
public class FileHelper {
@@ -55,25 +62,18 @@ public class FileHelper {
* Opens the preferred installed file manager on Android and shows a toast if no manager is
* installed.
*
- * @param activity
- * @param filename default selected file, not supported by all file managers
+ * @param fragment
+ * @param last default selected Uri, not supported by all file managers
* @param mimeType can be text/plain for example
* @param requestCode requestCode used to identify the result coming back from file manager to
* onActivityResult() in your activity
*/
- public static void openFile(Activity activity, String filename, String mimeType, int requestCode) {
- Intent intent = buildFileIntent(filename, mimeType);
-
- try {
- activity.startActivityForResult(intent, requestCode);
- } catch (ActivityNotFoundException e) {
- // No compatible file manager was found.
- Toast.makeText(activity, R.string.no_filemanager_installed, Toast.LENGTH_SHORT).show();
- }
- }
+ public static void openFile(Fragment fragment, Uri last, String mimeType, int requestCode) {
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
- public static void openFile(Fragment fragment, String filename, String mimeType, int requestCode) {
- Intent intent = buildFileIntent(filename, mimeType);
+ intent.setData(last);
+ intent.setType(mimeType);
try {
fragment.startActivityForResult(intent, requestCode);
@@ -84,19 +84,62 @@ public class FileHelper {
}
}
+ public static void saveFile(final FileDialogCallback callback, final FragmentManager fragmentManager,
+ final String title, final String message, final File defaultFile,
+ final String checkMsg) {
+ // Message is received after file is selected
+ Handler returnHandler = new Handler() {
+ @Override
+ public void handleMessage(Message message) {
+ if (message.what == FileDialogFragment.MESSAGE_OKAY) {
+ callback.onFileSelected(
+ new File(message.getData().getString(FileDialogFragment.MESSAGE_DATA_FILE)),
+ message.getData().getBoolean(FileDialogFragment.MESSAGE_DATA_CHECKED));
+ }
+ }
+ };
+
+ // Create a new Messenger for the communication back
+ final Messenger messenger = new Messenger(returnHandler);
+
+ DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
+ @Override
+ public void run() {
+ FileDialogFragment fileDialog = FileDialogFragment.newInstance(messenger, title, message,
+ defaultFile, checkMsg);
+
+ fileDialog.show(fragmentManager, "fileDialog");
+ }
+ });
+ }
+
+ public static void saveFile(Fragment fragment, String title, String message, File defaultFile, int requestCode) {
+ saveFile(fragment, title, message, defaultFile, requestCode, null);
+ }
+
+ public static void saveFile(final Fragment fragment, String title, String message, File defaultFile,
+ final int requestCode, String checkMsg) {
+ saveFile(new FileDialogCallback() {
+ @Override
+ public void onFileSelected(File file, boolean checked) {
+ Intent intent = new Intent();
+ intent.setData(Uri.fromFile(file));
+ fragment.onActivityResult(requestCode, Activity.RESULT_OK, intent);
+ }
+ }, fragment.getActivity().getSupportFragmentManager(), title, message, defaultFile, checkMsg);
+ }
+
/**
* Opens the storage browser on Android 4.4 or later for opening a file
* @param fragment
- * @param last default selected file
* @param mimeType can be text/plain for example
* @param requestCode used to identify the result coming back from storage browser onActivityResult() in your
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
- public static void openDocument(Fragment fragment, Uri last, String mimeType, int requestCode) {
+ public static void openDocument(Fragment fragment, String mimeType, int requestCode) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
- intent.setData(last);
intent.setType(mimeType);
fragment.startActivityForResult(intent, requestCode);
}
@@ -104,66 +147,42 @@ public class FileHelper {
/**
* Opens the storage browser on Android 4.4 or later for saving a file
* @param fragment
- * @param last default selected file
* @param mimeType can be text/plain for example
+ * @param suggestedName a filename desirable for the file to be saved
* @param requestCode used to identify the result coming back from storage browser onActivityResult() in your
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
- public static void saveDocument(Fragment fragment, Uri last, String mimeType, int requestCode) {
+ public static void saveDocument(Fragment fragment, String mimeType, String suggestedName, int requestCode) {
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
- intent.setData(last);
intent.setType(mimeType);
+ intent.putExtra("android.content.extra.SHOW_ADVANCED", true); // Note: This is not documented, but works
+ intent.putExtra(Intent.EXTRA_TITLE, suggestedName);
fragment.startActivityForResult(intent, requestCode);
}
- private static Intent buildFileIntent(String filename, String mimeType) {
- Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
-
- intent.setData(Uri.parse("file://" + filename));
- intent.setType(mimeType);
-
- return intent;
- }
+ public static String getFilename(Context context, Uri uri) {
+ String filename = null;
+ try {
+ Cursor cursor = context.getContentResolver().query(uri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null);
- /**
- * Get a file path from a Uri.
- *
- * from https://github.com/iPaulPro/aFileChooser/blob/master/aFileChooser/src/com/ipaulpro/
- * afilechooser/utils/FileUtils.java
- *
- * @param context
- * @param uri
- * @return
- * @author paulburke
- */
- public static String getPath(Context context, Uri uri) {
- Log.d(Constants.TAG + " File -",
- "Authority: " + uri.getAuthority() + ", Fragment: " + uri.getFragment()
- + ", Port: " + uri.getPort() + ", Query: " + uri.getQuery() + ", Scheme: "
- + uri.getScheme() + ", Host: " + uri.getHost() + ", Segments: "
- + uri.getPathSegments().toString());
-
- if ("content".equalsIgnoreCase(uri.getScheme())) {
- String[] projection = {"_data"};
- Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null);
- try {
- if (cursor != null && cursor.moveToFirst()) {
- int columnIndex = cursor.getColumnIndexOrThrow("_data");
- return cursor.getString(columnIndex);
- }
- } catch (Exception e) {
- // Eat it
- } finally {
- if (cursor != null) {
- cursor.close();
+ if (cursor != null) {
+ if (cursor.moveToNext()) {
+ filename = cursor.getString(0);
}
+ cursor.close();
}
- } else if ("file".equalsIgnoreCase(uri.getScheme())) {
- return uri.getPath();
+ } catch (Exception ignored) {
+ // This happens in rare cases (eg: document deleted since selection) and should not cause a failure
}
+ if (filename == null) {
+ String[] split = uri.toString().split("/");
+ filename = split[split.length - 1];
+ }
+ return filename;
+ }
- return null;
+ public static interface FileDialogCallback {
+ public void onFileSelected(File file, boolean checked);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index e1514b16f..a2676b1a4 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -139,6 +139,7 @@ public class KeychainIntentService extends IntentService
// export key
public static final String EXPORT_OUTPUT_STREAM = "export_output_stream";
public static final String EXPORT_FILENAME = "export_filename";
+ public static final String EXPORT_URI = "export_uri";
public static final String EXPORT_SECRET = "export_secret";
public static final String EXPORT_ALL = "export_all";
public static final String EXPORT_KEY_RING_MASTER_KEY_ID = "export_key_ring_id";
@@ -393,13 +394,16 @@ public class KeychainIntentService extends IntentService
boolean exportSecret = data.getBoolean(EXPORT_SECRET, false);
long[] masterKeyIds = data.getLongArray(EXPORT_KEY_RING_MASTER_KEY_ID);
String outputFile = data.getString(EXPORT_FILENAME);
+ Uri outputUri = data.getParcelable(EXPORT_URI);
// If not exporting all keys get the masterKeyIds of the keys to export from the intent
boolean exportAll = data.getBoolean(EXPORT_ALL);
- // check if storage is ready
- if (!FileHelper.isStorageMounted(outputFile)) {
- throw new PgpGeneralException(getString(R.string.error_external_storage_not_ready));
+ if (outputFile != null) {
+ // check if storage is ready
+ if (!FileHelper.isStorageMounted(outputFile)) {
+ throw new PgpGeneralException(getString(R.string.error_external_storage_not_ready));
+ }
}
ArrayList publicMasterKeyIds = new ArrayList();
@@ -431,12 +435,19 @@ public class KeychainIntentService extends IntentService
}
}
+ OutputStream outStream;
+ if (outputFile != null) {
+ outStream = new FileOutputStream(outputFile);
+ } else {
+ outStream = getContentResolver().openOutputStream(outputUri);
+ }
+
PgpImportExport pgpImportExport = new PgpImportExport(this, this, this);
Bundle resultData = pgpImportExport
.exportKeyRings(publicMasterKeyIds, secretMasterKeyIds,
- new FileOutputStream(outputFile));
+ outStream);
- if (mIsCanceled) {
+ if (mIsCanceled && outputFile != null) {
boolean isDeleted = new File(outputFile).delete();
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
index 5b21be6e4..33659f3e5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
@@ -23,11 +23,9 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
-import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.util.Log;
@@ -114,7 +112,7 @@ public class DecryptActivity extends DrawerActivity {
} else {
// Binary via content provider (could also be files)
// override uri to get stream from send
- uri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
+ uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
action = ACTION_DECRYPT;
}
} else if (Intent.ACTION_VIEW.equals(action)) {
@@ -155,21 +153,8 @@ public class DecryptActivity extends DrawerActivity {
}
}
} else if (ACTION_DECRYPT.equals(action) && uri != null) {
- // get file path from uri
- String path = FileHelper.getPath(this, uri);
-
- if (path != null) {
- mFileFragmentBundle.putString(DecryptFileFragment.ARG_FILENAME, path);
- mSwitchToTab = PAGER_TAB_FILE;
- } else {
- Log.e(Constants.TAG,
- "Direct binary data without actual file in filesystem is not supported. " +
- "Please use the Remote Service API!");
- Toast.makeText(this, R.string.error_only_files_are_supported, Toast.LENGTH_LONG)
- .show();
- // end activity
- finish();
- }
+ mFileFragmentBundle.putParcelable(DecryptFileFragment.ARG_URI, uri);
+ mSwitchToTab = PAGER_TAB_FILE;
} else {
Log.e(Constants.TAG,
"Include the extra 'text' or an Uri with setData() in your Intent!");
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
index 28a465436..3df3b24b2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
@@ -20,21 +20,17 @@ package org.sufficientlysecure.keychain.ui;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
-import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
-import android.provider.OpenableColumns;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
-import android.widget.EditText;
+import android.widget.TextView;
import com.beardedhen.androidbootstrap.BootstrapButton;
-import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
@@ -44,29 +40,26 @@ import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.util.Notify;
import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
-import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
public class DecryptFileFragment extends DecryptFragment {
- public static final String ARG_FILENAME = "filename";
+ public static final String ARG_URI = "uri";
- private static final int RESULT_CODE_FILE = 0x00007003;
+ private static final int REQUEST_CODE_INPUT = 0x00007003;
+ private static final int REQUEST_CODE_OUTPUT = 0x00007007;
// view
- private EditText mFilename;
+ private TextView mFilename;
private CheckBox mDeleteAfter;
private BootstrapButton mBrowse;
private View mDecryptButton;
- private String mInputFilename = null;
+ // model
private Uri mInputUri = null;
- private String mOutputFilename = null;
private Uri mOutputUri = null;
- private FileDialogFragment mFileDialog;
-
/**
* Inflate the layout for this fragment
*/
@@ -74,17 +67,17 @@ public class DecryptFileFragment extends DecryptFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.decrypt_file_fragment, container, false);
- mFilename = (EditText) view.findViewById(R.id.decrypt_file_filename);
+ mFilename = (TextView) view.findViewById(R.id.decrypt_file_filename);
mBrowse = (BootstrapButton) view.findViewById(R.id.decrypt_file_browse);
mDeleteAfter = (CheckBox) view.findViewById(R.id.decrypt_file_delete_after_decryption);
mDecryptButton = view.findViewById(R.id.decrypt_file_action_decrypt);
mBrowse.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (Constants.KITKAT) {
- FileHelper.openDocument(DecryptFileFragment.this, mInputUri, "*/*", RESULT_CODE_FILE);
+ FileHelper.openDocument(DecryptFileFragment.this, "*/*", REQUEST_CODE_INPUT);
} else {
- FileHelper.openFile(DecryptFileFragment.this, mFilename.getText().toString(), "*/*",
- RESULT_CODE_FILE);
+ FileHelper.openFile(DecryptFileFragment.this, mInputUri, "*/*",
+ REQUEST_CODE_INPUT);
}
}
});
@@ -102,78 +95,48 @@ public class DecryptFileFragment extends DecryptFragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- String filename = getArguments().getString(ARG_FILENAME);
- if (filename != null) {
- mFilename.setText(filename);
- }
+ setInputUri(getArguments().getParcelable(ARG_URI));
}
- private String guessOutputFilename() {
- File file = new File(mInputFilename);
- String filename = file.getName();
- if (filename.endsWith(".asc") || filename.endsWith(".gpg") || filename.endsWith(".pgp")) {
- filename = filename.substring(0, filename.length() - 4);
+ private void setInputUri(Uri inputUri) {
+ if (inputUri == null) {
+ mInputUri = null;
+ mFilename.setText("");
+ return;
}
- return Constants.Path.APP_DIR + "/" + filename;
+
+ mInputUri = inputUri;
+ mFilename.setText(FileHelper.getFilename(getActivity(), mInputUri));
}
private void decryptAction() {
- String currentFilename = mFilename.getText().toString();
- if (mInputFilename == null || !mInputFilename.equals(currentFilename)) {
- mInputUri = null;
- mInputFilename = mFilename.getText().toString();
- }
-
if (mInputUri == null) {
- mOutputFilename = guessOutputFilename();
- }
-
- if (mInputFilename.equals("")) {
//AppMsg.makeText(getActivity(), R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
Notify.showNotify(getActivity(), R.string.no_file_selected, Notify.Style.ERROR);
return;
}
- if (mInputUri == null && mInputFilename.startsWith("file")) {
- File file = new File(mInputFilename);
- if (!file.exists() || !file.isFile()) {
- AppMsg.makeText(
- getActivity(),
- getString(R.string.error_message,
- getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT)
- .show();
- return;
- }
- }
-
askForOutputFilename();
}
- private void askForOutputFilename() {
- // Message is received after passphrase is cached
- Handler returnHandler = new Handler() {
- @Override
- public void handleMessage(Message message) {
- if (message.what == FileDialogFragment.MESSAGE_OKAY) {
- Bundle data = message.getData();
- if (data.containsKey(FileDialogFragment.MESSAGE_DATA_URI)) {
- mOutputUri = data.getParcelable(FileDialogFragment.MESSAGE_DATA_URI);
- } else {
- mOutputFilename = data.getString(FileDialogFragment.MESSAGE_DATA_FILENAME);
- }
- decryptStart(null);
- }
- }
- };
-
- // Create a new Messenger for the communication back
- Messenger messenger = new Messenger(returnHandler);
-
- mFileDialog = FileDialogFragment.newInstance(messenger,
- getString(R.string.title_decrypt_to_file),
- getString(R.string.specify_file_to_decrypt_to), mOutputFilename, null);
+ private String removeEncryptedAppend(String name) {
+ if (name.endsWith(".asc") || name.endsWith(".gpg") || name.endsWith(".pgp")) {
+ return name.substring(0, name.length() - 4);
+ }
+ return name;
+ }
- mFileDialog.show(getActivity().getSupportFragmentManager(), "fileDialog");
+ private void askForOutputFilename() {
+ String targetName = removeEncryptedAppend(FileHelper.getFilename(getActivity(), mInputUri));
+ if (!Constants.KITKAT) {
+ File file = new File(mInputUri.getPath());
+ File parentDir = file.exists() ? file.getParentFile() : Constants.Path.APP_DIR;
+ File targetFile = new File(parentDir, targetName);
+ FileHelper.saveFile(this, getString(R.string.title_decrypt_to_file),
+ getString(R.string.specify_file_to_decrypt_to), targetFile, REQUEST_CODE_OUTPUT);
+ } else {
+ FileHelper.saveDocument(this, "*/*", targetName, REQUEST_CODE_OUTPUT);
+ }
}
@Override
@@ -189,25 +152,13 @@ public class DecryptFileFragment extends DecryptFragment {
intent.setAction(KeychainIntentService.ACTION_DECRYPT_VERIFY);
// data
- Log.d(Constants.TAG, "mInputFilename=" + mInputFilename + ", mOutputFilename="
- + mOutputFilename + ",mInputUri=" + mInputUri + ", mOutputUri="
- + mOutputUri);
+ Log.d(Constants.TAG, "mInputUri=" + mInputUri + ", mOutputUri=" + mOutputUri);
- if (mInputUri != null) {
- data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_URI);
- data.putParcelable(KeychainIntentService.ENCRYPT_INPUT_URI, mInputUri);
- } else {
- data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_FILE);
- data.putString(KeychainIntentService.ENCRYPT_INPUT_FILE, mInputFilename);
- }
+ data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_URI);
+ data.putParcelable(KeychainIntentService.ENCRYPT_INPUT_URI, mInputUri);
- if (mOutputUri != null) {
- data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_URI);
- data.putParcelable(KeychainIntentService.ENCRYPT_OUTPUT_URI, mOutputUri);
- } else {
- data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_FILE);
- data.putString(KeychainIntentService.ENCRYPT_OUTPUT_FILE, mOutputFilename);
- }
+ data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_URI);
+ data.putParcelable(KeychainIntentService.ENCRYPT_OUTPUT_URI, mOutputUri);
data.putString(KeychainIntentService.DECRYPT_PASSPHRASE, passphrase);
@@ -238,14 +189,9 @@ public class DecryptFileFragment extends DecryptFragment {
if (mDeleteAfter.isChecked()) {
// Create and show dialog to delete original file
- DeleteFileDialogFragment deleteFileDialog;
- if (mInputUri != null) {
- deleteFileDialog = DeleteFileDialogFragment.newInstance(mInputUri);
- } else {
- deleteFileDialog = DeleteFileDialogFragment
- .newInstance(mInputFilename);
- }
+ DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(mInputUri);
deleteFileDialog.show(getActivity().getSupportFragmentManager(), "deleteDialog");
+ setInputUri(null);
}
}
}
@@ -266,28 +212,17 @@ public class DecryptFileFragment extends DecryptFragment {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
- case RESULT_CODE_FILE: {
+ case REQUEST_CODE_INPUT: {
if (resultCode == Activity.RESULT_OK && data != null) {
- if (Constants.KITKAT) {
- mInputUri = data.getData();
- Cursor cursor = getActivity().getContentResolver().query(mInputUri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null);
- if (cursor != null) {
- if (cursor.moveToNext()) {
- mInputFilename = cursor.getString(0);
- mFilename.setText(mInputFilename);
- }
- cursor.close();
- }
- } else {
- try {
- String path = FileHelper.getPath(getActivity(), data.getData());
- Log.d(Constants.TAG, "path=" + path);
-
- mFilename.setText(path);
- } catch (NullPointerException e) {
- Log.e(Constants.TAG, "Nullpointer while retrieving path!");
- }
- }
+ setInputUri(data.getData());
+ }
+ return;
+ }
+ case REQUEST_CODE_OUTPUT: {
+ // This happens after output file was selected, so start our operation
+ if (resultCode == Activity.RESULT_OK && data != null) {
+ mOutputUri = data.getData();
+ decryptStart(null);
}
return;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 39d4a09bc..e93a63cc8 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -23,11 +23,9 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
-import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.util.Log;
@@ -98,11 +96,7 @@ public class EncryptActivity extends DrawerActivity implements
@Override
public boolean isModeSymmetric() {
- if (PAGER_MODE_SYMMETRIC == mViewPagerMode.getCurrentItem()) {
- return true;
- } else {
- return false;
- }
+ return PAGER_MODE_SYMMETRIC == mViewPagerMode.getCurrentItem();
}
@Override
@@ -201,7 +195,7 @@ public class EncryptActivity extends DrawerActivity implements
}
} else {
// Files via content provider, override uri and action
- uri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
+ uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
action = ACTION_ENCRYPT;
}
}
@@ -232,23 +226,8 @@ public class EncryptActivity extends DrawerActivity implements
mSwitchToContent = PAGER_CONTENT_MESSAGE;
} else if (ACTION_ENCRYPT.equals(action) && uri != null) {
// encrypt file based on Uri
-
- // get file path from uri
- String path = FileHelper.getPath(this, uri);
-
- if (path != null) {
- mFileFragmentBundle.putString(EncryptFileFragment.ARG_FILENAME, path);
- mSwitchToContent = PAGER_CONTENT_FILE;
- } else {
- Log.e(Constants.TAG,
- "Direct binary data without actual file in filesystem is not supported " +
- "by Intents. Please use the Remote Service API!"
- );
- Toast.makeText(this, R.string.error_only_files_are_supported,
- Toast.LENGTH_LONG).show();
- // end activity
- finish();
- }
+ mFileFragmentBundle.putParcelable(EncryptFileFragment.ARG_URI, uri);
+ mSwitchToContent = PAGER_CONTENT_FILE;
} else {
Log.e(Constants.TAG,
"Include the extra 'text' or an Uri with setData() in your Intent!");
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index 2671e0d40..4da76bdfb 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -20,21 +20,19 @@ package org.sufficientlysecure.keychain.ui;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
-import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
-import android.provider.OpenableColumns;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
-import android.widget.EditText;
import android.widget.Spinner;
+import android.widget.TextView;
import com.beardedhen.androidbootstrap.BootstrapButton;
import com.devspark.appmsg.AppMsg;
@@ -47,7 +45,6 @@ import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
-import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.util.Choice;
import org.sufficientlysecure.keychain.util.Log;
@@ -55,28 +52,25 @@ import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
public class EncryptFileFragment extends Fragment {
- public static final String ARG_FILENAME = "filename";
+ public static final String ARG_URI = "uri";
public static final String ARG_ASCII_ARMOR = "ascii_armor";
- private static final int RESULT_CODE_FILE = 0x00007003;
+ private static final int REQUEST_CODE_INPUT = 0x00007003;
+ private static final int REQUEST_CODE_OUTPUT = 0x00007007;
private EncryptActivityInterface mEncryptInterface;
// view
private CheckBox mAsciiArmor = null;
private Spinner mFileCompression = null;
- private EditText mFilename = null;
+ private TextView mFilename = null;
private CheckBox mDeleteAfter = null;
private CheckBox mShareAfter = null;
private BootstrapButton mBrowse = null;
private View mEncryptFile;
- private FileDialogFragment mFileDialog;
-
// model
- private String mInputFilename = null;
private Uri mInputUri = null;
- private String mOutputFilename = null;
private Uri mOutputUri = null;
@Override
@@ -104,15 +98,15 @@ public class EncryptFileFragment extends Fragment {
}
});
- mFilename = (EditText) view.findViewById(R.id.filename);
+ mFilename = (TextView) view.findViewById(R.id.filename);
mBrowse = (BootstrapButton) view.findViewById(R.id.btn_browse);
mBrowse.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (Constants.KITKAT) {
- FileHelper.openDocument(EncryptFileFragment.this, mInputUri, "*/*", RESULT_CODE_FILE);
+ FileHelper.openDocument(EncryptFileFragment.this, "*/*", REQUEST_CODE_INPUT);
} else {
- FileHelper.openFile(EncryptFileFragment.this, mFilename.getText().toString(), "*/*",
- RESULT_CODE_FILE);
+ FileHelper.openFile(EncryptFileFragment.this, mInputUri, "*/*",
+ REQUEST_CODE_INPUT);
}
}
});
@@ -154,86 +148,45 @@ public class EncryptFileFragment extends Fragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- String filename = getArguments().getString(ARG_FILENAME);
- if (filename != null) {
- mFilename.setText(filename);
- }
+ setInputUri(getArguments().getParcelable(ARG_URI));
boolean asciiArmor = getArguments().getBoolean(ARG_ASCII_ARMOR);
if (asciiArmor) {
- mAsciiArmor.setChecked(asciiArmor);
+ mAsciiArmor.setChecked(true);
}
}
- /**
- * Guess output filename based on input path
- *
- * @param path
- * @return Suggestion for output filename
- */
- private String guessOutputFilename(String path) {
- // output in the same directory but with additional ending
- File file = new File(path);
- String ending = (mAsciiArmor.isChecked() ? ".asc" : ".gpg");
- String outputFilename = file.getParent() + File.separator + file.getName() + ending;
+ private void setInputUri(Uri inputUri) {
+ if (inputUri == null) {
+ mInputUri = null;
+ mFilename.setText("");
+ return;
+ }
- return outputFilename;
+ mInputUri = inputUri;
+ mFilename.setText(FileHelper.getFilename(getActivity(), mInputUri));
}
private void showOutputFileDialog() {
- // Message is received after file is selected
- Handler returnHandler = new Handler() {
- @Override
- public void handleMessage(Message message) {
- if (message.what == FileDialogFragment.MESSAGE_OKAY) {
- Bundle data = message.getData();
- if (data.containsKey(FileDialogFragment.MESSAGE_DATA_URI)) {
- mOutputUri = data.getParcelable(FileDialogFragment.MESSAGE_DATA_URI);
- } else {
- mOutputFilename = data.getString(FileDialogFragment.MESSAGE_DATA_FILENAME);
- }
- encryptStart();
- }
- }
- };
-
- // Create a new Messenger for the communication back
- Messenger messenger = new Messenger(returnHandler);
-
- mFileDialog = FileDialogFragment.newInstance(messenger,
- getString(R.string.title_encrypt_to_file),
- getString(R.string.specify_file_to_encrypt_to), mOutputFilename, null);
-
- mFileDialog.show(getActivity().getSupportFragmentManager(), "fileDialog");
+ if (!Constants.KITKAT) {
+ File file = new File(mInputUri.getPath());
+ File parentDir = file.exists() ? file.getParentFile() : Constants.Path.APP_DIR;
+ String targetName = FileHelper.getFilename(
+ getActivity(), mInputUri) + (mAsciiArmor.isChecked() ? ".asc" : ".gpg");
+ File targetFile = new File(parentDir, targetName);
+ FileHelper.saveFile(this, getString(R.string.title_encrypt_to_file),
+ getString(R.string.specify_file_to_encrypt_to), targetFile, REQUEST_CODE_OUTPUT);
+ } else {
+ FileHelper.saveDocument(this, "*/*", FileHelper.getFilename(getActivity(), mInputUri) +
+ (mAsciiArmor.isChecked() ? ".asc" : ".gpg"), REQUEST_CODE_OUTPUT);
+ }
}
private void encryptClicked() {
- String currentFilename = mFilename.getText().toString();
- if (mInputFilename == null || !mInputFilename.equals(currentFilename)) {
- mInputUri = null;
- mInputFilename = mFilename.getText().toString();
- }
-
if (mInputUri == null) {
- mOutputFilename = guessOutputFilename(mInputFilename);
- }
-
- if (mInputFilename.equals("")) {
AppMsg.makeText(getActivity(), R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
return;
}
- if (mInputUri == null && !mInputFilename.startsWith("content")) {
- File file = new File(mInputFilename);
- if (!file.exists() || !file.isFile()) {
- AppMsg.makeText(
- getActivity(),
- getString(R.string.error_message,
- getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT)
- .show();
- return;
- }
- }
-
if (mEncryptInterface.isModeSymmetric()) {
// symmetric encryption
@@ -287,6 +240,10 @@ public class EncryptFileFragment extends Fragment {
}
private void encryptStart() {
+ if (mInputUri == null || mOutputUri == null) {
+ throw new IllegalStateException("Something went terribly wrong if this happens!");
+ }
+
// Send all information needed to service to edit key in other thread
Intent intent = new Intent(getActivity(), KeychainIntentService.class);
@@ -295,25 +252,13 @@ public class EncryptFileFragment extends Fragment {
// fill values for this action
Bundle data = new Bundle();
- Log.d(Constants.TAG, "mInputFilename=" + mInputFilename + ", mOutputFilename="
- + mOutputFilename + ",mInputUri=" + mInputUri + ", mOutputUri="
- + mOutputUri);
+ Log.d(Constants.TAG, "mInputUri=" + mInputUri + ", mOutputUri=" + mOutputUri);
- if (mInputUri != null) {
- data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_URI);
- data.putParcelable(KeychainIntentService.ENCRYPT_INPUT_URI, mInputUri);
- } else {
- data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_FILE);
- data.putString(KeychainIntentService.ENCRYPT_INPUT_FILE, mInputFilename);
- }
+ data.putInt(KeychainIntentService.SOURCE, KeychainIntentService.IO_URI);
+ data.putParcelable(KeychainIntentService.ENCRYPT_INPUT_URI, mInputUri);
- if (mOutputUri != null) {
- data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_URI);
- data.putParcelable(KeychainIntentService.ENCRYPT_OUTPUT_URI, mOutputUri);
- } else {
- data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_FILE);
- data.putString(KeychainIntentService.ENCRYPT_OUTPUT_FILE, mOutputFilename);
- }
+ data.putInt(KeychainIntentService.TARGET, KeychainIntentService.IO_URI);
+ data.putParcelable(KeychainIntentService.ENCRYPT_OUTPUT_URI, mOutputUri);
if (mEncryptInterface.isModeSymmetric()) {
Log.d(Constants.TAG, "Symmetric encryption enabled!");
@@ -350,25 +295,16 @@ public class EncryptFileFragment extends Fragment {
if (mDeleteAfter.isChecked()) {
// Create and show dialog to delete original file
- DeleteFileDialogFragment deleteFileDialog;
- if (mInputUri != null) {
- deleteFileDialog = DeleteFileDialogFragment.newInstance(mInputUri);
- } else {
- deleteFileDialog = DeleteFileDialogFragment
- .newInstance(mInputFilename);
- }
+ DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(mInputUri);
deleteFileDialog.show(getActivity().getSupportFragmentManager(), "deleteDialog");
+ setInputUri(null);
}
if (mShareAfter.isChecked()) {
// Share encrypted file
Intent sendFileIntent = new Intent(Intent.ACTION_SEND);
sendFileIntent.setType("*/*");
- if (mOutputUri != null) {
- sendFileIntent.putExtra(Intent.EXTRA_STREAM, mOutputUri);
- } else {
- sendFileIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(mOutputFilename));
- }
+ sendFileIntent.putExtra(Intent.EXTRA_STREAM, mOutputUri);
startActivity(Intent.createChooser(sendFileIntent,
getString(R.string.title_share_file)));
}
@@ -390,28 +326,17 @@ public class EncryptFileFragment extends Fragment {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
- case RESULT_CODE_FILE: {
+ case REQUEST_CODE_INPUT: {
if (resultCode == Activity.RESULT_OK && data != null) {
- if (Constants.KITKAT) {
- mInputUri = data.getData();
- Cursor cursor = getActivity().getContentResolver().query(mInputUri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null);
- if (cursor != null) {
- if (cursor.moveToNext()) {
- mInputFilename = cursor.getString(0);
- mFilename.setText(mInputFilename);
- }
- cursor.close();
- }
- } else {
- try {
- String path = FileHelper.getPath(getActivity(), data.getData());
- Log.d(Constants.TAG, "path=" + path);
-
- mFilename.setText(path);
- } catch (NullPointerException e) {
- Log.e(Constants.TAG, "Nullpointer while retrieving path!");
- }
- }
+ setInputUri(data.getData());
+ }
+ return;
+ }
+ case REQUEST_CODE_OUTPUT: {
+ // This happens after output file was selected, so start our operation
+ if (resultCode == Activity.RESULT_OK && data != null) {
+ mOutputUri = data.getData();
+ encryptStart();
}
return;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysFileFragment.java
index 60e5324c5..f24cb379e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysFileFragment.java
@@ -66,7 +66,7 @@ public class ImportKeysFileFragment extends Fragment {
// open .asc or .gpg files
// setting it to text/plain prevents Cyanogenmod's file manager from selecting asc
// or gpg types!
- FileHelper.openFile(ImportKeysFileFragment.this, Constants.Path.APP_DIR + "/",
+ FileHelper.openFile(ImportKeysFileFragment.this, Uri.fromFile(Constants.Path.APP_DIR),
"*/*", REQUEST_CODE_FILE);
}
});
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
index 5eb8ecb8d..48ad13425 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
@@ -181,8 +181,8 @@ public class KeyListFragment extends LoaderFragment
case R.id.menu_key_list_multi_export: {
ids = mAdapter.getCurrentSelectedMasterKeyIds();
ExportHelper mExportHelper = new ExportHelper((ActionBarActivity) getActivity());
- mExportHelper.showExportKeysDialog(
- ids, Constants.Path.APP_DIR_FILE, mAdapter.isAnySecretSelected());
+ mExportHelper.showExportKeysDialog(ids, Constants.Path.APP_DIR_FILE,
+ mAdapter.isAnySecretSelected());
break;
}
case R.id.menu_key_list_multi_select_all: {
@@ -205,7 +205,7 @@ public class KeyListFragment extends LoaderFragment
public void onItemCheckedStateChanged(ActionMode mode, int position, long id,
boolean checked) {
if (checked) {
- mAdapter.setNewSelection(position, checked);
+ mAdapter.setNewSelection(position, true);
} else {
mAdapter.removeSelection(position);
}
@@ -452,7 +452,7 @@ public class KeyListFragment extends LoaderFragment
ItemViewHolder holder = new ItemViewHolder();
holder.mMainUserId = (TextView) view.findViewById(R.id.mainUserId);
holder.mMainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
- holder.mStatusDivider = (View) view.findViewById(R.id.status_divider);
+ holder.mStatusDivider = view.findViewById(R.id.status_divider);
holder.mStatusLayout = (FrameLayout) view.findViewById(R.id.status_layout);
holder.mButton = (ImageButton) view.findViewById(R.id.edit);
holder.mRevoked = (TextView) view.findViewById(R.id.revoked);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
index 1912b6e7d..6dc6990e0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -20,7 +20,6 @@ package org.sufficientlysecure.keychain.ui;
import android.annotation.TargetApi;
import android.app.Activity;
-import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
@@ -312,8 +311,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
exportHelper.showExportKeysDialog(
new long[]{(Long) data.get(KeychainContract.KeyRings.MASTER_KEY_ID)},
- Constants.Path.APP_DIR_FILE,
- ((Long) data.get(KeychainContract.KeyRings.HAS_SECRET) == 1)
+ Constants.Path.APP_DIR_FILE, ((Long) data.get(KeychainContract.KeyRings.HAS_SECRET) == 1)
);
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
index cae6cf043..f9111d885 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
@@ -18,40 +18,20 @@
package org.sufficientlysecure.keychain.ui.dialog;
import android.app.Dialog;
-import android.app.ProgressDialog;
import android.content.DialogInterface;
-import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Message;
-import android.os.Messenger;
import android.provider.DocumentsContract;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
-import android.widget.Toast;
+import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.service.KeychainIntentService;
-import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
+import org.sufficientlysecure.keychain.helper.FileHelper;
public class DeleteFileDialogFragment extends DialogFragment {
- private static final String ARG_DELETE_FILE = "delete_file";
private static final String ARG_DELETE_URI = "delete_uri";
- /**
- * Creates new instance of this delete file dialog fragment
- */
- public static DeleteFileDialogFragment newInstance(String deleteFile) {
- DeleteFileDialogFragment frag = new DeleteFileDialogFragment();
- Bundle args = new Bundle();
-
- args.putString(ARG_DELETE_FILE, deleteFile);
-
- frag.setArguments(args);
-
- return frag;
- }
-
/**
* Creates new instance of this delete file dialog fragment
*/
@@ -74,14 +54,14 @@ public class DeleteFileDialogFragment extends DialogFragment {
final FragmentActivity activity = getActivity();
final Uri deleteUri = getArguments().containsKey(ARG_DELETE_URI) ? getArguments().getParcelable(ARG_DELETE_URI) : null;
- final String deleteFile = getArguments().getString(ARG_DELETE_FILE);
+ String deleteFilename = FileHelper.getFilename(getActivity(), deleteUri);
CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);
alert.setIcon(R.drawable.ic_dialog_alert_holo_light);
alert.setTitle(R.string.warning);
- alert.setMessage(this.getString(R.string.file_delete_confirmation, deleteFile));
+ alert.setMessage(this.getString(R.string.file_delete_confirmation, deleteFilename));
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@@ -89,12 +69,14 @@ public class DeleteFileDialogFragment extends DialogFragment {
public void onClick(DialogInterface dialog, int id) {
dismiss();
- if (deleteUri != null) {
+ if (Constants.KITKAT) {
// We can not securely delete Documents, so just use usual delete on them
- DocumentsContract.deleteDocument(getActivity().getContentResolver(), deleteUri);
- return;
+ if (DocumentsContract.deleteDocument(getActivity().getContentResolver(), deleteUri)) return;
}
+ // TODO!!! We can't delete files from Uri without trying to find it's real path
+
+ /*
// Send all information needed to service to edit key in other thread
Intent intent = new Intent(activity, KeychainIntentService.class);
@@ -102,7 +84,6 @@ public class DeleteFileDialogFragment extends DialogFragment {
Bundle data = new Bundle();
intent.setAction(KeychainIntentService.ACTION_DELETE_FILE_SECURELY);
- data.putString(KeychainIntentService.DELETE_FILE, deleteFile);
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
ProgressDialogFragment deletingDialog = ProgressDialogFragment.newInstance(
@@ -134,6 +115,7 @@ public class DeleteFileDialogFragment extends DialogFragment {
// start service with intent
activity.startService(intent);
+ */
}
});
alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
index 10a24ddf0..c02c37055 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
@@ -23,13 +23,11 @@ import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
-import android.provider.OpenableColumns;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
@@ -39,11 +37,17 @@ import android.widget.TextView;
import com.beardedhen.androidbootstrap.BootstrapButton;
+import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.util.Log;
+import java.io.File;
+
+/**
+ * This is a file chooser dialog no longer used with KitKat
+ */
public class FileDialogFragment extends DialogFragment {
private static final String ARG_MESSENGER = "messenger";
private static final String ARG_TITLE = "title";
@@ -53,8 +57,7 @@ public class FileDialogFragment extends DialogFragment {
public static final int MESSAGE_OKAY = 1;
- public static final String MESSAGE_DATA_URI = "uri";
- public static final String MESSAGE_DATA_FILENAME = "filename";
+ public static final String MESSAGE_DATA_FILE = "file";
public static final String MESSAGE_DATA_CHECKED = "checked";
private Messenger mMessenger;
@@ -64,8 +67,7 @@ public class FileDialogFragment extends DialogFragment {
private CheckBox mCheckBox;
private TextView mMessageTextView;
- private String mOutputFilename;
- private Uri mOutputUri;
+ private File mFile;
private static final int REQUEST_CODE = 0x00007004;
@@ -73,14 +75,14 @@ public class FileDialogFragment extends DialogFragment {
* Creates new instance of this file dialog fragment
*/
public static FileDialogFragment newInstance(Messenger messenger, String title, String message,
- String defaultFile, String checkboxText) {
+ File defaultFile, String checkboxText) {
FileDialogFragment frag = new FileDialogFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_MESSENGER, messenger);
args.putString(ARG_TITLE, title);
args.putString(ARG_MESSAGE, message);
- args.putString(ARG_DEFAULT_FILE, defaultFile);
+ args.putString(ARG_DEFAULT_FILE, defaultFile.getAbsolutePath());
args.putString(ARG_CHECKBOX_TEXT, checkboxText);
frag.setArguments(args);
@@ -99,7 +101,11 @@ public class FileDialogFragment extends DialogFragment {
String title = getArguments().getString(ARG_TITLE);
String message = getArguments().getString(ARG_MESSAGE);
- mOutputFilename = getArguments().getString(ARG_DEFAULT_FILE);
+ mFile = new File(getArguments().getString(ARG_DEFAULT_FILE));
+ if (!mFile.isAbsolute()) {
+ // We use OK dir by default
+ mFile = new File(Constants.Path.APP_DIR.getAbsolutePath(), mFile.getName());
+ }
String checkboxText = getArguments().getString(ARG_CHECKBOX_TEXT);
LayoutInflater inflater = (LayoutInflater) activity
@@ -113,18 +119,14 @@ public class FileDialogFragment extends DialogFragment {
mMessageTextView.setText(message);
mFilename = (EditText) view.findViewById(R.id.input);
- mFilename.setText(mOutputFilename);
+ mFilename.setText(mFile.getName());
mBrowse = (BootstrapButton) view.findViewById(R.id.btn_browse);
mBrowse.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// only .asc or .gpg files
// setting it to text/plain prevents Cynaogenmod's file manager from selecting asc
// or gpg types!
- if (Constants.KITKAT) {
- FileHelper.saveDocument(FileDialogFragment.this, mOutputUri, "*/*", REQUEST_CODE);
- } else {
- FileHelper.openFile(FileDialogFragment.this, mOutputFilename, "*/*", REQUEST_CODE);
- }
+ FileHelper.openFile(FileDialogFragment.this, Uri.fromFile(mFile), "*/*", REQUEST_CODE);
}
});
@@ -147,19 +149,23 @@ public class FileDialogFragment extends DialogFragment {
dismiss();
String currentFilename = mFilename.getText().toString();
- if (mOutputFilename == null || !mOutputFilename.equals(currentFilename)) {
- mOutputUri = null;
- mOutputFilename = mFilename.getText().toString();
+ if (currentFilename == null || currentFilename.isEmpty()) {
+ // No file is like pressing cancel, UI: maybe disable positive button in this case?
+ return;
+ }
+
+ if (mFile == null || currentFilename.startsWith("/")) {
+ mFile = new File(currentFilename);
+ } else if (!mFile.getName().equals(currentFilename)) {
+ // We update our File object if user changed name!
+ mFile = new File(mFile.getParentFile(), currentFilename);
}
boolean checked = mCheckBox.isEnabled() && mCheckBox.isChecked();
// return resulting data back to activity
Bundle data = new Bundle();
- if (mOutputUri != null) {
- data.putParcelable(MESSAGE_DATA_URI, mOutputUri);
- }
- data.putString(MESSAGE_DATA_FILENAME, mFilename.getText().toString());
+ data.putString(MESSAGE_DATA_FILE, mFile.getAbsolutePath());
data.putBoolean(MESSAGE_DATA_CHECKED, checked);
sendMessageToHandler(MESSAGE_OKAY, data);
@@ -176,44 +182,17 @@ public class FileDialogFragment extends DialogFragment {
return alert.show();
}
- /**
- * Updates filename in dialog, normally called in onActivityResult in activity using the
- * FileDialog
- */
- private void setFilename(String filename) {
- AlertDialog dialog = (AlertDialog) getDialog();
- EditText filenameEditText = (EditText) dialog.findViewById(R.id.input);
-
- if (filenameEditText != null) {
- filenameEditText.setText(filename);
- }
- }
-
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode & 0xFFFF) {
case REQUEST_CODE: {
if (resultCode == Activity.RESULT_OK && data != null) {
- if (Constants.KITKAT) {
- mOutputUri = data.getData();
- Cursor cursor = getActivity().getContentResolver().query(mOutputUri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null);
- if (cursor != null) {
- if (cursor.moveToNext()) {
- mOutputFilename = cursor.getString(0);
- mFilename.setText(mOutputFilename);
- }
- cursor.close();
- }
+ File file = new File(data.getData().getPath());
+ if (file.getParentFile().exists()) {
+ mFile = file;
+ mFilename.setText(mFile.getName());
} else {
- try {
- String path = data.getData().getPath();
- Log.d(Constants.TAG, "path=" + path);
-
- // set filename used in export/import dialogs
- setFilename(path);
- } catch (NullPointerException e) {
- Log.e(Constants.TAG, "Nullpointer while retrieving path!", e);
- }
+ AppMsg.makeText(getActivity(), R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
}
}
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index e24ac6925..5600aa06e 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -195,6 +195,7 @@
Wrong passphrase.Set a passphrase first.No compatible file manager installed.
+ The file manager does not support saving.The passphrases didn\'t match.Please enter a passphrase.Symmetric encryption.
--
cgit v1.2.3
From 50e72b196fa8bc97edc63198a9ad73c24770b9df Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Tue, 1 Jul 2014 01:26:50 +0200
Subject: Missing import after merge
---
.../org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
index 15d50d7ed..80341aeaa 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
@@ -35,6 +35,7 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
+import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
--
cgit v1.2.3
From 35647734104471a6d35bc26a77682dd5531dd5e3 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Tue, 1 Jul 2014 14:50:15 +0200
Subject: Add temporary file storage as discussed in #665
Writable from OpenKeychain, readable worldwide. Should be used to write shared files to it by first creating the file using TemporaryStorageProvider.createFile and then write to the Uri returned.
---
OpenKeychain/src/main/AndroidManifest.xml | 9 ++
.../org/sufficientlysecure/keychain/Constants.java | 2 +
.../keychain/KeychainApplication.java | 3 +
.../provider/TemporaryStorageProvider.java | 151 +++++++++++++++++++++
.../keychain/util/DatabaseUtil.java | 36 +++++
5 files changed, 201 insertions(+)
create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/DatabaseUtil.java
diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml
index 3ce200008..6a67ac9bf 100644
--- a/OpenKeychain/src/main/AndroidManifest.xml
+++ b/OpenKeychain/src/main/AndroidManifest.xml
@@ -49,6 +49,9 @@
android:name="android.hardware.touchscreen"
android:required="false" />
+
+
+
@@ -484,6 +487,12 @@
android:resource="@xml/custom_pgp_contacts_structure"/>
+
+
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index eeb9fa389..956019605 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -53,6 +53,8 @@ public final class Constants {
public static boolean KITKAT = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
+ public static int TEMPFILE_TTL = 24*60*60*1000; // 1 day
+
public static final class Path {
public static final File APP_DIR = new File(Environment.getExternalStorageDirectory(), "OpenKeychain");
public static final File APP_DIR_FILE = new File(APP_DIR, "export.asc");
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
index be9c1e405..125573b53 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
@@ -28,6 +28,7 @@ import android.os.Environment;
import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.helper.TlsHelper;
+import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.PRNGFixes;
@@ -85,6 +86,8 @@ public class KeychainApplication extends Application {
Preferences.getPreferences(this).updateKeyServers();
TlsHelper.addStaticCA("pool.sks-keyservers.net", getAssets(), "sks-keyservers.netCA.cer");
+
+ TemporaryStorageProvider.cleanUp(this);
}
public static void setupAccountAsNeeded(Context context) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
new file mode 100644
index 000000000..9e745215d
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
@@ -0,0 +1,151 @@
+package org.sufficientlysecure.keychain.provider;
+
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.net.Uri;
+import android.os.ParcelFileDescriptor;
+import android.provider.OpenableColumns;
+import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.util.DatabaseUtil;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+public class TemporaryStorageProvider extends ContentProvider {
+
+ private static final String DB_NAME = "tempstorage.db";
+ private static final String TABLE_FILES = "files";
+ private static final String COLUMN_ID = "id";
+ private static final String COLUMN_NAME = "name";
+ private static final String COLUMN_TIME = "time";
+ private static final Uri BASE_URI = Uri.parse("content://org.sufficientlysecure.keychain.tempstorage/");
+ private static final int DB_VERSION = 1;
+
+ public static Uri createFile(Context context, String targetName) {
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(COLUMN_NAME, targetName);
+ return context.getContentResolver().insert(BASE_URI, contentValues);
+ }
+
+ public static int cleanUp(Context context) {
+ return context.getContentResolver().delete(BASE_URI, COLUMN_TIME + "< ?",
+ new String[]{Long.toString(System.currentTimeMillis() - Constants.TEMPFILE_TTL)});
+ }
+
+ private class TemporaryStorageDatabase extends SQLiteOpenHelper {
+
+ public TemporaryStorageDatabase(Context context) {
+ super(context, DB_NAME, null, DB_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_FILES + " (" +
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
+ COLUMN_NAME + " TEXT, " +
+ COLUMN_TIME + " INTEGER" +
+ ");");
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+ }
+
+ private TemporaryStorageDatabase db;
+
+ private File getFile(Uri uri) throws FileNotFoundException {
+ try {
+ return getFile(Integer.parseInt(uri.getLastPathSegment()));
+ } catch (NumberFormatException e) {
+ throw new FileNotFoundException();
+ }
+ }
+
+ private File getFile(int id) {
+ return new File(getContext().getCacheDir(), "temp/" + id);
+ }
+
+ @Override
+ public boolean onCreate() {
+ db = new TemporaryStorageDatabase(getContext());
+ return new File(getContext().getCacheDir(), "temp").mkdirs();
+ }
+
+ @Override
+ public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ File file;
+ try {
+ file = getFile(uri);
+ } catch (FileNotFoundException e) {
+ return null;
+ }
+ Cursor fileName = db.getReadableDatabase().query(TABLE_FILES, new String[]{COLUMN_NAME}, COLUMN_ID + "=?",
+ new String[]{uri.getLastPathSegment()}, null, null, null);
+ if (fileName != null) {
+ if (fileName.moveToNext()) {
+ MatrixCursor cursor =
+ new MatrixCursor(new String[]{OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE, "_data"});
+ cursor.newRow().add(fileName.getString(0)).add(file.length()).add(file.getAbsolutePath());
+ fileName.close();
+ return cursor;
+ }
+ fileName.close();
+ }
+ return null;
+ }
+
+ @Override
+ public String getType(Uri uri) {
+ return "*/*";
+ }
+
+ @Override
+ public Uri insert(Uri uri, ContentValues values) {
+ if (!values.containsKey(COLUMN_TIME)) {
+ values.put(COLUMN_TIME, System.currentTimeMillis());
+ }
+ int insert = (int) db.getWritableDatabase().insert(TABLE_FILES, null, values);
+ try {
+ getFile(insert).createNewFile();
+ } catch (IOException e) {
+ return null;
+ }
+ return Uri.withAppendedPath(BASE_URI, Long.toString(insert));
+ }
+
+ @Override
+ public int delete(Uri uri, String selection, String[] selectionArgs) {
+ if (uri.getLastPathSegment() != null) {
+ selection = DatabaseUtil.concatenateWhere(selection, COLUMN_ID + "=?");
+ selectionArgs = DatabaseUtil.appendSelectionArgs(selectionArgs, new String[]{uri.getLastPathSegment()});
+ }
+ Cursor files = db.getReadableDatabase().query(TABLE_FILES, new String[]{COLUMN_ID}, selection,
+ selectionArgs, null, null, null);
+ if (files != null) {
+ while (files.moveToNext()) {
+ getFile(files.getInt(0)).delete();
+ }
+ files.close();
+ return db.getWritableDatabase().delete(TABLE_FILES, selection, selectionArgs);
+ }
+ return 0;
+ }
+
+ @Override
+ public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+ throw new UnsupportedOperationException("Update not supported");
+ }
+
+ @Override
+ public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
+ return openFileHelper(uri, mode);
+ }
+}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/DatabaseUtil.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/DatabaseUtil.java
new file mode 100644
index 000000000..c18e5cabd
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/DatabaseUtil.java
@@ -0,0 +1,36 @@
+package org.sufficientlysecure.keychain.util;
+
+import android.text.TextUtils;
+
+/**
+ * Shamelessly copied from android.database.DatabaseUtils
+ */
+public class DatabaseUtil {
+ /**
+ * Concatenates two SQL WHERE clauses, handling empty or null values.
+ */
+ public static String concatenateWhere(String a, String b) {
+ if (TextUtils.isEmpty(a)) {
+ return b;
+ }
+ if (TextUtils.isEmpty(b)) {
+ return a;
+ }
+
+ return "(" + a + ") AND (" + b + ")";
+ }
+
+ /**
+ * Appends one set of selection args to another. This is useful when adding a selection
+ * argument to a user provided set.
+ */
+ public static String[] appendSelectionArgs(String[] originalValues, String[] newValues) {
+ if (originalValues == null || originalValues.length == 0) {
+ return newValues;
+ }
+ String[] result = new String[originalValues.length + newValues.length ];
+ System.arraycopy(originalValues, 0, result, 0, originalValues.length);
+ System.arraycopy(newValues, 0, result, originalValues.length, newValues.length);
+ return result;
+ }
+}
--
cgit v1.2.3
From 93eae114eac566a9ed2da6275c147b66ca480305 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Wed, 2 Jul 2014 00:34:21 +0200
Subject: Encrypt/Decrypt UI work
---
.../keychain/provider/CachedPublicKeyRing.java | 14 +--
.../keychain/ui/DecryptFileFragment.java | 5 +-
.../keychain/ui/EncryptActivity.java | 11 ++
.../keychain/ui/EncryptActivityInterface.java | 1 +
.../keychain/ui/EncryptAsymmetricFragment.java | 24 +++-
.../keychain/ui/EncryptFileFragment.java | 48 ++++++--
.../keychain/ui/EncryptMessageFragment.java | 17 ++-
.../ui/dialog/DeleteFileDialogFragment.java | 59 +++-------
.../src/main/res/layout/decrypt_file_fragment.xml | 53 +++++----
.../res/layout/encrypt_content_adv_settings.xml | 13 ---
.../src/main/res/layout/encrypt_file_fragment.xml | 121 +++++++++++++--------
OpenKeychain/src/main/res/values/strings.xml | 2 +
12 files changed, 216 insertions(+), 152 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
index 48d40430a..52ca71679 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
@@ -62,7 +62,7 @@ public class CachedPublicKeyRing extends KeyRing {
public String getPrimaryUserId() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.USER_ID,
ProviderHelper.FIELD_TYPE_STRING);
return (String) data;
} catch(ProviderHelper.NotFoundException e) {
@@ -73,7 +73,7 @@ public class CachedPublicKeyRing extends KeyRing {
public boolean isRevoked() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.IS_REVOKED,
ProviderHelper.FIELD_TYPE_INTEGER);
return (Long) data > 0;
} catch(ProviderHelper.NotFoundException e) {
@@ -84,7 +84,7 @@ public class CachedPublicKeyRing extends KeyRing {
public boolean canCertify() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.CAN_CERTIFY,
ProviderHelper.FIELD_TYPE_INTEGER);
return (Long) data > 0;
} catch(ProviderHelper.NotFoundException e) {
@@ -106,7 +106,7 @@ public class CachedPublicKeyRing extends KeyRing {
public boolean hasEncrypt() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.HAS_ENCRYPT,
ProviderHelper.FIELD_TYPE_INTEGER);
return (Long) data > 0;
} catch(ProviderHelper.NotFoundException e) {
@@ -128,7 +128,7 @@ public class CachedPublicKeyRing extends KeyRing {
public boolean hasSign() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.HAS_SIGN,
ProviderHelper.FIELD_TYPE_INTEGER);
return (Long) data > 0;
} catch(ProviderHelper.NotFoundException e) {
@@ -139,7 +139,7 @@ public class CachedPublicKeyRing extends KeyRing {
public int getVerified() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.VERIFIED,
ProviderHelper.FIELD_TYPE_INTEGER);
return (Integer) data;
} catch(ProviderHelper.NotFoundException e) {
@@ -150,7 +150,7 @@ public class CachedPublicKeyRing extends KeyRing {
public boolean hasAnySecret() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
+ KeychainContract.KeyRings.HAS_ANY_SECRET,
ProviderHelper.FIELD_TYPE_INTEGER);
return (Long) data > 0;
} catch(ProviderHelper.NotFoundException e) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
index 430f85b6f..520ef7567 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
@@ -29,7 +29,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
-import android.widget.ImageButton;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
@@ -52,7 +51,6 @@ public class DecryptFileFragment extends DecryptFragment {
// view
private TextView mFilename;
private CheckBox mDeleteAfter;
- private ImageButton mBrowse;
private View mDecryptButton;
// model
@@ -67,10 +65,9 @@ public class DecryptFileFragment extends DecryptFragment {
View view = inflater.inflate(R.layout.decrypt_file_fragment, container, false);
mFilename = (TextView) view.findViewById(R.id.decrypt_file_filename);
- mBrowse = (ImageButton) view.findViewById(R.id.decrypt_file_browse);
mDeleteAfter = (CheckBox) view.findViewById(R.id.decrypt_file_delete_after_decryption);
mDecryptButton = view.findViewById(R.id.decrypt_file_action_decrypt);
- mBrowse.setOnClickListener(new View.OnClickListener() {
+ view.findViewById(R.id.decrypt_file_browse).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (Constants.KITKAT) {
FileHelper.openDocument(DecryptFileFragment.this, "*/*", REQUEST_CODE_INPUT);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index e93a63cc8..c77fe9ab8 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -70,6 +70,7 @@ public class EncryptActivity extends DrawerActivity implements
// model used by message and file fragments
private long mEncryptionKeyIds[] = null;
+ private String mEncryptionUserIds[] = null;
private long mSigningKeyId = Constants.key.none;
private String mPassphrase;
private String mPassphraseAgain;
@@ -84,6 +85,11 @@ public class EncryptActivity extends DrawerActivity implements
mEncryptionKeyIds = encryptionKeyIds;
}
+ @Override
+ public void onEncryptionUserSelected(String[] encryptionUserIds) {
+ mEncryptionUserIds = encryptionUserIds;
+ }
+
@Override
public void onPassphraseUpdate(String passphrase) {
mPassphrase = passphrase;
@@ -109,6 +115,11 @@ public class EncryptActivity extends DrawerActivity implements
return mEncryptionKeyIds;
}
+ @Override
+ public String[] getEncryptionUsers() {
+ return mEncryptionUserIds;
+ }
+
@Override
public String getPassphrase() {
return mPassphrase;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java
index 0786b3a16..ca2ee3b55 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java
@@ -23,6 +23,7 @@ public interface EncryptActivityInterface {
public long getSignatureKey();
public long[] getEncryptionKeys();
+ public String[] getEncryptionUsers();
public String getPassphrase();
public String getPassphraseAgain();
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
index 51963e963..be845f05e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
@@ -59,12 +59,15 @@ public class EncryptAsymmetricFragment extends Fragment {
// model
private long mSecretKeyId = Constants.key.none;
private long mEncryptionKeyIds[] = null;
+ private String mEncryptionUserIds[] = null;
// Container Activity must implement this interface
public interface OnAsymmetricKeySelection {
public void onSigningKeySelected(long signingKeyId);
public void onEncryptionKeysSelected(long[] encryptionKeyIds);
+
+ public void onEncryptionUserSelected(String[] encryptionUserIds);
}
@Override
@@ -91,6 +94,13 @@ public class EncryptAsymmetricFragment extends Fragment {
updateView();
}
+ private void setEncryptionUserIds(String[] encryptionUserIds) {
+ mEncryptionUserIds = encryptionUserIds;
+ // update key selection in EncryptActivity
+ mKeySelectionListener.onEncryptionUserSelected(encryptionUserIds);
+ updateView();
+ }
+
/**
* Inflate the layout for this fragment
*/
@@ -159,12 +169,14 @@ public class EncryptAsymmetricFragment extends Fragment {
if (preselectedEncryptionKeyIds != null) {
Vector goodIds = new Vector();
- for (int i = 0; i < preselectedEncryptionKeyIds.length; ++i) {
+ Vector goodUserIds = new Vector();
+ for (long preselectedId : preselectedEncryptionKeyIds) {
try {
- long id = providerHelper.getCachedPublicKeyRing(
- KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(
- preselectedEncryptionKeyIds[i])
- ).getMasterKeyId();
+ CachedPublicKeyRing ring = providerHelper.getCachedPublicKeyRing(
+ KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(preselectedId));
+ long id = ring.getMasterKeyId();
+ ring.getSplitPrimaryUserId();
+ goodUserIds.add(ring.getPrimaryUserId());
goodIds.add(id);
} catch (PgpGeneralException e) {
Log.e(Constants.TAG, "key not found!", e);
@@ -176,6 +188,7 @@ public class EncryptAsymmetricFragment extends Fragment {
keyIds[i] = goodIds.get(i);
}
setEncryptionKeyIds(keyIds);
+ setEncryptionUserIds(goodUserIds.toArray(new String[goodUserIds.size()]));
}
}
}
@@ -249,6 +262,7 @@ public class EncryptAsymmetricFragment extends Fragment {
Bundle bundle = data.getExtras();
setEncryptionKeyIds(bundle
.getLongArray(SelectPublicKeyActivity.RESULT_EXTRA_MASTER_KEY_IDS));
+ setEncryptionUserIds(bundle.getStringArray(SelectPublicKeyActivity.RESULT_EXTRA_USER_IDS));
}
break;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index 2fabeb82c..3111e5c3e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -33,12 +33,13 @@ import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.Spinner;
import android.widget.TextView;
-import android.widget.ImageButton;
import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.pgp.KeyRing;
+import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
@@ -50,6 +51,8 @@ import org.sufficientlysecure.keychain.util.Choice;
import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
public class EncryptFileFragment extends Fragment {
public static final String ARG_URI = "uri";
@@ -65,8 +68,7 @@ public class EncryptFileFragment extends Fragment {
private Spinner mFileCompression = null;
private TextView mFilename = null;
private CheckBox mDeleteAfter = null;
- private CheckBox mShareAfter = null;
- private ImageButton mBrowse = null;
+ private View mShareFile;
private View mEncryptFile;
// model
@@ -94,13 +96,19 @@ public class EncryptFileFragment extends Fragment {
mEncryptFile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- encryptClicked();
+ encryptClicked(false);
+ }
+ });
+ mShareFile = view.findViewById(R.id.action_encrypt_share);
+ mShareFile.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ encryptClicked(true);
}
});
mFilename = (TextView) view.findViewById(R.id.filename);
- mBrowse = (ImageButton) view.findViewById(R.id.btn_browse);
- mBrowse.setOnClickListener(new View.OnClickListener() {
+ view.findViewById(R.id.btn_browse).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (Constants.KITKAT) {
FileHelper.openDocument(EncryptFileFragment.this, "*/*", REQUEST_CODE_INPUT);
@@ -136,7 +144,6 @@ public class EncryptFileFragment extends Fragment {
}
mDeleteAfter = (CheckBox) view.findViewById(R.id.deleteAfterEncryption);
- mShareAfter = (CheckBox) view.findViewById(R.id.shareAfterEncryption);
mAsciiArmor = (CheckBox) view.findViewById(R.id.asciiArmor);
mAsciiArmor.setChecked(Preferences.getPreferences(getActivity()).getDefaultAsciiArmor());
@@ -181,7 +188,7 @@ public class EncryptFileFragment extends Fragment {
}
}
- private void encryptClicked() {
+ private void encryptClicked(boolean share) {
if (mInputUri == null) {
AppMsg.makeText(getActivity(), R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
return;
@@ -236,10 +243,17 @@ public class EncryptFileFragment extends Fragment {
}
}
- showOutputFileDialog();
+ if (share) {
+ String targetName = FileHelper.getFilename(getActivity(), mInputUri) +
+ (mAsciiArmor.isChecked() ? ".asc" : ".gpg");
+ mOutputUri = TemporaryStorageProvider.createFile(getActivity(), targetName);
+ encryptStart(true);
+ } else {
+ showOutputFileDialog();
+ }
}
- private void encryptStart() {
+ private void encryptStart(final boolean share) {
if (mInputUri == null || mOutputUri == null) {
throw new IllegalStateException("Something went terribly wrong if this happens!");
}
@@ -300,11 +314,21 @@ public class EncryptFileFragment extends Fragment {
setInputUri(null);
}
- if (mShareAfter.isChecked()) {
+ if (share) {
// Share encrypted file
Intent sendFileIntent = new Intent(Intent.ACTION_SEND);
sendFileIntent.setType("*/*");
sendFileIntent.putExtra(Intent.EXTRA_STREAM, mOutputUri);
+ if (!mEncryptInterface.isModeSymmetric() && mEncryptInterface.getEncryptionUsers() != null) {
+ Set users = new HashSet();
+ for (String user : mEncryptInterface.getEncryptionUsers()) {
+ String[] userId = KeyRing.splitUserId(user);
+ if (userId[1] != null) {
+ users.add(userId[1]);
+ }
+ }
+ sendFileIntent.putExtra(Intent.EXTRA_EMAIL, users.toArray(new String[users.size()]));
+ }
startActivity(Intent.createChooser(sendFileIntent,
getString(R.string.title_share_file)));
}
@@ -336,7 +360,7 @@ public class EncryptFileFragment extends Fragment {
// This happens after output file was selected, so start our operation
if (resultCode == Activity.RESULT_OK && data != null) {
mOutputUri = data.getData();
- encryptStart();
+ encryptStart(false);
}
return;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
index 8a6103b16..e4f63089f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
@@ -36,12 +36,17 @@ import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
import org.sufficientlysecure.keychain.helper.Preferences;
+import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
public class EncryptMessageFragment extends Fragment {
public static final String ARG_TEXT = "text";
@@ -235,7 +240,17 @@ public class EncryptMessageFragment extends Fragment {
// Type is set to text/plain so that encrypted messages can
// be sent with Whatsapp, Hangouts, SMS etc...
sendIntent.setType("text/plain");
-
+ Log.d(Constants.TAG, "encrypt to:" + Arrays.toString(mEncryptInterface.getEncryptionUsers()));
+ if (!mEncryptInterface.isModeSymmetric() && mEncryptInterface.getEncryptionUsers() != null) {
+ Set users = new HashSet();
+ for (String user : mEncryptInterface.getEncryptionUsers()) {
+ String[] userId = KeyRing.splitUserId(user);
+ if (userId[1] != null) {
+ users.add(userId[1]);
+ }
+ }
+ sendIntent.putExtra(Intent.EXTRA_EMAIL, users.toArray(new String[users.size()]));
+ }
sendIntent.putExtra(Intent.EXTRA_TEXT, output);
startActivity(Intent.createChooser(sendIntent,
getString(R.string.title_share_with)));
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
index f9111d885..27ce4faee 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
@@ -25,6 +25,7 @@ import android.provider.DocumentsContract;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
+import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
@@ -53,8 +54,8 @@ public class DeleteFileDialogFragment extends DialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) {
final FragmentActivity activity = getActivity();
- final Uri deleteUri = getArguments().containsKey(ARG_DELETE_URI) ? getArguments().getParcelable(ARG_DELETE_URI) : null;
- String deleteFilename = FileHelper.getFilename(getActivity(), deleteUri);
+ final Uri deleteUri = getArguments().getParcelable(ARG_DELETE_URI);
+ final String deleteFilename = FileHelper.getFilename(getActivity(), deleteUri);
CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);
@@ -69,53 +70,23 @@ public class DeleteFileDialogFragment extends DialogFragment {
public void onClick(DialogInterface dialog, int id) {
dismiss();
+ // We can not securely delete Uris, so just use usual delete on them
if (Constants.KITKAT) {
- // We can not securely delete Documents, so just use usual delete on them
- if (DocumentsContract.deleteDocument(getActivity().getContentResolver(), deleteUri)) return;
- }
-
- // TODO!!! We can't delete files from Uri without trying to find it's real path
-
- /*
- // Send all information needed to service to edit key in other thread
- Intent intent = new Intent(activity, KeychainIntentService.class);
-
- // fill values for this action
- Bundle data = new Bundle();
-
- intent.setAction(KeychainIntentService.ACTION_DELETE_FILE_SECURELY);
- intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
-
- ProgressDialogFragment deletingDialog = ProgressDialogFragment.newInstance(
- getString(R.string.progress_deleting_securely),
- ProgressDialog.STYLE_HORIZONTAL,
- false,
- null);
-
- // Message is received after deleting is done in KeychainIntentService
- KeychainIntentServiceHandler saveHandler =
- new KeychainIntentServiceHandler(activity, deletingDialog) {
- public void handleMessage(Message message) {
- // handle messages by standard KeychainIntentHandler first
- super.handleMessage(message);
-
- if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
- Toast.makeText(activity, R.string.file_delete_successful,
- Toast.LENGTH_SHORT).show();
- }
+ if (DocumentsContract.deleteDocument(getActivity().getContentResolver(), deleteUri)) {
+ Toast.makeText(getActivity(), R.string.file_delete_successful, Toast.LENGTH_SHORT).show();
+ return;
}
- };
+ }
- // Create a new Messenger for the communication back
- Messenger messenger = new Messenger(saveHandler);
- intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger);
+ if (getActivity().getContentResolver().delete(deleteUri, null, null) > 0) {
+ Toast.makeText(getActivity(), R.string.file_delete_successful, Toast.LENGTH_SHORT).show();
+ return;
+ }
- // show progress dialog
- deletingDialog.show(activity.getSupportFragmentManager(), "deletingDialog");
+ Toast.makeText(getActivity(), getActivity().getString(R.string.error_file_delete_failed, deleteFilename), Toast.LENGTH_SHORT).show();
- // start service with intent
- activity.startService(intent);
- */
+ // TODO: We can't delete that file...
+ // If possible we should find out if deletion is possible before even showing the option to do so.
}
});
alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
diff --git a/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml b/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml
index 098aaaea1..6ff827894 100644
--- a/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml
@@ -26,32 +26,41 @@
android:orientation="vertical">
-
-
+ android:layout_width="match_parent"
+ android:layout_height="?android:attr/listPreferredItemHeight"
+ android:orientation="horizontal"
-
+ android:clickable="true"
+ style="@style/SelectableItem">
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+ android:layout_height="?android:attr/listPreferredItemHeight"
+ android:orientation="horizontal"
+
+ android:id="@+id/btn_browse"
+ android:clickable="true"
+ style="@style/SelectableItem">
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ android:layout_above="@+id/action_encrypt_share"/>
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 25cdfb541..6823c3c57 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -55,6 +55,7 @@
Decrypt and verify messageFrom ClipboardEncrypt and save file
+ Encrypt and share fileSaveCancelDelete
@@ -105,6 +106,7 @@
SignMessageFile
+ File:No PassphrasePassphraseAgain
--
cgit v1.2.3
From 51a4b0466ba1e1c1c72d9d8112c28628d1efc84b Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Thu, 3 Jul 2014 00:34:41 +0200
Subject: Add support for multiple input/output URIs to KeychainIntentService
---
.../keychain/service/KeychainIntentService.java | 91 +++++++++++++---------
1 file changed, 56 insertions(+), 35 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index a2676b1a4..d87f98775 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -109,6 +109,9 @@ public class KeychainIntentService extends IntentService
public static final int IO_BYTES = 1;
public static final int IO_FILE = 2; // This was misleadingly TARGET_URI before!
public static final int IO_URI = 3;
+ public static final int IO_URIS = 4;
+
+ public static final String SELECTED_URI = "selected_uri";
// encrypt
public static final String ENCRYPT_SIGNATURE_KEY_ID = "secret_key_id";
@@ -118,8 +121,10 @@ public class KeychainIntentService extends IntentService
public static final String ENCRYPT_MESSAGE_BYTES = "message_bytes";
public static final String ENCRYPT_INPUT_FILE = "input_file";
public static final String ENCRYPT_INPUT_URI = "input_uri";
+ public static final String ENCRYPT_INPUT_URIS = "input_uris";
public static final String ENCRYPT_OUTPUT_FILE = "output_file";
public static final String ENCRYPT_OUTPUT_URI = "output_uri";
+ public static final String ENCRYPT_OUTPUT_URIS = "output_uris";
public static final String ENCRYPT_SYMMETRIC_PASSPHRASE = "passphrase";
// decrypt/verify
@@ -220,6 +225,7 @@ public class KeychainIntentService extends IntentService
try {
/* Input */
int source = data.get(SOURCE) != null ? data.getInt(SOURCE) : data.getInt(TARGET);
+ Bundle resultData = new Bundle();
long signatureKeyId = data.getLong(ENCRYPT_SIGNATURE_KEY_ID);
String symmetricPassphrase = data.getString(ENCRYPT_SYMMETRIC_PASSPHRASE);
@@ -227,44 +233,48 @@ public class KeychainIntentService extends IntentService
boolean useAsciiArmor = data.getBoolean(ENCRYPT_USE_ASCII_ARMOR);
long encryptionKeyIds[] = data.getLongArray(ENCRYPT_ENCRYPTION_KEYS_IDS);
int compressionId = data.getInt(ENCRYPT_COMPRESSION_ID);
- InputData inputData = createEncryptInputData(data);
- OutputStream outStream = createCryptOutputStream(data);
-
- /* Operation */
- PgpSignEncrypt.Builder builder =
- new PgpSignEncrypt.Builder(
- new ProviderHelper(this),
- PgpHelper.getFullVersion(this),
- inputData, outStream);
- builder.setProgressable(this);
+ int urisCount = data.containsKey(ENCRYPT_INPUT_URIS) ? data.getParcelableArrayList(ENCRYPT_INPUT_URIS).size() : 1;
+ for (int i = 0; i < urisCount; i++) {
+ data.putInt(SELECTED_URI, i);
+ InputData inputData = createEncryptInputData(data);
+ OutputStream outStream = createCryptOutputStream(data);
+
+ /* Operation */
+ PgpSignEncrypt.Builder builder =
+ new PgpSignEncrypt.Builder(
+ new ProviderHelper(this),
+ PgpHelper.getFullVersion(this),
+ inputData, outStream);
+ builder.setProgressable(this);
+
+ builder.setEnableAsciiArmorOutput(useAsciiArmor)
+ .setCompressionId(compressionId)
+ .setSymmetricEncryptionAlgorithm(
+ Preferences.getPreferences(this).getDefaultEncryptionAlgorithm())
+ .setSignatureForceV3(Preferences.getPreferences(this).getForceV3Signatures())
+ .setEncryptionMasterKeyIds(encryptionKeyIds)
+ .setSymmetricPassphrase(symmetricPassphrase)
+ .setSignatureMasterKeyId(signatureKeyId)
+ .setEncryptToSigner(true)
+ .setSignatureHashAlgorithm(
+ Preferences.getPreferences(this).getDefaultHashAlgorithm())
+ .setSignaturePassphrase(
+ PassphraseCacheService.getCachedPassphrase(this, signatureKeyId));
+
+ // this assumes that the bytes are cleartext (valid for current implementation!)
+ if (source == IO_BYTES) {
+ builder.setCleartextInput(true);
+ }
- builder.setEnableAsciiArmorOutput(useAsciiArmor)
- .setCompressionId(compressionId)
- .setSymmetricEncryptionAlgorithm(
- Preferences.getPreferences(this).getDefaultEncryptionAlgorithm())
- .setSignatureForceV3(Preferences.getPreferences(this).getForceV3Signatures())
- .setEncryptionMasterKeyIds(encryptionKeyIds)
- .setSymmetricPassphrase(symmetricPassphrase)
- .setSignatureMasterKeyId(signatureKeyId)
- .setEncryptToSigner(true)
- .setSignatureHashAlgorithm(
- Preferences.getPreferences(this).getDefaultHashAlgorithm())
- .setSignaturePassphrase(
- PassphraseCacheService.getCachedPassphrase(this, signatureKeyId));
-
- // this assumes that the bytes are cleartext (valid for current implementation!)
- if (source == IO_BYTES) {
- builder.setCleartextInput(true);
- }
+ builder.build().execute();
- builder.build().execute();
+ outStream.close();
- outStream.close();
+ /* Output */
- /* Output */
+ finalizeEncryptOutputStream(data, resultData, outStream);
- Bundle resultData = new Bundle();
- finalizeEncryptOutputStream(data, resultData, outStream);
+ }
OtherHelper.logDebugBundle(resultData, "resultData");
@@ -688,8 +698,13 @@ public class KeychainIntentService extends IntentService
Uri providerUri = data.getParcelable(ENCRYPT_INPUT_URI);
// InputStream
- InputStream in = getContentResolver().openInputStream(providerUri);
- return new InputData(in, 0);
+ return new InputData(getContentResolver().openInputStream(providerUri), 0);
+
+ case IO_URIS:
+ providerUri = data.getParcelableArrayList(ENCRYPT_INPUT_URIS).get(data.getInt(SELECTED_URI));
+
+ // InputStream
+ return new InputData(getContentResolver().openInputStream(providerUri), 0);
default:
throw new PgpGeneralException("No target choosen!");
@@ -719,6 +734,11 @@ public class KeychainIntentService extends IntentService
return getContentResolver().openOutputStream(providerUri);
+ case IO_URIS:
+ providerUri = data.getParcelableArrayList(ENCRYPT_OUTPUT_URIS).get(data.getInt(SELECTED_URI));
+
+ return getContentResolver().openOutputStream(providerUri);
+
default:
throw new PgpGeneralException("No target choosen!");
}
@@ -744,6 +764,7 @@ public class KeychainIntentService extends IntentService
break;
case IO_URI:
+ case IO_URIS:
// nothing, output was written, just send okay and verification bundle
break;
--
cgit v1.2.3
From 1b0666e9de5caea14997a3e638a6209b45c97d60 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Sun, 6 Jul 2014 02:10:35 +0200
Subject: Many changes to file ... and still incomplete
- Multi file
- Reworked UI
---
.gitmodules | 3 +
OpenKeychain/build.gradle | 2 +-
OpenKeychain/src/main/AndroidManifest.xml | 1 +
.../keychain/helper/ContactHelper.java | 14 ++
.../keychain/helper/FileHelper.java | 41 +++++
.../keychain/provider/CachedPublicKeyRing.java | 62 ++++++-
.../keychain/provider/ProviderHelper.java | 4 +
.../keychain/ui/EncryptActivity.java | 77 +++++++-
.../keychain/ui/EncryptActivityInterface.java | 2 +
.../keychain/ui/EncryptAsymmetricFragment.java | 105 +++++++----
.../keychain/ui/EncryptFileFragment.java | 190 +++++++++++++------
.../ui/widget/EncryptKeyCompletionView.java | 204 +++++++++++++++++++++
.../ui/widget/NoSwipeWrapContentViewPager.java | 44 +++++
.../res/drawable-hdpi/attachment_bg_holo.9.png | Bin 0 -> 282 bytes
.../main/res/drawable-hdpi/ic_doc_generic_am.png | Bin 0 -> 694 bytes
.../src/main/res/drawable-hdpi/ic_generic_man.png | Bin 0 -> 2375 bytes
.../res/drawable-mdpi/attachment_bg_holo.9.png | Bin 0 -> 204 bytes
.../main/res/drawable-mdpi/ic_doc_generic_am.png | Bin 0 -> 561 bytes
.../src/main/res/drawable-mdpi/ic_generic_man.png | Bin 0 -> 1657 bytes
.../res/drawable-xhdpi/attachment_bg_holo.9.png | Bin 0 -> 344 bytes
.../main/res/drawable-xhdpi/ic_doc_generic_am.png | Bin 0 -> 831 bytes
.../src/main/res/drawable-xhdpi/ic_generic_man.png | Bin 0 -> 3149 bytes
.../res/drawable-xxhdpi/attachment_bg_holo.9.png | Bin 0 -> 1316 bytes
.../main/res/drawable-xxhdpi/ic_doc_generic_am.png | Bin 0 -> 585 bytes
.../main/res/drawable-xxhdpi/ic_generic_man.png | Bin 0 -> 3607 bytes
.../src/main/res/layout/encrypt_activity.xml | 13 +-
.../res/layout/encrypt_asymmetric_fragment.xml | 64 +------
.../src/main/res/layout/encrypt_content.xml | 16 +-
.../res/layout/encrypt_content_adv_settings.xml | 26 ---
.../src/main/res/layout/encrypt_file_fragment.xml | 150 ++++++---------
.../main/res/layout/encrypt_symmetric_fragment.xml | 74 ++++----
.../src/main/res/layout/file_list_entry.xml | 60 ++++++
.../src/main/res/layout/file_list_entry_add.xml | 21 +++
.../src/main/res/layout/recipient_box_entry.xml | 24 +++
.../res/layout/recipient_selection_list_entry.xml | 42 +++++
.../src/main/res/menu/encrypt_activity.xml | 7 +
OpenKeychain/src/main/res/values/strings.xml | 1 +
extern/TokenAutoComplete | 1 +
38 files changed, 902 insertions(+), 346 deletions(-)
create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/attachment_bg_holo.9.png
create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_doc_generic_am.png
create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_generic_man.png
create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/attachment_bg_holo.9.png
create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_doc_generic_am.png
create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_generic_man.png
create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/attachment_bg_holo.9.png
create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_doc_generic_am.png
create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_generic_man.png
create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/attachment_bg_holo.9.png
create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_doc_generic_am.png
create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_generic_man.png
create mode 100644 OpenKeychain/src/main/res/layout/file_list_entry.xml
create mode 100644 OpenKeychain/src/main/res/layout/file_list_entry_add.xml
create mode 100644 OpenKeychain/src/main/res/layout/recipient_box_entry.xml
create mode 100644 OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml
create mode 100644 OpenKeychain/src/main/res/menu/encrypt_activity.xml
create mode 160000 extern/TokenAutoComplete
diff --git a/.gitmodules b/.gitmodules
index b7b0e1173..b01f9a0ff 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -34,3 +34,6 @@
[submodule "OpenKeychain/src/test/resources/extern/OpenPGP-Haskell"]
path = OpenKeychain/src/test/resources/extern/OpenPGP-Haskell
url = https://github.com/singpolyma/OpenPGP-Haskell.git
+[submodule "extern/TokenAutoComplete"]
+ path = extern/TokenAutoComplete
+ url = https://github.com/open-keychain/TokenAutoComplete
diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle
index f419141b4..18a801ce0 100644
--- a/OpenKeychain/build.gradle
+++ b/OpenKeychain/build.gradle
@@ -20,7 +20,7 @@ dependencies {
compile project(':extern:SuperToasts:supertoasts')
compile project(':extern:minidns')
compile project(':extern:KeybaseLib:Lib')
-
+ compile project(':extern:TokenAutoComplete:library')
// Unit tests are run with Robolectric
testCompile 'junit:junit:4.11'
diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml
index 6a67ac9bf..bed47a44a 100644
--- a/OpenKeychain/src/main/AndroidManifest.xml
+++ b/OpenKeychain/src/main/AndroidManifest.xml
@@ -155,6 +155,7 @@
+
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
index e639824ec..1b9ef57b3 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
@@ -21,6 +21,8 @@ import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.*;
import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.provider.ContactsContract;
@@ -33,6 +35,7 @@ import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.util.Log;
+import java.io.InputStream;
import java.util.*;
public class ContactHelper {
@@ -232,6 +235,17 @@ public class ContactHelper {
return null;
}
+ public static Bitmap photoFromFingerprint(ContentResolver contentResolver, String fingerprint) {
+ int rawContactId = findRawContactId(contentResolver, fingerprint);
+ if (rawContactId == -1) return null;
+ Uri rawContactUri = ContentUris.withAppendedId(ContactsContract.RawContacts.CONTENT_URI, rawContactId);
+ Uri contactUri = ContactsContract.RawContacts.getContactLookupUri(contentResolver, rawContactUri);
+ InputStream photoInputStream =
+ ContactsContract.Contacts.openContactPhotoInputStream(contentResolver, contactUri);
+ if (photoInputStream == null) return null;
+ return BitmapFactory.decodeStream(photoInputStream);
+ }
+
/**
* Write the current Keychain to the contact db
*/
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
index 2898c7030..e42c7987b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
@@ -23,22 +23,28 @@ import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.Point;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
+import android.provider.DocumentsContract;
import android.provider.OpenableColumns;
import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.widget.Toast;
+import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
import java.io.File;
+import java.text.DecimalFormat;
public class FileHelper {
@@ -182,6 +188,41 @@ public class FileHelper {
return filename;
}
+ public static long getFileSize(Context context, Uri uri) {
+ long size = -1;
+ try {
+ Cursor cursor = context.getContentResolver().query(uri, new String[]{OpenableColumns.SIZE}, null, null, null);
+
+ if (cursor != null) {
+ if (cursor.moveToNext()) {
+ size = cursor.getLong(0);
+ }
+ cursor.close();
+ }
+ } catch (Exception ignored) {
+ // This happens in rare cases (eg: document deleted since selection) and should not cause a failure
+ }
+ return size;
+ }
+
+ /**
+ * Retrieve thumbnail of file, document api feature and thus KitKat only
+ */
+ public static Bitmap getThumbnail(Context context, Uri uri, Point size) {
+ if (Constants.KITKAT) {
+ return DocumentsContract.getDocumentThumbnail(context.getContentResolver(), uri, size, null);
+ } else {
+ return null;
+ }
+ }
+
+ public static String readableFileSize(long size) {
+ if(size <= 0) return "0";
+ final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" };
+ int digitGroups = (int) (Math.log10(size)/Math.log10(1024));
+ return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups)) + " " + units[digitGroups];
+ }
+
public static interface FileDialogCallback {
public void onFileSelected(File file, boolean checked);
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
index 52ca71679..bc7221d13 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
@@ -1,5 +1,6 @@
package org.sufficientlysecure.keychain.provider;
+import android.database.Cursor;
import android.net.Uri;
import org.sufficientlysecure.keychain.Constants;
@@ -33,6 +34,7 @@ public class CachedPublicKeyRing extends KeyRing {
mUri = uri;
}
+ @Override
public long getMasterKeyId() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -59,6 +61,17 @@ public class CachedPublicKeyRing extends KeyRing {
return getMasterKeyId();
}
+ public byte[] getFingerprint() throws PgpGeneralException {
+ try {
+ Object data = mProviderHelper.getGenericData(mUri,
+ KeychainContract.KeyRings.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB);
+ return (byte[]) data;
+ } catch (ProviderHelper.NotFoundException e) {
+ throw new PgpGeneralException(e);
+ }
+ }
+
+ @Override
public String getPrimaryUserId() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -70,6 +83,7 @@ public class CachedPublicKeyRing extends KeyRing {
}
}
+ @Override
public boolean isRevoked() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -81,6 +95,7 @@ public class CachedPublicKeyRing extends KeyRing {
}
}
+ @Override
public boolean canCertify() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -92,17 +107,28 @@ public class CachedPublicKeyRing extends KeyRing {
}
}
+ @Override
public long getEncryptId() throws PgpGeneralException {
try {
- Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
- ProviderHelper.FIELD_TYPE_INTEGER);
- return (Long) data;
- } catch(ProviderHelper.NotFoundException e) {
+ Cursor subkeys = getSubkeys();
+ if (subkeys != null) {
+ try {
+ while (subkeys.moveToNext()) {
+ if (subkeys.getInt(subkeys.getColumnIndexOrThrow(KeychainContract.Keys.CAN_ENCRYPT)) != 0) {
+ return subkeys.getLong(subkeys.getColumnIndexOrThrow(KeychainContract.Keys.KEY_ID));
+ }
+ }
+ } finally {
+ subkeys.close();
+ }
+ }
+ } catch(Exception e) {
throw new PgpGeneralException(e);
}
+ throw new PgpGeneralException("No encrypt key found");
}
+ @Override
public boolean hasEncrypt() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -114,17 +140,28 @@ public class CachedPublicKeyRing extends KeyRing {
}
}
+ @Override
public long getSignId() throws PgpGeneralException {
try {
- Object data = mProviderHelper.getGenericData(mUri,
- KeychainContract.KeyRings.MASTER_KEY_ID,
- ProviderHelper.FIELD_TYPE_INTEGER);
- return (Long) data;
- } catch(ProviderHelper.NotFoundException e) {
+ Cursor subkeys = getSubkeys();
+ if (subkeys != null) {
+ try {
+ while (subkeys.moveToNext()) {
+ if (subkeys.getInt(subkeys.getColumnIndexOrThrow(KeychainContract.Keys.CAN_SIGN)) != 0) {
+ return subkeys.getLong(subkeys.getColumnIndexOrThrow(KeychainContract.Keys.KEY_ID));
+ }
+ }
+ } finally {
+ subkeys.close();
+ }
+ }
+ } catch(Exception e) {
throw new PgpGeneralException(e);
}
+ throw new PgpGeneralException("No sign key found");
}
+ @Override
public boolean hasSign() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -136,6 +173,7 @@ public class CachedPublicKeyRing extends KeyRing {
}
}
+ @Override
public int getVerified() throws PgpGeneralException {
try {
Object data = mProviderHelper.getGenericData(mUri,
@@ -156,6 +194,10 @@ public class CachedPublicKeyRing extends KeyRing {
} catch(ProviderHelper.NotFoundException e) {
throw new PgpGeneralException(e);
}
+ }
+ private Cursor getSubkeys() throws PgpGeneralException {
+ Uri keysUri = KeychainContract.Keys.buildKeysUri(Long.toString(extractOrGetMasterKeyId()));
+ return mProviderHelper.getContentResolver().query(keysUri, null, null, null, null);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
index 28495d51d..4bf3a38a0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
@@ -1034,4 +1034,8 @@ public class ProviderHelper {
}
}
}
+
+ public ContentResolver getContentResolver() {
+ return mContentResolver;
+ }
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index c77fe9ab8..5542cccd1 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -21,14 +21,21 @@ package org.sufficientlysecure.keychain.ui;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.support.v4.app.Fragment;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.ViewGroup;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.util.Log;
+import java.util.ArrayList;
+
public class EncryptActivity extends DrawerActivity implements
EncryptSymmetricFragment.OnSymmetricKeySelection,
EncryptAsymmetricFragment.OnAsymmetricKeySelection,
@@ -49,7 +56,7 @@ public class EncryptActivity extends DrawerActivity implements
// view
ViewPager mViewPagerMode;
- PagerTabStrip mPagerTabStripMode;
+ //PagerTabStrip mPagerTabStripMode;
PagerTabStripAdapter mTabsAdapterMode;
ViewPager mViewPagerContent;
PagerTabStrip mPagerTabStripContent;
@@ -74,6 +81,9 @@ public class EncryptActivity extends DrawerActivity implements
private long mSigningKeyId = Constants.key.none;
private String mPassphrase;
private String mPassphraseAgain;
+ private int mCurrentMode = PAGER_MODE_ASYMMETRIC;
+ private boolean mUseArmor;
+ private boolean mDeleteAfterEncrypt = false;
@Override
public void onSigningKeySelected(long signingKeyId) {
@@ -102,7 +112,7 @@ public class EncryptActivity extends DrawerActivity implements
@Override
public boolean isModeSymmetric() {
- return PAGER_MODE_SYMMETRIC == mViewPagerMode.getCurrentItem();
+ return PAGER_MODE_SYMMETRIC == mCurrentMode;
}
@Override
@@ -130,10 +140,19 @@ public class EncryptActivity extends DrawerActivity implements
return mPassphraseAgain;
}
+ @Override
+ public boolean isUseArmor() {
+ return mUseArmor;
+ }
+
+ @Override
+ public boolean isDeleteAfterEncrypt() {
+ return mDeleteAfterEncrypt;
+ }
private void initView() {
mViewPagerMode = (ViewPager) findViewById(R.id.encrypt_pager_mode);
- mPagerTabStripMode = (PagerTabStrip) findViewById(R.id.encrypt_pager_tab_strip_mode);
+ //mPagerTabStripMode = (PagerTabStrip) findViewById(R.id.encrypt_pager_tab_strip_mode);
mViewPagerContent = (ViewPager) findViewById(R.id.encrypt_pager_content);
mPagerTabStripContent = (PagerTabStrip) findViewById(R.id.encrypt_pager_tab_strip_content);
@@ -172,6 +191,37 @@ public class EncryptActivity extends DrawerActivity implements
mTabsAdapterContent.addTab(EncryptFileFragment.class,
mFileFragmentBundle, getString(R.string.label_file));
mViewPagerContent.setCurrentItem(mSwitchToContent);
+
+ mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.encrypt_activity, menu);
+ menu.findItem(R.id.check_use_armor).setChecked(mUseArmor);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.isCheckable()) {
+ item.setChecked(!item.isChecked());
+ }
+ switch (item.getItemId()) {
+ case R.id.check_use_symmetric:
+ mSwitchToMode = item.isChecked() ? PAGER_MODE_SYMMETRIC : PAGER_MODE_ASYMMETRIC;
+ mViewPagerMode.setCurrentItem(mSwitchToMode);
+ break;
+ case R.id.check_use_armor:
+ mUseArmor = item.isChecked();
+ break;
+ case R.id.check_delete_after_encrypt:
+ mDeleteAfterEncrypt = item.isChecked();
+ break;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ return true;
}
/**
@@ -183,12 +233,16 @@ public class EncryptActivity extends DrawerActivity implements
String action = intent.getAction();
Bundle extras = intent.getExtras();
String type = intent.getType();
- Uri uri = intent.getData();
+ ArrayList uris = new ArrayList();
if (extras == null) {
extras = new Bundle();
}
+ if (intent.getData() != null) {
+ uris.add(intent.getData());
+ }
+
/*
* Android's Action
*/
@@ -206,14 +260,19 @@ public class EncryptActivity extends DrawerActivity implements
}
} else {
// Files via content provider, override uri and action
- uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
+ uris.clear();
+ uris.add(intent.getParcelableExtra(Intent.EXTRA_STREAM));
action = ACTION_ENCRYPT;
}
}
+ if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) {
+ uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
+ action = ACTION_ENCRYPT;
+ }
+
if (extras.containsKey(EXTRA_ASCII_ARMOR)) {
- boolean requestAsciiArmor = extras.getBoolean(EXTRA_ASCII_ARMOR, true);
- mFileFragmentBundle.putBoolean(EncryptFileFragment.ARG_ASCII_ARMOR, requestAsciiArmor);
+ mUseArmor = extras.getBoolean(EXTRA_ASCII_ARMOR, true);
}
String textData = extras.getString(EXTRA_TEXT);
@@ -235,9 +294,9 @@ public class EncryptActivity extends DrawerActivity implements
// encrypt text based on given extra
mMessageFragmentBundle.putString(EncryptMessageFragment.ARG_TEXT, textData);
mSwitchToContent = PAGER_CONTENT_MESSAGE;
- } else if (ACTION_ENCRYPT.equals(action) && uri != null) {
+ } else if (ACTION_ENCRYPT.equals(action) && uris != null && !uris.isEmpty()) {
// encrypt file based on Uri
- mFileFragmentBundle.putParcelable(EncryptFileFragment.ARG_URI, uri);
+ mFileFragmentBundle.putParcelableArrayList(EncryptFileFragment.ARG_URIS, uris);
mSwitchToContent = PAGER_CONTENT_FILE;
} else {
Log.e(Constants.TAG,
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java
index ca2ee3b55..6d649c32e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivityInterface.java
@@ -28,4 +28,6 @@ public interface EncryptActivityInterface {
public String getPassphrase();
public String getPassphraseAgain();
+ boolean isUseArmor();
+ boolean isDeleteAfterEncrypt();
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
index be845f05e..dc9cfe72e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
@@ -19,25 +19,30 @@ package org.sufficientlysecure.keychain.ui;
import android.app.Activity;
import android.content.Intent;
+import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
+import android.support.v4.app.LoaderManager;
+import android.support.v4.content.CursorLoader;
+import android.support.v4.content.Loader;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.CheckBox;
-import android.widget.TextView;
-import android.widget.Button;
+import android.widget.*;
+import com.tokenautocomplete.TokenCompleteTextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
+import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
+import org.sufficientlysecure.keychain.ui.widget.EncryptKeyCompletionView;
import org.sufficientlysecure.keychain.util.Log;
-import java.util.Vector;
+import java.util.*;
public class EncryptAsymmetricFragment extends Fragment {
public static final String ARG_SIGNATURE_KEY_ID = "signature_key_id";
@@ -51,10 +56,8 @@ public class EncryptAsymmetricFragment extends Fragment {
OnAsymmetricKeySelection mKeySelectionListener;
// view
- private Button mSelectKeysButton;
private CheckBox mSign;
- private TextView mMainUserId;
- private TextView mMainUserIdRest;
+ private EncryptKeyCompletionView mEncryptKeyView;
// model
private long mSecretKeyId = Constants.key.none;
@@ -108,15 +111,7 @@ public class EncryptAsymmetricFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.encrypt_asymmetric_fragment, container, false);
- mSelectKeysButton = (Button) view.findViewById(R.id.btn_selectEncryptKeys);
mSign = (CheckBox) view.findViewById(R.id.sign);
- mMainUserId = (TextView) view.findViewById(R.id.mainUserId);
- mMainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
- mSelectKeysButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- selectPublicKeys();
- }
- });
mSign.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
CheckBox checkBox = (CheckBox) v;
@@ -127,6 +122,7 @@ public class EncryptAsymmetricFragment extends Fragment {
}
}
});
+ mEncryptKeyView = (EncryptKeyCompletionView) view.findViewById(R.id.recipient_list);
return view;
}
@@ -140,6 +136,40 @@ public class EncryptAsymmetricFragment extends Fragment {
mProviderHelper = new ProviderHelper(getActivity());
+ getLoaderManager().initLoader(0, null, new LoaderManager.LoaderCallbacks() {
+ @Override
+ public Loader onCreateLoader(int id, Bundle args) {
+ return new CursorLoader(getActivity(), KeychainContract.KeyRings.buildUnifiedKeyRingsUri(),
+ new String[]{KeyRings.HAS_ENCRYPT, KeyRings.KEY_ID, KeyRings.USER_ID, KeyRings.FINGERPRINT},
+ null, null, null);
+ }
+
+ @Override
+ public void onLoadFinished(Loader loader, Cursor data) {
+ mEncryptKeyView.fromCursor(data);
+ }
+
+ @Override
+ public void onLoaderReset(Loader loader) {
+ mEncryptKeyView.fromCursor(null);
+ }
+ });
+ mEncryptKeyView.setTokenListener(new TokenCompleteTextView.TokenListener() {
+ @Override
+ public void onTokenAdded(Object token) {
+ if (token instanceof EncryptKeyCompletionView.EncryptionKey) {
+ updateEncryptionKeys();
+ }
+ }
+
+ @Override
+ public void onTokenRemoved(Object token) {
+ if (token instanceof EncryptKeyCompletionView.EncryptionKey) {
+ updateEncryptionKeys();
+ }
+ }
+ });
+
// preselect keys given by arguments (given by Intent to EncryptActivity)
preselectKeys(signatureKeyId, encryptionKeyIds, mProviderHelper);
}
@@ -168,44 +198,31 @@ public class EncryptAsymmetricFragment extends Fragment {
}
if (preselectedEncryptionKeyIds != null) {
- Vector goodIds = new Vector();
- Vector goodUserIds = new Vector();
for (long preselectedId : preselectedEncryptionKeyIds) {
try {
CachedPublicKeyRing ring = providerHelper.getCachedPublicKeyRing(
KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(preselectedId));
- long id = ring.getMasterKeyId();
- ring.getSplitPrimaryUserId();
- goodUserIds.add(ring.getPrimaryUserId());
- goodIds.add(id);
+ mEncryptKeyView.addObject(mEncryptKeyView.new EncryptionKey(ring));
} catch (PgpGeneralException e) {
Log.e(Constants.TAG, "key not found!", e);
}
}
- if (goodIds.size() > 0) {
- long[] keyIds = new long[goodIds.size()];
- for (int i = 0; i < goodIds.size(); ++i) {
- keyIds[i] = goodIds.get(i);
- }
- setEncryptionKeyIds(keyIds);
- setEncryptionUserIds(goodUserIds.toArray(new String[goodUserIds.size()]));
- }
+ updateEncryptionKeys();
}
}
private void updateView() {
- if (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0) {
+ /*if (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0) {
mSelectKeysButton.setText(getString(R.string.select_keys_button_default));
} else {
mSelectKeysButton.setText(getResources().getQuantityString(
R.plurals.select_keys_button, mEncryptionKeyIds.length,
mEncryptionKeyIds.length));
- }
+ }*/
+ /*
if (mSecretKeyId == Constants.key.none) {
mSign.setChecked(false);
- mMainUserId.setText("");
- mMainUserIdRest.setText("");
} else {
// See if we can get a user_id from a unified query
String[] userId;
@@ -216,7 +233,7 @@ public class EncryptAsymmetricFragment extends Fragment {
userId = null;
}
if (userId != null && userId[0] != null) {
- mMainUserId.setText(String.format("%#16x", Long.parseLong(userId[0])));
+ mMainUserId.setText(userId[0]);
} else {
mMainUserId.setText(getResources().getString(R.string.user_id_no_name));
}
@@ -227,6 +244,26 @@ public class EncryptAsymmetricFragment extends Fragment {
}
mSign.setChecked(true);
}
+ */
+ }
+
+ private void updateEncryptionKeys() {
+ List
@@ -200,8 +200,8 @@
-
+
@@ -221,6 +221,7 @@
+
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
index e42c7987b..615d89e0c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
@@ -26,18 +26,12 @@ import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.os.Handler;
-import android.os.Message;
-import android.os.Messenger;
+import android.os.*;
import android.provider.DocumentsContract;
import android.provider.OpenableColumns;
import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.widget.Toast;
-
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
@@ -135,18 +129,25 @@ public class FileHelper {
}, fragment.getActivity().getSupportFragmentManager(), title, message, defaultFile, checkMsg);
}
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ public static void openDocument(Fragment fragment, String mimeType, int requestCode) {
+ openDocument(fragment, mimeType, false, requestCode);
+ }
/**
* Opens the storage browser on Android 4.4 or later for opening a file
* @param fragment
* @param mimeType can be text/plain for example
+ * @param multiple allow file chooser to return multiple files
* @param requestCode used to identify the result coming back from storage browser onActivityResult() in your
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
- public static void openDocument(Fragment fragment, String mimeType, int requestCode) {
+ public static void openDocument(Fragment fragment, String mimeType, boolean multiple, int requestCode) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(mimeType);
+ intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);
+
fragment.startActivityForResult(intent, requestCode);
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
index 9e745215d..d1864f873 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
@@ -104,6 +104,8 @@ public class TemporaryStorageProvider extends ContentProvider {
@Override
public String getType(Uri uri) {
+ // Note: If we can find a files mime type, we can decrypt it to temp storage and open it after
+ // encryption. The mime type is needed, else UI really sucks and some apps break.
return "*/*";
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
index 5d82fca6a..e62591b1a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
@@ -23,7 +23,6 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
-
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
@@ -120,6 +119,7 @@ public class DecryptActivity extends DrawerActivity {
// override action
action = ACTION_DECRYPT;
+ mFileFragmentBundle.putBoolean(DecryptFileFragment.ARG_FROM_VIEW_INTENT, true);
}
String textData = extras.getString(EXTRA_TEXT);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
index 520ef7567..dd05537ef 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
@@ -29,21 +29,21 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
-
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
-import org.sufficientlysecure.keychain.util.Notify;
import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
+import org.sufficientlysecure.keychain.util.Notify;
import java.io.File;
public class DecryptFileFragment extends DecryptFragment {
public static final String ARG_URI = "uri";
+ public static final String ARG_FROM_VIEW_INTENT = "view_intent";
private static final int REQUEST_CODE_INPUT = 0x00007003;
private static final int REQUEST_CODE_OUTPUT = 0x00007007;
@@ -189,6 +189,15 @@ public class DecryptFileFragment extends DecryptFragment {
deleteFileDialog.show(getActivity().getSupportFragmentManager(), "deleteDialog");
setInputUri(null);
}
+
+ /*
+ // A future open after decryption feature
+ if () {
+ Intent viewFile = new Intent(Intent.ACTION_VIEW);
+ viewFile.setData(mOutputUri);
+ startActivity(viewFile);
+ }
+ */
}
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptMessageFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptMessageFragment.java
index 46462f924..2db6c232c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptMessageFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptMessageFragment.java
@@ -27,9 +27,7 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.EditText;
-
import com.devspark.appmsg.AppMsg;
-
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index ef999a449..3dea8f227 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -28,7 +28,6 @@ import android.os.Messenger;
import android.support.v4.app.Fragment;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
-
import android.view.Menu;
import android.view.MenuItem;
import com.devspark.appmsg.AppMsg;
@@ -41,8 +40,8 @@ import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
+import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
-import org.sufficientlysecure.keychain.util.Choice;
import org.sufficientlysecure.keychain.util.Log;
import java.util.ArrayList;
@@ -220,9 +219,12 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
if (!isContentMessage() && mDeleteAfterEncrypt) {
// TODO: Create and show dialog to delete original file
- //DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(mInputUri);
- //deleteFileDialog.show(getActivity().getSupportFragmentManager(), "deleteDialog");
- //setInputUri(null);
+ for (Uri inputUri : mInputUris) {
+ DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(inputUri);
+ deleteFileDialog.show(getSupportFragmentManager(), "deleteDialog");
+ }
+ mInputUris.clear();
+ notifyUpdate();
}
if (mShareAfterEncrypt) {
@@ -327,12 +329,11 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
return false;
} else if (mInputUris.size() > 1 && !mShareAfterEncrypt) {
- AppMsg.makeText(this, "TODO", AppMsg.STYLE_ALERT).show(); // TODO
+ // This should be impossible...
+ return false;
+ } else if (mInputUris.size() != mOutputUris.size()) {
+ // This as well
return false;
- }
-
- if (mInputUris.size() != mOutputUris.size()) {
- throw new IllegalStateException("Something went terribly wrong if this happens!");
}
}
@@ -445,6 +446,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
switch (item.getItemId()) {
case R.id.check_use_symmetric:
mSwitchToMode = item.isChecked() ? PAGER_MODE_SYMMETRIC : PAGER_MODE_ASYMMETRIC;
+
mViewPagerMode.setCurrentItem(mSwitchToMode);
notifyUpdate();
break;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
index 9c7d7462f..47f4bdf59 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
@@ -37,7 +37,6 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
-import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.ui.widget.EncryptKeyCompletionView;
@@ -48,14 +47,9 @@ import java.util.Iterator;
import java.util.List;
public class EncryptAsymmetricFragment extends Fragment implements EncryptActivityInterface.UpdateListener {
- private static final String SIGN_KEY_SELECTION = KeyRings.CAN_SIGN + " = 1 AND " + KeyRings.IS_REVOKED + " = 0";
-
public static final String ARG_SIGNATURE_KEY_ID = "signature_key_id";
public static final String ARG_ENCRYPTION_KEY_IDS = "encryption_key_ids";
- public static final int REQUEST_CODE_PUBLIC_KEYS = 0x00007001;
- public static final int REQUEST_CODE_SECRET_KEYS = 0x00007002;
-
ProviderHelper mProviderHelper;
// view
@@ -130,26 +124,6 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi
// preselect keys given by arguments (given by Intent to EncryptActivity)
preselectKeys(signatureKeyId, encryptionKeyIds, mProviderHelper);
- // TODO: Move this into widget!
-
- getLoaderManager().initLoader(0, null, new LoaderManager.LoaderCallbacks() {
- @Override
- public Loader onCreateLoader(int id, Bundle args) {
- return new CursorLoader(getActivity(), KeychainContract.KeyRings.buildUnifiedKeyRingsUri(),
- new String[]{KeyRings.HAS_ENCRYPT, KeyRings.KEY_ID, KeyRings.USER_ID, KeyRings.FINGERPRINT},
- null, null, null);
- }
-
- @Override
- public void onLoadFinished(Loader loader, Cursor data) {
- mEncryptKeyView.swapCursor(data);
- }
-
- @Override
- public void onLoaderReset(Loader loader) {
- mEncryptKeyView.swapCursor(null);
- }
- });
getLoaderManager().initLoader(1, null, new LoaderManager.LoaderCallbacks() {
@Override
public Loader onCreateLoader(int id, Bundle args) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index f782b7594..1125dce77 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -17,24 +17,27 @@
package org.sufficientlysecure.keychain.ui;
+import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.*;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.helper.OtherHelper;
-import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
-import org.sufficientlysecure.keychain.util.Choice;
import java.io.File;
import java.util.List;
@@ -89,45 +92,13 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
mAddView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- if (Constants.KITKAT) {
- FileHelper.openDocument(EncryptFileFragment.this, "*/*", REQUEST_CODE_INPUT);
- } else {
- FileHelper.openFile(EncryptFileFragment.this,
- mEncryptInterface.getInputUris().isEmpty() ? null : mEncryptInterface.getInputUris().get(mEncryptInterface.getInputUris().size() - 1), "*/*", REQUEST_CODE_INPUT);
- }
+ addInputUri();
}
});
ListView listView = (ListView) view.findViewById(R.id.selected_files_list);
listView.addFooterView(mAddView);
listView.setAdapter(mAdapter);
- /*
- mFileCompression = (Spinner) view.findViewById(R.id.fileCompression);
- Choice[] choices = new Choice[]{
- new Choice(Constants.choice.compression.none, getString(R.string.choice_none) + " ("
- + getString(R.string.compression_fast) + ")"),
- new Choice(Constants.choice.compression.zip, "ZIP ("
- + getString(R.string.compression_fast) + ")"),
- new Choice(Constants.choice.compression.zlib, "ZLIB ("
- + getString(R.string.compression_fast) + ")"),
- new Choice(Constants.choice.compression.bzip2, "BZIP2 ("
- + getString(R.string.compression_very_slow) + ")"),
- };
- ArrayAdapter adapter = new ArrayAdapter(getActivity(),
- android.R.layout.simple_spinner_item, choices);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- mFileCompression.setAdapter(adapter);
-
-
- int defaultFileCompression = Preferences.getPreferences(getActivity()).getDefaultFileCompression();
- for (int i = 0; i < choices.length; ++i) {
- if (choices[i].getId() == defaultFileCompression) {
- mFileCompression.setSelection(i);
- break;
- }
- }
- */
-
return view;
}
@@ -138,6 +109,16 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
addInputUris(getArguments().getParcelableArrayList(ARG_URIS));
}
+ private void addInputUri() {
+ if (Constants.KITKAT) {
+ FileHelper.openDocument(EncryptFileFragment.this, "*/*", true, REQUEST_CODE_INPUT);
+ } else {
+ FileHelper.openFile(EncryptFileFragment.this, mEncryptInterface.getInputUris().isEmpty() ?
+ null : mEncryptInterface.getInputUris().get(mEncryptInterface.getInputUris().size() - 1),
+ "*/*", REQUEST_CODE_INPUT);
+ }
+ }
+
private void addInputUris(List uris) {
if (uris != null) {
for (Uri uri : uris) {
@@ -206,25 +187,41 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
(mEncryptInterface.isUseArmor() ? ".asc" : ".gpg");
mEncryptInterface.getOutputUris().add(TemporaryStorageProvider.createFile(getActivity(), targetName));
}
- mEncryptInterface.startEncrypt(share);
+ mEncryptInterface.startEncrypt(true);
} else if (mEncryptInterface.getInputUris().size() == 1) {
showOutputFileDialog();
}
}
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ public boolean handleClipData(Intent data) {
+ if (data.getClipData() != null && data.getClipData().getItemCount() > 0) {
+ for (int i = 0; i < data.getClipData().getItemCount(); i++) {
+ Uri uri = data.getClipData().getItemAt(i).getUri();
+ if (uri != null) addInputUri(uri);
+ }
+ return true;
+ }
+ return false;
+ }
+
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_CODE_INPUT: {
if (resultCode == Activity.RESULT_OK && data != null) {
- addInputUri(data.getData());
+ if (!Constants.KITKAT || !handleClipData(data)) {
+ addInputUri(data.getData());
+ }
}
return;
}
case REQUEST_CODE_OUTPUT: {
// This happens after output file was selected, so start our operation
if (resultCode == Activity.RESULT_OK && data != null) {
+ mEncryptInterface.getOutputUris().clear();
mEncryptInterface.getOutputUris().add(data.getData());
+ mEncryptInterface.notifyUpdate();
mEncryptInterface.startEncrypt(false);
}
return;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 2ba2e6497..7bdaf27c7 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -4,6 +4,11 @@ import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.LoaderManager;
+import android.support.v4.content.CursorLoader;
+import android.support.v4.content.Loader;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -48,8 +53,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
allowDuplicates(false);
}
- private EncryptKeyAdapter mAdapter;
-
@Override
protected View getViewForObject(Object object) {
if (object instanceof EncryptionKey) {
@@ -81,6 +84,31 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
return null;
}
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ if (getContext() instanceof FragmentActivity) {
+ ((FragmentActivity) getContext()).getSupportLoaderManager().initLoader(0, null, new LoaderManager.LoaderCallbacks() {
+ @Override
+ public Loader onCreateLoader(int id, Bundle args) {
+ return new CursorLoader(getContext(), KeychainContract.KeyRings.buildUnifiedKeyRingsUri(),
+ new String[]{KeychainContract.KeyRings.HAS_ENCRYPT, KeychainContract.KeyRings.KEY_ID, KeychainContract.KeyRings.USER_ID, KeychainContract.KeyRings.FINGERPRINT},
+ null, null, null);
+ }
+
+ @Override
+ public void onLoadFinished(Loader loader, Cursor data) {
+ swapCursor(data);
+ }
+
+ @Override
+ public void onLoaderReset(Loader loader) {
+ swapCursor(null);
+ }
+ });
+ }
+ }
+
public void swapCursor(Cursor cursor) {
if (cursor == null) {
setAdapter(new EncryptKeyAdapter(Collections.emptyList()));
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
index 08f071fb2..516e5ec39 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
@@ -17,12 +17,13 @@ public class NoSwipeWrapContentViewPager extends android.support.v4.view.ViewPag
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int height = 0;
- for(int i = 0; i < getChildCount(); i++) {
- View child = getChildAt(i);
+ int height;
+ View child = getChildAt(getCurrentItem());
+ if (child != null) {
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
- int h = child.getMeasuredHeight();
- if(h > height) height = h;
+ height = child.getMeasuredHeight();
+ } else {
+ height = 0;
}
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
diff --git a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
index b5d7b98cd..74d723d69 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
@@ -1,13 +1,14 @@
-
+
+ android:text="@string/from"/>
+ android:layout_gravity="center_vertical"/>
diff --git a/OpenKeychain/src/main/res/layout/encrypt_content.xml b/OpenKeychain/src/main/res/layout/encrypt_content.xml
index ec71b25e5..b2bdbf7b5 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_content.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_content.xml
@@ -1,15 +1,17 @@
-
+
+ android:id="@+id/encrypt_pager_mode"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
diff --git a/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml b/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml
index 156fce8f0..3110b059e 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml
@@ -10,17 +10,11 @@
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical">
-
-
-
@@ -30,6 +24,8 @@
android:layout_height="1dip"
android:background="?android:attr/listDivider"/>
+
+
From ClipboardEncrypt and save fileEncrypt and share file
+ Encrypt, sign and shareSaveCancelDelete
@@ -166,6 +167,7 @@
Secret Key:
+ From:None
--
cgit v1.2.3
From 36d8c9f608cca5ba2f8df11008415c230825174b Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Thu, 31 Jul 2014 23:20:43 +0200
Subject: Fix merge
---
.../keychain/ui/EncryptActivity.java | 30 ++++++++++++----------
.../keychain/ui/EncryptMessageFragment.java | 21 ---------------
.../keychain/ui/dialog/FileDialogFragment.java | 5 ++--
.../src/main/res/layout/encrypt_content.xml | 2 ++
4 files changed, 21 insertions(+), 37 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 3dea8f227..e804d76a6 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -30,7 +30,6 @@ import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.MenuItem;
-import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
@@ -43,6 +42,7 @@ import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
+import org.sufficientlysecure.keychain.util.Notify;
import java.util.ArrayList;
import java.util.HashSet;
@@ -94,7 +94,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
private boolean mShareAfterEncrypt = false;
private ArrayList mInputUris;
private ArrayList mOutputUris;
- private String mMessage;
+ private String mMessage = "";
public boolean isModeSymmetric() {
return PAGER_MODE_SYMMETRIC == mViewPagerMode.getCurrentItem();
@@ -198,7 +198,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
public void startEncrypt() {
if (!inputIsValid()) {
- // AppMsg was created by inputIsValid.
+ // Notify was created by inputIsValid.
return;
}
@@ -215,7 +215,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
super.handleMessage(message);
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
- AppMsg.makeText(EncryptActivity.this, R.string.encrypt_sign_successful, AppMsg.STYLE_INFO).show();
+ Notify.showNotify(EncryptActivity.this, R.string.encrypt_sign_successful, Notify.Style.INFO);
if (!isContentMessage() && mDeleteAfterEncrypt) {
// TODO: Create and show dialog to delete original file
@@ -233,8 +233,8 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
} else if (isContentMessage()) {
// Copy to clipboard
copyToClipboard(message);
- AppMsg.makeText(EncryptActivity.this,
- R.string.encrypt_sign_clipboard_successful, AppMsg.STYLE_INFO).show();
+ Notify.showNotify(EncryptActivity.this,
+ R.string.encrypt_sign_clipboard_successful, Notify.Style.INFO);
}
}
}
@@ -322,11 +322,16 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
}
private boolean inputIsValid() {
- if (!isContentMessage()) {
+ if (isContentMessage()) {
+ if (mMessage == null) {
+ Notify.showNotify(this, R.string.error_message, Notify.Style.ERROR);
+ return false;
+ }
+ } else {
// file checks
if (mInputUris.isEmpty()) {
- AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(this, R.string.no_file_selected, Notify.Style.ERROR);
return false;
} else if (mInputUris.size() > 1 && !mShareAfterEncrypt) {
// This should be impossible...
@@ -342,11 +347,11 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
if (mPassphrase == null) {
- AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(this, R.string.passphrases_do_not_match, Notify.Style.ERROR);
return false;
}
if (mPassphrase.isEmpty()) {
- AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(this, R.string.passphrase_must_not_be_empty, Notify.Style.ERROR);
return false;
}
@@ -358,13 +363,12 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
// Files must be encrypted, only text can be signed-only right now
if (!gotEncryptionKeys && !isContentMessage()) {
- AppMsg.makeText(this, R.string.select_encryption_key, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(this, R.string.select_encryption_key, Notify.Style.ERROR);
return false;
}
if (!gotEncryptionKeys && mSigningKeyId == 0) {
- AppMsg.makeText(this, R.string.select_encryption_or_signature_key,
- AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(this, R.string.select_encryption_or_signature_key, Notify.Style.ERROR);
return false;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
index 6aae649bd..e493ad066 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
@@ -18,12 +18,7 @@
package org.sufficientlysecure.keychain.ui;
import android.app.Activity;
-import android.app.ProgressDialog;
-import android.content.Intent;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.os.Messenger;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.TextWatcher;
@@ -31,23 +26,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
-
-import com.devspark.appmsg.AppMsg;
-
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
-import org.sufficientlysecure.keychain.helper.Preferences;
-import org.sufficientlysecure.keychain.pgp.KeyRing;
-import org.sufficientlysecure.keychain.service.KeychainIntentService;
-import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
-import org.sufficientlysecure.keychain.service.PassphraseCacheService;
-import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
-import org.sufficientlysecure.keychain.util.Log;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
public class EncryptMessageFragment extends Fragment {
public static final String ARG_TEXT = "text";
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
index 80341aeaa..50f5ef7c0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
@@ -18,7 +18,6 @@
package org.sufficientlysecure.keychain.ui.dialog;
import android.app.Activity;
-import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
@@ -35,11 +34,11 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
-import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.util.Log;
+import org.sufficientlysecure.keychain.util.Notify;
import java.io.File;
@@ -190,7 +189,7 @@ public class FileDialogFragment extends DialogFragment {
mFile = file;
mFilename.setText(mFile.getName());
} else {
- AppMsg.makeText(getActivity(), R.string.no_file_selected, AppMsg.STYLE_ALERT).show();
+ Notify.showNotify(getActivity(), R.string.no_file_selected, Notify.Style.ERROR);
}
}
diff --git a/OpenKeychain/src/main/res/layout/encrypt_content.xml b/OpenKeychain/src/main/res/layout/encrypt_content.xml
index b2bdbf7b5..e5edc6657 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_content.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_content.xml
@@ -7,6 +7,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
+
+
Date: Thu, 31 Jul 2014 23:36:37 +0200
Subject: Fix string resources
---
.../java/org/sufficientlysecure/keychain/ui/EncryptActivity.java | 2 +-
OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml | 2 +-
OpenKeychain/src/main/res/values/strings.xml | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index e804d76a6..609ac8ab7 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -429,7 +429,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
mTabsAdapterContent.addTab(EncryptMessageFragment.class,
mMessageFragmentBundle, getString(R.string.label_message));
mTabsAdapterContent.addTab(EncryptFileFragment.class,
- mFileFragmentBundle, getString(R.string.label_file));
+ mFileFragmentBundle, getString(R.string.label_files));
mViewPagerContent.setCurrentItem(mSwitchToContent);
mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
diff --git a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
index 74d723d69..e9e439d65 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
@@ -23,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/from"/>
+ android:text="@string/label_asymmetric_from"/>
SignMessageFile
+ File(s)File:No PassphrasePassphrase
@@ -115,14 +116,15 @@
Let others know that you\'re using OpenKeychainWrites \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keysRecipients
+ From:ToDelete After EncryptionDelete After DecryptionShare After EncryptionEncryption AlgorithmHash Algorithm
- with Public Key
- with Passphrase
+ With Public Key
+ With PassphrasePassphrase CacheMessage CompressionFile Compression
@@ -168,7 +170,6 @@
Secret Key:
- From:None
@@ -202,7 +203,7 @@
Wrong passphrase.Set a passphrase first.No compatible file manager installed.
- The file manager does not support saving.
+ The file manager does not support saving files.The passphrases didn\'t match.Please enter a passphrase.Symmetric encryption.
--
cgit v1.2.3
From 00f5352ddc90ab05f3d1a44534e44b015e071e18 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Fri, 1 Aug 2014 05:31:04 +0200
Subject: Fixes after merge
---
.../sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
index f05fec782..2295183a9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
@@ -30,9 +30,12 @@ import android.support.v4.widget.CursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.CheckBox;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.Spinner;
+import android.widget.SpinnerAdapter;
import android.widget.TextView;
-import android.widget.Button;
+
import com.tokenautocomplete.TokenCompleteTextView;
import org.sufficientlysecure.keychain.Constants;
--
cgit v1.2.3
From 3a13cd5e4deebe283f8bfbc5122951e0a77b339d Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Fri, 1 Aug 2014 12:23:31 +0200
Subject: Fix first key is not used erroneously
---
.../sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 7bdaf27c7..53731b278 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -115,7 +115,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
return;
}
ArrayList keys = new ArrayList();
- cursor.moveToFirst();
while (cursor.moveToNext()) {
try {
if (cursor.getInt(cursor.getColumnIndexOrThrow(KeychainContract.KeyRings.HAS_ENCRYPT)) != 0) {
--
cgit v1.2.3
From 1ebb92b33638e427befa37fd2b6eef67ed3e4b88 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Fri, 1 Aug 2014 12:24:26 +0200
Subject: Cache contact photos to make UI more fluid
---
.../org/sufficientlysecure/keychain/helper/ContactHelper.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
index 5d1bd1bb5..8fed40a86 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
@@ -63,6 +63,8 @@ public class ContactHelper {
ContactsContract.Data.RAW_CONTACT_ID + "=? AND " + ContactsContract.Data.MIMETYPE + "=?";
public static final String ID_SELECTION = ContactsContract.RawContacts._ID + "=?";
+ private static final Map photoCache = new HashMap();
+
public static List getPossibleUserEmails(Context context) {
Set accountMails = getAccountEmails(context);
accountMails.addAll(getMainProfileContactEmails(context));
@@ -236,6 +238,14 @@ public class ContactHelper {
}
public static Bitmap photoFromFingerprint(ContentResolver contentResolver, String fingerprint) {
+ if (fingerprint == null) return null;
+ if (!photoCache.containsKey(fingerprint)) {
+ photoCache.put(fingerprint, loadPhotoFromFingerprint(contentResolver, fingerprint));
+ }
+ return photoCache.get(fingerprint);
+ }
+
+ private static Bitmap loadPhotoFromFingerprint(ContentResolver contentResolver, String fingerprint) {
if (fingerprint == null) return null;
try {
int rawContactId = findRawContactId(contentResolver, fingerprint);
--
cgit v1.2.3
From b206b6d351e38c96eb44d801a45c872844c1a0fd Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Fri, 1 Aug 2014 12:41:30 +0200
Subject: Cache input file thumbnail.
---
.../keychain/ui/EncryptFileFragment.java | 23 +++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index 1125dce77..7538d2a56 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -38,9 +38,13 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.helper.OtherHelper;
import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
+import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
public class EncryptFileFragment extends Fragment implements EncryptActivityInterface.UpdateListener {
public static final String ARG_URIS = "uris";
@@ -55,6 +59,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
private View mShareFile;
private View mEncryptFile;
private SelectedFilesAdapter mAdapter = new SelectedFilesAdapter();
+ private final Map thumbnailCache = new HashMap();
@Override
public void onAttach(Activity activity) {
@@ -237,6 +242,14 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
@Override
public void onNotifyUpdate() {
+ // Clear cache if needed
+ for (Uri uri : new HashSet(thumbnailCache.keySet())) {
+ if (!mEncryptInterface.getInputUris().contains(uri)) {
+ Log.d(Constants.TAG, "Removed thumbnail for uri: "+uri);
+ thumbnailCache.remove(uri);
+ }
+ }
+
mAdapter.notifyDataSetChanged();
}
@@ -258,14 +271,15 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
+ Uri inputUri = mEncryptInterface.getInputUris().get(position);
View view;
if (convertView == null) {
view = getActivity().getLayoutInflater().inflate(R.layout.file_list_entry, null);
} else {
view = convertView;
}
- ((TextView) view.findViewById(R.id.filename)).setText(FileHelper.getFilename(getActivity(), mEncryptInterface.getInputUris().get(position)));
- long size = FileHelper.getFileSize(getActivity(), mEncryptInterface.getInputUris().get(position));
+ ((TextView) view.findViewById(R.id.filename)).setText(FileHelper.getFilename(getActivity(), inputUri));
+ long size = FileHelper.getFileSize(getActivity(), inputUri);
if (size == -1) {
((TextView) view.findViewById(R.id.filesize)).setText("");
} else {
@@ -278,7 +292,10 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
}
});
int px = OtherHelper.dpToPx(getActivity(), 48);
- Bitmap bitmap = FileHelper.getThumbnail(getActivity(), mEncryptInterface.getInputUris().get(position), new Point(px, px));
+ if (!thumbnailCache.containsKey(inputUri)) {
+ thumbnailCache.put(inputUri, FileHelper.getThumbnail(getActivity(), inputUri, new Point(px, px)));
+ }
+ Bitmap bitmap = thumbnailCache.get(inputUri);
if (bitmap != null) {
((ImageView) view.findViewById(R.id.thumbnail)).setImageBitmap(bitmap);
} else {
--
cgit v1.2.3
From 80ed3464f4b3291e4c3402b2db8e78c16535274c Mon Sep 17 00:00:00 2001
From: Vincent Breitmoser
Date: Fri, 1 Aug 2014 17:49:59 +0200
Subject: small fix for MSG_MF_UID_ADD log entry
---
.../main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
index 19b0d81b7..3f058d888 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
@@ -356,7 +356,7 @@ public class PgpKeyOperation {
progress(R.string.progress_modify_adduid, (i-1) * (100 / saveParcel.mAddUserIds.size()));
String userId = saveParcel.mAddUserIds.get(i);
- log.add(LogLevel.INFO, LogType.MSG_MF_UID_ADD, indent);
+ log.add(LogLevel.INFO, LogType.MSG_MF_UID_ADD, indent, userId);
if (userId.equals("")) {
log.add(LogLevel.ERROR, LogType.MSG_MF_UID_ERROR_EMPTY, indent+1);
--
cgit v1.2.3
From 9d101b4fe5ea3aa4c67264131eaaf055c0c35641 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Fri, 1 Aug 2014 23:30:31 +0200
Subject: Encrypt UI (drop downs)
---
.../keychain/ui/EncryptActivity.java | 3 +-
.../keychain/ui/EncryptAsymmetricFragment.java | 24 +++++++++++----
.../keychain/ui/EncryptFileFragment.java | 1 -
.../ui/widget/EncryptKeyCompletionView.java | 33 ++++++++++++--------
.../main/res/layout/encrypt_asymmetric_signkey.xml | 36 ++++++++++++++--------
.../res/layout/recipient_selection_list_entry.xml | 13 ++++++--
6 files changed, 75 insertions(+), 35 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 609ac8ab7..8a516e6af 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -300,13 +300,12 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
// file
if (mOutputUris.size() == 1) {
sendIntent = new Intent(Intent.ACTION_SEND);
- sendIntent.setType("*/*");
sendIntent.putExtra(Intent.EXTRA_STREAM, mOutputUris.get(0));
} else {
sendIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
- sendIntent.setType("*/*");
sendIntent.putExtra(Intent.EXTRA_STREAM, mOutputUris);
}
+ sendIntent.setType("application/pgp-encrypted");
}
if (!isModeSymmetric() && mEncryptionUserIds != null) {
Set users = new HashSet();
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
index 2295183a9..ed3be0e7f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
@@ -40,6 +40,7 @@ import com.tokenautocomplete.TokenCompleteTextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
@@ -261,8 +262,9 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi
@Override
public void bindView(View view, Context context, Cursor cursor) {
- ((TextView) view.findViewById(android.R.id.text1)).setText(cursor.getString(mIndexUserId));
- view.findViewById(android.R.id.text2).setVisibility(View.VISIBLE);
+ String[] userId = KeyRing.splitUserId(cursor.getString(mIndexUserId));
+ ((TextView) view.findViewById(android.R.id.title)).setText(userId[2] == null ? userId[0] : (userId[0] + " (" + userId[2] + ")"));
+ ((TextView) view.findViewById(android.R.id.text1)).setText(userId[1]);
((TextView) view.findViewById(android.R.id.text2)).setText(PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId)));
}
@@ -309,19 +311,29 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi
@Override
public View getView(int position, View convertView, ViewGroup parent) {
+ View v = getDropDownView(position, convertView, parent);
+ v.findViewById(android.R.id.text1).setVisibility(View.GONE);
+ return v;
+ }
+
+ @Override
+ public View getDropDownView(int position, View convertView, ViewGroup parent) {
+ View v;
if (position == 0) {
- View v;
if (convertView == null) {
v = inner.newView(null, null, parent);
} else {
v = convertView;
}
- ((TextView) v.findViewById(android.R.id.text1)).setText("None");
+ ((TextView) v.findViewById(android.R.id.title)).setText("None");
+ v.findViewById(android.R.id.text1).setVisibility(View.GONE);
v.findViewById(android.R.id.text2).setVisibility(View.GONE);
- return v;
} else {
- return inner.getView(position - 1, convertView, parent);
+ v = inner.getView(position - 1, convertView, parent);
+ v.findViewById(android.R.id.text1).setVisibility(View.VISIBLE);
+ v.findViewById(android.R.id.text2).setVisibility(View.VISIBLE);
}
+ return v;
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index 7538d2a56..7650c3954 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -245,7 +245,6 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
// Clear cache if needed
for (Uri uri : new HashSet(thumbnailCache.keySet())) {
if (!mEncryptInterface.getInputUris().contains(uri)) {
- Log.d(Constants.TAG, "Removed thumbnail for uri: "+uri);
thumbnailCache.remove(uri);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 53731b278..329ef2c9b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -130,12 +130,14 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
}
public class EncryptionKey {
- private String mUserId;
+ private String mUserIdFull;
+ private String[] mUserId;
private long mKeyId;
private String mFingerprint;
public EncryptionKey(String userId, long keyId, String fingerprint) {
- this.mUserId = userId;
+ this.mUserId = KeyRing.splitUserId(userId);
+ this.mUserIdFull = userId;
this.mKeyId = keyId;
this.mFingerprint = fingerprint;
}
@@ -154,7 +156,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
}
public String getUserId() {
- return mUserId;
+ return mUserIdFull;
}
public String getFingerprint() {
@@ -162,25 +164,31 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
}
public String getPrimary() {
- String[] userId = KeyRing.splitUserId(mUserId);
- if (userId[0] != null && userId[2] != null) {
- return userId[0] + " (" + userId[2] + ")";
- } else if (userId[0] != null) {
- return userId[0];
+ if (mUserId[0] != null && mUserId[2] != null) {
+ return mUserId[0] + " (" + mUserId[2] + ")";
+ } else if (mUserId[0] != null) {
+ return mUserId[0];
} else {
- return userId[1];
+ return mUserId[1];
}
}
public String getSecondary() {
- String[] userId = KeyRing.splitUserId(mUserId);
- if (userId[0] != null) {
- return userId[1] + " (" + getKeyIdHexShort() + ")";
+ if (mUserId[0] != null) {
+ return mUserId[1];
} else {
return getKeyIdHex();
}
}
+ public String getTertiary() {
+ if (mUserId[0] != null) {
+ return getKeyIdHex();
+ } else {
+ return null;
+ }
+ }
+
public long getKeyId() {
return mKeyId;
}
@@ -216,6 +224,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
}
((TextView) view.findViewById(android.R.id.title)).setText(getItem(position).getPrimary());
((TextView) view.findViewById(android.R.id.text1)).setText(getItem(position).getSecondary());
+ ((TextView) view.findViewById(android.R.id.text2)).setText(getItem(position).getTertiary());
setImageByKey((ImageView) view.findViewById(android.R.id.icon), getItem(position));
return view;
}
diff --git a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml
index 35c618c72..703f9133b 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_signkey.xml
@@ -3,17 +3,29 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml b/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml
index 2be37fb4c..9d2d1e9a9 100644
--- a/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml
+++ b/OpenKeychain/src/main/res/layout/recipient_selection_list_entry.xml
@@ -30,11 +30,20 @@
android:singleLine="true"
android:ellipsize="end"
android:layout_marginTop="-4dip"/>
+
Date: Sat, 2 Aug 2014 00:51:56 +0200
Subject: Fix focusing with To field
---
.../sufficientlysecure/keychain/ui/EncryptFileFragment.java | 10 +++++++---
.../keychain/ui/widget/EncryptKeyCompletionView.java | 11 +++++++++++
OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml | 2 ++
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index 7650c3954..6bbbac713 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -27,6 +27,7 @@ import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@@ -58,6 +59,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
private View mAddView;
private View mShareFile;
private View mEncryptFile;
+ private ListView mSelectedFiles;
private SelectedFilesAdapter mAdapter = new SelectedFilesAdapter();
private final Map thumbnailCache = new HashMap();
@@ -100,9 +102,9 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
addInputUri();
}
});
- ListView listView = (ListView) view.findViewById(R.id.selected_files_list);
- listView.addFooterView(mAddView);
- listView.setAdapter(mAdapter);
+ mSelectedFiles = (ListView) view.findViewById(R.id.selected_files_list);
+ mSelectedFiles.addFooterView(mAddView);
+ mSelectedFiles.setAdapter(mAdapter);
return view;
}
@@ -139,6 +141,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
mEncryptInterface.getInputUris().add(inputUri);
mEncryptInterface.notifyUpdate();
+ mSelectedFiles.requestFocus();
/**
* We hide the encrypt to file button if multiple files are selected.
@@ -157,6 +160,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
private void delInputUri(int position) {
mEncryptInterface.getInputUris().remove(position);
mEncryptInterface.notifyUpdate();
+ mSelectedFiles.requestFocus();
if (mEncryptInterface.getInputUris().size() > 1) {
mEncryptFile.setVisibility(View.GONE);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 329ef2c9b..f1c17bfb5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -4,6 +4,7 @@ import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
+import android.graphics.Rect;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager;
@@ -13,6 +14,7 @@ import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.tokenautocomplete.FilteredArrayAdapter;
@@ -109,6 +111,15 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
}
}
+ @Override
+ public void onFocusChanged(boolean hasFocus, int direction, Rect previous) {
+ super.onFocusChanged(hasFocus, direction, previous);
+ if (hasFocus) {
+ ((InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE))
+ .showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
+ }
+ }
+
public void swapCursor(Cursor cursor) {
if (cursor == null) {
setAdapter(new EncryptKeyAdapter(Collections.emptyList()));
diff --git a/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml b/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml
index 3110b059e..b853ac2fb 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_file_fragment.xml
@@ -14,6 +14,8 @@
android:id="@+id/selected_files_list"
android:dividerHeight="4dip"
android:divider="@android:color/transparent"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="0dip"
--
cgit v1.2.3
From d4f2d3842b0a9e5611657ed1889154a950becc19 Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Sat, 2 Aug 2014 04:16:26 +0200
Subject: Minor cleanup
---
.../main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java | 1 -
.../sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java | 2 +-
OpenKeychain/src/main/res/layout/file_list_entry_add.xml | 2 +-
OpenKeychain/src/main/res/values/strings.xml | 1 +
4 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 8a516e6af..303db60ed 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -218,7 +218,6 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
Notify.showNotify(EncryptActivity.this, R.string.encrypt_sign_successful, Notify.Style.INFO);
if (!isContentMessage() && mDeleteAfterEncrypt) {
- // TODO: Create and show dialog to delete original file
for (Uri inputUri : mInputUris) {
DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(inputUri);
deleteFileDialog.show(getSupportFragmentManager(), "deleteDialog");
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
index 27ce4faee..5e296c062 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
@@ -85,7 +85,7 @@ public class DeleteFileDialogFragment extends DialogFragment {
Toast.makeText(getActivity(), getActivity().getString(R.string.error_file_delete_failed, deleteFilename), Toast.LENGTH_SHORT).show();
- // TODO: We can't delete that file...
+ // Note: We can't delete every file...
// If possible we should find out if deletion is possible before even showing the option to do so.
}
});
diff --git a/OpenKeychain/src/main/res/layout/file_list_entry_add.xml b/OpenKeychain/src/main/res/layout/file_list_entry_add.xml
index 2f24227fa..f2caab653 100644
--- a/OpenKeychain/src/main/res/layout/file_list_entry_add.xml
+++ b/OpenKeychain/src/main/res/layout/file_list_entry_add.xml
@@ -14,7 +14,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
- android:text="Add file(s)"
+ android:text="@string/btn_add_files"
android:drawableLeft="@drawable/ic_action_collection"
android:drawablePadding="8dp"
android:gravity="center"/>
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 7ad2cebdf..459c33862 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -74,6 +74,7 @@
Share encrypted/signed message…View certification keyCreate key
+ Add file(s)Settings
--
cgit v1.2.3
From d4240f73f5df91eaf2e7cc6bdc88a4e6b984746b Mon Sep 17 00:00:00 2001
From: Vincent Breitmoser
Date: Mon, 4 Aug 2014 00:39:49 +0200
Subject: delete unused PgpConversionHelper
---
.../keychain/pgp/PgpConversionHelper.java | 102 ---------------------
1 file changed, 102 deletions(-)
delete mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
deleted file mode 100644
index 3a5a96fbb..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2012-2014 Dominik Schürmann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.sufficientlysecure.keychain.pgp;
-
-import org.spongycastle.openpgp.PGPObjectFactory;
-import org.spongycastle.openpgp.PGPSecretKey;
-import org.spongycastle.openpgp.PGPSecretKeyRing;
-import org.sufficientlysecure.keychain.Constants;
-import org.sufficientlysecure.keychain.util.Log;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-public class PgpConversionHelper {
-
- /**
- * Convert from byte[] to ArrayList
- *
- * @param keysBytes
- * @return
- */
- public static ArrayList BytesToPGPSecretKeyList(byte[] keysBytes) {
- PGPObjectFactory factory = new PGPObjectFactory(keysBytes);
- Object obj = null;
- ArrayList keys = new ArrayList();
- try {
- while ((obj = factory.nextObject()) != null) {
- PGPSecretKey secKey = null;
- if (obj instanceof PGPSecretKey) {
- secKey = (PGPSecretKey) obj;
- if (secKey == null) {
- Log.e(Constants.TAG, "No keys given!");
- }
- keys.add(new UncachedSecretKey(secKey));
- } else if (obj instanceof PGPSecretKeyRing) { //master keys are sent as keyrings
- PGPSecretKeyRing keyRing = null;
- keyRing = (PGPSecretKeyRing) obj;
- if (keyRing == null) {
- Log.e(Constants.TAG, "No keys given!");
- }
- @SuppressWarnings("unchecked")
- Iterator itr = keyRing.getSecretKeys();
- while (itr.hasNext()) {
- keys.add(new UncachedSecretKey(itr.next()));
- }
- }
- }
- } catch (IOException e) {
- }
-
- return keys;
- }
-
- /**
- * Convert from byte[] to PGPSecretKey
- *
- * Singles keys are encoded as keyRings with one single key in it by Bouncy Castle
- *
- * @param keyBytes
- * @return
- */
- public static UncachedSecretKey BytesToPGPSecretKey(byte[] keyBytes) {
- PGPObjectFactory factory = new PGPObjectFactory(keyBytes);
- Object obj = null;
- try {
- obj = factory.nextObject();
- } catch (IOException e) {
- Log.e(Constants.TAG, "Error while converting to PGPSecretKey!", e);
- }
- PGPSecretKey secKey = null;
- if (obj instanceof PGPSecretKey) {
- if ((secKey = (PGPSecretKey) obj) == null) {
- Log.e(Constants.TAG, "No keys given!");
- }
- } else if (obj instanceof PGPSecretKeyRing) { //master keys are sent as keyrings
- PGPSecretKeyRing keyRing = null;
- if ((keyRing = (PGPSecretKeyRing) obj) == null) {
- Log.e(Constants.TAG, "No keys given!");
- }
- secKey = keyRing.getSecretKey();
- }
-
- return new UncachedSecretKey(secKey);
- }
-
-}
--
cgit v1.2.3
From 4979ccd645e605f66afd9e4e6174dd7f27687e1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 00:49:16 +0200
Subject: Smaller UI fixes
---
OpenKeychain/src/main/AndroidManifest.xml | 43 ++++++++---------
.../keychain/ui/EncryptActivity.java | 2 +-
.../keychain/ui/EncryptAsymmetricFragment.java | 1 +
.../ui/dialog/AddUserIdDialogFragment.java | 8 ++++
.../res/layout/encrypt_asymmetric_fragment.xml | 54 +++++++++++-----------
.../src/main/res/menu/encrypt_activity.xml | 2 +-
OpenKeychain/src/main/res/values/strings.xml | 5 +-
7 files changed, 59 insertions(+), 56 deletions(-)
diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml
index de559fe16..df5eaa69e 100644
--- a/OpenKeychain/src/main/AndroidManifest.xml
+++ b/OpenKeychain/src/main/AndroidManifest.xml
@@ -50,6 +50,7 @@
android:required="false" />
+
@@ -155,8 +156,9 @@
+
-
+
@@ -174,26 +176,16 @@
android:label="@string/title_decrypt"
android:windowSoftInputMode="stateHidden">
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
@@ -206,8 +198,9 @@
+
-
+
@@ -227,7 +220,7 @@
-
+
@@ -649,10 +642,10 @@
+ android:name=".provider.TemporaryStorageProvider"
+ android:authorities="org.sufficientlysecure.keychain.tempstorage"
+ android:writePermission="org.sufficientlysecure.keychain.WRITE_TEMPORARY_STORAGE"
+ android:exported="true" />
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 303db60ed..211802717 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -489,7 +489,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
* Android's Action
*/
if (Intent.ACTION_SEND.equals(action) && type != null) {
- // When sending to APG Encrypt via share menu
+ // When sending to OpenKeychain Encrypt via share menu
if ("text/plain".equals(type)) {
// Plain text
String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
index ed3be0e7f..3de617ca0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptAsymmetricFragment.java
@@ -115,6 +115,7 @@ public class EncryptAsymmetricFragment extends Fragment implements EncryptActivi
}
});
mEncryptKeyView = (EncryptKeyCompletionView) view.findViewById(R.id.recipient_list);
+ mEncryptKeyView.setThreshold(1); // Start working from first character
return view;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java
index d5264ae10..226bdf51e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java
@@ -149,6 +149,14 @@ public class AddUserIdDialogFragment extends DialogFragment implements OnEditorA
}
});
+ mName.setThreshold(1); // Start working from first character
+ mName.setAdapter(
+ new ArrayAdapter
+ (getActivity(), android.R.layout.simple_spinner_dropdown_item,
+ ContactHelper.getPossibleUserNames(getActivity())
+ )
+ );
+
alert.setNegativeButton(android.R.string.cancel, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
diff --git a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
index e9e439d65..4d82477bc 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_asymmetric_fragment.xml
@@ -1,39 +1,39 @@
+
-
+ android:padding="0dp"
+ android:layout_margin="0dp"
+ style="@android:style/Widget.EditText">
-
+ android:paddingLeft="12dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/label_asymmetric_from" />
+
+ android:id="@+id/sign"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical" />
+ android:id="@+id/recipient_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/menu/encrypt_activity.xml b/OpenKeychain/src/main/res/menu/encrypt_activity.xml
index c852fbb5c..05d85ee2a 100644
--- a/OpenKeychain/src/main/res/menu/encrypt_activity.xml
+++ b/OpenKeychain/src/main/res/menu/encrypt_activity.xml
@@ -2,6 +2,6 @@
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index fca17f837..6abca0548 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -113,12 +113,13 @@
Repeat PassphraseAlgorithmASCII Armor
+ Files: ASCII ArmorLet others know that you\'re using OpenKeychainWrites \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keysRecipientsFrom:To
- Delete After Encryption
+ Files: Delete After EncryptionDelete After DecryptionShare After EncryptionEncryption Algorithm
@@ -538,7 +539,7 @@
My Keys
- Write message here to encrypt and/or sign…
+ The message entered here will be signed using the key selected in \'From\' and encrypted for all recipients selected in \'To\'.Enter ciphertext here to decrypt and/or verify…
--
cgit v1.2.3
From c39cf197f4b1d03ff5d973441a1ffe70b2601a62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 00:54:57 +0200
Subject: button language in encrypt
---
.../java/org/sufficientlysecure/keychain/ui/widget/SectionView.java | 1 -
OpenKeychain/src/main/res/values/strings.xml | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
index cd5671801..35170fc37 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
@@ -35,7 +35,6 @@ import android.widget.TextView;
import android.widget.ImageButton;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.pgp.PgpConversionHelper;
import org.sufficientlysecure.keychain.pgp.UncachedSecretKey;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 6abca0548..5f801398b 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -55,7 +55,6 @@
From ClipboardEncrypt and save fileEncrypt and share file
- Encrypt, sign and shareSaveCancelDelete
@@ -71,7 +70,7 @@
Lookup keyShow advanced settingsHide advanced settings
- Share encrypted/signed message…
+ Encrypt and share messageView certification keyCreate keyAdd file(s)
--
cgit v1.2.3
From 7f463ae0dfcc3c0299c8ff943f8a021bfa5476f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 02:26:34 +0200
Subject: Edit key: subkey adding, not finished
---
.../keychain/ui/EditKeyFragment.java | 19 +-
.../keychain/ui/adapter/ImportKeysAdapter.java | 2 +-
.../ui/adapter/SelectKeyCursorAdapter.java | 2 +-
.../keychain/ui/adapter/SubkeysAdapter.java | 36 ++-
.../keychain/ui/adapter/SubkeysAddedAdapter.java | 323 ++++----------------
.../ui/dialog/AddSubkeyDialogFragment.java | 328 +++++++++++++++++++++
.../ui/dialog/CreateKeyDialogFragment.java | 322 --------------------
.../keychain/ui/widget/KeyEditor.java | 2 +-
.../keychain/ui/widget/SectionView.java | 36 +--
.../src/main/res/layout/create_key_dialog.xml | 130 ++++++--
.../src/main/res/layout/edit_key_key_item.xml | 2 +-
.../main/res/layout/edit_key_subkey_added_item.xml | 179 -----------
.../src/main/res/layout/import_keys_list_entry.xml | 2 +-
.../src/main/res/layout/select_key_item.xml | 2 +-
.../src/main/res/layout/view_key_subkey_item.xml | 57 ++--
15 files changed, 570 insertions(+), 872 deletions(-)
create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
delete mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java
delete mode 100644 OpenKeychain/src/main/res/layout/edit_key_subkey_added_item.xml
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index b76755bb2..2d8bdad27 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -57,6 +57,7 @@ import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter;
import org.sufficientlysecure.keychain.ui.adapter.SubkeysAddedAdapter;
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAddedAdapter;
+import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.ChangeExpiryDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyDialogFragment;
@@ -65,7 +66,6 @@ import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
-import java.util.ArrayList;
import java.util.Date;
public class EditKeyFragment extends LoaderFragment implements
@@ -453,8 +453,21 @@ public class EditKeyFragment extends LoaderFragment implements
}
private void addSubkey() {
- // default values
- mSubkeysAddedAdapter.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.SIGN_DATA, null));
+ boolean willBeMasterKey = mSubkeysAdapter.getCount() == 0
+ && mSubkeysAddedAdapter.getCount() == 0;
+
+ AddSubkeyDialogFragment addSubkeyDialogFragment =
+ AddSubkeyDialogFragment.newInstance(willBeMasterKey);
+ addSubkeyDialogFragment
+ .setOnAlgorithmSelectedListener(
+ new AddSubkeyDialogFragment.OnAlgorithmSelectedListener() {
+ @Override
+ public void onAlgorithmSelected(SaveKeyringParcel.SubkeyAdd newSubkey) {
+ mSubkeysAddedAdapter.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.SIGN_DATA, null));
+ }
+ }
+ );
+ addSubkeyDialogFragment.show(getActivity().getSupportFragmentManager(), "addSubkeyDialog");
}
private void cachePassphraseForEdit() {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java
index 7a55f9aaa..1f809cc51 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java
@@ -111,7 +111,7 @@ public class ImportKeysAdapter extends ArrayAdapter {
convertView = mInflater.inflate(R.layout.import_keys_list_entry, null);
holder.mainUserId = (TextView) convertView.findViewById(R.id.mainUserId);
holder.mainUserIdRest = (TextView) convertView.findViewById(R.id.mainUserIdRest);
- holder.keyId = (TextView) convertView.findViewById(R.id.keyId);
+ holder.keyId = (TextView) convertView.findViewById(R.id.subkey_item_key_id);
holder.fingerprint = (TextView) convertView.findViewById(R.id.view_key_fingerprint);
holder.algorithm = (TextView) convertView.findViewById(R.id.algorithm);
holder.status = (TextView) convertView.findViewById(R.id.status);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java
index e69a63c63..0e2177568 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java
@@ -152,7 +152,7 @@ abstract public class SelectKeyCursorAdapter extends CursorAdapter {
holder.view = view;
holder.mainUserId = (TextView) view.findViewById(R.id.mainUserId);
holder.mainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
- holder.keyId = (TextView) view.findViewById(R.id.keyId);
+ holder.keyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
holder.status = (TextView) view.findViewById(R.id.status);
holder.selected = (CheckBox) view.findViewById(R.id.selected);
view.setTag(holder);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
index c2a882fdb..0d8c7240d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.adapter;
import android.content.Context;
import android.content.res.ColorStateList;
import android.database.Cursor;
+import android.graphics.Typeface;
import android.support.v4.widget.CursorAdapter;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
@@ -106,15 +107,18 @@ public class SubkeysAdapter extends CursorAdapter {
@Override
public void bindView(View view, Context context, Cursor cursor) {
- TextView vKeyId = (TextView) view.findViewById(R.id.keyId);
- TextView vKeyDetails = (TextView) view.findViewById(R.id.keyDetails);
- TextView vKeyExpiry = (TextView) view.findViewById(R.id.keyExpiry);
- ImageView vMasterKeyIcon = (ImageView) view.findViewById(R.id.ic_masterKey);
- ImageView vCertifyIcon = (ImageView) view.findViewById(R.id.ic_certifyKey);
- ImageView vEncryptIcon = (ImageView) view.findViewById(R.id.ic_encryptKey);
- ImageView vSignIcon = (ImageView) view.findViewById(R.id.ic_signKey);
- ImageView vRevokedKeyIcon = (ImageView) view.findViewById(R.id.ic_revokedKey);
- ImageView vEditImage = (ImageView) view.findViewById(R.id.user_id_item_edit_image);
+ TextView vKeyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
+ TextView vKeyDetails = (TextView) view.findViewById(R.id.subkey_item_details);
+ TextView vKeyExpiry = (TextView) view.findViewById(R.id.subkey_item_expiry);
+ ImageView vCertifyIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_certify);
+ ImageView vEncryptIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_encrypt);
+ ImageView vSignIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_sign);
+ ImageView vRevokedIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_revoked);
+ ImageView vEditImage = (ImageView) view.findViewById(R.id.subkey_item_edit_image);
+
+ // not used:
+ ImageView deleteImage = (ImageView) view.findViewById(R.id.subkey_item_delete_button);
+ deleteImage.setVisibility(View.GONE);
long keyId = cursor.getLong(INDEX_KEY_ID);
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(keyId);
@@ -133,8 +137,14 @@ public class SubkeysAdapter extends CursorAdapter {
vKeyDetails.setText(algorithmStr);
}
+ boolean isMasterKey = cursor.getInt(INDEX_RANK) == 0;
+ if (isMasterKey) {
+ vKeyId.setTypeface(null, Typeface.BOLD);
+ } else {
+ vKeyId.setTypeface(null, Typeface.NORMAL);
+ }
+
// Set icons according to properties
- vMasterKeyIcon.setVisibility(cursor.getInt(INDEX_RANK) == 0 ? View.VISIBLE : View.INVISIBLE);
vCertifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
vEncryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
vSignIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
@@ -157,13 +167,13 @@ public class SubkeysAdapter extends CursorAdapter {
}
if (isRevoked) {
- vRevokedKeyIcon.setVisibility(View.VISIBLE);
+ vRevokedIcon.setVisibility(View.VISIBLE);
} else {
vKeyId.setTextColor(mDefaultTextColor);
vKeyDetails.setTextColor(mDefaultTextColor);
vKeyExpiry.setTextColor(mDefaultTextColor);
- vRevokedKeyIcon.setVisibility(View.GONE);
+ vRevokedIcon.setVisibility(View.GONE);
}
boolean isExpired;
@@ -195,7 +205,7 @@ public class SubkeysAdapter extends CursorAdapter {
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = mInflater.inflate(R.layout.view_key_subkey_item, null);
if (mDefaultTextColor == null) {
- TextView keyId = (TextView) view.findViewById(R.id.keyId);
+ TextView keyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
mDefaultTextColor = keyId.getTextColors();
}
return view;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
index 25509fee5..1ec9add68 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
@@ -17,48 +17,28 @@
package org.sufficientlysecure.keychain.ui.adapter;
-import android.annotation.TargetApi;
import android.app.Activity;
-import android.app.AlertDialog;
import android.content.Context;
-import android.content.DialogInterface;
-import android.os.Build;
-import android.text.Editable;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-import android.util.Patterns;
+import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.AdapterView;
import android.widget.ArrayAdapter;
-import android.widget.AutoCompleteTextView;
-import android.widget.EditText;
import android.widget.ImageButton;
-import android.widget.Spinner;
+import android.widget.ImageView;
import android.widget.TextView;
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.helper.ContactHelper;
+import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
-import org.sufficientlysecure.keychain.ui.dialog.CreateKeyDialogFragment;
-import org.sufficientlysecure.keychain.util.Choice;
-import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Date;
import java.util.List;
-import java.util.regex.Matcher;
public class SubkeysAddedAdapter extends ArrayAdapter {
private LayoutInflater mInflater;
private Activity mActivity;
- public interface OnAlgorithmSelectedListener {
- public void onAlgorithmSelected(Choice algorithmChoice, int keySize);
- }
-
// hold a private reference to the underlying data List
private List mData;
@@ -70,12 +50,13 @@ public class SubkeysAddedAdapter extends ArrayAdapter parent, View view, int position, long id) {
- Choice newKeyAlgorithmChoice = (Choice) holder.mAlgorithmSpinner.getSelectedItem();
- // update referenced model item
- holder.mModel.mAlgorithm = newKeyAlgorithmChoice.getId();
- }
+ holder.vKeyId = (TextView) convertView.findViewById(R.id.subkey_item_key_id);
+ holder.vKeyDetails = (TextView) convertView.findViewById(R.id.subkey_item_details);
+ holder.vKeyExpiry = (TextView) convertView.findViewById(R.id.subkey_item_expiry);
+ holder.vCertifyIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_certify);
+ holder.vEncryptIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_encrypt);
+ holder.vSignIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_sign);
+ holder.vRevokedIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_revoked);
+ holder.vDelete = (ImageButton) convertView.findViewById(R.id.subkey_item_delete_button);
+ holder.vDelete.setVisibility(View.VISIBLE); // always visible
+
+ // not used:
+ ImageView editImage = (ImageView) convertView.findViewById(R.id.subkey_item_edit_image);
+ editImage.setVisibility(View.GONE);
- @Override
- public void onNothingSelected(AdapterView> parent) {
- }
- });
-
- holder.mKeySizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- Choice newKeyAlgorithmChoice = (Choice) holder.mAlgorithmSpinner.getSelectedItem();
- int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(),
- getSelectedKeyLength(holder.mKeySizeSpinner, holder.mCustomKeyEditText));
- // update referenced model item
- holder.mModel.mKeysize = newKeySize;
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
- }
- });
+ convertView.setTag(holder);
holder.vDelete.setOnClickListener(new View.OnClickListener() {
@Override
@@ -136,83 +97,30 @@ public class SubkeysAddedAdapter extends ArrayAdapter choices = new ArrayList();
- choices.add(new Choice(Constants.choice.algorithm.dsa, mActivity.getResources().getString(
- R.string.dsa)));
- if (!wouldBeMasterKey) {
- choices.add(new Choice(Constants.choice.algorithm.elgamal, mActivity.getResources().getString(
- R.string.elgamal)));
- }
-
- choices.add(new Choice(Constants.choice.algorithm.rsa, mActivity.getResources().getString(
- R.string.rsa)));
-
- ArrayAdapter adapter = new ArrayAdapter(mActivity,
- android.R.layout.simple_spinner_item, choices);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- holder.mAlgorithmSpinner.setAdapter(adapter);
- // make RSA the default
- for (int i = 0; i < choices.size(); ++i) {
- if (choices.get(i).getId() == Constants.choice.algorithm.rsa) {
- holder.mAlgorithmSpinner.setSelection(i);
- break;
- }
- }
-
- // dynamic ArrayAdapter must be created (instead of ArrayAdapter.getFromResource), because it's content may change
- ArrayAdapter keySizeAdapter = new ArrayAdapter(mActivity, android.R.layout.simple_spinner_item,
- new ArrayList(Arrays.asList(mActivity.getResources().getStringArray(R.array.rsa_key_size_spinner_values))));
- keySizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- holder.mKeySizeSpinner.setAdapter(keySizeAdapter);
- holder.mKeySizeSpinner.setSelection(1); // Default to 4096 for the key length
-
- holder.mCustomKeyEditText.addTextChangedListener(new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- }
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- }
-
- @Override
- public void afterTextChanged(Editable s) {
-// setOkButtonAvailability(alertDialog);
- }
- });
-
- holder.mKeySizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- setCustomKeyVisibility(holder.mKeySizeSpinner, holder.mCustomKeyEditText,
- holder.mCustomKeyTextView, holder.mCustomKeyInfoTextView);
-// setOkButtonAvailability(alertDialog);
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
- }
- });
-
- holder.mAlgorithmSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- setKeyLengthSpinnerValuesForAlgorithm(((Choice) parent.getSelectedItem()).getId(),
- holder.mKeySizeSpinner, holder.mCustomKeyInfoTextView);
-
- setCustomKeyVisibility(holder.mKeySizeSpinner, holder.mCustomKeyEditText,
- holder.mCustomKeyTextView, holder.mCustomKeyInfoTextView);
-// setOkButtonAvailability(alertDialog);
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
- }
- });
+ String algorithmStr = PgpKeyHelper.getAlgorithmInfo(
+ mActivity,
+ holder.mModel.mAlgorithm,
+ holder.mModel.mKeysize
+ );
+ holder.vKeyId.setText("new");
+ holder.vKeyDetails.setText(algorithmStr);
+
+ // Set icons according to properties
+// holder.vMasterIcon.setVisibility(cursor.getInt(INDEX_RANK) == 0 ? View.VISIBLE : View.INVISIBLE);
+// holder.vCertifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
+// holder.vEncryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
+// holder.vSignIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
+// if (!cursor.isNull(INDEX_EXPIRY)) {
+// Date expiryDate = new Date(cursor.getLong(INDEX_EXPIRY) * 1000);
+// isExpired = expiryDate.before(new Date());
+//
+// holder.vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": "
+// + DateFormat.getDateFormat(context).format(expiryDate));
+// } else {
+// isExpired = false;
+//
+// holder.vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": " + context.getString(R.string.none));
+// }
//
// holder.vAddress.setText(holder.mModel.address);
// holder.vAddress.setThreshold(1); // Start working from first character
@@ -227,135 +135,4 @@ public class SubkeysAddedAdapter extends ArrayAdapterRSA
- *
for RSA algorithm, key length must be greater than 1024 (according to
- * #102). Possibility to generate keys bigger
- * than 8192 bits is currently disabled, because it's almost impossible to generate them on a mobile device (check
- * RSA key length plot and
- * Cryptographic Key Length Recommendation). Also, key length must be a
- * multiplicity of 8.
- *
ElGamal
- *
For ElGamal algorithm, supported key lengths are 1536, 2048, 3072, 4096 or 8192 bits.
- *
DSA
- *
For DSA algorithm key length must be between 512 and 1024. Also, it must me dividable by 64.
- *
- * @return correct key length, according to SpongyCastle specification. Returns -1, if key length is
- * inappropriate.
- */
- private int getProperKeyLength(int algorithmId, int currentKeyLength) {
- final int[] elGamalSupportedLengths = {1536, 2048, 3072, 4096, 8192};
- int properKeyLength = -1;
- switch (algorithmId) {
- case Constants.choice.algorithm.rsa:
- if (currentKeyLength > 1024 && currentKeyLength <= 8192) {
- properKeyLength = currentKeyLength + ((8 - (currentKeyLength % 8)) % 8);
- }
- break;
- case Constants.choice.algorithm.elgamal:
- int[] elGammalKeyDiff = new int[elGamalSupportedLengths.length];
- for (int i = 0; i < elGamalSupportedLengths.length; i++) {
- elGammalKeyDiff[i] = Math.abs(elGamalSupportedLengths[i] - currentKeyLength);
- }
- int minimalValue = Integer.MAX_VALUE;
- int minimalIndex = -1;
- for (int i = 0; i < elGammalKeyDiff.length; i++) {
- if (elGammalKeyDiff[i] <= minimalValue) {
- minimalValue = elGammalKeyDiff[i];
- minimalIndex = i;
- }
- }
- properKeyLength = elGamalSupportedLengths[minimalIndex];
- break;
- case Constants.choice.algorithm.dsa:
- if (currentKeyLength >= 512 && currentKeyLength <= 1024) {
- properKeyLength = currentKeyLength + ((64 - (currentKeyLength % 64)) % 64);
- }
- break;
- }
- return properKeyLength;
- }
-
- // TODO: make this an error message on the field
-// private boolean setOkButtonAvailability(AlertDialog alertDialog) {
-// final Choice selectedAlgorithm = (Choice) mAlgorithmSpinner.getSelectedItem();
-// final int selectedKeySize = getSelectedKeyLength(); //Integer.parseInt((String) mKeySizeSpinner.getSelectedItem());
-// final int properKeyLength = getProperKeyLength(selectedAlgorithm.getId(), selectedKeySize);
-// alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(properKeyLength > 0);
-// }
-
- private void setCustomKeyVisibility(Spinner keySizeSpinner, EditText customkeyedittext, TextView customKeyTextView, TextView customKeyInfoTextView) {
- final String selectedItemString = (String) keySizeSpinner.getSelectedItem();
- final String customLengthString = mActivity.getResources().getString(R.string.key_size_custom);
- final boolean customSelected = customLengthString.equals(selectedItemString);
- final int visibility = customSelected ? View.VISIBLE : View.GONE;
-
- customkeyedittext.setVisibility(visibility);
- customKeyTextView.setVisibility(visibility);
- customKeyInfoTextView.setVisibility(visibility);
-
- // hide keyboard after setting visibility to gone
- if (visibility == View.GONE) {
- InputMethodManager imm = (InputMethodManager)
- mActivity.getSystemService(mActivity.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(customkeyedittext.getWindowToken(), 0);
- }
- }
-
- private void setKeyLengthSpinnerValuesForAlgorithm(int algorithmId, Spinner keySizeSpinner, TextView customKeyInfoTextView) {
- final ArrayAdapter keySizeAdapter = (ArrayAdapter) keySizeSpinner.getAdapter();
- final Object selectedItem = keySizeSpinner.getSelectedItem();
- keySizeAdapter.clear();
- switch (algorithmId) {
- case Constants.choice.algorithm.rsa:
- replaceArrayAdapterContent(keySizeAdapter, R.array.rsa_key_size_spinner_values);
- customKeyInfoTextView.setText(mActivity.getResources().getString(R.string.key_size_custom_info_rsa));
- break;
- case Constants.choice.algorithm.elgamal:
- replaceArrayAdapterContent(keySizeAdapter, R.array.elgamal_key_size_spinner_values);
- customKeyInfoTextView.setText(""); // ElGamal does not support custom key length
- break;
- case Constants.choice.algorithm.dsa:
- replaceArrayAdapterContent(keySizeAdapter, R.array.dsa_key_size_spinner_values);
- customKeyInfoTextView.setText(mActivity.getResources().getString(R.string.key_size_custom_info_dsa));
- break;
- }
- keySizeAdapter.notifyDataSetChanged();
-
- // when switching algorithm, try to select same key length as before
- for (int i = 0; i < keySizeAdapter.getCount(); i++) {
- if (selectedItem.equals(keySizeAdapter.getItem(i))) {
- keySizeSpinner.setSelection(i);
- break;
- }
- }
- }
-
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- private void replaceArrayAdapterContent(ArrayAdapter arrayAdapter, int stringArrayResourceId) {
- final String[] spinnerValuesStringArray = mActivity.getResources().getStringArray(stringArrayResourceId);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- arrayAdapter.addAll(spinnerValuesStringArray);
- } else {
- for (final String value : spinnerValuesStringArray) {
- arrayAdapter.add(value);
- }
- }
- }
-
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
new file mode 100644
index 000000000..2031eae2a
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2012-2013 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package org.sufficientlysecure.keychain.ui.dialog;
+
+import android.annotation.TargetApi;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v4.app.DialogFragment;
+import android.support.v4.app.FragmentActivity;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import org.spongycastle.bcpg.sig.KeyFlags;
+import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
+import org.sufficientlysecure.keychain.util.Choice;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+public class AddSubkeyDialogFragment extends DialogFragment {
+
+ public interface OnAlgorithmSelectedListener {
+ public void onAlgorithmSelected(SaveKeyringParcel.SubkeyAdd newSubkey);
+ }
+
+ private static final String ARG_WILL_BE_MASTER_KEY = "will_be_master_key";
+
+ private OnAlgorithmSelectedListener mAlgorithmSelectedListener;
+ private Spinner mAlgorithmSpinner;
+ private Spinner mKeySizeSpinner;
+ private TextView mCustomKeyTextView;
+ private EditText mCustomKeyEditText;
+ private TextView mCustomKeyInfoTextView;
+
+ public void setOnAlgorithmSelectedListener(OnAlgorithmSelectedListener listener) {
+ mAlgorithmSelectedListener = listener;
+ }
+
+ public static AddSubkeyDialogFragment newInstance(boolean willBeMasterKey) {
+ AddSubkeyDialogFragment frag = new AddSubkeyDialogFragment();
+ Bundle args = new Bundle();
+
+ args.putBoolean(ARG_WILL_BE_MASTER_KEY, willBeMasterKey);
+
+ frag.setArguments(args);
+
+ return frag;
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ final FragmentActivity context = getActivity();
+ final LayoutInflater mInflater;
+
+ final boolean willBeMasterKey = getArguments().getBoolean(ARG_WILL_BE_MASTER_KEY);
+ mInflater = context.getLayoutInflater();
+
+ CustomAlertDialogBuilder dialog = new CustomAlertDialogBuilder(context);
+
+ View view = mInflater.inflate(R.layout.create_key_dialog, null);
+ dialog.setView(view);
+ dialog.setTitle(R.string.title_create_key);
+
+ mAlgorithmSpinner = (Spinner) view.findViewById(R.id.create_key_algorithm);
+ ArrayList choices = new ArrayList();
+ choices.add(new Choice(Constants.choice.algorithm.dsa, getResources().getString(
+ R.string.dsa)));
+ if (!willBeMasterKey) {
+ choices.add(new Choice(Constants.choice.algorithm.elgamal, getResources().getString(
+ R.string.elgamal)));
+ }
+
+ choices.add(new Choice(Constants.choice.algorithm.rsa, getResources().getString(
+ R.string.rsa)));
+
+ ArrayAdapter adapter = new ArrayAdapter(context,
+ android.R.layout.simple_spinner_item, choices);
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ mAlgorithmSpinner.setAdapter(adapter);
+ // make RSA the default
+ for (int i = 0; i < choices.size(); ++i) {
+ if (choices.get(i).getId() == Constants.choice.algorithm.rsa) {
+ mAlgorithmSpinner.setSelection(i);
+ break;
+ }
+ }
+
+ mKeySizeSpinner = (Spinner) view.findViewById(R.id.create_key_size);
+ // dynamic ArrayAdapter must be created (instead of ArrayAdapter.getFromResource), because it's content may change
+ ArrayAdapter keySizeAdapter = new ArrayAdapter(context, android.R.layout.simple_spinner_item,
+ new ArrayList(Arrays.asList(getResources().getStringArray(R.array.rsa_key_size_spinner_values))));
+ keySizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ mKeySizeSpinner.setAdapter(keySizeAdapter);
+ mKeySizeSpinner.setSelection(1); // Default to 4096 for the key length
+
+ mCustomKeyTextView = (TextView) view.findViewById(R.id.custom_key_size_label);
+ mCustomKeyEditText = (EditText) view.findViewById(R.id.custom_key_size_input);
+ mCustomKeyInfoTextView = (TextView) view.findViewById(R.id.custom_key_size_info);
+
+ dialog.setPositiveButton(android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface di, int id) {
+ di.dismiss();
+ Choice newKeyAlgorithmChoice = (Choice) mAlgorithmSpinner.getSelectedItem();
+ int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(), getSelectedKeyLength());
+ SaveKeyringParcel.SubkeyAdd newSubkey = new SaveKeyringParcel.SubkeyAdd(
+ newKeyAlgorithmChoice.getId(),
+ newKeySize,
+ KeyFlags.SIGN_DATA, //TODO
+ null
+ );
+ mAlgorithmSelectedListener.onAlgorithmSelected(newSubkey);
+ }
+ }
+ );
+
+ dialog.setCancelable(true);
+ dialog.setNegativeButton(android.R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface di, int id) {
+ di.dismiss();
+ }
+ });
+
+ final AlertDialog alertDialog = dialog.show();
+
+ mCustomKeyEditText.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ setOkButtonAvailability(alertDialog);
+ }
+ });
+
+ mKeySizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ setCustomKeyVisibility();
+ setOkButtonAvailability(alertDialog);
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+
+ mAlgorithmSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ setKeyLengthSpinnerValuesForAlgorithm(((Choice) parent.getSelectedItem()).getId());
+
+ setCustomKeyVisibility();
+ setOkButtonAvailability(alertDialog);
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+
+ return alertDialog;
+ }
+
+ private int getSelectedKeyLength() {
+ final String selectedItemString = (String) mKeySizeSpinner.getSelectedItem();
+ final String customLengthString = getResources().getString(R.string.key_size_custom);
+ final boolean customSelected = customLengthString.equals(selectedItemString);
+ String keyLengthString = customSelected ? mCustomKeyEditText.getText().toString() : selectedItemString;
+ int keySize;
+ try {
+ keySize = Integer.parseInt(keyLengthString);
+ } catch (NumberFormatException e) {
+ keySize = 0;
+ }
+ return keySize;
+ }
+
+ /**
+ *
RSA
+ *
for RSA algorithm, key length must be greater than 1024 (according to
+ * #102). Possibility to generate keys bigger
+ * than 8192 bits is currently disabled, because it's almost impossible to generate them on a mobile device (check
+ * RSA key length plot and
+ * Cryptographic Key Length Recommendation). Also, key length must be a
+ * multiplicity of 8.
+ *
ElGamal
+ *
For ElGamal algorithm, supported key lengths are 1536, 2048, 3072, 4096 or 8192 bits.
+ *
DSA
+ *
For DSA algorithm key length must be between 512 and 1024. Also, it must me dividable by 64.
+ *
+ * @return correct key length, according to SpongyCastle specification. Returns -1, if key length is
+ * inappropriate.
+ */
+ private int getProperKeyLength(int algorithmId, int currentKeyLength) {
+ final int[] elGamalSupportedLengths = {1536, 2048, 3072, 4096, 8192};
+ int properKeyLength = -1;
+ switch (algorithmId) {
+ case Constants.choice.algorithm.rsa:
+ if (currentKeyLength > 1024 && currentKeyLength <= 8192) {
+ properKeyLength = currentKeyLength + ((8 - (currentKeyLength % 8)) % 8);
+ }
+ break;
+ case Constants.choice.algorithm.elgamal:
+ int[] elGammalKeyDiff = new int[elGamalSupportedLengths.length];
+ for (int i = 0; i < elGamalSupportedLengths.length; i++) {
+ elGammalKeyDiff[i] = Math.abs(elGamalSupportedLengths[i] - currentKeyLength);
+ }
+ int minimalValue = Integer.MAX_VALUE;
+ int minimalIndex = -1;
+ for (int i = 0; i < elGammalKeyDiff.length; i++) {
+ if (elGammalKeyDiff[i] <= minimalValue) {
+ minimalValue = elGammalKeyDiff[i];
+ minimalIndex = i;
+ }
+ }
+ properKeyLength = elGamalSupportedLengths[minimalIndex];
+ break;
+ case Constants.choice.algorithm.dsa:
+ if (currentKeyLength >= 512 && currentKeyLength <= 1024) {
+ properKeyLength = currentKeyLength + ((64 - (currentKeyLength % 64)) % 64);
+ }
+ break;
+ }
+ return properKeyLength;
+ }
+
+ private void setOkButtonAvailability(AlertDialog alertDialog) {
+ final Choice selectedAlgorithm = (Choice) mAlgorithmSpinner.getSelectedItem();
+ final int selectedKeySize = getSelectedKeyLength(); //Integer.parseInt((String) mKeySizeSpinner.getSelectedItem());
+ final int properKeyLength = getProperKeyLength(selectedAlgorithm.getId(), selectedKeySize);
+ alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(properKeyLength > 0);
+ }
+
+ private void setCustomKeyVisibility() {
+ final String selectedItemString = (String) mKeySizeSpinner.getSelectedItem();
+ final String customLengthString = getResources().getString(R.string.key_size_custom);
+ final boolean customSelected = customLengthString.equals(selectedItemString);
+ final int visibility = customSelected ? View.VISIBLE : View.GONE;
+
+ mCustomKeyEditText.setVisibility(visibility);
+ mCustomKeyTextView.setVisibility(visibility);
+ mCustomKeyInfoTextView.setVisibility(visibility);
+
+ // hide keyboard after setting visibility to gone
+ if (visibility == View.GONE) {
+ InputMethodManager imm = (InputMethodManager)
+ getActivity().getSystemService(getActivity().INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(mCustomKeyEditText.getWindowToken(), 0);
+ }
+ }
+
+ private void setKeyLengthSpinnerValuesForAlgorithm(int algorithmId) {
+ final ArrayAdapter keySizeAdapter = (ArrayAdapter) mKeySizeSpinner.getAdapter();
+ final Object selectedItem = mKeySizeSpinner.getSelectedItem();
+ keySizeAdapter.clear();
+ switch (algorithmId) {
+ case Constants.choice.algorithm.rsa:
+ replaceArrayAdapterContent(keySizeAdapter, R.array.rsa_key_size_spinner_values);
+ mCustomKeyInfoTextView.setText(getResources().getString(R.string.key_size_custom_info_rsa));
+ break;
+ case Constants.choice.algorithm.elgamal:
+ replaceArrayAdapterContent(keySizeAdapter, R.array.elgamal_key_size_spinner_values);
+ mCustomKeyInfoTextView.setText(""); // ElGamal does not support custom key length
+ break;
+ case Constants.choice.algorithm.dsa:
+ replaceArrayAdapterContent(keySizeAdapter, R.array.dsa_key_size_spinner_values);
+ mCustomKeyInfoTextView.setText(getResources().getString(R.string.key_size_custom_info_dsa));
+ break;
+ }
+ keySizeAdapter.notifyDataSetChanged();
+
+ // when switching algorithm, try to select same key length as before
+ for (int i = 0; i < keySizeAdapter.getCount(); i++) {
+ if (selectedItem.equals(keySizeAdapter.getItem(i))) {
+ mKeySizeSpinner.setSelection(i);
+ break;
+ }
+ }
+ }
+
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ private void replaceArrayAdapterContent(ArrayAdapter arrayAdapter, int stringArrayResourceId) {
+ final String[] spinnerValuesStringArray = getResources().getStringArray(stringArrayResourceId);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
+ arrayAdapter.addAll(spinnerValuesStringArray);
+ } else {
+ for (final String value : spinnerValuesStringArray) {
+ arrayAdapter.add(value);
+ }
+ }
+ }
+
+}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java
deleted file mode 100644
index 920743a9b..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (C) 2012-2013 Dominik Schürmann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.sufficientlysecure.keychain.ui.dialog;
-
-import android.annotation.TargetApi;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.os.Build;
-import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.FragmentActivity;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.EditText;
-import android.widget.Spinner;
-import android.widget.TextView;
-
-import org.sufficientlysecure.keychain.Constants;
-import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.util.Choice;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-public class CreateKeyDialogFragment extends DialogFragment {
-
- public interface OnAlgorithmSelectedListener {
- public void onAlgorithmSelected(Choice algorithmChoice, int keySize);
- }
-
- private static final String ARG_EDITOR_CHILD_COUNT = "child_count";
-
- private OnAlgorithmSelectedListener mAlgorithmSelectedListener;
- private Spinner mAlgorithmSpinner;
- private Spinner mKeySizeSpinner;
- private TextView mCustomKeyTextView;
- private EditText mCustomKeyEditText;
- private TextView mCustomKeyInfoTextView;
-
- public void setOnAlgorithmSelectedListener(OnAlgorithmSelectedListener listener) {
- mAlgorithmSelectedListener = listener;
- }
-
- public static CreateKeyDialogFragment newInstance(int mEditorChildCount) {
- CreateKeyDialogFragment frag = new CreateKeyDialogFragment();
- Bundle args = new Bundle();
-
- args.putInt(ARG_EDITOR_CHILD_COUNT, mEditorChildCount);
-
- frag.setArguments(args);
-
- return frag;
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- final FragmentActivity context = getActivity();
- final LayoutInflater mInflater;
-
- final int childCount = getArguments().getInt(ARG_EDITOR_CHILD_COUNT);
- mInflater = context.getLayoutInflater();
-
- CustomAlertDialogBuilder dialog = new CustomAlertDialogBuilder(context);
-
- View view = mInflater.inflate(R.layout.create_key_dialog, null);
- dialog.setView(view);
- dialog.setTitle(R.string.title_create_key);
-
- boolean wouldBeMasterKey = (childCount == 0);
-
- mAlgorithmSpinner = (Spinner) view.findViewById(R.id.create_key_algorithm);
- ArrayList choices = new ArrayList();
- choices.add(new Choice(Constants.choice.algorithm.dsa, getResources().getString(
- R.string.dsa)));
- if (!wouldBeMasterKey) {
- choices.add(new Choice(Constants.choice.algorithm.elgamal, getResources().getString(
- R.string.elgamal)));
- }
-
- choices.add(new Choice(Constants.choice.algorithm.rsa, getResources().getString(
- R.string.rsa)));
-
- ArrayAdapter adapter = new ArrayAdapter(context,
- android.R.layout.simple_spinner_item, choices);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- mAlgorithmSpinner.setAdapter(adapter);
- // make RSA the default
- for (int i = 0; i < choices.size(); ++i) {
- if (choices.get(i).getId() == Constants.choice.algorithm.rsa) {
- mAlgorithmSpinner.setSelection(i);
- break;
- }
- }
-
- mKeySizeSpinner = (Spinner) view.findViewById(R.id.create_key_size);
- // dynamic ArrayAdapter must be created (instead of ArrayAdapter.getFromResource), because it's content may change
- ArrayAdapter keySizeAdapter = new ArrayAdapter(context, android.R.layout.simple_spinner_item,
- new ArrayList(Arrays.asList(getResources().getStringArray(R.array.rsa_key_size_spinner_values))));
- keySizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- mKeySizeSpinner.setAdapter(keySizeAdapter);
- mKeySizeSpinner.setSelection(1); // Default to 4096 for the key length
-
- mCustomKeyTextView = (TextView) view.findViewById(R.id.custom_key_size_label);
- mCustomKeyEditText = (EditText) view.findViewById(R.id.custom_key_size_input);
- mCustomKeyInfoTextView = (TextView) view.findViewById(R.id.custom_key_size_info);
-
- dialog.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface di, int id) {
- di.dismiss();
- Choice newKeyAlgorithmChoice = (Choice) mAlgorithmSpinner.getSelectedItem();
- int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(), getSelectedKeyLength());
- mAlgorithmSelectedListener.onAlgorithmSelected(newKeyAlgorithmChoice, newKeySize);
- }
- }
- );
-
- dialog.setCancelable(true);
- dialog.setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface di, int id) {
- di.dismiss();
- }
- });
-
- final AlertDialog alertDialog = dialog.show();
-
- mCustomKeyEditText.addTextChangedListener(new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- }
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- }
-
- @Override
- public void afterTextChanged(Editable s) {
- setOkButtonAvailability(alertDialog);
- }
- });
-
- mKeySizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- setCustomKeyVisibility();
- setOkButtonAvailability(alertDialog);
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
- }
- });
-
- mAlgorithmSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- setKeyLengthSpinnerValuesForAlgorithm(((Choice) parent.getSelectedItem()).getId());
-
- setCustomKeyVisibility();
- setOkButtonAvailability(alertDialog);
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
- }
- });
-
- return alertDialog;
- }
-
- private int getSelectedKeyLength() {
- final String selectedItemString = (String) mKeySizeSpinner.getSelectedItem();
- final String customLengthString = getResources().getString(R.string.key_size_custom);
- final boolean customSelected = customLengthString.equals(selectedItemString);
- String keyLengthString = customSelected ? mCustomKeyEditText.getText().toString() : selectedItemString;
- int keySize;
- try {
- keySize = Integer.parseInt(keyLengthString);
- } catch (NumberFormatException e) {
- keySize = 0;
- }
- return keySize;
- }
-
- /**
- *
RSA
- *
for RSA algorithm, key length must be greater than 1024 (according to
- * #102). Possibility to generate keys bigger
- * than 8192 bits is currently disabled, because it's almost impossible to generate them on a mobile device (check
- * RSA key length plot and
- * Cryptographic Key Length Recommendation). Also, key length must be a
- * multiplicity of 8.
- *
ElGamal
- *
For ElGamal algorithm, supported key lengths are 1536, 2048, 3072, 4096 or 8192 bits.
- *
DSA
- *
For DSA algorithm key length must be between 512 and 1024. Also, it must me dividable by 64.
- *
- * @return correct key length, according to SpongyCastle specification. Returns -1, if key length is
- * inappropriate.
- */
- private int getProperKeyLength(int algorithmId, int currentKeyLength) {
- final int[] elGamalSupportedLengths = {1536, 2048, 3072, 4096, 8192};
- int properKeyLength = -1;
- switch (algorithmId) {
- case Constants.choice.algorithm.rsa:
- if (currentKeyLength > 1024 && currentKeyLength <= 8192) {
- properKeyLength = currentKeyLength + ((8 - (currentKeyLength % 8)) % 8);
- }
- break;
- case Constants.choice.algorithm.elgamal:
- int[] elGammalKeyDiff = new int[elGamalSupportedLengths.length];
- for (int i = 0; i < elGamalSupportedLengths.length; i++) {
- elGammalKeyDiff[i] = Math.abs(elGamalSupportedLengths[i] - currentKeyLength);
- }
- int minimalValue = Integer.MAX_VALUE;
- int minimalIndex = -1;
- for (int i = 0; i < elGammalKeyDiff.length; i++) {
- if (elGammalKeyDiff[i] <= minimalValue) {
- minimalValue = elGammalKeyDiff[i];
- minimalIndex = i;
- }
- }
- properKeyLength = elGamalSupportedLengths[minimalIndex];
- break;
- case Constants.choice.algorithm.dsa:
- if (currentKeyLength >= 512 && currentKeyLength <= 1024) {
- properKeyLength = currentKeyLength + ((64 - (currentKeyLength % 64)) % 64);
- }
- break;
- }
- return properKeyLength;
- }
-
- private void setOkButtonAvailability(AlertDialog alertDialog) {
- final Choice selectedAlgorithm = (Choice) mAlgorithmSpinner.getSelectedItem();
- final int selectedKeySize = getSelectedKeyLength(); //Integer.parseInt((String) mKeySizeSpinner.getSelectedItem());
- final int properKeyLength = getProperKeyLength(selectedAlgorithm.getId(), selectedKeySize);
- alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(properKeyLength > 0);
- }
-
- private void setCustomKeyVisibility() {
- final String selectedItemString = (String) mKeySizeSpinner.getSelectedItem();
- final String customLengthString = getResources().getString(R.string.key_size_custom);
- final boolean customSelected = customLengthString.equals(selectedItemString);
- final int visibility = customSelected ? View.VISIBLE : View.GONE;
-
- mCustomKeyEditText.setVisibility(visibility);
- mCustomKeyTextView.setVisibility(visibility);
- mCustomKeyInfoTextView.setVisibility(visibility);
-
- // hide keyboard after setting visibility to gone
- if (visibility == View.GONE) {
- InputMethodManager imm = (InputMethodManager)
- getActivity().getSystemService(getActivity().INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(mCustomKeyEditText.getWindowToken(), 0);
- }
- }
-
- private void setKeyLengthSpinnerValuesForAlgorithm(int algorithmId) {
- final ArrayAdapter keySizeAdapter = (ArrayAdapter) mKeySizeSpinner.getAdapter();
- final Object selectedItem = mKeySizeSpinner.getSelectedItem();
- keySizeAdapter.clear();
- switch (algorithmId) {
- case Constants.choice.algorithm.rsa:
- replaceArrayAdapterContent(keySizeAdapter, R.array.rsa_key_size_spinner_values);
- mCustomKeyInfoTextView.setText(getResources().getString(R.string.key_size_custom_info_rsa));
- break;
- case Constants.choice.algorithm.elgamal:
- replaceArrayAdapterContent(keySizeAdapter, R.array.elgamal_key_size_spinner_values);
- mCustomKeyInfoTextView.setText(""); // ElGamal does not support custom key length
- break;
- case Constants.choice.algorithm.dsa:
- replaceArrayAdapterContent(keySizeAdapter, R.array.dsa_key_size_spinner_values);
- mCustomKeyInfoTextView.setText(getResources().getString(R.string.key_size_custom_info_dsa));
- break;
- }
- keySizeAdapter.notifyDataSetChanged();
-
- // when switching algorithm, try to select same key length as before
- for (int i = 0; i < keySizeAdapter.getCount(); i++) {
- if (selectedItem.equals(keySizeAdapter.getItem(i))) {
- mKeySizeSpinner.setSelection(i);
- break;
- }
- }
- }
-
- @TargetApi(Build.VERSION_CODES.HONEYCOMB)
- private void replaceArrayAdapterContent(ArrayAdapter arrayAdapter, int stringArrayResourceId) {
- final String[] spinnerValuesStringArray = getResources().getStringArray(stringArrayResourceId);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- arrayAdapter.addAll(spinnerValuesStringArray);
- } else {
- for (final String value : spinnerValuesStringArray) {
- arrayAdapter.add(value);
- }
- }
- }
-
-}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java
index c23b4c3ff..484ce8e47 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java
@@ -120,7 +120,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
setAlwaysDrawnWithCacheEnabled(true);
mAlgorithm = (TextView) findViewById(R.id.algorithm);
- mKeyId = (TextView) findViewById(R.id.keyId);
+ mKeyId = (TextView) findViewById(R.id.subkey_item_key_id);
mCreationDate = (TextView) findViewById(R.id.creation);
mExpiryDateButton = (Button) findViewById(R.id.expiry);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
index 35170fc37..190db1fe3 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
@@ -17,13 +17,7 @@
package org.sufficientlysecure.keychain.ui.widget;
-import android.app.ProgressDialog;
import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.Messenger;
import android.support.v7.app.ActionBarActivity;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -36,10 +30,8 @@ import android.widget.ImageButton;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.UncachedSecretKey;
-import org.sufficientlysecure.keychain.service.KeychainIntentService;
-import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
-import org.sufficientlysecure.keychain.ui.dialog.CreateKeyDialogFragment;
+import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment;
import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener;
import org.sufficientlysecure.keychain.util.Choice;
@@ -280,19 +272,19 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
}
case TYPE_KEY: {
- CreateKeyDialogFragment mCreateKeyDialogFragment =
- CreateKeyDialogFragment.newInstance(mEditors.getChildCount());
- mCreateKeyDialogFragment
- .setOnAlgorithmSelectedListener(
- new CreateKeyDialogFragment.OnAlgorithmSelectedListener() {
- @Override
- public void onAlgorithmSelected(Choice algorithmChoice, int keySize) {
- mNewKeyAlgorithmChoice = algorithmChoice;
- mNewKeySize = keySize;
- createKey();
- }
- });
- mCreateKeyDialogFragment.show(mActivity.getSupportFragmentManager(), "createKeyDialog");
+// AddSubkeyDialogFragment mCreateKeyDialogFragment =
+// AddSubkeyDialogFragment.newInstance(mEditors.getChildCount());
+// mCreateKeyDialogFragment
+// .setOnAlgorithmSelectedListener(
+// new AddSubkeyDialogFragment.OnAlgorithmSelectedListener() {
+// @Override
+// public void onAlgorithmSelected(Choice algorithmChoice, int keySize) {
+// mNewKeyAlgorithmChoice = algorithmChoice;
+// mNewKeySize = keySize;
+// createKey();
+// }
+// });
+// mCreateKeyDialogFragment.show(mActivity.getSupportFragmentManager(), "createKeyDialog");
break;
}
diff --git a/OpenKeychain/src/main/res/layout/create_key_dialog.xml b/OpenKeychain/src/main/res/layout/create_key_dialog.xml
index 16eef08c4..31c5fbefc 100644
--- a/OpenKeychain/src/main/res/layout/create_key_dialog.xml
+++ b/OpenKeychain/src/main/res/layout/create_key_dialog.xml
@@ -1,28 +1,104 @@
+ android:layout_height="match_parent">
+ android:stretchColumns="1">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ android:text="@string/key_creation_el_gamal_info" />
@@ -58,28 +134,28 @@
+ android:id="@+id/custom_key_size_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:padding="4dp"
+ android:text="@string/key_size_custom_info"
+ android:visibility="gone" />
+ android:id="@+id/custom_key_size_input"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:inputType="number"
+ android:visibility="gone" />
+ android:id="@+id/custom_key_size_info"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:padding="4dp" />
diff --git a/OpenKeychain/src/main/res/layout/edit_key_key_item.xml b/OpenKeychain/src/main/res/layout/edit_key_key_item.xml
index 81fb643ab..65e2c82fb 100644
--- a/OpenKeychain/src/main/res/layout/edit_key_key_item.xml
+++ b/OpenKeychain/src/main/res/layout/edit_key_key_item.xml
@@ -27,7 +27,7 @@
android:text="@string/label_key_id" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/import_keys_list_entry.xml b/OpenKeychain/src/main/res/layout/import_keys_list_entry.xml
index 56f34e2eb..773250dc6 100644
--- a/OpenKeychain/src/main/res/layout/import_keys_list_entry.xml
+++ b/OpenKeychain/src/main/res/layout/import_keys_list_entry.xml
@@ -100,7 +100,7 @@
android:orientation="vertical" />
-
-
-
+ android:layout_alignParentEnd="true">
+
+
+
+
+
+
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp">
Date: Mon, 4 Aug 2014 02:31:54 +0200
Subject: Remove old edit key stuff
---
.../keychain/ui/widget/KeyEditor.java | 380 -------------------
.../keychain/ui/widget/SectionView.java | 419 ---------------------
.../keychain/ui/widget/UserIdEditor.java | 267 -------------
.../src/main/res/layout/edit_key_key_item.xml | 172 ---------
.../src/main/res/layout/edit_key_section.xml | 41 --
.../src/main/res/layout/edit_key_user_id_item.xml | 96 -----
6 files changed, 1375 deletions(-)
delete mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java
delete mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
delete mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/UserIdEditor.java
delete mode 100644 OpenKeychain/src/main/res/layout/edit_key_key_item.xml
delete mode 100644 OpenKeychain/src/main/res/layout/edit_key_section.xml
delete mode 100644 OpenKeychain/src/main/res/layout/edit_key_user_id_item.xml
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java
deleted file mode 100644
index 484ce8e47..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (C) 2014 Dominik Schürmann
- * Copyright (C) 2010-2014 Thialfihar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.sufficientlysecure.keychain.ui.widget;
-
-import android.annotation.TargetApi;
-import android.app.DatePickerDialog;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.text.format.DateUtils;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.CheckBox;
-import android.widget.CompoundButton;
-import android.widget.DatePicker;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.TableLayout;
-import android.widget.TableRow;
-import android.widget.TextView;
-import android.widget.Button;
-
-import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
-import org.sufficientlysecure.keychain.pgp.UncachedSecretKey;
-
-import java.text.DateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
- private UncachedSecretKey mKey;
-
- private EditorListener mEditorListener = null;
-
- private boolean mIsMasterKey;
- ImageButton mDeleteButton;
- TextView mAlgorithm;
- TextView mKeyId;
- TextView mCreationDate;
- Button mExpiryDateButton;
- Calendar mCreatedDate;
- Calendar mExpiryDate;
- Calendar mOriginalExpiryDate = null;
- CheckBox mChkCertify;
- CheckBox mChkSign;
- CheckBox mChkEncrypt;
- CheckBox mChkAuthenticate;
- int mUsage;
- int mOriginalUsage;
- boolean mIsNewKey;
-
- private CheckBox.OnCheckedChangeListener mCheckChanged = new CheckBox.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
- };
-
-
- private int mDatePickerResultCount = 0;
- private DatePickerDialog.OnDateSetListener mExpiryDateSetListener =
- new DatePickerDialog.OnDateSetListener() {
- public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
- // Note: Ignore results after the first one - android sends multiples.
- if (mDatePickerResultCount++ == 0) {
- GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
- date.set(year, monthOfYear, dayOfMonth);
- if (mOriginalExpiryDate != null) {
- long numDays = (date.getTimeInMillis() / 86400000) -
- (mOriginalExpiryDate.getTimeInMillis() / 86400000);
- if (numDays == 0) {
- setExpiryDate(mOriginalExpiryDate);
- } else {
- setExpiryDate(date);
- }
- } else {
- setExpiryDate(date);
- }
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
- }
- };
-
- public KeyEditor(Context context) {
- super(context);
- }
-
- public KeyEditor(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- @Override
- protected void onFinishInflate() {
- setDrawingCacheEnabled(true);
- setAlwaysDrawnWithCacheEnabled(true);
-
- mAlgorithm = (TextView) findViewById(R.id.algorithm);
- mKeyId = (TextView) findViewById(R.id.subkey_item_key_id);
- mCreationDate = (TextView) findViewById(R.id.creation);
- mExpiryDateButton = (Button) findViewById(R.id.expiry);
-
- mDeleteButton = (ImageButton) findViewById(R.id.delete);
- mDeleteButton.setOnClickListener(this);
- mChkCertify = (CheckBox) findViewById(R.id.chkCertify);
- mChkCertify.setOnCheckedChangeListener(mCheckChanged);
- mChkSign = (CheckBox) findViewById(R.id.chkSign);
- mChkSign.setOnCheckedChangeListener(mCheckChanged);
- mChkEncrypt = (CheckBox) findViewById(R.id.chkEncrypt);
- mChkEncrypt.setOnCheckedChangeListener(mCheckChanged);
- mChkAuthenticate = (CheckBox) findViewById(R.id.chkAuthenticate);
- mChkAuthenticate.setOnCheckedChangeListener(mCheckChanged);
-
- setExpiryDate(null);
-
- mExpiryDateButton.setOnClickListener(new OnClickListener() {
- @TargetApi(11)
- public void onClick(View v) {
- Calendar expiryDate = mExpiryDate;
- if (expiryDate == null) {
- expiryDate = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- }
- /*
- * Using custom DatePickerDialog which overrides the setTitle because
- * the DatePickerDialog title is buggy (unix warparound bug).
- * See: https://code.google.com/p/android/issues/detail?id=49066
- */
- DatePickerDialog dialog = new ExpiryDatePickerDialog(getContext(),
- mExpiryDateSetListener, expiryDate.get(Calendar.YEAR), expiryDate.get(Calendar.MONTH),
- expiryDate.get(Calendar.DAY_OF_MONTH));
- mDatePickerResultCount = 0;
- dialog.setCancelable(true);
- dialog.setButton(Dialog.BUTTON_NEGATIVE,
- getContext().getString(R.string.btn_no_date),
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- // Note: Ignore results after the first one - android sends multiples.
- if (mDatePickerResultCount++ == 0) {
- setExpiryDate(null);
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
- }
- });
-
- // setCalendarViewShown() is supported from API 11 onwards.
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- // Hide calendarView in tablets because of the unix warparound bug.
- dialog.getDatePicker().setCalendarViewShown(false);
- }
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
-
- // will crash with IllegalArgumentException if we set a min date
- // that is not before expiry
- if (mCreatedDate != null && mCreatedDate.before(expiryDate)) {
- dialog.getDatePicker()
- .setMinDate(
- mCreatedDate.getTime().getTime() + DateUtils.DAY_IN_MILLIS);
- } else {
- // When created date isn't available
- dialog.getDatePicker().setMinDate(expiryDate.getTime().getTime() + DateUtils.DAY_IN_MILLIS);
- }
- }
-
- dialog.show();
- }
- });
-
- super.onFinishInflate();
- }
-
- public void setCanBeEdited(boolean canBeEdited) {
- if (!canBeEdited) {
- mDeleteButton.setVisibility(View.INVISIBLE);
- mExpiryDateButton.setEnabled(false);
- mChkSign.setEnabled(false); //certify is always disabled
- mChkEncrypt.setEnabled(false);
- mChkAuthenticate.setEnabled(false);
- }
- }
-
- public void setValue(UncachedSecretKey key, boolean isMasterKey, int usage, boolean isNewKey) {
- mKey = key;
-
- mIsMasterKey = isMasterKey;
- if (mIsMasterKey) {
- mDeleteButton.setVisibility(View.INVISIBLE);
- }
-
- mAlgorithm.setText(PgpKeyHelper.getAlgorithmInfo(getContext(), key.getAlgorithm()));
- String keyIdStr = PgpKeyHelper.convertKeyIdToHex(key.getKeyId());
- mKeyId.setText(keyIdStr);
-
- boolean isElGamalKey = (key.isElGamalEncrypt());
- boolean isDSAKey = (key.isDSA());
- if (isElGamalKey) {
- mChkSign.setVisibility(View.INVISIBLE);
- TableLayout table = (TableLayout) findViewById(R.id.table_keylayout);
- TableRow row = (TableRow) findViewById(R.id.row_sign);
- table.removeView(row);
- }
- if (isDSAKey) {
- mChkEncrypt.setVisibility(View.INVISIBLE);
- TableLayout table = (TableLayout) findViewById(R.id.table_keylayout);
- TableRow row = (TableRow) findViewById(R.id.row_encrypt);
- table.removeView(row);
- }
- if (!mIsMasterKey) {
- mChkCertify.setVisibility(View.INVISIBLE);
- TableLayout table = (TableLayout) findViewById(R.id.table_keylayout);
- TableRow row = (TableRow) findViewById(R.id.row_certify);
- table.removeView(row);
- } else {
- TextView mLabelUsage2 = (TextView) findViewById(R.id.label_usage2);
- mLabelUsage2.setVisibility(View.INVISIBLE);
- }
-
- mIsNewKey = isNewKey;
- if (isNewKey) {
- mUsage = usage;
- mChkCertify.setChecked(
- (usage & UncachedSecretKey.CERTIFY_OTHER) == UncachedSecretKey.CERTIFY_OTHER);
- mChkSign.setChecked(
- (usage & UncachedSecretKey.SIGN_DATA) == UncachedSecretKey.SIGN_DATA);
- mChkEncrypt.setChecked(
- ((usage & UncachedSecretKey.ENCRYPT_COMMS) == UncachedSecretKey.ENCRYPT_COMMS) ||
- ((usage & UncachedSecretKey.ENCRYPT_STORAGE) == UncachedSecretKey.ENCRYPT_STORAGE));
- mChkAuthenticate.setChecked(
- (usage & UncachedSecretKey.AUTHENTICATION) == UncachedSecretKey.AUTHENTICATION);
- } else {
- mUsage = key.getKeyUsage();
- mOriginalUsage = mUsage;
- if (key.isMasterKey()) {
- mChkCertify.setChecked(key.canCertify());
- }
- mChkSign.setChecked(key.canSign());
- mChkEncrypt.setChecked(key.canEncrypt());
- mChkAuthenticate.setChecked(key.canAuthenticate());
- }
-
- {
- Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- cal.setTime(key.getCreationTime());
- setCreatedDate(cal);
- }
-
- Date expiryDate = key.getExpiryTime();
- if (expiryDate == null) {
- setExpiryDate(null);
- } else {
- Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- cal.setTime(expiryDate);
- setExpiryDate(cal);
- mOriginalExpiryDate = cal;
- }
-
- }
-
- public UncachedSecretKey getValue() {
- return mKey;
- }
-
- public void onClick(View v) {
- final ViewGroup parent = (ViewGroup) getParent();
- if (v == mDeleteButton) {
- parent.removeView(this);
- if (mEditorListener != null) {
- mEditorListener.onDeleted(this, mIsNewKey);
- }
- }
- }
-
- public void setEditorListener(EditorListener listener) {
- mEditorListener = listener;
- }
-
- private void setCreatedDate(Calendar date) {
- mCreatedDate = date;
- if (date == null) {
- mCreationDate.setText(getContext().getString(R.string.none));
- } else {
- mCreationDate.setText(DateFormat.getDateInstance().format(date.getTime()));
- }
- }
-
- private void setExpiryDate(Calendar date) {
- mExpiryDate = date;
- if (date == null) {
- mExpiryDateButton.setText(getContext().getString(R.string.none));
- } else {
- mExpiryDateButton.setText(DateFormat.getDateInstance().format(date.getTime()));
- }
- }
-
- public Calendar getExpiryDate() {
- return mExpiryDate;
- }
-
- public int getUsage() {
- mUsage = (mUsage & ~UncachedSecretKey.CERTIFY_OTHER) |
- (mChkCertify.isChecked() ? UncachedSecretKey.CERTIFY_OTHER : 0);
- mUsage = (mUsage & ~UncachedSecretKey.SIGN_DATA) |
- (mChkSign.isChecked() ? UncachedSecretKey.SIGN_DATA : 0);
- mUsage = (mUsage & ~UncachedSecretKey.ENCRYPT_COMMS) |
- (mChkEncrypt.isChecked() ? UncachedSecretKey.ENCRYPT_COMMS : 0);
- mUsage = (mUsage & ~UncachedSecretKey.ENCRYPT_STORAGE) |
- (mChkEncrypt.isChecked() ? UncachedSecretKey.ENCRYPT_STORAGE : 0);
- mUsage = (mUsage & ~UncachedSecretKey.AUTHENTICATION) |
- (mChkAuthenticate.isChecked() ? UncachedSecretKey.AUTHENTICATION : 0);
-
- return mUsage;
- }
-
- public boolean needsSaving() {
- if (mIsNewKey) {
- return true;
- }
-
- boolean retval = (getUsage() != mOriginalUsage);
-
- boolean dateChanged;
- boolean mOEDNull = (mOriginalExpiryDate == null);
- boolean mEDNull = (mExpiryDate == null);
- if (mOEDNull != mEDNull) {
- dateChanged = true;
- } else {
- if (mOEDNull) {
- //both null, no change
- dateChanged = false;
- } else {
- dateChanged = ((mExpiryDate.compareTo(mOriginalExpiryDate)) != 0);
- }
- }
- retval |= dateChanged;
-
- return retval;
- }
-
- public boolean getIsNewKey() {
- return mIsNewKey;
- }
-}
-
-class ExpiryDatePickerDialog extends DatePickerDialog {
-
- public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack,
- int year, int monthOfYear, int dayOfMonth) {
- super(context, callBack, year, monthOfYear, dayOfMonth);
- }
-
- //Set permanent title.
- public void setTitle(CharSequence title) {
- super.setTitle(getContext().getString(R.string.expiry_date_dialog_title));
- }
-}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
deleted file mode 100644
index 190db1fe3..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright (C) 2010-2014 Thialfihar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.sufficientlysecure.keychain.ui.widget;
-
-import android.content.Context;
-import android.support.v7.app.ActionBarActivity;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.ImageButton;
-
-import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.pgp.UncachedSecretKey;
-import org.sufficientlysecure.keychain.service.PassphraseCacheService;
-import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
-import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment;
-import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener;
-import org.sufficientlysecure.keychain.util.Choice;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-public class SectionView extends LinearLayout implements OnClickListener, EditorListener, Editor {
- private LayoutInflater mInflater;
- private ImageButton mPlusButton;
- private ViewGroup mEditors;
- private TextView mTitle;
- private int mType = 0;
- private EditorListener mEditorListener = null;
-
- private Choice mNewKeyAlgorithmChoice;
- private int mNewKeySize;
- private boolean mOldItemDeleted = false;
- private ArrayList mDeletedIDs = new ArrayList();
- private ArrayList mDeletedKeys = new ArrayList();
- private boolean mCanBeEdited = true;
-
- private ActionBarActivity mActivity;
-
- private ProgressDialogFragment mGeneratingDialog;
-
- public static final int TYPE_USER_ID = 1;
- public static final int TYPE_KEY = 2;
-
- public void setEditorListener(EditorListener listener) {
- mEditorListener = listener;
- }
-
- public SectionView(Context context) {
- super(context);
- mActivity = (ActionBarActivity) context;
- }
-
- public SectionView(Context context, AttributeSet attrs) {
- super(context, attrs);
- mActivity = (ActionBarActivity) context;
- }
-
- public ViewGroup getEditors() {
- return mEditors;
- }
-
- public void setType(int type) {
- mType = type;
- switch (type) {
- case TYPE_USER_ID: {
- mTitle.setText(R.string.section_user_ids);
- break;
- }
-
- case TYPE_KEY: {
- mTitle.setText(R.string.section_keys);
- break;
- }
-
- default: {
- break;
- }
- }
- }
-
- public void setCanBeEdited(boolean canBeEdited) {
- mCanBeEdited = canBeEdited;
- if (!mCanBeEdited) {
- mPlusButton.setVisibility(View.INVISIBLE);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onFinishInflate() {
- mInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
- setDrawingCacheEnabled(true);
- setAlwaysDrawnWithCacheEnabled(true);
-
- mPlusButton = (ImageButton) findViewById(R.id.plusbutton);
- mPlusButton.setOnClickListener(this);
-
- mEditors = (ViewGroup) findViewById(R.id.editors);
- mTitle = (TextView) findViewById(R.id.title);
-
- updateEditorsVisible();
- super.onFinishInflate();
- }
-
- /**
- * {@inheritDoc}
- */
- public void onDeleted(Editor editor, boolean wasNewItem) {
- mOldItemDeleted |= !wasNewItem;
- if (mOldItemDeleted) {
- if (mType == TYPE_USER_ID) {
- mDeletedIDs.add(((UserIdEditor) editor).getOriginalID());
- } else if (mType == TYPE_KEY) {
- mDeletedKeys.add(((KeyEditor) editor).getValue());
- }
- }
- this.updateEditorsVisible();
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
-
- @Override
- public void onEdited() {
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
-
- protected void updateEditorsVisible() {
- final boolean hasChildren = mEditors.getChildCount() > 0;
- mEditors.setVisibility(hasChildren ? View.VISIBLE : View.GONE);
- }
-
- public boolean needsSaving() {
- //check each view for needs saving, take account of deleted items
- boolean ret = mOldItemDeleted;
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- Editor editor = (Editor) mEditors.getChildAt(i);
- ret |= editor.needsSaving();
- if (mType == TYPE_USER_ID) {
- ret |= ((UserIdEditor) editor).primarySwapped();
- }
- }
- return ret;
- }
-
- public boolean primaryChanged() {
- boolean ret = false;
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- Editor editor = (Editor) mEditors.getChildAt(i);
- if (mType == TYPE_USER_ID) {
- ret |= ((UserIdEditor) editor).primarySwapped();
- }
- }
- return ret;
- }
-
- public String getOriginalPrimaryID() {
- //NB: this will have to change when we change how Primary IDs are chosen, and so we need to be
- // careful about where Master key capabilities are stored... multiple primaries and
- // revoked ones make this harder than the simple case we are continuing to assume here
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- Editor editor = (Editor) mEditors.getChildAt(i);
- if (mType == TYPE_USER_ID) {
- if (((UserIdEditor) editor).getIsOriginallyMainUserID()) {
- return ((UserIdEditor) editor).getOriginalID();
- }
- }
- }
- return null;
- }
-
- public ArrayList getOriginalIDs() {
- ArrayList orig = new ArrayList();
- if (mType == TYPE_USER_ID) {
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- UserIdEditor editor = (UserIdEditor) mEditors.getChildAt(i);
- if (editor.isMainUserId()) {
- orig.add(0, editor.getOriginalID());
- } else {
- orig.add(editor.getOriginalID());
- }
- }
- return orig;
- } else {
- return null;
- }
- }
-
- public ArrayList getDeletedIDs() {
- return mDeletedIDs;
- }
-
- public ArrayList getDeletedKeys() {
- return mDeletedKeys;
- }
-
- public List getNeedsSavingArray() {
- ArrayList mList = new ArrayList();
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- Editor editor = (Editor) mEditors.getChildAt(i);
- mList.add(editor.needsSaving());
- }
- return mList;
- }
-
- public List getNewIDFlags() {
- ArrayList mList = new ArrayList();
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- UserIdEditor editor = (UserIdEditor) mEditors.getChildAt(i);
- if (editor.isMainUserId()) {
- mList.add(0, editor.getIsNewID());
- } else {
- mList.add(editor.getIsNewID());
- }
- }
- return mList;
- }
-
- public List getNewKeysArray() {
- ArrayList mList = new ArrayList();
- if (mType == TYPE_KEY) {
- for (int i = 0; i < mEditors.getChildCount(); ++i) {
- KeyEditor editor = (KeyEditor) mEditors.getChildAt(i);
- mList.add(editor.getIsNewKey());
- }
- }
- return mList;
- }
-
- /**
- * {@inheritDoc}
- */
- public void onClick(View v) {
- if (mCanBeEdited) {
- switch (mType) {
- case TYPE_USER_ID: {
- UserIdEditor view = (UserIdEditor) mInflater.inflate(
- R.layout.edit_key_user_id_item, mEditors, false);
- view.setEditorListener(this);
- view.setValue("", mEditors.getChildCount() == 0, true);
- mEditors.addView(view);
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- break;
- }
-
- case TYPE_KEY: {
-// AddSubkeyDialogFragment mCreateKeyDialogFragment =
-// AddSubkeyDialogFragment.newInstance(mEditors.getChildCount());
-// mCreateKeyDialogFragment
-// .setOnAlgorithmSelectedListener(
-// new AddSubkeyDialogFragment.OnAlgorithmSelectedListener() {
-// @Override
-// public void onAlgorithmSelected(Choice algorithmChoice, int keySize) {
-// mNewKeyAlgorithmChoice = algorithmChoice;
-// mNewKeySize = keySize;
-// createKey();
-// }
-// });
-// mCreateKeyDialogFragment.show(mActivity.getSupportFragmentManager(), "createKeyDialog");
- break;
- }
-
- default: {
- break;
- }
- }
- this.updateEditorsVisible();
- }
- }
-
- public void setUserIds(Vector list) {
- if (mType != TYPE_USER_ID) {
- return;
- }
-
- mEditors.removeAllViews();
- for (String userId : list) {
- UserIdEditor view = (UserIdEditor) mInflater.inflate(R.layout.edit_key_user_id_item,
- mEditors, false);
- view.setEditorListener(this);
- view.setValue(userId, mEditors.getChildCount() == 0, false);
- view.setCanBeEdited(mCanBeEdited);
- mEditors.addView(view);
- }
-
- this.updateEditorsVisible();
- }
-
- public void setKeys(Vector list, Vector usages, boolean newKeys) {
- if (mType != TYPE_KEY) {
- return;
- }
-
- mEditors.removeAllViews();
-
- // go through all keys and set view based on them
- for (int i = 0; i < list.size(); i++) {
- KeyEditor view = (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item, mEditors,
- false);
- view.setEditorListener(this);
- boolean isMasterKey = (mEditors.getChildCount() == 0);
- view.setValue(list.get(i), isMasterKey, usages.get(i), newKeys);
- view.setCanBeEdited(mCanBeEdited);
- mEditors.addView(view);
- }
-
- this.updateEditorsVisible();
- }
-
- private void createKey() {
-
- // fill values for this action
- Boolean isMasterKey;
-
- String passphrase;
- if (mEditors.getChildCount() > 0) {
- UncachedSecretKey masterKey = ((KeyEditor) mEditors.getChildAt(0)).getValue();
- passphrase = PassphraseCacheService
- .getCachedPassphrase(mActivity, masterKey.getKeyId());
- isMasterKey = false;
- } else {
- passphrase = "";
- isMasterKey = true;
- }
- /*
- data.putBoolean(KeychainIntentService.GENERATE_KEY_MASTER_KEY, isMasterKey);
- data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passphrase);
- data.putInt(KeychainIntentService.GENERATE_KEY_ALGORITHM, mNewKeyAlgorithmChoice.getId());
- data.putInt(KeychainIntentService.GENERATE_KEY_KEY_SIZE, mNewKeySize);
-
- intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
-
- // show progress dialog
- mGeneratingDialog = ProgressDialogFragment.newInstance(
- getResources().getQuantityString(R.plurals.progress_generating, 1),
- ProgressDialog.STYLE_SPINNER,
- true,
- new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- mActivity.stopService(intent);
- }
- });
-
- // Message is received after generating is done in KeychainIntentService
- KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(mActivity,
- mGeneratingDialog) {
- public void handleMessage(Message message) {
- // handle messages by standard KeychainIntentServiceHandler first
- super.handleMessage(message);
-
- if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
- // get new key from data bundle returned from service
- Bundle data = message.getDataAsStringList();
- UncachedSecretKey newKey = PgpConversionHelper
- .BytesToPGPSecretKey(data
- .getByteArray(KeychainIntentService.RESULT_NEW_KEY));
- addGeneratedKeyToView(newKey);
- }
- }
- };
-
- // Create a new Messenger for the communication back
- Messenger messenger = new Messenger(saveHandler);
- intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger);
-
- mGeneratingDialog.show(mActivity.getSupportFragmentManager(), "dialog");
-
- // start service with intent
- mActivity.startService(intent);
- */
-
- }
-
- private void addGeneratedKeyToView(UncachedSecretKey newKey) {
- // add view with new key
- KeyEditor view = (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item,
- mEditors, false);
- view.setEditorListener(SectionView.this);
- int usage = 0;
- if (mEditors.getChildCount() == 0) {
- usage = UncachedSecretKey.CERTIFY_OTHER;
- }
- view.setValue(newKey, newKey.isMasterKey(), usage, true);
- mEditors.addView(view);
- SectionView.this.updateEditorsVisible();
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
-}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/UserIdEditor.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/UserIdEditor.java
deleted file mode 100644
index f50d2adc6..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/UserIdEditor.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (C) 2014 Dominik Schürmann
- * Copyright (C) 2010-2014 Thialfihar
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.sufficientlysecure.keychain.ui.widget;
-
-import android.content.Context;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.util.AttributeSet;
-import android.util.Patterns;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.AutoCompleteTextView;
-import android.widget.EditText;
-import android.widget.LinearLayout;
-import android.widget.RadioButton;
-import android.widget.ImageButton;
-
-import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.helper.ContactHelper;
-import org.sufficientlysecure.keychain.pgp.KeyRing;
-
-import java.util.regex.Matcher;
-
-public class UserIdEditor extends LinearLayout implements Editor, OnClickListener {
- private EditorListener mEditorListener = null;
-
- private ImageButton mDeleteButton;
- private RadioButton mIsMainUserId;
- private String mOriginalID;
- private EditText mName;
- private String mOriginalName;
- private AutoCompleteTextView mEmail;
- private String mOriginalEmail;
- private EditText mComment;
- private String mOriginalComment;
- private boolean mOriginallyMainUserID;
- private boolean mIsNewId;
-
- public void setCanBeEdited(boolean canBeEdited) {
- if (!canBeEdited) {
- mDeleteButton.setVisibility(View.INVISIBLE);
- mName.setEnabled(false);
- mIsMainUserId.setEnabled(false);
- mEmail.setEnabled(false);
- mComment.setEnabled(false);
- }
- }
-
- public static class InvalidEmailException extends Exception {
- static final long serialVersionUID = 0xf812773345L;
-
- public InvalidEmailException(String message) {
- super(message);
- }
- }
-
- public UserIdEditor(Context context) {
- super(context);
- }
-
- public UserIdEditor(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- TextWatcher mTextWatcher = new TextWatcher() {
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- }
-
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- }
-
- @Override
- public void afterTextChanged(Editable s) {
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
- };
-
- @Override
- protected void onFinishInflate() {
- setDrawingCacheEnabled(true);
- setAlwaysDrawnWithCacheEnabled(true);
-
- mDeleteButton = (ImageButton) findViewById(R.id.delete);
- mDeleteButton.setOnClickListener(this);
- mIsMainUserId = (RadioButton) findViewById(R.id.isMainUserId);
- mIsMainUserId.setOnClickListener(this);
-
- mName = (EditText) findViewById(R.id.name);
- mName.addTextChangedListener(mTextWatcher);
- mEmail = (AutoCompleteTextView) findViewById(R.id.email);
- mComment = (EditText) findViewById(R.id.user_id_item_comment);
- mComment.addTextChangedListener(mTextWatcher);
-
-
- mEmail.setThreshold(1); // Start working from first character
- mEmail.setAdapter(
- new ArrayAdapter
- (this.getContext(), android.R.layout.simple_dropdown_item_1line,
- ContactHelper.getPossibleUserEmails(getContext())
- ));
- mEmail.addTextChangedListener(new TextWatcher(){
- @Override
- public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { }
-
- @Override
- public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { }
-
- @Override
- public void afterTextChanged(Editable editable) {
- String email = editable.toString();
- if (email.length() > 0) {
- Matcher emailMatcher = Patterns.EMAIL_ADDRESS.matcher(email);
- if (emailMatcher.matches()) {
- mEmail.setCompoundDrawablesWithIntrinsicBounds(0, 0,
- R.drawable.uid_mail_ok, 0);
- } else {
- mEmail.setCompoundDrawablesWithIntrinsicBounds(0, 0,
- R.drawable.uid_mail_bad, 0);
- }
- } else {
- // remove drawable if email is empty
- mEmail.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
- }
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
- });
-
- super.onFinishInflate();
- }
-
- public void setValue(String userId, boolean isMainID, boolean isNewId) {
-
- mName.setText("");
- mOriginalName = "";
- mComment.setText("");
- mOriginalComment = "";
- mEmail.setText("");
- mOriginalEmail = "";
- mIsNewId = isNewId;
- mOriginalID = userId;
-
- String[] result = KeyRing.splitUserId(userId);
- if (result[0] != null) {
- mName.setText(result[0]);
- mOriginalName = result[0];
- }
- if (result[1] != null) {
- mEmail.setText(result[1]);
- mOriginalEmail = result[1];
- }
- if (result[2] != null) {
- mComment.setText(result[2]);
- mOriginalComment = result[2];
- }
-
- mOriginallyMainUserID = isMainID;
- setIsMainUserId(isMainID);
- }
-
- public String getValue() {
- String name = ("" + mName.getText()).trim();
- String email = ("" + mEmail.getText()).trim();
- String comment = ("" + mComment.getText()).trim();
-
- String userId = name;
- if (comment.length() > 0) {
- userId += " (" + comment + ")";
- }
- if (email.length() > 0) {
- userId += " <" + email + ">";
- }
-
- if (userId.equals("")) {
- // ok, empty one...
- return userId;
- }
- //TODO: check gpg accepts an entirely empty ID packet. specs say this is allowed
- return userId;
- }
-
- public void onClick(View v) {
- final ViewGroup parent = (ViewGroup) getParent();
- if (v == mDeleteButton) {
- boolean wasMainUserId = mIsMainUserId.isChecked();
- parent.removeView(this);
- if (mEditorListener != null) {
- mEditorListener.onDeleted(this, mIsNewId);
- }
- if (wasMainUserId && parent.getChildCount() > 0) {
- UserIdEditor editor = (UserIdEditor) parent.getChildAt(0);
- editor.setIsMainUserId(true);
- }
- } else if (v == mIsMainUserId) {
- for (int i = 0; i < parent.getChildCount(); ++i) {
- UserIdEditor editor = (UserIdEditor) parent.getChildAt(i);
- if (editor == this) {
- editor.setIsMainUserId(true);
- } else {
- editor.setIsMainUserId(false);
- }
- }
- if (mEditorListener != null) {
- mEditorListener.onEdited();
- }
- }
- }
-
- public void setIsMainUserId(boolean value) {
- mIsMainUserId.setChecked(value);
- }
-
- public boolean isMainUserId() {
- return mIsMainUserId.isChecked();
- }
-
- public void setEditorListener(EditorListener listener) {
- mEditorListener = listener;
- }
-
- @Override
- public boolean needsSaving() {
- boolean retval = false; //(mOriginallyMainUserID != isMainUserId());
- retval |= !(mOriginalName.equals(("" + mName.getText()).trim()));
- retval |= !(mOriginalEmail.equals(("" + mEmail.getText()).trim()));
- retval |= !(mOriginalComment.equals(("" + mComment.getText()).trim()));
- retval |= mIsNewId;
- return retval;
- }
-
- public boolean getIsOriginallyMainUserID() {
- return mOriginallyMainUserID;
- }
-
- public boolean primarySwapped() {
- return (mOriginallyMainUserID != isMainUserId());
- }
-
- public String getOriginalID() {
- return mOriginalID;
- }
-
- public boolean getIsNewID() { return mIsNewId; }
-}
diff --git a/OpenKeychain/src/main/res/layout/edit_key_key_item.xml b/OpenKeychain/src/main/res/layout/edit_key_key_item.xml
deleted file mode 100644
index 65e2c82fb..000000000
--- a/OpenKeychain/src/main/res/layout/edit_key_key_item.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/OpenKeychain/src/main/res/layout/edit_key_section.xml b/OpenKeychain/src/main/res/layout/edit_key_section.xml
deleted file mode 100644
index 6cfe18bd6..000000000
--- a/OpenKeychain/src/main/res/layout/edit_key_section.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/edit_key_user_id_item.xml b/OpenKeychain/src/main/res/layout/edit_key_user_id_item.xml
deleted file mode 100644
index 877ea77db..000000000
--- a/OpenKeychain/src/main/res/layout/edit_key_user_id_item.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
--
cgit v1.2.3
From da163c8d3d19fabb1cbfb7cdded23e7cb081b7bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 02:37:41 +0200
Subject: TokenAutoComplete: Do not abort build if lint finds errors
---
extern/TokenAutoComplete | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/extern/TokenAutoComplete b/extern/TokenAutoComplete
index 4239ef065..0056270ce 160000
--- a/extern/TokenAutoComplete
+++ b/extern/TokenAutoComplete
@@ -1 +1 @@
-Subproject commit 4239ef065b738a53ac86f3807cad26d4471aedf6
+Subproject commit 0056270cec6a91893b853844ebe99f6cd5c15348
--
cgit v1.2.3
From a8b8ed6f14b917c220d1e46548260e0e9bdf7656 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 09:59:11 +0200
Subject: Gradle troubleshooting info
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 509c57e63..6743372ac 100644
--- a/README.md
+++ b/README.md
@@ -132,6 +132,10 @@ When changing build files or dependencies, respect the following requirements:
* https://www.timroes.de/2013/09/12/speed-up-gradle/
* Disable Lint checking if it is enabled in build.gradle
+### Error:Configuration with name 'default' not found.
+
+Gradle project dependencies are missing. Do a ``git submodule init && git submodule update``
+
### Translations
Translations are hosted on Transifex, which is configured by ".tx/config".
--
cgit v1.2.3
From b42afcd32cc082d45daf64e37d89ba88f0c3eb56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 11:19:46 +0200
Subject: Fix debug backup/restore methods
---
OpenKeychain/src/main/AndroidManifest.xml | 2 +-
.../keychain/provider/KeychainDatabase.java | 39 ++++++++++------------
.../keychain/ui/KeyListActivity.java | 12 +++----
.../main/res/layout/view_key_share_fragment.xml | 1 -
4 files changed, 24 insertions(+), 30 deletions(-)
diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml
index df5eaa69e..c10629c6d 100644
--- a/OpenKeychain/src/main/AndroidManifest.xml
+++ b/OpenKeychain/src/main/AndroidManifest.xml
@@ -177,7 +177,7 @@
android:windowSoftInputMode="stateHidden">
-
+
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
index 7a63ec3d7..ebc53ddf6 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
@@ -316,42 +316,37 @@ public class KeychainDatabase extends SQLiteOpenHelper {
}
private static void copy(File in, File out) throws IOException {
- FileInputStream ss = new FileInputStream(in);
- FileOutputStream ds = new FileOutputStream(out);
+ FileInputStream is = new FileInputStream(in);
+ FileOutputStream os = new FileOutputStream(out);
byte[] buf = new byte[512];
- while (ss.available() > 0) {
- int count = ss.read(buf, 0, 512);
- ds.write(buf, 0, count);
+ while (is.available() > 0) {
+ int count = is.read(buf, 0, 512);
+ os.write(buf, 0, count);
}
}
- public static void debugRead(Context context) throws IOException {
+ public static void debugBackup(Context context, boolean restore) throws IOException {
if (!Constants.DEBUG) {
return;
}
- File in = context.getDatabasePath("debug.db");
- File out = context.getDatabasePath("openkeychain.db");
- if (!in.canRead()) {
- throw new IOException("Cannot read " + in.getName());
- }
- if (!out.canRead()) {
- throw new IOException("Cannot write " + out.getName());
- }
- copy(in, out);
- }
- public static void debugWrite(Context context) throws IOException {
- if (!Constants.DEBUG) {
- return;
+ File in;
+ File out;
+ if (restore) {
+ in = context.getDatabasePath("debug_backup.db");
+ out = context.getDatabasePath("openkeychain.db");
+ } else {
+ in = context.getDatabasePath("openkeychain.db");
+ out = context.getDatabasePath("debug_backup.db");
+ out.createNewFile();
}
- File in = context.getDatabasePath("openkeychain.db");
- File out = context.getDatabasePath("debug.db");
if (!in.canRead()) {
throw new IOException("Cannot read " + in.getName());
}
- if (!out.canRead()) {
+ if (!out.canWrite()) {
throw new IOException("Cannot write " + out.getName());
}
copy(in, out);
}
+
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
index 50ff5c753..7a6e78a7d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
@@ -94,22 +94,22 @@ public class KeyListActivity extends DrawerActivity {
case R.id.menu_key_list_debug_read:
try {
- KeychainDatabase.debugRead(this);
- Notify.showNotify(this, "Restored Notify.Style backup", Notify.Style.INFO);
+ KeychainDatabase.debugBackup(this, true);
+ Notify.showNotify(this, "Restored debug_backup.db", Notify.Style.INFO);
getContentResolver().notifyChange(KeychainContract.KeyRings.CONTENT_URI, null);
} catch (IOException e) {
Log.e(Constants.TAG, "IO Error", e);
- Notify.showNotify(this, "IO Notify.Style: " + e.getMessage(), Notify.Style.ERROR);
+ Notify.showNotify(this, "IO Error " + e.getMessage(), Notify.Style.ERROR);
}
return true;
case R.id.menu_key_list_debug_write:
try {
- KeychainDatabase.debugWrite(this);
- Notify.showNotify(this, "Backup Notify.Style", Notify.Style.INFO);
+ KeychainDatabase.debugBackup(this, false);
+ Notify.showNotify(this, "Backup to debug_backup.db completed", Notify.Style.INFO);
} catch(IOException e) {
Log.e(Constants.TAG, "IO Error", e);
- Notify.showNotify(this, "IO Notify.Style: " + e.getMessage(), Notify.Style.ERROR);
+ Notify.showNotify(this, "IO Error: " + e.getMessage(), Notify.Style.ERROR);
}
return true;
diff --git a/OpenKeychain/src/main/res/layout/view_key_share_fragment.xml b/OpenKeychain/src/main/res/layout/view_key_share_fragment.xml
index a8786c461..7905473c0 100644
--- a/OpenKeychain/src/main/res/layout/view_key_share_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/view_key_share_fragment.xml
@@ -133,7 +133,6 @@
android:id="@+id/view_key_action_upload"
android:paddingLeft="8dp"
android:paddingRight="8dp"
- android:layout_marginBottom="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
--
cgit v1.2.3
From 839294d27c4f8b3ac22573a1d429bc230f641bd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 14:42:03 +0200
Subject: Cleanup, prevent encrypt Intent inception
---
.../org/sufficientlysecure/keychain/Constants.java | 2 -
.../keychain/helper/FileHelper.java | 21 +++---
.../keychain/provider/KeychainDatabase.java | 8 +--
.../keychain/ui/DecryptFileFragment.java | 5 +-
.../keychain/ui/EncryptActivity.java | 76 +++++++++++++++++++++-
.../keychain/ui/EncryptFileFragment.java | 8 +--
.../ui/dialog/DeleteFileDialogFragment.java | 3 +-
7 files changed, 98 insertions(+), 25 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index b679ef210..6423697cf 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -51,8 +51,6 @@ public final class Constants {
public static final String CUSTOM_CONTACT_DATA_MIME_TYPE = "vnd.android.cursor.item/vnd.org.sufficientlysecure.keychain.key";
- public static boolean KITKAT = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
-
public static int TEMPFILE_TTL = 24*60*60*1000; // 1 day
public static final class Path {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
index 615d89e0c..ca0749a4e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
@@ -32,6 +32,7 @@ import android.provider.OpenableColumns;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.widget.Toast;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
@@ -136,9 +137,10 @@ public class FileHelper {
/**
* Opens the storage browser on Android 4.4 or later for opening a file
+ *
* @param fragment
- * @param mimeType can be text/plain for example
- * @param multiple allow file chooser to return multiple files
+ * @param mimeType can be text/plain for example
+ * @param multiple allow file chooser to return multiple files
* @param requestCode used to identify the result coming back from storage browser onActivityResult() in your
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
@@ -153,10 +155,11 @@ public class FileHelper {
/**
* Opens the storage browser on Android 4.4 or later for saving a file
+ *
* @param fragment
- * @param mimeType can be text/plain for example
+ * @param mimeType can be text/plain for example
* @param suggestedName a filename desirable for the file to be saved
- * @param requestCode used to identify the result coming back from storage browser onActivityResult() in your
+ * @param requestCode used to identify the result coming back from storage browser onActivityResult() in your
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
public static void saveDocument(Fragment fragment, String mimeType, String suggestedName, int requestCode) {
@@ -210,7 +213,7 @@ public class FileHelper {
* Retrieve thumbnail of file, document api feature and thus KitKat only
*/
public static Bitmap getThumbnail(Context context, Uri uri, Point size) {
- if (Constants.KITKAT) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return DocumentsContract.getDocumentThumbnail(context.getContentResolver(), uri, size, null);
} else {
return null;
@@ -218,10 +221,10 @@ public class FileHelper {
}
public static String readableFileSize(long size) {
- if(size <= 0) return "0";
- final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" };
- int digitGroups = (int) (Math.log10(size)/Math.log10(1024));
- return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups)) + " " + units[digitGroups];
+ if (size <= 0) return "0";
+ final String[] units = new String[]{"B", "KB", "MB", "GB", "TB"};
+ int digitGroups = (int) (Math.log10(size) / Math.log10(1024));
+ return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
}
public static interface FileDialogCallback {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
index ebc53ddf6..3a859f505 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
@@ -165,8 +165,8 @@ public class KeychainDatabase extends SQLiteOpenHelper {
// make sure this is only done once, on the first instance!
boolean iAmIt = false;
- synchronized(KeychainDatabase.class) {
- if(!KeychainDatabase.apgHack) {
+ synchronized (KeychainDatabase.class) {
+ if (!KeychainDatabase.apgHack) {
iAmIt = true;
KeychainDatabase.apgHack = true;
}
@@ -334,9 +334,9 @@ public class KeychainDatabase extends SQLiteOpenHelper {
File out;
if (restore) {
in = context.getDatabasePath("debug_backup.db");
- out = context.getDatabasePath("openkeychain.db");
+ out = context.getDatabasePath(DATABASE_NAME);
} else {
- in = context.getDatabasePath("openkeychain.db");
+ in = context.getDatabasePath(DATABASE_NAME);
out = context.getDatabasePath("debug_backup.db");
out.createNewFile();
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
index 5b61c3f52..51e90ea20 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
@@ -21,6 +21,7 @@ import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.os.Messenger;
@@ -72,7 +73,7 @@ public class DecryptFileFragment extends DecryptFragment {
mDecryptButton = view.findViewById(R.id.decrypt_file_action_decrypt);
view.findViewById(R.id.decrypt_file_browse).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- if (Constants.KITKAT) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
FileHelper.openDocument(DecryptFileFragment.this, "*/*", REQUEST_CODE_INPUT);
} else {
FileHelper.openFile(DecryptFileFragment.this, mInputUri, "*/*",
@@ -126,7 +127,7 @@ public class DecryptFileFragment extends DecryptFragment {
private void askForOutputFilename() {
String targetName = removeEncryptedAppend(FileHelper.getFilename(getActivity(), mInputUri));
- if (!Constants.KITKAT) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
File file = new File(mInputUri.getPath());
File parentDir = file.exists() ? file.getParentFile() : Constants.Path.APP_DIR;
File targetFile = new File(parentDir, targetName);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 211802717..f9dbb2b6b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -20,16 +20,20 @@ package org.sufficientlysecure.keychain.ui;
import android.app.ProgressDialog;
import android.content.Intent;
+import android.content.pm.LabeledIntent;
+import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
+import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.MenuItem;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
@@ -45,7 +49,11 @@ import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.Notify;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
public class EncryptActivity extends DrawerActivity implements EncryptActivityInterface {
@@ -228,7 +236,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
if (mShareAfterEncrypt) {
// Share encrypted file
- startActivity(Intent.createChooser(createSendIntent(message), getString(R.string.title_share_file)));
+ startActivity(sendCreateChooserExcludingOpenKeychain(message));
} else if (isContentMessage()) {
// Copy to clipboard
copyToClipboard(message);
@@ -289,6 +297,69 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
ClipboardReflection.copyToClipboard(this, new String(message.getData().getByteArray(KeychainIntentService.RESULT_BYTES)));
}
+ /**
+ * Create Intent Chooser but exclude OK's EncryptActivity.
+ *
+ * Put together from some stackoverflow posts...
+ *
+ * @param message
+ * @return
+ */
+ private Intent sendCreateChooserExcludingOpenKeychain(Message message) {
+ Intent prototype = createSendIntent(message);
+
+ String[] blacklist = new String[]{Constants.PACKAGE_NAME + ".ui.EncryptActivity"};
+
+ List targetedShareIntents = new ArrayList();
+
+ List resInfoList = getPackageManager().queryIntentActivities(prototype, 0);
+ List resInfoListFiltered = new ArrayList();
+ if (!resInfoList.isEmpty()) {
+ for (ResolveInfo resolveInfo : resInfoList) {
+ // do not add blacklisted ones
+ if (resolveInfo.activityInfo == null || Arrays.asList(blacklist).contains(resolveInfo.activityInfo.name))
+ continue;
+
+ resInfoListFiltered.add(resolveInfo);
+ }
+
+ if (!resInfoListFiltered.isEmpty()) {
+ // sorting for nice readability
+ Collections.sort(resInfoListFiltered, new Comparator() {
+ @Override
+ public int compare(ResolveInfo first, ResolveInfo second) {
+ String firstName = first.loadLabel(getPackageManager()).toString();
+ String secondName = second.loadLabel(getPackageManager()).toString();
+ return firstName.compareToIgnoreCase(secondName);
+ }
+ });
+
+ // create the custom intent list
+ for (ResolveInfo resolveInfo : resInfoListFiltered) {
+ Intent targetedShareIntent = (Intent) prototype.clone();
+ targetedShareIntent.setPackage(resolveInfo.activityInfo.packageName);
+ targetedShareIntent.setClassName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name);
+
+ LabeledIntent lIntent = new LabeledIntent(targetedShareIntent,
+ resolveInfo.activityInfo.packageName,
+ resolveInfo.loadLabel(getPackageManager()),
+ resolveInfo.activityInfo.icon);
+ targetedShareIntents.add(lIntent);
+ }
+
+ // Create chooser with only one Intent in it
+ Intent chooserIntent = Intent.createChooser(targetedShareIntents.remove(targetedShareIntents.size() - 1), getString(R.string.title_share_file));
+ // append all other Intents
+ chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[]{}));
+ return chooserIntent;
+ }
+
+ }
+
+ // fallback to Android's default chooser
+ return Intent.createChooser(prototype, getString(R.string.title_share_file));
+ }
+
private Intent createSendIntent(Message message) {
Intent sendIntent;
if (isContentMessage()) {
@@ -380,7 +451,8 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
startEncrypt();
}
}
- });
+ }
+ );
return false;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index 6bbbac713..d412df0f4 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -27,7 +27,6 @@ import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
-import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@@ -39,7 +38,6 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.helper.OtherHelper;
import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
-import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
import java.util.HashMap;
@@ -117,7 +115,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
}
private void addInputUri() {
- if (Constants.KITKAT) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
FileHelper.openDocument(EncryptFileFragment.this, "*/*", true, REQUEST_CODE_INPUT);
} else {
FileHelper.openFile(EncryptFileFragment.this, mEncryptInterface.getInputUris().isEmpty() ?
@@ -174,7 +172,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
throw new IllegalStateException();
}
Uri inputUri = mEncryptInterface.getInputUris().get(0);
- if (!Constants.KITKAT) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
File file = new File(inputUri.getPath());
File parentDir = file.exists() ? file.getParentFile() : Constants.Path.APP_DIR;
String targetName = FileHelper.getFilename(getActivity(), inputUri) +
@@ -219,7 +217,7 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
switch (requestCode) {
case REQUEST_CODE_INPUT: {
if (resultCode == Activity.RESULT_OK && data != null) {
- if (!Constants.KITKAT || !handleClipData(data)) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT || !handleClipData(data)) {
addInputUri(data.getData());
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
index 5e296c062..d408349d2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.dialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.provider.DocumentsContract;
import android.support.v4.app.DialogFragment;
@@ -71,7 +72,7 @@ public class DeleteFileDialogFragment extends DialogFragment {
dismiss();
// We can not securely delete Uris, so just use usual delete on them
- if (Constants.KITKAT) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (DocumentsContract.deleteDocument(getActivity().getContentResolver(), deleteUri)) {
Toast.makeText(getActivity(), R.string.file_delete_successful, Toast.LENGTH_SHORT).show();
return;
--
cgit v1.2.3
From c4311e2f52e5870ccfd67d34fa7c364ecd160753 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 14:44:11 +0200
Subject: Remove support for IO_FILE, this is no longer used and was never a
good practice, use IO_URI on Android!
---
.../keychain/service/KeychainIntentService.java | 31 ++--------------------
1 file changed, 2 insertions(+), 29 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index b45359a10..601f45fed 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -110,9 +110,8 @@ public class KeychainIntentService extends IntentService
public static final String SOURCE = "source";
// possible targets:
public static final int IO_BYTES = 1;
- public static final int IO_FILE = 2; // This was misleadingly TARGET_URI before!
- public static final int IO_URI = 3;
- public static final int IO_URIS = 4;
+ public static final int IO_URI = 2;
+ public static final int IO_URIS = 3;
public static final String SELECTED_URI = "selected_uri";
@@ -716,16 +715,6 @@ public class KeychainIntentService extends IntentService
byte[] bytes = data.getByteArray(bytesName);
return new InputData(new ByteArrayInputStream(bytes), bytes.length);
- case IO_FILE: /* encrypting file */
- String inputFile = data.getString(ENCRYPT_INPUT_FILE);
-
- // check if storage is ready
- if (!FileHelper.isStorageMounted(inputFile)) {
- throw new PgpGeneralException(getString(R.string.error_external_storage_not_ready));
- }
-
- return new InputData(new FileInputStream(inputFile), new File(inputFile).length());
-
case IO_URI: /* encrypting content uri */
Uri providerUri = data.getParcelable(ENCRYPT_INPUT_URI);
@@ -749,18 +738,6 @@ public class KeychainIntentService extends IntentService
case IO_BYTES:
return new ByteArrayOutputStream();
- case IO_FILE:
- String outputFile = data.getString(ENCRYPT_OUTPUT_FILE);
-
- // check if storage is ready
- if (!FileHelper.isStorageMounted(outputFile)) {
- throw new PgpGeneralException(
- getString(R.string.error_external_storage_not_ready));
- }
-
- // OutputStream
- return new FileOutputStream(outputFile);
-
case IO_URI:
Uri providerUri = data.getParcelable(ENCRYPT_OUTPUT_URI);
@@ -790,10 +767,6 @@ public class KeychainIntentService extends IntentService
case IO_BYTES:
byte output[] = ((ByteArrayOutputStream) outStream).toByteArray();
resultData.putByteArray(bytesName, output);
- break;
- case IO_FILE:
- // nothing, file was written, just send okay and verification bundle
-
break;
case IO_URI:
case IO_URIS:
--
cgit v1.2.3
From e87c69647c06740146dcbdb9ee350aeacc178a94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 15:40:34 +0200
Subject: Even more smaller nitpicks
---
.../keychain/ui/EncryptActivity.java | 35 ++++++++++++++--------
OpenKeychain/src/main/res/values/strings.xml | 1 +
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index f9dbb2b6b..0007d179a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -23,6 +23,7 @@ import android.content.Intent;
import android.content.pm.LabeledIntent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -223,20 +224,22 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
super.handleMessage(message);
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
- Notify.showNotify(EncryptActivity.this, R.string.encrypt_sign_successful, Notify.Style.INFO);
+ if (!isContentMessage()) {
+ Notify.showNotify(EncryptActivity.this, R.string.encrypt_sign_successful, Notify.Style.INFO);
- if (!isContentMessage() && mDeleteAfterEncrypt) {
- for (Uri inputUri : mInputUris) {
- DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(inputUri);
- deleteFileDialog.show(getSupportFragmentManager(), "deleteDialog");
+ if (mDeleteAfterEncrypt) {
+ for (Uri inputUri : mInputUris) {
+ DeleteFileDialogFragment deleteFileDialog = DeleteFileDialogFragment.newInstance(inputUri);
+ deleteFileDialog.show(getSupportFragmentManager(), "deleteDialog");
+ }
+ mInputUris.clear();
+ notifyUpdate();
}
- mInputUris.clear();
- notifyUpdate();
}
if (mShareAfterEncrypt) {
- // Share encrypted file
- startActivity(sendCreateChooserExcludingOpenKeychain(message));
+ // Share encrypted message/file
+ startActivity(sendWithChooserExcludingOpenKeychain(message));
} else if (isContentMessage()) {
// Copy to clipboard
copyToClipboard(message);
@@ -305,9 +308,17 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
* @param message
* @return
*/
- private Intent sendCreateChooserExcludingOpenKeychain(Message message) {
+ private Intent sendWithChooserExcludingOpenKeychain(Message message) {
Intent prototype = createSendIntent(message);
+ String title = isContentMessage() ? getString(R.string.title_share_message)
+ : getString(R.string.title_share_file);
+
+ // somehow this returns lists with only one entry on Android 2.3
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
+ return Intent.createChooser(prototype, title);
+ }
+
String[] blacklist = new String[]{Constants.PACKAGE_NAME + ".ui.EncryptActivity"};
List targetedShareIntents = new ArrayList();
@@ -348,7 +359,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
}
// Create chooser with only one Intent in it
- Intent chooserIntent = Intent.createChooser(targetedShareIntents.remove(targetedShareIntents.size() - 1), getString(R.string.title_share_file));
+ Intent chooserIntent = Intent.createChooser(targetedShareIntents.remove(targetedShareIntents.size() - 1), title);
// append all other Intents
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[]{}));
return chooserIntent;
@@ -357,7 +368,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
}
// fallback to Android's default chooser
- return Intent.createChooser(prototype, getString(R.string.title_share_file));
+ return Intent.createChooser(prototype, title);
}
private Intent createSendIntent(Message message) {
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 5f801398b..8072b297d 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -18,6 +18,7 @@
Share fingerprint with…Share key with…Share file with…
+ Share message with…Encrypt To FileDecrypt To FileImport Keys
--
cgit v1.2.3
From 3a6ac2a16aef9a066bf196df04c40d03f348d147 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 15:49:49 +0200
Subject: More cleanup
---
.../java/org/sufficientlysecure/keychain/ui/EncryptActivity.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
index 0007d179a..94f828b48 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
@@ -239,7 +239,7 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
if (mShareAfterEncrypt) {
// Share encrypted message/file
- startActivity(sendWithChooserExcludingOpenKeychain(message));
+ startActivity(sendWithChooserExcludingEncrypt(message));
} else if (isContentMessage()) {
// Copy to clipboard
copyToClipboard(message);
@@ -308,17 +308,18 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
* @param message
* @return
*/
- private Intent sendWithChooserExcludingOpenKeychain(Message message) {
+ private Intent sendWithChooserExcludingEncrypt(Message message) {
Intent prototype = createSendIntent(message);
String title = isContentMessage() ? getString(R.string.title_share_message)
: getString(R.string.title_share_file);
- // somehow this returns lists with only one entry on Android 2.3
+ // fallback on Android 2.3, otherwise we would get weird results
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return Intent.createChooser(prototype, title);
}
+ // prevent recursion aka Inception :P
String[] blacklist = new String[]{Constants.PACKAGE_NAME + ".ui.EncryptActivity"};
List targetedShareIntents = new ArrayList();
--
cgit v1.2.3
From a2c122139702f2d792ede06c0011bc7531e40790 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 16:29:16 +0200
Subject: Fixing lint complaints, removing unused resources
---
OpenKeychain/build.gradle | 2 +-
.../keychain/helper/EmailKeyHelper.java | 3 +-
.../keychain/keyimport/HkpKeyserver.java | 10 +--
.../keychain/pgp/PgpKeyHelper.java | 4 +-
.../keychain/service/PassphraseCacheService.java | 4 +-
.../keychain/ui/ViewKeyActivity.java | 2 +-
.../ui/widget/EncryptKeyCompletionView.java | 5 +-
.../src/main/res/drawable-hdpi/ic_action_cloud.png | Bin 450 -> 0 bytes
.../src/main/res/drawable-hdpi/ic_action_good.png | Bin 485 -> 0 bytes
.../drawable-hdpi/ic_action_important_small.png | Bin 473 -> 0 bytes
.../src/main/res/drawable-hdpi/ic_menu_search.png | Bin 1218 -> 0 bytes
.../main/res/drawable-hdpi/ic_menu_search_list.png | Bin 1190 -> 0 bytes
.../src/main/res/drawable-hdpi/ic_next.png | Bin 1722 -> 0 bytes
.../src/main/res/drawable-hdpi/ic_previous.png | Bin 1712 -> 0 bytes
.../src/main/res/drawable-hdpi/key_small.png | Bin 2088 -> 0 bytes
.../src/main/res/drawable-ldpi/ic_next.png | Bin 916 -> 0 bytes
.../src/main/res/drawable-ldpi/ic_previous.png | Bin 922 -> 0 bytes
.../src/main/res/drawable-ldpi/key_small.png | Bin 1074 -> 0 bytes
.../src/main/res/drawable-mdpi/ic_action_cloud.png | Bin 335 -> 0 bytes
.../src/main/res/drawable-mdpi/ic_action_good.png | Bin 343 -> 0 bytes
.../drawable-mdpi/ic_action_important_small.png | Bin 361 -> 0 bytes
.../src/main/res/drawable-mdpi/ic_menu_search.png | Bin 858 -> 0 bytes
.../main/res/drawable-mdpi/ic_menu_search_list.png | Bin 863 -> 0 bytes
.../src/main/res/drawable-mdpi/ic_next.png | Bin 1360 -> 0 bytes
.../src/main/res/drawable-mdpi/ic_previous.png | Bin 1352 -> 0 bytes
.../src/main/res/drawable-mdpi/key_small.png | Bin 1484 -> 0 bytes
.../main/res/drawable-xhdpi/ic_action_cloud.png | Bin 538 -> 0 bytes
.../src/main/res/drawable-xhdpi/ic_action_good.png | Bin 566 -> 0 bytes
.../drawable-xhdpi/ic_action_important_small.png | Bin 623 -> 0 bytes
.../src/main/res/drawable-xhdpi/ic_menu_search.png | Bin 1629 -> 0 bytes
.../res/drawable-xhdpi/ic_menu_search_list.png | Bin 1571 -> 0 bytes
.../main/res/drawable-xxhdpi/ic_action_cloud.png | Bin 760 -> 0 bytes
.../main/res/drawable-xxhdpi/ic_action_good.png | Bin 823 -> 0 bytes
.../drawable-xxhdpi/ic_action_important_small.png | Bin 890 -> 0 bytes
.../res/layout/api_account_settings_fragment.xml | 2 +-
.../layout/select_secret_key_layout_fragment.xml | 2 +-
.../main/res/layout/view_key_share_fragment.xml | 3 +-
OpenKeychain/src/main/res/values/strings.xml | 75 ---------------------
38 files changed, 19 insertions(+), 93 deletions(-)
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_cloud.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_good.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_important_small.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search_list.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_next.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_previous.png
delete mode 100644 OpenKeychain/src/main/res/drawable-hdpi/key_small.png
delete mode 100644 OpenKeychain/src/main/res/drawable-ldpi/ic_next.png
delete mode 100644 OpenKeychain/src/main/res/drawable-ldpi/ic_previous.png
delete mode 100644 OpenKeychain/src/main/res/drawable-ldpi/key_small.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_cloud.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_good.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_important_small.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search_list.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_next.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_previous.png
delete mode 100644 OpenKeychain/src/main/res/drawable-mdpi/key_small.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_cloud.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_good.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_important_small.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search_list.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_cloud.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_good.png
delete mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_important_small.png
diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle
index 88706f1f9..26c49ce18 100644
--- a/OpenKeychain/build.gradle
+++ b/OpenKeychain/build.gradle
@@ -1,4 +1,4 @@
-apply plugin: 'android'
+apply plugin: 'com.android.application'
dependencies {
// NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java
index 5d281d5b0..7cd4f6710 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java
@@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.service.KeychainIntentService;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Set;
public class EmailKeyHelper {
@@ -86,7 +87,7 @@ public class EmailKeyHelper {
for (ImportKeysListEntry key : keyServer.search(mail)) {
if (key.isRevoked() || key.isExpired()) continue;
for (String userId : key.getUserIds()) {
- if (userId.toLowerCase().contains(mail.toLowerCase())) {
+ if (userId.toLowerCase().contains(mail.toLowerCase(Locale.ENGLISH))) {
keys.add(key);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
index 41f1e6997..eb741fc45 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
@@ -251,14 +251,14 @@ public class HkpKeyserver extends Keyserver {
data = query(request);
} catch (HttpError e) {
if (e.getData() != null) {
- Log.d(Constants.TAG, "returned error data: " + e.getData().toLowerCase(Locale.US));
+ Log.d(Constants.TAG, "returned error data: " + e.getData().toLowerCase(Locale.ENGLISH));
- if (e.getData().toLowerCase(Locale.US).contains("no keys found")) {
+ if (e.getData().toLowerCase(Locale.ENGLISH).contains("no keys found")) {
// NOTE: This is also a 404 error for some keyservers!
return results;
- } else if (e.getData().toLowerCase(Locale.US).contains("too many")) {
+ } else if (e.getData().toLowerCase(Locale.ENGLISH).contains("too many")) {
throw new TooManyResponsesException();
- } else if (e.getData().toLowerCase(Locale.US).contains("insufficient")) {
+ } else if (e.getData().toLowerCase(Locale.ENGLISH).contains("insufficient")) {
throw new QueryTooShortException();
} else if (e.getCode() == 404) {
// NOTE: handle this 404 at last, maybe it was a "no keys found" error
@@ -285,7 +285,7 @@ public class HkpKeyserver extends Keyserver {
// group 1 contains the full fingerprint (v4) or the long key id if available
// see http://bit.ly/1d4bxbk and http://bit.ly/1gD1wwr
- String fingerprintOrKeyId = matcher.group(1).toLowerCase(Locale.US);
+ String fingerprintOrKeyId = matcher.group(1).toLowerCase(Locale.ENGLISH);
if (fingerprintOrKeyId.length() > 16) {
entry.setFingerprintHex(fingerprintOrKeyId);
entry.setKeyIdHex("0x" + fingerprintOrKeyId.substring(fingerprintOrKeyId.length()
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
index 1ba028006..7e18aa906 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
@@ -104,7 +104,7 @@ public class PgpKeyHelper {
* @return
*/
public static String convertFingerprintToHex(byte[] fingerprint) {
- String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.US);
+ String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.ENGLISH);
return hexString;
}
@@ -133,7 +133,7 @@ public class PgpKeyHelper {
}
private static String convertKeyIdToHex32bit(long keyId) {
- String hexString = Long.toHexString(keyId & 0xffffffffL).toLowerCase(Locale.US);
+ String hexString = Long.toHexString(keyId & 0xffffffffL).toLowerCase(Locale.ENGLISH);
while (hexString.length() < 8) {
hexString = "0" + hexString;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java
index c4ecfdec5..7789ee064 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java
@@ -388,8 +388,8 @@ public class PassphraseCacheService extends Service {
} else {
// Fallback, since expandable notifications weren't available back then
builder.setSmallIcon(R.drawable.ic_launcher)
- .setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys,
- mPassphraseCache.size())))
+ .setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys),
+ mPassphraseCache.size()))
.setContentText(getString(R.string.passp_cache_notif_click_to_clear));
Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
index ac228c9f6..568772709 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -103,7 +103,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
- requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+ supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
mExportHelper = new ExportHelper(this);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index f1c17bfb5..b95dee12c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -32,6 +32,7 @@ import org.sufficientlysecure.keychain.util.Log;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Locale;
public class EncryptKeyCompletionView extends TokenCompleteTextView {
public EncryptKeyCompletionView(Context context) {
@@ -242,8 +243,8 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
@Override
protected boolean keepObject(EncryptionKey obj, String mask) {
- String m = mask.toLowerCase();
- return obj.getUserId().toLowerCase().contains(m) ||
+ String m = mask.toLowerCase(Locale.ENGLISH);
+ return obj.getUserId().toLowerCase(Locale.ENGLISH).contains(m) ||
obj.getKeyIdHex().contains(m) ||
obj.getKeyIdHexShort().startsWith(m);
}
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_cloud.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_cloud.png
deleted file mode 100644
index 3daa64131..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_cloud.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_good.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_good.png
deleted file mode 100644
index 38051d8d6..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_good.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_important_small.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_important_small.png
deleted file mode 100644
index a1804b2c1..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_important_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search.png
deleted file mode 100644
index 1cb61faf4..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search_list.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search_list.png
deleted file mode 100644
index efee6dfd2..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_menu_search_list.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_next.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_next.png
deleted file mode 100644
index d71058055..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_next.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_previous.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_previous.png
deleted file mode 100644
index d610e4667..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/ic_previous.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_small.png b/OpenKeychain/src/main/res/drawable-hdpi/key_small.png
deleted file mode 100644
index 6966048a1..000000000
Binary files a/OpenKeychain/src/main/res/drawable-hdpi/key_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-ldpi/ic_next.png b/OpenKeychain/src/main/res/drawable-ldpi/ic_next.png
deleted file mode 100644
index 474ed8faa..000000000
Binary files a/OpenKeychain/src/main/res/drawable-ldpi/ic_next.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-ldpi/ic_previous.png b/OpenKeychain/src/main/res/drawable-ldpi/ic_previous.png
deleted file mode 100644
index 6fd885e6b..000000000
Binary files a/OpenKeychain/src/main/res/drawable-ldpi/ic_previous.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-ldpi/key_small.png b/OpenKeychain/src/main/res/drawable-ldpi/key_small.png
deleted file mode 100644
index 073b95029..000000000
Binary files a/OpenKeychain/src/main/res/drawable-ldpi/key_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_cloud.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_action_cloud.png
deleted file mode 100644
index 266d4c21f..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_cloud.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_good.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_action_good.png
deleted file mode 100644
index 13967b30a..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_good.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_important_small.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_action_important_small.png
deleted file mode 100644
index 11a25b504..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_important_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search.png
deleted file mode 100644
index 2369d03f3..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search_list.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search_list.png
deleted file mode 100644
index 9033f1ec2..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_menu_search_list.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_next.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_next.png
deleted file mode 100644
index 8271c1380..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_next.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_previous.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_previous.png
deleted file mode 100644
index ef90db972..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/ic_previous.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_small.png b/OpenKeychain/src/main/res/drawable-mdpi/key_small.png
deleted file mode 100644
index c806b6041..000000000
Binary files a/OpenKeychain/src/main/res/drawable-mdpi/key_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_cloud.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_cloud.png
deleted file mode 100644
index 0769899fd..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_cloud.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_good.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_good.png
deleted file mode 100644
index 0bb45d2c0..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_good.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_important_small.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_important_small.png
deleted file mode 100644
index 40ca1572c..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_important_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search.png
deleted file mode 100644
index 578cb24eb..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search_list.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search_list.png
deleted file mode 100644
index de20fa0e7..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xhdpi/ic_menu_search_list.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_cloud.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_cloud.png
deleted file mode 100644
index f97084dbe..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_cloud.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_good.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_good.png
deleted file mode 100644
index fda51ad86..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_good.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_important_small.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_important_small.png
deleted file mode 100644
index 44754152f..000000000
Binary files a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_important_small.png and /dev/null differ
diff --git a/OpenKeychain/src/main/res/layout/api_account_settings_fragment.xml b/OpenKeychain/src/main/res/layout/api_account_settings_fragment.xml
index 7bb861547..aaeae78e0 100644
--- a/OpenKeychain/src/main/res/layout/api_account_settings_fragment.xml
+++ b/OpenKeychain/src/main/res/layout/api_account_settings_fragment.xml
@@ -53,7 +53,7 @@
android:text="@string/api_settings_create_key"
android:background="@drawable/button_edgy"
android:drawableLeft="@drawable/ic_action_accounts"
- android:textSize="14dip"/>
+ android:textSize="14sp"/>
+ android:textSize="14sp"/>
+ android:gravity="center_vertical" />
AppsKeyserver PreferenceChange Passphrase
- Set Passphrase
- Share with…Share fingerprint with…Share key with…Share file with…
@@ -37,23 +35,17 @@
GeneralDefaultsAdvanced
- Master Key
- Primary IdentityActionsWhole keyYour Key used for certificationUpload KeyKeyserver
- Encrypt and/or Sign
- Decrypt and VerifyFingerprintKey to be certified
- CertifyDecrypt, verify, and save fileDecrypt and verify message
- From ClipboardEncrypt and save fileEncrypt and share fileSave
@@ -61,16 +53,10 @@
DeleteNoneOkay
- Change New Passphrase
- Set New PassphraseUpload To KeyserverNextBack
- Clipboard
- Share with…Lookup key
- Show advanced settings
- Hide advanced settingsEncrypt and share messageView certification keyCreate key
@@ -84,16 +70,6 @@
Create my keyImport existing keySearch
- Keyserver…
- Share…
- Share fingerprint…
- Share whole key…
- with…
- with…
- with QR Code
- with QR Code
- with NFC
- Copy to clipboardBeam settingsCancelEncrypt to…
@@ -103,7 +79,6 @@
Show advanced info
- SignMessageFileFile(s)
@@ -116,12 +91,10 @@
Files: ASCII ArmorLet others know that you\'re using OpenKeychainWrites \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys
- RecipientsFrom:ToFiles: Delete After EncryptionDelete After Decryption
- Share After EncryptionEncryption AlgorithmHash AlgorithmWith Public Key
@@ -142,14 +115,8 @@
EmailUpload key to selected keyserver after certificationFingerprint
- SelectSet expiry date
-
- %d selected
- %d selected
-
-
<no name><none><no key>
@@ -202,9 +169,7 @@
Wrong passphrase.
- Set a passphrase first.No compatible file manager installed.
- The file manager does not support saving files.The passphrases didn\'t match.Please enter a passphrase.Symmetric encryption.
@@ -222,8 +187,6 @@
Please specify which file to export to.\nWARNING: File will be overwritten if it exists.Do you really want to delete all selected public keys?\nYou can\'t undo this!Do you really want to delete the SECRET key \'%s\'?\nYou can\'t undo this!
- You have made changes to the keyring, would you like to save it?
- You have added an empty identity, are you sure you want to continue?Do you really want to delete the public key \'%s\'?\nYou can\'t undo this!Also export secret keys
@@ -244,7 +207,6 @@
Successfully sent key with NFC Beam!Key has been copied to the clipboard!Fingerprint has been copied to the clipboard!
- Key has already been certified!Please select a key to be used for certification!Key is too big to be shared this way!
@@ -258,23 +220,17 @@
no suitable secret key foundexternal storage not readykey size must be at least 512bit
- the master key cannot be an ElGamal keyunknown algorithm choiceno email foundneed at least one identity
- primary identity must not be empty
- need at least a master keyno passphrase givenno signature key givennot valid encryption dataintegrity check failed! Data has been modified!wrong passphrase
- error saving some keyscould not extract private key
- expiry date must come after creation date
- Direct binary data without actual file in filesystem is not supported.You need Android 4.1 to use Android\'s NFC Beam feature!NFC is not available on your device!No keys found!
@@ -289,7 +245,6 @@
part of the loaded file is a valid OpenPGP object but not a OpenPGP keyparts of the loaded file are valid OpenPGP objects but not OpenPGP keys
- You must make changes to the keyring before you can save itInvalid signature!
@@ -309,10 +264,7 @@
exporting…uploading…building key…
- certifying master key…building master ring…
- adding sub keys…
- saving key…generating new RSA key…generating new DSA key…generating new ElGamal key…
@@ -333,11 +285,6 @@
exporting keys…
-
- generating key, this can take up to 3 minutes…
- generating keys, this can take up to 3 minutes…
-
-
extracting signature key…extracting key…preparing streams…
@@ -357,7 +304,6 @@
Name/Email/Key ID…
- Share Key with…Name/Keybase.io username…
@@ -393,23 +339,9 @@
QR Code/NFCKeybase.ioImport selected keys
- Import from clipboard
-
-
- Missing QR Code with ID %s
- Missing QR Codes with IDs %s
-
-
- Please start with QR Code with ID 1QR Code malformed! Please try again!
- QR Code scanning finished!Fingerprint is too short (< 16 characters)
- Scan QR Code with \'Barcode Scanner\'
- To receive keys via NFC, the device needs to be unlocked.
- HelpScan QR Code…
- Get key from clipboard
- Get key from Keybase.io
@@ -469,9 +401,6 @@
Share with QR Code
- Go through all QR Codes using \'Next\', and scan them one by one.
- Fingerprint:
- QR Code with ID %1$d of %2$dShare with NFC
@@ -531,11 +460,9 @@
KeysSign and EncryptDecrypt and Verify
- Import KeysAppsOpen navigation drawerClose navigation drawer
- EditMy Keys
@@ -736,13 +663,11 @@
TypeKey not found!Error processing key!
- subkey unavailablestrippedYour own keys can only be deleted individually!View Certificate Detailsunknowncannot sign
- Encoding errorNo encryption subkey available!Do not create OpenKeychain-Accounts manually.\nFor more information, see Help.Show key (%s)
--
cgit v1.2.3
From f5f6102458b72b9f5763f3155e7dae649295a6c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 16:33:05 +0200
Subject: Pull from transifex
---
OpenKeychain/src/main/res/raw-ar/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-cs/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-el/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-es/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-et/help_start.html | 2 +-
.../src/main/res/raw-fr/help_changelog.html | 6 +-
OpenKeychain/src/main/res/raw-fr/help_wot.html | 2 +-
.../src/main/res/raw-ja/help_changelog.html | 2 +-
OpenKeychain/src/main/res/raw-ja/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-ja/help_wot.html | 2 +-
OpenKeychain/src/main/res/raw-ko/help_start.html | 2 +-
.../src/main/res/raw-pl/help_changelog.html | 2 +-
OpenKeychain/src/main/res/raw-pl/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-ro/help_about.html | 50 ++++
.../src/main/res/raw-ro/help_changelog.html | 156 +++++++++++++
.../src/main/res/raw-ro/help_nfc_beam.html | 12 +
OpenKeychain/src/main/res/raw-ro/help_start.html | 22 ++
OpenKeychain/src/main/res/raw-ro/help_wot.html | 17 ++
.../src/main/res/raw-ro/nfc_beam_share.html | 11 +
OpenKeychain/src/main/res/raw-ru/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-tr/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-uk/help_start.html | 2 +-
OpenKeychain/src/main/res/raw-zh/help_start.html | 2 +-
.../src/main/res/raw-zh/nfc_beam_share.html | 2 +-
OpenKeychain/src/main/res/values-ar/strings.xml | 6 +
OpenKeychain/src/main/res/values-cs/strings.xml | 176 ++++++++++++--
OpenKeychain/src/main/res/values-de/strings.xml | 166 ++++++--------
OpenKeychain/src/main/res/values-el/strings.xml | 12 +-
OpenKeychain/src/main/res/values-es/strings.xml | 219 +++++++++---------
OpenKeychain/src/main/res/values-et/strings.xml | 20 +-
OpenKeychain/src/main/res/values-fr/strings.xml | 255 +++++++++++----------
OpenKeychain/src/main/res/values-it/strings.xml | 184 +++++++--------
OpenKeychain/src/main/res/values-ja/strings.xml | 206 +++++++++--------
OpenKeychain/src/main/res/values-ko/strings.xml | 6 +
OpenKeychain/src/main/res/values-nl/strings.xml | 101 +-------
OpenKeychain/src/main/res/values-pl/strings.xml | 97 +-------
OpenKeychain/src/main/res/values-ro/strings.xml | 43 ++++
OpenKeychain/src/main/res/values-ru/strings.xml | 117 +---------
OpenKeychain/src/main/res/values-sk/strings.xml | 6 +
OpenKeychain/src/main/res/values-sl/strings.xml | 154 ++++---------
OpenKeychain/src/main/res/values-tr/strings.xml | 28 +--
OpenKeychain/src/main/res/values-uk/strings.xml | 144 ++++--------
OpenKeychain/src/main/res/values-zh/strings.xml | 26 +--
43 files changed, 1131 insertions(+), 1143 deletions(-)
create mode 100644 OpenKeychain/src/main/res/raw-ro/help_about.html
create mode 100644 OpenKeychain/src/main/res/raw-ro/help_changelog.html
create mode 100644 OpenKeychain/src/main/res/raw-ro/help_nfc_beam.html
create mode 100644 OpenKeychain/src/main/res/raw-ro/help_start.html
create mode 100644 OpenKeychain/src/main/res/raw-ro/help_wot.html
create mode 100644 OpenKeychain/src/main/res/raw-ro/nfc_beam_share.html
create mode 100644 OpenKeychain/src/main/res/values-ro/strings.xml
diff --git a/OpenKeychain/src/main/res/raw-ar/help_start.html b/OpenKeychain/src/main/res/raw-ar/help_start.html
index 3a681f8fa..51a76c01e 100644
--- a/OpenKeychain/src/main/res/raw-ar/help_start.html
+++ b/OpenKeychain/src/main/res/raw-ar/help_start.html
@@ -2,7 +2,7 @@
Getting started
-
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
Primero necesita una clave privada (secreta) personal. Cree una mediante las opciones de menú en "Claves", o importe claves privadas existentes. En adelante puede descargar las claves de sus amigos, o intercambiarlas mediante códigos QR o vía NFC.
+
Primero necesita una clave privada (secreta) personal. Cree una mediante las opciones de menú en "Claves", o importe claves privadas existentes. En adelante puede descargar las claves de sus amigos, o intercambiarlas mediante códigos QR o vía NFC.
Es recomendable que instales OI File Manager para una mejor selección de archivos y Barcode Scanner para escanear los códigos QR generados. Pulsando en los enlaces se abrirá Google Play o F-Droid.
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
diff --git a/OpenKeychain/src/main/res/raw-fr/help_changelog.html b/OpenKeychain/src/main/res/raw-fr/help_changelog.html
index 2746881fb..82486cdcc 100644
--- a/OpenKeychain/src/main/res/raw-fr/help_changelog.html
+++ b/OpenKeychain/src/main/res/raw-fr/help_changelog.html
@@ -38,7 +38,7 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
prise en charge des ports du serveur de clefs
désactiver la possibilité de générer des clefs faibles
bien plus de travail interne sur l'API
-
certifier les ID des utilisateurs
+
certifier les ID d'utilisateurs
requête du serveur de clef basée sur une sortie lisible par la machine
verrouiller le tiroir de navigation sur les tablettes
suggestions de courriels à la création des clefs
@@ -56,7 +56,7 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
autres correctifs internes affectant la modifications des clefs (merci à Ash hughes)
interrogation des serveurs de clefs directement depuis l'écran d'importation
correctif de mise en page et du style des fenêtres de dialogue sur Android 2.2-3.0
-
corrige un plantage pour les clefs avec des ID utilisateur vides
+
corriger un plantage pour les clefs avec des ID d'utilisateurs vides
corrige un plantage et des listes vides en revenant de l'écran de signature
Bouncy Castle (bibliothèque cryptographique) mise à jour de 1.47 à 1.50 et compilée depuis la source
correction du téléversement d'une clef depuis l'écran de signature
@@ -111,7 +111,7 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
correction de l'ajout de compte sur Froyo
suppression sécurisée de fichiers
option de suppression du fichier de clef après l'importation
-
chiffrement/déchiffrement de flux (galerie, etc...)
+
chiffrement/déchiffrement de flux (galerie, etc.)
nouvelles options (langue, forcer les signatures v3)
L'évaluation de la confiance est fondée sur la simple supposition que toutes les clefs ayant des clefs secrètes disponibles sont de confiance. Les clefs publiques contenant au moins un ID d'utilisateur certifié par une clef de confiance seront marquées par un point vert dans le listage des clefs. Il n'est pas (encore) possible de spécifier les niveaux de confiance pour les certificats d'autres clefs publiques inconnues.
Certifications des clefs
-
La prise en charge de la certification des clefs est disponible et les ID d'utilisateur peuvent être certifiées individuellement. Il n'est pas encore possible de spécifier le niveau de confiance ou de créer des certificats locaux et d'autres types spéciaux.
+
La prise en charge de la certification des clefs est disponible et les ID d'utilisateurs peuvent être certifiées individuellement. Il n'est pas encore possible de spécifier le niveau de confiance ou de créer des certificats locaux et d'autres types spéciaux.
diff --git a/OpenKeychain/src/main/res/raw-ja/help_changelog.html b/OpenKeychain/src/main/res/raw-ja/help_changelog.html
index 0aae03ba6..0bde8d000 100644
--- a/OpenKeychain/src/main/res/raw-ja/help_changelog.html
+++ b/OpenKeychain/src/main/res/raw-ja/help_changelog.html
@@ -38,7 +38,7 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
diff --git a/OpenKeychain/src/main/res/raw-pl/help_changelog.html b/OpenKeychain/src/main/res/raw-pl/help_changelog.html
index d94ac3c0f..8fce6c475 100644
--- a/OpenKeychain/src/main/res/raw-pl/help_changelog.html
+++ b/OpenKeychain/src/main/res/raw-pl/help_changelog.html
@@ -136,7 +136,7 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
Zalecana jest instalacja menadżera plików OI File Manager w celu zapewnienia wygodniejszego wyboru plików oraz programu Barcode Scanner, który jest w stanie skanować wygenerowane kody QR. Kliknięcie na powyższe linki przekieruje Cię do sklepu Google Play / F-Droid.
support for GnuPG partial secret keys (thanks to Vincent Breitmoser)
+
new design for signature verification
+
custom key length (thanks to Greg Witczak)
+
fix share-functionality from other apps
+
+
2.5
+
+
fix decryption of symmetric pgp messages/files
+
refactored edit key screen (thanks to Ash Hughes)
+
new modern design for encrypt/decrypt screens
+
OpenPGP API version 3 (multiple api accounts, internal fixes, key lookup)
+
+
2.4
+
Thanks to all applicants of Google Summer of Code 2014 who made this release feature rich and bug free!
+Besides several small patches, a notable number of patches are made by the following people (in alphabetical order):
+Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Paul Sarbinowski, Sreeram Boyapati, Vincent Breitmoser.
+
+
new unified key list
+
colorized key fingerprint
+
support for keyserver ports
+
deactivate possibility to generate weak keys
+
much more internal work on the API
+
certify user ids
+
keyserver query based on machine-readable output
+
lock navigation drawer on tablets
+
suggestions for emails on creation of keys
+
search in public key lists
+
and much more improvements and fixes…
+
+
2.3.1
+
+
hotfix for crash when upgrading from old versions
+
+
2.3
+
+
remove unnecessary export of public keys when exporting secret key (thanks to Ash Hughes)
+
fix setting expiry dates on keys (thanks to Ash Hughes)
+
more internal fixes when editing keys (thanks to Ash Hughes)
+
querying keyservers directly from the import screen
+
fix layout and dialog style on Android 2.2-3.0
+
fix crash on keys with empty user ids
+
fix crash and empty lists when coming back from signing screen
+
Bouncy Castle (cryptography library) updated from 1.47 to 1.50 and build from source
+
fix upload of key from signing screen
+
+
2.2
+
+
new design with navigation drawer
+
new public key list design
+
new public key view
+
bug fixes for importing of keys
+
key cross-certification (thanks to Ash Hughes)
+
handle UTF-8 passwords properly (thanks to Ash Hughes)
+
first version with new languages (thanks to the contributors on Transifex)
+
sharing of keys via QR Codes fixed and improved
+
package signature verification for API
+
+
2.1.1
+
+
API Updates, preparation for K-9 Mail integration
+
+
2.1
+
+
lots of bug fixes
+
new API for developers
+
PRNG bug fix by Google
+
+
2.0
+
+
complete redesign
+
share public keys via qr codes, nfc beam
+
sign keys
+
upload keys to server
+
fixes import issues
+
new AIDL API
+
+
1.0.8
+
+
basic keyserver support
+
app2sd
+
more choices for pass phrase cache: 1, 2, 4, 8, hours
+
translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)
+
bugfixes
+
optimizations
+
+
1.0.7
+
+
fixed problem with signature verification of texts with trailing newline
+
more options for pass phrase cache time to live (20, 40, 60 mins)
+
+
1.0.6
+
+
account adding crash on Froyo fixed
+
secure file deletion
+
option to delete key file after import
+
stream encryption/decryption (gallery, etc.)
+
new options (language, force v3 signatures)
+
interface changes
+
bugfixes
+
+
1.0.5
+
+
German and Italian translation
+
much smaller package, due to reduced BC sources
+
new preferences GUI
+
layout adjustment for localization
+
signature bugfix
+
+
1.0.4
+
+
fixed another crash caused by some SDK bug with query builder
+
+
1.0.3
+
+
fixed crashes during encryption/signing and possibly key export
+
+
1.0.2
+
+
filterable key lists
+
smarter pre-selection of encryption keys
+
new Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers
+
fixes and additional features (key preselection) for K-9 Mail, new beta build available
+
+
1.0.1
+
+
GMail account listing was broken in 1.0.0, fixed again
+
+
1.0.0
+
+
K-9 Mail integration, APG supporting beta build of K-9 Mail
+
support of more file managers (including ASTRO)
+
Slovenian translation
+
new database, much faster, less memory usage
+
defined Intents and content provider for other apps
Go to your partners contacts and open the contact you want to share.
+
Hold the two devices back to back (they have to be almost touching) and you’ll feel a vibration.
+
After it vibrates you’ll see the content on your partners device turn into a card-like object with Star Trek warp speed-looking animation in the background.
+
Tap the card and the content will then load on the your device.
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
+
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
+
+
Applications
+
Several applications support OpenKeychain to encrypt/sign your private communication:
K-9 Mail: OpenKeychain support available in current alpha build! Conversations: Jabber/XMPP client PGPAuth: App to send a PGP-signed request to a server to open or close something, e.g. a door
The Web of Trust describes the part of PGP which deals with creation and bookkeeping of certifications. It provides mechanisms to help the user keep track of who a public key belongs to, and share this information with others; To ensure the privacy of encrypted communication, it is essential to know that the public key you encrypt to belongs to the person you think it does.
+
+
Support in OpenKeychain
+
There is only basic support for Web of Trust in OpenKeychain. This is a heavy work in progress and subject to changes in upcoming releases.
+
+
Trust Model
+
Trust evaluation is based on the simple assumption that all keys which have secret keys available are trusted. Public keys which contain at least one user id certified by a trusted key will be marked with a green dot in the key listings. It is not (yet) possible to specify trust levels for certificates of other known public keys.
+
+
Certifying keys
+
Support for key certification is available, and user ids can be certified individually. It is not yet possible to specify the level of trust or create local and other special types of certificates.
Для начала Вас нужен свой секретный ключ. Создайте его в меню раздела "Ключи" или импортируйте ранее созданный ключ. Позже вы сможете поделиться данными своего ключа с друзьями с помощью QR кода или NFC.
+
Для начала Вас нужен свой секретный ключ. Создайте его в меню раздела "Ключи" или импортируйте ранее созданный ключ. Позже вы сможете поделиться данными своего ключа с друзьями с помощью QR кода или NFC.
Рекомендуется установить OI File Manager для удобного выбора файлов и Barcode Scanner для распознавания QR кодов. Перейдите по ссылкам на соответствующие страницы Google Play или F-Droid для дальнейшей установки.
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
Спершу вам потрібний особистий секретний ключ. Створіть один через меню параметрів у „Ключі" або імпортуйте наявні секретні ключі через "Імпорт ключів". Після цього ви зможете завантажувати ключі ваших друзів чи обміняти їх через штрих-коди або NFC.
+
Спершу вам потрібний особистий секретний ключ. Створіть один через меню параметрів у „Ключі" або імпортуйте наявні секретні ключі через "Імпорт ключів". Після цього ви зможете завантажувати ключі ваших друзів чи обміняти їх через штрих-коди або NFC.
Рекомендуємо вам встановити OI File Manager для поліпшеного виділення файлів та Barcode Scanner для сканування згенерованих штрих-кодів. Натискання посилань відкриє Google Play або F-Droid для встановлення.
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
+
First you need a personal secret key. Create one via the option menus in "Keys" or import existing secret keys. Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.
It is recommended that you install OI File Manager for enhanced file selection and Barcode Scanner to scan generated QR Codes. Clicking on the links will open Google Play Store or F-Droid for installation.
diff --git a/OpenKeychain/src/main/res/values-ar/strings.xml b/OpenKeychain/src/main/res/values-ar/strings.xml
index 593fc2d11..4cf33460a 100644
--- a/OpenKeychain/src/main/res/values-ar/strings.xml
+++ b/OpenKeychain/src/main/res/values-ar/strings.xml
@@ -25,6 +25,9 @@
+
+
+
@@ -32,6 +35,9 @@
+
+
+
diff --git a/OpenKeychain/src/main/res/values-cs/strings.xml b/OpenKeychain/src/main/res/values-cs/strings.xml
index a7c24cd0e..2bb0ab5c8 100644
--- a/OpenKeychain/src/main/res/values-cs/strings.xml
+++ b/OpenKeychain/src/main/res/values-cs/strings.xml
@@ -1,17 +1,14 @@
- Vybrat veřejný klíč
- Vybrat veřjný klíčZašifrovatRozšifrovatHeslo
- Vytvořit klíčEditovat klíčMožnostiAppkyNastavení keyservrů
- Nastavit heslo
+ Změnit hesloZašifrovat do souboruRozšifrovat do souboruImportovat klíče
@@ -19,6 +16,8 @@
Exportovat klíčeKlíč nebyl nalezenNahrát na keyserver
+ Certifikovat identity
+ Detaily klíčeNápovědaIdentity
@@ -26,6 +25,10 @@
ObecnéVýchozí hodnotyPokročilé
+ Akce
+ Klíč použitý pro certifikaci
+ Uploadovat klíč
+ KeyserverZaširovat a uložit souborUložit
@@ -33,41 +36,31 @@
SmazatNicOK
- Změnit nové heslo
- Nastavit nové hesloNahrát na keyserverDalšíZpět
+ Vyhledat klíčNastavení
+ NápovědaExportovat do souboruSmazat klíč
- Vytvořit klíč
- Vytvořit klíč (pokročilé)Hledat
- Keyserver...
- Obnovit z keyservru
- Obnovit na keyserveru
- Sdílet...
- pomocí QR kódu
- pomocí NFCBeam settings
+ Zrušit
+ Zašifrovat do...
+ Vybrat vše
+ Přidat klíče
- PodepsatZprávaSouborBez heslaHeslo
- ZnovuAlgoritmusASCII Armor
- Příjemci
- Smazat po zašifrováníSmazat po rozšifrováníŠifrovací algoritmusHashovací algoritmus
- veřejným klíčem
- heslemCache heselKomprimovat zprávuKomprimovat soubor
@@ -82,11 +75,15 @@
KomentářEmailPo vytvoření nahrt na vybraný keyserver
+ Otisk
+ Nastavit datum expirace
+ <beze jména><žádný><žádný klíč>slouží k šifrovníslouží k podpisupo epiraci
+ revokovatTajný klíč:Žádný
@@ -101,15 +98,21 @@
2 hodiny4 hodiny8 hodin
+ navždyDSA
+ ElGamal
+ RSAOtevřít...VarovnáníChybaChyba: %s
+ Certifikovat
+ Podepsat
+ Zašifrovat
+ AuthentikovatŠpatné heslo.
- Nejprve nastavit heslo.Není nainstalován žádný compatibilní správce souborů.Hesla se neshodují.Prosím zadejte heslo.
@@ -124,7 +127,9 @@
Prosím specifikujte do kterého souboru zašifrovat.\nVAROVÁNÍ: Pokud soubor již existuje, bude přepsán.Prosím specifikujte do kterého souboru rozšifrovat.\nVAROVÁNÍ: Pokud soubor již existuje, bude přepsán.Prosím specifikujte do kterého souboru exportovat.\nVAROVÁNÍ: Pokud soubor již existuje, bude přepsán.
+ Opravdu si přejete smazat všechny vybrané veřejné klíče?\nToto nebude možné vzít zpět!Opravdu chcete smazat TAJNÝ klíč \'%s\'?\nToto je nevratná operace!
+ Opravdu chcete smazat veřejný klíč \'%s\'?\nToto nebude možné vrátit zpět!Úspěšně exportován 1 klíč.Úspěšně exportován %d klíč.Žádný kláč pro export.
@@ -132,6 +137,8 @@
Nemohu najít klíč %08X.Úspěšně nahráno na keyserver.Seznam je prázný!
+ Klíč byl zkopírován do schránky!
+ Klíč je příliš velký aby byl sdílen pomocí této metody!
@@ -140,32 +147,153 @@
žádný vhodný tajný klíč nenalezenexterní úložiště není připravenodélka klíče musí být alespoň 512 bitů
- hlavní klíč nemůže být typu ElGamalneznámý typ algoritmu
+ žádný email nenalezenpotřebuji alespoň jednu identitu
- hlavní identita nesmí být prázdná
- potřebuji alespoň hlavní klíč
+ nebylo poskytnuto heslo
+ nebyl poskytnut podpisový klíč
+ kryptovaná data nejsou správná
+ selhala kontrola integrity! Data byla pozměněna!
+ špatné heslo
+ nebylo možné extrahovat privátní klíč
+ Musíte mít Android 4.1 abyste mohli používat Androidí NFC Beam technologii!
+ NFC není na vašem zařízení k dispozici!
+ Žádný klíč nenalezen!
+ Nastala obecná chyba, prosím vytvořte nový bug report pro OpenKeychain.
+ Hotovo.
+ Zrušit
+ ukládám...
+ importuji...
+ exportuji...
+ vytvářím klíč...
+ vytvářím hlavní klíč...
+ extrahuji podpisový klíč...
+ extrahuji klíč...
+ připravuji streamy...
+ šifruji data...
+ dešifruji data...
+ připravuji podpis...
+ generuji podpis...
+ zpracovávám podpis...
+ verifikuji podpis...
+ podepisuji...
+ načítám data...
+ hledám klíč...
+ rozbaluji data...
+ verifikuji integritu...
+ mažu \'%s\' bezpečně...
+ Jméno/Email/ID klíče
+ 512
+ 768
+ 1024
+ 1536
+ 2048
+ 3072
+ 4096
+ 8192
+ Vlastní velikost klíče
+ Napište vlastní délku klíče (v bitech):
+ délka RSA klíče musí být větší než 1024 a nejvýše 8192. Zároveň musí být dělitelná 8mi.
+ Délka DSA klíče musí být alespoň 512 a nejvýše 1024. Zároveň musí být dělitelná 64.
+ rychle
+ velmi pomalu
+ Začít
+ FAQ
+ Síť důvěry
+ NFC Beam
+ Historie změn
+ O aplikaci
+ Verze:
+ Importovat vybrané klíče
+ QR kód nerozpoznán! Zkuste to znovu prosím!
+ Fingerprint je příliš krátký (< 16 znaků)
+ Dešifrovat soubor pomocí OpenKeychain
+ Importovat kíč pomocí OpenKeychain
+ Zašifrovat pomocí OpenKeychain
+ Dešifrovat pomocí OpenKeychain
+ Neregistrovaná appka!\n\nSeznam podporovaných aplikací třetích stran je možo nalézt v \'Nápovědě\'!
+ Zobrazit pokročilé informace
+ Schovat pokročilé informace
+ Zobrazit pokročilá nastavení
+ Schovat pokročilá nastavení
+ Žádný klíč nebyl vybrán
+ Vybrat klíč
+ Vytvořit nový klíč pro tento účet
+ Uložit
+ Zrušit
+ Zneplatnit přístup
+ Smazat účet
+ Jméno balíčku
+ SHA-256 z podpisu balíčku
+ Účty
+ Žádné účty nejsou specifikovány pro tuto appku.
+ Zobrazená appka chce zašifrovat/rozšifrovat zprávy a podepsat je vačím jménem.\nPovolit přístup?\n\nVAROVÁNÍ: Pokud nevíte proč se tato obrazovka objevila, zamítněte přístup! Také můžete zneplatnit přístup jindy v obrazovce \'Appky\'.
+ Povolit přístup
+ Zamítnout přístup
+ Prosím vyberte klíč!
+ Nebyl nalezen žádný veřejný klíč pro tyto identity:
+ Existuje více jak jeden veřejný klíč pro tyto identity:
+ Zkontrolujte prosím seznam příjemců!
+ Selhala kontrola podpisu! Instalovali jste tuto appku z jiného zdroje? Pokud jste si jistí, že toto není útok, zneplatněte registraci této appky v OpenKeychain a poté ji znovu zaregistrujte.
+ Sdílet pomocí QR kódu
+ Sdílet pomocí NFC
+ Žádné klíče nejsou zatím k dispozici...
+ Můžete začít pomocí
+ nebo
+ vytvářím váš vlastní klíč
+ Editovat klíč
+ Šifruji pomocí těchto klíčů.
+ Certifikovat identity
+ Hlavní info
+ Certifikáty
+
+
+
+ Podepisuji a šifruji
+ Dešifruji a kontroluji
+ Appky
+ Otevřít navigační panel
+ Zavří navigační panel
+ Moje Klíče
+ výchozí
+ žádný
+ příležitostně
+ pozitivní
+ revokované
+ OK
+ selhalo!
+ chyba!
+ klíč není k dispozici
+
+
+ Identita
+ <neznámý>
+ Žádné certifikáty pro tento klíč
+ Důvod revokace
+ Stav ověření
+ Typ
+
diff --git a/OpenKeychain/src/main/res/values-de/strings.xml b/OpenKeychain/src/main/res/values-de/strings.xml
index 9d9868457..e6e594708 100644
--- a/OpenKeychain/src/main/res/values-de/strings.xml
+++ b/OpenKeychain/src/main/res/values-de/strings.xml
@@ -1,19 +1,17 @@
- Öffentlichen Schlüssel auswählen
- Privaten Schlüssel auswählen
+ Wähle Schlüssel
+ Wähle Deinen SchlüsselVerschlüsselnEntschlüsselnPasswort
- Schlüssel erstellen
+ Erzeuge Deinen SchlüsselSchlüssel bearbeitenEinstellungenApps
- Schlüsselserver
- Passphrase ändern
- Passwort setzen
- Teilen über...
+ Schlüsselserver Einstellungen
+ Passwort ändernTeile Fingerabdruck über…Teile Schlüssel über...Datei teilen mit…
@@ -27,66 +25,43 @@
Identitäten beglaubigenSchlüsseldetailsHilfe
+ LogIdentitätenUnterschlüsselAllgemeinStandardwerteFortgeschrittene Einstellungen
- Hauptschlüssel
- HauptidentitätAktionenGesamter SchlüsselMit diesem Schlüssel beglaubigenSchlüssel hochladenSchlüsselserver
- Verschlüsseln und/oder Signieren
- Entschlüsseln und VerifizierenFingerabdruckZu beglaubigender Schlüssel
- BeglaubigenDatei entschlüsseln, verifizieren und speichernEntschlüsseln und verifizieren
- Aus der ZwischenablageDatei verschlüsseln und speichernSpeichernAbbrechenLöschenKeineOkay
- Passwort ändern
- Neues Passwort setzenAuf Schlüsselserver hochladenWeiterZurück
- Zwischenablage
- Teilen mit…Schlüssel nachschlagen
- Erweiterte Einstellungen anzeigen
- Erweiterte Einstellungen verbergen
- Verschlüsselt/signierte Nachricht teilen…Beglaubigungsschlüssel anzeigen
+ Erzeuge SchlüsselEinstellungenHilfeIn Datei exportierenSchlüssel löschen
- Schlüssel erstellen
- Schlüssel erstellen (Experte)
+ Erzeuge meinen Schlüssel
+ Importiere existierenden SchlüsselSuchen
- Schlüsselserver…
- Von einem Schlüsselserver aktualisieren
- Auf Schlüsselserver hochladen
- Teilen…
- Teile Fingerabdruck…
- Teile gesamten Schlüssel…
- mit…
- mit…
- mit QR-Code
- mit QR-Code
- mit NFC
- In die Zwischenablage kopierenBeam-EinstellungenAbbrechenVerschlüsseln nach…
@@ -95,22 +70,18 @@
Alle Schlüssel exportierenErweiterte Info anzeigen
- SignierenNachrichtDateiKein PasswortPasswort
- Wiederholen
+ Passwort wiederholenAlgorithmusASCII-Armor
- Empfänger
- Nach Verschlüsselung löschen
+ Lass andere wissen dass du OpenKeychain nutzt
+ Fügt \'OpenKeychain v2.7\' zu OpenPGP Signaturen, Daten und exportierten Schlüsseln hinzuNach Entschlüsselung löschen
- Nach Verschlüsselung teilenVerschlüsselungsalgorithmusHash-Algorithmus
- mit Öffentlichem Schlüssel
- mit PasswortPasswort-CacheNachrichten-KomprimierungDatei-Komprimierung
@@ -127,12 +98,7 @@
E-MailSchlüssel nach Beglaubigung auf ausgewählten Schlüsselserver hochladenFingerabdruck
- AuswählenAblaufdatum festsetzen
-
- %d ausgewählt
- %d ausgewählt
- <kein Name><keine><kein Schlüssel>
@@ -179,7 +145,6 @@
AuthentifizierenFalsches Passwort.
- Zuerst muss ein Passwort gesetzt werden.Kein passender Dateimanager installiert.Die Passwörter stimmten nicht überein.Bitte ein Passwort eingeben.
@@ -198,15 +163,12 @@
Bitte angeben, in welche Datei exportiert werden soll.\nWARNUNG: Datei wird überschrieben, wenn sie bereits existiert. Möchtest du wirklich alle ausgewählten öffentlichen Schlüssel löschen?\nDies kann nicht rückgängig gemacht werden!Soll der PRIVATE Schlüssel \'%s\' wirklich gelöscht werden?\nDies kann nicht rückgängig gemacht werden!
- Es wurden am Schlüsselbund Veränderungen vorgenommen. Sollen dies gespeichert werden?
- Es wurde eine leere Identität hinzugefügt. Wirklich fortfahren?Soll der öffentliche Schlüssel \'%s\' wirklich gelöscht werden?\nDies kann nicht rückgängig gemacht werden!
- Private Schlüssel auch exportieren
+ Exportiere auch private Schlüssel1 Schlüssel erfolgreich exportiert.%d Schlüssel erfolgreich exportiert.Keine Schlüssel exportiert.Beachte: Nur Unterschlüssel unterstützen ElGamal.
- Beachte: RSA-Schlüssel mit einer Schlüssellänge von 1024-Bits oder weniger werden als unsicher angesehen und können daher nicht für neue Schlüssel erstellt werden.Schlüssel %08X konnte nicht gefunden werden.%d schlechter privater Schlüssel ignoriert. Evtl. wurde er mit folgender Option exportiert:\n --export-secret-subkeys\nUnbedingt mit der Option \n --export-secret-keys\nexportieren.
@@ -218,7 +180,6 @@
Schlüssel erfolgreich mit NFC-Beam gesendet!Schlüssel wurde in die Zwischenablage kopiert!Fingerabdruck wurde in die Zwischenablage kopiert!
- Schlüssel wurde bereits beglaubigtBitte wähle einen Schlüssel um zu Beglaubigen!Schlüssel ist zu groß um so geteilt zu werden!
- Binäre Daten ohne ohne Datei im Dateisystem werden nicht unterstützt.Android 4.1 wird benötigt um Androids NFC Beam nutzen zu können!NFC steht auf diesem Gerät nicht zur Verfügung!
- zu kurze Schlüsselanfrage
- Die Schlüsselanfrage liefert zu viele Ergebnisse. Bitte verfeinern sie sie Anfrage.
+ Keine Schlüssel gefunden!
+ Suchanfrage zu kurz. Bitte ändere deine Andrage!
+ Ein Fehler ist beim Suchen der Schlüssel aufgetreten.
+ Die Schlüsselsuche ergab zu viele Treffer. Bitte präzisiere deine Anfrage!
+ Keine oder zu viele Schlüssel wurden gefunden. Bitte verbessere deine Anfrage!
+ Keine gültigen Schlüssel in Datei/Zwischenablage gefunden!Ein allgemeiner Fehler trat auf, bitte schreiben Sie einen neuen Bugreport für OpenKeychain.Ein Teil der geladenen Datei ist ein gültiges OpenPGP Objekt aber kein OpenPGP SchlüsselTeile der geladenen Dateien sind gültige OpenPGP Objekte aber keine OpenPGP Schlüssel
- Es müssen vorm Speichern erst Veränderungen am Schlüsselbund vorgenommen werdenUngültige Signatur!Unbekannter öffentlicher Schlüssel
@@ -270,19 +228,23 @@
wird gespeichert…wird importiert…wird exportiert…
+ hochladen...Schlüssel wird erstellt…
- Hauptschlüssel wird beglaubigt…Hauptschlüssel wird erstellt…
- Unterschlüssel wird hinzugefügt…
- Schlüssel wird gespeichert…
+ erzeuge neuen RSA Schlüssel...
+ erzeuge neuen DSA Schlüssel...
+ erzeuge neuen ElGamal Schlüssel...
+ verändere Schlüsselbund...
+ entsperre Schlüsselbund...
+ füge User ID hinzu...
+ ändere Haupt User ID...
+ verändere Unterschlüssel...
+ füge Unterschlüssel hinzu...
+ ändere Passwort...Schlüssel wird exportiert…Schlüssel werden exportiert…
-
- Schlüssel wird erstellt, das kann bis zu 3 Minuten dauern…
- Schlüssel wird erstellt, das kann bis zu 3 Minuten dauern…
- Signaturschlüssel wird extrahiert…Schlüssel wird extrahiert…Datenstrom wird vorbereitet…
@@ -299,8 +261,8 @@
Integrität wird überprüft…\'%s\' wird sicher gelöscht…
- Private Schlüssel suchen
- Teile Schlüssel über…
+ Name/Email/Schlüssel ID...
+ Name/Keybase.io Benutzername...512768
@@ -326,29 +288,38 @@
ÜberVersion:
+ Schlüsselserver
+ Datei/Zwischenablage
+ QR Kode/NFC
+ Keybase.ioAusgewählte Schlüssel importieren
- Zwischenablage
-
- QR-Codes mit folgender ID fehlt: %s
- QR-Codes mit folgenden IDs fehlen: %s
-
- Bitte fange mit QR-Code der ID 1 anFalsch formatierter QR-Code! Bitte erneut versuchen!
- QR-Code wurde erfolgreich eingescannt!Der Fingerabdruck ist zu kurz (< 16 Zeichen)
- Qr-Code mittels \'Barcode Scanner\' einscannen
- Um Schlüssel über NFC zu erhalten muss das Gerät entsperrt sein.
- Hilfe
- Schlüssel aus der Zwischenablage einfügen
- Schlüssel von Keybase.io erhalten
+ QR Kode Einlesen...
+
+ 1 Schlüssel erfolgreich importiert
+ %1$d Schlüssel erfolgreich importiert
+
+
+ Schlüssel %2$s erfolgreich importiert
+ %1$d Schlüssel erfolgreich importiert: %2$s.
+
+
+ Schlüssel %2$s erfolgreich aktualisiert.
+ %1$d Schlüssel erfolgreich aktualisiert: %2$s.
+
+ Log ansehen
+ Nichts zu importieren.
+ Fehler bei der Verarbeitung der Schlüssel!
+ , mit WarnungenDatei entschlüsseln mit OpenKeychainSchlüssel importieren mit OpenKeychainVerschlüsseln mit OpenKeychain Entschlüsseln mit OpenKeychain
- Keine verknüpften Apps vorhanden\n\nEine Liste von unterstützten Drittanbieter-Apps finden Sie unter \"Hilfe\"!
+ Keine registrierten Apps!\n\nEine Liste der unterstützten Anwendungen ist in der \'Hilfe\' verfügbar.Erweiterte Informationen anzeigenErweiterte Informationen ausblendenErweiterte Einstellungen anzeigen
@@ -364,9 +335,8 @@
PaketnameSHA-256 der PaketsignaturKonten
- Keine Accounts mit dieser App verknüpft.
- Die Anwendung erfordert die Erstellung eines neuen Accounts. Bitte wähle einen existierenden Schlüssel oder erstelle einen neuen.\nAnwendungen sind auf die Nutzung der Schlüssel beschränkt, die du hier auswählst!
- Folgende Anwendung beantragt Zugriff auf OpenKeychains API.\nZugriff erlauben?\n\nVORSICHT: Sollten Sie nicht wissen, warum diese Anfrage erscheint, sollten Sie den Zugriff nicht erlauben! Sie können Zugriffe später über das Menü \'Registrierte Anwendungen\' widerrufen.
+ Keine Konten mit dieser Anwendung verknüpft.
+ Folgende Anwendung möchte Nachrichten ver-/entschlüsseln und in Ihrem Namen signieren\nZugriff erlauben?\n\nVORSICHT: Sollten Sie nicht wissen warum dieses Fenster erscheint, sollten Sie den Zugriff nicht gewähren! Sie können Zugriffe später über das Menü \'Anwendungen\' widerrufen.Zugriff erlaubenZugriff verbietenBitte einen Schlüssel auswählen!
@@ -376,9 +346,6 @@
Signaturüberprüfung fehlgeschlagen! Haben Sie diese Anwendung aus einer anderen Quelle installiert? Wenn Sie eine Attacke ausschliessen können, sollten Sie die Registrierung der App in OpenKeychain widerrufen und die Anwendung erneut registrieren.Über QR-Code teilen
- Mit \'Weiter\' durch alle QR-Codes gehen und diese nacheinander scannen.
- Fingerabdruck:
- QR-Code mit ID %1$d von %2$dÜber NFC teilen
@@ -389,7 +356,6 @@
Du kannst anfangen OpenKeychain zu benutzen indem duoderdeinen eigenen Schlüssel erstellst
- existierende Schlüssel importierst.Schlüssel bearbeitenMit diesem Schlüssel verschlüsseln
@@ -400,29 +366,27 @@
TeilenUnterschlüsselBeglaubigungen
+
+ Identität hinzufügen
+ Unterschlüssel hinzufügen
+
+
SchlüsselSignieren und VerschlüsselnEntschlüsseln und Verifizieren
- Schlüssel ImportierenAppsMenü öffnenMenü schließen
- BearbeitenMeine Schlüssel
- Private Schlüssel
- verfügbar
- nicht verfügbar
- Hier die Nachricht schreiben welche verschlüsselt und/oder signiert werden soll…
- Hier die verschlüsselte Nachricht eingeben um sie zu entschlüsseln und/oder zu verifzieren…
+ Hier die verschlüsselte Nachricht eingeben um sie zu entschlüsseln und/oder zu verifizieren…normalkeineinfach überprüftpositivwiderrufen
- OKfehlgeschlagen!Fehler!Schlüssel nicht verfügbar
@@ -438,7 +402,9 @@
Geheime Unterschlüssel werden bearbeitet
+
+
BeglaubigerZertifikatdetails
@@ -451,13 +417,11 @@
TypSchlüssel nicht gefunden!Fehler bei der Verarbeitung des Schlüssels!
- Unterschlüssel nicht verfügbarnicht verfügbar
- Geheime Schlüssel können nur einzeln gelöscht werden!Zertifikatdetails anzeigenunbekanntKann nicht unterschreiben
- KodierungsfehlerKein Unterschlüssel zum Verschlüsseln verfügbar!Schlüssel anzeigen (%s)
+
diff --git a/OpenKeychain/src/main/res/values-el/strings.xml b/OpenKeychain/src/main/res/values-el/strings.xml
index 5cd62952b..0ae077242 100644
--- a/OpenKeychain/src/main/res/values-el/strings.xml
+++ b/OpenKeychain/src/main/res/values-el/strings.xml
@@ -1,10 +1,7 @@
- Επιλογή Δημόσιου Κλειδιού
- Επιλογή Ιδιωτικού ΚλειδιούΚωδικός
- Δημιουργία ΚλειδιούΕπεξεργασία ΚλειδιούΕπιλογές
@@ -16,13 +13,10 @@
ΟΚΔιαγραφής κλειδιού
- Δημιουργίας κλειδιού
- ΥπόγραψεΜήνυμαΑρχείοΚωδικός
- ΞανάΑλγόριθμοςΑλγόριθμος κρυπτογράφησηςΜέγεθος κλειδιού
@@ -47,6 +41,9 @@
+
+
+
@@ -54,6 +51,9 @@
+
+
+
diff --git a/OpenKeychain/src/main/res/values-es/strings.xml b/OpenKeychain/src/main/res/values-es/strings.xml
index 719ddf414..be488f82d 100644
--- a/OpenKeychain/src/main/res/values-es/strings.xml
+++ b/OpenKeychain/src/main/res/values-es/strings.xml
@@ -1,20 +1,17 @@
- Seleccionar la clave pública
- Seleccionar la clave secreta
+ Seleccionar claves
+ Seleccionar su claveCifrarDescifrarFrase de contraseña
- Crear clave
+ Crear mi clave Editar clave
- Bienvenido a OpenKeychain PreferenciasAplicacionesPrioridad del servidor de clavesCambiar frase de contraseña
- Establecer frase de contraseña
- Compartir con...Compartir huella de validación de clave con...Compartir clave con...Compartir fichero con...
@@ -35,60 +32,39 @@
GeneralPredeterminadosAvanzado
- Clave maestra
- Identidad primariaAccionesClave completaTu clave usada para las certificacionesCargar claveServidor de claves
- Cifrar y/o firmar
- Descifrar y verificarHuella de validación de claveClave a ser certificada
- CertificarDescifrar, verificar, y guardar ficheroDescifrar y verificar mensaje
- Desde el portapapelesCifrar y guardar fichero
+ Cifrar y compartir ficheroGuardarCancelarEliminarNingunoDe acuerdo
- Cambiar nueva frase de contraseña
- Establecer nueva frase de contraseñaCargar al servidor de clavesSiguienteVolver
- Portapapeles
- Compartir con...Buscar clave
- Mostrar ajustes avanzados
- Ocultar ajustes avanzados
- Compartir mensaje cifrado/firmado...
+ Cifrar y compartir mensajeVer clave de verificación
+ Crear clave
+ Añadir fichero(s)AjustesAyudaExportar hacia archivoBorrar clave
- Crear clave
- Crear clave (experto)
+ Crear mi clave
+ Importar clave existenteBuscar
- Servidor de claves...
- Actualizar desde servidor de claves
- Cargar al servidor de claves
- Compartir...
- Compartir la huella digital...
- Compartir la clave completa...
- con...
- con...
- con código QR
- con código QR
- con NFC
- Copiar al portapapelesAjustes de BeamCancelarCifrar hacia...
@@ -97,22 +73,26 @@
Exportar todas las clavesMostrar información avanzada
- FirmarMensajeArchivo
+ Fichero(s)
+ Fichero:No hay frase de contraseñaFrase de contraseña
- De nuevo
+ Repeat PassphraseAlgoritmoArmadura ASCII
- Destinatarios
- Borrar después del cifrado
+ Ficheros: Armadura ASCII
+ Permitir a otros saber que está usando OpenKeychain
+ Escribe \'OpenKeychain v2.7\' en las firmas OpenPGP, el texto cifrado, y las claves exportadas
+ Desde:
+ Hacia:
+ Ficheros: Borrar después del cifradoBorrar después del descifrado
- Compartir después del cifradoAlgoritmo de cifradoAlgoritmo de Hash
- con clave pública
- con frase contraseña
+ Con clave pública
+ Con frase contraseñaCaché de frase de contraseñaCompresión de mensajeCompresión de archivo
@@ -129,12 +109,7 @@
EmailCargar clave al servidor de claves seleccionado después de la certificaciónHuella digital
- SeleccionarEstabler la fecha de vencimiento
-
- %d seleccionado
- %d seleccionados
- <sin nombre><ninguna><sin clave>
@@ -181,7 +156,6 @@
AutentificarFrase de contraseña incorrecta.
- Establece una frase de contraseña antes.No hay un gestor de archivos compatible instalado.Las frases de contraseña no coinciden.Por favor, introduce una frase de contraseña.
@@ -200,15 +174,12 @@
Por favor, especifica hacia qué archivo quieres exportar.\nADVERTENCIA: El archivo se sobreescribirá si ya existiese.¿De veras quiere borrar todas las claves públicas seleccionadas?\n¡No puede deshacer esto!¿Quieres realmente borrar la clave SECRETA \'%s\'?\n¡No podrás deshacerlo!
- Has hecho cambios en el almacén de claves, ¿quieres guardarlos?
- Ha añadido una identidad vacía, ¿está seguro de que quiere continuar?¿De veras quiere borrar la clave pública \'%s\'?\n¡No puede deshacer esto!
- ¿Exportar también las claves secretas?
+ Exportar también claves secretas (privadas)Se ha exportado 1 clave satisfactoriamente.%d claves exportadas satisfactoriamente.No se han exportado claves.Nota: Sólo las subclaves soportan ElGamal.
- Nota: generar una clave RSA de longitud 1024-bit o menos está considerado inseguro y desactivado para generar nuevas claves.No se puede encontrar la clave %08X.%d mala clave secreta ignorada. Quizás hayas exportado con la opción\n--export-secret-subkeys\nAsegúrate de que exportas con\n--export-secret-keys\nen su lugar.
@@ -220,7 +191,6 @@
¡Clave enviada con éxito vía NFC Beam (haz NFC)!¡La clave ha sido copiada al portapapeles!¡La huella de validación de clave se ha copiado al portapapeles!
- ¡La clave ya ha sido certificada!Por favor ¡seleccione una clave para ser usada en certificación!¡La clave es demasiado grande para ser compartida de esta forma!
- Los datos binarios directos sin un fichero existente en el sistema de ficheros no están soportados.¡Necesita Android 4.1 para usar la característica NFC Beam (haz NFC) de Android!¡NFC no está disponible en tu dispositivo!¡No se encontraron claves!
- Petición de búsqueda de clave demasiado corta
- Error irrecuperable buscando claves en el servidor
- La petición de búsqueda de clave devolvió demasiados candidatos; por favor refine su petición
- El Fichero/Portapapeles está vacío
+ Petición de búsqueda demasiado corta. Por favor, ¡refine su petición!
+ Ocurrió un error al buscar claves.
+ La petición de búsqueda de claves devolvió demasiados candidatos. Por favor.¡refine su petición!
+ O no hay claves, o bien se han encontrado demasiadas. Por favor, ¡mejore su petición!
+ ¡No se encontraron claves válidas en Fichero/Portapapeles!Ha ocurrido un error genérico, por favor, informa de este bug a OpenKeychainparte del archivo cargado es un objeto OpenPGP válido pero no una clave OpenPGPpartes del archivo cargado son objetos OpenPGP válidos pero no claves OpenPGP
- Debes hacer cambios en el almacén de claves antes de que puedas guardarlo¡Firma no válida!Clave pública desconocida
@@ -275,19 +239,25 @@
guardando...importando...exportando...
+ subiendo...construyendo la clave...
- certificando la clave maestra...construyendo el anillo maestro...
- añadiendo las subclaves...
- guardando claves...
+ generando nueva clave RSA...
+ generando nueva clave DSA...
+ generando nueva clave ElGamal...
+ modificando juego de claves...
+ desbloqueando juego de claves...
+ añadiendo identidades de usuario...
+ revocando identidades de usuario...
+ cambiando identidad primaria de usuario...
+ modificando subclaves...
+ revocando subclaves...
+ añadiendo subclaves...
+ cambiando frase contraseña...exportando clave...exportando claves...
-
- generando clave, esto puede tardar más de 3 minutos...
- generando claves, esto puede tardar más de 3 minutos...
- extrayendo la clave de firma...extrayendo la clave...preparando las transmisiones...
@@ -298,6 +268,7 @@
procesando la firma...verificando la firma...firmando...
+ certificando...leyendo los datos...localizando la clave...descomprimiendo los datos...
@@ -305,8 +276,6 @@
borrando \'%s\' de forma segura…Identidad de Nombre/Correo/Clave...
- Buscar claves secretas
- Compartir la clave con...Nombre de usuario de Nombre/Keybase.io...512
@@ -338,37 +307,25 @@
Código QR/NFCKeybase.ioImportar las claves seleccionadas
- Importar desde el portapapeles
-
- El código QR con ID %s se ha extraviado
- Los códigos QR con IDs %s se han extraviado
-
- Por favor, comienza con el código QR de ID 1¡El código QR está deformado! ¡Por favor, prueba de nuevo!
- ¡El escaneo del código QR ha finalizado!La huella de validación (fingerprint) de clave es demasiado corta (< 16 caracteres)
- Escanea el código QR con \'Barcode Scanner\'
- Para recibir las claves a través de NFC, el dispositivo tiene que estar desbloqueado.
- AyudaEscaneando código QR...
- Tomar la clave desde el portapapeles
- Obtener clave desde Keybase.ioClave importada con éxito%1$d claves importadas con éxito
- y clave%2$s actualizada.
- y %1$d claves%2$s actualizadas.
+ y actualizada clave%2$s.
+ y actualizadas %1$d claves%2$s.Clave%2$s importada con éxito.%1$d claves%2$s importadas con éxito.
- Clave%2$s importada con éxito.
- %1$d claves%2$s importadas con éxito.
+ Clave%2$s actualizada con éxito.
+ %1$d claves%2$s actualizadas con éxito.Ver registro (log)No hay nada que importar.
@@ -380,7 +337,7 @@
Cifrar con OpenKeychainDescifrar con OpenKeychain
- ¡No hay aplicaciones registradas!\n\n¡Una lista de aplicaciones soportadas de terceros puede encontrarse en \'Ayuda\'!
+ ¡No hay aplicaciones registradas!\n\n¡Puede encontrar una lista de aplicaciones de terceros soportadas en la \'Ayuda\'!Mostrar información avanzadaOcultar información avanzadaMostrar la configuración avanzada
@@ -396,9 +353,9 @@
Nombre de paqueteSHA-256 de firma de paqueteCuentas
- No hay cuentas asociadas a esta aplicación.
- La aplicación solicita la creación de una nueva cuenta. Por favor, selecciona una clave privada que ya exista o crea una nueva.\n¡Las aplicaciones tienen restringido el uso de claves a las que tú selecciones aquí!
- La aplicación mostrada solicita acceso a OpenKeychain.\n¿Permitir el acceso?\n\nAVISO: Si no sabes por qué aparece esta pantalla, ¡deniega el acceso! Puedes revocarlo después usando la pantalla \'Aplicaciones registradas\'.
+ No hay cuentas adjuntas a esta aplicación
+ La aplicación solicita la creación de una nueva cuenta. Por favor, seleccione una de sus claves existentes o cree una nueva.\n¡Las aplicaciones están restringidas al uso de las claves que usted seleccione aquí!
+ La aplicación mostrada quiere cifrar, descrifrar y firmar mensajes en su nombre.\n¿Permitir acceso?\n\nADVERTENCIA: Si no sabe por qué apareció esta pantalla, ¡no permita el acceso! Puede revocar el acceso más tarde usando la pantalla de \'Aplicaciones\'.Permitir el accesoDenegar el acceso¡Por favor, selecciona una clave!
@@ -408,9 +365,6 @@
¡La comprobación de la firma ha fallado! ¿Has instalado esta app desde una fuente distinta? Si estás seguro de que esto no es un ataque, revoca el registro de esta app en OpenKeychain y regístrala de nuevo.Compartir con código QR
- Pasa por todos los códigos QR usando \'Siguiente\', y escanéalos de uno en uno.
- Huella digital:
- Código QR con ID %1$d de %2$dCompartir con NFC
@@ -421,32 +375,54 @@
Puedes empezar porocrear tu propia clave
- importar claves
+ importando una clave existente.Editar claveCifrar con esta claveCertificar identidades
+ Actualizar desde el servidor de clavesCompartir con...Compartir sobre NFC juntando los dispositivos por el reverso
+ Actualizar al servidor de clavesInformación principalCompartirSubclavesCertificados
+
+ Cambiar frase contraseña
+ Añadir identidad
+ Añadir subclave
+ ¡Seleccione una acción!
+
+ Cambiar a la identidad primaria
+ Revocar identidad
+
+ ¡Seleccione una acción!
+
+ Cambiar periodo hasta la expiración
+ Revocar subclave
+
+
+ Subir clave al servidor de claves
+ Este campo es obligatorio
+ Las frases contraseña no coinciden
+ Ha introducido la siguiente identidad:
+ Crear una clave puede llevar un tiempo, hágase con una taza de café entre tanto...\n(3 subclaves, RSA 4096 bits)
+ Introduzca su nombre completo, dirección de correo electrónico, y elija una frase contraseña.
+ Nombre completo, ej. Max Mustermann
+
+ ¡Esta clave ha sido revocada!
+ ¡Esta clave ha expirado!ClavesFirmar y cifrarDescifrar y verificar
- Importar clavesAplicacionesAbrir el Navigation DrawerCerrar el Navigation Drawer
- EditarMis claves
- Claves secretas
- disponible
- no disponible
- Escribe aquí el mensaje que quieras cifrar y/o firmar...
+ El mensaje introducido aquí estará firmado usando la clave seleccionada en \'Desde\' y cifrada para todos los receptores seleccionados en \'Hacia\'.Introduce aquí el texto cifrado para descifrarlo y/o verificarlo...predeterminado
@@ -454,7 +430,7 @@
casualpositivorevocada
- correcto
+ Correcto¡falló!¡error!clave no disponible
@@ -498,7 +474,7 @@
Re-insertando clave secreta¡Se encontró un certificado defectuoso!¡Error procesando certificado!
- La identificación de usuario está certificada por %1$s (%2$s)
+ La identidad del usuario está certificada por %1$sIgnorando un certificado publicado por una clave pública desconocidaIgnorando %s certificados publicados por claves públicas desconocidas
@@ -512,6 +488,7 @@
Procesando identidad (id) de usuario %sLa identificación de usuario está revocadaSe intentó importar un juego de claves (keyring) público como secreto. Esto es un fallo, por favor ¡consigne un informe!
+ Se intentó importar un juego de claves sin canonicalización. ¡Esto es un fallo, por favor rellene un informe!Importando clave secreta (privada) %s¡Error de base de datos!
@@ -532,6 +509,7 @@
Eliminando certificado de revocación de juego de claves, con distintivo \"local\"Eliminando certificado de revocación de juego de claves, con marca de tiempo futuraEliminando certificado de clave maestra, de tipo desconocido (%s)
+ Eliminando identidad de usuario en posición equivocadaEliminando certificado defectuoso de revocación de juego de clavesEliminando certificado redundante de revocación de juego de claves Procesando subclave %s
@@ -569,6 +547,7 @@
Eliminando certificado redundate de revocación para la identidad de usuario \"%s\"Eliminando certificado desactualizado de revocación para la identidad de usuario \"%s\"No se encontró ningún auto-certificado válido para la identificación de usuario %s, eliminándola del juego de claves.
+ Eliminando identidad de usuario %s no válidaIncorporándolas en el juego de claves públicas %sIncorporándolas en el juego de claves secretas (privadas) %s
@@ -576,12 +555,29 @@
Se intentaron consolidar juegos de claves heterogéneosAñadiendo nueva subclave %sSe encontraron %s nuevos certificados en el juego de claves
+ No hay nuevos certificados
+
+ Generando nueva clave maestra
+ ¡No se especificaron opciones de clave!
+ ¡Los juegos de claves tienen que estar creados con al menos una identidad de usuario!
+ ¡La clave maestra debe tener el indicador de certificado!
+ ¡El tamaño de la clave debe ser mayor o igual de 512!
+ ¡Error PGP interno!
+ ¡Seleccionado algoritmo defectuoso!
+ ¡La clave maestra no debe ser del tipo ElGamal!Modificando el juego de claves %s¡Excepción en la codificación!
+ ¡La actual huella de validación de clave no coincide con la esperada!
+ No hay identidad de clave. Esto es un error interno, por favor ¡consigne un informe de error!
+ Error interno, ¡fallo en la comprobación de integridad!
+ ¡Especificada identidad de usuario primaria defectuosa!
+ ¡Las identidades de usuario revocadas no pueden ser primarias!¡Excepción interna de PGP!¡Excepción con la firma!Cambiando frase contraseña
+ Reemplazando certificado de la anterior identidad de usuario primaria
+ Generando nuevo certificado para nueva identidad de usuario primariaModificando subclave %s¡Intentó operar sobre una subclave ausente %s!Generando nueva subclave %2$s de %1$s bits
@@ -592,9 +588,17 @@
Añadiendo identidad de usuario %sCambiando identidad de usuario (uid) primaria a %sRevocando identidad de usuario %s
+ ¡La identidad de usuario no debe estar vacía!¡Error desbloqueando juego de claves!Desbloqueando juego de claves
+
+ Haga clic para limpiar las frases contraseña almacenadas en caché
+ OpenKeychain ha almacenado en caché %d frases contraseña
+ Frases contraseña almacenadas en caché:
+ Limpiar caché
+ Contraseña
+ ¡Error interno!CertificadorDetalles del certificadoIdentidad
@@ -606,14 +610,17 @@
Tipo¡Clave no encontrada!¡Error procesando clave!
- subclave no disponibledesnudo, sin clave
- ¡Las claves privadas (secretas) sólo pueden borrarse individualmente!
+ ¡Sus claves propias sólo pueden ser borradas individualmente!Ver detalles del certificadodesconocidono puede firmarse
- Error de codificación¡No hay subclave de cifrado disponible!No cree Cuentas-OpenKeychain manualmente.\nPara más información, vea la Ayuda.Mostrar clave (%s)
+
+ ¡Recupere su privacidad con OpenKeychain!
+ Crear mi clave
+ Importar clave existente
+ Omitir configuración
diff --git a/OpenKeychain/src/main/res/values-et/strings.xml b/OpenKeychain/src/main/res/values-et/strings.xml
index 51f30015a..fdd7f026a 100644
--- a/OpenKeychain/src/main/res/values-et/strings.xml
+++ b/OpenKeychain/src/main/res/values-et/strings.xml
@@ -1,16 +1,12 @@
- Vali avalik võti
- Vali salajane võtiKrüpteeriDekrüpteeriSalasõne
- Loo võtiMuuda võtitSeadedVõtmeserveri seaded
- Määra salasõneImpordi võtmeidEkspordi võtiEkspordi võtmed
@@ -30,22 +26,13 @@
SeadedKustuta võti
- Loo võtiOtsi
- Võtmeserver...
- Uuenda võtmeserverist
- Saada võtmeserverisse
- Jaga...
- AllkirjastaSõnumFailSalasõnet poleSalasõne
- UuestiAlgoritm
- Saajad
- Kustuta peale šifreerimistRäsialgoritmSalasõne puhverdusLoodud
@@ -79,7 +66,6 @@
Vale salasõne
- Määra enne salasõne.Salasõned ei ühti.Sümmeetriline krüpteering
+
+
+
@@ -106,6 +95,9 @@
+
+
+
diff --git a/OpenKeychain/src/main/res/values-fr/strings.xml b/OpenKeychain/src/main/res/values-fr/strings.xml
index 0c5c5de67..2b6405ed5 100644
--- a/OpenKeychain/src/main/res/values-fr/strings.xml
+++ b/OpenKeychain/src/main/res/values-fr/strings.xml
@@ -1,20 +1,17 @@
- Choisir la clef publique
- Choisir la clef secrète
+ Choisir des clefs
+ Choisir ma clefChiffrerDéchiffrerPhrase de passe
- Créer une clef
+ Créer ma clefModifier une clef
- Bienvenue à OpenKeychainPréférencesApplisPréférences du serveur de clefsModifier la phrase de passe
- Définir la phrase de passe
- Partager avec...Partager l\'empreinte avec...Partager la clef avec...Partager le fichier avec...
@@ -35,60 +32,36 @@
GénéralValeurs par défautAvancé
- Clef maîtresse
- Identité principaleActionsClef entièreVotre clef utilisée pour la certificationTéléverser la clefServeur de clefs
- Chiffrer et/ou signer
- Déchiffrer et vérifierEmpreinteClef à certifier !
- CertifierDéchiffrer, vérifier et enregistrer le fichierDéchiffrer et enregistrer le message
- À partir du presse-papiersChiffrer et enregistrer le fichierEnregistrerAnnulerSupprimerAucuneOK
- Changer la nouvelle phrase de passe
- Définir la nouvelle phrase de passeTéléverser vers le serveur de clefsSuivantRetour
- Presse-papiers
- Partager avec...Rechercher la clef
- Afficher les paramètres avancés
- Masquer les paramètres avancés
- Partager le message chiffré/signé...Voir la clef de certification
+ Créer la clefParamètresAideExporter vers un fichierSupprimer la clef
- Créer une clef
- Créer une clef (expert)
+ Créer ma clef
+ Importer une clef existanteRechercher
- Serveur de clefs...
- Mettre à jour depuis le serveur de clefs
- Téléverser vers le serveur de clefs
- Partager...
- Partager l\'empreinte...
- Partager la clef entière...
- avec...
- avec...
- par un code QR
- par un code QR
- par la NFC
- Copier vers le presse-papiersParamètres BeamAnnulerChiffrer vers...
@@ -97,22 +70,18 @@
Exporter toutes les clefsAfficher les infos avancées
- SignerMessageFichierAucune phrase de passePhrase de passe
- Confirmation
+ Répéter la phrase de passeAlgorithmeArmure ASCII
- Destinataires
- Supprimer après le chiffrement
+ Informez les autres de votre utilisation d\'OpenKeychain
+ Ajoute « OpenKeychain v2.7 » aux signatures OpenPGP, aux cryptogrammes, et aux clefs exportéesSupprimer après le chiffrement
- Partager après chiffrementAlgorithme de chiffrementAlgorithme de hachage
- avec une clef publique
- avec une phrase de passeCache de la phrase de passeCompression des messagesCompression des fichiers
@@ -129,12 +98,7 @@
CourrielTéléverser la clef vers le serveur de clefs choisi après certificationEmpreinte
- ChoisirDéfinir une date d\'expiration
-
- %d choisie
- %d choisies
- <aucun nom><aucune><pas de clef>
@@ -181,7 +145,6 @@
AuthentifierPhrase de passe erronée
- Définir d\'abord une phrase de passe.Aucun gestionnaire de fichiers compatible installé.Les phrases de passe ne correspondent pas.Veuillez saisir une phrase de passe
@@ -200,15 +163,12 @@
Veuillez spécifier vers quel fichier exporter.\nAVERTISSEMENT ! Le fichier sera écrasé s\'il existe.Voulez-vous vraiment supprimer toutes les clefs publiques choisies ?\nCeci est irréversible !Voulez-vous vraiment supprimer la clef SECRÈTE %s ?\nVous ne pourrez pas la restituer !
- Vous avez apporté des changements au trousseau, voulez-vous l\'enregistrer ?
- Vous avez ajouté une identité vide, êtes-vous certain de vouloir continuer ?Voulez-vous vraiment supprimer la clef publique %s ?\nCeci est irréversible !
- Exporter aussi les clefs secrètes ?
+ Importer aussi les clefs secrètes1 clef exportée avec succès.%d clefs exportées avec succès.Aucune clef exportée.Note : seules les sous-clefs prennent en charge ElGamal.
- Note : générer des clefs RSA d\'une longueur de 1024 bits ou moins est considéré non sécuritaire et est désactivé pour la génération de nouvelles clefs.Clef %08X introuvable.%d mauvaise clef ignorée. Vous avez peut-être exporté avec l\'option\n --export-secret-subkeys\nAssurez-vous d\'exporter plutôt avec\n --export-secret-keys.
@@ -220,7 +180,6 @@
Clef envoyée par Beam NFC avec succès |La clef a été copié vers le presse-papiers !L\'empreinte a été copié vers le presse-papiers !
- La clef a déjà été certifiée !Veuillez choisir une clef à utiliser pour la certification !La clef est trop grosse pour être partagée ainsi !
- Les données binaires directes sans fichier dans le système de fichiers ne sont pas prises en charge.Il vous faut Android 4.1 pour utiliser la fonction Beam NFC d\'Android !La NFC n\'est pas disponible sur votre appareil !Aucune clef trouvée !
- La requête de recherche de clef est trop courte
- Erreur irrécupérable lors de la recherche de clef sur le serveur
- La requête de recherche de clef a retourné trop de candidats. Veuillez raffiner la requête
- Le fichier/le presse-papiers est vide
+ La demande de recherche est trop courte. Veuillez la préciser !
+ Une erreur est survenue lors de la recherche de clefs.
+ La demande de recherche de clef a retourné trop de candidats. Veuillez la préciser !
+ Soit aucune clef n\'a été trouvée, soit trop de clefs. Veuillez améliorer votre demande !
+ Aucune clef valide n\'a été trouvée dans le fichier/presse-papiers |Une erreur générique est survenue, veuillez créer un nouveau rapport de bogue pour OpenKeychain.une partie du fichier chargé est un objet OpenPGP valide mais pas une clef OpenPGPcertaines parties du fichier chargé sont des objets OpenPGP valides mais pas des clefs OpenPGP
- Vous devez apporter des changements au trousseau avant de pouvoir l\'enregistrerSignature invalide !Clef publique inconnue
@@ -275,19 +228,25 @@
sauvegarde...importation...exportation...
+ téléversement...assemblage de la clef...
- certification de la clef maîtresse...assemblage du trousseau maître...
- ajout des sous-clefs...
- sauvegarde de la clef...
+ génération d\'une nouvelle clef RSA...
+ génération d\'une nouvelle clef DSA...
+ génération d\'une nouvelle clef ElGamal...
+ modification du trousseau...
+ déverrouillage du trousseau...
+ ajout des IDs d\'utilisateur...
+ révocation des IDs d\'utilisateur...
+ changement de l\'ID d\'utilisateur principale...
+ modification des sous-clefs...
+ révocation des sous-clefs...
+ ajout des sous-clefs...
+ changement de la phrase de passe...exportation de la clef...exportation des clefs...
-
- génération de la clef, ceci peut prendre jusqu\'à 3 min...
- génération des clefs, ceci peut prendre jusqu\'à 3 min...
- extraction de la clef de signature...extraction de la clef...préparation des flux...
@@ -298,6 +257,7 @@
traitement de la signature...vérification de la signature...signature...
+ certification...lecture des données...recherche de la clef...décompression des données...
@@ -305,8 +265,6 @@
suppression sûre de « %s »...Nom/courriel/ ID clef...
- Rechercher des clefs secrètes
- Partager la clef avec...Nom/nom d\'utilisateur keybase.io...512
@@ -338,26 +296,26 @@
Code QR/NFCKeybase.ioImporter les clefs choisies
- Importer à partir du presse-papiers
-
- Le code QR avec l\'ID %s est manquant
- Les codes QR avec les IDs %s sont manquants
-
- Veuillez commencer par le code QR avec l\'ID 1Code QR incorrecte ! Veuillez réessayer !
- Balayage de code QR terminé !L\'empreinte est trop courte (< 16 caractères)
- Numériser le code QR avec le lecteur de code-barres
- Pour recevoir des clefs par la NFC, les appareils doivent être déverrouillés.
- AideBalayer le code QR...
- Obtenir la clef depuis le presse-papiers
- Obtenir la clef depuis Keybase.ioClef importée avec succès%1$d clefs importées avec succès
+
+ et mise à jour de la clef%2$s.
+ et mise à jour de %1$d clefs%2$s.
+
+
+ Une clef%2$s importée avec succès.
+ %1$d clefs%2$s importées avec succès.
+
+
+ Une clef%2$s mise à jour avec succès.
+ %1$d clefs%2$s mises à jour avec succès
+ Consulter le journalRien à importer.Erreur lors de l\'importation des clefs !
@@ -384,9 +342,9 @@
Nom du paquetSHA-256 de la signature du paquetComptes
- Aucun compte n\'est attaché à cette application.
- L\'application demande la création d\'un nouveau compte. Veuillez choisir un clef privée existante ou en créer une.\nLes applications sont restreintes à l\'utilisation de clefs choisies ici.
- L\'application affichée demande l\'accès à OpenKeychain.\nPermettre l\'accès ?\n\nAvertissement : si vous ne savez pas pourquoi cet écran est apparu, refusez l\'accès ! Vous pourrez révoquer l\'accès plus tard en utilisant l\'écran « Applications enregistrées ».
+ Aucun compte n\'est attaché à cette appli.
+ L\'appli demande la création d\'un nouveau compte. Veuillez choisir une de vos clefs existantes ou en créer une nouvelle.\nLes applis ne peuvent utiliser que les clefs que vous choisissez ici !
+ L\'application affichée veut chiffrer/déchiffrer des messages et les signer en votre nom.\nPermettre l\'accès ?\n\nAVERTISSEMENT : si vous ne savez pas pourquoi cet écran est apparu, refusez l\'accès ! Vous pourrez révoquer l\'accès plus tard en utilisant l\'écran « Applis ».Permettre l\'accèsEnlever l\'accèsVeuillez choisir une clef !
@@ -396,9 +354,6 @@
La vérification de la signature a échoué ! Avez-vous installé cette appli à partir d\'une source différente ? Si vous êtes sûr que ce n\'est pas une attaque, révoquez l\'enregistrement de cette appli dans OpenKeychain et enregistrez-la à nouveau.Partager par un code QR
- Balayer tous les codes QR un par un en utilisant « Suivant ».
- Empreinte :
- Code QR avec l\'ID %1$d de %2$dPartager par la NFC
@@ -409,32 +364,53 @@
Vous pouvez commencer paroucréer votre propre clef
- Importer des clefs.
+ importation d\'une clef existante.Modifier la clefChiffrer avec cette clefCertifier les identités
+ Mise à jour depuis le serveur de clefsPartager avec...Partager par NFC en tenant les appareils dos à dos
+ Téléverser vers le serveur de clefsInfos principalesPartagerSous-clefsCertificats
+
+ Changer la phrase de passe
+ Ajouter une identité
+ Ajouter une sous-clef
+ Choisir une action !
+
+ Changer en identité principale
+ Révoquer l\'identité
+
+ Choisissez une action !
+
+ Changer l\'expiration
+ Révoquer la sous-clef
+
+
+ Téléverser la clef vers le serveur de clefs
+ Ce champ est exigé
+ Les phrases de passe ne correspondent pas
+ Vous avez saisie l\'identité suivante :
+ Créer une clef peut prendre du temps, prenez donc un café en attendant...\n(3 sous-clefs, RSA 4096 bits)
+ Saisissez votre nom complet, votre adresse courriel et choisissez votre phrase de passe.
+ Nom complet, p. ex. Marc-Olivier Lagacé
+
+ Cette clef a été révoquée !
+ Cette clef est expirée !ClefsSigner et chiffrerDéchiffrer et vérifier
- Importer les clefsApplisOuvrir le tiroir de navigationFermer le tiroir de navigation
- ModifierMes clefs
- Clef secrète
- disponible
- non disponible
- Écrire ici le message à chiffrer et/ou signer...Saisir le cryptogramme à déchiffrer et/ou à vérifier ici...valeur par défaut
@@ -442,7 +418,7 @@
rapidepositifrévoqué
- ok
+ OKéchec!erreur!clef non disponible
@@ -486,20 +462,21 @@
Réinsertion de la clef secrèteUn mauvais certificat a été rencontré !Erreur lors du traitement du certificat !
- L\'ID utilisateur est certifié par %1$s (%2$s)
+ L\'ID d\'utilisateur est certifié par %1$sUn certificat ignoré provenant d\'une clef publique inconnue%s certificats ignorés provenant de clefs publiques inconnues
- Classification des ID utilisateurs (aucune clef de confiance disponible)
+ Classification des ID d\'utilisateurs (aucune clef de confiance disponible)
- Classification des ID utilisateurs (en utilisant une clef de confiance)
- Classification des ID utilisateurs (en utilisant %s clefs de confiance)
+ Classification des ID d\'utilisateurs (en utilisant une clef de confiance)
+ Classification des ID d\'utilisateurs (en utilisant %s clefs de confiance)
- Réorganisation des ID utilisateurs
- Traitement de l\'ID utilisateur %s
- L\'ID utilisateur est révoqué
+ Réorganisation des ID d\'utilisateurs
+ Traitement de l\'ID d\'utilisateur %s
+ L\'ID d\'utilisateur est révoquéTentative d\'importer le trousseau public comme secret. Ceci est un bogue, veuillez remplir un rapport !
+ Tentative d\'importer un trousseau sans canonicalisation. Ceci est un bogue, veuillez remplir un rapport !Importation de la clef secrète %sErreur de base de données!
@@ -514,12 +491,13 @@
Canonicalisation du trousseau public %sCanonicalisation du trousseau secret %s
- La canonicalisation du trousseau a échoué : le trousseau n\'a pas d\'ID utilisateur valides
+ La canonicalisation du trousseau a échoué : le trousseau n\'a pas d\'ID d\'utilisateur validesTraitement de la clef maîtresseSuppression du mauvais certificat de révocation du trousseauSuppression du certificat de révocation du trousseau ayant le drapeau « local »Suppression du certificat de révocation du trousseau ayant une estampille temporelle dans le futurSuppression du certificat de clef maîtresse de type inconnu (%s)
+ Suppression de la certification de l\'ID d\'utilisateur en mauvaise positionSuppression du mauvais certificat de révocation du trousseau Suppression du certificat redondant de révocation du trousseauTraitement de la sous-clef %s
@@ -530,9 +508,9 @@
Suppression du certificat de liaison de la sous-clef ayant une estampille temporelle dans le futurType de certificat de sous-clef inconnu : %sSuppression du certificat redondant de liaison de sous-clef
- Suppression du certificat de liaison de la sous-clef à cause d\'un certificat de liaison primaire invalide
- Suppression du certificat de liaison de la sous-clef due à un mauvais certificat de liaison
- Suppression du certificat de liaison de la sous-clef due à un certificat de liaison primaire manquant
+ Suppression du certificat de liaison de la sous-clef à cause d\'un certificat de liaison principal invalide
+ Suppression du certificat de liaison de la sous-clef due à un mauvais certificat principal de liaison
+ Suppression du certificat de liaison de la sous-clef due à un certificat principal de liaison manquantAucun certificat valide trouvé pour %s, qui est maintenant enlevé du trousseauSuppression du certificat de révocation de la mauvaise sous-clefSuppression du certificat de révocation de la mauvaise sous-clef
@@ -547,16 +525,17 @@
Canonicalisation du trousseau réussie, un certificat redondant suppriméCanonicalisation du trousseau réussie, %d certificats redondants supprimés
- Suppression du mauvais auto-certificat pour l\'ID utilisateur %s
- Suppression du certificat d\'ID utilisateur ayant le drapeau « local »
- Suppression de l\'ID utilisateur ayant une estampille temporelle dans le futur
- Suppression du certificat d\'ID utilisateur de type inconnu (%s)
- Suppression du mauvais auto-certificat pour l\'ID utilisateur « %s »
- Suppression de l\'auto-certificat périmé pour l\'ID utilisateur « %s »
- Suppression du certificat étranger d\'ID utilisateur par %s
- Suppression du certificat de révocation redondant pour l\'ID utilisateur « %s »
- Suppression du certificat de révocation périmé pour l\'ID utilisateur « %s »
- Aucun auto-certificat valide trouvé pour l\'ID utilisateur %s, qui est maintenant enlevé du trousseau
+ Suppression du mauvais auto-certificat pour l\'ID d\'utilisateur %s
+ Suppression du certificat d\'ID d\'utilisateur ayant le drapeau « local »
+ Suppression de l\'ID d\'utilisateur ayant une estampille temporelle dans le futur
+ Suppression du certificat d\'ID d\'utilisateur de type inconnu (%s)
+ Suppression du mauvais auto-certificat pour l\'ID d\'utilisateur « %s »
+ Suppression de l\'auto-certificat périmé pour l\'ID d\'utilisateur « %s »
+ Suppression du certificat étranger d\'ID d\'utilisateur par %s
+ Suppression du certificat de révocation redondant pour l\'ID d\'utilisateur « %s »
+ Suppression du certificat de révocation périmé pour l\'ID d\'utilisateur « %s »
+ Aucun auto-certificat valide trouvé pour l\'ID d\'utilisateur %s, qui est maintenant enlevé du trousseau
+ Suppression de l\'ID d\'utilisateur invalide %sFusion vers le trousseau public %sFusion vers le trousseau secret %s
@@ -564,16 +543,29 @@
Il a été tenté de consolider les trousseaux hétérogènesAjout de la nouvelle sous-clef %s%s nouveaux certificats trouvés dans le trousseau
+ Aucun nouveau certificat
+
+ Génération d\'une nouvelle clef maîtresse
+ Aucune option de clef maîtresse n\'a été spécifiée !
+ Les trousseaux doivent être créés avec au moins un ID d\'utilisateur !
+ La clef maîtresse doit avoir le drapeau « certifié » !
+ La taille de la clef doit être supérieure ou égale à 512 !
+ Erreur interne PGP !
+ Mauvais choix d’algorithme !
+ La clef maîtresse ne doit pas être de type ElGamal !Modification du trousseau %sException d\'encodage !L\'empreinte de clef effective ne correspond pas à celle attendue !
- Aucune ID de clef. Ceci est une erreur de programmation, veuillez remplir un rapport de bogue !
+ Aucune ID de clef. Ceci est une erreur interne, veuillez remplir un rapport de bogue !Erreur interne, le contrôle d\'intégrité a échoué !
- Les IDs d\'un utilisateur révoqué ne peuvent pas être primaires !
+ Mauvais ID principal spécifié !
+ Les IDs d\'utilisateurs révoqués ne peuvent pas être principaux !Exception interne PGP !Exception de signature !Changement de la phrase de passe
+ Remplacement du certificat de l\'ID d\'utilisateur principal précédent
+ Génération d\'un nouveau certificat pour le nouvel ID d\'utilisateur principalModification de la sous-clef %sUne action a été tentée sur la sous-clef manquante %s !Génération d\'une nouvelle sous-clef %2$s de %1$s bit
@@ -581,12 +573,20 @@
La date d\'expiration ne peut pas être dans le passé !Révocation de la sous-clef %sTrousseau modifié avec succès
- Ajout de l\'ID utilisateur %s
- Changement de l\'UID primaire en %s
- Révocation de l\'ID utilisateur %s
+ Ajout de l\'ID d\'utilisateur %s
+ Changement de l\'UID principal en %s
+ Révocation de l\'ID d\'utilisateur %s
+ L\'ID d\'utilisateur ne peut pas être vide !Erreur lors du déverrouillage du trousseau !Déverrouillage du trousseau
+
+ Cliquer ici pour effacer les phrases de passe mises en cache
+ OpenKeychain a mis en cache %d phrases de passe
+ Phrases de passe mises en cache :
+ Effacer le cache
+ Mot de passe
+ Erreur interne !CertificateurDétails du certificatidentité
@@ -598,14 +598,17 @@
TypeClef introuvable !Erreur lors du traitement de la clef !
- sous-clef non disponibledépouillée
- Les clefs secrètes ne peuvent être supprimées qu\'individuellement !
+ Vos propres clefs ne peuvent être supprimées qu\'individuellement !Voir les détails du certificatinconnuimpossible de signer
- Erreur d\'encodageAucune sous-clef de chiffrement n\'est disponible !Ne pas créer de comptes-OpenKeychain manuellement.\nPour plus d\'informations, consultez l\'aide.Montrer la clef (%s)
+
+ Reprenez le contrôle de votre confidentialité avec OpenKeychain |
+ Créer ma clef
+ Importer une clef existante
+ Ignorer le paramétrage
diff --git a/OpenKeychain/src/main/res/values-it/strings.xml b/OpenKeychain/src/main/res/values-it/strings.xml
index 074efb78b..d31d1cc87 100644
--- a/OpenKeychain/src/main/res/values-it/strings.xml
+++ b/OpenKeychain/src/main/res/values-it/strings.xml
@@ -1,20 +1,14 @@
- Seleziona Chiave Pubblica
- Seleziona Chiave PrivataCodificaDecodificaFrase di accesso
- Crea ChiaveModifica Chiave
- Benvenuto in OpenKeychainPreferenzeAppsPreferenze Server delle ChiaviCambia Frase Di Accesso
- Imposta Frase di Accesso
- Condividi con...Condivi impronta con...Condividi chiave con...Condividi file con...
@@ -35,60 +29,33 @@
GeneralePredefinitiAvanzato
- Chiave Principale
- Identità PrimariaAzioniIntera chiaveLa Tua Chiave usata per la certificazioneCarica ChiaveServer delle Chiavi
- Codifica e/o Firma
- Decodifica e VerificaImprontaChiave da certificare
- CertificaDecodifica, verifica e salva su fileDecodifica e verifica messaggio
- Dagli AppuntiCodifica e salva fileSalvaAnnullaEliminaNessunoOK
- Cambia Nuova Frase di Accesso
- Imposta Nuova Frase di AccessoCarica sul Server delle ChiaviProssimoPrecedente
- Appunti
- Condividi...Chiave di ricerca
- Mostra impostazioni avanzate
- Nascondi impostazioni avanzate
- Condividi messaggio codificato/firmato...Mostra chiave di certificazioneImpostazioniAiutoEsporta su un fileCancella chiave
- Crea chiave
- Crea chiave (avanzato)Cerca
- Server delle Chiavi...
- Aggiorna dal server delle chiavi
- Carica chiave nel server
- Condividi...
- Condivi impronta...
- Condividi intera chiave...
- con..
- con...
- con Codice QR
- con Codice QR
- con NFC
- Copia negli appuntiImpostazioni BeamAnnullaCodifica su...
@@ -97,22 +64,18 @@
Esporta tutte le chiaviMostra informazioni avanzate
- FirmaMessaggioFileNessuna Frase di AccessoFrase di Accesso
- Di nuovo
+ Ripeti Frase di AccessoAlgortimoArmatura ASCII
- Destinatari
- Cancella Dopo Codifica
+ Fai sapere agli altri che utilizzi OpenKeychain
+ Scrive \'OpenKeychain v2.7\' nelle firme OpenPGP, testi cifrati e chiavi esportateCancella Dopo Decodifica
- Condividi Dopo la CodificaAlgoritmo di CodificaAlgoritmo di Hash
- con Chiave Pubblica
- con Frase di AccessoCache Frase di AccessoCompressione MessaggioCompressione File
@@ -129,12 +92,7 @@
EmailCarica chiave nel server delle chiavi selezionati dopo la certificazioneImpronta
- SelezionaImpostare la data di scadenza
-
- %d selezionato
- %d selezionati
- <nessun nome><nessuno><nessuna chiave>
@@ -181,7 +139,6 @@
ConvalidaFrase di Accesso errata
- Imposta prima una frase di accesso.Nessun gestore file compatibile installato.Le frasi di accesso non corrispondono.Si prega di inserire una frase di accesso.
@@ -200,15 +157,11 @@
Perfavore specifica su quale file esportare.\nATTENZIONE: Il file sara\' sovrascritto se esistente.Vuoi veramente eliminare tutte le chiavi pubbliche selezionate?\nNon potrai annullare!Vuoi veramente eliminare la chiave PRIVATA \'%s\'?\nNon potrai annullare!
- Hai apportato modifiche al tuo portachiavi, vuoi salvarlo?
- Hai aggiunto una identità vuota, sei sicuro di voler continuare?Vuoi veramente eliminare la chiave pubblica \'%s\'?\nNon potrai annullare!
- Esportare anche le chiavi segrete?1 chiave esportata correttamente.%d chiavi esportate correttamente.Nessuna chiave esportata.Nota: supporto sottochiavi solo per ElGamal.
- Nota: la generazione di chiavi RSA con lunghezza pari a 1024 bit o inferiore è considerata non sicura ed è disabilitata per la generazione di nuove chiavi.Impossibile trovare la chiave %08X.%d chiave segreta non valida ignorata. Forse hai esportato con opzione\n--export-secret-subkeys\nAssicurati di esportare con\n--export-secret-keys\ninvece.
@@ -220,7 +173,6 @@
Chiave correttamente inviata tramite NFC Beam!Chiave copiata negli appunti!Impronta copiata negli appunti!
- La chiave è già certificata!Per favore seleziona una chiave per la certificazione!Chiave troppo grande per essere condivisa in questo modo!
- Flusso di dati diretto senza file corrispettivo nel filesystem non e\' supportato.Devi avere Android 4.1 per usare Android NFC Beam!NFC non disponibile nel tuo dispositivo!Nessuna chiave trovata!
- Chiave della query di ricerca troppo corta
- Errore irreversibile nella ricerca di chiavi sul server
- Chiave della query di ricerca ha generato troppi candidati; Si prega di perfezionare la ricerca
- File/Appunti vuotiSi è verificato un errore generico, si prega di creare una nuova segnalazione di errore per OpenKeychain.parte del file caricato e\' un oggetto OpenPGP valido, ma non una chave OpenPGPparti del file caricato sono oggetti OpenPGP validi, ma non chavi OpenPGP
- È necessario apportare modifiche al portachiavi prima prima che sia possibile salvarloFirma non valida!Chiave pubblica sconosciuta
@@ -276,18 +217,11 @@
importazione...esportazione...fabbricazione chiave...
- certificazione chiave principale...fabbricazione portachiavi principale...
- aggiunta sottochiavi...
- salvataggio chiavi...esportazione chiave...esportazione chiavi...
-
- generazione chiave, sono necessari fino a 3 minuti...
- generazione chiavi, sono necessari fino a 3 minuti...
- estrazione chiavi di firma...estrazione chiave...preparazione flussi...
@@ -305,8 +239,6 @@
eliminazione sicura di \'%s\'...Nome/Email/ID Chiave...
- Cerca Chiave Privata
- Condividi chiave con...Nome/Keybase.io nome utente...512
@@ -338,22 +270,22 @@
Codice QR/NFCKeybase.ioImporta chiavi selezionate
- Importa dagli appunti
-
- Codice QR con ID %s mancante
- Codici QR con ID %s mancanti
-
- Perfavore inizia col Codice QR con ID 1Codica QR deformato! Prova di nuovo!
- Scansione codice QR completata!Impronta troppo corta (< 16 caratteri)
- Scansiona il Codice QR con \'Barcode Scanner\'
- Per ricevere le chiavi via NFC, il dispositivo deve essere sbloccato.
- AiutoScansione Codice QR
- Ottieni chiave dagli appunti
- Ottieni chiave da Keybase.io
+
+ Chiave importata correttamente.
+ %1$d chiavi importate correttamente.
+
+
+ Chiave%2$s importata correttamente.
+ %1$d chiavi%2$s importate correttamente.
+
+
+ Chiave%2$s aggiornata con successo.
+ Aggiornate %1$d chiavi%2$s con successo.
+ Mostra registroNiente da importareErrore di importazione chiavi!
@@ -381,7 +313,6 @@
SHA-256 della Firma del PacchettoAccountNessun account collegato a questa applicazione
- L\'applicazione richiede la creazione di un nuovo account. Si prega di selezionare una chiave privata esistente o crearne una nuova.\nLe applicazioni sono limitate all\'utilizzo delle chiavi selezionate qui!Le app visualizzate hanno richiesto l\'accesso a OpenKeychain.\nPermetti accesso?\n\nATTENZIONE: Se non sai perche\' questo schermata e\' apparsa, nega l\'accesso! Puoi revocare l\'accesso dopo, usando la schermata \'App Registrate\'.Permetti accessoNega accesso
@@ -392,9 +323,6 @@
Controllo della firma fallito! Hai installato questa app da una fonte diversa? Se sei sicuro che non sia un attacco, revoca la registrazione di questa app in OpenKeychain e dopo registra di nuovo l\'app.Condividi tramite Codice QR
- Scorri tutti i Codici QR usando \'Prossimo\', a scansionali uno ad uno.
- Impronta:
- Codice QR con ID %1$d di %2$dCondividi tramite NFC
@@ -405,7 +333,6 @@
Puoi iniziare daocreazione della tua chiave
- importazione chiavi.Modifica chiaveCodifica con questa chiave
@@ -416,21 +343,35 @@
CondividiSottochiaviCertificati
+
+ Cambia Frase Di Accesso
+ Aggiungi Identità
+ Aggiungi Sottochiave
+ Seleziona un azione!
+
+ Cambia in Identita\' Primaria
+ Revoca identita\'
+
+ Seleziona un azione!
+
+ Cambia Scadenza
+ Revoca Sottochiave
+
+
+ Carica chiave nel server delle chiavi
+ Questo campo è necessario
+
+ Questa chiave è stata revocata!
+ Questa chiave è scadutaChiaviFirma e CodificaDecodifica e Verifica
- Importa ChiaviAppsApri drawer di navigazioneChiudi drawer di navigazione
- ModificaLe Mie Chiavi
- Chiave Segreta
- disponibile
- non disponibile
- Scrivi qui il messaggio da codificare e/o firmare...Inserisci il testo cifrato qui per la decodifica e/o verifica...predefiniti
@@ -438,7 +379,7 @@
casualepositivorevocato
- ok
+ OKfallito!errore!chiave non disponibile
@@ -482,11 +423,21 @@
Reinserimento chiave segretaRiscontrato certificato sbagliato!Errore elaborazione certificato!
- ID utente certificato da %1$s (%2$s)
+ ID utente certificato da %1$s
+
+ Ignoro un certificato rilasciato da chiavi pubbliche sconosciute
+ Ignoro %s certificati rilasciati da chiavi pubbliche sconosciute
+
+ Classificazione ID utenti(nessuna firma affidabile disponibile)
+
+ Classificazione ID utenti (uso di una chiave verificata)
+ Classificazione ID utenti (uso di %s chiavi verificate)
+ Riordinamento ID utentiElaborazione ID utente %sID utente revocatoHo cercato di importare portachiavi pubblico come privato. Questo è un bug, per cortesia inviateci un rapporto!
+ Tentativo di importare un portachiavi senza canonicalizzazione. Questo è un bug, per cortesia inviateci un rapporto!Importazione chiave segreta %sErrore Banca Dati!
@@ -507,6 +458,7 @@
Rimozione certificato di revoca del portachiavi con caratteristica \"locale\"Rimozione certificato di revoca del portachiavi con marca temporale futuraRimozione certificato della chiave principale di tipo sconosciuto (%s)
+ Rimozione certificazione ID Utente in posizione errataRimozione certificato di revoca del portachiavi corrottoRimozione certificato di revoca del portachiavi ridondanteElaborazione sottochiave %s
@@ -525,7 +477,15 @@
Rimozione certificato di revoca corrotto della sottochiaveRimozione certificato di revoca ridondante della sottochiaveCanonicalizzazione del portachiavi avvenuta con successo, nessuna modifica
+
+ Canonicalizzazione portachiavi con successo, rimosso un certificato errato
+ Canonicalizzazione portachiavi con successo, rimossi %d certificati errati
+ Canonicalizzazione portachiavi con successo, rimossi %1$s certificati errati e %2$s certificati ridondanti
+
+ Canonicalizzazione portachiavi con successo, rimosso un certificato ridondante
+ Canonicalizzazione portachiavi con successo, rimossi %d certificati ridondanti
+ Rimozione autocertificazione corrotta per ID utente %sRimozione certificato ID utente con caratteristica \"locale\"Rimozione ID utente con marca temporale futura
@@ -536,6 +496,7 @@
Rimozione certificato di revoca ridondante per ID utente \"%s\"Rimozione certificato di revoca scaduto per ID utente \"%s\"Nessuna autocertificazione valida trovata per ID utente %s, rimozione dal portachiavi
+ Rimozione ID Utente %s non validoFusione nel portachiavi pubblico %sFusione nel portachiavi privato %s
@@ -543,12 +504,29 @@
Tentativo di consolidare portachiavi eterogeneiAggiunta nuova sottochiave %sTrovati %s nuovi certificati nel portachiavi
+ Nessun nuovo certificato
+
+ Generazione nuova chiave principale
+ Nessuna opzione della chiave principale specificata!
+ I portachiavi devono essere creati con almeno un ID utente!
+ La chiave principale deve avere la caratteristica di certificazione!
+ La grandezza della chiave deve essere di 512bit o maggiore
+ Errore PGP interno!
+ Pessima opzione di algortimo!
+ La chiave principale non deve essere del tipo ElGamal!Modifica del portachiavi %sEccezione di codifica!
+ Impronta chiave attuale non corrispondente!
+ Nessun ID chiave. Questo è un errore di programmazione, per favore invia una segnalazione!
+ Errore interno, controllo di integrità fallito!
+ ID utente primario specificato non valido!
+ ID utente revocato non può essere primario!Eccezione interna di PGP!Eccezione di firma!Cambio frase di accesso
+ Sostituzione certificato del ID utente primario precedente
+ Generazione di un nuovo certificato per il nuovo ID utente primarioModifica sottochiave %sTentativo di operare su sottochiave mancante %s!Generazione nuovi %1$s bit %2$s sottochiave
@@ -559,9 +537,17 @@
Aggiunta id utente %sCambio UID primario in %sRevoca ID utente %s
+ ID Utente non può essere vuoto!Errore di apertura portachiavi!Apertura portachiavi
+
+ Clicca per rimuovere la frase di accesso nella cache
+ OpenKeychain ha memorizzato nella cache %d frasi di accesso
+ Frasi di accesso memorizzate:
+ Pulisci Cache
+ Password
+ Errore interno!CertificatoreDettagli CertificatoIdentit
@@ -573,14 +559,14 @@
TipoChiave non trovata!Errore di elaborazione chiave!
- sottochiave non disponibileripulito
- Le chiavi segrete possono essere cancellate solo individualmente!Visualizza Dettagli Certificatisconosciutonon può firmare
- Errore di codificaNessuna sottochiave di codifica disponibile!Non creare account OpenKeychain manualmente\nPer ulteriori informazioni, vedere la Guida.Mostra chiave (%s)
+
+ Riappropriati della tua riservatezza con OpenKeychain!
+ Salta Installazione
diff --git a/OpenKeychain/src/main/res/values-ja/strings.xml b/OpenKeychain/src/main/res/values-ja/strings.xml
index 070ee7f5a..de22a8f7c 100644
--- a/OpenKeychain/src/main/res/values-ja/strings.xml
+++ b/OpenKeychain/src/main/res/values-ja/strings.xml
@@ -1,20 +1,17 @@
- 公開鍵の選択
- 秘密鍵の選択
+ 鍵を選択
+ あなたの鍵を選択暗号化復号化パスフレーズ
- 鍵の生成
+ 自分の鍵の生成鍵の編集
- OpenKeychainへようこそ設定アプリ鍵サーバ設定パスフレーズの変更
- パスフレーズの設定
- ...で共有...で指紋の共有...で鍵の共有...でファイルの共有
@@ -35,60 +32,39 @@
一般デフォルト拡張
- 主鍵
- メインのユーザIDアクションすべての鍵あなたの鍵を証明に利用します鍵のアップロード鍵サーバ
- 暗号化/署名
- 復号化と検証指紋鍵は検証されています。
- 証明復号化と検証、そしてファイルの保存メッセージの復号化と検証
- クリップボードから暗号化してファイルを保存
+ 暗号化してファイルを共有保存キャンセル削除無しOK
- 新しいパスフレーズに変更
- 新しいパスフレーズを設定鍵サーバへアップロード次戻る
- クリップボード
- ...で共有鍵検出
- 拡張設定を表示
- 拡張設定を隠す
- 暗号化/署名メッセージの共有...
+ 暗号化してメッセージを共有検証した鍵を見る
+ 鍵の生成
+ ファイルの追加設定ヘルプファイルへのエクスポート鍵の削除
- 鍵の生成
- 鍵の生成(上級)
+ 自分の鍵の生成
+ 既存の鍵のインポート検索
- 鍵サーバ...
- 鍵サーバからの更新
- 鍵サーバへのアップロード
- 共有...
- 指紋の共有...
- すべての鍵の共有...
- ...(指紋)
- ...(鍵)
- QRコードで共有(鍵)
- QRコードで共有(指紋)
- NFCで共有
- クリップボードへコピーBeamの設定キャンセル暗号化...
@@ -97,18 +73,22 @@
すべての鍵のエクスポート詳細情報を表示
- 署名メッセージファイル
+ ファイル
+ ファイル:パスフレーズなしパスフレーズ
- もう一度
+ 再度パスフレーズを入力アルゴリズムアスキー形式
- 受信者
- 暗号化後に削除
+ ファイル: アスキー形式
+ 他の人にあなたがOpenKeychain使用していることを知ってもらいましょう
+ OpenPGPの 署名、暗号文、そしてエクスポートした鍵に \'OpenKeychain v2.7\' と書くようになりました
+ 差出人:
+ 宛先
+ ファイル: 暗号化後に削除復号化後に削除
- 暗号化して共有暗号化アルゴリズムハッシュアルゴリズム公開鍵で
@@ -123,17 +103,13 @@
満了使い方鍵サイズ
- メインのユーザID
+ 主ユーザID名前コメントEメールアドレス証明後選択した鍵サーバに鍵をアップロード指紋
- 選択期限日時を設定
-
- %d を選択
- <名前なし><無し><鍵無し>
@@ -178,7 +154,6 @@
認証良くないパスフレーズ
- 最初にパスフレーズを設定してください。互換性のないファイルマネージャがインストールされています。パスフレーズが一致しません。パスフレーズを入れてください。
@@ -197,15 +172,12 @@
どのファイルをエクスポートするか決めてください。\n注意: 既存のファイルがあると上書きされます。選択したすべての公開鍵を削除して本当に良いのですか?\nこれは元に戻せません!秘密鍵\'%s\'を本当に削除してもよいですか?\nこれは元に戻せません!
- あなたは鍵輪に変更を加えました、これを保存しますか?
- あなたは空のユーザIDを追加しました、このまま続けますか?公開鍵\'%s\'を本当に削除してもよいですか?\nこれは元に戻せません!
- 秘密鍵もエクスポートしますか?
+ 秘密鍵もエクスポートします1つの鍵をエクスポートしました。%d の鍵をエクスポートしました。鍵をエクスポートしていません。ノート: 副鍵はElGamalでのみサポートされます。
- 付記: 長さ1024bitかそれ以下で生成されたRSA鍵は安全とはみなされず、新な鍵の生成は無効にされています。鍵 %08X は見付かりませんでした。%d の問題ある鍵を無視しました。 おそらく次のオプションでエクスポートしています\n --export-secret-subkeys\n代りに次のオプションでエクスポートしてください。\n --export-secret-keys
@@ -216,7 +188,6 @@
NFCビームで鍵を送信しました!鍵はクリプボードにコピーされました!指紋はクリプボードにコピーされました!
- 鍵はすでに検証されています!検証に使う鍵を選択して下さい!この共有方法では鍵が大きすぎます!
- ファイルシステムに存在するファイルではないバイナリデータはサポートされません。Android NFC Beam機能を使うにはAndroid 4.1 が必要です!あなたのデバイスにはNFCが存在しません!鍵が見当りません!
- 鍵検索のクエリが短かすぎます
- サーバでの鍵の検索が回復不可能なエラーになりました
- 鍵検索のクエリが沢山の候補を返しました; クエリを精密化してください
- ファイル/クリップボードが空です
+ 鍵検索のクエリが短かすぎます。クエリを精密化してください!
+ 鍵の検索時にエラーが発生しました。
+ 鍵検索のクエリが沢山の候補を返しました。クエリを精密化してください!
+ 鍵がまったく無いか、多すぎる鍵が見付かりました。クエリを改善してください!
+ ファイル/クリップボードにて正しい鍵が見付かりません!一般エラーが発生しました、この新しいバグの情報をOpenKeychainプロジェクトに送ってください読み込んだファイルのOpenPGPオブジェクト部分は正しいですが、OpenPGPの鍵ではありません
- あなたは鍵輪を保存する前に変更を加えなくてはなりません不正な署名です!不明な公開鍵
@@ -270,17 +235,24 @@
保存...インポート...エクスポート...
+ アップロード中...鍵の構築中...
- 主鍵の証明中...主鍵輪の構築中...
- 副鍵の追加中...
- 鍵の保存...
+ 新しいRSA鍵を生成中...
+ 新しいDSA鍵を生成中...
+ 新しいElGamal鍵を生成中...
+ 鍵輪を変更中...
+ 鍵輪のロック解除中...
+ ユーザIDを追加中...
+ ユーザIDを破棄中...
+ 主ユーザIDを変更中...
+ 副鍵の変更中...
+ 副鍵の破棄中...
+ 副鍵を追加中...
+ パスフレーズの変更中...鍵のエクスポート...
-
- 鍵の生成中、最大3分ほどかかります...
- 署名鍵の取り出し中...鍵の取り出し中...ストリームの準備中...
@@ -291,6 +263,7 @@
署名処理中...署名の検証中...署名中...
+ 検証中...データ読み込み中...鍵検索中...データの展開中...
@@ -298,8 +271,6 @@
\'%s\' を完全に削除中…名前/メール/鍵ID...
- 秘密鍵の検索
- ...で鍵の共有名前/Keybase.io名...512
@@ -331,26 +302,15 @@
QRコード/NFCKeybase.io選択した鍵のインポート
- クリップボードからインポート
-
- ID %s のQRコードがありません
-
- QRコードをID 1で始めてください不適QRコード! もう一度!
- QRコードの読み取り完了!指紋が短かすぎます (< 16 文字)
- \'バーコードスキャナー\'でQRコードをスキャンする
- NFCで鍵を受信しました、デバイスのロックを解除する必要があります。
- ヘルプQCコードのスキャン...
- クリップボードから鍵を取得
- Keybase.ioから鍵を取得%1$d の鍵のインポートに成功
- そして%1$d の鍵%2$s をアップデート。
+ そして、%1$d の鍵を %2$s アップデートした。%1$d の鍵%2$sのインポートに成功。
@@ -368,7 +328,7 @@
OpenKeychainで暗号化OpenKeychainで復号化
- 未登録のアプリケーションです!\n\n\"ヘルプ\"のサードパーティ製アプリケーションのサポートリストにあるかを見てください!
+ 未登録のアプリです!\n\n\"ヘルプ\"のサードパーティ製アプリケーションのサポートリストにあるかを見てください!詳細情報を表示詳細情報を非表示拡張設定を表示
@@ -384,9 +344,9 @@
パッケージ名パッケージの署名 SHA-256アカウント
- このアプリケーションに接続されてるアカウントはありません。
- このアプリケーションは新しいアカウントの生成を要求しています。すでにある秘密鍵を選択するか、新しく生成してください。\nここであなたが選択する鍵の使い道についてアプリケーションには制約があります!
- 表示されているアプリケーションはOpenKeychainへのアクセスを要求しています。\nアクセスを許可しますか?\n\n注意: もしなぜスクリーンに表れたかわからないなら、アクセスを許可しないでください! あなたは\'登録済みアプリケーション\'スクリーンを使って、以降のアクセスを破棄するこもできます。
+ このアプリに接続されてるアカウントはありません。
+ このアプリは新しいアカウントの生成を要求しています。すでにある鍵1つを選択するか、新たに生成してください。\nここであなたが選択する鍵の使い道についてアプリケーションには制約があります!
+ 表示されているアプリはメッセージの暗号/復号化とあなたの名前での署名付けを要求しています。\nアクセスを許可しますか?\n\n注意: もしなぜスクリーンに表れたかわからないなら、アクセスを許可しないでください! あなたは後で\'アプリ\'スクリーンを使い、アクセスを破棄するこもできます。許可されたアクセス許可されないアクセス鍵を選択してください!
@@ -396,9 +356,6 @@
署名チェックが失敗! 違うところからこのアプリをインストールしましたか? もし攻撃されてでなくそうであるなら、OpenKeychainにあるこのアプリの登録を破棄し、再度アプリを登録してください。QRコードで共有
- すべてのQRコードを見る場合、\'次\' を押して一つ一つスキャンしてください。
- 指紋:
- %2$d の ID %1$d のQRコードNFCで共有
@@ -408,32 +365,54 @@
で始めるもしくはあなた所有の鍵を作る
- 鍵のインポート。
+ 既存の鍵のインポート。鍵の編集この鍵で暗号化ユーザID検証
+ 鍵サーバからの更新...で共有デバイスの後ろ同士を固定してNFC経由で共有
+ 鍵サーバへのアップロード情報共有副鍵証明
+
+ パスフレーズの変更
+ ユーザIDの追加
+ 副鍵の追加
+ アクションを選んでください!
+
+ 主IDを変更
+ IDを破棄
+
+ アクションを選んでください!
+
+ 期限を変更
+ 副鍵を破棄
+
+
+ 鍵サーバへアップロード
+ このフィールドは必須です
+ パスフレーズが一致しない
+ あたなが入力したIDは以下です:
+ しばらくの間鍵を生成しています、その間はコーヒーでもどうぞ....\n(3つの副鍵、RSA、4096bit)
+ フルネーム、Eメールアドレスを入力そしてパスフレーズを選択してください。
+ フルネーム、例えば Max Mustermann
+
+ この鍵は破棄されています!
+ この鍵は期限切れです!鍵署名と暗号化復号化と検証
- 鍵のインポートアプリナビゲーションドロワーを開くナビゲーションドロワーを閉める
- 編集自分の鍵
- 秘密鍵
- 存在する
- 存在しない
- ここに書いたメッセージを暗号化/署名..
+ ここで入力したメッセージは、「差出人」で選択した鍵で署名され、「宛先」で選択したすべての受信者に対してその鍵で暗号化します。ここに入力された暗号化テキストを復号化/検証...デフォルト
@@ -485,7 +464,7 @@
秘密鍵を再挿入中問題のある検証と遭遇しました!検証の処理中にエラーしました!
- ユーザIDは %1$s (%2$s) によって検証されました
+ ユーザIDは %1$s によって検証されました不明な公開鍵から %s の検証を無視
@@ -497,6 +476,7 @@
ユーザID %s の処理中ユーザIDは破棄されました公開鍵の鍵輪を秘密鍵としてインポートを試行しました。これはバグで、ファイルをレポートしてください\"
+ 正規化せずに鍵輪へインポートを試行した。これはバグで、ファイルをレポートしてください!秘密鍵 %s のインポート中データベースエラー!
@@ -517,6 +497,7 @@
鍵輪のローカルフラグ付き破棄証明を破棄中鍵輪の未来にタイムスタンプがある破棄証明を破棄中問題のある主鍵の不明な型 (%s) の証明を破棄中
+ 不正な位置のユーザID検証を破棄中問題のある鍵輪の破棄証明を破棄中重複している鍵輪の破棄証明を破棄中副鍵 %s の処理中
@@ -552,6 +533,7 @@
ユーザID \"%s\" による重複した破棄証明を破棄中ユーザID \"%s\" による期限切れ破棄証明を破棄中ユーザID %s の正常な自己署名が見付かりませんでした、鍵輪から除去しました
+ 正しくないユーザID %s を破棄中公開鍵の鍵輪 %s にマージ中秘密鍵の鍵輪 %s にマージ中
@@ -559,16 +541,29 @@
種類の異なる鍵輪を統合しようとした新しい副鍵 %s を追加中鍵輪に新しい検証を %s 発見
+ 新しい証明がない
+
+ 新しい主鍵を生成中
+ 主鍵オプション特有ではありません!
+ 鍵輪は最低でも1つのユーザIDの生成が必要です!
+ 主鍵は検証フラグが必須です!
+ 鍵サイズは512かそれ以上が必須です!
+ PGP内部エラー!
+ 悪いアルゴリズムを選択しています!
+ 主鍵を ElGamal にすることはできません鍵輪 %s を変更中エンコード例外!
- 現実の鍵指紋が予想と合致しませんでした!
- 鍵IDがない。 これはプログラミングのエラーで、バグレポートの提出をお願いします!
+ 現実の鍵指紋が想定の1つと合致しませんでした!
+ 鍵IDがない。 これは内部エラーで、バグレポートの提出をお願いします!内部エラー、完全性チェックが失敗!
+ 問題のある主ユーザIDが指定された!主ユーザIDの破棄はできません!PGP内部例外!署名例外!パスフレーズの変更中
+ 以前の主ユーザIDで証明を入れ替え中
+ 新しい主ユーザIDで新しい証明を生成中副鍵 %s を変更中遺失した副鍵 %s の操作をしようとした!新しい %1$s ビットの %2$s 副鍵の生成中
@@ -579,9 +574,17 @@
ユーザID %s を追加中主UIDを %s に変更中ユーザID %s を破棄中
+ ユーザIDは空にすることはできません!鍵輪のロック解除エラー!鍵輪のロック解除中
+
+ クリックしてパスフレーズのキャッシュをクリア
+ OpenKeychainは %d のパスフレーズをキャッシュしています
+ パスフレーズのキャッシュ:
+ キャッシュクリア
+ パスワード
+ 内部エラー!検証者証明の詳細ユーザID
@@ -593,14 +596,17 @@
種別鍵が見当りません!鍵処理中のエラー!
- 副鍵がありませんスリム化
- 秘密鍵は個別にしか削除できません!
+ あなたが所有者の鍵は個別にしか削除できません!証明の詳細を見る不明署名不可
- エンコードエラー暗号化の副鍵がありません!OpenKeychainのアカウントを手動では生成できません.\nより詳細は、ヘルプを参照のこと。鍵 (%s) を表示
+
+ OpenKeychainであなたのプライバシーを取り戻しましょう!
+ 自分の鍵の生成
+ 既存の鍵のインポート
+ セットアップをスキップ
diff --git a/OpenKeychain/src/main/res/values-ko/strings.xml b/OpenKeychain/src/main/res/values-ko/strings.xml
index 593fc2d11..4cf33460a 100644
--- a/OpenKeychain/src/main/res/values-ko/strings.xml
+++ b/OpenKeychain/src/main/res/values-ko/strings.xml
@@ -25,6 +25,9 @@
+
+
+
@@ -32,6 +35,9 @@
+
+
+
diff --git a/OpenKeychain/src/main/res/values-nl/strings.xml b/OpenKeychain/src/main/res/values-nl/strings.xml
index 11b6c9673..640ac777d 100644
--- a/OpenKeychain/src/main/res/values-nl/strings.xml
+++ b/OpenKeychain/src/main/res/values-nl/strings.xml
@@ -1,18 +1,13 @@
- Publieke sleutel selecteren
- Privésleutel selecterenVersleutelenOntsleutelenWachtwoord
- Sleutel aanmakenSleutel bewerkenInstellingenSleutelserver VoorkeurWachtwoord wijzigen
- Wachtwoord instellen
- Delen met...Vingerafdruk delen met...Sleutel delen met...Bestand delen met...
@@ -32,60 +27,33 @@
AlgemeenStandaardGeavanceerd
- Master Sleutel
- Primaire IdentiteitActiesHele sleutelUw Sleutel die u gebruikt voor certificatieUpload SleutelSleutelserver
- Versleutel en/of Signeer
- Decodeer en VerifiëerVingerafdrukSleutel om te certificeren
- CertifiëerDecodeer, verifiëer en sla bestand opDecodeer en verifiëer bericht
- Van KlembordCodeer en sla bestanden opOpslaanAnnulerenVerwijderenGeenOK
- Verander Nieuw Wachtwoord
- Bepaal Nieuwe WachtwoordUpload Naar SleutelserverVolgendeTerug
- Klembord
- Delen met...Opzoeksleutel
- Toon geavanceerde instellingen
- Verberg geavanceerde instellingen
- Gecodeerd/ondertekend bericht delen...Toon certificatiesleutelInstellingenHelpExporteren naar bestandSleutel verwijderen
- Sleutel aanmaken
- Sleutel aanmaken (expert)Zoeken
- Sleutelserver...
- Update van sleutelserver
- Upload naar sleutelserver
- Delen...
- Deel vingerafdruk...
- Hele sleutel delen...
- met...
- met...
- met QR Code
- met QR Code
- met NFC
- Kopieer naar klembordBeam-instellingenAnnulerenVersleutelen naar...
@@ -93,22 +61,15 @@
Sleutels toevoegenAlle sleutels exporteren
- OndertekenenBerichtBestandGeen wachtwoordWachtwoord
- OpnieuwAlgoritmeASCII-armor
- Ontvangers
- Verwijderen na versleutelingVerwijderen na ontsleuteling
- Delen Na VersleutelingVersleutelingsalgoritmeVerificatie-algoritme
- met Publieke Sleutel
- met WachtwoordWachtwoordcacheBerichtcompressieBestandscompressie
@@ -125,12 +86,7 @@
E-mailadresUpload sleutel naar geselecteerde sleutelserver na bevestigingVingerafdruk
- SelecterenBepaal verloopdatum
-
- %d geselecteerd
- %d geselecteerd
- <no naam><geen><geen sleutel>
@@ -177,7 +133,6 @@
LegitimerenWachtwoord verkeerd.
- Stel eerst een wachtwoord in.Geen compatibele bestandsbeheerder geïnstalleerd.De wachtwoorden komen niet overeen.Vul een wachtwoord in.
@@ -196,15 +151,11 @@
Specifieer naar welk bestand er geëxporteerd moet worden.\nWAARSCHUWING: Bestand zal vervangen worden als het bestaat.Weet u zeker dat u alle weergegeven publieke sleutels wilt verwijderen?\nU kunt dit niet ongedaan maken!Weet u zeker dat u de privésleutel \'%s\' wilt verwijderen?\nDit kan niet ongedaan worden gemaakt.
- U heeft veranderingen aangebracht tot de sleutelring, wilt u deze opslaan?
- U heeft een lege identiteit toegevoegd, weet u zeker dat u wilt doorgaan?Wilt u echt de publieke sleutel \'%s\' verwijderen?\nDit kunt u niet ongedaan maken!
- Ook geheime sleutels exporteren?1 sleutel succesvol geëxporteerd.Succesvol %d sleutels geëxporteerd.Geen sleutels geëxporteerd.Opmerking: alleen subsleutels ondersteunen ElGamal.
- Opmerking: RSA sleutel met lengte 1024-bit en minder genereren wordt als onveilig beschouwd en is uitgeschakeld voor het genereren van nieuwe sleutels.Kan de sleutel %08X niet vinden.%d slechte geheime sleutel genegeerd. Misschien heeft u geëxporteerd met de optie\n --export-secret-subkeys\nZorg ervoor dat u in plaats daarvan met\n --export-secret-keys\nexporteert.
@@ -216,7 +167,6 @@
Succesvol sleutel verstuurd met NFC Beam!Sleutel is gekopieerd naar het klembord!Sleutel is gekopieerd naar het klembord!
- Sleutel is al gecertificeerd!Selecteer een sleutel die gebruikt moet worden voor certificatie!Sleutel is te groot om op deze manier gedeeld te worden!
- Directe binaire data zonder eigenlijke bestand in bestandssysteem wordt niet ondersteund.U heeft minstens Android 4.1 nodig om Androids NFC Beam eigenschap te gebruiken!Uw apparaat biedt geen ondersteuning voor NFCEen algemene fout is opgetreden, maak alstublieft een nieuwe bug report voor OpenKeychain.
@@ -250,7 +194,6 @@
Deel van het geladen bestand is geldig OpenPGP object maar niet een OpenPGP sleutelDelen van het geladen bestand zijn geldige OpenPGP objecten maar niet OpenPGP sleutels
- U moet veranderingen maken aan de sleutelring voor u het kunt opslaan.Ongeldige handtekening!Onbekende publieke sleutel
@@ -267,18 +210,11 @@
importeren...exporteren...sleutel maken...
- hoofdsleutel certificeren...hoofdsleutelbos maken...
- sub-sleutels toevoegen...
- sleutel opslaan...sleutel exporteren...sleutels exporteren...
-
- sleutel genereren, dit kan tot 3 minuten duren...
- sleutels genereren, dit kan tot 3 minuten duren...
- ondertekeningssleutel uitpakken...sleutel uitpakken...streams voorbereiden...
@@ -295,8 +231,6 @@
integriteit verifiëren...\'%s\' veilig verwijderen...
- Privésleutels zoeken
- Sleutel delen met...512768
@@ -323,20 +257,8 @@
Versie:Geselecteerde sleutels importeren
- Importeren uit klembord
-
- Missende QR code met ID %s
- Missende QR Codes met ID\'s %s
-
- Begin met QR Code met ID 1QR-code ongeldig. Probeer het opnieuw
- QR-code gescandVingerafdruk is te kort (< 16 tekens)
- Scan QR Code met \'Barcode Scanner\'
- Om sleutels via NFC te ontvangen moet het apparaat ontgrendeld zijn.
- Help
- Verkrijg sleutel uit klembord
- Verkrijg sleutel uit Keybase.ioDecodeer bestand met OpenKeychain
@@ -344,7 +266,6 @@
Codeer met OpenKeychainDecodeer met OpenKeychain
- Geen geregistreerde applicaties!\n\nEen lijst van ondersteunde derde-partij applicaties kan gevonden worden in \'Help\'!Toon geavanceerde informatieVerberg geavanceerde informatieToon geavanceerde instellingen
@@ -360,9 +281,6 @@
PakketnaamSHA-256 van PakkethandtekeningAccounts
- Geen accounts verbonden aan deze applicatie.
- Deze applicatie vraagt de aanmaak van een nieuw account aan. Selecteer een bestaande privésleutel of maak een nieuwe.\nApplicaties zijn gelimiteerd tot het gebruik van sleutels die u hier selecteert!
- De weergegeven applicatie vraagt toegang tot OpenKeychain.\nSta toegang toe?\n\nWAARSCHUWING: Als u niet weet waarom dit scherm verscheen, sta dan geen toegang toe! U kunt toegang later weghalen door het \'Geregistreerde Applicaties\' scherm te gebruiken.Toegang toestaanToegang weigerenSelecteert u a.u.b. een sleutel
@@ -372,9 +290,6 @@
Handtekening check mislukt! Hebt u deze app van een andere bron geïnstalleerd? Als u zeker weet dat dit geen aanval is, haal dan de registratie van deze app in OpenKeychain weg en registreer de app opnieuw.Delen met QR-code
- U gaat door alle QR-codes met \'Volgende\', en scant ze een voor een.
- Vingerafdruk:
- QR Code met ID %1$d van %2$dDeel met NFC
@@ -385,7 +300,6 @@
U kunt beginnen doorofuw eigen sleutel aanmaken
- sleutels importeren.Sleutel bewerkenCodeer met deze sleutel
@@ -396,20 +310,17 @@
DelenSubsleutelsCertificaten
+
+
+
SleutelsOndertekenen en VersleutelenDecoderen en Verifiëren
- Importeer SleutelsOpen navigatiemenuSluit navigatiemenu
- BewerkenMijn Sleutels
- Geheime Sleutel
- beschikbaar
- onbeschikbaar
- Schrijf bericht hier om te versleutelen en/of ondertekenen...Voer cijfertekst hier in om te decoderen en/of verifiëren...standaard
@@ -417,7 +328,6 @@
eenvoudigpositiefingetrokken
- okmislukt!fout!sleutel onbeschikbaar
@@ -425,7 +335,9 @@
+
+
CertificeerCertificaat Details
@@ -438,11 +350,10 @@
TypeSleutel niet gevonden!Fout bij verwerken sleutel!
- subsleutel onbeschikbaargestript
- Geheime sleutels kunnen alleen individueel verwijderd worden!Toon Certificaat Detailsonbekendkan niet ondertekenenGeen codeer-subsleutel beschikbaar!
+
diff --git a/OpenKeychain/src/main/res/values-pl/strings.xml b/OpenKeychain/src/main/res/values-pl/strings.xml
index 9e41373f4..69179d509 100644
--- a/OpenKeychain/src/main/res/values-pl/strings.xml
+++ b/OpenKeychain/src/main/res/values-pl/strings.xml
@@ -1,17 +1,13 @@
- Wybierz Klucz Publiczny
- Wybierz Klucz PrywatnyZaszyfrujOdszyfrujHasło
- Utwórz KluczEdytuj KluczWłaściwościWłaściwości serwera kluczyZmień hasło
- Ustaw hasłoUdostępnij plik...Zaszyfruj do plikuOdszyfruj do pliku
@@ -26,51 +22,26 @@
OgólneDomyślneZaawansowane
- Klucz głównyDziałaniaTwój klucz użyty do certyfikacjiWyślij kluczSerwer kluczy
- Zaszyfruj i/lub podpisz
- Deszyfruj i weryfikuj
- Certyfikuj
- Ze schowkaZapiszAnulujUsuńŻadenOk
- Zmień nowe hasło
- Ustaw nowe hasłoWyślij do serwera kluczyDalejWstecz
- Schowek
- Podziel się z...Klucz wyszukiwania
- Pokaż zaawanowane ustawienia
- Ukryj zaawansowane ustawieniaUstawieniaPomocEksportuj do plikuUsuń klucz
- Stwórz klucz
- Stwórz klucz (tryb zaawansowany)Znajdź
- Serwer kluczy...
- Aktualizuj z serwera kluczy
- Wyślij do serwera kluczy
- Udostepnij...
- Udostepnij odcisk...
- Udostępnij cały klucz...
- z...
- z...
- za pomocą kodu QR
- za pomocą kodu QR
- za pomocą NFC
- Kopiuj do schowkaUstawienia BeamAnulujZaszyfruj do...
@@ -78,22 +49,15 @@
Dodaj kluczeEksportuj wszystkie klucze
- PodpisWiadomośćPlikBrak hasłaHasło
- PonówAlgorytmASCII Armor
- Odbiorcy
- Usuń po zaszyfrowaniuUsuń po odszyfrowaniu
- Udostępnij po zaszyfrowaniuAlgorytm szyfrującyAlgorytm funkcji skrótu
- za pomocą klucza publicznego
- za pomocą hasłaBufor hasełKompresja wiadomościKompresja plików
@@ -109,13 +73,7 @@
Adres emailWyślij klucz do serwera kluczy po certyfikacjiOdcisk
- WybierzUstaw datę wygaśnięcia
-
- wybrano %d
- wybrano %d
- wybrano %d
- <bez nazwy><żaden><brak klucza>
@@ -164,7 +122,6 @@
AutentykujNieprawidłowe hasło.
- Najpierw ustaw hasło.Nie zainstalowano żadnego kompatybilnego menadżera plików.Hasła nie pasują do siebiePodaj hasło.
@@ -183,14 +140,11 @@
Wskaż, do którego pliku wyeksportować dane.\nOSTRZEŻENIE: Plik zostanie nadpisany, jeżeli istnieje.Czy na pewno chcesz usunąć wszystkie zaznaczone klucze publiczne?\nTej operacji nie można cofnąć!Czy na pewno chcesz usunąć klucz prywatny \'%s\'?\nNie można cofnąć tej operacji!
- Zostały dokonane zmiany w pęku kluczy, czy chcesz je zachować?Czy na pewno chcesz usunąć klucz publiczny \'%s\'?\nNie można cofnąć tej operacji!
- Czy wyeksportować również klucze prywatne?Pomyślnie wyeksportowano 1 klucz.Pomyślnie wyeksportowano %d kluczy.Nie wyeksportowano żadnych kluczy.Informacja: tylko podklucze mogą być tworzone przy użyciu algorytmu ElGamal.
- Uwaga: generowanie klucza RSA o długości 1024 bity i mniejszej jest uważane za niebezpieczne i wyłączone dla tworzenia nowych kluczy.Nie można znaleźć klucza %08X.Zignorowano %d niepoprawny klucz prywatny. Prawdopodobnie został wyeksportowany przy uzyciu opcji\n --export-secret-subkeys\nUpewnij się że eksportujesz go z opcją\n --export-secret-keys\nktóra jest poprawna.
@@ -201,7 +155,6 @@
Lista jest pusta!Pomyślnie wysłano klucz przez NFC Beam!Klucz został skopiowany do schowka!
- Klucz został już wcześniej certyfikowany!Klucz ma za duży rozmiar by być udostępniony w ten sposób!
- Dane binarne pozbawione pliku nie są obsługiwane.Potrzebujesz Androida 4.1 aby korzystać z Android NFC BeamNCF jest niedostępne na twoim urządzeniuWystąpił błąd ogólny, proszę zgłoś go autorom OpenKeychain.
@@ -233,7 +181,6 @@
Część wczytanego pliku to poprawne obiekty OpenPGP, ale nie są kluczami OpenPGPCzęść wczytanego pliku to poprawne obiekty OpenPGP, ale nie są kluczami OpenPGP
- Musisz dokonać zmian w pęku kluczy zanim będziesz mógł go zachowaćNieprawidłowy podpis!Nieznany klucz publiczny
@@ -250,20 +197,12 @@
importowanie...eksportowanie...budowanie klucza...
- podpisywanie klucza głównego...budowanie głównego zbioru kluczy...
- dodawanie podkluczy...
- zapisywanie klucza...eksportowanie klucza...eksportowanie kluczy...eksportowanie kluczy...
-
- generowanie klucza, może to potrwać do 3 minut...
- generowanie kluczy, może to potrwać do 3 minut...
- generowanie kluczy, może to potrwać do 3 minut...
- wyodrębnianie klucza podpisu...wyodrębnianie klucza...przygotowywanie strumieni...
@@ -280,8 +219,6 @@
weryfikacja spójności...usuwanie \'%s\' bezpiecznie…
- Wyszukaj klucze prywatne
- Udostępnij klucz...512768
@@ -308,20 +245,8 @@
Wersja:Zaimportuj wybrane klucze
- Importuj ze schowka
-
- Brakuje kodu QR o identyfikatorze %s
- Brakuje kodów QR o identyfikatorach %s
- Brakuje kodów QR o identyfikatorach %s
-
- Zacznij od kodu QR o identyfikatorze 1Kod QR zniekształcony! Spróbuj jeszcze raz!
- Skanowanie kodu QR zakończone!Odcisk klucza jest za krótki (< 16 znaków)
- Odczytaj kod QR przy pomocy \'Barcode Scanner\'
- Aby odbierać klucze przez NFC, urządzenie musi być odblokowane.
- Pomoc
- Odczytaj klucz ze schowkaDeszyfruj plik korzystając z OpenKeychain
@@ -343,9 +268,6 @@
Nazwa paczkiSkrót SHA-256 podpisu paczkiKonta
- Nie przypisano żadnych kont do tej aplikacji
- Aplikacja prosi o zgodę na utworzenie nowego konta. Wskaż istniejący klucz prywatny lub wygeneruj nowy.\nAplikacje mogą używać wyłącznie klucze które tutaj wskażesz!
- Wyświetlona aplikacja prosi o dostęp do OpenKeychain.\nZezwolić?\n\nOSTRZEZENIE: Jeżeli nie wiesz, czemu wyświetlił się ten komunikat, nie zezwalaj na dostęp! Możesz to również zrobić później, korzystając z ekranu \'Zarejestrowane aplikacje\'.Zezwól na dostępOdmów dostępuWybierz klucz!
@@ -353,9 +275,6 @@
Sprawdzanie podpisu zakończone niepowodzeniem! Czy zainstalowałeś tę aplikację z innego źródła? Jeżeli jesteś pewien, że nie jest to atak, odwołaj rejestrację teg aplikacji w OpenKeychain, a następnie zarejestruj ją ponownie.Udostępnij przez kod QR
- Przejdź przez wszystkiego kody QR korzystając z przycisku \'Nastepny\' i skanuj je pojedynczo.
- Odcisk:
- Kod QR o identyfikatorze %1$d z %2$dUdostępnij przez NFC
@@ -367,30 +286,25 @@
Możesz zacząć odlubtworzenie własnego klucza
- importowanie kluczy.Zaszyfruj korzystając z tego klucza
+
+
+
KluczePodpisz i zaszyfrujDeszyfruj i weryfikuj
- Importuj kluczeOtwórz panel nawigacjiZamknij panel nawigacji
- EdytujMoje klucze
- Klucz prywatny
- dostępny
- niedostepny
- Wpisz tutaj wiadomość do zaszyfrowania i/lub podpisania...Wpisz tutaj tekst do zaszyfrowania i/lub zweryfikowania...domyślnyżadentypowypozytywny
- okniepowodzenie!błąd!klucz niedostępny
@@ -398,7 +312,9 @@
+
+
Szczegóły certyfikatu<nieznany>
@@ -408,10 +324,9 @@
TypNie znaleziono klucza!Błąd przy przetwarzaniu klucza!
- podklucz niedostępnyzredukowany
- Klucze prywatne mogą być usuwane tylko pojedynczoZweryfikuj szczegóły certyfikatunieznanynie może podpisać
+
diff --git a/OpenKeychain/src/main/res/values-ro/strings.xml b/OpenKeychain/src/main/res/values-ro/strings.xml
new file mode 100644
index 000000000..4cf33460a
--- /dev/null
+++ b/OpenKeychain/src/main/res/values-ro/strings.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OpenKeychain/src/main/res/values-ru/strings.xml b/OpenKeychain/src/main/res/values-ru/strings.xml
index 1e697c8db..7e6516abe 100644
--- a/OpenKeychain/src/main/res/values-ru/strings.xml
+++ b/OpenKeychain/src/main/res/values-ru/strings.xml
@@ -1,20 +1,14 @@
- Выбрать Публичный ключ
- Выбрать Секретный ключЗашифроватьРасшифроватьПароль
- Создать ключИзменить ключ
- Добро пожаловать в OpenKeychainНастройкиПриложенияНастройки сервера ключейИзменить пароль
- Задать пароль
- Отправить...Отправить отпечаток...Отправить ключ...Отправить файл...
@@ -35,60 +29,33 @@
ПриложениеАлгоритмыДополнительно
- Основной ключ
- Основной идентификаторДействияКлючВаш ключ для сертификацииЗагрузить ключСервер ключей
- Зашифровать и/или Подписать
- Расшифровать и проверитьОтпечаток ключаСертифицируемый ключ
- СертифицироватьРасшифровать, проверить и сохранить файлРасшифровать и проверить сообщение
- Из буфера обменаЗашифровать и сохранить файлСохранитьОтменаУдалитьНетДа
- Изменить новый пароль
- Задать новый парольЗагрузить на сервер ключейДалееНазад
- Буфер обмена
- Поделиться...Найти ключ
- Показать расширенные настройки
- Скрыть расширенные настройки
- Отправить зашифрованное/подписанное сообщение...Просмотр ключаНастройкиПомощьЭкспорт в файлУдалить ключ
- Создать ключ
- Создать ключ (эксперт)Поиск
- Сервер ключей...
- Обновить с сервера ключей
- Загрузить на сервер ключей
- Отправить...
- Отправить отпечаток...
- Отправить ключ...
- Отправить
- Отправить
- QR код
- QR код
- через NFC
- Копировать в буферНастройки BeamОтменаЗашифровать....
@@ -97,22 +64,15 @@
Экспорт всех ключейПодробные данные
- ПодписатьСообщениеФайлБез пароляПароль
- Еще разАлгоритмASCII формат
- Получатели
- Удалить после шифрованияУдалить после расшифровки
- Отправить после шифрованияАлгоритм шифрованияHash-алгоритм
- Публичным ключом
- ПаролемПомнить парольСжатие сообщенияСжатие файла
@@ -129,13 +89,7 @@
EmailПосле сертификации загрузить ключ на серверОтпечаток
- ВыбратьСрок годности
-
- %d выбран
- %d выбрано
- %d выбрано
- <нет имени><нет><нет ключа>
@@ -184,7 +138,6 @@
АутентификацияНеправ. пароль
- Сначала задайте парольНет совместимого менеджера файлов.Пароли не совпадают.Пожалуйста, введите пароль.
@@ -203,15 +156,11 @@
Пожалуйста, выберите файл для экспорта.\nВНИМАНИЕ! Если файл существует, он будет перезаписан.Вы уверены, что хотите удалить выбранные ключи?\nЭто действие нельзя отменить!Вы уверены, что ходите удалить СЕКРЕТНЫЙ ключ \'%s\'?\nЭто действие нельзя отменить!
- Изменения внесены. Сохранить?
- Вы добавили пустой идентификатор. Вы уверены, что хотите продолжить?Вы правда хотите удалить публичный ключ \'%s\'?\nЭто действие нельзя отменить!
- Экспортировать секретные ключи?Успешный экспорт 1 ключа.Экспортировано %d ключей.Ключи не были экспортированы.Прим.: только вторичные ключи поддерживают ElGamal.
- Внимание: создание ключей RSA длиной 1024 бита и менее признано небезопасным. Данная возможность отключена.Не удается найти ключ %08X.%d плохой секретный ключ проигнорирован. Возможно, вы экспортируете с параметром\n--export-secret-subkeys\nВместо этого используйте\n--export-secret-keys
@@ -224,7 +173,6 @@
Ключ успешно передан через NFC!Ключ скопирован в буфер обмена!Отпечаток ключа скопирован в буфер обмена!
- Ключ уже был сертифицирован ранее!Выберите ключ, используемый для сертификации!Ключ слишком большой для этого способа передачи!
- Прямая передача данных без использования файла в памяти устройства не поддерживается.Для использования NFC Beam требуется Android 4.1+ !Ваше устройство не поддерживает NFC!Ключи не найдены!
- Запрос слишком короткий
- Ошибка поиска ключей на сервере
- Поиск ключа вернул слишком много вариантов; Пожалуйста, уточните запрос
- Файл/Буфер пустВыявлена ошибка. Пожалуйста, сообщите о ней разработчику.часть загруженного файла содержит данные OpenPGP, но это не ключчасти загруженного файла содержат данные OpenPGP, но это не ключчасти загруженного файла содержат данные OpenPGP, но это не ключ
- Перед сохранением внесите измененияНеверная подпись!Неизвестный ключ
@@ -281,20 +218,12 @@
импорт...экспорт...создание ключа...
- сертификация основного ключа...создание основной связки...
- добавление доп. ключей...
- сохранение ключа...экспорт ключа...экспорт ключей...экспорт ключей...
-
- создание ключа. это может занять до 3 минут...
- создание ключей. это может занять до 3 минут...
- создание ключей. это может занять до 3 минут...
- извлечение подписи ключа...извлечение ключа...подготовка к передаче...
@@ -312,8 +241,6 @@
безопасное удаление \'%s\'...Имя/Email/ID ключа…
- Найти секретные ключи
- Отправить...512768
@@ -344,34 +271,15 @@
QR код/NFCKeybase.ioИмпорт выбранных ключей
- Импорт из буфера обмена
-
- Не найдены QR код с ID %s
- Не найдены QR коды с ID %s
- Не найдены QR коды с ID %s
-
- Пожалуйста, начните с QR кода с id 1Некорректный QR код. Попробуйте снова!
- Сканирование QR завершено!Отпечаток слишком коротнкий (< 16 символов)
- Сканировать QR код с \'Barcode Scanner\'
- Разблокируйте устройство, что бы получить ключ через NFC.
- ПомощьСканировать QR код...
- Получить ключ из буфера
- Получить ключ с сервера Keybase.ioКлюч успешно импортированУспешно добавлено %1$d ключейУспешно добавлено %1$d ключей
-
- и обновлен ключ%2$s.
- и обновлено %1$d ключей%2$s.
- и обновлено %1$d ключей%2$s.
-
- Смотреть журналНет данных для импорта.Ошибка импорта ключей!, с предупреждениями
@@ -381,7 +289,6 @@
OpenKeychain: ЗашифроватьOpenKeychain: Расшифровать
- Нет связанных приложений!\n\nСписок приложений, поддерживающих интеграцию, доступен в разделе \'Помощь\'!Показать подробную информациюСкрыть подробную информациюПоказать расширенные настройки
@@ -397,9 +304,6 @@
Наименование пакетаSHA-256 подписи пакетаАккаунты
- Нет аккаунтов, связанных с этим приложением.
- Приложение запрашивает создание нового аккаунта. Выберите секретный ключ или создайте новый.\nПриложения ограничены в доступе только к выбраным здесь ключам!
- Данное приложение запрашивает доступ к OpenKeychain.\nРазрешить доступ?\n\nВНИМАНИЕ: Если вы не знаете почему возник этот запрос, откажите в доступе!\nПозже вы можете отозвать право доступа в разделе \"Зарегистрированные программы\".Разрешить доступЗапретить доступПожалуйста, выберите ключ!
@@ -409,9 +313,6 @@
Проверка подписи пакета не удалась! Если вы установили программу из другого источника, отзовите для неё доступ к этой программе или обновите право доступа.Отправить как QR код
- Сканируйте несколько QR подряд, нажимая \'Далее\' после каждого кода.
- Отпечаток:
- QR код с id %1$d из %2$dОтправить через NFC
@@ -423,7 +324,6 @@
Но Вы можетеилисоздать свой ключ
- Импортировать ключиИзменить ключЗашифровать этим ключом
@@ -434,27 +334,23 @@
Отправить...Доп. ключиСертификация
+
+
+
КлючиПодписать и зашифроватьРасшифровать и проверить
- Импорт ключейПриложенияОткрыть панель навигацииЗакрыть панель навигации
- ИзменитьМои ключи
- Секретный ключ
- доступен
- не доступен
- Напишите сообщение здесь, что бы зашифровать и/или подписать...Введите сюда шифр для расшифровки и/или проверки...по умолчаниюнетотозван
- okсбой!ошибка!ключ не доступен
@@ -483,9 +379,9 @@
Подготовка основного ключа
+
Ошибка кодирования!
- Нет ID ключа. Это программная ошибка. Пожалуйста, сообщите об этом!Внутренняя ошибка, сбой проверки целостности!Аннулированные идентификаторы не могут быть основными!Внутренняя ошибка PGP!
@@ -498,6 +394,7 @@
Аннулирование id %sОшибка разблокирования связки!Разблокирование связки
+
Кем подписанДетали сертификации
@@ -510,13 +407,11 @@
ТипКлюч не найден!Ошибка обработки ключа!
- вторичный ключ не доступен
- Секретные ключи можно удалять только по одному!Просмотреть детали сертификациинеизв.не для подписания
- Ошибка кодировкиНет доп. ключа для шифрования!Не создавать аккаунт OpenKeychain вручную.\nДля подробной информации, смотрите раздел Помощь.Показать ключ (%s)
+
diff --git a/OpenKeychain/src/main/res/values-sk/strings.xml b/OpenKeychain/src/main/res/values-sk/strings.xml
index 593fc2d11..4cf33460a 100644
--- a/OpenKeychain/src/main/res/values-sk/strings.xml
+++ b/OpenKeychain/src/main/res/values-sk/strings.xml
@@ -25,6 +25,9 @@
+
+
+
@@ -32,6 +35,9 @@
+
+
+
diff --git a/OpenKeychain/src/main/res/values-sl/strings.xml b/OpenKeychain/src/main/res/values-sl/strings.xml
index b9a0c4cb9..a6426b3e8 100644
--- a/OpenKeychain/src/main/res/values-sl/strings.xml
+++ b/OpenKeychain/src/main/res/values-sl/strings.xml
@@ -1,18 +1,14 @@
- Izberi javni ključ
- Izberi zasebni ključŠifrirajDešifrirajGeslo
- Ustvari klučUredi ključNastavitve
+ AplikacijeNastavitve strežnikovSpremeni geslo
- Določi geslo
- Deli z...Deli prstni odtis z...Deli ključ z...Deli datoteko z...
@@ -26,66 +22,40 @@
Overi identitetoPodrobnosti o ključuPomoč
+ DnevnikIdentitetePodključiSplošnoPrivzetoNapredno
- Glavni ključ
- Glavna identitetaRavnanjaCel ključVaš ključ, uporabljan za overitevNaloži ključStrežnik
- Šifriraj in/ali podpiši
- Dešifriraj in preveriPrstnim odtisomKljuči za overjanje
- OveriDešifriraj, preveri in shraniDešifriraj in preveri sporočilo
- Iz odložiščaŠifriraj in shrani datotekoShraniPrekličiIzbrišiBrezOK
- Spremeni novo geslo
- Nastavi novo gesloNaloži na strežnikNaprejNazaj
- Odložišče
- Deli z...Išči ključ
- Prikaži napredne nstavitve
- Skrij napredne nastavitve
- Deli šifrirano/podpisano sporočilo...Poglej ključ za overjanjeNastavitvePomočIzvozi v datotekoIzbriši ključ
- Ustvari ključ
- Ustvari ključ (napredno)Išči
- Strežnik...
- Posodobi s strežnika
- Naloži na strežnik
- Deli...
- Deli prstni odtis...
- Deli celotni ključ...
- z...
- z...
- s kodo QR
- s kodo QR
- preko NFC
- Kopiraj na odložiščeNastavitve BeamPrekličiŠifriraj v...
@@ -94,22 +64,15 @@
Izvozi vse ključePrikaži dodatne informacije
- PodpišiSporočiloDatotekaBrez geslaGeslo
- PonovnoAlgoritemASCII Armor
- Prejemniki
- Po šifriranju izbrišiPo dešifriranju izbriši
- Deli po šifriranjuŠifrirni algoritemZgostitveni algoritem
- z javnim ključem
- z geslomHranjenje gesla v spominuStiskanje sporočilStiskanje datotek
@@ -126,14 +89,7 @@
E-poštaPo overitvi naloži ključ na izbrani strežnikPrstni odtis
- IzberiDoloči datum poteka veljavnosti
-
- %d izbran
- %d izbrana
- %d izbrani
- %d izbranih
- <brez imena><nič><brez ključa>
@@ -184,7 +140,6 @@
Preveri avtentičnostNapačno geslo.
- Najprej določite geslo.Nimate nameščenega združljivega upravljalnika datotek.Gesli se ne ujemata.Vnesite geslo.
@@ -203,15 +158,11 @@
Določite datoteko, kamor želite izvoziti vsebino.\nPOZOR: če datoteka že obstaja, bo prepisana.Ali res želite izbrisati vse izbrane javne ključe?\nTega koraka ne boste mogli preklicati!Ali res želite izbrisati ZASEBNI ključ \'%s\'?\nTega koraka ne boste mogli preklicati!
- Vnesli ste spremembe v zbirko ključev. Jih želite shraniti?
- Dodali ste prazno identiteto, ali res želite nadaljevati?Ali res želite izbrisati javni ključ \'%s\'?\nTega koraka ne boste mogli preklicati!
- Želite izvoziti tudi zasebne ključe?Uspešno izvožen 1 ključ.Uspešno izvoženih ključev: %dNoben ključ ni bil izvožen.Pozor: ELGamal podpirajo samo podključi.
- Pozor: ključi RSA dolžine 1024 bitov ali manj ne veljajo več za varne, zato je njihovo ustvarjanje onemogočeno.Ne najdem ključa %08X.Neupoštevan %d slab zasebni ključ. Morda je bil izvožen na način\n --export-secret-subkeys\nPoskrbite, da bo izvožen z\n --export-secret-keys
@@ -225,7 +176,6 @@
Ključ uspešno poslan preko NFC Beam!Ključ je bil prekopiran v odložišče!Prstni odtis je bil prekopiran v odložišče!
- Ključ je že bil overjen!Izberite ključ, ki ga boste uporabljali za overjanje!Ključ je prevelik za delitev na ta način!
- Neposredni binarni podatki brez dejanske datoteke v datotečnem sistemu niso podprti.Za uporabo storitve NFC Beam potrebujete najmanj Android 4.1!NFC ni na voljo na vaši napravi!
- Iskalni pojem je prekratek
- Nepremostljiva napaka pri iskanju ključev na strežniku
- Iskanje ključev je vrnilo preveč zadetkov; prosimo redefinirajte iskalni pojem
+ Najden ni bil noben ključ!Pripetila se je splošna napaka, prosimo ustvarite poročilo o \'hrošču\'.Del naložene datoteke je veljavnen objekt OpenPGP a ni ključ.
@@ -264,7 +206,6 @@
Deli naložene datoteke so veljavni objekti OpenPGP a niso ključi.Deli naložene datoteke so veljavni objekti OpenPGP a niso ključi.
- V zbirko ključev morate najprej vnesti spremembe, šele nato jo lahko shraniteNeveljaven podpis!Neznan javni ključ
@@ -281,22 +222,13 @@
uvažam...izvažam...ustvarjam ključ...
- overjam glavni ključ...ustvarjam glavni prstan...
- dodajam podključe...
- shranjujem ključ...izvažam ključ...izvažam ključa...izvažam ključe...izvažam ključe...
-
- ustvarjam ključ, to lahko traja okoli 3 minute...
- ustvarjam ključa, to lahko traja okoli 3 minute...
- ustvarjam ključe, to lahko traja okoli 3 minute...
- ustvarjam ključe, to lahko traja okoli 3 minute...
- izvlačim ključ za podpisovanje...izvlačim ključ...pripravljam tokove...
@@ -313,8 +245,8 @@
preverjam neokrnjenost...varno brišem \'%s\'…
- Iskanje zasebnih ključev
- Deli ključ z...
+ Ime/e-pošta/ID ključa
+ Ime/Keybase.io uporabniško ime...512768
@@ -341,30 +273,19 @@
Različica:Uvozi izbrane ključe
- Uvozi iz odložišča
-
- Manjka koda QR z ID-jem %s
- Manjkata kodi QR z ID-jema %s
- Manjkajo kode QR z ID-ji %s
- Manjkajo kode QR z ID-ji %s
-
- Začnite s kodo QR z ID-jem 1Koda QR je deformirana! Poskusite znova!
- Skeniranje kode QR zaključeno!Prstni odtis je prekratek (< 16 znakov)
- Skenirajte kodo QR z aplikacijo \'Barcode Scanner\'
- Za prejem ključev preko NFC mora biti naprava odklenjena.
- Pomoč
- Pridobi ključ iz odložišča
- Pridobi ključ iz Keybase.io
+ Nič za uvoziti.
+ Napaka pri uvozu ključev!
+ , z opozorilomDešifriraj datoteko z OpenKeychainUvozi ključ z OpenKeychainŠifriraj z OpenKeychainDešifriraj z OpenKeychain
- Ni nobene prijavljene aplikacije!\n\nSeznam podprtih aplikacij drugih avtorjev lahko najdete v Pomoči!
+ Ni nobene registrirane aplikacije!\n\nSeznam podprtih aplikacij najdete v poglavju \'Pomoč\'!Pokaži dodatne informacijeSkrij dodatne informacijePokaži napredne nastavitve
@@ -380,9 +301,8 @@
Ime paketaSHA-256 podpisa paketaRačuni
- Noben račun ni vezan na to aplikacijo
- Aplikacija zahteva stvaritev novega računa. Izberite obstoječ zasebni ključ ali ustvarite novega.\nAplikacije so omejene na uporabo tu izbranih ključev.
- Navedena aplikacija zahteva dostop do aplikacije OpenKeychain.\nDovolim dostop?\n\nPOZOR: Če ne veste zakaj se je pojavilo to obvestilo, ne dovolite dostopa! Dostop lahko prekličete tudi kasneje, v oknu \'Prijavljene aplikacije\'.
+ S to aplikacijo ni povezan noben račun
+ Prikazane aplikacije želijo šifrirati/dešifrirati sporočila ter jih podpisovati v vašem imenu.\nDovolim dostop?\n\nPOZOR: Če ne veste zakaj se je pojavilo to obvestilo, ne dovolite dostopa! Dostop lahko prekličete tudi kasneje, v oknu \'Aplikacije\'.Dovoli dostopZavrni dostopIzberite ključ!
@@ -392,9 +312,6 @@
Preverjanje podpisa ni uspelo! Ste namestili to aplikacijo iz drugega vira? Če ste prepričani, da to ni napad, prekličite registracijo te aplikacije v OpenKeychain in jo izvedite znova.Deli s kodo QR
- Z uporabo tipke \'Naprej\' se sprehodite skozi vse kode QR in jih skenirajte eno za drugo.
- Prstni odtis:
- Koda QR z ID-jem %1$d of %2$dDeli preko NFC
@@ -407,7 +324,6 @@
Lahko začnete zalistvaritvijo lastnega ključa
- uvozom obstoječih ključev.Uredi ključŠifriraj s tem ključem
@@ -418,20 +334,18 @@
DeliPodključiCertifikati
+
+
+
KljučiPodpiši in šifrirajDešifriraj in preveri
- Uvozi ključe
+ AplikacijeOdprite navigacijski poteznikZaprite navigacijski poteznik
- UrediMoji ključi
- Zasebni ključ
- na voljo
- ni na voljo
- Tu zapišite sporočilo, ki ga želite šifrirati in/ali podpisati...Tu vnesite tajnopis za dešifriranje in/ali overbo...privzeto
@@ -439,7 +353,6 @@
navadnopozitivnopreklicano
- okneuspešno!napaka!ključ ni na voljo
@@ -451,19 +364,52 @@
Operacija ni uspela zaradi napakeOperacija ni uspela zaradi napake pri branju/pisanjuOperacija ni uspela zaradi notranje napake
+ Uvažam javno zbirko ključev %s
+ Šifriram podatke zbirke klučev
+ Pripravljam
+ Obdelujem podključ %s
+ Podključ je potekel %s
+ Podključ poteče %s
+ Oznake podključa: overja, šifrira, podpisuje
+ Oznake podključa: overja, šifrira
+ Oznake podključa: overja, podpisuje
+ Oznake podključa: šifrira, podpisuje
+ Oznake podključa: overja
+ Oznake podključa: šifrira
+ Oznake podključa: podpisuje
+ Oznake podključa: brez
+ Uspešno uvožena javna zbirka klučev Ponovno vnašam zasebni ključNaleteli ste na slab certifikat!Napaka pri obdelavi certifikata!
+ Prerazporejam uporabniške ID-jeProcesiram uporabniško identiteto %s
+ Uporabniški ID je preklicanPoskus uvoza javne zbirke ključev kot zasebne. Prosimo prijavite dogodek kot \'hrošč\' (napako).
+ Uvažam zasebni ključ %sProcesiram zasebne podključePodključ %s ni na voljo v javnem ključu%s označen kot razpoložljiv%s označen kot slečen
+ Zasebna zbirka ključev uspešno uvožena
+ Obdelujem glavni ključ...
+ Umikam slab certifikat za preklic zbirk ključev
+ Umikam certifikat za preklic zbirk ključev z oznako \"lokalno\"
+ Umikam certifikat za preklic zbirk ključev s časovno znamko v prihodnosti
+ Umikam certifikat glavnega ključa neznanega tipa (%s)
+ Umikam slab certifikat za preklic zbirk ključev
+ Umikam odvečen certifikat za preklic zbirk ključev
+ Obdelujem podključ %s
+ Umikam neveljaven certifikat za povezovanje podključev
+ Umikam slab certifikat za povezovanje podključev
+ Umikam certifikat za povezovanje podključev z oznako \"lokalno\"
+ Umikam certifikat za povezovanje podključev z časovno znamko v prihodnosti
+
+
OveroviteljPodrobnosti potrdil
@@ -476,14 +422,12 @@
VrstaKljuč ni bil najden!Napaka pri obdelavi ključa!
- podključ ni na voljoslečen
- Zasebne ključe je mogoče izbrisati zgolj posamično!Preglej podrobosti certifikataneznanne more podpisati
- Napaka pri šifriranjuNi nobenega podključa za šifriranje!Ne ustvari računov OpenKeychain ročno.\nZa več informacij poglej poglavje Pomoč.Prikaži ključ (%s)
+
diff --git a/OpenKeychain/src/main/res/values-tr/strings.xml b/OpenKeychain/src/main/res/values-tr/strings.xml
index bae2b55ad..f8c26f140 100644
--- a/OpenKeychain/src/main/res/values-tr/strings.xml
+++ b/OpenKeychain/src/main/res/values-tr/strings.xml
@@ -1,10 +1,7 @@
- Açık Anahtar Seç
- Özel Anahtar SeçŞifrele
- Anahtar oluşturAnahtarı düzenleSeçeneklerAnahtar Sunucusu Seçenekleri
@@ -21,36 +18,25 @@
Anahtar YükleAnahtar Sunucusu
- PanodanKaydetİptalSilTamamİleriGeri
- PanoAyarlarYardımDosyaya verAnahtar sil
- Anahtar oluştur
- Anahtar oluştur (uzman)Ara
- Paylaş...
- QR Kod ile
- NFC ile
- Panoya kopyalaİptalHepsini seçAnahtar ekle
- İmzalaMesajDosya
- TekrarAlgoritma
- AlıcılarAnahtar SunucularıAnahtar IDOluşturma
@@ -60,7 +46,6 @@
İsimYorumEposta
- Seç1 anahtar%d anahtar
@@ -110,7 +95,6 @@
alıyor...veriyor...anahtar oluşturuluyor...
- anahtar kaydediliyor...anahtar veriliyor...anahtarlar veriliyor...
@@ -142,7 +126,6 @@
Sürüm:Seçili anahtarları al
- Yardım
@@ -161,17 +144,15 @@
ya da
+
+
+
Anahtarlar
- DüzenleAnahtarlarım
- Özel Anahtar
- mevcut
- mevcut değilvarsayılan
- tamambaşarısız!hata!anahtar mevcut değil
@@ -179,7 +160,10 @@
+
+
imzalanamadı
+
diff --git a/OpenKeychain/src/main/res/values-uk/strings.xml b/OpenKeychain/src/main/res/values-uk/strings.xml
index 4e267e431..74713ca33 100644
--- a/OpenKeychain/src/main/res/values-uk/strings.xml
+++ b/OpenKeychain/src/main/res/values-uk/strings.xml
@@ -1,18 +1,14 @@
- Виберіть публічний ключ
- Виберіть секретний ключЗашифруватиРозшифруватиПарольна фраза
- Створити ключРедагувати ключНалаштування
+ ПрограмиНалаштування сервера ключівЗмінити парольну фразу
- Задати парольну фразу
- Поділитися через…Поділитися відбитком із…Поділитися ключем з…Поширити файл з…
@@ -33,60 +29,33 @@
ЗагальнеТиповеДодаткове
- Основний ключ
- Первинна сутністьДіїЦілий ключВаш ключ використаний для сертифікаціїЗавантажити ключСервер ключів
- Шифрувати і/або підписати
- Розшифрувати і ПеревіритиВідбитокКлюч для сертикації
- СертифікуватиРозшифрувати, перевірити та зберегти файлРозшифрувати і перевірити повідомлення
- З буфера обмінуШифрувати і зберегти файлЗберегтиСкасуватиВилучитиЖоденГаразд
- Змінити нову парольну фразу
- Задати нову парольну фразуЗавантажити на сервер ключівДаліНазад
- Буфер обміну
- Поділитися через…Шукати ключ
- Показати додаткові налаштування
- Приховати додаткові налаштування
- Поширити зашифроване/підписане повідомлення…Переглянути ключ сертифікаціїПараметриДовідкаЕкспорт до файлуВилучити ключ
- Створити ключ
- Створити ключ (експерт)Пошук
- Сервер ключів…
- Оновити з сервера ключів
- Завантажити на сервер ключів
- Поділитися…
- Поділитися відбитком…
- Поділитися цілим ключем…
- з…
- з…
- з QR кодом
- з QR кодом
- з NFC
- Копіювати у буфер обмінуНалаштування променяСкасуватиЗашифрувати…
@@ -95,22 +64,15 @@
Експортувати усі ключіПоказати додаткову інформацію
- ПідписПовідомленняФайлБез парольної фразиПарольна фраза
- ЗновуАлгоритмASCII Броня
- Отримувачі
- Вилучити після шифруванняВилучити після розшифрування
- Поширити після шифруванняАлгоритм шифруванняХеш алгоритм
- з публічним ключем
- з парольною фразоюКеш парольної фразиСтиснення повідомленняСтиснення файлу
@@ -127,13 +89,7 @@
Ел. поштаЗавантажити ключ до вибраного сервера ключів після сертифікаціїВідбиток
- ВибратиЗадати термін дії
-
- %d вибраний
- %d вибрані
- %d вибраних
- <без імені><жоден><без ключа>
@@ -182,7 +138,6 @@
Перевірити справжністьНевірна парольна фраза.
- Спершу задайте парольну фразу.Нема встановленого сумісного менеджера файлів.Парольні фрази не збігаються.Будь ласка, введіть парольну фразу.
@@ -201,15 +156,11 @@
Будь ласка, виберіть файл для експорту.\nУВАГА! Якщо файл існує, то він буде переписаний.Ви справді хочете вилучити усі вибрані відкриті ключі?\nВи не зможете це відмінити!Ви справді хочете вилучити секретний ключ \'%s\'?\nВи не зможете це відмінити!
- Ви внесли зміни до в\'язки ключів, ви б хотіли. Волієте їх зберегти?
- Ви вже додали порожню сутність. Ви справді хочете продовжити?Ви справді хочете вилучити відкритий ключ \'%s\'?\nВи не зможете це відмінити!
- Також експортувати секретні ключі?Успішно експортовано 1 ключ.Успішно експортовано %d ключів.Жодного ключа не експортовано.Примітка: лише підключі підтримують ElGamal.
- Примітка: генерація ключа RSA з довжиною 1024 біти і менше вважається небезпечною і вона вимкнена для генерації нових ключів.Не можливо знайти ключ %08X.%d поганий секретний ключ проігнорований. Можливо ви експортували з параметром\n --export-secret-subkeys\nЗробіть ваш експорт з \n --export-secret-keys\nнатомість.
@@ -222,7 +173,6 @@
Успішно надіслано ключ через промінь NFC!Ключ вже скопійовано у буфер обміну!Відбиток вже скопійовано до буфера обміну!
- Ключ вже сертифіковано!Будь ласка, виберіть ключ для використання у сертифікації!Ключ надто великий для цього способу поширення!
- Пряма передача даних без використання файлу в пам\'яті пристрою не підтримується.Вам потрібний Android 4.1 для використання функції Androids NFC промінь!NFC недоступний на вашому пристрої!Ключ не знайдено!
- Запит пошуку ключа надто короткий
- Невиправна помилка пошуку ключів в сервері
- Запит пошуку ключа видав надто багато варіантів. Уточніть пошуковий запитТрапилася загальна помилка, будь ласка, створіть новий звіт про помилку для OpenKeychain.частина завантаженого файлу є вірним об\'єктом OpenPGP, але не ключем OpenPGPчастини завантаженого файлу є вірним об\'єктом OpenPGP, але не ключем OpenPGPчастин завантаженого файлу є вірним об\'єктом OpenPGP, але не ключем OpenPGP
- Вам потрібно внести зміни до в\'язки ключів перед тим, як зможете їх зберегти.Невірний підпис!Невідомий відкритий ключ
@@ -278,20 +218,12 @@
імпортується…експортується…будується ключ…
- сертифікація основного ключа…побудова основного кільця…
- додавання підключів…
- зберігається ключ…експортується ключ…експортуються ключі…експортуються ключі…
-
- генерується ключ, це може тривати до 3 хвилини
- генеруються ключі, це може тривати до 3 хвилини
- генеруються ключі, це може тривати до 3 хвилини
- видобування ключа підпису…видобувається ключа…підготовка потоків…
@@ -308,8 +240,7 @@
перевірка цілісності…вилучення безпечно \'%s\'…
- Пошук секретних ключів
- Поділитися ключем з…
+ Назва/Ел. пошта/ІД ключа…512768
@@ -335,33 +266,34 @@
ПроВерсія:
+ Сервер ключів
+ Файл/Буфер обміну
+ Код QR/NFC
+ Keybase.ioІмпортувати вибрані ключі
- Імпорт з буфера обміну
-
- Пропущений QR код із ID %s
- Пропущені QR коди із ID %s
- Пропущені QR коди із ID %s
-
- Будь ласка, почніть з QR коду із ІД 1Невірний штрих-код! Спробуйте знову!
- Сканування штрих-коду завершено!Відбиток надто короткий (< 16 символів)
- Сканувати QR код з \'Barcode Scanner\'
- Розблокуйте пристрій, щоб отримати ключ через NFC.
- Довідка
- Отримати ключ з буфера обміну
- Отримати ключ із Keybase.io
+ Сканувати штрих-код…
- Переглянути журнал
+
+ Успішно імпортовано ключ.
+ Успішно імпортовано %1$d ключі.
+ Успішно імпортовано %1$d ключів.
+
+
+ Успішно імпортований ключ%2$s.
+ Успішно імпортовано %1$d ключі%2$s.
+ Успішно імпортовано %1$d ключів%2$s.
+ Нема що імпортувати.Помилка імпорту ключів!
+ , із застереженнямиРозшифрувати файл з OpenKeychainІмпортувати ключ з OpenKeychainЗашифрувати з OpenKeychainРозшифрувати з OpenKeychain
- Немає зареєстрованих програм!\n\nСписок підтримуваних сторонніх програм можна знайти у „Довідці“!Показати додаткову інформаціюПриховати додаткову інформаціюПоказати додаткові налаштування
@@ -377,9 +309,6 @@
Назва пакункуSHA-256 підписку пакункуОблікові записи
- Немає облікового запису приєднаного до цієї програми.
- Ця програма вимагає створення нового профілю. Будь ласка, виберіть наявний приватний ключ або створіть інший.\nПрограми обмежені використання ключів, які ви тут оберете!
- Показана програма запитує доступ до OpenPGP Keychain.\nДозволити доступ?\n\nУВАГА: якщо ви не знаєте, чому цей екран появився, не дозволяйте доступ! Ви можете відкликати доступ пізніше, використовуючи екран \'Зареєстровані програми\'.Дозволити доступНе дозволити доступБудь ласка, виберіть ключ!
@@ -389,9 +318,6 @@
Перевірка підпису пакету не вдалася! Може ви встановили програму з іншого джерела? Якщо ви впевнені, що це не атака, то відкличте реєстрацію програми у OpenKeychain та знову зареєструйте її.Відправити як штрих-код
- Пройдіть через усі штрих-коди за допомогою \"Далі\", а також проскануйте їх по одному.
- Відбиток:
- Штрих-код з ID %1$d із %2$dПоділитися з NFC
@@ -403,7 +329,6 @@
Ви можете розпочати зачистворюється ваш власний ключ
- імпортуюся ключі.Редагувати ключШифрувати з цим ключем
@@ -414,20 +339,18 @@
ПоділитисяПідключіСертифікати
+
+
+
КлючіПідписати і зашифруватиРозшифрувати і Перевірити
- Імпортувати ключі
+ ПрограмиВідкрити панель навігаціїЗакрити панель навігації
- РедагуватиМої ключі
- Секретний ключ
- доступний
- недоступний
- Напишіть повідомлення для шифрування та/або підпису…Уведіть зашифрований текст тут для його розшифрування та/або перевірки…типово
@@ -435,7 +358,6 @@
випадковийдодатнийвідкликано
- ГараздНевдача!Помилка!Недоступний ключ
@@ -446,19 +368,37 @@
Операція не вдалася через помилку кодуванняОперація не вдалася через помилку вводу/виводуОперація не вдалася через внутрішню помилку
+ Шифруються дані із в\'язки
+ Аналізуються ключіПідготовка операцій з базою даних
+ Обробляється основний ключа %sОпрацьовується підключ %s
+ Успішно імпортована публічна в\'язкаПовторне вставлення секретного ключаВиявлено поганий сертифікат!Помилка опрацювання сертифікату!Обробляється ІД користувача %s
+ Імпортується секретний ключ %s
+ Помилка бази даних!Опрацьовуються секретні підключі
+ Помилка шифрування в’язкиПідключ %s недоступний у публічному ключіПозначено %s як доступно
+ Успішно імпортована секретна в\'язка
+ Обробляється основний ключ…
+ Опрацьовується підключ %s
+ Додається новий підключ %s
+
+ Внутрішня помилка - збій перевірки цілісності!
+ ІД відхилених користувачів не може бути первинним!
+ Внутрішній виняток PGP!
+ Змінюється парольна фраза
+ Розблоковується в\'язка
+
Ким підписанийДані сертифікату
@@ -471,14 +411,12 @@
ТипКлюч не знайдено!Помилка опрацювання ключа!
- підключ недоступнийголий
- Секретні ключі можна вилучити лише окремо!Переглянути дані сертифікатуневідомийне можна підписати
- Помилка шифруванняЖодний підключ шифрування недоступний!Вручну не створюються профілі OpenKeychain.\nЗа подробицями дивіться Довідку.Показати ключ (%s)
+
diff --git a/OpenKeychain/src/main/res/values-zh/strings.xml b/OpenKeychain/src/main/res/values-zh/strings.xml
index f661ca058..7f0ec99fd 100644
--- a/OpenKeychain/src/main/res/values-zh/strings.xml
+++ b/OpenKeychain/src/main/res/values-zh/strings.xml
@@ -1,16 +1,12 @@
- 选择公钥
- 选择私钥加密解密密码短语
- 创建密钥编辑密钥参数密钥服务器偏好
- 设置密码短语加密至文件解密至文件导入密钥
@@ -23,33 +19,24 @@
常规缺省高级
- 主密钥密钥服务器
- 解密并验证保存取消删除无
- 剪贴板帮助删除密钥
- 创建密钥
- 创建密钥(专家)搜索
- 复制到剪贴板取消加密到...
- 签署讯息文件没有密语密语算法
- 收件人
- 加密后删除解密后删除加密算法哈希算法
@@ -79,7 +66,6 @@
错误
- 先设置密钥安装了不匹配的文件管理器密钥不匹配对称加密
@@ -99,7 +85,6 @@
外置存储没有准备好密钥的大小必须至少512位位置的算法选择
- 需要至少一个主密钥没有提供密语没有提供密钥不是有效的加密数据
@@ -130,9 +115,6 @@
关于版本:
- 从剪贴板导入
- 二维码扫描完成!
- 帮助
@@ -147,19 +129,23 @@
请选择一个密钥请重审收件人列表
- 指纹:使用NFC分享或者
+
+
+
- 导入密钥
+
+
+
--
cgit v1.2.3
From 7eafd77e15d7d9bcbef20df593500ae679545abc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 16:37:42 +0200
Subject: Fix nullpointer, remove unused window feature
---
.../main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
index 568772709..e179115dc 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -103,7 +103,6 @@ public class ViewKeyActivity extends ActionBarActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
- supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
mExportHelper = new ExportHelper(this);
--
cgit v1.2.3
From ce8d38d9b3eb809c9859bbdee219b76346972ba6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 16:46:23 +0200
Subject: Add license headers
---
.../keychain/keyimport/ParcelableKeyRing.java | 17 +++++++++++++++++
.../keychain/pgp/CanonicalizedKeyRing.java | 17 +++++++++++++++++
.../keychain/pgp/CanonicalizedPublicKey.java | 17 +++++++++++++++++
.../keychain/pgp/CanonicalizedPublicKeyRing.java | 17 +++++++++++++++++
.../keychain/pgp/CanonicalizedSecretKey.java | 17 +++++++++++++++++
.../keychain/pgp/CanonicalizedSecretKeyRing.java | 17 +++++++++++++++++
.../org/sufficientlysecure/keychain/pgp/KeyRing.java | 17 +++++++++++++++++
.../keychain/pgp/NullProgressable.java | 17 +++++++++++++++++
.../keychain/pgp/UncachedKeyRing.java | 17 +++++++++++++++++
.../keychain/pgp/UncachedPublicKey.java | 17 +++++++++++++++++
.../keychain/pgp/UncachedSecretKey.java | 17 +++++++++++++++++
.../keychain/pgp/WrappedSignature.java | 17 +++++++++++++++++
.../keychain/provider/CachedPublicKeyRing.java | 17 +++++++++++++++++
.../keychain/provider/TemporaryStorageProvider.java | 17 +++++++++++++++++
.../keychain/service/OperationResultParcel.java | 17 +++++++++++++++++
.../keychain/service/OperationResults.java | 17 +++++++++++++++++
.../keychain/service/SaveKeyringParcel.java | 17 +++++++++++++++++
.../keychain/ui/widget/EncryptKeyCompletionView.java | 17 +++++++++++++++++
.../keychain/ui/widget/NoSwipeWrapContentViewPager.java | 17 +++++++++++++++++
19 files changed, 323 insertions(+)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/ParcelableKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/ParcelableKeyRing.java
index 066c51a13..8609a7082 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/ParcelableKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/ParcelableKeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.keyimport;
import android.os.Parcel;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedKeyRing.java
index ee0dfefa4..1da66872d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedKeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.openpgp.PGPKeyRing;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKey.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKey.java
index 981caad49..ce6498df1 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKey.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKey.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.openpgp.PGPPublicKey;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java
index 70288dceb..972e45c2e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.ArmoredOutputStream;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKey.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKey.java
index 2eb517697..af058b618 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKey.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKey.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.openpgp.PGPException;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java
index e48fe5020..812bf2fed 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.S2K;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/KeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/KeyRing.java
index 7d11a20d3..35020b815 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/KeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/KeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import android.text.TextUtils;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/NullProgressable.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/NullProgressable.java
index 68312dca3..5ef4f7998 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/NullProgressable.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/NullProgressable.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
/**
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java
index 690317170..af82495aa 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.ArmoredOutputStream;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
index 4a03d942b..341ca6d04 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedPublicKey.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.sig.KeyFlags;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedSecretKey.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedSecretKey.java
index 0e14a7fd3..8dc28c2b3 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedSecretKey.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedSecretKey.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.sig.KeyFlags;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java
index 07fb4fb9e..ebd110dc5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.SignatureSubpacket;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
index aa0207a6a..89acbd488 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.provider;
import android.database.Cursor;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
index d1864f873..b8934b6c1 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.provider;
import android.content.ContentProvider;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
index c27b3f6da..d7d98fd68 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.service;
import android.app.Activity;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java
index 11829e7b8..543b83edb 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResults.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.service;
import android.app.Activity;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
index 5e90b396e..3b55e6231 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.service;
import android.os.Parcel;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index b95dee12c..c730e5662 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.ui.widget;
import android.app.Activity;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
index 516e5ec39..a48d2a026 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/NoSwipeWrapContentViewPager.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package org.sufficientlysecure.keychain.ui.widget;
import android.content.Context;
--
cgit v1.2.3
From de6950377cf8954ec5be1f07fb360e07fd0547b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Mon, 4 Aug 2014 17:10:56 +0200
Subject: Lint fixes
---
extern/openpgp-api-lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/extern/openpgp-api-lib b/extern/openpgp-api-lib
index e515a4902..fab79b605 160000
--- a/extern/openpgp-api-lib
+++ b/extern/openpgp-api-lib
@@ -1 +1 @@
-Subproject commit e515a49027fc5de36b8977cf8b096afc9838a9be
+Subproject commit fab79b605f0317891fe4260dcec0dea1a76fa04f
--
cgit v1.2.3
From 2712c18a7a921118e6fe18563b4b38a003cd013a Mon Sep 17 00:00:00 2001
From: mar-v-in
Date: Mon, 4 Aug 2014 20:34:00 +0200
Subject: Use size of input uris for progress bar in encrypt/decrypt
---
.../java/org/sufficientlysecure/keychain/helper/FileHelper.java | 6 +++++-
.../sufficientlysecure/keychain/service/KeychainIntentService.java | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
index ca0749a4e..1b36ba3fc 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
@@ -193,7 +193,11 @@ public class FileHelper {
}
public static long getFileSize(Context context, Uri uri) {
- long size = -1;
+ return getFileSize(context, uri, -1);
+ }
+
+ public static long getFileSize(Context context, Uri uri, long def) {
+ long size = def;
try {
Cursor cursor = context.getContentResolver().query(uri, new String[]{OpenableColumns.SIZE}, null, null, null);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index 601f45fed..19f7bc9bb 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -719,13 +719,13 @@ public class KeychainIntentService extends IntentService
Uri providerUri = data.getParcelable(ENCRYPT_INPUT_URI);
// InputStream
- return new InputData(getContentResolver().openInputStream(providerUri), 0);
+ return new InputData(getContentResolver().openInputStream(providerUri), FileHelper.getFileSize(this, providerUri, 0));
case IO_URIS:
providerUri = data.getParcelableArrayList(ENCRYPT_INPUT_URIS).get(data.getInt(SELECTED_URI));
// InputStream
- return new InputData(getContentResolver().openInputStream(providerUri), 0);
+ return new InputData(getContentResolver().openInputStream(providerUri), FileHelper.getFileSize(this, providerUri, 0));
default:
throw new PgpGeneralException("No target choosen!");
--
cgit v1.2.3
From 80408460a0aa16c38dc5b3269061bac85306d24a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 00:23:04 +0200
Subject: KeychainContract: use longs instead of String, other fixes
---
.../keychain/helper/ContactHelper.java | 2 +-
.../keychain/provider/CachedPublicKeyRing.java | 2 +-
.../keychain/provider/KeychainContract.java | 26 ++++++++++---------
.../keychain/provider/ProviderHelper.java | 14 +++++------
.../keychain/ui/EditKeyFragment.java | 29 ++++++++++++++--------
.../keychain/ui/ViewKeyCertsFragment.java | 2 +-
.../keychain/ui/adapter/SubkeysAdapter.java | 10 ++++++++
.../ui/dialog/DeleteKeyDialogFragment.java | 2 +-
.../ui/widget/EncryptKeyCompletionView.java | 2 +-
OpenKeychain/src/main/res/values/strings.xml | 2 +-
10 files changed, 56 insertions(+), 35 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
index 8fed40a86..1d8661bfe 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
@@ -385,7 +385,7 @@ public class ContactHelper {
int rawContactId, long masterKeyId) {
ops.add(selectByRawContactAndItemType(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI),
rawContactId, ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE).build());
- Cursor ids = resolver.query(KeychainContract.UserIds.buildUserIdsUri(Long.toString(masterKeyId)),
+ Cursor ids = resolver.query(KeychainContract.UserIds.buildUserIdsUri(masterKeyId),
USER_IDS_PROJECTION, NON_REVOKED_SELECTION, null, null);
if (ids != null) {
while (ids.moveToNext()) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
index 89acbd488..e076fd9cc 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/CachedPublicKeyRing.java
@@ -218,7 +218,7 @@ public class CachedPublicKeyRing extends KeyRing {
}
private Cursor getSubkeys() throws PgpGeneralException {
- Uri keysUri = KeychainContract.Keys.buildKeysUri(Long.toString(extractOrGetMasterKeyId()));
+ Uri keysUri = KeychainContract.Keys.buildKeysUri(extractOrGetMasterKeyId());
return mProviderHelper.getContentResolver().query(keysUri, null, null, null, null);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java
index 483f762f7..56168847f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainContract.java
@@ -172,8 +172,8 @@ public class KeychainContract {
return CONTENT_URI.buildUpon().appendPath(PATH_PUBLIC).build();
}
- public static Uri buildPublicKeyRingUri(String masterKeyId) {
- return CONTENT_URI.buildUpon().appendPath(masterKeyId).appendPath(PATH_PUBLIC).build();
+ public static Uri buildPublicKeyRingUri(long masterKeyId) {
+ return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId)).appendPath(PATH_PUBLIC).build();
}
public static Uri buildPublicKeyRingUri(Uri uri) {
@@ -184,8 +184,8 @@ public class KeychainContract {
return CONTENT_URI.buildUpon().appendPath(PATH_SECRET).build();
}
- public static Uri buildSecretKeyRingUri(String masterKeyId) {
- return CONTENT_URI.buildUpon().appendPath(masterKeyId).appendPath(PATH_SECRET).build();
+ public static Uri buildSecretKeyRingUri(long masterKeyId) {
+ return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId)).appendPath(PATH_SECRET).build();
}
public static Uri buildSecretKeyRingUri(Uri uri) {
@@ -210,8 +210,8 @@ public class KeychainContract {
public static final String CONTENT_ITEM_TYPE
= "vnd.android.cursor.item/vnd.org.sufficientlysecure.keychain.provider.keychain.keys";
- public static Uri buildKeysUri(String masterKeyId) {
- return CONTENT_URI.buildUpon().appendPath(masterKeyId).appendPath(PATH_KEYS).build();
+ public static Uri buildKeysUri(long masterKeyId) {
+ return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId)).appendPath(PATH_KEYS).build();
}
public static Uri buildKeysUri(Uri uri) {
@@ -237,8 +237,8 @@ public class KeychainContract {
public static final String CONTENT_ITEM_TYPE
= "vnd.android.cursor.item/vnd.org.sufficientlysecure.keychain.provider.user_ids";
- public static Uri buildUserIdsUri(String masterKeyId) {
- return CONTENT_URI.buildUpon().appendPath(masterKeyId).appendPath(PATH_USER_IDS).build();
+ public static Uri buildUserIdsUri(long masterKeyId) {
+ return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId)).appendPath(PATH_USER_IDS).build();
}
public static Uri buildUserIdsUri(Uri uri) {
@@ -304,12 +304,14 @@ public class KeychainContract {
public static final Uri CONTENT_URI = BASE_CONTENT_URI_INTERNAL.buildUpon()
.appendPath(BASE_KEY_RINGS).build();
- public static Uri buildCertsUri(String masterKeyId) {
- return CONTENT_URI.buildUpon().appendPath(masterKeyId).appendPath(PATH_CERTS).build();
+ public static Uri buildCertsUri(long masterKeyId) {
+ return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId)).appendPath(PATH_CERTS).build();
}
- public static Uri buildCertsSpecificUri(String masterKeyId, String rank, String certifier) {
- return CONTENT_URI.buildUpon().appendPath(masterKeyId).appendPath(PATH_CERTS).appendPath(rank).appendPath(certifier).build();
+ public static Uri buildCertsSpecificUri(long masterKeyId, long rank, long certifier) {
+ return CONTENT_URI.buildUpon().appendPath(Long.toString(masterKeyId))
+ .appendPath(PATH_CERTS).appendPath(Long.toString(rank))
+ .appendPath(Long.toString(certifier)).build();
}
public static Uri buildCertsUri(Uri uri) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
index aa85577e0..e79771ed6 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
@@ -299,7 +299,7 @@ public class ProviderHelper {
return SaveKeyringResult.RESULT_ERROR;
}
- Uri uri = KeyRingData.buildPublicKeyRingUri(Long.toString(masterKeyId));
+ Uri uri = KeyRingData.buildPublicKeyRingUri(masterKeyId);
operations.add(ContentProviderOperation.newInsert(uri).withValues(values).build());
}
@@ -307,7 +307,7 @@ public class ProviderHelper {
progress.setProgress(LogType.MSG_IP_INSERT_SUBKEYS.getMsgId(), 40, 100);
mIndent += 1;
{ // insert subkeys
- Uri uri = Keys.buildKeysUri(Long.toString(masterKeyId));
+ Uri uri = Keys.buildKeysUri(masterKeyId);
int rank = 0;
for (CanonicalizedPublicKey key : keyRing.publicKeyIterator()) {
long keyId = key.getKeyId();
@@ -498,7 +498,7 @@ public class ProviderHelper {
try {
// delete old version of this keyRing, which also deletes all keys and userIds on cascade
int deleted = mContentResolver.delete(
- KeyRingData.buildPublicKeyRingUri(Long.toString(masterKeyId)), null, null);
+ KeyRingData.buildPublicKeyRingUri(masterKeyId), null, null);
if (deleted > 0) {
log(LogLevel.DEBUG, LogType.MSG_IP_DELETE_OLD_OK);
result |= SaveKeyringResult.UPDATED;
@@ -567,7 +567,7 @@ public class ProviderHelper {
values.put(KeyRingData.MASTER_KEY_ID, masterKeyId);
values.put(KeyRingData.KEY_RING_DATA, keyRing.getEncoded());
// insert new version of this keyRing
- Uri uri = KeyRingData.buildSecretKeyRingUri(Long.toString(masterKeyId));
+ Uri uri = KeyRingData.buildSecretKeyRingUri(masterKeyId);
if (mContentResolver.insert(uri, values) == null) {
log(LogLevel.ERROR, LogType.MSG_IS_DB_EXCEPTION);
return SaveKeyringResult.RESULT_ERROR;
@@ -579,7 +579,7 @@ public class ProviderHelper {
}
{
- Uri uri = Keys.buildKeysUri(Long.toString(masterKeyId));
+ Uri uri = Keys.buildKeysUri(masterKeyId);
// first, mark all keys as not available
ContentValues values = new ContentValues();
@@ -836,7 +836,7 @@ public class ProviderHelper {
values.put(Certs.VERIFIED, verified);
values.put(Certs.DATA, cert.getEncoded());
- Uri uri = Certs.buildCertsUri(Long.toString(masterKeyId));
+ Uri uri = Certs.buildCertsUri(masterKeyId);
return ContentProviderOperation.newInsert(uri).withValues(values).build();
}
@@ -853,7 +853,7 @@ public class ProviderHelper {
values.put(UserIds.IS_REVOKED, item.isRevoked);
values.put(UserIds.RANK, rank);
- Uri uri = UserIds.buildUserIdsUri(Long.toString(masterKeyId));
+ Uri uri = UserIds.buildUserIdsUri(masterKeyId);
return ContentProviderOperation.newInsert(uri).withValues(values).build();
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index 2d8bdad27..7460b73b4 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -45,6 +45,7 @@ import org.sufficientlysecure.keychain.helper.ActionBarHelper;
import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
+import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
@@ -215,8 +216,7 @@ public class EditKeyFragment extends LoaderFragment implements
mUserIdsList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
- String userId = mUserIdsAdapter.getUserId(position);
- editUserId(userId);
+ editUserId(position);
}
});
@@ -230,8 +230,7 @@ public class EditKeyFragment extends LoaderFragment implements
mSubkeysList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
- long keyId = mSubkeysAdapter.getKeyId(position);
- editSubkey(keyId);
+ editSubkey(position);
}
});
@@ -320,7 +319,9 @@ public class EditKeyFragment extends LoaderFragment implements
setPassphraseDialog.show(getActivity().getSupportFragmentManager(), "setPassphraseDialog");
}
- private void editUserId(final String userId) {
+ private void editUserId(final int position) {
+ final String userId = mUserIdsAdapter.getUserId(position);
+
Handler returnHandler = new Handler() {
@Override
public void handleMessage(Message message) {
@@ -360,13 +361,15 @@ public class EditKeyFragment extends LoaderFragment implements
});
}
- private void editSubkey(final long keyId) {
+ private void editSubkey(final int position) {
+ final long keyId = mSubkeysAdapter.getKeyId(position);
+
Handler returnHandler = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.what) {
case EditSubkeyDialogFragment.MESSAGE_CHANGE_EXPIRY:
- editSubkeyExpiry(keyId);
+ editSubkeyExpiry(position);
break;
case EditSubkeyDialogFragment.MESSAGE_REVOKE:
// toggle
@@ -394,13 +397,19 @@ public class EditKeyFragment extends LoaderFragment implements
});
}
- private void editSubkeyExpiry(final long keyId) {
+ private void editSubkeyExpiry(final int position) {
+ final long keyId = mSubkeysAdapter.getKeyId(position);
+ final Date creationDate = new Date(mSubkeysAdapter.getCreationDate(position));
+ final Date expiryDate = new Date(mSubkeysAdapter.getExpiryDate(position));
+
Handler returnHandler = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.what) {
case ChangeExpiryDialogFragment.MESSAGE_NEW_EXPIRY_DATE:
- // toggle
+// SaveKeyringParcel.SubkeyChange subkeyChange = new SaveKeyringParcel.SubkeyChange();
+
+// mSaveKeyringParcel.mChangeSubKeys.add()
// if (mSaveKeyringParcel.changePrimaryUserId != null
// && mSaveKeyringParcel.changePrimaryUserId.equals(userId)) {
// mSaveKeyringParcel.changePrimaryUserId = null;
@@ -419,7 +428,7 @@ public class EditKeyFragment extends LoaderFragment implements
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
public void run() {
ChangeExpiryDialogFragment dialogFragment =
- ChangeExpiryDialogFragment.newInstance(messenger, new Date(), new Date());
+ ChangeExpiryDialogFragment.newInstance(messenger, creationDate, expiryDate);
dialogFragment.show(getActivity().getSupportFragmentManager(), "editSubkeyExpiryDialog");
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java
index e98562690..5a55b0dad 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyCertsFragment.java
@@ -150,7 +150,7 @@ public class ViewKeyCertsFragment extends LoaderFragment
Intent viewIntent = new Intent(getActivity(), ViewCertActivity.class);
viewIntent.setData(Certs.buildCertsSpecificUri(
- Long.toString(masterKeyId), Long.toString(rank), Long.toString(certifierId)));
+ masterKeyId, rank, certifierId));
startActivity(viewIntent);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
index 0d8c7240d..25b3c0fc5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
@@ -90,6 +90,16 @@ public class SubkeysAdapter extends CursorAdapter {
return mCursor.getLong(INDEX_KEY_ID);
}
+ public long getCreationDate(int position) {
+ mCursor.moveToPosition(position);
+ return mCursor.getLong(INDEX_CREATION);
+ }
+
+ public long getExpiryDate(int position) {
+ mCursor.moveToPosition(position);
+ return mCursor.getLong(INDEX_EXPIRY);
+ }
+
@Override
public Cursor swapCursor(Cursor newCursor) {
hasAnySecret = false;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java
index 01d2fae6a..4927a4d24 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java
@@ -123,7 +123,7 @@ public class DeleteKeyDialogFragment extends DialogFragment {
boolean success = false;
for (long masterKeyId : masterKeyIds) {
int count = activity.getContentResolver().delete(
- KeyRingData.buildPublicKeyRingUri(Long.toString(masterKeyId)), null, null
+ KeyRingData.buildPublicKeyRingUri(masterKeyId), null, null
);
success = count > 0;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index c730e5662..03b0d658f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -69,7 +69,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
private void initView() {
swapCursor(null);
- setPrefix(getContext().getString(R.string.label_to) + ": ");
+ setPrefix(getContext().getString(R.string.label_to));
allowDuplicates(false);
}
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 122fa20b1..ed5dca813 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -92,7 +92,7 @@
Let others know that you\'re using OpenKeychainWrites \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keysFrom:
- To
+ To:Files: Delete After EncryptionDelete After DecryptionEncryption Algorithm
--
cgit v1.2.3
From 369f6e080c110a0446aad793886e60924afe510e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 15:07:11 +0200
Subject: Refactor expiry dialog
---
.../keychain/service/SaveKeyringParcel.java | 72 +++++++-
.../keychain/ui/EditKeyFragment.java | 33 ++--
.../keychain/ui/adapter/SubkeysAdapter.java | 36 ++--
.../ui/dialog/ChangeExpiryDialogFragment.java | 187 --------------------
.../ui/dialog/EditSubkeyExpiryDialogFragment.java | 189 +++++++++++++++++++++
OpenKeychain/src/main/res/layout/expiry_dialog.xml | 16 ++
OpenKeychain/src/main/res/values/strings.xml | 2 +-
7 files changed, 308 insertions(+), 227 deletions(-)
delete mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ChangeExpiryDialogFragment.java
create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
create mode 100644 OpenKeychain/src/main/res/layout/expiry_dialog.xml
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
index 3b55e6231..abc377b7e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
@@ -20,19 +20,23 @@ package org.sufficientlysecure.keychain.service;
import android.os.Parcel;
import android.os.Parcelable;
+import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.util.Log;
+
import java.io.Serializable;
import java.util.ArrayList;
-/** This class is a a transferable representation for a collection of changes
+/**
+ * This class is a a transferable representation for a collection of changes
* to be done on a keyring.
- *
+ *
* This class should include all types of operations supported in the backend.
- *
+ *
* All changes are done in a differential manner. Besides the two key
* identification attributes, all attributes may be null, which indicates no
* change to the keyring. This is also the reason why boxed values are used
* instead of primitives in the subclasses.
- *
+ *
* Application of operations in the backend should be fail-fast, which means an
* error in any included operation (for example revocation of a non-existent
* subkey) will cause the operation as a whole to fail.
@@ -82,12 +86,23 @@ public class SaveKeyringParcel implements Parcelable {
public int mKeysize;
public int mFlags;
public Long mExpiry;
+
public SubkeyAdd(int algorithm, int keysize, int flags, Long expiry) {
mAlgorithm = algorithm;
mKeysize = keysize;
mFlags = flags;
mExpiry = expiry;
}
+
+ @Override
+ public String toString() {
+ String out = "mAlgorithm: " + mAlgorithm + ", ";
+ out += "mKeysize: " + mKeysize + ", ";
+ out += "mFlags: " + mFlags;
+ out += "mExpiry: " + mExpiry;
+
+ return out;
+ }
}
public static class SubkeyChange implements Serializable {
@@ -95,11 +110,46 @@ public class SaveKeyringParcel implements Parcelable {
public Integer mFlags;
// this is a long unix timestamp, in seconds (NOT MILLISECONDS!)
public Long mExpiry;
+
+ public SubkeyChange(long keyId) {
+ mKeyId = keyId;
+ }
+
public SubkeyChange(long keyId, Integer flags, Long expiry) {
mKeyId = keyId;
mFlags = flags;
mExpiry = expiry;
}
+
+ @Override
+ public String toString() {
+ String out = "mKeyId: " + mKeyId + ", ";
+ out += "mFlags: " + mFlags + ", ";
+ out += "mExpiry: " + mExpiry;
+
+ return out;
+ }
+ }
+
+ public SubkeyChange getSubkeyChange(long keyId) {
+ for (SubkeyChange subkeyChange : mChangeSubKeys) {
+ if (subkeyChange.mKeyId == keyId) {
+ return subkeyChange;
+ }
+ }
+ return null;
+ }
+
+ public SubkeyChange getOrCreateSubkeyChange(long keyId) {
+ SubkeyChange foundSubkeyChange = getSubkeyChange(keyId);
+ if (foundSubkeyChange != null) {
+ return foundSubkeyChange;
+ } else {
+ // else, create a new one
+ SubkeyChange newSubkeyChange = new SubkeyChange(keyId);
+ mChangeSubKeys.add(newSubkeyChange);
+ return newSubkeyChange;
+ }
}
public SaveKeyringParcel(Parcel source) {
@@ -121,7 +171,7 @@ public class SaveKeyringParcel implements Parcelable {
@Override
public void writeToParcel(Parcel destination, int flags) {
destination.writeInt(mMasterKeyId == null ? 0 : 1);
- if(mMasterKeyId != null) {
+ if (mMasterKeyId != null) {
destination.writeLong(mMasterKeyId);
}
destination.writeByteArray(mFingerprint);
@@ -153,4 +203,16 @@ public class SaveKeyringParcel implements Parcelable {
return 0;
}
+ @Override
+ public String toString() {
+ String out = "mMasterKeyId: " + mMasterKeyId + "\n";
+ out += "mNewPassphrase: " + mNewPassphrase + "\n";
+ out += "mAddSubKeys: " + mAddSubKeys + "\n";
+ out += "mChangeSubKeys: " + mChangeSubKeys + "\n";
+ out += "mChangePrimaryUserId: " + mChangePrimaryUserId + "\n";
+ out += "mRevokeUserIds: " + mRevokeUserIds + "\n";
+ out += "mRevokeSubKeys: " + mRevokeSubKeys;
+
+ return out;
+ }
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index 7460b73b4..6b062af59 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -45,7 +45,6 @@ import org.sufficientlysecure.keychain.helper.ActionBarHelper;
import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
-import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
@@ -60,15 +59,13 @@ import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAddedAdapter;
import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
-import org.sufficientlysecure.keychain.ui.dialog.ChangeExpiryDialogFragment;
+import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyExpiryDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
-import java.util.Date;
-
public class EditKeyFragment extends LoaderFragment implements
LoaderManager.LoaderCallbacks {
@@ -96,8 +93,8 @@ public class EditKeyFragment extends LoaderFragment implements
private Uri mDataUri;
private SaveKeyringParcel mSaveKeyringParcel;
- private String mPrimaryUserId;
+ private String mPrimaryUserId;
private String mCurrentPassphrase;
/**
@@ -399,23 +396,17 @@ public class EditKeyFragment extends LoaderFragment implements
private void editSubkeyExpiry(final int position) {
final long keyId = mSubkeysAdapter.getKeyId(position);
- final Date creationDate = new Date(mSubkeysAdapter.getCreationDate(position));
- final Date expiryDate = new Date(mSubkeysAdapter.getExpiryDate(position));
+ final long creationDate = mSubkeysAdapter.getCreationDate(position);
+ final long expiryDate = mSubkeysAdapter.getExpiryDate(position);
Handler returnHandler = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.what) {
- case ChangeExpiryDialogFragment.MESSAGE_NEW_EXPIRY_DATE:
-// SaveKeyringParcel.SubkeyChange subkeyChange = new SaveKeyringParcel.SubkeyChange();
-
-// mSaveKeyringParcel.mChangeSubKeys.add()
-// if (mSaveKeyringParcel.changePrimaryUserId != null
-// && mSaveKeyringParcel.changePrimaryUserId.equals(userId)) {
-// mSaveKeyringParcel.changePrimaryUserId = null;
-// } else {
-// mSaveKeyringParcel.changePrimaryUserId = userId;
-// }
+ case EditSubkeyExpiryDialogFragment.MESSAGE_NEW_EXPIRY_DATE:
+ long expiry = message.getData().getLong(EditSubkeyExpiryDialogFragment.MESSAGE_DATA_EXPIRY_DATE);
+ Log.d(Constants.TAG, "new expiry: " + expiry);
+ mSaveKeyringParcel.getOrCreateSubkeyChange(keyId).mExpiry = expiry;
break;
}
getLoaderManager().getLoader(LOADER_ID_SUBKEYS).forceLoad();
@@ -427,8 +418,8 @@ public class EditKeyFragment extends LoaderFragment implements
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
public void run() {
- ChangeExpiryDialogFragment dialogFragment =
- ChangeExpiryDialogFragment.newInstance(messenger, creationDate, expiryDate);
+ EditSubkeyExpiryDialogFragment dialogFragment =
+ EditSubkeyExpiryDialogFragment.newInstance(messenger, creationDate, expiryDate);
dialogFragment.show(getActivity().getSupportFragmentManager(), "editSubkeyExpiryDialog");
}
@@ -501,9 +492,7 @@ public class EditKeyFragment extends LoaderFragment implements
}
private void save(String passphrase) {
- Log.d(Constants.TAG, "mSaveKeyringParcel.mAddUserIds: " + mSaveKeyringParcel.mAddUserIds);
- Log.d(Constants.TAG, "mSaveKeyringParcel.mNewPassphrase: " + mSaveKeyringParcel.mNewPassphrase);
- Log.d(Constants.TAG, "mSaveKeyringParcel.mRevokeUserIds: " + mSaveKeyringParcel.mRevokeUserIds);
+ Log.d(Constants.TAG, "mSaveKeyringParcel:\n" + mSaveKeyringParcel.toString());
// Message is received after importing is done in KeychainIntentService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
index 25b3c0fc5..dd972866c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
@@ -161,6 +161,11 @@ public class SubkeysAdapter extends CursorAdapter {
boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0;
+ Date expiryDate = null;
+ if (!cursor.isNull(INDEX_EXPIRY)) {
+ expiryDate = new Date(cursor.getLong(INDEX_EXPIRY) * 1000);
+ }
+
// for edit key
if (mSaveKeyringParcel != null) {
boolean revokeThisSubkey = (mSaveKeyringParcel.mRevokeSubKeys.contains(keyId));
@@ -171,24 +176,21 @@ public class SubkeysAdapter extends CursorAdapter {
}
}
+ SaveKeyringParcel.SubkeyChange subkeyChange = mSaveKeyringParcel.getSubkeyChange(keyId);
+ if (subkeyChange != null) {
+ // 0 is "no expiry"
+ if (subkeyChange.mExpiry != null && subkeyChange.mExpiry != 0) {
+ expiryDate = new Date(subkeyChange.mExpiry * 1000);
+ }
+ }
+
vEditImage.setVisibility(View.VISIBLE);
} else {
vEditImage.setVisibility(View.GONE);
}
- if (isRevoked) {
- vRevokedIcon.setVisibility(View.VISIBLE);
- } else {
- vKeyId.setTextColor(mDefaultTextColor);
- vKeyDetails.setTextColor(mDefaultTextColor);
- vKeyExpiry.setTextColor(mDefaultTextColor);
-
- vRevokedIcon.setVisibility(View.GONE);
- }
-
boolean isExpired;
- if (!cursor.isNull(INDEX_EXPIRY)) {
- Date expiryDate = new Date(cursor.getLong(INDEX_EXPIRY) * 1000);
+ if (expiryDate != null) {
isExpired = expiryDate.before(new Date());
vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": "
@@ -199,6 +201,16 @@ public class SubkeysAdapter extends CursorAdapter {
vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": " + context.getString(R.string.none));
}
+ if (isRevoked) {
+ vRevokedIcon.setVisibility(View.VISIBLE);
+ } else {
+ vKeyId.setTextColor(mDefaultTextColor);
+ vKeyDetails.setTextColor(mDefaultTextColor);
+ vKeyExpiry.setTextColor(mDefaultTextColor);
+
+ vRevokedIcon.setVisibility(View.GONE);
+ }
+
// if key is expired or revoked, strike through text
boolean isInvalid = isRevoked || isExpired;
if (isInvalid) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ChangeExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ChangeExpiryDialogFragment.java
deleted file mode 100644
index d5354a9f6..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ChangeExpiryDialogFragment.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2014 Dominik Schürmann
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package org.sufficientlysecure.keychain.ui.dialog;
-
-import android.app.DatePickerDialog;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.support.v4.app.DialogFragment;
-import android.text.format.DateUtils;
-import android.widget.DatePicker;
-
-import org.sufficientlysecure.keychain.Constants;
-import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.util.Log;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-public class ChangeExpiryDialogFragment extends DialogFragment {
- private static final String ARG_MESSENGER = "messenger";
- private static final String ARG_CREATION_DATE = "creation_date";
- private static final String ARG_EXPIRY_DATE = "expiry_date";
-
- public static final int MESSAGE_NEW_EXPIRY_DATE = 1;
- public static final String MESSAGE_DATA_EXPIRY_DATE = "expiry_date";
-
- private Messenger mMessenger;
- private Calendar mCreationCal;
- private Calendar mExpiryCal;
-
- private int mDatePickerResultCount = 0;
- private DatePickerDialog.OnDateSetListener mExpiryDateSetListener =
- new DatePickerDialog.OnDateSetListener() {
- public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
- // Note: Ignore results after the first one - android sends multiples.
- if (mDatePickerResultCount++ == 0) {
- Calendar selectedCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- selectedCal.set(year, monthOfYear, dayOfMonth);
- if (mExpiryCal != null) {
- long numDays = (selectedCal.getTimeInMillis() / 86400000)
- - (mExpiryCal.getTimeInMillis() / 86400000);
- if (numDays > 0) {
- Bundle data = new Bundle();
- data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime());
- sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
- }
- } else {
- Bundle data = new Bundle();
- data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime());
- sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
- }
- }
- }
- };
-
- public class ExpiryDatePickerDialog extends DatePickerDialog {
-
- public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack,
- int year, int monthOfYear, int dayOfMonth) {
- super(context, callBack, year, monthOfYear, dayOfMonth);
- }
-
- // set permanent title
- public void setTitle(CharSequence title) {
- super.setTitle(getContext().getString(R.string.expiry_date_dialog_title));
- }
- }
-
- /**
- * Creates new instance of this dialog fragment
- */
- public static ChangeExpiryDialogFragment newInstance(Messenger messenger,
- Date creationDate, Date expiryDate) {
- ChangeExpiryDialogFragment frag = new ChangeExpiryDialogFragment();
- Bundle args = new Bundle();
- args.putParcelable(ARG_MESSENGER, messenger);
- args.putSerializable(ARG_CREATION_DATE, creationDate);
- args.putSerializable(ARG_EXPIRY_DATE, expiryDate);
-
- frag.setArguments(args);
-
- return frag;
- }
-
- /**
- * Creates dialog
- */
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- mMessenger = getArguments().getParcelable(ARG_MESSENGER);
- Date creationDate = (Date) getArguments().getSerializable(ARG_CREATION_DATE);
- Date expiryDate = (Date) getArguments().getSerializable(ARG_EXPIRY_DATE);
-
- mCreationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- mCreationCal.setTime(creationDate);
- mExpiryCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- mExpiryCal.setTime(expiryDate);
-
- /*
- * Using custom DatePickerDialog which overrides the setTitle because
- * the DatePickerDialog title is buggy (unix warparound bug).
- * See: https://code.google.com/p/android/issues/detail?id=49066
- */
- DatePickerDialog dialog = new ExpiryDatePickerDialog(getActivity(),
- mExpiryDateSetListener, mExpiryCal.get(Calendar.YEAR), mExpiryCal.get(Calendar.MONTH),
- mExpiryCal.get(Calendar.DAY_OF_MONTH));
- mDatePickerResultCount = 0;
- dialog.setCancelable(true);
- dialog.setButton(Dialog.BUTTON_NEGATIVE,
- getActivity().getString(R.string.btn_no_date),
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- // Note: Ignore results after the first one - android sends multiples.
- if (mDatePickerResultCount++ == 0) {
- // none expiry dates corresponds to a null message
- Bundle data = new Bundle();
- data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, null);
- sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
- }
- }
- }
- );
-
- // setCalendarViewShown() is supported from API 11 onwards.
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- // Hide calendarView in tablets because of the unix warparound bug.
- dialog.getDatePicker().setCalendarViewShown(false);
- }
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- // will crash with IllegalArgumentException if we set a min date
- // that is not before expiry
- if (mCreationCal != null && mCreationCal.before(mExpiryCal)) {
- dialog.getDatePicker().setMinDate(mCreationCal.getTime().getTime()
- + DateUtils.DAY_IN_MILLIS);
- } else {
- // When created date isn't available
- dialog.getDatePicker().setMinDate(mExpiryCal.getTime().getTime()
- + DateUtils.DAY_IN_MILLIS);
- }
- }
-
- return dialog;
- }
-
- /**
- * Send message back to handler which is initialized in a activity
- *
- * @param what Message integer you want to send
- */
- private void sendMessageToHandler(Integer what, Bundle data) {
- Message msg = Message.obtain();
- msg.what = what;
- if (data != null) {
- msg.setData(data);
- }
-
- try {
- mMessenger.send(msg);
- } catch (RemoteException e) {
- Log.w(Constants.TAG, "Exception sending message, Is handler present?", e);
- } catch (NullPointerException e) {
- Log.w(Constants.TAG, "Messenger is null!", e);
- }
- }
-}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
new file mode 100644
index 000000000..1712b922f
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package org.sufficientlysecure.keychain.ui.dialog;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.support.v4.app.DialogFragment;
+import android.text.format.DateUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.DatePicker;
+
+import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.util.Log;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+public class EditSubkeyExpiryDialogFragment extends DialogFragment {
+ private static final String ARG_MESSENGER = "messenger";
+ private static final String ARG_CREATION_DATE = "creation_date";
+ private static final String ARG_EXPIRY_DATE = "expiry_date";
+
+ public static final int MESSAGE_NEW_EXPIRY_DATE = 1;
+ public static final int MESSAGE_CANCEL = 2;
+ public static final String MESSAGE_DATA_EXPIRY_DATE = "expiry_date";
+
+ private Messenger mMessenger;
+ private Calendar mCreationCal;
+ private Calendar mExpiryCal;
+
+ private DatePicker mDatePicker;
+
+ /**
+ * Creates new instance of this dialog fragment
+ */
+ public static EditSubkeyExpiryDialogFragment newInstance(Messenger messenger,
+ long creationDate, long expiryDate) {
+ EditSubkeyExpiryDialogFragment frag = new EditSubkeyExpiryDialogFragment();
+ Bundle args = new Bundle();
+ args.putParcelable(ARG_MESSENGER, messenger);
+ args.putLong(ARG_CREATION_DATE, creationDate);
+ args.putLong(ARG_EXPIRY_DATE, expiryDate);
+
+ frag.setArguments(args);
+
+ return frag;
+ }
+
+ /**
+ * Creates dialog
+ */
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ final Activity activity = getActivity();
+ mMessenger = getArguments().getParcelable(ARG_MESSENGER);
+ Date creationDate = new Date(getArguments().getLong(ARG_CREATION_DATE) * 1000);
+ Date expiryDate = new Date(getArguments().getLong(ARG_EXPIRY_DATE) * 1000);
+
+ mCreationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ mCreationCal.setTime(creationDate);
+ mExpiryCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ mExpiryCal.setTime(expiryDate);
+
+ Log.d(Constants.TAG, "onCreateDialog");
+
+ // Explicitly not using DatePickerDialog here!
+ // DatePickerDialog is difficult to customize and has many problems (see old git versions)
+ CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);
+
+ alert.setTitle(R.string.expiry_date_dialog_title);
+
+ LayoutInflater inflater = activity.getLayoutInflater();
+ View view = inflater.inflate(R.layout.expiry_dialog, null);
+ alert.setView(view);
+
+ mDatePicker = (DatePicker) view.findViewById(R.id.datePicker);
+
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
+ // will crash with IllegalArgumentException if we set a min date
+ // that is not before expiry
+ if (mCreationCal != null && mCreationCal.before(mExpiryCal)) {
+ mDatePicker.setMinDate(mCreationCal.getTime().getTime()
+ + DateUtils.DAY_IN_MILLIS);
+ } else {
+ // When created date isn't available
+ mDatePicker.setMinDate(mExpiryCal.getTime().getTime()
+ + DateUtils.DAY_IN_MILLIS);
+ }
+ }
+
+ alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ dismiss();
+
+ Calendar selectedCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ //noinspection ResourceType
+ selectedCal.set(mDatePicker.getYear(), mDatePicker.getMonth(), mDatePicker.getDayOfMonth());
+
+ if (mExpiryCal != null) {
+ long numDays = (selectedCal.getTimeInMillis() / 86400000)
+ - (mExpiryCal.getTimeInMillis() / 86400000);
+ if (numDays > 0) {
+ Bundle data = new Bundle();
+ data.putLong(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime().getTime() / 1000);
+ sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
+ }
+ } else {
+ Bundle data = new Bundle();
+ data.putLong(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime().getTime() / 1000);
+ sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
+ }
+ }
+ });
+
+ alert.setNeutralButton(R.string.btn_no_date, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ dismiss();
+
+ // "no expiry" corresponds to a 0
+ Bundle data = new Bundle();
+ data.putLong(MESSAGE_DATA_EXPIRY_DATE, 0);
+ sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
+ }
+ });
+
+ alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ dismiss();
+ }
+ });
+
+ return alert.show();
+ }
+
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ super.onCancel(dialog);
+
+ dismiss();
+ sendMessageToHandler(MESSAGE_CANCEL, null);
+ }
+
+ /**
+ * Send message back to handler which is initialized in a activity
+ *
+ * @param what Message integer you want to send
+ */
+ private void sendMessageToHandler(Integer what, Bundle data) {
+ Message msg = Message.obtain();
+ msg.what = what;
+ if (data != null) {
+ msg.setData(data);
+ }
+
+ try {
+ mMessenger.send(msg);
+ } catch (RemoteException e) {
+ Log.w(Constants.TAG, "Exception sending message, Is handler present?", e);
+ } catch (NullPointerException e) {
+ Log.w(Constants.TAG, "Messenger is null!", e);
+ }
+ }
+}
diff --git a/OpenKeychain/src/main/res/layout/expiry_dialog.xml b/OpenKeychain/src/main/res/layout/expiry_dialog.xml
new file mode 100644
index 000000000..14fff0b3f
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/expiry_dialog.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index ed5dca813..18031e25b 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -51,7 +51,7 @@
SaveCancelDelete
- None
+ No ExpiryOkayUpload To KeyserverNext
--
cgit v1.2.3
From 160e6972d8366e4b0b8d72fa838434629588c930 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 17:25:22 +0200
Subject: Create key: make single user id primary user id, other cleanup
---
.../keychain/service/SaveKeyringParcel.java | 1 +
.../keychain/ui/CreateKeyFinalFragment.java | 1 +
.../keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java | 11 +++++------
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
index abc377b7e..442746feb 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
@@ -207,6 +207,7 @@ public class SaveKeyringParcel implements Parcelable {
public String toString() {
String out = "mMasterKeyId: " + mMasterKeyId + "\n";
out += "mNewPassphrase: " + mNewPassphrase + "\n";
+ out += "mAddUserIds: " + mAddUserIds + "\n";
out += "mAddSubKeys: " + mAddSubKeys + "\n";
out += "mChangeSubKeys: " + mChangeSubKeys + "\n";
out += "mChangePrimaryUserId: " + mChangePrimaryUserId + "\n";
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
index 662ba4ce1..abbc3f199 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
@@ -174,6 +174,7 @@ public class CreateKeyFinalFragment extends Fragment {
parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, null));
String userId = KeyRing.createUserId(mName, mEmail, null);
parcel.mAddUserIds.add(userId);
+ parcel.mChangePrimaryUserId = userId;
parcel.mNewPassphrase = mPassphrase;
// get selected key entries
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
index 1712b922f..8482c0b37 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
@@ -48,7 +48,6 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
public static final String MESSAGE_DATA_EXPIRY_DATE = "expiry_date";
private Messenger mMessenger;
- private Calendar mCreationCal;
private Calendar mExpiryCal;
private DatePicker mDatePicker;
@@ -79,8 +78,8 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
Date creationDate = new Date(getArguments().getLong(ARG_CREATION_DATE) * 1000);
Date expiryDate = new Date(getArguments().getLong(ARG_EXPIRY_DATE) * 1000);
- mCreationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- mCreationCal.setTime(creationDate);
+ Calendar creationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ creationCal.setTime(creationDate);
mExpiryCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
mExpiryCal.setTime(expiryDate);
@@ -101,11 +100,11 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
// will crash with IllegalArgumentException if we set a min date
// that is not before expiry
- if (mCreationCal != null && mCreationCal.before(mExpiryCal)) {
- mDatePicker.setMinDate(mCreationCal.getTime().getTime()
+ if (creationCal.before(mExpiryCal)) {
+ mDatePicker.setMinDate(creationCal.getTime().getTime()
+ DateUtils.DAY_IN_MILLIS);
} else {
- // When created date isn't available
+ // when creation date isn't available
mDatePicker.setMinDate(mExpiryCal.getTime().getTime()
+ DateUtils.DAY_IN_MILLIS);
}
--
cgit v1.2.3
From d377d1f23d75ad78982419e9ca9633cd5b6813e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 17:59:05 +0200
Subject: Better handling of user id revocation in UI code
---
.../keychain/ui/EditKeyFragment.java | 5 +-
.../keychain/ui/adapter/UserIdsAdapter.java | 20 +++++++
.../ui/dialog/EditUserIdDialogFragment.java | 64 ++++++++++++++++------
OpenKeychain/src/main/res/values/strings.xml | 5 ++
4 files changed, 75 insertions(+), 19 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index 6b062af59..7697f736c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -318,6 +318,8 @@ public class EditKeyFragment extends LoaderFragment implements
private void editUserId(final int position) {
final String userId = mUserIdsAdapter.getUserId(position);
+ final boolean isRevoked = mUserIdsAdapter.getIsRevoked(position);
+ final boolean isRevokedPending = mUserIdsAdapter.getIsRevokedPending(position);
Handler returnHandler = new Handler() {
@Override
@@ -351,8 +353,7 @@ public class EditKeyFragment extends LoaderFragment implements
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
public void run() {
EditUserIdDialogFragment dialogFragment =
- EditUserIdDialogFragment.newInstance(messenger);
-
+ EditUserIdDialogFragment.newInstance(messenger, isRevoked, isRevokedPending);
dialogFragment.show(getActivity().getSupportFragmentManager(), "editUserIdDialog");
}
});
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java
index ee3341c08..9bf47a387 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java
@@ -252,6 +252,26 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
return mCursor.getString(INDEX_USER_ID);
}
+ public boolean getIsRevoked(int position) {
+ mCursor.moveToPosition(position);
+ return mCursor.getInt(INDEX_IS_REVOKED) > 0;
+ }
+
+ public boolean getIsRevokedPending(int position) {
+ mCursor.moveToPosition(position);
+ String userId = mCursor.getString(INDEX_USER_ID);
+
+ boolean isRevokedPending = false;
+ if (mSaveKeyringParcel != null) {
+ if (mSaveKeyringParcel.mRevokeUserIds.contains(userId)) {
+ isRevokedPending = true;
+ }
+
+ }
+
+ return isRevokedPending;
+ }
+
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = mInflater.inflate(R.layout.view_key_user_id_item, null);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java
index 5eba3a463..8a31b7f64 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java
@@ -29,9 +29,14 @@ import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
+import java.util.Arrays;
+
public class EditUserIdDialogFragment extends DialogFragment {
private static final String ARG_MESSENGER = "messenger";
+ private static final String ARG_IS_REVOKED = "is_revoked";
+ private static final String ARG_IS_REVOKED_PENDING = "is_revoked_pending";
+
public static final int MESSAGE_CHANGE_PRIMARY_USER_ID = 1;
public static final int MESSAGE_REVOKE = 2;
@@ -40,10 +45,13 @@ public class EditUserIdDialogFragment extends DialogFragment {
/**
* Creates new instance of this dialog fragment
*/
- public static EditUserIdDialogFragment newInstance(Messenger messenger) {
+ public static EditUserIdDialogFragment newInstance(Messenger messenger, boolean isRevoked,
+ boolean isRevokedPending) {
EditUserIdDialogFragment frag = new EditUserIdDialogFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_MESSENGER, messenger);
+ args.putBoolean(ARG_IS_REVOKED, isRevoked);
+ args.putBoolean(ARG_IS_REVOKED_PENDING, isRevokedPending);
frag.setArguments(args);
@@ -56,27 +64,49 @@ public class EditUserIdDialogFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
mMessenger = getArguments().getParcelable(ARG_MESSENGER);
+ boolean isRevoked = getArguments().getBoolean(ARG_IS_REVOKED);
+ boolean isRevokedPending = getArguments().getBoolean(ARG_IS_REVOKED_PENDING);
CustomAlertDialogBuilder builder = new CustomAlertDialogBuilder(getActivity());
- CharSequence[] array = getResources().getStringArray(R.array.edit_key_edit_user_id);
-
builder.setTitle(R.string.edit_key_edit_user_id_title);
- builder.setItems(array, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- switch (which) {
- case 0:
- sendMessageToHandler(MESSAGE_CHANGE_PRIMARY_USER_ID, null);
- break;
- case 1:
- sendMessageToHandler(MESSAGE_REVOKE, null);
- break;
- default:
- break;
+ if (isRevokedPending) {
+ CharSequence[] array = getResources().getStringArray(R.array.edit_key_edit_user_id_revert_revocation);
+
+ builder.setItems(array, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ switch (which) {
+ case 0:
+ sendMessageToHandler(MESSAGE_REVOKE, null);
+ break;
+ default:
+ break;
+ }
}
- }
- });
+ });
+ } else if (isRevoked) {
+ builder.setMessage(R.string.edit_key_edit_user_id_revoked);
+ } else {
+ CharSequence[] array = getResources().getStringArray(R.array.edit_key_edit_user_id);
+
+ builder.setItems(array, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ switch (which) {
+ case 0:
+ sendMessageToHandler(MESSAGE_CHANGE_PRIMARY_USER_ID, null);
+ break;
+ case 1:
+ sendMessageToHandler(MESSAGE_REVOKE, null);
+ break;
+ default:
+ break;
+ }
+ }
+ });
+ }
+
builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 18031e25b..f8bf68240 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -437,12 +437,17 @@
Change to Primary IdentityRevoke Identity
+
+ Revert revocation
+
+ This identity has been revoked. This cannot be undone.Select an action!Change ExpiryRevoke Subkey
+
Upload key to keyserverThis field is required
--
cgit v1.2.3
From 04cdd45e1aceb940fe74051a0015e5ab85b18314 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 18:35:48 +0200
Subject: Work on add subkey dialog design
---
.../ui/dialog/AddSubkeyDialogFragment.java | 46 ++++--
.../ui/dialog/EditSubkeyExpiryDialogFragment.java | 4 +-
.../ui/dialog/EditUserIdDialogFragment.java | 2 -
.../src/main/res/layout/add_subkey_dialog.xml | 177 +++++++++++++++++++++
.../src/main/res/layout/create_key_dialog.xml | 162 -------------------
.../main/res/layout/edit_subkey_expiry_dialog.xml | 16 ++
OpenKeychain/src/main/res/layout/expiry_dialog.xml | 16 --
7 files changed, 232 insertions(+), 191 deletions(-)
create mode 100644 OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
delete mode 100644 OpenKeychain/src/main/res/layout/create_key_dialog.xml
create mode 100644 OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml
delete mode 100644 OpenKeychain/src/main/res/layout/expiry_dialog.xml
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
index 2031eae2a..c085adf40 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -32,6 +32,9 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
@@ -54,11 +57,18 @@ public class AddSubkeyDialogFragment extends DialogFragment {
private static final String ARG_WILL_BE_MASTER_KEY = "will_be_master_key";
private OnAlgorithmSelectedListener mAlgorithmSelectedListener;
+
+ private CheckBox mNoExpiryCheckBox;
+ private DatePicker mExpiryDatePicker;
private Spinner mAlgorithmSpinner;
private Spinner mKeySizeSpinner;
private TextView mCustomKeyTextView;
private EditText mCustomKeyEditText;
private TextView mCustomKeyInfoTextView;
+ private CheckBox mFlagCertify;
+ private CheckBox mFlagSign;
+ private CheckBox mFlagEncrypt;
+ private CheckBox mFlagAuthenticate;
public void setOnAlgorithmSelectedListener(OnAlgorithmSelectedListener listener) {
mAlgorithmSelectedListener = listener;
@@ -85,11 +95,33 @@ public class AddSubkeyDialogFragment extends DialogFragment {
CustomAlertDialogBuilder dialog = new CustomAlertDialogBuilder(context);
- View view = mInflater.inflate(R.layout.create_key_dialog, null);
+ View view = mInflater.inflate(R.layout.add_subkey_dialog, null);
dialog.setView(view);
dialog.setTitle(R.string.title_create_key);
- mAlgorithmSpinner = (Spinner) view.findViewById(R.id.create_key_algorithm);
+ mNoExpiryCheckBox = (CheckBox) view.findViewById(R.id.add_subkey_no_expiry);
+ mExpiryDatePicker = (DatePicker) view.findViewById(R.id.add_subkey_expiry_date_picker);
+ mAlgorithmSpinner = (Spinner) view.findViewById(R.id.add_subkey_algorithm);
+ mKeySizeSpinner = (Spinner) view.findViewById(R.id.add_subkey_size);
+ mCustomKeyTextView = (TextView) view.findViewById(R.id.add_subkey_custom_key_size_label);
+ mCustomKeyEditText = (EditText) view.findViewById(R.id.add_subkey_custom_key_size_input);
+ mCustomKeyInfoTextView = (TextView) view.findViewById(R.id.add_subkey_custom_key_size_info);
+ mFlagCertify = (CheckBox) view.findViewById(R.id.add_subkey_flag_certify);
+ mFlagSign = (CheckBox) view.findViewById(R.id.add_subkey_flag_sign);
+ mFlagEncrypt = (CheckBox) view.findViewById(R.id.add_subkey_flag_encrypt);
+ mFlagAuthenticate = (CheckBox) view.findViewById(R.id.add_subkey_flag_authenticate);
+
+ mNoExpiryCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if (isChecked) {
+ mExpiryDatePicker.setVisibility(View.GONE);
+ } else {
+ mExpiryDatePicker.setVisibility(View.VISIBLE);
+ }
+ }
+ });
+
ArrayList choices = new ArrayList();
choices.add(new Choice(Constants.choice.algorithm.dsa, getResources().getString(
R.string.dsa)));
@@ -97,10 +129,8 @@ public class AddSubkeyDialogFragment extends DialogFragment {
choices.add(new Choice(Constants.choice.algorithm.elgamal, getResources().getString(
R.string.elgamal)));
}
-
choices.add(new Choice(Constants.choice.algorithm.rsa, getResources().getString(
R.string.rsa)));
-
ArrayAdapter adapter = new ArrayAdapter(context,
android.R.layout.simple_spinner_item, choices);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
@@ -113,7 +143,7 @@ public class AddSubkeyDialogFragment extends DialogFragment {
}
}
- mKeySizeSpinner = (Spinner) view.findViewById(R.id.create_key_size);
+
// dynamic ArrayAdapter must be created (instead of ArrayAdapter.getFromResource), because it's content may change
ArrayAdapter keySizeAdapter = new ArrayAdapter(context, android.R.layout.simple_spinner_item,
new ArrayList(Arrays.asList(getResources().getStringArray(R.array.rsa_key_size_spinner_values))));
@@ -121,9 +151,6 @@ public class AddSubkeyDialogFragment extends DialogFragment {
mKeySizeSpinner.setAdapter(keySizeAdapter);
mKeySizeSpinner.setSelection(1); // Default to 4096 for the key length
- mCustomKeyTextView = (TextView) view.findViewById(R.id.custom_key_size_label);
- mCustomKeyEditText = (EditText) view.findViewById(R.id.custom_key_size_input);
- mCustomKeyInfoTextView = (TextView) view.findViewById(R.id.custom_key_size_info);
dialog.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@@ -148,7 +175,8 @@ public class AddSubkeyDialogFragment extends DialogFragment {
public void onClick(DialogInterface di, int id) {
di.dismiss();
}
- });
+ }
+ );
final AlertDialog alertDialog = dialog.show();
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
index 8482c0b37..303ab4363 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
@@ -92,10 +92,10 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
alert.setTitle(R.string.expiry_date_dialog_title);
LayoutInflater inflater = activity.getLayoutInflater();
- View view = inflater.inflate(R.layout.expiry_dialog, null);
+ View view = inflater.inflate(R.layout.edit_subkey_expiry_dialog, null);
alert.setView(view);
- mDatePicker = (DatePicker) view.findViewById(R.id.datePicker);
+ mDatePicker = (DatePicker) view.findViewById(R.id.edit_subkey_expiry_date_picker);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
// will crash with IllegalArgumentException if we set a min date
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java
index 8a31b7f64..70a3b8fd0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditUserIdDialogFragment.java
@@ -29,8 +29,6 @@ import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
-import java.util.Arrays;
-
public class EditUserIdDialogFragment extends DialogFragment {
private static final String ARG_MESSENGER = "messenger";
diff --git a/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml b/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
new file mode 100644
index 000000000..a4bd4ed6a
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/create_key_dialog.xml b/OpenKeychain/src/main/res/layout/create_key_dialog.xml
deleted file mode 100644
index 31c5fbefc..000000000
--- a/OpenKeychain/src/main/res/layout/create_key_dialog.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml b/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml
new file mode 100644
index 000000000..062f07863
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/expiry_dialog.xml b/OpenKeychain/src/main/res/layout/expiry_dialog.xml
deleted file mode 100644
index 14fff0b3f..000000000
--- a/OpenKeychain/src/main/res/layout/expiry_dialog.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
--
cgit v1.2.3
From 39380a361718201fdefa86628fb0deb8771deaa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 18:42:55 +0200
Subject: More work on add subkey dialog design
---
.../keychain/ui/dialog/AddSubkeyDialogFragment.java | 9 ++++++---
OpenKeychain/src/main/res/layout/add_subkey_dialog.xml | 11 ++++++++---
OpenKeychain/src/main/res/values/strings.xml | 2 +-
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
index c085adf40..34bb3486a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -37,6 +37,7 @@ import android.widget.CompoundButton;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
+import android.widget.TableRow;
import android.widget.TextView;
import org.spongycastle.bcpg.sig.KeyFlags;
@@ -59,6 +60,7 @@ public class AddSubkeyDialogFragment extends DialogFragment {
private OnAlgorithmSelectedListener mAlgorithmSelectedListener;
private CheckBox mNoExpiryCheckBox;
+ private TableRow mExpiryRow;
private DatePicker mExpiryDatePicker;
private Spinner mAlgorithmSpinner;
private Spinner mKeySizeSpinner;
@@ -97,9 +99,10 @@ public class AddSubkeyDialogFragment extends DialogFragment {
View view = mInflater.inflate(R.layout.add_subkey_dialog, null);
dialog.setView(view);
- dialog.setTitle(R.string.title_create_key);
+ dialog.setTitle(R.string.title_add_subkey);
mNoExpiryCheckBox = (CheckBox) view.findViewById(R.id.add_subkey_no_expiry);
+ mExpiryRow = (TableRow) view.findViewById(R.id.add_subkey_expiry_row);
mExpiryDatePicker = (DatePicker) view.findViewById(R.id.add_subkey_expiry_date_picker);
mAlgorithmSpinner = (Spinner) view.findViewById(R.id.add_subkey_algorithm);
mKeySizeSpinner = (Spinner) view.findViewById(R.id.add_subkey_size);
@@ -115,9 +118,9 @@ public class AddSubkeyDialogFragment extends DialogFragment {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
- mExpiryDatePicker.setVisibility(View.GONE);
+ mExpiryRow.setVisibility(View.GONE);
} else {
- mExpiryDatePicker.setVisibility(View.VISIBLE);
+ mExpiryRow.setVisibility(View.VISIBLE);
}
}
});
diff --git a/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml b/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
index a4bd4ed6a..e1ccfee1f 100644
--- a/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
+++ b/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
@@ -7,6 +7,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
+ android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:stretchColumns="1">
@@ -15,6 +16,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:layout_marginBottom="4dp"
android:text="@string/key_creation_el_gamal_info" />
@@ -70,7 +72,9 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
-
+
-
+ EncryptDecryptPassphrase
- Create My Key
+ Add subkeyEdit KeyPreferencesApps
--
cgit v1.2.3
From f8a222983efe5741a0d79147c6724a49ad7e5b3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 20:52:29 +0200
Subject: Use PublicKeyAlgorithmTags instead of homebrew choices constants, fix
expiry selection for adding new subkeys
---
.../org/sufficientlysecure/keychain/Constants.java | 7 ---
.../keychain/pgp/PgpKeyHelper.java | 22 ++++----
.../keychain/pgp/PgpKeyOperation.java | 9 ++--
.../keychain/ui/CreateKeyFinalFragment.java | 8 +--
.../keychain/ui/EditKeyFragment.java | 9 ++--
.../keychain/ui/adapter/SubkeysAdapter.java | 13 +++--
.../keychain/ui/adapter/SubkeysAddedAdapter.java | 36 +++++--------
.../ui/dialog/AddSubkeyDialogFragment.java | 61 +++++++++++++++++-----
.../ui/dialog/EditSubkeyExpiryDialogFragment.java | 13 +++--
OpenKeychain/src/main/res/values/strings.xml | 2 +-
10 files changed, 102 insertions(+), 78 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index 6423697cf..df39efeb0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -92,13 +92,6 @@ public final class Constants {
}
public static final class choice {
- public static final class algorithm {
- // TODO: legacy reasons :/ better: PublicKeyAlgorithmTags
- public static final int dsa = 0x21070001;
- public static final int elgamal = 0x21070002;
- public static final int rsa = 0x21070003;
- }
-
public static final class compression {
// TODO: legacy reasons :/ better: CompressionAlgorithmTags.UNCOMPRESSED
public static final int none = 0x21070001;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
index 7e18aa906..0c640538f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
@@ -24,7 +24,7 @@ import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
-import org.spongycastle.openpgp.PGPPublicKey;
+import org.spongycastle.bcpg.PublicKeyAlgorithmTags;
import org.spongycastle.util.encoders.Hex;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
@@ -37,9 +37,6 @@ import java.util.Locale;
public class PgpKeyHelper {
- /**
- * TODO: Only used in HkpKeyServer. Get rid of this one!
- */
public static String getAlgorithmInfo(int algorithm) {
return getAlgorithmInfo(null, algorithm, 0);
}
@@ -55,25 +52,25 @@ public class PgpKeyHelper {
String algorithmStr;
switch (algorithm) {
- case PGPPublicKey.RSA_ENCRYPT:
- case PGPPublicKey.RSA_GENERAL:
- case PGPPublicKey.RSA_SIGN: {
+ case PublicKeyAlgorithmTags.RSA_ENCRYPT:
+ case PublicKeyAlgorithmTags.RSA_GENERAL:
+ case PublicKeyAlgorithmTags.RSA_SIGN: {
algorithmStr = "RSA";
break;
}
- case PGPPublicKey.DSA: {
+ case PublicKeyAlgorithmTags.DSA: {
algorithmStr = "DSA";
break;
}
- case PGPPublicKey.ELGAMAL_ENCRYPT:
- case PGPPublicKey.ELGAMAL_GENERAL: {
+ case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT:
+ case PublicKeyAlgorithmTags.ELGAMAL_GENERAL: {
algorithmStr = "ElGamal";
break;
}
- case PGPPublicKey.ECDSA:
- case PGPPublicKey.ECDH: {
+ case PublicKeyAlgorithmTags.ECDSA:
+ case PublicKeyAlgorithmTags.ECDH: {
algorithmStr = "ECC";
break;
}
@@ -82,7 +79,6 @@ public class PgpKeyHelper {
if (context != null) {
algorithmStr = context.getResources().getString(R.string.unknown_algorithm);
} else {
- // TODO
algorithmStr = "unknown";
}
break;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
index 3f058d888..6cd020684 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.bcpg.HashAlgorithmTags;
+import org.spongycastle.bcpg.PublicKeyAlgorithmTags;
import org.spongycastle.bcpg.SymmetricKeyAlgorithmTags;
import org.spongycastle.bcpg.sig.KeyFlags;
import org.spongycastle.jce.spec.ElGamalParameterSpec;
@@ -138,7 +139,7 @@ public class PgpKeyOperation {
KeyPairGenerator keyGen;
switch (algorithmChoice) {
- case Constants.choice.algorithm.dsa: {
+ case PublicKeyAlgorithmTags.DSA: {
progress(R.string.progress_generating_dsa, 30);
keyGen = KeyPairGenerator.getInstance("DSA", Constants.BOUNCY_CASTLE_PROVIDER_NAME);
keyGen.initialize(keySize, new SecureRandom());
@@ -146,7 +147,7 @@ public class PgpKeyOperation {
break;
}
- case Constants.choice.algorithm.elgamal: {
+ case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT: {
progress(R.string.progress_generating_elgamal, 30);
keyGen = KeyPairGenerator.getInstance("ElGamal", Constants.BOUNCY_CASTLE_PROVIDER_NAME);
BigInteger p = Primes.getBestPrime(keySize);
@@ -159,7 +160,7 @@ public class PgpKeyOperation {
break;
}
- case Constants.choice.algorithm.rsa: {
+ case PublicKeyAlgorithmTags.RSA_GENERAL: {
progress(R.string.progress_generating_rsa, 30);
keyGen = KeyPairGenerator.getInstance("RSA", Constants.BOUNCY_CASTLE_PROVIDER_NAME);
keyGen.initialize(keySize, new SecureRandom());
@@ -217,7 +218,7 @@ public class PgpKeyOperation {
return new EditKeyResult(EditKeyResult.RESULT_ERROR, log, null);
}
- if (add.mAlgorithm == Constants.choice.algorithm.elgamal) {
+ if (add.mAlgorithm == PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT) {
log.add(LogLevel.ERROR, LogType.MSG_CR_ERROR_MASTER_ELGAMAL, indent);
return new EditKeyResult(EditKeyResult.RESULT_ERROR, log, null);
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
index abbc3f199..de9c7f77d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
@@ -31,7 +31,9 @@ import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
+import org.spongycastle.bcpg.PublicKeyAlgorithmTags;
import org.spongycastle.bcpg.sig.KeyFlags;
+import org.spongycastle.openpgp.PGPPublicKey;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.Preferences;
@@ -169,9 +171,9 @@ public class CreateKeyFinalFragment extends Fragment {
Bundle data = new Bundle();
SaveKeyringParcel parcel = new SaveKeyringParcel();
- parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.CERTIFY_OTHER, null));
- parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.SIGN_DATA, null));
- parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, null));
+ parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.CERTIFY_OTHER, null));
+ parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.SIGN_DATA, null));
+ parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(PublicKeyAlgorithmTags.RSA_GENERAL, 4096, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, null));
String userId = KeyRing.createUserId(mName, mEmail, null);
parcel.mAddUserIds.add(userId);
parcel.mChangePrimaryUserId = userId;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index 7697f736c..1a37567eb 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -397,15 +397,16 @@ public class EditKeyFragment extends LoaderFragment implements
private void editSubkeyExpiry(final int position) {
final long keyId = mSubkeysAdapter.getKeyId(position);
- final long creationDate = mSubkeysAdapter.getCreationDate(position);
- final long expiryDate = mSubkeysAdapter.getExpiryDate(position);
+ final Long creationDate = mSubkeysAdapter.getCreationDate(position);
+ final Long expiryDate = mSubkeysAdapter.getExpiryDate(position);
Handler returnHandler = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.what) {
case EditSubkeyExpiryDialogFragment.MESSAGE_NEW_EXPIRY_DATE:
- long expiry = message.getData().getLong(EditSubkeyExpiryDialogFragment.MESSAGE_DATA_EXPIRY_DATE);
+ Long expiry = (Long) message.getData().
+ getSerializable(EditSubkeyExpiryDialogFragment.MESSAGE_DATA_EXPIRY_DATE);
Log.d(Constants.TAG, "new expiry: " + expiry);
mSaveKeyringParcel.getOrCreateSubkeyChange(keyId).mExpiry = expiry;
break;
@@ -464,7 +465,7 @@ public class EditKeyFragment extends LoaderFragment implements
new AddSubkeyDialogFragment.OnAlgorithmSelectedListener() {
@Override
public void onAlgorithmSelected(SaveKeyringParcel.SubkeyAdd newSubkey) {
- mSubkeysAddedAdapter.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.SIGN_DATA, null));
+ mSubkeysAddedAdapter.add(newSubkey);
}
}
);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
index dd972866c..e845c7e42 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
@@ -95,9 +95,13 @@ public class SubkeysAdapter extends CursorAdapter {
return mCursor.getLong(INDEX_CREATION);
}
- public long getExpiryDate(int position) {
+ public Long getExpiryDate(int position) {
mCursor.moveToPosition(position);
- return mCursor.getLong(INDEX_EXPIRY);
+ if (mCursor.isNull(INDEX_EXPIRY)) {
+ return null;
+ } else {
+ return mCursor.getLong(INDEX_EXPIRY);
+ }
}
@Override
@@ -178,8 +182,9 @@ public class SubkeysAdapter extends CursorAdapter {
SaveKeyringParcel.SubkeyChange subkeyChange = mSaveKeyringParcel.getSubkeyChange(keyId);
if (subkeyChange != null) {
- // 0 is "no expiry"
- if (subkeyChange.mExpiry != null && subkeyChange.mExpiry != 0) {
+ if (subkeyChange.mExpiry == null) {
+ expiryDate = null;
+ } else {
expiryDate = new Date(subkeyChange.mExpiry * 1000);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
index 1ec9add68..b3f87a4c4 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
@@ -102,35 +102,27 @@ public class SubkeysAddedAdapter extends ArrayAdapter= android.os.Build.VERSION_CODES.HONEYCOMB) {
+ mExpiryDatePicker.setMinDate(new Date().getTime() + DateUtils.DAY_IN_MILLIS);
+ }
+
ArrayList choices = new ArrayList();
- choices.add(new Choice(Constants.choice.algorithm.dsa, getResources().getString(
+ choices.add(new Choice(PublicKeyAlgorithmTags.DSA, getResources().getString(
R.string.dsa)));
if (!willBeMasterKey) {
- choices.add(new Choice(Constants.choice.algorithm.elgamal, getResources().getString(
+ choices.add(new Choice(PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT, getResources().getString(
R.string.elgamal)));
}
- choices.add(new Choice(Constants.choice.algorithm.rsa, getResources().getString(
+ choices.add(new Choice(PublicKeyAlgorithmTags.RSA_GENERAL, getResources().getString(
R.string.rsa)));
ArrayAdapter adapter = new ArrayAdapter(context,
android.R.layout.simple_spinner_item, choices);
@@ -140,13 +150,12 @@ public class AddSubkeyDialogFragment extends DialogFragment {
mAlgorithmSpinner.setAdapter(adapter);
// make RSA the default
for (int i = 0; i < choices.size(); ++i) {
- if (choices.get(i).getId() == Constants.choice.algorithm.rsa) {
+ if (choices.get(i).getId() == PublicKeyAlgorithmTags.RSA_GENERAL) {
mAlgorithmSpinner.setSelection(i);
break;
}
}
-
// dynamic ArrayAdapter must be created (instead of ArrayAdapter.getFromResource), because it's content may change
ArrayAdapter keySizeAdapter = new ArrayAdapter(context, android.R.layout.simple_spinner_item,
new ArrayList(Arrays.asList(getResources().getStringArray(R.array.rsa_key_size_spinner_values))));
@@ -161,11 +170,37 @@ public class AddSubkeyDialogFragment extends DialogFragment {
di.dismiss();
Choice newKeyAlgorithmChoice = (Choice) mAlgorithmSpinner.getSelectedItem();
int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(), getSelectedKeyLength());
+
+ int flags = 0;
+ if (mFlagCertify.isChecked()) {
+ flags += KeyFlags.CERTIFY_OTHER;
+ }
+ if (mFlagSign.isChecked()) {
+ flags += KeyFlags.SIGN_DATA;
+ }
+ if (mFlagEncrypt.isChecked()) {
+ flags += KeyFlags.ENCRYPT_COMMS + KeyFlags.ENCRYPT_STORAGE;
+ }
+ if (mFlagAuthenticate.isChecked()) {
+ flags += KeyFlags.AUTHENTICATION;
+ }
+
+ Long expiry;
+ if (mNoExpiryCheckBox.isChecked()) {
+ expiry = null;
+ } else {
+ Calendar selectedCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ //noinspection ResourceType
+ selectedCal.set(mExpiryDatePicker.getYear(),
+ mExpiryDatePicker.getMonth(), mExpiryDatePicker.getDayOfMonth());
+ expiry = selectedCal.getTime().getTime() / 1000;
+ }
+
SaveKeyringParcel.SubkeyAdd newSubkey = new SaveKeyringParcel.SubkeyAdd(
newKeyAlgorithmChoice.getId(),
newKeySize,
- KeyFlags.SIGN_DATA, //TODO
- null
+ flags,
+ expiry
);
mAlgorithmSelectedListener.onAlgorithmSelected(newSubkey);
}
@@ -261,12 +296,12 @@ public class AddSubkeyDialogFragment extends DialogFragment {
final int[] elGamalSupportedLengths = {1536, 2048, 3072, 4096, 8192};
int properKeyLength = -1;
switch (algorithmId) {
- case Constants.choice.algorithm.rsa:
+ case PublicKeyAlgorithmTags.RSA_GENERAL:
if (currentKeyLength > 1024 && currentKeyLength <= 8192) {
properKeyLength = currentKeyLength + ((8 - (currentKeyLength % 8)) % 8);
}
break;
- case Constants.choice.algorithm.elgamal:
+ case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT:
int[] elGammalKeyDiff = new int[elGamalSupportedLengths.length];
for (int i = 0; i < elGamalSupportedLengths.length; i++) {
elGammalKeyDiff[i] = Math.abs(elGamalSupportedLengths[i] - currentKeyLength);
@@ -281,7 +316,7 @@ public class AddSubkeyDialogFragment extends DialogFragment {
}
properKeyLength = elGamalSupportedLengths[minimalIndex];
break;
- case Constants.choice.algorithm.dsa:
+ case PublicKeyAlgorithmTags.DSA:
if (currentKeyLength >= 512 && currentKeyLength <= 1024) {
properKeyLength = currentKeyLength + ((64 - (currentKeyLength % 64)) % 64);
}
@@ -320,15 +355,15 @@ public class AddSubkeyDialogFragment extends DialogFragment {
final Object selectedItem = mKeySizeSpinner.getSelectedItem();
keySizeAdapter.clear();
switch (algorithmId) {
- case Constants.choice.algorithm.rsa:
+ case PublicKeyAlgorithmTags.RSA_GENERAL:
replaceArrayAdapterContent(keySizeAdapter, R.array.rsa_key_size_spinner_values);
mCustomKeyInfoTextView.setText(getResources().getString(R.string.key_size_custom_info_rsa));
break;
- case Constants.choice.algorithm.elgamal:
+ case PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT:
replaceArrayAdapterContent(keySizeAdapter, R.array.elgamal_key_size_spinner_values);
mCustomKeyInfoTextView.setText(""); // ElGamal does not support custom key length
break;
- case Constants.choice.algorithm.dsa:
+ case PublicKeyAlgorithmTags.DSA:
replaceArrayAdapterContent(keySizeAdapter, R.array.dsa_key_size_spinner_values);
mCustomKeyInfoTextView.setText(getResources().getString(R.string.key_size_custom_info_dsa));
break;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
index 303ab4363..aa63f9944 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
@@ -56,12 +56,12 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
* Creates new instance of this dialog fragment
*/
public static EditSubkeyExpiryDialogFragment newInstance(Messenger messenger,
- long creationDate, long expiryDate) {
+ Long creationDate, Long expiryDate) {
EditSubkeyExpiryDialogFragment frag = new EditSubkeyExpiryDialogFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_MESSENGER, messenger);
- args.putLong(ARG_CREATION_DATE, creationDate);
- args.putLong(ARG_EXPIRY_DATE, expiryDate);
+ args.putSerializable(ARG_CREATION_DATE, creationDate);
+ args.putSerializable(ARG_EXPIRY_DATE, expiryDate);
frag.setArguments(args);
@@ -124,12 +124,12 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
- (mExpiryCal.getTimeInMillis() / 86400000);
if (numDays > 0) {
Bundle data = new Bundle();
- data.putLong(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime().getTime() / 1000);
+ data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime().getTime() / 1000);
sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
}
} else {
Bundle data = new Bundle();
- data.putLong(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime().getTime() / 1000);
+ data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, selectedCal.getTime().getTime() / 1000);
sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
}
}
@@ -140,9 +140,8 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
public void onClick(DialogInterface dialog, int id) {
dismiss();
- // "no expiry" corresponds to a 0
Bundle data = new Bundle();
- data.putLong(MESSAGE_DATA_EXPIRY_DATE, 0);
+ data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, null);
sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
}
});
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 831edc94c..58d3832f7 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -446,7 +446,7 @@
Change ExpiryRevoke Subkey
-
+ newUpload key to keyserver
--
cgit v1.2.3
From 1455af2eed0f5efa2bc3b3317334796516670970 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 22:35:37 +0200
Subject: Edit key: key flags
---
.../keychain/pgp/PgpKeyOperation.java | 2 +-
.../keychain/ui/EditKeyFragment.java | 1 -
.../keychain/ui/adapter/SubkeysAdapter.java | 1 +
.../keychain/ui/adapter/SubkeysAddedAdapter.java | 31 +++++++++++++++-------
.../ui/dialog/AddSubkeyDialogFragment.java | 8 +++---
.../src/main/res/layout/view_key_user_id_item.xml | 2 +-
6 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
index 6cd020684..bb692555e 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
@@ -769,7 +769,7 @@ public class PgpKeyOperation {
PGPSignatureSubpacketGenerator unhashedPacketsGen = new PGPSignatureSubpacketGenerator();
// If this key can sign, we need a primary key binding signature
- if ((flags & KeyFlags.SIGN_DATA) != 0) {
+ if ((flags & KeyFlags.SIGN_DATA) > 0) {
// cross-certify signing keys
PGPSignatureSubpacketGenerator subHashedPacketsGen = new PGPSignatureSubpacketGenerator();
subHashedPacketsGen.setSignatureCreationTime(false, todayDate);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index 1a37567eb..82206655f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -407,7 +407,6 @@ public class EditKeyFragment extends LoaderFragment implements
case EditSubkeyExpiryDialogFragment.MESSAGE_NEW_EXPIRY_DATE:
Long expiry = (Long) message.getData().
getSerializable(EditSubkeyExpiryDialogFragment.MESSAGE_DATA_EXPIRY_DATE);
- Log.d(Constants.TAG, "new expiry: " + expiry);
mSaveKeyringParcel.getOrCreateSubkeyChange(keyId).mExpiry = expiry;
break;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
index e845c7e42..d457e75bd 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java
@@ -162,6 +162,7 @@ public class SubkeysAdapter extends CursorAdapter {
vCertifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
vEncryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
vSignIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
+ // TODO: missing icon for authenticate
boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
index b3f87a4c4..be2e17c63 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAddedAdapter.java
@@ -28,6 +28,7 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
+import org.spongycastle.bcpg.sig.KeyFlags;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
@@ -56,7 +57,6 @@ public class SubkeysAddedAdapter extends ArrayAdapter 0) {
+ holder.vCertifyIcon.setVisibility(View.VISIBLE);
+ } else {
+ holder.vCertifyIcon.setVisibility(View.GONE);
+ }
+ if ((flags & KeyFlags.SIGN_DATA) > 0) {
+ holder.vSignIcon.setVisibility(View.VISIBLE);
+ } else {
+ holder.vSignIcon.setVisibility(View.GONE);
+ }
+ if (((flags & KeyFlags.ENCRYPT_COMMS) > 0)
+ || ((flags & KeyFlags.ENCRYPT_STORAGE) > 0)) {
+ holder.vEncryptIcon.setVisibility(View.VISIBLE);
+ } else {
+ holder.vEncryptIcon.setVisibility(View.GONE);
+ }
+ // TODO: missing icon for authenticate
return convertView;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
index 53428f526..27c797a7d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -173,16 +173,16 @@ public class AddSubkeyDialogFragment extends DialogFragment {
int flags = 0;
if (mFlagCertify.isChecked()) {
- flags += KeyFlags.CERTIFY_OTHER;
+ flags |= KeyFlags.CERTIFY_OTHER;
}
if (mFlagSign.isChecked()) {
- flags += KeyFlags.SIGN_DATA;
+ flags |= KeyFlags.SIGN_DATA;
}
if (mFlagEncrypt.isChecked()) {
- flags += KeyFlags.ENCRYPT_COMMS + KeyFlags.ENCRYPT_STORAGE;
+ flags |= KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE;
}
if (mFlagAuthenticate.isChecked()) {
- flags += KeyFlags.AUTHENTICATION;
+ flags |= KeyFlags.AUTHENTICATION;
}
Long expiry;
diff --git a/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml b/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml
index e6dae3eeb..24e8e1a10 100644
--- a/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml
+++ b/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml
@@ -69,7 +69,7 @@
android:layout_height="match_parent"
android:src="@drawable/ic_action_edit"
android:padding="8dp"
- android:layout_gravity="center_horizontal" />
+ android:layout_gravity="center_vertical" />
Date: Tue, 5 Aug 2014 22:38:36 +0200
Subject: Increase maximum custom RSA size
---
.../sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java | 2 +-
OpenKeychain/src/main/res/values/strings.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
index 27c797a7d..9841deeab 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -297,7 +297,7 @@ public class AddSubkeyDialogFragment extends DialogFragment {
int properKeyLength = -1;
switch (algorithmId) {
case PublicKeyAlgorithmTags.RSA_GENERAL:
- if (currentKeyLength > 1024 && currentKeyLength <= 8192) {
+ if (currentKeyLength > 1024 && currentKeyLength <= 16384) {
properKeyLength = currentKeyLength + ((8 - (currentKeyLength % 8)) % 8);
}
break;
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 58d3832f7..3debd9083 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -317,7 +317,7 @@
8192Custom key sizeType custom key length (in bits):
- RSA key length must be greater than 1024 and at most 8192. Also it must be multiplicity of 8.
+ RSA key length must be greater than 1024 and at most 16384. Also it must be multiplicity of 8.DSA key length must be at least 512 and at most 1024. Also it must be multiplicity of 64.
--
cgit v1.2.3
From f4802157dd1137e765acb9b538d26828b6fce3c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 22:46:00 +0200
Subject: Optimize imports
---
.../java/org/sufficientlysecure/keychain/Constants.java | 1 -
.../sufficientlysecure/keychain/KeychainApplication.java | 1 -
.../sufficientlysecure/keychain/helper/ContactHelper.java | 13 +++++++++++--
.../sufficientlysecure/keychain/helper/EmailKeyHelper.java | 1 +
.../sufficientlysecure/keychain/helper/ExportHelper.java | 1 -
.../org/sufficientlysecure/keychain/helper/FileHelper.java | 7 +++++--
.../org/sufficientlysecure/keychain/helper/TlsHelper.java | 12 ++++++++----
.../sufficientlysecure/keychain/keyimport/HkpKeyserver.java | 10 +++++-----
.../keychain/pgp/CanonicalizedSecretKeyRing.java | 1 -
.../sufficientlysecure/keychain/pgp/UncachedKeyRing.java | 4 +---
.../keychain/provider/ProviderHelper.java | 10 +++++-----
.../keychain/provider/TemporaryStorageProvider.java | 1 +
.../keychain/remote/ui/AccountSettingsFragment.java | 2 +-
.../keychain/service/ContactSyncAdapterService.java | 8 +++++++-
.../keychain/service/DummyAccountService.java | 1 +
.../keychain/service/KeychainIntentService.java | 5 +----
.../keychain/service/PassphraseCacheService.java | 3 +--
.../keychain/service/SaveKeyringParcel.java | 3 ---
.../keychain/ui/CreateKeyFinalFragment.java | 2 --
.../org/sufficientlysecure/keychain/ui/DecryptActivity.java | 1 +
.../sufficientlysecure/keychain/ui/DecryptFileFragment.java | 4 +---
.../org/sufficientlysecure/keychain/ui/DecryptFragment.java | 2 +-
.../org/sufficientlysecure/keychain/ui/DrawerActivity.java | 2 +-
.../org/sufficientlysecure/keychain/ui/EditKeyFragment.java | 3 +--
.../sufficientlysecure/keychain/ui/EncryptFileFragment.java | 1 +
.../keychain/ui/EncryptMessageFragment.java | 1 +
.../sufficientlysecure/keychain/ui/ImportKeysActivity.java | 2 +-
.../org/sufficientlysecure/keychain/ui/KeyListFragment.java | 2 +-
.../sufficientlysecure/keychain/ui/LogDisplayFragment.java | 2 --
.../sufficientlysecure/keychain/ui/ViewCertActivity.java | 2 +-
.../org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 3 +--
.../keychain/ui/ViewKeyShareFragment.java | 1 -
.../keychain/ui/adapter/ImportKeysListLoader.java | 1 -
.../keychain/ui/adapter/PagerTabStripAdapter.java | 5 -----
.../keychain/ui/dialog/AddSubkeyDialogFragment.java | 2 --
.../keychain/ui/dialog/AddUserIdDialogFragment.java | 1 -
.../keychain/ui/dialog/DeleteFileDialogFragment.java | 3 +--
.../keychain/ui/dialog/FileDialogFragment.java | 1 +
.../keychain/ui/dialog/SetPassphraseDialogFragment.java | 1 -
.../keychain/ui/widget/EncryptKeyCompletionView.java | 2 ++
.../keychain/ui/widget/FoldableLinearLayout.java | 2 +-
41 files changed, 64 insertions(+), 66 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index df39efeb0..d19233b3f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -17,7 +17,6 @@
package org.sufficientlysecure.keychain;
-import android.os.Build;
import android.os.Environment;
import org.spongycastle.bcpg.CompressionAlgorithmTags;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
index 181470757..95f9425ed 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
@@ -32,7 +32,6 @@ import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.PRNGFixes;
-import java.security.Provider;
import java.security.Security;
public class KeychainApplication extends Application {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
index 1d8661bfe..8697e49f7 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ContactHelper.java
@@ -19,7 +19,10 @@ package org.sufficientlysecure.keychain.helper;
import android.accounts.Account;
import android.accounts.AccountManager;
-import android.content.*;
+import android.content.ContentProviderOperation;
+import android.content.ContentResolver;
+import android.content.ContentUris;
+import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -36,7 +39,13 @@ import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.util.Log;
import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
public class ContactHelper {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java
index 7cd4f6710..d8efdc480 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/EmailKeyHelper.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Messenger;
+
import org.sufficientlysecure.keychain.keyimport.HkpKeyserver;
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
import org.sufficientlysecure.keychain.keyimport.Keyserver;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java
index ae9438148..bcd57b290 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/ExportHelper.java
@@ -35,7 +35,6 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
-import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
index 1b36ba3fc..b640ecb03 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/FileHelper.java
@@ -26,14 +26,17 @@ import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.net.Uri;
-import android.os.*;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Messenger;
import android.provider.DocumentsContract;
import android.provider.OpenableColumns;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.widget.Toast;
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/TlsHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/TlsHelper.java
index 4b09af04d..8bbe73676 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/TlsHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/TlsHelper.java
@@ -18,12 +18,10 @@
package org.sufficientlysecure.keychain.helper;
import android.content.res.AssetManager;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.util.Log;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManagerFactory;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -34,10 +32,16 @@ import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
-import java.security.cert.*;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
import java.util.HashMap;
import java.util.Map;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
public class TlsHelper {
public static class TlsHelperException extends Exception {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
index eb741fc45..f617be62a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java
@@ -18,11 +18,6 @@
package org.sufficientlysecure.keychain.keyimport;
-import de.measite.minidns.Client;
-import de.measite.minidns.Question;
-import de.measite.minidns.Record;
-import de.measite.minidns.record.SRV;
-
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.helper.TlsHelper;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
@@ -45,6 +40,11 @@ import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import de.measite.minidns.Client;
+import de.measite.minidns.Question;
+import de.measite.minidns.Record;
+import de.measite.minidns.record.SRV;
+
public class HkpKeyserver extends Keyserver {
private static class HttpError extends Exception {
private static final long serialVersionUID = 1718783705229428893L;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java
index 812bf2fed..80889f70d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedSecretKeyRing.java
@@ -23,7 +23,6 @@ import org.spongycastle.openpgp.PGPKeyRing;
import org.spongycastle.openpgp.PGPObjectFactory;
import org.spongycastle.openpgp.PGPPrivateKey;
import org.spongycastle.openpgp.PGPPublicKey;
-import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.spongycastle.openpgp.PGPSecretKey;
import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java
index af82495aa..18ddaa0ec 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java
@@ -33,9 +33,9 @@ import org.spongycastle.openpgp.PGPUtil;
import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
-import org.sufficientlysecure.keychain.service.OperationResultParcel.OperationLog;
import org.sufficientlysecure.keychain.service.OperationResultParcel.LogLevel;
import org.sufficientlysecure.keychain.service.OperationResultParcel.LogType;
+import org.sufficientlysecure.keychain.service.OperationResultParcel.OperationLog;
import org.sufficientlysecure.keychain.util.IterableIterator;
import org.sufficientlysecure.keychain.util.Log;
@@ -44,11 +44,9 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.Iterator;
-import java.util.List;
import java.util.Set;
import java.util.TreeSet;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
index e79771ed6..6111a4ef4 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
@@ -28,17 +28,14 @@ import android.os.RemoteException;
import android.support.v4.util.LongSparseArray;
import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKey;
import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKeyRing;
import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.pgp.NullProgressable;
-import org.sufficientlysecure.keychain.pgp.Progressable;
-import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKey;
-import org.sufficientlysecure.keychain.service.OperationResultParcel.LogType;
-import org.sufficientlysecure.keychain.service.OperationResultParcel.LogLevel;
-import org.sufficientlysecure.keychain.service.OperationResultParcel.OperationLog;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
+import org.sufficientlysecure.keychain.pgp.Progressable;
import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
import org.sufficientlysecure.keychain.pgp.UncachedPublicKey;
import org.sufficientlysecure.keychain.pgp.WrappedSignature;
@@ -51,6 +48,9 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
import org.sufficientlysecure.keychain.remote.AccountSettings;
import org.sufficientlysecure.keychain.remote.AppSettings;
+import org.sufficientlysecure.keychain.service.OperationResultParcel.LogLevel;
+import org.sufficientlysecure.keychain.service.OperationResultParcel.LogType;
+import org.sufficientlysecure.keychain.service.OperationResultParcel.OperationLog;
import org.sufficientlysecure.keychain.service.OperationResults.SaveKeyringResult;
import org.sufficientlysecure.keychain.util.IterableIterator;
import org.sufficientlysecure.keychain.util.Log;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
index b8934b6c1..87c0cc0a6 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/TemporaryStorageProvider.java
@@ -27,6 +27,7 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.provider.OpenableColumns;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.util.DatabaseUtil;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java
index 2ba792f9a..8468f5eca 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsFragment.java
@@ -26,9 +26,9 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
-import android.widget.Button;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ContactSyncAdapterService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ContactSyncAdapterService.java
index 6c4d59a77..43ed2dad0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ContactSyncAdapterService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/ContactSyncAdapterService.java
@@ -23,7 +23,13 @@ import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
import android.content.Intent;
import android.content.SyncResult;
-import android.os.*;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.KeychainApplication;
import org.sufficientlysecure.keychain.helper.ContactHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/DummyAccountService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/DummyAccountService.java
index 008502ce7..41ff6d02b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/DummyAccountService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/DummyAccountService.java
@@ -29,6 +29,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.widget.Toast;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.util.Log;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index 19f7bc9bb..30108d52d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -24,7 +24,6 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.os.Messenger;
-import android.os.Parcel;
import android.os.RemoteException;
import org.sufficientlysecure.keychain.Constants;
@@ -32,7 +31,6 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
import org.sufficientlysecure.keychain.helper.OtherHelper;
import org.sufficientlysecure.keychain.helper.Preferences;
-import org.sufficientlysecure.keychain.util.FileImportCache;
import org.sufficientlysecure.keychain.keyimport.HkpKeyserver;
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
import org.sufficientlysecure.keychain.keyimport.KeybaseKeyserver;
@@ -56,6 +54,7 @@ import org.sufficientlysecure.keychain.provider.KeychainDatabase;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.OperationResults.EditKeyResult;
import org.sufficientlysecure.keychain.service.OperationResults.ImportKeyResult;
+import org.sufficientlysecure.keychain.util.FileImportCache;
import org.sufficientlysecure.keychain.util.InputData;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ProgressScaler;
@@ -63,11 +62,9 @@ import org.sufficientlysecure.keychain.util.ProgressScaler;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java
index 7789ee064..e95e737d5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java
@@ -34,9 +34,8 @@ import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
-
-import android.support.v4.util.LongSparseArray;
import android.support.v4.app.NotificationCompat;
+import android.support.v4.util.LongSparseArray;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
index 442746feb..490a8e738 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/SaveKeyringParcel.java
@@ -20,9 +20,6 @@ package org.sufficientlysecure.keychain.service;
import android.os.Parcel;
import android.os.Parcelable;
-import org.sufficientlysecure.keychain.Constants;
-import org.sufficientlysecure.keychain.util.Log;
-
import java.io.Serializable;
import java.util.ArrayList;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
index de9c7f77d..773be816a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java
@@ -33,8 +33,6 @@ import android.widget.TextView;
import org.spongycastle.bcpg.PublicKeyAlgorithmTags;
import org.spongycastle.bcpg.sig.KeyFlags;
-import org.spongycastle.openpgp.PGPPublicKey;
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.Preferences;
import org.sufficientlysecure.keychain.pgp.KeyRing;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
index e62591b1a..830b9a279 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java
@@ -23,6 +23,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
index 51e90ea20..c33b1489a 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFileFragment.java
@@ -29,10 +29,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
-import android.widget.EditText;
-import android.widget.ImageButton;
-
import android.widget.TextView;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java
index 16a7b911e..211a20ec8 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java
@@ -25,11 +25,11 @@ import android.os.Message;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
-import android.widget.Button;
import org.openintents.openpgp.OpenPgpSignatureResult;
import org.sufficientlysecure.keychain.R;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java
index 586442bb0..0e8d6f39d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java
@@ -35,9 +35,9 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
+import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.ImageView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
index 82206655f..5be196a45 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java
@@ -37,7 +37,6 @@ import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
-import org.spongycastle.bcpg.sig.KeyFlags;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
@@ -59,8 +58,8 @@ import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAddedAdapter;
import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
-import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyExpiryDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyDialogFragment;
+import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyExpiryDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
index d412df0f4..8a9e17020 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java
@@ -33,6 +33,7 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
index e493ad066..6d753088b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptMessageFragment.java
@@ -26,6 +26,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+
import org.sufficientlysecure.keychain.R;
public class EncryptMessageFragment extends Fragment {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java
index 4a606a1b3..255290de3 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java
@@ -40,7 +40,6 @@ import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.OtherHelper;
import org.sufficientlysecure.keychain.helper.Preferences;
-import org.sufficientlysecure.keychain.util.FileImportCache;
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
@@ -49,6 +48,7 @@ import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
import org.sufficientlysecure.keychain.service.OperationResults.ImportKeyResult;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout;
+import org.sufficientlysecure.keychain.util.FileImportCache;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.Notify;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
index 28177c2ed..3c97b1128 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
@@ -47,10 +47,10 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.AdapterView;
+import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.Button;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java
index 43de6774b..0e948bf7f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/LogDisplayFragment.java
@@ -41,9 +41,7 @@ import org.sufficientlysecure.keychain.service.OperationResultParcel.LogEntryPar
import org.sufficientlysecure.keychain.service.OperationResultParcel.LogLevel;
import org.sufficientlysecure.keychain.util.Log;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
public class LogDisplayFragment extends ListFragment implements OnTouchListener {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java
index 5201b5df8..341e11d1d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewCertActivity.java
@@ -34,8 +34,8 @@ import android.widget.TextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKeyRing;
+import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.pgp.WrappedSignature;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.provider.KeychainContract.Certs;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
index e179115dc..28f7b8bf5 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -42,7 +42,6 @@ import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
-import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -57,9 +56,9 @@ import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.service.OperationResultParcel;
import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter;
+import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout;
import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout.TabColorizer;
import org.sufficientlysecure.keychain.util.Log;
-import org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout;
import org.sufficientlysecure.keychain.util.Notify;
import java.util.Date;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java
index 54ab76464..ae0bea5e9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java
@@ -49,7 +49,6 @@ import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
-import org.sufficientlysecure.keychain.provider.ProviderHelper.NotFoundException;
import org.sufficientlysecure.keychain.ui.dialog.ShareNfcDialogFragment;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.Notify;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java
index 4971c535c..04947da93 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java
@@ -33,7 +33,6 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
public class ImportKeysListLoader
extends AsyncTaskLoader>> {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/PagerTabStripAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/PagerTabStripAdapter.java
index 3e3098b10..330254a8f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/PagerTabStripAdapter.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/PagerTabStripAdapter.java
@@ -20,13 +20,8 @@ package org.sufficientlysecure.keychain.ui.adapter;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
-import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;
-import android.view.ViewGroup;
-
-import org.sufficientlysecure.keychain.Constants;
import java.util.ArrayList;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
index 9841deeab..cb31978e9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -43,8 +43,6 @@ import android.widget.TextView;
import org.spongycastle.bcpg.PublicKeyAlgorithmTags;
import org.spongycastle.bcpg.sig.KeyFlags;
-import org.spongycastle.openpgp.PGPPublicKey;
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
import org.sufficientlysecure.keychain.util.Choice;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java
index 226bdf51e..4d6b13476 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddUserIdDialogFragment.java
@@ -29,7 +29,6 @@ import android.os.Messenger;
import android.os.RemoteException;
import android.support.v4.app.DialogFragment;
import android.text.Editable;
-import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Patterns;
import android.view.KeyEvent;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
index d408349d2..5f29f1d18 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java
@@ -25,9 +25,8 @@ import android.os.Bundle;
import android.provider.DocumentsContract;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
-
import android.widget.Toast;
-import org.sufficientlysecure.keychain.Constants;
+
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
index 50f5ef7c0..18f134594 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/FileDialogFragment.java
@@ -34,6 +34,7 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.FileHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java
index 1386ed098..5e2bec0e9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java
@@ -31,7 +31,6 @@ import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.WindowManager.LayoutParams;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
index 03b0d658f..7e762fe77 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/EncryptKeyCompletionView.java
@@ -34,8 +34,10 @@ import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
+
import com.tokenautocomplete.FilteredArrayAdapter;
import com.tokenautocomplete.TokenCompleteTextView;
+
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.ContactHelper;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/FoldableLinearLayout.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/FoldableLinearLayout.java
index a29c17d37..31e01a7fb 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/FoldableLinearLayout.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/FoldableLinearLayout.java
@@ -24,9 +24,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
+import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
-import android.widget.ImageButton;
import org.sufficientlysecure.keychain.R;
--
cgit v1.2.3
From e4974ac4097b7b92b51134942b01e9ab300222de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Tue, 5 Aug 2014 23:50:59 +0200
Subject: Use CompressionAlgorithmTags instead of homebrew constants
---
.../java/org/sufficientlysecure/keychain/Constants.java | 13 +------------
.../keychain/KeychainApplication.java | 2 +-
.../sufficientlysecure/keychain/helper/Preferences.java | 13 ++++++++++---
.../sufficientlysecure/keychain/pgp/PgpSignEncrypt.java | 5 +++--
.../keychain/remote/AccountSettings.java | 3 ++-
.../keychain/ui/PreferencesActivity.java | 17 +++++++++--------
.../keychain/util/AlgorithmNames.java | 9 +++++----
OpenKeychain/src/main/res/values/strings.xml | 2 +-
8 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index d19233b3f..05676c5d0 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -19,7 +19,6 @@ package org.sufficientlysecure.keychain;
import android.os.Environment;
-import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.sufficientlysecure.keychain.remote.ui.AppsListActivity;
import org.sufficientlysecure.keychain.ui.DecryptActivity;
@@ -50,7 +49,7 @@ public final class Constants {
public static final String CUSTOM_CONTACT_DATA_MIME_TYPE = "vnd.android.cursor.item/vnd.org.sufficientlysecure.keychain.key";
- public static int TEMPFILE_TTL = 24*60*60*1000; // 1 day
+ public static int TEMPFILE_TTL = 24 * 60 * 60 * 1000; // 1 day
public static final class Path {
public static final File APP_DIR = new File(Environment.getExternalStorageDirectory(), "OpenKeychain");
@@ -90,16 +89,6 @@ public final class Constants {
};
}
- public static final class choice {
- public static final class compression {
- // TODO: legacy reasons :/ better: CompressionAlgorithmTags.UNCOMPRESSED
- public static final int none = 0x21070001;
- public static final int zlib = CompressionAlgorithmTags.ZLIB;
- public static final int bzip2 = CompressionAlgorithmTags.BZIP2;
- public static final int zip = CompressionAlgorithmTags.ZIP;
- }
- }
-
public static final class key {
public static final int none = 0;
public static final int symmetric = -1;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
index 95f9425ed..9b9880533 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/KeychainApplication.java
@@ -84,7 +84,7 @@ public class KeychainApplication extends Application {
setupAccountAsNeeded(this);
// Update keyserver list as needed
- Preferences.getPreferences(this).updateKeyServers();
+ Preferences.getPreferences(this).updatePreferences();
TlsHelper.addStaticCA("pool.sks-keyservers.net", getAssets(), "sks-keyservers.netCA.cer");
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
index 5d765b663..00f6b6715 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
@@ -21,6 +21,7 @@ package org.sufficientlysecure.keychain.helper;
import android.content.Context;
import android.content.SharedPreferences;
+import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.bcpg.HashAlgorithmTags;
import org.spongycastle.openpgp.PGPEncryptedData;
import org.sufficientlysecure.keychain.Constants;
@@ -99,7 +100,7 @@ public class Preferences {
public int getDefaultMessageCompression() {
return mSharedPreferences.getInt(Constants.Pref.DEFAULT_MESSAGE_COMPRESSION,
- Constants.choice.compression.zlib);
+ CompressionAlgorithmTags.ZLIB);
}
public void setDefaultMessageCompression(int value) {
@@ -110,7 +111,7 @@ public class Preferences {
public int getDefaultFileCompression() {
return mSharedPreferences.getInt(Constants.Pref.DEFAULT_FILE_COMPRESSION,
- Constants.choice.compression.none);
+ CompressionAlgorithmTags.UNCOMPRESSED);
}
public void setDefaultFileCompression(int value) {
@@ -180,7 +181,8 @@ public class Preferences {
editor.commit();
}
- public void updateKeyServers() {
+ public void updatePreferences() {
+ // migrate keyserver to hkps
if (mSharedPreferences.getInt(Constants.Pref.KEY_SERVERS_DEFAULT_VERSION, 0) !=
Constants.Defaults.KEY_SERVERS_VERSION) {
String[] servers = getKeyServers();
@@ -196,6 +198,11 @@ public class Preferences {
.putInt(Constants.Pref.KEY_SERVERS_DEFAULT_VERSION, Constants.Defaults.KEY_SERVERS_VERSION)
.commit();
}
+
+ // migrate old uncompressed constant to new one
+ if (mSharedPreferences.getInt(Constants.Pref.DEFAULT_FILE_COMPRESSION, 0) == 0x21070001) {
+ setDefaultFileCompression(CompressionAlgorithmTags.UNCOMPRESSED);
+ }
}
public void setConcealPgpApplication(boolean conceal) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
index f0403e625..d8bf0d4d9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.pgp;
import org.spongycastle.bcpg.ArmoredOutputStream;
import org.spongycastle.bcpg.BCPGOutputStream;
+import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.openpgp.PGPCompressedDataGenerator;
import org.spongycastle.openpgp.PGPEncryptedDataGenerator;
import org.spongycastle.openpgp.PGPException;
@@ -112,7 +113,7 @@ public class PgpSignEncrypt {
// optional
private Progressable mProgressable = null;
private boolean mEnableAsciiArmorOutput = false;
- private int mCompressionId = Constants.choice.compression.none;
+ private int mCompressionId = CompressionAlgorithmTags.UNCOMPRESSED;
private long[] mEncryptionMasterKeyIds = null;
private String mSymmetricPassphrase = null;
private int mSymmetricEncryptionAlgorithm = 0;
@@ -242,7 +243,7 @@ public class PgpSignEncrypt {
boolean enableSignature = mSignatureMasterKeyId != Constants.key.none;
boolean enableEncryption = ((mEncryptionMasterKeyIds != null && mEncryptionMasterKeyIds.length > 0)
|| mSymmetricPassphrase != null);
- boolean enableCompression = (mCompressionId != Constants.choice.compression.none);
+ boolean enableCompression = (mCompressionId != CompressionAlgorithmTags.UNCOMPRESSED);
Log.d(Constants.TAG, "enableSignature:" + enableSignature
+ "\nenableEncryption:" + enableEncryption
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/AccountSettings.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/AccountSettings.java
index a25ecded6..d6013b49d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/AccountSettings.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/AccountSettings.java
@@ -17,6 +17,7 @@
package org.sufficientlysecure.keychain.remote;
+import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.bcpg.HashAlgorithmTags;
import org.spongycastle.openpgp.PGPEncryptedData;
import org.sufficientlysecure.keychain.Constants;
@@ -39,7 +40,7 @@ public class AccountSettings {
// defaults:
this.mEncryptionAlgorithm = PGPEncryptedData.AES_256;
this.mHashAlgorithm = HashAlgorithmTags.SHA512;
- this.mCompression = Constants.choice.compression.zlib;
+ this.mCompression = CompressionAlgorithmTags.ZLIB;
}
public String getAccountName() {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java
index dcacdbc9d..e0261730d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java
@@ -27,6 +27,7 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
+import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.bcpg.HashAlgorithmTags;
import org.spongycastle.openpgp.PGPEncryptedData;
import org.sufficientlysecure.keychain.Constants;
@@ -88,10 +89,10 @@ public class PreferencesActivity extends PreferenceActivity {
(IntegerListPreference) findPreference(Constants.Pref.DEFAULT_ENCRYPTION_ALGORITHM));
int[] valueIds = new int[]{
- Constants.choice.compression.none,
- Constants.choice.compression.zip,
- Constants.choice.compression.zlib,
- Constants.choice.compression.bzip2,
+ CompressionAlgorithmTags.UNCOMPRESSED,
+ CompressionAlgorithmTags.ZIP,
+ CompressionAlgorithmTags.ZLIB,
+ CompressionAlgorithmTags.BZIP2,
};
String[] entries = new String[]{
getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")",
@@ -232,10 +233,10 @@ public class PreferencesActivity extends PreferenceActivity {
(IntegerListPreference) findPreference(Constants.Pref.DEFAULT_ENCRYPTION_ALGORITHM));
int[] valueIds = new int[]{
- Constants.choice.compression.none,
- Constants.choice.compression.zip,
- Constants.choice.compression.zlib,
- Constants.choice.compression.bzip2,
+ CompressionAlgorithmTags.UNCOMPRESSED,
+ CompressionAlgorithmTags.ZIP,
+ CompressionAlgorithmTags.ZLIB,
+ CompressionAlgorithmTags.BZIP2,
};
String[] entries = new String[]{
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/AlgorithmNames.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/AlgorithmNames.java
index 2499f2571..9acc7a73b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/AlgorithmNames.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/AlgorithmNames.java
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.util;
import android.annotation.SuppressLint;
import android.app.Activity;
+import org.spongycastle.bcpg.CompressionAlgorithmTags;
import org.spongycastle.bcpg.HashAlgorithmTags;
import org.spongycastle.openpgp.PGPEncryptedData;
import org.sufficientlysecure.keychain.Constants;
@@ -57,13 +58,13 @@ public class AlgorithmNames {
mHashNames.put(HashAlgorithmTags.SHA384, "SHA-384");
mHashNames.put(HashAlgorithmTags.SHA512, "SHA-512");
- mCompressionNames.put(Constants.choice.compression.none, mActivity.getString(R.string.choice_none)
+ mCompressionNames.put(CompressionAlgorithmTags.UNCOMPRESSED, mActivity.getString(R.string.choice_none)
+ " (" + mActivity.getString(R.string.compression_fast) + ")");
- mCompressionNames.put(Constants.choice.compression.zip,
+ mCompressionNames.put(CompressionAlgorithmTags.ZIP,
"ZIP (" + mActivity.getString(R.string.compression_fast) + ")");
- mCompressionNames.put(Constants.choice.compression.zlib,
+ mCompressionNames.put(CompressionAlgorithmTags.ZLIB,
"ZLIB (" + mActivity.getString(R.string.compression_fast) + ")");
- mCompressionNames.put(Constants.choice.compression.bzip2,
+ mCompressionNames.put(CompressionAlgorithmTags.BZIP2,
"BZIP2 (" + mActivity.getString(R.string.compression_very_slow) + ")");
}
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 3debd9083..09a88f4d9 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -87,7 +87,7 @@
PassphraseRepeat PassphraseAlgorithm
- ASCII Armor
+ File ASCII ArmorFiles: ASCII ArmorLet others know that you\'re using OpenKeychainWrites \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys
--
cgit v1.2.3
From 9b1efdcdada8cfd16a1f4d75f7e2af25bf3bf1ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Wed, 6 Aug 2014 00:20:08 +0200
Subject: Start with changelog
---
CHANGELOG | 188 +++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 101 insertions(+), 87 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 893082aa4..6490ac18f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,17 @@
+2.8
+* So many bugs have been fixed in this release that we focus on the main new features
+* Key edit: awesome new design, key revocation
+* Key import: awesome new design, secure keyserver connections via hkps, keyserver resolving via DNS SRV records
+* New first time screen
+* New create key screen: autocompletion of name and email based on your personal Android accounts
+* File encryption: awesome new design, support for encrypting multiple files
+* New icons to show status of key
+* Important bug fix: Importing of large key collections from a file is now possible
+* Notification showing cached passphrases
+
+This release wouldn't be possible without the work of Vincent Breitmoser (GSoC 2014), mar-v-in (GSoC 2014), Daniel Albert, Art O Cathain, Daniel Haß, Tim Bray, Thialfihar
+
+
2.7
* Purple! (Dominik, Vincent)
* New key view design (Dominik, Vincent)
@@ -6,50 +20,50 @@
* Keybase.io import (Tim Bray)
2.6.1
-* some fixes for regression bugs
+* Some fixes for regression bugs
2.6
-* key certifications (thanks to Vincent Breitmoser)
-* support for GnuPG partial secret keys (thanks to Vincent Breitmoser)
-* new design for signature verification
-* custom key length (thanks to Greg Witczak)
-* fix share-functionality from other apps
+* Key certifications (thanks to Vincent Breitmoser)
+* Support for GnuPG partial secret keys (thanks to Vincent Breitmoser)
+* New design for signature verification
+* Custom key length (thanks to Greg Witczak)
+* Fix share-functionality from other apps
2.5
-* fix decryption of symmetric pgp messages/files
-* refactored edit key screen (thanks to Ash Hughes)
-* new modern design for encrypt/decrypt screens
+* Fix decryption of symmetric pgp messages/files
+* Refactored edit key screen (thanks to Ash Hughes)
+* New modern design for encrypt/decrypt screens
* OpenPGP API version 3 (multiple api accounts, internal fixes, key lookup)
2.4
Thanks to all applicants of Google Summer of Code 2014 who made this release feature rich and bug free!
Besides several small patches, a notable number of patches are made by the following people (in alphabetical order):
Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Paul Sarbinowski, Sreeram Boyapati, Vincent Breitmoser.
-* new unified key list
-* colorized key fingerprint
-* support for keyserver ports
-* deactivate possibility to generate weak keys
-* much more internal work on the API
-* certify user ids
-* keyserver query based on machine-readable output
-* lock navigation drawer on tablets
-* suggestions for emails on creation of keys
-* search in public key lists
-* and much more improvements and fixes…
+* New unified key list
+* Colorized key fingerprint
+* Support for keyserver ports
+* Deactivate possibility to generate weak keys
+* Much more internal work on the API
+* Certify user ids
+* Keyserver query based on machine-readable output
+* Lock navigation drawer on tablets
+* Suggestions for emails on creation of keys
+* Search in public key lists
+* And much more improvements and fixes…
2.3.1
-* hotfix for crash when upgrading from old versions
+* Hotfix for crash when upgrading from old versions
2.3
-* remove unnecessary export of public keys when exporting secret key (thanks to Ash Hughes)
-* fix setting expiry dates on keys (thanks to Ash Hughes)
-* more internal fixes when editing keys (thanks to Ash Hughes)
-* querying keyservers directly from the import screen
-* fix layout and dialog style on Android 2.2-3.0
-* fix crash on keys with empty user ids
-* fix crash and empty lists when coming back from signing screen
+* Remove unnecessary export of public keys when exporting secret key (thanks to Ash Hughes)
+* Fix setting expiry dates on keys (thanks to Ash Hughes)
+* More internal fixes when editing keys (thanks to Ash Hughes)
+* Querying keyservers directly from the import screen
+* Fix layout and dialog style on Android 2.2-3.0
+* Fix crash on keys with empty user ids
+* Fix crash and empty lists when coming back from signing screen
* Bouncy Castle (cryptography library) updated from 1.47 to 1.50 and build from source
-* fix upload of key from signing screen
+* Fix upload of key from signing screen
2.2
* New design with navigation drawer
@@ -76,110 +90,110 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
* New AIDL API
1.0.8
-* basic keyserver support (HKP, please report bugs :))
-* app2sd (untested, let me know if there are problems)
-* more choices for pass phrase cache: 1, 2, 4, 8, hours
-* translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)
-* bugfixes
-* optimizations
+* Basic keyserver support (HKP, please report bugs :))
+* App2sd (untested, let me know if there are problems)
+* More choices for pass phrase cache: 1, 2, 4, 8, hours
+* Translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)
+* Bugfixes
+* Optimizations
1.0.7
-* clear sign problem with lacking trailing newline fixed
-* more options for pass phrase cache time to live (20, 40, 60 mins)
+* Clear sign problem with lacking trailing newline fixed
+* More options for pass phrase cache time to live (20, 40, 60 mins)
1.0.6
-* account adding crash on Froyo fixed
-* secure file deletion
-* option to delete key file after import
-* stream encryption/decryption (gallery, etc.)
-* new options (language, force v3 signatures)
-* interface changes
-* bugfixes
+* Account adding crash on Froyo fixed
+* Secure file deletion
+* Option to delete key file after import
+* Stream encryption/decryption (gallery, etc.)
+* New options (language, force v3 signatures)
+* Interface changes
+* Bugfixes
1.0.5
* German and Italian translation
-* much smaller package, due to reduced BC sources
-* new preferences GUI
-* layout adjustment for localization
-* signature bugfix
+* Much smaller package, due to reduced BC sources
+* New preferences GUI
+* Layout adjustment for localization
+* Signature bugfix
1.0.4
-* fixed another crash caused by some SDK bug with query builder
+* Fixed another crash caused by some SDK bug with query builder
1.0.3
-* fixed crashes during encryption/signing and possibly key export
+* Fixed crashes during encryption/signing and possibly key export
1.0.2
-* filterable key lists
-* smarter preselection of encryption keys
-* new Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers
-* fixes and additional features (key preselection) for k9, new beta build available
+* Filterable key lists
+* Smarter preselection of encryption keys
+* New Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers
+* Fixes and additional features (key preselection) for k9, new beta build available
1.0.1
* GMail account listing was broken in 1.0.0, fixed again
1.0.0
-* k9mail integration, APG supporting beta build of k9mail
-* support of more file managers (including ASTRO)
+* K-9 Mail integration, APG supporting beta build of K-9 Mail
+* Support of more file managers (including ASTRO)
* Slovenian translation
-* new database, much faster, less memory usage
-* defined Intents and content provider for other apps
-* bugfixes
+* New database, much faster, less memory usage
+* Defined Intents and content provider for other apps
+* Bugfixes
0.9.7
* 0.9.5 must have introduced a bug that prevented symmetric encryption, this release fixes it
0.9.6
-* finally fixed that bug that prevents the import of keys exported with Enigmail (and others), since this likely affects many users... it gets its own quick release
+* Finally fixed that bug that prevents the import of keys exported with Enigmail (and others), since this likely affects many users... it gets its own quick release
0.9.5
-* k9mail integration: using "More -> Forward (alternate)"
-* pass phrase cache
-* compression preferences added
-* accurate decryption progress bar
-* internationalization prepared, hopefully translations will follow
+* K-9 Mail integration: using "More -> Forward (alternate)"
+* Passphrase cache
+* Compression preferences added
+* Accurate decryption progress bar
+* Internationalization prepared, hopefully translations will follow
0.9.4
* Android 1.5 support, I *hope*, please report problems with layout and graphics
-* yet another interface change, hopefully this will be it :)
-* symmetric encryption for messages
-* encrypt and decrypt processes all wrapped into ONE activity respectively in preparation for defined Intents to use APG in other apps
+* Yet another interface change, hopefully this will be it :)
+* Symmetric encryption for messages
+* Encrypt and decrypt processes all wrapped into ONE activity respectively in preparation for defined Intents to use APG in other apps
0.9.3
-* handle large files correctly
-* better progress bars (especially for file encryption/decryption)
-* option to delete files after en-/decryption
-* bug fixes, layout tweaks
+* Handle large files correctly
+* Better progress bars (especially for file encryption/decryption)
+* Option to delete files after en-/decryption
+* Bug fixes, layout tweaks
0.9.2
-* settings for default encryption/hash algorithm
-* hushmail key support
+* Settings for default encryption/hash algorithm
+* Hushmail key support
* GUI improvements (encrypt file layout rewritten)
-* bug fixes
+* Bug fixes
0.9.1
* ElGamal support for subkeys
-* fixes of some silly 0.9.0 bugs
+* Fixes of some silly 0.9.0 bugs
0.9.0
* OI File Manager support
-* file encryption/decryption
+* File encryption/decryption
0.8.1
-* display/verify signed-only mails
-* bug fixes, layout fixes
+* Display/verify signed-only mails
+* Bug fixes, layout fixes
0.8.0
-* create/edit keys
-* export keys
+* Create/edit keys
+* Export keys
* GUI more Android-like
-* a lot of code review, rewriting things
-* tidy up strings and error handling
+* A lot of code review, rewriting things
+* Tidy up strings and error handling
0.7.1
-* minor fixes, some code review
-* recognize ElGamal encryption keys as suitable for encryption
-* allow signing only
+* Minor fixes, some code review
+* Recognize ElGamal encryption keys as suitable for encryption
+* Allow signing only
0.7.0
-* initial public release
\ No newline at end of file
+* Initial public release
\ No newline at end of file
--
cgit v1.2.3
From 8b0c389b1b2653efb862b279b4f120a8c2c10adb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Wed, 6 Aug 2014 00:32:04 +0200
Subject: Update changelog and about
---
OpenKeychain/src/main/res/raw/help_about.html | 29 ++--
OpenKeychain/src/main/res/raw/help_changelog.html | 164 ++++++++++++----------
2 files changed, 104 insertions(+), 89 deletions(-)
diff --git a/OpenKeychain/src/main/res/raw/help_about.html b/OpenKeychain/src/main/res/raw/help_about.html
index a9178d515..580ac5865 100644
--- a/OpenKeychain/src/main/res/raw/help_about.html
+++ b/OpenKeychain/src/main/res/raw/help_about.html
@@ -9,40 +9,41 @@ And don't add newlines before or after p tags because of transifex -->
OpenKeychain is an OpenPGP implementation for Android.
diff --git a/OpenKeychain/src/main/res/raw/help_changelog.html b/OpenKeychain/src/main/res/raw/help_changelog.html
index 779aa696f..681aa305b 100644
--- a/OpenKeychain/src/main/res/raw/help_changelog.html
+++ b/OpenKeychain/src/main/res/raw/help_changelog.html
@@ -5,6 +5,20 @@ And don't add newlines before or after p tags because of transifex -->
+
2.8
+
+
So many bugs have been fixed in this release that we focus on the main new features
+
Key edit: awesome new design, key revocation
+
Key import: awesome new design, secure keyserver connections via hkps, keyserver resolving via DNS SRV records
+
New first time screen
+
New create key screen: autocompletion of name and email based on your personal Android accounts
+
File encryption: awesome new design, support for encrypting multiple files
+
New icons to show status of key
+
Important bug fix: Importing of large key collections from a file is now possible
+
Notification showing cached passphrases
+
+
This release wouldn't be possible without the work of Vincent Breitmoser (GSoC 2014), mar-v-in (GSoC 2014), Daniel Albert, Art O Cathain, Daniel Haß, Tim Bray, Thialfihar
+
2.7
Purple! (Dominik, Vincent)
@@ -16,23 +30,23 @@ And don't add newlines before or after p tags because of transifex -->
2.6.1
-
some fixes for regression bugs
+
Some fixes for regression bugs
2.6
-
key certifications (thanks to Vincent Breitmoser)
-
support for GnuPG partial secret keys (thanks to Vincent Breitmoser)
-
new design for signature verification
-
custom key length (thanks to Greg Witczak)
-
fix share-functionality from other apps
+
Key certifications (thanks to Vincent Breitmoser)
+
Support for GnuPG partial secret keys (thanks to Vincent Breitmoser)
+
New design for signature verification
+
Custom key length (thanks to Greg Witczak)
+
Fix share-functionality from other apps
2.5
-
fix decryption of symmetric pgp messages/files
-
refactored edit key screen (thanks to Ash Hughes)
-
new modern design for encrypt/decrypt screens
+
Fix decryption of symmetric pgp messages/files
+
Refactored edit key screen (thanks to Ash Hughes)
+
New modern design for encrypt/decrypt screens
OpenPGP API version 3 (multiple api accounts, internal fixes, key lookup)
@@ -41,48 +55,48 @@ And don't add newlines before or after p tags because of transifex -->
Besides several small patches, a notable number of patches are made by the following people (in alphabetical order):
Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Paul Sarbinowski, Sreeram Boyapati, Vincent Breitmoser.
-
new unified key list
-
colorized key fingerprint
-
support for keyserver ports
-
deactivate possibility to generate weak keys
-
much more internal work on the API
-
certify user ids
-
keyserver query based on machine-readable output
-
lock navigation drawer on tablets
-
suggestions for emails on creation of keys
-
search in public key lists
-
and much more improvements and fixes…
+
New unified key list
+
Colorized key fingerprint
+
Support for keyserver ports
+
Deactivate possibility to generate weak keys
+
Much more internal work on the API
+
Certify user ids
+
Keyserver query based on machine-readable output
+
Lock navigation drawer on tablets
+
Suggestions for emails on creation of keys
+
Search in public key lists
+
And much more improvements and fixes…
2.3.1
-
hotfix for crash when upgrading from old versions
+
Hotfix for crash when upgrading from old versions
2.3
-
remove unnecessary export of public keys when exporting secret key (thanks to Ash Hughes)
-
fix setting expiry dates on keys (thanks to Ash Hughes)
-
more internal fixes when editing keys (thanks to Ash Hughes)
-
querying keyservers directly from the import screen
-
fix layout and dialog style on Android 2.2-3.0
-
fix crash on keys with empty user ids
-
fix crash and empty lists when coming back from signing screen
+
Remove unnecessary export of public keys when exporting secret key (thanks to Ash Hughes)
+
Fix setting expiry dates on keys (thanks to Ash Hughes)
+
More internal fixes when editing keys (thanks to Ash Hughes)
+
Querying keyservers directly from the import screen
+
Fix layout and dialog style on Android 2.2-3.0
+
Fix crash on keys with empty user ids
+
Fix crash and empty lists when coming back from signing screen
Bouncy Castle (cryptography library) updated from 1.47 to 1.50 and build from source
-
fix upload of key from signing screen
+
Fix upload of key from signing screen
2.2
-
new design with navigation drawer
-
new public key list design
-
new public key view
-
bug fixes for importing of keys
-
key cross-certification (thanks to Ash Hughes)
-
handle UTF-8 passwords properly (thanks to Ash Hughes)
-
first version with new languages (thanks to the contributors on Transifex)
-
sharing of keys via QR Codes fixed and improved
-
package signature verification for API
+
New design with navigation drawer
+
New public key list design
+
New public key view
+
Bug fixes for importing of keys
+
Key cross-certification (thanks to Ash Hughes)
+
Handle UTF-8 passwords properly (thanks to Ash Hughes)
+
First version with new languages (thanks to the contributors on Transifex)
+
Sharing of keys via QR Codes fixed and improved
+
Package signature verification for API
2.1.1
@@ -92,73 +106,73 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
2.1
-
lots of bug fixes
-
new API for developers
+
Lots of bug fixes
+
New API for developers
PRNG bug fix by Google
2.0
-
complete redesign
-
share public keys via qr codes, nfc beam
-
sign keys
-
upload keys to server
-
fixes import issues
-
new AIDL API
+
Complete redesign
+
Share public keys via qr codes, nfc beam
+
Sign keys
+
Upload keys to server
+
Fixes import issues
+
New AIDL API
1.0.8
-
basic keyserver support
-
app2sd
-
more choices for pass phrase cache: 1, 2, 4, 8, hours
-
translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)
-
bugfixes
-
optimizations
+
Basic keyserver support
+
App2sd
+
More choices for pass phrase cache: 1, 2, 4, 8, hours
+
Translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)
+
Bugfixes
+
Optimizations
1.0.7
-
fixed problem with signature verification of texts with trailing newline
-
more options for pass phrase cache time to live (20, 40, 60 mins)
+
Fixed problem with signature verification of texts with trailing newline
+
More options for pass phrase cache time to live (20, 40, 60 mins)
1.0.6
-
account adding crash on Froyo fixed
-
secure file deletion
-
option to delete key file after import
-
stream encryption/decryption (gallery, etc.)
-
new options (language, force v3 signatures)
-
interface changes
-
bugfixes
+
Account adding crash on Froyo fixed
+
Secure file deletion
+
Option to delete key file after import
+
Stream encryption/decryption (gallery, etc.)
+
New options (language, force v3 signatures)
+
Interface changes
+
Bugfixes
1.0.5
German and Italian translation
-
much smaller package, due to reduced BC sources
-
new preferences GUI
-
layout adjustment for localization
-
signature bugfix
+
Much smaller package, due to reduced BC sources
+
New preferences GUI
+
Layout adjustment for localization
+
Signature bugfix
1.0.4
-
fixed another crash caused by some SDK bug with query builder
+
Fixed another crash caused by some SDK bug with query builder
1.0.3
-
fixed crashes during encryption/signing and possibly key export
+
Fixed crashes during encryption/signing and possibly key export
1.0.2
-
filterable key lists
-
smarter pre-selection of encryption keys
-
new Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers
-
fixes and additional features (key preselection) for K-9 Mail, new beta build available
+
Filterable key lists
+
Smarter pre-selection of encryption keys
+
New Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers
+
Fixes and additional features (key preselection) for K-9 Mail, new beta build available
1.0.1
@@ -169,11 +183,11 @@ Daniel Hammann, Daniel Haß, Greg Witczak, Miroojin Bakshi, Nikhil Peter Raj, Pa
1.0.0
K-9 Mail integration, APG supporting beta build of K-9 Mail
-
support of more file managers (including ASTRO)
+
Support of more file managers (including ASTRO)
Slovenian translation
-
new database, much faster, less memory usage
-
defined Intents and content provider for other apps
-
bugfixes
+
New database, much faster, less memory usage
+
Defined Intents and content provider for other apps
+
Bugfixes
\ No newline at end of file
--
cgit v1.2.3
From 6ba7536838b8fbc69684bec7c3e847afcb5e9d6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?=
Date: Wed, 6 Aug 2014 00:59:38 +0200
Subject: ModernPGP infos
---
CHANGELOG | 2 +-
OpenKeychain/src/main/res/raw/help_changelog.html | 2 +-
README.md | 7 +++----
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 6490ac18f..be5ea325c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,7 +5,7 @@
* New first time screen
* New create key screen: autocompletion of name and email based on your personal Android accounts
* File encryption: awesome new design, support for encrypting multiple files
-* New icons to show status of key
+* New icons to show status of key (by Brennan Novak)
* Important bug fix: Importing of large key collections from a file is now possible
* Notification showing cached passphrases
diff --git a/OpenKeychain/src/main/res/raw/help_changelog.html b/OpenKeychain/src/main/res/raw/help_changelog.html
index 681aa305b..b2c798615 100644
--- a/OpenKeychain/src/main/res/raw/help_changelog.html
+++ b/OpenKeychain/src/main/res/raw/help_changelog.html
@@ -13,7 +13,7 @@ And don't add newlines before or after p tags because of transifex -->
New first time screen
New create key screen: autocompletion of name and email based on your personal Android accounts
File encryption: awesome new design, support for encrypting multiple files
-
New icons to show status of key
+
New icons to show status of key (by Brennan Novak)
Important bug fix: Importing of large key collections from a file is now possible
Notification showing cached passphrases
diff --git a/README.md b/README.md
index 6743372ac..c91b2127e 100644
--- a/README.md
+++ b/README.md
@@ -220,10 +220,6 @@ Some parts and some libraries are Apache License v2, MIT X11 License (see below)
* StickyListHeaders
https://github.com/emilsjolander/StickyListHeaders
Apache License v2
-
-* Android-Bootstrap
- https://github.com/Bearded-Hen/Android-Bootstrap
- MIT License
### Images
* icon.svg
@@ -235,5 +231,8 @@ Some parts and some libraries are Apache License v2, MIT X11 License (see below)
* QR Code Actionbar icon
https://github.com/openintents/openintents/blob/master/extensions/qrcode_ext/icons/ic_menu_qr_code/ic_menu_qr_code_holo_light/ic_menu_qr_code.svg
+* Key status icons by the ModernPGP working group
+ https://github.com/ModernPGP
+
* Purple color scheme
http://android-holo-colors.com/
--
cgit v1.2.3