From f7216841e3bc95a19fc8cd38dc29f1ebd832fe60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 23 Feb 2014 17:29:11 +0100 Subject: Update help_start.html --- OpenPGP-Keychain/src/main/res/raw/help_start.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/raw/help_start.html b/OpenPGP-Keychain/src/main/res/raw/help_start.html index 6c8c49846..7afac0f08 100644 --- a/OpenPGP-Keychain/src/main/res/raw/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw/help_start.html @@ -17,7 +17,7 @@ And don't add newlines before or after p tags because of transifex -->

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

Translations

-

Help translating OpenKeychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

-- cgit v1.2.3 From 1f36238a1b8cbaaf3f2b1d03eb0c9f97e64889ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Sun, 23 Feb 2014 23:35:11 +0100 Subject: Replaced Toast with AppMsg in EncryptActivity --- .../keychain/ui/EncryptActivity.java | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 85bfba224..6db4aae90 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -63,6 +63,7 @@ import android.widget.Toast; import android.widget.ViewFlipper; import com.beardedhen.androidbootstrap.BootstrapButton; +import com.devspark.appmsg.AppMsg; public class EncryptActivity extends DrawerActivity { @@ -215,7 +216,8 @@ public class EncryptActivity extends DrawerActivity { // encrypt file based on Uri // get file path from uri - String path = FileHelper.getPath(this, uri); + //String path = FileHelper.getPath(this, uri); + String path = null; if (path != null) { mInputFilename = path; @@ -415,17 +417,17 @@ public class EncryptActivity extends DrawerActivity { mOutputFilename = guessOutputFilename(mInputFilename); if (mInputFilename.equals("")) { - Toast.makeText(this, R.string.no_file_selected, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show(); return; } if (!mInputFilename.startsWith("content")) { File file = new File(mInputFilename); if (!file.exists() || !file.isFile()) { - Toast.makeText( + AppMsg.makeText( this, getString(R.string.error_message, - getString(R.string.error_file_not_found)), Toast.LENGTH_SHORT) + getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT) .show(); return; } @@ -438,13 +440,13 @@ public class EncryptActivity extends DrawerActivity { String passPhrase = mPassPhrase.getText().toString(); String passPhraseAgain = mPassPhraseAgain.getText().toString(); if (!passPhrase.equals(passPhraseAgain)) { - Toast.makeText(this, R.string.passphrases_do_not_match, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show(); return; } gotPassPhrase = (passPhrase.length() != 0); if (!gotPassPhrase) { - Toast.makeText(this, R.string.passphrase_must_not_be_empty, Toast.LENGTH_SHORT) + AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT) .show(); return; } @@ -452,13 +454,13 @@ public class EncryptActivity extends DrawerActivity { boolean encryptIt = (mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0); // for now require at least one form of encryption for files if (!encryptIt && mEncryptTarget == Id.target.file) { - Toast.makeText(this, R.string.select_encryption_key, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.select_encryption_key, AppMsg.STYLE_ALERT).show(); return; } if (!encryptIt && mSecretKeyId == 0) { - Toast.makeText(this, R.string.select_encryption_or_signature_key, - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.select_encryption_or_signature_key, + AppMsg.STYLE_ALERT).show(); return; } @@ -618,8 +620,8 @@ public class EncryptActivity extends DrawerActivity { output = data.getString(KeychainIntentService.RESULT_ENCRYPTED_STRING); Log.d(Constants.TAG, "output: " + output); ClipboardReflection.copyToClipboard(EncryptActivity.this, output); - Toast.makeText(EncryptActivity.this, - R.string.encryption_to_clipboard_successful, Toast.LENGTH_SHORT) + AppMsg.makeText(EncryptActivity.this, + R.string.encryption_to_clipboard_successful, AppMsg.STYLE_INFO) .show(); break; @@ -640,8 +642,8 @@ public class EncryptActivity extends DrawerActivity { break; case Id.target.file: - Toast.makeText(EncryptActivity.this, R.string.encryption_successful, - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(EncryptActivity.this, R.string.encryption_successful, + AppMsg.STYLE_INFO).show(); if (mDeleteAfter.isChecked()) { // Create and show dialog to delete original file -- cgit v1.2.3 From e936a4762b4c6ed8153d216ab4655e251c4366f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Sun, 23 Feb 2014 23:50:55 +0100 Subject: Replaced Toast with AppMsg in EncryptActivity --- .../keychain/ui/EncryptActivity.java | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 6db4aae90..85bfba224 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -63,7 +63,6 @@ import android.widget.Toast; import android.widget.ViewFlipper; import com.beardedhen.androidbootstrap.BootstrapButton; -import com.devspark.appmsg.AppMsg; public class EncryptActivity extends DrawerActivity { @@ -216,8 +215,7 @@ public class EncryptActivity extends DrawerActivity { // encrypt file based on Uri // get file path from uri - //String path = FileHelper.getPath(this, uri); - String path = null; + String path = FileHelper.getPath(this, uri); if (path != null) { mInputFilename = path; @@ -417,17 +415,17 @@ public class EncryptActivity extends DrawerActivity { mOutputFilename = guessOutputFilename(mInputFilename); if (mInputFilename.equals("")) { - AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show(); + Toast.makeText(this, R.string.no_file_selected, Toast.LENGTH_SHORT).show(); return; } if (!mInputFilename.startsWith("content")) { File file = new File(mInputFilename); if (!file.exists() || !file.isFile()) { - AppMsg.makeText( + Toast.makeText( this, getString(R.string.error_message, - getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT) + getString(R.string.error_file_not_found)), Toast.LENGTH_SHORT) .show(); return; } @@ -440,13 +438,13 @@ public class EncryptActivity extends DrawerActivity { String passPhrase = mPassPhrase.getText().toString(); String passPhraseAgain = mPassPhraseAgain.getText().toString(); if (!passPhrase.equals(passPhraseAgain)) { - AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show(); + Toast.makeText(this, R.string.passphrases_do_not_match, Toast.LENGTH_SHORT).show(); return; } gotPassPhrase = (passPhrase.length() != 0); if (!gotPassPhrase) { - AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT) + Toast.makeText(this, R.string.passphrase_must_not_be_empty, Toast.LENGTH_SHORT) .show(); return; } @@ -454,13 +452,13 @@ public class EncryptActivity extends DrawerActivity { boolean encryptIt = (mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0); // for now require at least one form of encryption for files if (!encryptIt && mEncryptTarget == Id.target.file) { - AppMsg.makeText(this, R.string.select_encryption_key, AppMsg.STYLE_ALERT).show(); + Toast.makeText(this, R.string.select_encryption_key, Toast.LENGTH_SHORT).show(); return; } if (!encryptIt && mSecretKeyId == 0) { - AppMsg.makeText(this, R.string.select_encryption_or_signature_key, - AppMsg.STYLE_ALERT).show(); + Toast.makeText(this, R.string.select_encryption_or_signature_key, + Toast.LENGTH_SHORT).show(); return; } @@ -620,8 +618,8 @@ public class EncryptActivity extends DrawerActivity { output = data.getString(KeychainIntentService.RESULT_ENCRYPTED_STRING); Log.d(Constants.TAG, "output: " + output); ClipboardReflection.copyToClipboard(EncryptActivity.this, output); - AppMsg.makeText(EncryptActivity.this, - R.string.encryption_to_clipboard_successful, AppMsg.STYLE_INFO) + Toast.makeText(EncryptActivity.this, + R.string.encryption_to_clipboard_successful, Toast.LENGTH_SHORT) .show(); break; @@ -642,8 +640,8 @@ public class EncryptActivity extends DrawerActivity { break; case Id.target.file: - AppMsg.makeText(EncryptActivity.this, R.string.encryption_successful, - AppMsg.STYLE_INFO).show(); + Toast.makeText(EncryptActivity.this, R.string.encryption_successful, + Toast.LENGTH_SHORT).show(); if (mDeleteAfter.isChecked()) { // Create and show dialog to delete original file -- cgit v1.2.3 From 09e220eddd96be0995e300c92e6e1f1638ed9bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Sun, 23 Feb 2014 23:56:10 +0100 Subject: Revert "Replaced Toast with AppMsg in EncryptActivity" This reverts commit e936a4762b4c6ed8153d216ab4655e251c4366f3. --- .../keychain/ui/EncryptActivity.java | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 85bfba224..6db4aae90 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -63,6 +63,7 @@ import android.widget.Toast; import android.widget.ViewFlipper; import com.beardedhen.androidbootstrap.BootstrapButton; +import com.devspark.appmsg.AppMsg; public class EncryptActivity extends DrawerActivity { @@ -215,7 +216,8 @@ public class EncryptActivity extends DrawerActivity { // encrypt file based on Uri // get file path from uri - String path = FileHelper.getPath(this, uri); + //String path = FileHelper.getPath(this, uri); + String path = null; if (path != null) { mInputFilename = path; @@ -415,17 +417,17 @@ public class EncryptActivity extends DrawerActivity { mOutputFilename = guessOutputFilename(mInputFilename); if (mInputFilename.equals("")) { - Toast.makeText(this, R.string.no_file_selected, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show(); return; } if (!mInputFilename.startsWith("content")) { File file = new File(mInputFilename); if (!file.exists() || !file.isFile()) { - Toast.makeText( + AppMsg.makeText( this, getString(R.string.error_message, - getString(R.string.error_file_not_found)), Toast.LENGTH_SHORT) + getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT) .show(); return; } @@ -438,13 +440,13 @@ public class EncryptActivity extends DrawerActivity { String passPhrase = mPassPhrase.getText().toString(); String passPhraseAgain = mPassPhraseAgain.getText().toString(); if (!passPhrase.equals(passPhraseAgain)) { - Toast.makeText(this, R.string.passphrases_do_not_match, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show(); return; } gotPassPhrase = (passPhrase.length() != 0); if (!gotPassPhrase) { - Toast.makeText(this, R.string.passphrase_must_not_be_empty, Toast.LENGTH_SHORT) + AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT) .show(); return; } @@ -452,13 +454,13 @@ public class EncryptActivity extends DrawerActivity { boolean encryptIt = (mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0); // for now require at least one form of encryption for files if (!encryptIt && mEncryptTarget == Id.target.file) { - Toast.makeText(this, R.string.select_encryption_key, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.select_encryption_key, AppMsg.STYLE_ALERT).show(); return; } if (!encryptIt && mSecretKeyId == 0) { - Toast.makeText(this, R.string.select_encryption_or_signature_key, - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.select_encryption_or_signature_key, + AppMsg.STYLE_ALERT).show(); return; } @@ -618,8 +620,8 @@ public class EncryptActivity extends DrawerActivity { output = data.getString(KeychainIntentService.RESULT_ENCRYPTED_STRING); Log.d(Constants.TAG, "output: " + output); ClipboardReflection.copyToClipboard(EncryptActivity.this, output); - Toast.makeText(EncryptActivity.this, - R.string.encryption_to_clipboard_successful, Toast.LENGTH_SHORT) + AppMsg.makeText(EncryptActivity.this, + R.string.encryption_to_clipboard_successful, AppMsg.STYLE_INFO) .show(); break; @@ -640,8 +642,8 @@ public class EncryptActivity extends DrawerActivity { break; case Id.target.file: - Toast.makeText(EncryptActivity.this, R.string.encryption_successful, - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(EncryptActivity.this, R.string.encryption_successful, + AppMsg.STYLE_INFO).show(); if (mDeleteAfter.isChecked()) { // Create and show dialog to delete original file -- cgit v1.2.3 From 947b9902e5c394ef8c149c39c35fc31ca0ac80e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Sun, 23 Feb 2014 23:59:55 +0100 Subject: remove debug stuff --- .../main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 6db4aae90..9da6c1b9f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -216,8 +216,7 @@ public class EncryptActivity extends DrawerActivity { // encrypt file based on Uri // get file path from uri - //String path = FileHelper.getPath(this, uri); - String path = null; + String path = FileHelper.getPath(this, uri); if (path != null) { mInputFilename = path; -- cgit v1.2.3 From c7c45a80fa15651864d349b351d3ff0407c24b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 24 Feb 2014 01:24:46 +0100 Subject: fix signature passing and verify in demo --- .../keychain/service/remote/OpenPgpService.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index 34213bd3b..11b3b2f87 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -281,7 +281,8 @@ public class OpenPgpService extends RemoteService { // Get Input- and OutputStream from ParcelFileDescriptor InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(input); OutputStream os = new ParcelFileDescriptor.AutoCloseOutputStream(output); - OpenPgpSignatureResult sigResult = null; + + Bundle result = new Bundle(); try { // PGPUtil.getDecoderStream(is) @@ -403,9 +404,10 @@ public class OpenPgpService extends RemoteService { // byte[] outputBytes = ((ByteArrayOutputStream) outputStream).toByteArray(); + + // get signature informations from bundle boolean signature = outputBundle.getBoolean(KeychainIntentService.RESULT_SIGNATURE, false); - if (signature) { long signatureKeyId = outputBundle .getLong(KeychainIntentService.RESULT_SIGNATURE_KEY_ID, 0); @@ -425,17 +427,16 @@ public class OpenPgpService extends RemoteService { signatureStatus = OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY; } - sigResult = new OpenPgpSignatureResult(signatureStatus, signatureUserId, + OpenPgpSignatureResult sigResult = new OpenPgpSignatureResult(signatureStatus, signatureUserId, signatureOnly, signatureKeyId); + result.putParcelable(OpenPgpConstants.RESULT_SIGNATURE, sigResult); } } finally { is.close(); os.close(); } - Bundle result = new Bundle(); result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_SUCCESS); - result.putParcelable(OpenPgpConstants.RESULT_SIGNATURE, sigResult); return result; } catch (Exception e) { Bundle result = new Bundle(); -- cgit v1.2.3 From 0747a5815f2c9875d0b0ffb6b88ea67b60c5003c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 24 Feb 2014 01:32:00 +0100 Subject: cleanup --- .../keychain/service/remote/OpenPgpService.java | 64 +++------------------- 1 file changed, 7 insertions(+), 57 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index 11b3b2f87..6d8a8beb3 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -285,51 +285,16 @@ public class OpenPgpService extends RemoteService { Bundle result = new Bundle(); try { -// PGPUtil.getDecoderStream(is) - // TODOs API 2.0: - // implement verify-only! + // TODO: // fix the mess: http://stackoverflow.com/questions/148130/how-do-i-peek-at-the-first-two-bytes-in-an-inputstream // should we allow to decrypt everything under every key id or only the one set? // TODO: instead of trying to get the passphrase before // pause stream when passphrase is missing and then resume - - // TODO: this is not really needed - // checked if it is text with BEGIN and END tags -// String message = new String(inputBytes); -// Log.d(Constants.TAG, "in: " + message); -// boolean signedOnly = false; -// Matcher matcher = PgpHelper.PGP_MESSAGE.matcher(message); -// if (matcher.matches()) { -// Log.d(Constants.TAG, "PGP_MESSAGE matched"); -// message = matcher.group(1); -// // replace non breakable spaces -// message = message.replaceAll("\\xa0", " "); -// -// // overwrite inputBytes -// inputBytes = message.getBytes(); -// } else { -// matcher = PgpHelper.PGP_SIGNED_MESSAGE.matcher(message); -// if (matcher.matches()) { -// signedOnly = true; -// Log.d(Constants.TAG, "PGP_SIGNED_MESSAGE matched"); -// message = matcher.group(1); -// // replace non breakable spaces -// message = message.replaceAll("\\xa0", " "); -// -// // overwrite inputBytes -// inputBytes = message.getBytes(); -// } else { -// Log.d(Constants.TAG, "Nothing matched! Binary?"); -// } -// } - // END TODO - -// Log.d(Constants.TAG, "in: " + new String(inputBytes)); + // TODO: put this code into PgpDecryptVerify class // TODO: This allows to decrypt messages with ALL secret keys, not only the one for the // app, Fix this? - // String passphrase = null; // if (!signedOnly) { // // BEGIN Get key @@ -377,36 +342,21 @@ public class OpenPgpService extends RemoteService { Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId()); return passphraseBundle; } -// } - // build InputData and write into OutputStream long inputLength = is.available(); InputData inputData = new InputData(is, inputLength); - Bundle outputBundle; PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder(this, inputData, os); -// if (signedOnly) { -// outputBundle = builder.build().verifyText(); -// } else { builder.assumeSymmetric(false) .passphrase(passphrase); - // Do we want to do this: instead of trying to get the passphrase before - // pause stream when passphrase is missing and then resume??? - - // TODO: this also decrypts with other secret keys without passphrase!!! + // TODO: this also decrypts with other secret keys that have no passphrase!!! outputBundle = builder.build().execute(); -// } - -// outputStream.close(); - -// byte[] outputBytes = ((ByteArrayOutputStream) outputStream).toByteArray(); - - - // get signature informations from bundle + //TODO: instead of using all these wrapping use OpenPgpSignatureResult directly + // in DecryptVerify class and then in DecryptActivity boolean signature = outputBundle.getBoolean(KeychainIntentService.RESULT_SIGNATURE, false); if (signature) { long signatureKeyId = outputBundle @@ -427,8 +377,8 @@ public class OpenPgpService extends RemoteService { signatureStatus = OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY; } - OpenPgpSignatureResult sigResult = new OpenPgpSignatureResult(signatureStatus, signatureUserId, - signatureOnly, signatureKeyId); + OpenPgpSignatureResult sigResult = new OpenPgpSignatureResult(signatureStatus, + signatureUserId, signatureOnly, signatureKeyId); result.putParcelable(OpenPgpConstants.RESULT_SIGNATURE, sigResult); } } finally { -- cgit v1.2.3 From 1351c6f804ac2ced8c135a7f83401956c2bcb44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Mon, 24 Feb 2014 22:02:32 +0100 Subject: Replaced Toast with AppMsg in DecryptActivity --- .../keychain/ui/DecryptActivity.java | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java index 652310cd2..9bb675db0 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java @@ -66,6 +66,7 @@ import android.widget.Toast; import android.widget.ViewFlipper; import com.beardedhen.androidbootstrap.BootstrapButton; +import com.devspark.appmsg.AppMsg; @SuppressLint("NewApi") public class DecryptActivity extends DrawerActivity { @@ -233,7 +234,7 @@ public class DecryptActivity extends DrawerActivity { if (matcher.matches()) { data = matcher.group(1); mMessage.setText(data); - Toast.makeText(this, R.string.using_clipboard_content, Toast.LENGTH_SHORT) + AppMsg.makeText(this, R.string.using_clipboard_content, AppMsg.STYLE_INFO) .show(); } } @@ -420,17 +421,17 @@ public class DecryptActivity extends DrawerActivity { } if (mInputFilename.equals("")) { - Toast.makeText(this, R.string.no_file_selected, Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, R.string.no_file_selected, AppMsg.STYLE_ALERT).show(); return; } if (mInputFilename.startsWith("file")) { File file = new File(mInputFilename); if (!file.exists() || !file.isFile()) { - Toast.makeText( + AppMsg.makeText( this, getString(R.string.error_message, - getString(R.string.error_file_not_found)), Toast.LENGTH_SHORT) + getString(R.string.error_file_not_found)), AppMsg.STYLE_ALERT) .show(); return; } @@ -510,14 +511,14 @@ public class DecryptActivity extends DrawerActivity { inStream = getContentResolver().openInputStream(mContentUri); } catch (FileNotFoundException e) { Log.e(Constants.TAG, "File not found!", e); - Toast.makeText(this, getString(R.string.error_file_not_found, e.getMessage()), - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, getString(R.string.error_file_not_found, e.getMessage()), + AppMsg.STYLE_ALERT).show(); } } else if (mDecryptTarget == Id.target.file) { // check if storage is ready if (!FileHelper.isStorageMounted(mInputFilename)) { - Toast.makeText(this, getString(R.string.error_external_storage_not_ready), - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, getString(R.string.error_external_storage_not_ready), + AppMsg.STYLE_ALERT).show(); return; } @@ -525,8 +526,8 @@ public class DecryptActivity extends DrawerActivity { inStream = new BufferedInputStream(new FileInputStream(mInputFilename)); } catch (FileNotFoundException e) { Log.e(Constants.TAG, "File not found!", e); - Toast.makeText(this, getString(R.string.error_file_not_found, e.getMessage()), - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, getString(R.string.error_file_not_found, e.getMessage()), + AppMsg.STYLE_ALERT).show(); } } else { inStream = new ByteArrayInputStream(mMessage.getText().toString().getBytes()); @@ -556,8 +557,8 @@ public class DecryptActivity extends DrawerActivity { mAssumeSymmetricEncryption = true; } } catch (Exception e) { - Toast.makeText(this, getString(R.string.error_message, e.getMessage()), - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(this, getString(R.string.error_message, e.getMessage()), + AppMsg.STYLE_ALERT).show(); } } @@ -655,8 +656,8 @@ public class DecryptActivity extends DrawerActivity { mSignatureKeyId = 0; mSignatureLayout.setVisibility(View.GONE); - Toast.makeText(DecryptActivity.this, R.string.decryption_successful, - Toast.LENGTH_SHORT).show(); + AppMsg.makeText(DecryptActivity.this, R.string.decryption_successful, + AppMsg.STYLE_INFO).show(); if (mReturnResult) { Intent intent = new Intent(); intent.putExtras(returnData); @@ -713,9 +714,9 @@ public class DecryptActivity extends DrawerActivity { .getBoolean(KeychainIntentService.RESULT_SIGNATURE_UNKNOWN)) { mSignatureStatusImage.setImageResource(R.drawable.overlay_error); mLookupKey.setVisibility(View.VISIBLE); - Toast.makeText(DecryptActivity.this, + AppMsg.makeText(DecryptActivity.this, R.string.unknown_signature, - Toast.LENGTH_LONG).show(); + AppMsg.STYLE_ALERT).show(); } else { mSignatureStatusImage.setImageResource(R.drawable.overlay_error); mLookupKey.setVisibility(View.GONE); -- cgit v1.2.3 From fc06f678c5155b06ef9d6ab320062c8ce4310ff5 Mon Sep 17 00:00:00 2001 From: Nikhil Peter Raj Date: Tue, 25 Feb 2014 22:45:29 +0530 Subject: Fix for #266 -Extra: Added the appropriate images to drawable folder from Android SDK source, can be used as alternative if required. --- .../keychain/ui/dialog/DeleteFileDialogFragment.java | 3 ++- .../keychain/ui/dialog/DeleteKeyDialogFragment.java | 2 +- OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db | Bin 0 -> 4608 bytes .../res/drawable-hdpi/ic_dialog_alert_holo_light.png | Bin 0 -> 1018 bytes OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db | Bin 0 -> 3584 bytes .../res/drawable-mdpi/ic_dialog_alert_holo_light.png | Bin 0 -> 770 bytes OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db | Bin 0 -> 5120 bytes .../res/drawable-xhdpi/ic_dialog_alert_holo_light.png | Bin 0 -> 1359 bytes OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db | Bin 0 -> 6144 bytes .../res/drawable-xxhdpi/ic_dialog_alert_holo_light.png | Bin 0 -> 1991 bytes 10 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db create mode 100644 OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_dialog_alert_holo_light.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db create mode 100644 OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_dialog_alert_holo_light.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_dialog_alert_holo_light.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_dialog_alert_holo_light.png (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java index f7e41daf7..4f2c44675 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java @@ -61,7 +61,8 @@ public class DeleteFileDialogFragment extends DialogFragment { AlertDialog.Builder alert = new AlertDialog.Builder(activity); - alert.setIcon(android.R.drawable.ic_dialog_alert); + + alert.setIconAttribute(android.R.attr.alertDialogIcon); alert.setTitle(R.string.warning); alert.setMessage(this.getString(R.string.file_delete_confirmation, deleteFile)); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java index 3c44bff81..5b20ddf15 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java @@ -100,7 +100,7 @@ public class DeleteKeyDialogFragment extends DialogFragment { builder.setMessage(R.string.key_deletion_confirmation_multi); } - builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setIconAttribute(android.R.attr.alertDialogIcon); builder.setPositiveButton(R.string.btn_delete, new DialogInterface.OnClickListener() { @Override diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db new file mode 100644 index 000000000..37eba349e Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_dialog_alert_holo_light.png b/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_dialog_alert_holo_light.png new file mode 100644 index 000000000..1374a53e5 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_dialog_alert_holo_light.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db new file mode 100644 index 000000000..824007986 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_dialog_alert_holo_light.png b/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_dialog_alert_holo_light.png new file mode 100644 index 000000000..9e7f0bd5f Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_dialog_alert_holo_light.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db new file mode 100644 index 000000000..e82c912ed Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_dialog_alert_holo_light.png b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_dialog_alert_holo_light.png new file mode 100644 index 000000000..a99f0621c Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_dialog_alert_holo_light.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db new file mode 100644 index 000000000..3375b7b80 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_dialog_alert_holo_light.png b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_dialog_alert_holo_light.png new file mode 100644 index 000000000..24ec28c2e Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_dialog_alert_holo_light.png differ -- cgit v1.2.3 From c77aff6fc2ee810531efc268b5b3003f3ac8a89a Mon Sep 17 00:00:00 2001 From: Nikhil Peter Raj Date: Tue, 25 Feb 2014 23:43:59 +0530 Subject: Removed Thumbs.db,added to gitignore --- OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db | Bin 4608 -> 0 bytes OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db | Bin 3584 -> 0 bytes OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db | Bin 5120 -> 0 bytes OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db | Bin 6144 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db delete mode 100644 OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db delete mode 100644 OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db delete mode 100644 OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db deleted file mode 100644 index 37eba349e..000000000 Binary files a/OpenPGP-Keychain/src/main/res/drawable-hdpi/Thumbs.db and /dev/null differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db deleted file mode 100644 index 824007986..000000000 Binary files a/OpenPGP-Keychain/src/main/res/drawable-mdpi/Thumbs.db and /dev/null differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db deleted file mode 100644 index e82c912ed..000000000 Binary files a/OpenPGP-Keychain/src/main/res/drawable-xhdpi/Thumbs.db and /dev/null differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db deleted file mode 100644 index 3375b7b80..000000000 Binary files a/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/Thumbs.db and /dev/null differ -- cgit v1.2.3 From fa6ea57121f86f9e898bd4a40b3306432e93b6b1 Mon Sep 17 00:00:00 2001 From: Nikhil Peter Raj Date: Wed, 26 Feb 2014 00:29:01 +0530 Subject: Final fix for #266 -Fix implemented using setIcon() as setIconAttribute() is not valid for API less than 11 --- .../sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java | 2 +- .../sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java index 4f2c44675..a859bb045 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java @@ -62,7 +62,7 @@ public class DeleteFileDialogFragment extends DialogFragment { AlertDialog.Builder alert = new AlertDialog.Builder(activity); - alert.setIconAttribute(android.R.attr.alertDialogIcon); + alert.setIcon(R.drawable.ic_dialog_alert_holo_light); alert.setTitle(R.string.warning); alert.setMessage(this.getString(R.string.file_delete_confirmation, deleteFile)); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java index 5b20ddf15..8a8c6a1d6 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java @@ -100,7 +100,7 @@ public class DeleteKeyDialogFragment extends DialogFragment { builder.setMessage(R.string.key_deletion_confirmation_multi); } - builder.setIconAttribute(android.R.attr.alertDialogIcon); + builder.setIcon(R.drawable.ic_dialog_alert_holo_light); builder.setPositiveButton(R.string.btn_delete, new DialogInterface.OnClickListener() { @Override -- cgit v1.2.3 From 5ddf001f9c6a4777082dfbe1648dd097f3d44318 Mon Sep 17 00:00:00 2001 From: Nikhil Peter Raj Date: Wed, 26 Feb 2014 11:33:39 +0530 Subject: Partial fix for #304 --- .../keychain/ui/ImportKeysActivity.java | 48 ++++++---------- .../ui/dialog/BadImportKeyDialogFragment.java | 66 ++++++++++++++++++++++ 2 files changed, 82 insertions(+), 32 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index a5027ac1c..5ac421a44 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -17,22 +17,9 @@ package org.sufficientlysecure.keychain.ui; -import java.util.ArrayList; -import java.util.Locale; - -import org.sufficientlysecure.keychain.Constants; -import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; -import org.sufficientlysecure.keychain.service.KeychainIntentService; -import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; -import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry; -import org.sufficientlysecure.keychain.util.Log; - import android.annotation.SuppressLint; -import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.nfc.NdefMessage; @@ -51,6 +38,18 @@ import android.widget.ArrayAdapter; import com.beardedhen.androidbootstrap.BootstrapButton; import com.devspark.appmsg.AppMsg; +import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; +import org.sufficientlysecure.keychain.service.KeychainIntentService; +import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; +import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry; +import org.sufficientlysecure.keychain.ui.dialog.BadImportKeyDialogFragment; +import org.sufficientlysecure.keychain.util.Log; + +import java.util.ArrayList; +import java.util.Locale; + public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNavigationListener { public static final String ACTION_IMPORT_KEY = Constants.INTENT_PREFIX + "IMPORT_KEY"; public static final String ACTION_IMPORT_KEY_FROM_QR_CODE = Constants.INTENT_PREFIX @@ -236,10 +235,10 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa * inside your Activity." *

* from http://stackoverflow.com/questions/10983396/fragment-oncreateview-and-onactivitycreated-called-twice/14295474#14295474 - * + *

* In our case, if we start ImportKeysActivity with parameters to directly search using a fingerprint, * the fragment would be loaded twice resulting in the query being empty after the second load. - * + *

* Our solution: * To prevent that a fragment will be loaded again even if it was already loaded loadNavFragment * checks against mCurrentNavPostition. @@ -395,23 +394,8 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa AppMsg.makeText(ImportKeysActivity.this, toastMessage, AppMsg.STYLE_INFO) .show(); if (bad > 0) { - AlertDialog.Builder alert = new AlertDialog.Builder( - ImportKeysActivity.this); - - alert.setIcon(android.R.drawable.ic_dialog_alert); - alert.setTitle(R.string.warning); - - alert.setMessage(ImportKeysActivity.this.getResources() - .getQuantityString(R.plurals.bad_keys_encountered, bad, bad)); - - alert.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - dialog.cancel(); - } - }); - alert.setCancelable(true); - alert.create().show(); + BadImportKeyDialogFragment badImportKeyDialogFragment = BadImportKeyDialogFragment.newInstance(bad); + badImportKeyDialogFragment.show(getSupportFragmentManager(), "badKeyDialog"); } } } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java new file mode 100644 index 000000000..72954b508 --- /dev/null +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java @@ -0,0 +1,66 @@ +package org.sufficientlysecure.keychain.ui.dialog; + + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import android.os.Bundle; +import android.support.v4.app.DialogFragment; +import android.support.v4.app.FragmentActivity; + +import org.sufficientlysecure.keychain.R; + + +/** + * Created by Haven on 26/2/14. + */ +public class BadImportKeyDialogFragment extends DialogFragment { + private static final String ARG_BAD_IMPORT = "bad_import"; + + + /** + * Creates a new instance of this Bad Import Key DialogFragment + * @param bad + * @return + */ + + public static BadImportKeyDialogFragment newInstance(int bad) { + BadImportKeyDialogFragment frag = new BadImportKeyDialogFragment(); + Bundle args = new Bundle(); + + args.putInt(ARG_BAD_IMPORT, bad); + frag.setArguments(args); + + + return frag; + } + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + + final FragmentActivity activity = getActivity(); + + final int badImport = getArguments().getInt(ARG_BAD_IMPORT); + + AlertDialog.Builder alert = new AlertDialog.Builder(activity); + + alert.setIcon(R.drawable.ic_dialog_alert_holo_light); + alert.setTitle(R.string.warning); + + alert.setMessage(activity.getResources() + .getQuantityString(R.plurals.bad_keys_encountered, badImport, badImport)); + + alert.setPositiveButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.cancel(); + } + }); + alert.setCancelable(true); + + + return alert.create(); + + + } +} -- cgit v1.2.3 From 9bbb286c5e5a15208a7fe0cb9a3c52c7c6c1c42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Wed, 26 Feb 2014 17:58:12 +0100 Subject: Added the AsyncTaskResultWrapper --- .../ui/adapter/AsyncTaskResultWrapper.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java new file mode 100644 index 000000000..518ff8f27 --- /dev/null +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java @@ -0,0 +1,38 @@ +/* + * 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.adapter; + +public class AsyncTaskResultWrapper { + + private final T result; + private final Exception error; + + public AsyncTaskResultWrapper(T result, Exception error){ + this.result = result; + this.error = error; + } + + public T getResult() { + return result; + } + + public Exception getError() { + return error; + } + +} -- cgit v1.2.3 From 5d1f61bff78e4f09eb18e5cc7020906af40655ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Wed, 26 Feb 2014 18:00:13 +0100 Subject: Reworked ImportKeysListFragment to handel exceptions, ImportKeyListLoader is temporarily disabled --- .../keychain/ui/ImportKeysListFragment.java | 33 +++++++++++++--------- .../ui/adapter/ImportKeysListServerLoader.java | 21 +++++++++----- 2 files changed, 34 insertions(+), 20 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java index b52de5bc9..e88df9e43 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java @@ -27,6 +27,7 @@ import java.util.List; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.helper.Preferences; +import org.sufficientlysecure.keychain.ui.adapter.AsyncTaskResultWrapper; import org.sufficientlysecure.keychain.ui.adapter.ImportKeysAdapter; import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry; import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListLoader; @@ -45,7 +46,7 @@ import android.widget.ListView; import android.widget.Toast; public class ImportKeysListFragment extends ListFragment implements - LoaderManager.LoaderCallbacks> { + LoaderManager.LoaderCallbacks>> { private static final String ARG_DATA_URI = "uri"; private static final String ARG_BYTES = "bytes"; private static final String ARG_SERVER_QUERY = "query"; @@ -181,12 +182,13 @@ public class ImportKeysListFragment extends ListFragment implements } @Override - public Loader> onCreateLoader(int id, Bundle args) { + public Loader>> onCreateLoader(int id, Bundle args) { switch (id) { case LOADER_ID_BYTES: { InputData inputData = getInputData(mKeyBytes, mDataUri); - return new ImportKeysListLoader(mActivity, inputData); + //TODO Rewrite ImportKeysListLoader + //return new ImportKeysListLoader(mActivity, inputData); } case LOADER_ID_SERVER_QUERY: { return new ImportKeysListServerLoader(getActivity(), mServerQuery, mKeyServer); @@ -198,15 +200,15 @@ public class ImportKeysListFragment extends ListFragment implements } @Override - public void onLoadFinished(Loader> loader, - List data) { + public void onLoadFinished(Loader>> loader, + AsyncTaskResultWrapper> data) { // Swap the new cursor in. (The framework will take care of closing the // old cursor once we return.) - Log.d(Constants.TAG, "data: " + data); + Log.d(Constants.TAG, "data: " + data.getResult()); // swap in the real data! - mAdapter.setData(data); + mAdapter.setData(data.getResult()); mAdapter.notifyDataSetChanged(); setListAdapter(mAdapter); @@ -222,11 +224,16 @@ public class ImportKeysListFragment extends ListFragment implements break; case LOADER_ID_SERVER_QUERY: - Toast.makeText( - getActivity(), getResources().getQuantityString(R.plurals.keys_found, - mAdapter.getCount(), mAdapter.getCount()), - Toast.LENGTH_SHORT - ).show(); + + if(data.getError() == null){ + Toast.makeText( + getActivity(), getResources().getQuantityString(R.plurals.keys_found, + mAdapter.getCount(), mAdapter.getCount()), + Toast.LENGTH_SHORT + ).show(); + } else { + Toast.makeText(getActivity(), "Server connection timed out!", Toast.LENGTH_SHORT).show(); + } break; default: @@ -235,7 +242,7 @@ public class ImportKeysListFragment extends ListFragment implements } @Override - public void onLoaderReset(Loader> loader) { + public void onLoaderReset(Loader>> loader) { switch (loader.getId()) { case LOADER_ID_BYTES: // Clear the data in the adapter. diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java index b3bc39127..c7f6eee32 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java @@ -28,13 +28,15 @@ import org.sufficientlysecure.keychain.util.Log; import java.util.ArrayList; import java.util.List; -public class ImportKeysListServerLoader extends AsyncTaskLoader> { +public class ImportKeysListServerLoader extends AsyncTaskLoader>> { Context mContext; String mServerQuery; String mKeyServer; - ArrayList data = new ArrayList(); + //ArrayList data = new ArrayList(); + ArrayList entryList = new ArrayList(); + AsyncTaskResultWrapper> entryListWrapper; public ImportKeysListServerLoader(Context context, String serverQuery, String keyServer) { super(context); @@ -44,15 +46,16 @@ public class ImportKeysListServerLoader extends AsyncTaskLoader loadInBackground() { + public AsyncTaskResultWrapper> loadInBackground() { if (mServerQuery == null) { Log.e(Constants.TAG, "mServerQuery is null!"); - return data; + entryListWrapper = new AsyncTaskResultWrapper>(entryList, null); + return entryListWrapper; } queryServer(mServerQuery, mKeyServer); - return data; + return entryListWrapper; } @Override @@ -74,7 +77,7 @@ public class ImportKeysListServerLoader extends AsyncTaskLoader data) { + public void deliverResult(AsyncTaskResultWrapper> data) { super.deliverResult(data); } @@ -87,13 +90,17 @@ public class ImportKeysListServerLoader extends AsyncTaskLoader searchResult = server.search(query); // add result to data - data.addAll(searchResult); + entryList.addAll(searchResult); + entryListWrapper = new AsyncTaskResultWrapper>(entryList, null); } catch (KeyServer.InsufficientQuery e) { Log.e(Constants.TAG, "InsufficientQuery", e); + entryListWrapper = new AsyncTaskResultWrapper>(entryList, e); } catch (KeyServer.QueryException e) { Log.e(Constants.TAG, "QueryException", e); + entryListWrapper = new AsyncTaskResultWrapper>(entryList, e); } catch (KeyServer.TooManyResponses e) { Log.e(Constants.TAG, "TooManyResponses", e); + entryListWrapper = new AsyncTaskResultWrapper>(entryList, e); } } -- cgit v1.2.3 From 20470748a971d819a64e842d2847891cbd63f72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Wed, 26 Feb 2014 19:16:28 +0100 Subject: Adapted the ImportKeysLoader to work with the new AsyncWrapper --- .../keychain/ui/ImportKeysListFragment.java | 4 +--- .../keychain/ui/adapter/ImportKeysListLoader.java | 14 +++++++++----- .../keychain/ui/adapter/ImportKeysListServerLoader.java | 4 +++- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java index e88df9e43..a11a78dd6 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java @@ -186,9 +186,7 @@ public class ImportKeysListFragment extends ListFragment implements switch (id) { case LOADER_ID_BYTES: { InputData inputData = getInputData(mKeyBytes, mDataUri); - - //TODO Rewrite ImportKeysListLoader - //return new ImportKeysListLoader(mActivity, inputData); + return new ImportKeysListLoader(mActivity, inputData); } case LOADER_ID_SERVER_QUERY: { return new ImportKeysListServerLoader(getActivity(), mServerQuery, mKeyServer); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java index 00ad8c957..29e418db7 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java @@ -33,12 +33,13 @@ import org.sufficientlysecure.keychain.util.PositionAwareInputStream; import android.content.Context; import android.support.v4.content.AsyncTaskLoader; -public class ImportKeysListLoader extends AsyncTaskLoader> { +public class ImportKeysListLoader extends AsyncTaskLoader>> { Context mContext; InputData mInputData; ArrayList data = new ArrayList(); + AsyncTaskResultWrapper> entryListWrapper; public ImportKeysListLoader(Context context, InputData inputData) { super(context); @@ -47,15 +48,18 @@ public class ImportKeysListLoader extends AsyncTaskLoader loadInBackground() { + public AsyncTaskResultWrapper> loadInBackground() { + + entryListWrapper = new AsyncTaskResultWrapper>(data, null); + if (mInputData == null) { Log.e(Constants.TAG, "Input data is null!"); - return data; + return entryListWrapper; } generateListOfKeyrings(mInputData); - return data; + return entryListWrapper; } @Override @@ -77,7 +81,7 @@ public class ImportKeysListLoader extends AsyncTaskLoader data) { + public void deliverResult(AsyncTaskResultWrapper> data) { super.deliverResult(data); } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java index c7f6eee32..78e4d23fb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java @@ -47,9 +47,11 @@ public class ImportKeysListServerLoader extends AsyncTaskLoader> loadInBackground() { + + entryListWrapper = new AsyncTaskResultWrapper>(entryList, null); + if (mServerQuery == null) { Log.e(Constants.TAG, "mServerQuery is null!"); - entryListWrapper = new AsyncTaskResultWrapper>(entryList, null); return entryListWrapper; } -- cgit v1.2.3 From c98a7d1977fbbc8e66d445b40fc56f2849d3fd95 Mon Sep 17 00:00:00 2001 From: Nikhil Peter Raj Date: Thu, 27 Feb 2014 00:56:33 +0530 Subject: Complete fix for #304 --- .../ui/dialog/CreateKeyDialogFragment.java | 147 +++++++++++++++++++++ .../keychain/ui/widget/SectionView.java | 117 ++++------------ 2 files changed, 170 insertions(+), 94 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java new file mode 100644 index 000000000..cfdf8a7e4 --- /dev/null +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java @@ -0,0 +1,147 @@ +package org.sufficientlysecure.keychain.ui.dialog; + +/** + * Created by Haven on 26/2/14. + */ + + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import android.os.Bundle; +import android.support.v4.app.DialogFragment; +import android.support.v4.app.FragmentActivity; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.Spinner; + +import org.sufficientlysecure.keychain.Id; +import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.util.Choice; + +import java.util.Vector; + +/** + * Created by Haven on 26/2/14. + */ +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 int mNewKeySize; + private Choice mNewKeyAlgorithmChoice; + private OnAlgorithmSelectedListener mAlgorithmSelectedListener; + + 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(); + + AlertDialog.Builder dialog = new AlertDialog.Builder(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); + + final Spinner algorithm = (Spinner) view.findViewById(R.id.create_key_algorithm); + Vector choices = new Vector(); + choices.add(new Choice(Id.choice.algorithm.dsa, getResources().getString( + R.string.dsa))); + if (!wouldBeMasterKey) { + choices.add(new Choice(Id.choice.algorithm.elgamal, getResources().getString( + R.string.elgamal))); + } + + choices.add(new Choice(Id.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); + algorithm.setAdapter(adapter); + // make RSA the default + for (int i = 0; i < choices.size(); ++i) { + if (choices.get(i).getId() == Id.choice.algorithm.rsa) { + algorithm.setSelection(i); + break; + } + } + + final Spinner keySize = (Spinner) view.findViewById(R.id.create_key_size); + ArrayAdapter keySizeAdapter = ArrayAdapter.createFromResource( + context, R.array.key_size_spinner_values, + android.R.layout.simple_spinner_item); + keySizeAdapter + .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + keySize.setAdapter(keySizeAdapter); + keySize.setSelection(3); // Default to 4096 for the key length + dialog.setPositiveButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface di, int id) { + di.dismiss(); + try { + int nKeyIndex = keySize.getSelectedItemPosition(); + switch (nKeyIndex) { + case 0: + mNewKeySize = 512; + break; + case 1: + mNewKeySize = 1024; + break; + case 2: + mNewKeySize = 2048; + break; + case 3: + mNewKeySize = 4096; + break; + } + } catch (NumberFormatException e) { + mNewKeySize = 0; + } + + mNewKeyAlgorithmChoice = (Choice) algorithm.getSelectedItem(); + mAlgorithmSelectedListener.onAlgorithmSelected(mNewKeyAlgorithmChoice, mNewKeySize); + } + }); + + dialog.setCancelable(true); + dialog.setNegativeButton(android.R.string.cancel, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface di, int id) { + di.dismiss(); + } + }); + + return dialog.create(); + + + } + +} \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java index 9d3643914..57865b032 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java @@ -16,23 +16,8 @@ package org.sufficientlysecure.keychain.ui.widget; -import java.util.Vector; - -import org.spongycastle.openpgp.PGPSecretKey; -import org.sufficientlysecure.keychain.Id; -import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; -import org.sufficientlysecure.keychain.service.KeychainIntentService; -import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; -import org.sufficientlysecure.keychain.service.PassphraseCacheService; -import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment; -import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener; -import org.sufficientlysecure.keychain.util.Choice; - -import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.os.Message; @@ -43,13 +28,25 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.ArrayAdapter; import android.widget.LinearLayout; -import android.widget.Spinner; import android.widget.TextView; import com.beardedhen.androidbootstrap.BootstrapButton; +import org.spongycastle.openpgp.PGPSecretKey; +import org.sufficientlysecure.keychain.Id; +import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; +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.ProgressDialogFragment; +import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener; +import org.sufficientlysecure.keychain.util.Choice; + +import java.util.Vector; + public class SectionView extends LinearLayout implements OnClickListener, EditorListener { private LayoutInflater mInflater; private BootstrapButton mPlusButton; @@ -149,84 +146,16 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor } case Id.type.key: { - AlertDialog.Builder dialog = new AlertDialog.Builder(getContext()); - - View view = mInflater.inflate(R.layout.create_key_dialog, null); - dialog.setView(view); - dialog.setTitle(R.string.title_create_key); - - boolean wouldBeMasterKey = (mEditors.getChildCount() == 0); - - final Spinner algorithm = (Spinner) view.findViewById(R.id.create_key_algorithm); - Vector choices = new Vector(); - choices.add(new Choice(Id.choice.algorithm.dsa, getResources().getString( - R.string.dsa))); - if (!wouldBeMasterKey) { - choices.add(new Choice(Id.choice.algorithm.elgamal, getResources().getString( - R.string.elgamal))); - } - - choices.add(new Choice(Id.choice.algorithm.rsa, getResources().getString( - R.string.rsa))); - - ArrayAdapter adapter = new ArrayAdapter(getContext(), - android.R.layout.simple_spinner_item, choices); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - algorithm.setAdapter(adapter); - // make RSA the default - for (int i = 0; i < choices.size(); ++i) { - if (choices.get(i).getId() == Id.choice.algorithm.rsa) { - algorithm.setSelection(i); - break; + CreateKeyDialogFragment mCreateKeyDialogFragment = CreateKeyDialogFragment.newInstance(mEditors.getChildCount()); + mCreateKeyDialogFragment.setOnAlgorithmSelectedListener(new CreateKeyDialogFragment.OnAlgorithmSelectedListener() { + @Override + public void onAlgorithmSelected(Choice algorithmChoice, int keySize) { + mNewKeyAlgorithmChoice = algorithmChoice; + mNewKeySize = keySize; + createKey(); } - } - - final Spinner keySize = (Spinner) view.findViewById(R.id.create_key_size); - ArrayAdapter keySizeAdapter = ArrayAdapter.createFromResource( - getContext(), R.array.key_size_spinner_values, - android.R.layout.simple_spinner_item); - keySizeAdapter - .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - keySize.setAdapter(keySizeAdapter); - keySize.setSelection(3); // Default to 4096 for the key length - dialog.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface di, int id) { - di.dismiss(); - try { - int nKeyIndex = keySize.getSelectedItemPosition(); - switch (nKeyIndex) { - case 0: - mNewKeySize = 512; - break; - case 1: - mNewKeySize = 1024; - break; - case 2: - mNewKeySize = 2048; - break; - case 3: - mNewKeySize = 4096; - break; - } - } catch (NumberFormatException e) { - mNewKeySize = 0; - } - - mNewKeyAlgorithmChoice = (Choice) algorithm.getSelectedItem(); - createKey(); - } - }); - - dialog.setCancelable(true); - dialog.setNegativeButton(android.R.string.cancel, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface di, int id) { - di.dismiss(); - } - }); - - dialog.create().show(); + }); + mCreateKeyDialogFragment.show(mActivity.getSupportFragmentManager(), "createKeyDialog"); break; } -- cgit v1.2.3 From 49769645a0f2a0e7369627f093c7971677676ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Thu, 27 Feb 2014 10:17:38 +0100 Subject: Added documentation to the AsyncTaskResultWrapper --- .../keychain/ui/adapter/AsyncTaskResultWrapper.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java index 518ff8f27..2914b1f01 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java @@ -17,6 +17,11 @@ package org.sufficientlysecure.keychain.ui.adapter; +/** + * The AsyncTaskResultWrapper is used to wrap a result from a AsyncTask (for example: Loader). + * You can pass the result and an exception in it if an error occurred. + * @param - Typ of the result which is wrapped + */ public class AsyncTaskResultWrapper { private final T result; -- cgit v1.2.3 From 2fa9067edb2b381acd71c34082c1be9c2246f9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Thu, 27 Feb 2014 10:20:24 +0100 Subject: Added StackOverflow link to documentation --- .../sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java index 2914b1f01..2ac19c1d9 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/AsyncTaskResultWrapper.java @@ -20,6 +20,8 @@ package org.sufficientlysecure.keychain.ui.adapter; /** * The AsyncTaskResultWrapper is used to wrap a result from a AsyncTask (for example: Loader). * You can pass the result and an exception in it if an error occurred. + * Concept found at: + * https://stackoverflow.com/questions/19593577/how-to-handle-errors-in-custom-asynctaskloader * @param - Typ of the result which is wrapped */ public class AsyncTaskResultWrapper { -- cgit v1.2.3 From 87af73977332b698c94d1ff8b3863cddc51840d5 Mon Sep 17 00:00:00 2001 From: Nikhil Peter Raj Date: Thu, 27 Feb 2014 18:09:47 +0530 Subject: Added GPL headers --- .../ui/dialog/BadImportKeyDialogFragment.java | 21 ++++++++++++++++----- .../keychain/ui/dialog/CreateKeyDialogFragment.java | 21 +++++++++++++++------ 2 files changed, 31 insertions(+), 11 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java index 72954b508..3300d67a5 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java @@ -1,5 +1,20 @@ package org.sufficientlysecure.keychain.ui.dialog; - +/* + * 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 . + */ import android.app.AlertDialog; import android.app.Dialog; @@ -10,10 +25,6 @@ import android.support.v4.app.FragmentActivity; import org.sufficientlysecure.keychain.R; - -/** - * Created by Haven on 26/2/14. - */ public class BadImportKeyDialogFragment extends DialogFragment { private static final String ARG_BAD_IMPORT = "bad_import"; diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java index cfdf8a7e4..9b6f6e5f9 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java @@ -1,10 +1,22 @@ package org.sufficientlysecure.keychain.ui.dialog; -/** - * Created by Haven on 26/2/14. +/* + * 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 . */ - import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; @@ -22,9 +34,6 @@ import org.sufficientlysecure.keychain.util.Choice; import java.util.Vector; -/** - * Created by Haven on 26/2/14. - */ public class CreateKeyDialogFragment extends DialogFragment { public interface OnAlgorithmSelectedListener { -- cgit v1.2.3 From 7bbfd9d446b49eec6d541787217bacbc4cb59b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 27 Feb 2014 16:55:42 +0100 Subject: cleanup --- .../ui/dialog/BadImportKeyDialogFragment.java | 17 ++++------------- .../keychain/ui/dialog/CreateKeyDialogFragment.java | 8 ++------ .../keychain/ui/dialog/DeleteKeyDialogFragment.java | 19 ++++++++----------- .../keychain/ui/dialog/ShareQrCodeDialogFragment.java | 18 ++++++++---------- 4 files changed, 22 insertions(+), 40 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java index 3300d67a5..2b8cba857 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/BadImportKeyDialogFragment.java @@ -1,4 +1,3 @@ -package org.sufficientlysecure.keychain.ui.dialog; /* * Copyright (C) 2012-2013 Dominik Schürmann * @@ -16,6 +15,8 @@ package org.sufficientlysecure.keychain.ui.dialog; * along with this program. If not, see . */ +package org.sufficientlysecure.keychain.ui.dialog; + import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; @@ -28,13 +29,12 @@ import org.sufficientlysecure.keychain.R; public class BadImportKeyDialogFragment extends DialogFragment { private static final String ARG_BAD_IMPORT = "bad_import"; - /** - * Creates a new instance of this Bad Import Key DialogFragment + * Creates a new instance of this Bad Import Key DialogFragment + * * @param bad * @return */ - public static BadImportKeyDialogFragment newInstance(int bad) { BadImportKeyDialogFragment frag = new BadImportKeyDialogFragment(); Bundle args = new Bundle(); @@ -42,25 +42,19 @@ public class BadImportKeyDialogFragment extends DialogFragment { args.putInt(ARG_BAD_IMPORT, bad); frag.setArguments(args); - return frag; } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - final FragmentActivity activity = getActivity(); - final int badImport = getArguments().getInt(ARG_BAD_IMPORT); AlertDialog.Builder alert = new AlertDialog.Builder(activity); - alert.setIcon(R.drawable.ic_dialog_alert_holo_light); alert.setTitle(R.string.warning); - alert.setMessage(activity.getResources() .getQuantityString(R.plurals.bad_keys_encountered, badImport, badImport)); - alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { @@ -69,9 +63,6 @@ public class BadImportKeyDialogFragment extends DialogFragment { }); alert.setCancelable(true); - return alert.create(); - - } } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java index 9b6f6e5f9..98b677511 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CreateKeyDialogFragment.java @@ -1,5 +1,3 @@ -package org.sufficientlysecure.keychain.ui.dialog; - /* * Copyright (C) 2012-2013 Dominik Schürmann * @@ -17,6 +15,8 @@ package org.sufficientlysecure.keychain.ui.dialog; * along with this program. If not, see . */ +package org.sufficientlysecure.keychain.ui.dialog; + import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; @@ -59,12 +59,10 @@ public class CreateKeyDialogFragment extends DialogFragment { frag.setArguments(args); return frag; - } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - final FragmentActivity context = getActivity(); final LayoutInflater mInflater; @@ -149,8 +147,6 @@ public class CreateKeyDialogFragment extends DialogFragment { }); return dialog.create(); - - } } \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java index 8a8c6a1d6..dc40bab2a 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteKeyDialogFragment.java @@ -17,17 +17,6 @@ package org.sufficientlysecure.keychain.ui.dialog; -import org.spongycastle.openpgp.PGPPublicKeyRing; -import org.spongycastle.openpgp.PGPSecretKeyRing; -import org.sufficientlysecure.keychain.Constants; -import org.sufficientlysecure.keychain.Id; -import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; -import org.sufficientlysecure.keychain.provider.KeychainContract; -import org.sufficientlysecure.keychain.provider.KeychainDatabase; -import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.util.Log; - import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; @@ -40,6 +29,14 @@ import android.os.RemoteException; import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentActivity; +import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.Id; +import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.provider.KeychainContract; +import org.sufficientlysecure.keychain.provider.KeychainDatabase; +import org.sufficientlysecure.keychain.provider.ProviderHelper; +import org.sufficientlysecure.keychain.util.Log; + import java.util.ArrayList; public class DeleteKeyDialogFragment extends DialogFragment { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java index 9f3270250..f26cd35c0 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java @@ -17,28 +17,26 @@ package org.sufficientlysecure.keychain.ui.dialog; -import java.util.ArrayList; - -import org.sufficientlysecure.keychain.Constants; -import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; -import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.util.Log; -import org.sufficientlysecure.keychain.util.QrCodeUtils; - import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.DialogFragment; -import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; +import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; +import org.sufficientlysecure.keychain.provider.ProviderHelper; +import org.sufficientlysecure.keychain.util.QrCodeUtils; + +import java.util.ArrayList; + public class ShareQrCodeDialogFragment extends DialogFragment { private static final String ARG_KEY_URI = "uri"; private static final String ARG_FINGERPRINT_ONLY = "fingerprint_only"; -- cgit v1.2.3 From c60ec7a8a7b80364d2cc92aeb60e0da5522e9e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Thu, 27 Feb 2014 22:10:07 +0100 Subject: Added error strings for key import from keyserver --- OpenPGP-Keychain/src/main/res/values/strings.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/values/strings.xml b/OpenPGP-Keychain/src/main/res/values/strings.xml index 178ef8f17..91359701f 100644 --- a/OpenPGP-Keychain/src/main/res/values/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values/strings.xml @@ -286,6 +286,9 @@ expiry date must come after creation date you can not delete this contact because it is your own. you can not delete the following contacts because they are your own:\n%s + Insufficient server query + Querying keyserver failed + Too many responses Please delete it from the \'My Keys\' screen! Please delete them from the \'My Keys\' screen! -- cgit v1.2.3 From 7e229d4247a4416150574669269b5f0409fc3ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Thu, 27 Feb 2014 22:15:50 +0100 Subject: Added different notifys for different exceptions --- .../keychain/ui/ImportKeysListFragment.java | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java index a11a78dd6..1118f0264 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java @@ -33,6 +33,7 @@ import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry; import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListLoader; import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListServerLoader; import org.sufficientlysecure.keychain.util.InputData; +import org.sufficientlysecure.keychain.util.KeyServer; import org.sufficientlysecure.keychain.util.Log; import android.app.Activity; @@ -43,7 +44,8 @@ import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; import android.view.View; import android.widget.ListView; -import android.widget.Toast; + +import com.devspark.appmsg.AppMsg; public class ImportKeysListFragment extends ListFragment implements LoaderManager.LoaderCallbacks>> { @@ -223,14 +225,23 @@ public class ImportKeysListFragment extends ListFragment implements case LOADER_ID_SERVER_QUERY: - if(data.getError() == null){ - Toast.makeText( + Exception error = data.getError(); + + if(error == null){ + AppMsg.makeText( getActivity(), getResources().getQuantityString(R.plurals.keys_found, mAdapter.getCount(), mAdapter.getCount()), - Toast.LENGTH_SHORT + AppMsg.STYLE_INFO ).show(); - } else { - Toast.makeText(getActivity(), "Server connection timed out!", Toast.LENGTH_SHORT).show(); + } else if(error instanceof KeyServer.InsufficientQuery){ + AppMsg.makeText(getActivity(), R.string.error_keyserver_insufficient_query, + AppMsg.STYLE_ALERT).show(); + }else if(error instanceof KeyServer.QueryException){ + AppMsg.makeText(getActivity(), R.string.error_keyserver_query, + AppMsg.STYLE_ALERT).show(); + }else if(error instanceof KeyServer.TooManyResponses){ + AppMsg.makeText(getActivity(), R.string.error_keyserver_too_many_responses, + AppMsg.STYLE_ALERT).show(); } break; -- cgit v1.2.3 From 414839b9155b03e3fd50d6d692cfda55e69897c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ha=C3=9F?= Date: Fri, 28 Feb 2014 22:43:31 +0100 Subject: Some clean up --- .../keychain/ui/adapter/ImportKeysListServerLoader.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java index 78e4d23fb..3a3b6e58b 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListServerLoader.java @@ -26,7 +26,6 @@ import org.sufficientlysecure.keychain.util.KeyServer; import org.sufficientlysecure.keychain.util.Log; import java.util.ArrayList; -import java.util.List; public class ImportKeysListServerLoader extends AsyncTaskLoader>> { Context mContext; @@ -34,9 +33,8 @@ public class ImportKeysListServerLoader extends AsyncTaskLoader data = new ArrayList(); - ArrayList entryList = new ArrayList(); - AsyncTaskResultWrapper> entryListWrapper; + private ArrayList entryList = new ArrayList(); + private AsyncTaskResultWrapper> entryListWrapper; public ImportKeysListServerLoader(Context context, String serverQuery, String keyServer) { super(context); -- cgit v1.2.3 From 4a13f70a88d64591eb878ea2a9ff70b062c7cc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 2 Mar 2014 01:20:06 +0100 Subject: API changes --- .../keychain/service/remote/OpenPgpService.java | 225 ++++++++++----------- .../keychain/service/remote/RemoteService.java | 30 ++- .../service/remote/RemoteServiceActivity.java | 37 ++-- 3 files changed, 132 insertions(+), 160 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index 6d8a8beb3..8c8e6f00a 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -28,7 +28,7 @@ import android.os.ParcelFileDescriptor; import org.openintents.openpgp.IOpenPgpService; import org.openintents.openpgp.OpenPgpError; import org.openintents.openpgp.OpenPgpSignatureResult; -import org.openintents.openpgp.util.OpenPgpConstants; +import org.openintents.openpgp.util.OpenPgpApi; import org.spongycastle.util.Arrays; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; @@ -48,7 +48,7 @@ public class OpenPgpService extends RemoteService { private static final int PRIVATE_REQUEST_CODE_PASSPHRASE = 551; private static final int PRIVATE_REQUEST_CODE_USER_IDS = 552; - + private static final int PRIVATE_REQUEST_CODE_GET_KEYS = 553; /** * Search database for key ids based on emails. @@ -56,7 +56,7 @@ public class OpenPgpService extends RemoteService { * @param encryptionUserIds * @return */ - private Bundle getKeyIdsFromEmails(Bundle params, String[] encryptionUserIds) { + private Intent getKeyIdsFromEmails(Intent data, String[] encryptionUserIds) { // find key ids to given emails in database ArrayList keyIds = new ArrayList(); @@ -91,20 +91,20 @@ public class OpenPgpService extends RemoteService { // allow the user to verify pub key selection if (missingUserIdsCheck || dublicateUserIdsCheck) { - // build PendingIntent for passphrase input + // build PendingIntent Intent intent = new Intent(getBaseContext(), RemoteServiceActivity.class); intent.setAction(RemoteServiceActivity.ACTION_SELECT_PUB_KEYS); intent.putExtra(RemoteServiceActivity.EXTRA_SELECTED_MASTER_KEY_IDS, keyIdsArray); intent.putExtra(RemoteServiceActivity.EXTRA_MISSING_USER_IDS, missingUserIds); intent.putExtra(RemoteServiceActivity.EXTRA_DUBLICATE_USER_IDS, dublicateUserIds); - intent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); + intent.putExtra(RemoteServiceActivity.EXTRA_DATA, data); PendingIntent pi = PendingIntent.getActivity(getBaseContext(), PRIVATE_REQUEST_CODE_USER_IDS, intent, 0); // return PendingIntent to be executed by client - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_USER_INTERACTION_REQUIRED); - result.putParcelable(OpenPgpConstants.RESULT_INTENT, pi); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); + result.putExtra(OpenPgpApi.RESULT_INTENT, pi); return result; } @@ -113,44 +113,44 @@ public class OpenPgpService extends RemoteService { return null; } - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_SUCCESS); - result.putLongArray(OpenPgpConstants.PARAMS_KEY_IDS, keyIdsArray); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); + result.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keyIdsArray); return result; } - private Bundle getPassphraseBundleIntent(Bundle params, long keyId) { + private Intent getPassphraseBundleIntent(Intent data, long keyId) { // build PendingIntent for passphrase input Intent intent = new Intent(getBaseContext(), RemoteServiceActivity.class); intent.setAction(RemoteServiceActivity.ACTION_CACHE_PASSPHRASE); intent.putExtra(RemoteServiceActivity.EXTRA_SECRET_KEY_ID, keyId); // pass params through to activity that it can be returned again later to repeat pgp operation - intent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); + intent.putExtra(RemoteServiceActivity.EXTRA_DATA, data); PendingIntent pi = PendingIntent.getActivity(getBaseContext(), PRIVATE_REQUEST_CODE_PASSPHRASE, intent, 0); // return PendingIntent to be executed by client - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_USER_INTERACTION_REQUIRED); - result.putParcelable(OpenPgpConstants.RESULT_INTENT, pi); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); + result.putExtra(OpenPgpApi.RESULT_INTENT, pi); return result; } - private Bundle signImpl(Bundle params, ParcelFileDescriptor input, ParcelFileDescriptor output, - AppSettings appSettings) { + private Intent signImpl(Intent data, ParcelFileDescriptor input, + ParcelFileDescriptor output, AppSettings appSettings) { try { - boolean asciiArmor = params.getBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR, true); + boolean asciiArmor = data.getBooleanExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); // get passphrase from cache, if key has "no" passphrase, this returns an empty String String passphrase; - if (params.containsKey(OpenPgpConstants.PARAMS_PASSPHRASE)) { - passphrase = params.getString(OpenPgpConstants.PARAMS_PASSPHRASE); + if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) { + passphrase = data.getStringExtra(OpenPgpApi.EXTRA_PASSPHRASE); } else { passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId()); } if (passphrase == null) { // get PendingIntent for passphrase input, add it to given params and return to client - Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId()); + Intent passphraseBundle = getPassphraseBundleIntent(data, appSettings.getKeyId()); return passphraseBundle; } @@ -174,43 +174,42 @@ public class OpenPgpService extends RemoteService { os.close(); } - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_SUCCESS); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); return result; } catch (Exception e) { - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } } - private Bundle encryptAndSignImpl(Bundle params, ParcelFileDescriptor input, - ParcelFileDescriptor output, AppSettings appSettings, - boolean sign) { + private Intent encryptAndSignImpl(Intent data, ParcelFileDescriptor input, + ParcelFileDescriptor output, AppSettings appSettings, boolean sign) { try { - boolean asciiArmor = params.getBoolean(OpenPgpConstants.PARAMS_REQUEST_ASCII_ARMOR, true); + boolean asciiArmor = data.getBooleanExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); long[] keyIds; - if (params.containsKey(OpenPgpConstants.PARAMS_KEY_IDS)) { - keyIds = params.getLongArray(OpenPgpConstants.PARAMS_KEY_IDS); - } else if (params.containsKey(OpenPgpConstants.PARAMS_USER_IDS)) { + if (data.hasExtra(OpenPgpApi.EXTRA_KEY_IDS)) { + keyIds = data.getLongArrayExtra(OpenPgpApi.EXTRA_KEY_IDS); + } else if (data.hasExtra(OpenPgpApi.EXTRA_USER_IDS)) { // get key ids based on given user ids - String[] userIds = params.getStringArray(OpenPgpConstants.PARAMS_USER_IDS); + String[] userIds = data.getStringArrayExtra(OpenPgpApi.EXTRA_USER_IDS); // give params through to activity... - Bundle result = getKeyIdsFromEmails(params, userIds); + Intent result = getKeyIdsFromEmails(data, userIds); - if (result.getInt(OpenPgpConstants.RESULT_CODE, 0) == OpenPgpConstants.RESULT_CODE_SUCCESS) { - keyIds = result.getLongArray(OpenPgpConstants.PARAMS_KEY_IDS); + if (result.getIntExtra(OpenPgpApi.RESULT_CODE, 0) == OpenPgpApi.RESULT_CODE_SUCCESS) { + keyIds = result.getLongArrayExtra(OpenPgpApi.EXTRA_KEY_IDS); } else { // if not success -> result contains a PendingIntent for user interaction return result; } } else { - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, new OpenPgpError(OpenPgpError.GENERIC_ERROR, "Missing parameter user_ids or key_ids!")); return result; } @@ -235,15 +234,15 @@ public class OpenPgpService extends RemoteService { if (sign) { String passphrase; - if (params.containsKey(OpenPgpConstants.PARAMS_PASSPHRASE)) { - passphrase = params.getString(OpenPgpConstants.PARAMS_PASSPHRASE); + if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) { + passphrase = data.getStringExtra(OpenPgpApi.EXTRA_PASSPHRASE); } else { passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId()); } if (passphrase == null) { // get PendingIntent for passphrase input, add it to given params and return to client - Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId()); + Intent passphraseBundle = getPassphraseBundleIntent(data, appSettings.getKeyId()); return passphraseBundle; } @@ -263,26 +262,26 @@ public class OpenPgpService extends RemoteService { os.close(); } - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_SUCCESS); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); return result; } catch (Exception e) { - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } } - private Bundle decryptAndVerifyImpl(Bundle params, ParcelFileDescriptor input, + private Intent decryptAndVerifyImpl(Intent data, ParcelFileDescriptor input, ParcelFileDescriptor output, AppSettings appSettings) { try { // Get Input- and OutputStream from ParcelFileDescriptor InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(input); OutputStream os = new ParcelFileDescriptor.AutoCloseOutputStream(output); - Bundle result = new Bundle(); + Intent result = new Intent(); try { // TODO: @@ -332,14 +331,14 @@ public class OpenPgpService extends RemoteService { // NOTE: currently this only gets the passphrase for the key set for this client String passphrase; - if (params.containsKey(OpenPgpConstants.PARAMS_PASSPHRASE)) { - passphrase = params.getString(OpenPgpConstants.PARAMS_PASSPHRASE); + if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) { + passphrase = data.getStringExtra(OpenPgpApi.EXTRA_PASSPHRASE); } else { passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId()); } if (passphrase == null) { // get PendingIntent for passphrase input, add it to given params and return to client - Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId()); + Intent passphraseBundle = getPassphraseBundleIntent(data, appSettings.getKeyId()); return passphraseBundle; } @@ -375,32 +374,46 @@ public class OpenPgpService extends RemoteService { signatureStatus = OpenPgpSignatureResult.SIGNATURE_SUCCESS_CERTIFIED; } else if (signatureUnknown) { signatureStatus = OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY; + + // If signature is unknown we return an additional PendingIntent + // to retrieve the missing key + // TODO!!! + Intent intent = new Intent(getBaseContext(), RemoteServiceActivity.class); + intent.setAction(RemoteServiceActivity.ACTION_ERROR_MESSAGE); + intent.putExtra(RemoteServiceActivity.EXTRA_ERROR_MESSAGE, "todo"); + intent.putExtra(RemoteServiceActivity.EXTRA_DATA, data); + + PendingIntent pi = PendingIntent.getActivity(getBaseContext(), + PRIVATE_REQUEST_CODE_GET_KEYS, intent, 0); + + result.putExtra(OpenPgpApi.RESULT_INTENT, pi); } + OpenPgpSignatureResult sigResult = new OpenPgpSignatureResult(signatureStatus, signatureUserId, signatureOnly, signatureKeyId); - result.putParcelable(OpenPgpConstants.RESULT_SIGNATURE, sigResult); + result.putExtra(OpenPgpApi.RESULT_SIGNATURE, sigResult); } } finally { is.close(); os.close(); } - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_SUCCESS); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); return result; } catch (Exception e) { - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } } - private Bundle getKeyIdsImpl(Bundle params) { + private Intent getKeyIdsImpl(Intent data) { // get key ids based on given user ids - String[] userIds = params.getStringArray(OpenPgpConstants.PARAMS_USER_IDS); - Bundle result = getKeyIdsFromEmails(params, userIds); + String[] userIds = data.getStringArrayExtra(OpenPgpApi.EXTRA_USER_IDS); + Intent result = getKeyIdsFromEmails(data, userIds); return result; } @@ -410,30 +423,30 @@ public class OpenPgpService extends RemoteService { * - has supported API version * - is allowed to call the service (access has been granted) * - * @param params + * @param data * @return null if everything is okay, or a Bundle with an error/PendingIntent */ - private Bundle checkRequirements(Bundle params) { + private Intent checkRequirements(Intent data) { // params Bundle is required! - if (params == null) { - Bundle result = new Bundle(); + if (data == null) { + Intent result = new Intent(); OpenPgpError error = new OpenPgpError(OpenPgpError.GENERIC_ERROR, "params Bundle required!"); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, error); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, error); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } // version code is required and needs to correspond to version code of service! - if (params.getInt(OpenPgpConstants.PARAMS_API_VERSION) != OpenPgpConstants.API_VERSION) { - Bundle result = new Bundle(); + if (data.getIntExtra(OpenPgpApi.EXTRA_API_VERSION, -1) != OpenPgpApi.API_VERSION) { + Intent result = new Intent(); OpenPgpError error = new OpenPgpError(OpenPgpError.INCOMPATIBLE_API_VERSIONS, "Incompatible API versions!"); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, error); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, error); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } // check if caller is allowed to access openpgp keychain - Bundle result = isAllowed(params); + Intent result = isAllowed(data); if (result != null) { return result; } @@ -445,61 +458,31 @@ public class OpenPgpService extends RemoteService { private final IOpenPgpService.Stub mBinder = new IOpenPgpService.Stub() { @Override - public Bundle sign(Bundle params, final ParcelFileDescriptor input, final ParcelFileDescriptor output) { - final AppSettings appSettings = getAppSettings(); - - Bundle errorResult = checkRequirements(params); - if (errorResult != null) { - return errorResult; - } - - return signImpl(params, input, output, appSettings); - } - - @Override - public Bundle encrypt(Bundle params, ParcelFileDescriptor input, ParcelFileDescriptor output) { - final AppSettings appSettings = getAppSettings(); - - Bundle errorResult = checkRequirements(params); + public Intent execute(Intent data, ParcelFileDescriptor input, ParcelFileDescriptor output) { + Intent errorResult = checkRequirements(data); if (errorResult != null) { return errorResult; } - return encryptAndSignImpl(params, input, output, appSettings, false); - } - - @Override - public Bundle signAndEncrypt(Bundle params, ParcelFileDescriptor input, ParcelFileDescriptor output) { final AppSettings appSettings = getAppSettings(); - Bundle errorResult = checkRequirements(params); - if (errorResult != null) { - return errorResult; - } - - return encryptAndSignImpl(params, input, output, appSettings, true); - } - - @Override - public Bundle decryptAndVerify(Bundle params, ParcelFileDescriptor input, ParcelFileDescriptor output) { - final AppSettings appSettings = getAppSettings(); - - Bundle errorResult = checkRequirements(params); - if (errorResult != null) { - return errorResult; - } - - return decryptAndVerifyImpl(params, input, output, appSettings); - } - - @Override - public Bundle getKeyIds(Bundle params) { - Bundle errorResult = checkRequirements(params); - if (errorResult != null) { - return errorResult; + String action = data.getAction(); + if (OpenPgpApi.ACTION_SIGN.equals(action)) { + return signImpl(data, input, output, appSettings); + } else if (OpenPgpApi.ACTION_ENCRYPT.equals(action)) { + return encryptAndSignImpl(data, input, output, appSettings, false); + } else if (OpenPgpApi.ACTION_SIGN_AND_ENCTYPT.equals(action)) { + return encryptAndSignImpl(data, input, output, appSettings, true); + } else if (OpenPgpApi.ACTION_DECRYPT_VERIFY.equals(action)) { + return decryptAndVerifyImpl(data, input, output, appSettings); + } else if (OpenPgpApi.ACTION_DOWNLOAD_KEYS.equals(action)) { + // TODO! + return null; + } else if (OpenPgpApi.ACTION_GET_KEY_IDS.equals(action)) { + return getKeyIdsImpl(data); + } else { + return null; } - - return getKeyIdsImpl(params); } }; diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java index cfd2b9ec3..e7b3b2945 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.Arrays; import org.openintents.openpgp.OpenPgpError; -import org.openintents.openpgp.util.OpenPgpConstants; +import org.openintents.openpgp.util.OpenPgpApi; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.provider.KeychainContract; @@ -38,10 +38,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; import android.net.Uri; import android.os.Binder; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.os.Messenger; /** * Abstract service class for remote APIs that handle app registration and user input. @@ -57,7 +53,7 @@ public abstract class RemoteService extends Service { return mContext; } - protected Bundle isAllowed(Bundle params) { + protected Intent isAllowed(Intent data) { try { if (isCallerAllowed(false)) { @@ -74,9 +70,9 @@ public abstract class RemoteService extends Service { } catch (NameNotFoundException e) { Log.e(Constants.TAG, "Should not happen, returning!", e); // return error - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_ERROR); - result.putParcelable(OpenPgpConstants.RESULT_ERRORS, + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); + result.putExtra(OpenPgpApi.RESULT_ERRORS, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } @@ -86,14 +82,14 @@ public abstract class RemoteService extends Service { intent.setAction(RemoteServiceActivity.ACTION_REGISTER); intent.putExtra(RemoteServiceActivity.EXTRA_PACKAGE_NAME, packageName); intent.putExtra(RemoteServiceActivity.EXTRA_PACKAGE_SIGNATURE, packageSignature); - intent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); + intent.putExtra(RemoteServiceActivity.EXTRA_DATA, data); PendingIntent pi = PendingIntent.getActivity(getBaseContext(), PRIVATE_REQUEST_CODE_REGISTER, intent, 0); // return PendingIntent to be executed by client - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_USER_INTERACTION_REQUIRED); - result.putParcelable(OpenPgpConstants.RESULT_INTENT, pi); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); + result.putExtra(OpenPgpApi.RESULT_INTENT, pi); return result; } @@ -103,14 +99,14 @@ public abstract class RemoteService extends Service { Intent intent = new Intent(getBaseContext(), RemoteServiceActivity.class); intent.setAction(RemoteServiceActivity.ACTION_ERROR_MESSAGE); intent.putExtra(RemoteServiceActivity.EXTRA_ERROR_MESSAGE, getString(R.string.api_error_wrong_signature)); - intent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); + intent.putExtra(RemoteServiceActivity.EXTRA_DATA, data); PendingIntent pi = PendingIntent.getActivity(getBaseContext(), PRIVATE_REQUEST_CODE_ERROR, intent, 0); // return PendingIntent to be executed by client - Bundle result = new Bundle(); - result.putInt(OpenPgpConstants.RESULT_CODE, OpenPgpConstants.RESULT_CODE_USER_INTERACTION_REQUIRED); - result.putParcelable(OpenPgpConstants.RESULT_INTENT, pi); + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); + result.putExtra(OpenPgpApi.RESULT_INTENT, pi); return result; } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteServiceActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteServiceActivity.java index af8e3ade8..11b3ee217 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteServiceActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteServiceActivity.java @@ -25,7 +25,7 @@ import android.os.Messenger; import android.support.v7.app.ActionBarActivity; import android.view.View; -import org.openintents.openpgp.util.OpenPgpConstants; +import org.openintents.openpgp.util.OpenPgpApi; import org.sufficientlysecure.htmltextview.HtmlTextView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; @@ -51,6 +51,8 @@ public class RemoteServiceActivity extends ActionBarActivity { public static final String EXTRA_MESSENGER = "messenger"; + public static final String EXTRA_DATA = "data"; + // passphrase action public static final String EXTRA_SECRET_KEY_ID = "secret_key_id"; // register action @@ -100,12 +102,9 @@ public class RemoteServiceActivity extends ActionBarActivity { ProviderHelper.insertApiApp(RemoteServiceActivity.this, mSettingsFragment.getAppSettings()); - // give params through for new service call - Bundle oldParams = extras.getBundle(OpenPgpConstants.PI_RESULT_PARAMS); - - Intent finishIntent = new Intent(); - finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, oldParams); - RemoteServiceActivity.this.setResult(RESULT_OK, finishIntent); + // give data through for new service call + Intent resultData = extras.getParcelable(EXTRA_DATA); + RemoteServiceActivity.this.setResult(RESULT_OK, resultData); RemoteServiceActivity.this.finish(); } } @@ -128,9 +127,9 @@ public class RemoteServiceActivity extends ActionBarActivity { mSettingsFragment.setAppSettings(settings); } else if (ACTION_CACHE_PASSPHRASE.equals(action)) { long secretKeyId = extras.getLong(EXTRA_SECRET_KEY_ID); - Bundle oldParams = extras.getBundle(OpenPgpConstants.PI_RESULT_PARAMS); + Intent resultData = extras.getParcelable(EXTRA_DATA); - showPassphraseDialog(oldParams, secretKeyId); + showPassphraseDialog(resultData, secretKeyId); } else if (ACTION_SELECT_PUB_KEYS.equals(action)) { long[] selectedMasterKeyIds = intent.getLongArrayExtra(EXTRA_SELECTED_MASTER_KEY_IDS); ArrayList missingUserIds = intent @@ -167,13 +166,11 @@ public class RemoteServiceActivity extends ActionBarActivity { @Override public void onClick(View v) { // add key ids to params Bundle for new request - Bundle params = extras.getBundle(OpenPgpConstants.PI_RESULT_PARAMS); - params.putLongArray(OpenPgpConstants.PARAMS_KEY_IDS, + Intent resultData = extras.getParcelable(EXTRA_DATA); + resultData.putExtra(OpenPgpApi.EXTRA_KEY_IDS, mSelectFragment.getSelectedMasterKeyIds()); - Intent finishIntent = new Intent(); - finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); - RemoteServiceActivity.this.setResult(RESULT_OK, finishIntent); + RemoteServiceActivity.this.setResult(RESULT_OK, resultData); RemoteServiceActivity.this.finish(); } }, R.string.btn_do_not_save, new View.OnClickListener() { @@ -222,7 +219,7 @@ public class RemoteServiceActivity extends ActionBarActivity { @Override public void onClick(View v) { - RemoteServiceActivity.this.setResult(RESULT_OK); + RemoteServiceActivity.this.setResult(RESULT_CANCELED); RemoteServiceActivity.this.finish(); } }); @@ -244,16 +241,14 @@ public class RemoteServiceActivity extends ActionBarActivity { * encryption. Based on mSecretKeyId it asks for a passphrase to open a private key or it asks * for a symmetric passphrase */ - private void showPassphraseDialog(final Bundle params, long secretKeyId) { + private void showPassphraseDialog(final Intent data, long secretKeyId) { // Message is received after passphrase is cached Handler returnHandler = new Handler() { @Override public void handleMessage(Message message) { if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) { // return given params again, for calling the service method again - Intent finishIntent = new Intent(); - finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); - RemoteServiceActivity.this.setResult(RESULT_OK, finishIntent); + RemoteServiceActivity.this.setResult(RESULT_OK, data); } else { RemoteServiceActivity.this.setResult(RESULT_CANCELED); } @@ -273,9 +268,7 @@ public class RemoteServiceActivity extends ActionBarActivity { } catch (PgpGeneralException e) { Log.d(Constants.TAG, "No passphrase for this secret key, do pgp operation directly!"); // return given params again, for calling the service method again - Intent finishIntent = new Intent(); - finishIntent.putExtra(OpenPgpConstants.PI_RESULT_PARAMS, params); - setResult(RESULT_OK, finishIntent); + setResult(RESULT_OK, data); finish(); } } -- cgit v1.2.3 From 339136dda5feb430005aa7af36409ef902bbbe6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 2 Mar 2014 18:14:49 +0100 Subject: Update from transifex --- .../src/main/res/raw-de/help_about.html | 12 +- .../src/main/res/raw-de/help_changelog.html | 40 +-- .../src/main/res/raw-de/help_start.html | 10 +- .../src/main/res/raw-es-rCO/help_about.html | 8 +- .../src/main/res/raw-es-rCO/help_start.html | 8 +- .../src/main/res/raw-es/help_about.html | 8 +- .../src/main/res/raw-es/help_start.html | 8 +- .../src/main/res/raw-fr/help_about.html | 8 +- .../src/main/res/raw-fr/help_start.html | 8 +- .../src/main/res/raw-it-rIT/help_about.html | 42 +-- .../src/main/res/raw-it-rIT/help_changelog.html | 118 +++---- .../src/main/res/raw-it-rIT/help_nfc_beam.html | 10 +- .../src/main/res/raw-it-rIT/help_start.html | 18 +- .../src/main/res/raw-it-rIT/nfc_beam_share.html | 8 +- .../src/main/res/raw-ja/help_about.html | 8 +- .../src/main/res/raw-ja/help_start.html | 8 +- .../src/main/res/raw-nl-rNL/help_about.html | 8 +- .../src/main/res/raw-nl-rNL/help_start.html | 8 +- .../src/main/res/raw-pt-rBR/help_about.html | 8 +- .../src/main/res/raw-pt-rBR/help_start.html | 8 +- .../src/main/res/raw-ru/help_about.html | 8 +- .../src/main/res/raw-ru/help_start.html | 8 +- .../src/main/res/raw-sl-rSI/help_about.html | 8 +- .../src/main/res/raw-sl-rSI/help_start.html | 8 +- .../src/main/res/raw-tr/help_about.html | 8 +- .../src/main/res/raw-tr/help_start.html | 8 +- .../src/main/res/raw-uk/help_about.html | 6 +- .../src/main/res/raw-uk/help_start.html | 2 +- .../src/main/res/raw-zh/help_about.html | 8 +- .../src/main/res/raw-zh/help_start.html | 8 +- .../src/main/res/values-de/strings.xml | 19 +- .../src/main/res/values-es/strings.xml | 14 +- .../src/main/res/values-fr/strings.xml | 19 +- .../src/main/res/values-it-rIT/strings.xml | 375 +++++++++++++++++++-- .../src/main/res/values-ja/strings.xml | 17 +- .../src/main/res/values-nl-rNL/strings.xml | 4 - .../src/main/res/values-ru/strings.xml | 19 +- .../src/main/res/values-uk/strings.xml | 5 +- .../src/main/res/values-zh/strings.xml | 4 - 39 files changed, 626 insertions(+), 276 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/raw-de/help_about.html b/OpenPGP-Keychain/src/main/res/raw-de/help_about.html index 89f74e9b0..50220bd0b 100644 --- a/OpenPGP-Keychain/src/main/res/raw-de/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-de/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain ist eine OpenPGP-Implementierung für Android. Die Entwicklung begann als ein Fork von Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain is an OpenPGP implementation for Android.

Lizenz: GPLv3+

-

Entwickler OpenPGP Keychain

+

Entwickler OpenKeychain

  • Dominik Schürmann (Leitender Entwickler)
  • Ash Hughes (crypto patches)
  • @@ -23,9 +23,9 @@

    Bibliotheken

    diff --git a/OpenPGP-Keychain/src/main/res/raw-de/help_changelog.html b/OpenPGP-Keychain/src/main/res/raw-de/help_changelog.html index 56dcf0c8b..ea31d1f3d 100644 --- a/OpenPGP-Keychain/src/main/res/raw-de/help_changelog.html +++ b/OpenPGP-Keychain/src/main/res/raw-de/help_changelog.html @@ -16,12 +16,12 @@

    2.2

    • new design with navigation drawer
    • -
    • new public key list design
    • +
    • Neus Design für die Liste der öffentlichen Schlüssel
    • new public key view
    • -
    • bug fixes for importing of keys
    • +
    • Fehler beim Schlüsselimport behoben
    • 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)
    • +
    • Erste Version mit neuen Sprachen (Danke an die Mitwirkenden bei Transifex)
    • sharing of keys via QR Codes fixed and improved
    • package signature verification for API
    @@ -31,16 +31,16 @@

2.1

    -
  • lots of bug fixes
  • -
  • new API for developers
  • -
  • PRNG bug fix by Google
  • +
  • Viele Fehler behoben
  • +
  • Neue API für Entwickler
  • +
  • PRNG Bugfix von Google

2.0

    -
  • complete redesign
  • +
  • Komlett neu designd
  • share public keys via qr codes, nfc beam
  • -
  • sign keys
  • -
  • upload keys to server
  • +
  • Schlüssel signieren
  • +
  • Schlüssel auf den Server hochladen
  • fixes import issues
  • new AIDL API
@@ -56,25 +56,25 @@

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)
  • +
  • weitere Optionen für die Time-to-live des Passphrasencaches (20, 40, 60 mins)

1.0.6

    -
  • account adding crash on Froyo fixed
  • +
  • crash beim Hinzufügen eines Kontos auf Froyo repariert
  • sichere Dateilöschung
  • -
  • option to delete key file after import
  • +
  • Option, um Schlüsseldatei nach dem Import zu löschen
  • Streamverschlüsselung/-entschlüsselung (Galerie, etc.)
  • -
  • new options (language, force v3 signatures)
  • -
  • interface changes
  • +
  • neue Optionen (Sprache, v3-Unterschriften erzwingen)
  • +
  • Interfaceänderungen
  • Fehlerbehebungen

1.0.5

  • Deutsche und Italienische Übersetzung
  • -
  • much smaller package, due to reduced BC sources
  • -
  • new preferences GUI
  • -
  • layout adjustment for localization
  • -
  • signature bugfix
  • +
  • viel kleineres Paket, dank reduzierter BC Quellen
  • +
  • Neues Einstellungs-GUI
  • +
  • Lay-Out-Anpassung für die Lokalisierung
  • +
  • Fehler bei Signatur behoben

1.0.4

    @@ -82,7 +82,7 @@

1.0.3

    -
  • fixed crashes during encryption/signing and possibly key export
  • +
  • Absturz während der Verschlüsselung/Signierung und möglicherweise Schlüsselexport behoben.

1.0.2

    @@ -100,7 +100,7 @@
  • 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
  • +
  • Neue Datenbank, viel schneller, weniger Speicherbedarf
  • defined Intents and content provider for other apps
  • Fehlerbehebungen
diff --git a/OpenPGP-Keychain/src/main/res/raw-de/help_start.html b/OpenPGP-Keychain/src/main/res/raw-de/help_start.html index 198dfe64f..d2735f739 100644 --- a/OpenPGP-Keychain/src/main/res/raw-de/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-de/help_start.html @@ -6,14 +6,14 @@

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.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

Ich habe einen Fehler in OpenKeychain gefunden!

+

Please report the bug using the issue tracker of OpenKeychain.

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

-

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Übersetzungen

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_about.html b/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_about.html index 773d11fa7..863aeee58 100644 --- a/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain is an OpenPGP implementation for Android. The development began as a fork of Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain is an OpenPGP implementation for Android.

License: GPLv3+

-

Developers OpenPGP Keychain

+

Developers OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_start.html b/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_start.html index 198dfe64f..3a6443a2f 100644 --- a/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-es-rCO/help_start.html @@ -6,14 +6,14 @@

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.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

I found a bug in OpenKeychain!

+

Please report the bug using the issue tracker of OpenKeychain.

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-es/help_about.html b/OpenPGP-Keychain/src/main/res/raw-es/help_about.html index a81789cec..95189425d 100644 --- a/OpenPGP-Keychain/src/main/res/raw-es/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-es/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain es una implementación de OpenPGP para Android. Su desarrollo comenzó como un fork de Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain es una implementación de OpenPGP para Android.

Licencia: GPLv3+

-

Desarrolladores de OpenPGP Keychain

+

Desarrolladores OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-es/help_start.html b/OpenPGP-Keychain/src/main/res/raw-es/help_start.html index d0eee8adb..2907bbc99 100644 --- a/OpenPGP-Keychain/src/main/res/raw-es/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-es/help_start.html @@ -6,14 +6,14 @@

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.

-

¡He encontrado un bug en OpenPGP Keychain!

-

Por favor, informa de errores usando el seguimiento de incidencias de OpenPGP Keychain.

+

¡He encontrado un bug en OpenKeychain!

+

Por favor, informa de errores usando el seguimiento de incidencias de OpenKeychain.

Aportar

-

Si quieres ayudarnos con el desarrollo de OpenPGP Keychain aportando código sigue nuestra pequeña guía en Github.

+

Si quieres ayudarnos con el desarrollo de OpenKeychain aportando código sigue nuestra pequeña guía en Github.

Traducciones

-

¡Ayúdanos a traducir OpenPGP Keychain! Todo el mundo es bienvenido en Transifex - OpenPGP Keychain.

+

¡Ayúdanos a traducir OpenKeychain! Todo el mundo es bienvenido en Transifex - OpenKeychain.

diff --git a/OpenPGP-Keychain/src/main/res/raw-fr/help_about.html b/OpenPGP-Keychain/src/main/res/raw-fr/help_about.html index 0833c35d9..3cbbce4d5 100644 --- a/OpenPGP-Keychain/src/main/res/raw-fr/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-fr/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

Le porte-clefs OpenPGP est une implémentation d'OpenPGP pour Android. Le développement a commencé comme bifurcation d'Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain est une implémentation d'OpenPGP pour Android.

Licence : GPLv3+

-

Les développeurs du Porte-clefs OpenPGP

+

Les développeurs d'OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-fr/help_start.html b/OpenPGP-Keychain/src/main/res/raw-fr/help_start.html index 4be071ec9..0c1610f0c 100644 --- a/OpenPGP-Keychain/src/main/res/raw-fr/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-fr/help_start.html @@ -6,14 +6,14 @@

Il vous est recommendé d'installer le gestionnaire de fichiers OI pour sa fonction améliorée de séléction des fichiers et le lecteur de codes à barres pour balayer les codes QR générés. Cliquer sur les liens ouvrira Google Play Store ou F-Droid pour l'installation.

-

J'ai trouvé un bogue dans le Porte-clefs OpenPGP !

-

Veuillez rapporter le bogue en utilisant le gestionnaire de bogues du Porte-clefs OpenPGP.

+

J'ai trouvé un bogue dans OpenKeychain !

+

Veuillez rapporter le bogue en utilisant le gestionnaire de bogue d'OpenKeychain.

Contribuer

-

Si vous voulez nous aider à développer le Porte-clefs OpenPGP en y contribuant par du code, veuillez suivre notre petit guide sur Github.

+

Si vous voulez nous aider à développer OpenKeychain en y contribuant par du code veuillez suivre notre petit guide sur Github.

Traductions

-

Aidez-nous à traduire le Porte-clefs OpenPGP ! Tout le monde peut y participer sur la page Transifex du Porte-clefs OpenPGP Keychain.

+

Aidez-nous à traduire le OpenKeychain ! Tout le monde peut y participer sur la page d'OpenKeychain sur Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_about.html b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_about.html index 773d11fa7..ba0676f3e 100644 --- a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_about.html @@ -1,43 +1,45 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain is an OpenPGP implementation for Android. The development began as a fork of Android Privacy Guard (APG).

-

License: GPLv3+

+

http://www.openkeychain.org

+

OpenKeychain un implementazione OpenPGP per Android.

+

Licenza: GPLv3+

-

Developers OpenPGP Keychain

+

Sviluppatori OpenKeychain

    -
  • Dominik Schürmann (Lead developer)
  • -
  • Ash Hughes (crypto patches)
  • +
  • Dominik Schürmann (Capo Sviluppatore)
  • +
  • Ash Hughes (Patch crittografia)
  • Brian C. Barnes
  • -
  • Bahtiar 'kalkin' Gadimov (UI)
  • +
  • Bahtiar 'kalkin' Gadimov (Interfaccia Utente)
-

Developers APG 1.x

+

Sviluppatori APG 1.x

    -
  • 'Thialfihar' (Lead developer)
  • -
  • 'Senecaso' (QRCode, sign key, upload key)
  • +
  • 'Thialfihar' (Capo Sviluppatore)
  • +
  • 'Senecaso' (QRCode, firma chiavi, caricamento chiavi)
  • Oliver Runge
  • Markus Doits
-

Libraries

+

Librerie

diff --git a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_changelog.html b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_changelog.html index abf660ba8..050d2c9ef 100644 --- a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_changelog.html +++ b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_changelog.html @@ -3,106 +3,106 @@

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
  • +
  • rimossa esportazione non necessaria delle chiavi pubbliche quando si esportano le chiavi private (grazie a Ash Hughes)
  • +
  • corretto impostazione data di scadenza delle chiavi (grazie a Ash Hughes)
  • +
  • altre correzioni interne quando si modificano le chiavi (grazie a Ash Hughes)
  • +
  • interrogazione server delle chiavi direttamente dalla schermata di importazione
  • +
  • corretto layout e dialog style su Android 2.2-3.0
  • +
  • corretto crash su chiavi con id utente vuoto
  • +
  • corretto crash e liste vuote quando si torna dalla schermata di firma
  • +
  • Bouncy Castle (libreria crittografica) aggiornata da 1.47 a 1.50 e compilata da sorgente
  • +
  • corretto upload delle chiavi dalla schermata di firma

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
  • +
  • nuovo design con drawer di navigazione
  • +
  • nuovo design per la lista chiavi pubbliche
  • +
  • nuova visuale chiavi pubbliche
  • +
  • correzione bug per importazione chiavi
  • +
  • Chiave certificazione incrociata (grazie a Ash Hughes)
  • +
  • password UTF-8 gestite correttamente (grazie a Ash Hughes)
  • +
  • Prima versione con nuove lingue (grazie ai contributori su Transifex)
  • +
  • condivisione di chiavi via Codici QR corretta e migliorata
  • +
  • Verifica firma pacchetto per API

2.1.1

    -
  • API Updates, preparation for K-9 Mail integration
  • +
  • Aggiornamenti API, preparazione per integrazione con K-9 Mail

2.1

    -
  • lots of bug fixes
  • -
  • new API for developers
  • +
  • molte correzioni di bug
  • +
  • nuove API per sviluppatori
  • 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
  • +
  • completo restyle
  • +
  • condivisione chiavi pubbliche via codici qr, nfc beam
  • +
  • firma chiavi
  • +
  • Carica chiavi sul server
  • +
  • corrette caratteristiche di importazione
  • +
  • nuova AIDL API

1.0.8

    -
  • basic keyserver support
  • +
  • supporto base per server delle chiavi
  • app2sd
  • -
  • more choices for pass phrase cache: 1, 2, 4, 8, hours
  • -
  • translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)
  • -
  • bugfixes
  • -
  • optimizations
  • +
  • Aggiunte opzioni per la cache della frase di accesso: 1, 2, 4, 8 ore
  • +
  • Traduzioni: Norvegese (grazie, Sander Danielsen), Cinese (grazie, Zhang Fredrick)
  • +
  • correzione bug
  • +
  • ottimizzazioni

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)
  • +
  • corretto problema con la verifica firma di testi con capo finale
  • +
  • maggiori opzioni per il tempo di mantenimento della cache della frase di accesso (20, 40, 60 minuti)

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
  • +
  • crash della aggiunta degli account risolto su Froyo
  • +
  • Cancellazione sicura dei file
  • +
  • opzione per cancellare file delle chiavi dopo l'importazione
  • +
  • flusso codifica/decodifica (galleria, ecc.)
  • +
  • nuove opzioni (lingua, forza firme v3)
  • +
  • cambiamenti interfaccia
  • +
  • correzione bug

1.0.5

    -
  • German and Italian translation
  • -
  • much smaller package, due to reduced BC sources
  • -
  • new preferences GUI
  • -
  • layout adjustment for localization
  • -
  • signature bugfix
  • +
  • Traduzione Italiana e Tedesca
  • +
  • dimensioni pacchetto ridotte, a causa della riduzione dei sorgenti BC
  • +
  • Nuove preferenze GUI
  • +
  • Regolazione layout per la localizzazione
  • +
  • correzione bug firma

1.0.4

    -
  • fixed another crash caused by some SDK bug with query builder
  • +
  • corretto altro crash causato da alcuni bug SDK con query builder

1.0.3

    -
  • fixed crashes during encryption/signing and possibly key export
  • +
  • corretto crash durante codifica/firma e possibilita' di esportare chiave

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
  • +
  • liste chiavi filtrabili
  • +
  • preselezione di chiavi di codifica intelligente
  • +
  • nuovo gestore intent per VIEW e SEND, permette la codifica/decodifica file all'infuori di file manager
  • +
  • caratteristiche corrette e aggiunte (preselezione chiavi) per K-9 Mail. nuova build beta disponibile

1.0.1

    -
  • GMail account listing was broken in 1.0.0, fixed again
  • +
  • elencazione account GMail corrotta in 1.0.0, corretta nuovamente

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
  • -
  • bugfixes
  • +
  • integrazione K-9 Mail, APG supporto beta build di K-9 Mail
  • +
  • supporto per altri file manager (incluso ASTRO)
  • +
  • traduzione Slovena
  • +
  • Nuovo database, piu' veloce, utilizzo memoria ridotto
  • +
  • Definiti Intent e ContentProvider per le altre app
  • +
  • correzione bug
diff --git a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_nfc_beam.html b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_nfc_beam.html index 88492731c..6ff56194e 100644 --- a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_nfc_beam.html +++ b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_nfc_beam.html @@ -1,12 +1,12 @@ -

How to receive keys

+

Come ricevere le chiavi

    -
  1. Go to your partners contacts and open the contact you want to share.
  2. -
  3. Hold the two devices back to back (they have to be almost touching) and you’ll feel a vibration.
  4. -
  5. 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.
  6. -
  7. Tap the card and the content will then load on the your device.
  8. +
  9. Vai ai contatti dei tuoi partner e apri il contatto che si desidera condividere.
  10. +
  11. Mantieni i due dispositivi vicini (devono quasi toccarsi) e sentirai una vibrazione.
  12. +
  13. Dopo che ha vibrato, vedrai il contenuto del tuo dispositivo diventare come una scheda e nello sfondo apparirà una animazione come la propulsione a curvatura di Star Trek.
  14. +
  15. Tocca la scheda e il contenuto dopo si trasferira' nel dispositivo dell'altra persona.
diff --git a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_start.html b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_start.html index 198dfe64f..4eadd82fc 100644 --- a/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-it-rIT/help_start.html @@ -1,19 +1,19 @@ -

Getting started

-

First you need a personal key pair. Create one via the option menus in "My Keys" or import existing key pairs via "Import Keys". Afterwards, you can download your friends' keys or exchange them via QR Codes or NFC.

+

Per iniziare

+

Per prima cosa hai bisogno di un paio di chiavi personali. Creane una tramite i menu di opzione sotto 'Mie Chiavi' o importane di esistenti attraverso "Importa Chiavi". Dopodiche' puoi scaricare le chiavi dei tuoi amici o scambiarle tramite Codici QR o 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.

+

Si raccomanda di installare OI File Manager per una migliore selezione dei file e Barcode Scanner per scansionare i codici QR. I collegamenti verranno aperti in Google Play Store o F-Droid per l'installazione.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

Ho trovato un bug in OpenKeychain!

+

Per favore riporta i bug usando il issue tracker di OpenKeychain.

-

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

Contribuire

+

Se vuoi aiutarci nello sviluppo di OpenKeychain contribuendo al codice segui la nostra breve guida su Github.

-

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Traduzioni

+

Aiutaci a tradurre OpenKeychain! Tutti possono collaborare a OpenKeychain su Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-it-rIT/nfc_beam_share.html b/OpenPGP-Keychain/src/main/res/raw-it-rIT/nfc_beam_share.html index 083e055c7..e75877efe 100644 --- a/OpenPGP-Keychain/src/main/res/raw-it-rIT/nfc_beam_share.html +++ b/OpenPGP-Keychain/src/main/res/raw-it-rIT/nfc_beam_share.html @@ -2,10 +2,10 @@
    -
  1. Make sure that NFC is turned on in Settings > More > NFC and make sure that Android Beam is also on in the same section.
  2. -
  3. Hold the two devices back to back (they have to be almost touching) and you'll feel a vibration.
  4. -
  5. After it vibrates you'll see the content on your device turn into a card-like object with Star Trek warp speed-looking animation in the background.
  6. -
  7. Tap the card and the content will then load on the other person’s device.
  8. +
  9. Assicurati che NFC sia acceso in Impostazioni > Altro > NFC a assicurati che Android Beam sia pure su On nella stessa sezione.
  10. +
  11. Mantieni i due dispositivi vicini (devono quasi toccarsi) e sentirai una vibrazione.
  12. +
  13. Dopo che ha vibrato, vedrai il contenuto del tuo dispositivo diventare come una scheda e nello sfondo apparirà una animazione come la propulsione a curvatura di Star Trek.
  14. +
  15. Tocca la scheda e il contenuto dopo si trasferira' nel dispositivo dell'altra persona.
diff --git a/OpenPGP-Keychain/src/main/res/raw-ja/help_about.html b/OpenPGP-Keychain/src/main/res/raw-ja/help_about.html index 51e0b8c25..206fc9f8d 100644 --- a/OpenPGP-Keychain/src/main/res/raw-ja/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-ja/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain は AndroidにおけるOpenPGP実装の一つです。開発はAndroid Privacy Guard (APG)から分岐して始まりました。

+

http://www.openkeychain.org

+

OpenKeychain は Android における OpenPGP 実装です。

ライセンス: GPLv3以降

-

OpenPGP Keychain開発者

+

OpenKeychain開発者

diff --git a/OpenPGP-Keychain/src/main/res/raw-ja/help_start.html b/OpenPGP-Keychain/src/main/res/raw-ja/help_start.html index 5c78a1273..9764e876a 100644 --- a/OpenPGP-Keychain/src/main/res/raw-ja/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-ja/help_start.html @@ -6,14 +6,14 @@

ファイルの選択を拡張するにはOI File ManagerBarcode Scannerを生成したQRコードのスキャンのため、それぞれのインストールを必要とします。 リンクをクリックして、Google Play Store上かF-Droidからインストールしてください。

-

OpenPGP Keychainにバグを発見した!

-

OpenPGP KeychainのIssueトラッカーを使ってバグレポートを送ってください。

+

OpenKeychainでバグを見付けた!

+

OpenKeychainのIssueトラッカーを使ってバグレポートを送ってください。

寄贈

-

もし、あなたが OpenPGP Keychain の開発を助け、コードを寄贈するというなら、Githubの寄贈ガイドを確認して下さい。

+

もし、あなたが OpenKeychain の開発を助け、コードを寄贈するというなら、Githubのミニガイドを確認して下さい。

翻訳

-

OpenPGP Keychainの翻訳を補助してください! だれでも、TransifexでのOpenPGP Keychainプロジェクトに参加できます。

+

OpenKeychainの翻訳を助けてください! TransifexのOpenKeychainプロジェクトに誰でも参加できます。

diff --git a/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_about.html b/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_about.html index 773d11fa7..863aeee58 100644 --- a/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain is an OpenPGP implementation for Android. The development began as a fork of Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain is an OpenPGP implementation for Android.

License: GPLv3+

-

Developers OpenPGP Keychain

+

Developers OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_start.html b/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_start.html index 198dfe64f..3a6443a2f 100644 --- a/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-nl-rNL/help_start.html @@ -6,14 +6,14 @@

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.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

I found a bug in OpenKeychain!

+

Please report the bug using the issue tracker of OpenKeychain.

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_about.html b/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_about.html index 773d11fa7..863aeee58 100644 --- a/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain is an OpenPGP implementation for Android. The development began as a fork of Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain is an OpenPGP implementation for Android.

License: GPLv3+

-

Developers OpenPGP Keychain

+

Developers OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_start.html b/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_start.html index 198dfe64f..3a6443a2f 100644 --- a/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-pt-rBR/help_start.html @@ -6,14 +6,14 @@

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.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

I found a bug in OpenKeychain!

+

Please report the bug using the issue tracker of OpenKeychain.

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-ru/help_about.html b/OpenPGP-Keychain/src/main/res/raw-ru/help_about.html index b11aaab35..655e98758 100644 --- a/OpenPGP-Keychain/src/main/res/raw-ru/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-ru/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain - свободная реализация OpenPGP для Android. Разработка начиналась как ответвление Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain - реализация OpenPGP для Android.

Лицензия: GPLv3+

-

Разработчики OpenPGP Keychain

+

Разработчики OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-ru/help_start.html b/OpenPGP-Keychain/src/main/res/raw-ru/help_start.html index 99e6f263d..9b2b99e96 100644 --- a/OpenPGP-Keychain/src/main/res/raw-ru/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-ru/help_start.html @@ -6,14 +6,14 @@

Рекомендуется установить OI File Manager для удобного выбора файлов и Barcode Scanner для распознавания QR кодов. Перейдите по ссылкам на соответствующие страницы Google Play или F-Droid для дальнейшей установки.

-

Я нашел ошибку в OpenPGP Keychain!

-

Пожалуйста, сообщайте о возникших проблемах и найденных ошибках в разделе Решение проблем OpenPGP Keychain.

+

Я нашел ошибку в OpenKeychain!

+

Пожалуйста, сообщайте о возникших проблемах и найденных ошибках в разделе Решение проблем OpenKeychain.

Вклад в развитие

-

Если Вы хотите помочь в разработке OpenPGP Keychain, обратитесь к инструкции на Github.

+

Если Вы хотите помочь в разработке OpenKeychain, обратитесь к инструкции на Github.

Перевод

-

Помогите переводить OpenPGP Keychain! Каждый может принять участие в переводе OpenPGP Keychain на Transifex.

+

Помогите переводить OpenKeychain! Каждый может принять участие в переводе OpenKeychain на Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_about.html b/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_about.html index 773d11fa7..863aeee58 100644 --- a/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain is an OpenPGP implementation for Android. The development began as a fork of Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain is an OpenPGP implementation for Android.

License: GPLv3+

-

Developers OpenPGP Keychain

+

Developers OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_start.html b/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_start.html index 198dfe64f..3a6443a2f 100644 --- a/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-sl-rSI/help_start.html @@ -6,14 +6,14 @@

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.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

I found a bug in OpenKeychain!

+

Please report the bug using the issue tracker of OpenKeychain.

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-tr/help_about.html b/OpenPGP-Keychain/src/main/res/raw-tr/help_about.html index 3a95c8c16..eb262b242 100644 --- a/OpenPGP-Keychain/src/main/res/raw-tr/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-tr/help_about.html @@ -1,11 +1,11 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain Android için bir OpenPGP uygulamasıdır.

+

http://www.openkeychain.org

+

OpenKeychain is an OpenPGP implementation for Android.

Lisans: GPLv3+

-

Geliştiriciler OpenPGP Keychain

+

Developers OpenKeychain

diff --git a/OpenPGP-Keychain/src/main/res/raw-tr/help_start.html b/OpenPGP-Keychain/src/main/res/raw-tr/help_start.html index 198dfe64f..3a6443a2f 100644 --- a/OpenPGP-Keychain/src/main/res/raw-tr/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-tr/help_start.html @@ -6,14 +6,14 @@

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.

-

I found a bug in OpenPGP Keychain!

-

Please report the bug using the issue tracker of OpenPGP Keychain.

+

I found a bug in OpenKeychain!

+

Please report the bug using the issue tracker of OpenKeychain.

Contribute

-

If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

+

If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

Translations

-

Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

+

Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

diff --git a/OpenPGP-Keychain/src/main/res/raw-uk/help_about.html b/OpenPGP-Keychain/src/main/res/raw-uk/help_about.html index c6c2e1eed..c8a5a82c5 100644 --- a/OpenPGP-Keychain/src/main/res/raw-uk/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-uk/help_about.html @@ -1,8 +1,8 @@ -

http://sufficientlysecure.org/keychain

-

OpenPGP Keychain - вільна реалізація OpenPGP для Android. Розробка починалася як відгалуження Android Privacy Guard (APG).

+

http://www.openkeychain.org

+

OpenKeychain імплементація OpenPGP для Андроїду.

Ліцензія: GPLv3+

Розробники OpenPGP Keychain

@@ -36,6 +36,8 @@ SpongyCastle (ліцензія MIT X11)
  • HtmlTextView (ліцензія Apache в.2)
  • +
  • +Бібліотека Android AppMsg Library (Ліцензія Apache в. 2)
  • Піктограми із набору піктограм RRZE (ліцензія Creative Commons - Із зазначенням авторства - Розповсюдження на тих самих умовах - версія 3.0)
  • Піктограми із набору піктограм Tango (відкритий домен)
  • diff --git a/OpenPGP-Keychain/src/main/res/raw-uk/help_start.html b/OpenPGP-Keychain/src/main/res/raw-uk/help_start.html index 520224815..3bfb40f8a 100644 --- a/OpenPGP-Keychain/src/main/res/raw-uk/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-uk/help_start.html @@ -13,7 +13,7 @@

    Якщо ви хочете допомогти нам у розробці OpenPGP Keychain через редагування коду програми підпишіться на наш невеличкий посібник у Github.

    Переклади

    -

    Допоможіть перекласти OpenPGP Keychain! Кожний може взяти участь у OpenPGP Keychain на Transifex.

    +

    Допоможіть перекласти OpenPGP Keychain! Кожний може взяти участь на OpenPGP Keychain на Transifex.

    diff --git a/OpenPGP-Keychain/src/main/res/raw-zh/help_about.html b/OpenPGP-Keychain/src/main/res/raw-zh/help_about.html index 773d11fa7..863aeee58 100644 --- a/OpenPGP-Keychain/src/main/res/raw-zh/help_about.html +++ b/OpenPGP-Keychain/src/main/res/raw-zh/help_about.html @@ -1,11 +1,11 @@ -

    http://sufficientlysecure.org/keychain

    -

    OpenPGP Keychain is an OpenPGP implementation for Android. The development began as a fork of Android Privacy Guard (APG).

    +

    http://www.openkeychain.org

    +

    OpenKeychain is an OpenPGP implementation for Android.

    License: GPLv3+

    -

    Developers OpenPGP Keychain

    +

    Developers OpenKeychain

    diff --git a/OpenPGP-Keychain/src/main/res/raw-zh/help_start.html b/OpenPGP-Keychain/src/main/res/raw-zh/help_start.html index 198dfe64f..3a6443a2f 100644 --- a/OpenPGP-Keychain/src/main/res/raw-zh/help_start.html +++ b/OpenPGP-Keychain/src/main/res/raw-zh/help_start.html @@ -6,14 +6,14 @@

    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.

    -

    I found a bug in OpenPGP Keychain!

    -

    Please report the bug using the issue tracker of OpenPGP Keychain.

    +

    I found a bug in OpenKeychain!

    +

    Please report the bug using the issue tracker of OpenKeychain.

    Contribute

    -

    If you want to help us developing OpenPGP Keychain by contributing code follow our small guide on Github.

    +

    If you want to help us developing OpenKeychain by contributing code follow our small guide on Github.

    Translations

    -

    Help translating OpenPGP Keychain! Everybody can participate at OpenPGP Keychain on Transifex.

    +

    Help translating OpenKeychain! Everybody can participate at OpenKeychain on Transifex.

    diff --git a/OpenPGP-Keychain/src/main/res/values-de/strings.xml b/OpenPGP-Keychain/src/main/res/values-de/strings.xml index d421fd141..09b4fdb23 100644 --- a/OpenPGP-Keychain/src/main/res/values-de/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-de/strings.xml @@ -111,6 +111,7 @@ Passwort-Cache Nachrichten-Komprimierung Datei-Komprimierung + Alte OpenPGPv3 Unterschriften erzwingen Schlüsselserver Schlüssel-ID Erstellungsdatum @@ -253,6 +254,7 @@ kein Signaturschlüssel angegeben Verschlüsselte Daten nicht gültig beschädigte Daten + Integritätscheck fehlgeschlagen! Die Daten wurden modifiziert! Paket mit symmetrischer Verschlüsselung konnte nicht gefunden werden falsches Passwort Es trat ein Fehler beim Speichern einiger Schlüssel auf @@ -262,6 +264,8 @@ NFC steht auf diesem Gerät nicht zur Verfügung! Nichts zu importieren! Ablaufdatum muss später sein als das Erstellungsdatum + Sie können diesen Kontakt nicht löschen, denn es ist ihr eigener. + Sie können folgende Kontakte nicht löschen, denn sie gehören Ihnen selbst:\n%s Bitte lösche ihn unter \'Meine Schlüssel\'! Bitte lösche sie unter \'Meine Schlüssel\'! @@ -271,6 +275,7 @@ speichern... importieren... exportieren... + erstelle Schlüssel, dies kann bis zu 3 Minuten dauern... erstelle Schlüssel... Hauptschlüssel wird vorbereitet... Hauptschlüssel wird beglaubigt... @@ -332,11 +337,12 @@ Hilfe Füge den Schlüssel aus der Zwischenablage ein - OpenPGP: Datei entschlüsseln - OpenPGP: Schlüssel importieren - OpenPGP: Verschlüsseln - OpenPGP: Entschlüsseln + OpenKeychain: Datei entschlüsseln + OpenKeychain: Schlüssel importieren + OpenKeychain: Verschlüsseln + OpenKeychain: Entschlüsseln + Keine registrierten Anwendungen vorhanden!\n\nAnwendungen von Dritten können Zugriff auf OpenKeychain erbitten. Nachdem Zugriff gewährt wurde, werden diese hier aufgelistet. Erweiterte Einstellungen anzeigen Erweiterte Einstellungen ausblenden Kein Schlüssel ausgewählt @@ -346,13 +352,14 @@ Zugriff widerufen Paketname SHA-256 der Paketsignatur + Folgende Anwendung beantragt Zugriff zur API von OpenKeychain.\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ü \'Registrierte Anwendungen\' widerrufen. Zugriff erlauben Zugriff verbieten Bitte einen Schlüssel auswählen! Für diese Benutzer-IDs wurden keine öffentlichen Schlüssel gefunden: Für diese Benutzer-IDs existieren mehrere öffentliche Schlüssel: Bitte die Liste der Empfänger überprüfen! - Signaturüberprüfung fehlgeschlagen! Haben Sie diese App von einer anderen Quelle installiert? Wenn Sie eine Attacke ausschliessen können, sollten Sie die Registrierung der App in OpenPGP Keychain widerrufen und die App erneut registrieren. + Signaturüberprüfung fehlgeschlagen! Haben Sie diese App von einer anderen Quelle installiert? Wenn Sie eine Attacke ausschliessen können, sollten Sie die Registrierung der App in OpenKeychain widerrufen und die App erneut registrieren. Über QR Code teilen Mit \'Weiter\' durch alle QR-Codes gehen und diese nacheinander scannen. @@ -372,6 +379,8 @@ Für diesen Kontakt verschlüsseln Schlüssel dieses Kontakts beglaubigen + Info + Zertifikationen Kontakte Verschlüsseln diff --git a/OpenPGP-Keychain/src/main/res/values-es/strings.xml b/OpenPGP-Keychain/src/main/res/values-es/strings.xml index d6b0f9562..48ea6cc69 100644 --- a/OpenPGP-Keychain/src/main/res/values-es/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-es/strings.xml @@ -337,12 +337,12 @@ Ayuda Tomar la clave desde el portapapeles - OpenPGP: Descifrar archivo - OpenPGP: Importar clave - OpenPGP: Cifrar - OpenPGP: Descifrar + OpenKeychain: Descifrar archivo + OpenKeychain: Importar clave + OpenKeychain: Cifrar + OpenKeychain: Descifrar - ¡No hay aplicaciones registradas¡\n\nLas aplicaciones de terceros pueden pedir acceso a OpenPGP Keychain. Después de recibir permiso, se mostrarán aquí. + ¡No hay aplicaciones registradas!\n\nLas aplicaciones de terceros pueden pedir permiso de acceso a OpenKeychain. Después de obtener acceso, serán enumeradas aquí. Mostrar la configuración avanzada Ocultar la configuración avanzada No se ha seleccionado ninguna clave @@ -352,14 +352,14 @@ Revocar acceso Nombre de paquete SHA-256 de firma de paquete - La aplicación mostrada pide acceso a OpenPGP Keychain.\n¿Permitir acceso?\n\nAVISO: Si no sabes por qué ha aparecido esta pantalla, ¡deniega el acceso! Puedes revocar el acceso más tarde usando la ventana \'Aplicaciones Registradas\'. + 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\'. Permitir el acceso Denegar el acceso ¡Por favor, selecciona una clave! No se han encontrado claves públicas para estas IDs de usuario: Existe más de una clave pública para estos IDs de usuario: ¡Por favor, revisa la lista de destinatarios! - ¡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 OpenPGP Keychain y regístrala de nuevo. + ¡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. diff --git a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml index 016090d61..bf66756cf 100644 --- a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml @@ -111,6 +111,7 @@ Cache de la phrase de passe Compression des messages Compression des fichiers + Forcer les anciennes signatures OpenPGP v3 Serveurs de clefs ID de le clef Création @@ -253,6 +254,7 @@ aucune clef de signature n\'a été donnée aucune donnée de chiffrement valide données corrompues + la vérification de l\'intégrité a échoué ! Les données ont été modifiées ! paquet avec chiffrement symétrique introuvable phrase de passe erronnée erreur lors de la sauvegarde de certaines clefs @@ -264,6 +266,9 @@ la date d\'expiration doit venir après la date de création vous ne pouvez pas supprimer ce contact car c\'est le vôtre. vous ne pouvez pas supprimer les contacts suivants car c\'est les vôtres.\n%s + Requête serveur insuffisante + Échec lors de l\'interrogation du serveur de clefs + Trop de réponses Veuillez le supprimer depuis l\'écran « Mes Clefs »! Veuillez les supprimer depuis l\'écran « Mes Clefs »! @@ -335,12 +340,12 @@ Aide Obtenir la clef depuis le presse-papiers - OpenPGP : déchiffrer le ficher - OpenPGP : importer la clef - OpenPGP : chiffrer - OpenPGP : déchiffrer + OpenKeychain : déchiffrer le ficher + OpenKeychain : importer la clef + OpenKeychain : chiffrer + OpenKeychain : déchiffrer - Aucune application enregistrée !\n\nLes applications tierces peuvent demander l\'accès au Porte-clefs OpenPGP. Après avoir autoriser l\'accès, elles seront listées ici. + Aucune application enregistrée !\n\nLes applications tierces peuvent demander l\'accès à OpenKeychain. Après avoir autorisé l\'accès, elles seront listées ici. Afficher les paramètres avancés Masquer les paramètres avancés Aucune clef choisie @@ -350,14 +355,14 @@ Révoquer l\'accès Nom du paquet SHA-256 de la signature du paquet - L\'application affichée demande l\'accès au Porte-clefs OpenPGP.\nPermettre l\'accès ?\n\nAvertissement : si vous ne savez pas pourquoi cet écran est apparu, refusé l\'accès ! Vous pourrez révoquer l\'accès plus tard en utilisant l\'écran « Applications enregistrées ». + 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 ». Permettre l\'accès Enlever l\'accès Veuillez choisir une clef ! Aucune clef publique n\'a été trouvée pour ces IDs utilisateur : Plus d\'une clef publique existe pour ces IDs utilisateur Veuillez revoir la liste des destinataires ! - 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évoquer l\'enregistrement de cette appli dans le Porte-clefs OpenPGP et l\'enregistrer à nouveau. + 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 ». diff --git a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml index e404addfa..86a094c41 100644 --- a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml @@ -1,89 +1,396 @@ - Selezionare Chiave Pubblica - Selezionare Chiave Privata - Cifrare - Decifrare - Passphrase - Creare Chiave - Modificare Chiave + Contatti + Chiavi Private + Seleziona Chiave Pubblica + Seleziona Chiave Privata + Codifica + Decodifica + Frase di accesso + Crea Chiave + Modifica Chiave Preferenze - Impostare Passphrase - Inviare Mail... - Importare Chiavi - Esportare Chiave - Esportare Chiavi + App Registrate + Preferenze Server delle Chiavi + Cambia Frase di Accesso + Imposta Frase di Accesso + Invia Mail... + Codifica File + Decodifica File + Importa Chiavi + Esporta Chiave + Esporta Chiavi Chiave Non Trovata + Interroga Server delle Chiavi + Carica sul Server delle Chiavi + Chiave di Firma Sconosciuta + Certifica Chiave + Dettagli Chiave Aiuto ID Utente Chiavi Generale + Predefiniti Avanzato + Chiave Principale + ID Utente Principale + Azioni + La Tua Chiave usata per la certificazione + Carica Chiave + Server delle Chiavi + Codifica e/o Firma + Decodifica e Verifica - Firmare - Decifrare - Cifrare File + Firma + Certifica + Decodifica + Decodifica e Verifica + Seleziona Destinatari + Codifica File Salva - Cancella - Eliminare + Annulla + Elimina Nessuno Okay - Cambiare passphrase - Cercare + Cambia Frase Di Accesso + Imposta Frase di Accesso + Cerca + Carica sul Server delle Chiavi + Prossimo + Precedente + Appunti + Condividi con... + Chiave di ricerca Impostazioni - Importare da file - Importare da QR Code - Eliminare chiave - Creare chiave - Cercare + Aiuto + Importa da file + Importa da Codice QR + Importa + Importa tramite NFC + Esporta tutte le chiavi + Esporta su un file + Cancella chiave + Crea chiave + Crea chiave (esperto) + Cerca + Importa dal 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 appunti + Firma chiave + Impostazioni Beam + Annulla + Codifica su... + Firma + Messaggio + File + Nessuna Frase di Accesso + Frase di Accesso + Ancora + Algortimo + Armatura ASCII + Destinatari + Cancella Dopo Codifica + Cancella Dopo Decodifica + Algoritmo di Codifica + Algoritmo di Hash + Chiave Pubblica + Frase di Accesso + Cache Frase di Accesso + Compressione Messaggio + Compressione File + Forza vecchie Firme OpenPGPv3 + Server Chiavi + ID Chiave + Creazione + Scadenza + Utilizzo + Dimensione Chiave + ID Utente Principale + Nome + Commento + Email + Carica chiave nel server delle chiavi selezionati dopo la certificazione + Impronta + Seleziona + + %d selezionato + %d selezionati + + <nessun nome> + <nessuno> + <nessuna chiave> + puo\'; codificare + puo\' firmare + scaduto + revocato + + %d server delle chiavi + %d server delle chiavi + + Impronta: + Chiave Privata: + Nessuno + Firma soltanto + Codifica soltanto + Firma e Codifica + 15 sec + 1 min + 3 min + 5 min + 10 min + 20 min + 40 min 1 ora 2 ore 4 ore 8 ore + sempre DSA ElGamal RSA + Apri... Attenzione Errore Errore: %s + Frase di Accesso errata + Utilizzo il contenuto degli appunti. + Imposta prima una frase di accesso. + Nessun gestore file compatibile installato. + Le frasi di accesso non corrispondono. + Frasi di accesso vuote non consentite. + Codifica Simmetrica. + Inserisci la frase di accesso per \'%s\' + Sei sicuro di voler cancellare\n%s? + Eliminato correttamente. + Seleziona un file prima. + Decodificato correttamente. + Codificato correttamente. + Codificato correttamente negli appunti. + Inserisci la frase di accesso due volte. + Seleziona almeno una chiave di codifica. + Seleziona almeno una chiave di codifica o di firma. + Perfavore specifica quale file codificare.\nATTENZIONE: Il file sara\' sovrascritto se esistente. + Perfavore specifica quale file decodificare.\nATTENZIONE: Il file sara\' sovrascritto se esistente. + Perfavore specifica su quale file esportare.\nATTENZIONE: Il file sara\' sovrascritto se esistente. + Perfavore specifica quale file esportare.\nATTENZIONE: Stai esportanto chiavi PRIVATE.\nATTENZIONE: Il file sara\' sovrascritto se esistente. + Vuoi veramente eliminare la chiave \'%s\'?\nNon potrai annullare! + Vuoi veramente eliminare le chiavi selezionate?\nNon potrai annullare! + Vuoi veramente eliminare la chiave PRIVATA \'%s\'?\nNon potrai annullare! + + %d chiave aggiunta correttamente + %d chiavi aggiunte correttamente + + + e %d chiave aggiornata. + e %d chiavi aggiornate. + + + %d chiave aggiunta correttamente. + %d chiavi aggiunte correttamente. + + + %d chiave aggiornata correttamente. + %d chiavi aggiornate correttamente. + + Nessuna chiave aggiunta o aggiornata. + 1 chiave esportata correttamente. + %d chiavi esportate correttamente. + Nessuna chiave esportata. + Nota: solo le sottochiavi supportano ElGamal, e per ElGamal verra\' usata la grandezza chiave piu\' vicina a 1536, 2048, 3072, 4096 o 8192. + Impossibile trovare la chiave %08X. + + Trovata %d chiave. + Trovate %d chiavi. + + Firma sconosciuta, clicca il pulsante per ricercare la chiave mancante. + + %d chiave segreta non valida ignorata. Forse hai esportato con opzione\n--export-secret-subkeys\nAssicurati di esportare con\n--export-secret-keys\ninvece. + %d chiavi private non valide ignorate. Forse hai esportato con opzione\n--export-secret-subkeys\nAssicurati di esportare con\n--export-secret-keys\ninvece. + + Chiave caricata con successo sul server + Chiave firmata correttamente + Lista vuota! + Chiave inviata tramite NFC Beam! + Chiave copiata negli appunti! + La chiave e\' gia\' firmata! + Per favore seleziona la chiave per la firma! + Chiave troppo grande per essere condivisa in questo modo! + Cancellazione di \'%s\' fallita + File non trovato + nessuna chiave privata adatta trovata + nessun tipo conosciuto di codifica trovata + memoria esterna non pronta + email non valida \'%s\' + La grandezza della chiave deve essere almeno di 512bit + La chiave principale non puo\' essere ElGamal + opzione algoritmo sconosciuta + devi specificare un nome + devi specificare un indirizzo email + necessario almeno un id utente + id utente principale non puo\' essere vuoto + necessaria almeno una chiave principale + nessuna chiave di codifica o frase di accesso fornita + firma fallita + nessuna frase di accesso inserita + nessuna chiave di firma inserita + dati di codifica non validi + dati corrotti + Controllo di integrita\' fallito! I dati sono stati modificati! + impossibile trovare una pacchetto con codifica simmetrica + frase di accesso errata + errore nel salvataggio di alcune chiavi + impossibile estrarre la chiave privata + Flusso di dati diretto senza file corrispettivo nel filesystem non e\' supportato. Supportato soltanto da ACTION_ENCRYPT_STREAM_AND_RETURN. + Devi avere Android 4.1 alias Jelly Bean per usare Android NFC Beam! + NFC non disponibile nel tuo dispositivo! + Niente da importare! + La data di scadenza deve essere postuma quella di creazione + Non è possibile eliminare questo contatto, perché è il proprio. + Non è possibile eliminare i seguenti contatti perché sono i propri:\n%s + Query di server insufficiente + Interrogazione del server delle chiavi fallita + Troppi responsi + + Per favore cancellala dalla schermata \'Mie Chavi\' + Per favore cancellatele dalla schermata \'Mie Chavi\' + + fatto. + salvataggio... + importazione... + esportazione... + generazione chiave, richiede fino a 3 minuti... + fabbricazione chiave... + preparazione chiave principale... + certificazione chiave principale... + fabbricazione portachiavi principale... + aggiunta sottochiavi... + salvataggio chiavi... + + esportazione chiave... + esportazione chiavi... + + estrazione chiavi di firma... + estrazione chiave... + preparazione flussi... + codifica dati... + decodifica dati... + preparazione firma... + generazione firma... + elaborazione firma... + verifica firma... + firma... + lettura dati... + ricerca chiave... + decompressione dati... + verifica integrita\'... + eliminazione sicura di \'%s\'... + interrogazione... + Ricerca Chiavi Pubbliche + Cerca Chiave Privata + Condividi chiave con... 512 1024 2048 4096 + veloce + molto lento + Inizia NFC Beam - Changelog - About + Novita\' + Info Versione: + Importa chiavi selezionate + Importa, Firma e carica le chiavi selezionate + Importa dagli appunti + + Codice QR con ID %s mancante + Codici QR con ID %s mancanti + + Perfavore inizia col Codice QR con ID 1 + Codica QR deformato! Prova di nuovo! + Scansione codice QR completata! + Impronta contenuta nel Codice QR troppo corta (< 16 caratteri) + Scansiona il Codice QR con \'Barcode Scanner\' + Per ricevere le chiavi via NFC, il dispositivo deve essere sbloccato. + Aiuto + Ottieni chiave dagli appunti - OpenPGP: Cifrare - OpenPGP: Decifrare + OpenKeyChain: Decodifica File + OpenKeyChain: Importa Chiave + OpenKeychain: Codifica + OpenKeychain: Decodifica + Nessuna app registrata!\n\nApp di terza parti possono richiedere accesso a OpenKeychain. Dopo aver concesso l\'accesso, saranno elencate qui. + Mostra impostazioni avanzate + Nascondi impostazioni avanzate Nessuna chiave selezionata - Selezionare chiave - Salvare - Cancellare - Revocare l\'accesso - Permettere l\'accesso - Disabilitare l\'accesso + Seleziona chiave + Salva + Annulla + Revoca accesso + Nome Pacchetto + SHA-256 della Firma del Pacchetto + 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 accesso + Nega accesso Per favore selezionare una chiave! + Nessuna chiave pubblica trovata per id utente: + Esistono piu\' di una chiave pubblica per gli id utenti: + Per favore ricontrolla la lista destinatari! + 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$d + Condividi tramite NFC + + 1 chiave selezionata. + %d chiavi selezionate. + + Nessuna chiave disponibile... + Puoi iniziare da + o + creazione della tua chiave + importazione chiavi. + Codifica a questo contatto + Certifica la chiave di questo contatto + Info + Certificazioni + Contatti + Codifica + Decodifica + Importare Chiavi + Le Mie Chiavi + App Registrate + Apri drawer di navigazione + Chiudi drawer di navigazione diff --git a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml index 15043c93a..c99f8b31c 100644 --- a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml @@ -258,6 +258,9 @@ 期限日時は生成日時より後である必要があります この連絡先はあなたなので削除できません。 この連絡先はあなたなので削除できません。:\n%s + サーバへのクエリーが不足しています + 鍵サーバへのクエリーが失敗 + レスポンスが多すぎます \'自分の鍵\'画面から削除してください! @@ -326,12 +329,12 @@ ヘルプ クリップボードから鍵を取得 - OpenPGP: ファイル復号 - OpenPGP: 鍵のインポート - OpenPGP: 暗号化 - OpenPGP: 復号化 + OpenKeychain: ファイル復号化 + OpenKeychain: 鍵のインポート + OpenKeychain: 暗号化 + OpenKeychain: 復号化 - 登録されていないアプリケーション!\n\nサードパーティアプリケーションはOpenPGP Keychainにアクセスを要求できます。アクセスを与えた後、それらはここにリストされます。 + 登録されていないアプリケーション!\n\nサードパーティアプリケーションはOpenKeychainにアクセスを要求できます。アクセスを与えた後、それらはここにリストされます。 拡張設定を表示 拡張設定を非表示 鍵が選択されていない @@ -341,14 +344,14 @@ 破棄されたアクセス パッケージ名 パッケージの署名 SHA-256 - 表示されているアプリケーションはOpenPGP Keychainへのアクセスを要求しています。\nアクセスを許可しますか?\n\n注意: もしなぜスクリーンに表れたかわからないなら、アクセスを許可しないでください! あなたは\'登録済みアプリケーション\'スクリーンを使って、以降のアクセスを破棄するこもできます。 + 表示されているアプリケーションはOpenKeychainへのアクセスを要求しています。\nアクセスを許可しますか?\n\n注意: もしなぜスクリーンに表れたかわからないなら、アクセスを許可しないでください! あなたは\'登録済みアプリケーション\'スクリーンを使って、以降のアクセスを破棄するこもできます。 許可されたアクセス 許可されないアクセス 鍵を選択してください! このユーザIDについて公開鍵が見付かりません: このユーザIDについて1つ以上の公開鍵が存在します: 受信者リストを確認してください! - 署名チェックが失敗! 違うところからこのアプリをインストールしましたか? もし攻撃されてでなくそうであるなら、OpenPGP Keychainにあるこのアプリの登録を破棄し、再度アプリを登録してください。 + 署名チェックが失敗! 違うところからこのアプリをインストールしましたか? もし攻撃されてでなくそうであるなら、OpenKeychainにあるこのアプリの登録を破棄し、再度アプリを登録してください。 QRコードで共有 すべてのQRコードを見る場合、\'次\' を押して一つ一つスキャンしてください。 diff --git a/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml b/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml index 72a8fdea8..7d7efa616 100644 --- a/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml @@ -220,10 +220,6 @@ QR-code ongeldig. Probeer het opnieuw QR-code gescand - OpenPGP: bestand ontsleutelen - OpenPGP: sleutel importeren - OpenPGP: versleutelen - OpenPGP: ontsleutelen Geen sleutel geselecteerd Sleutel selecteren diff --git a/OpenPGP-Keychain/src/main/res/values-ru/strings.xml b/OpenPGP-Keychain/src/main/res/values-ru/strings.xml index cbc394766..7d865cc23 100644 --- a/OpenPGP-Keychain/src/main/res/values-ru/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ru/strings.xml @@ -111,6 +111,7 @@ Помнить пароль Сжатие сообщения Сжатие файла + Использовать старые OpenPGPV3 подписи Серверы ключей ID ключа Создан @@ -261,6 +262,7 @@ ключ для подписи не задан некорректное шифрование данные повреждены + Проверка целостности не удалась! Данные изменились! не найден блок симметричного шифрования неправильный пароль ошибка сохранения ключей @@ -272,6 +274,9 @@ срок годности не может быть раньше даты создания нельзя удалить свой собственный контакт. Пожалуйста, удалите его в разделе \'Мои ключи\'! это ваши собственные контакты, их нельзя удалить:\n%s + Ограничение запроса сервера + Сбой запроса сервера ключей + Слишком много ответов Пожалуйста, удалите его в разделе \'Мои ключи\'! Пожалуйста, удалите их в разделе \'Мои ключи\'! @@ -346,12 +351,12 @@ Помощь Получить ключ из буфера - OpenPGP: Расшифровать файл - OpenPGP: Импортировать ключ - OpenPGP: Зашифровать - OpenPGP: Расшифровать + OpenKeychain: Расшифровать файл + OpenKeychain: Импортировать ключ + OpenKeychain: Зашифровать + OpenKeychain: Расшифровать - Нет связанных программ!\n\nСторонние программы могут запросить доступ к OpenPGP Keychain, после чего они будут отражаться здесь. + Нет связанных программ!\n\nСторонние программы могут запросить доступ к OpenKeychain, после чего они будут отражаться здесь. Показать расширенные настройки Скрыть расширенные настройки Ключ не выбран @@ -361,14 +366,14 @@ Отозвать доступ Наименование пакета SHA-256 подписи пакета - Данное приложение запрашивает доступ к OpenPGP Keychain.\nРазрешить доступ?\n\nВНИМАНИЕ: Если вы не знаете почему возник этот запрос, откажите в доступе!\nПозже вы можете отозвать право доступа в разделе \"Зарегистрированные программы\". + Данное приложение запрашивает доступ к OpenKeychain.\nРазрешить доступ?\n\nВНИМАНИЕ: Если вы не знаете почему возник этот запрос, откажите в доступе!\nПозже вы можете отозвать право доступа в разделе \"Зарегистрированные программы\". Разрешить доступ Запретить доступ Пожалуйста, выберите ключ! Для этих id не найдены публичные ключи: Для этих id найдено более одного ключа: Пожалуйста, проверьте получателей! - Проверка подписи пакета не удалась! Если вы установили программу из другого источника, отзовите или обновите право доступа. + Проверка подписи пакета не удалась! Если вы установили программу из другого источника, отзовите для неё доступ к этой программе или обновите право доступа. Отправить как QR код Сканируйте несколько QR подряд, нажимая \'Далее\' после каждого кода. diff --git a/OpenPGP-Keychain/src/main/res/values-uk/strings.xml b/OpenPGP-Keychain/src/main/res/values-uk/strings.xml index 47cbb38b3..7f1766a5c 100644 --- a/OpenPGP-Keychain/src/main/res/values-uk/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-uk/strings.xml @@ -274,6 +274,9 @@ дата завершення дії має йти після дати створення ви не можете вилучити цей контакт, тому що він ваш власний. ви не можете вилучити наступні контакти, тому що вони - ваші власні:\n%s + Запит обмеженого сервера + Збій сервера ключа запиту + Забагато відповідей Будь ласка, вилучіть його з екрану „Мої ключі“! Будь ласка, вилучіть їх з екрану „Мої ключі“! @@ -370,7 +373,7 @@ Не знайдено публічних ключів для цих ІД користувачів: Більше ніж один публічний ключ існує для цих ІД користувачів: Будь ласка, перевірте список одержувачів! - Перевірка підпису пакета не вдалася! Якщо ви встановили програму з іншого джерела, відкличте або поновіть право доступу. + Перевірка підпису пакету не вдалася! Може ви встановили програму з іншого джерела? Якщо ви впевнені, що це не атака, то відкличте реєстрацію програми у OpenKeychain та знову зареєструйте її. Відправити як штрих-код Пройдіть через усі штрих-коди за допомогою \"Далі\", а також проскануйте їх по одному. diff --git a/OpenPGP-Keychain/src/main/res/values-zh/strings.xml b/OpenPGP-Keychain/src/main/res/values-zh/strings.xml index 30d6a3518..f9422b64b 100644 --- a/OpenPGP-Keychain/src/main/res/values-zh/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-zh/strings.xml @@ -135,10 +135,6 @@ 二维码扫描完成! 帮助 - OpenPGP: 解密文件 - OpenPGP: 导入密钥 - OpenPGP: 加密 - OpenPGP: 解密 显示高级设置 隐藏高级设置 -- cgit v1.2.3 From 6ddccb0d6f6f26acde68e87f9779846927d4cc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 2 Mar 2014 18:15:11 +0100 Subject: version code 23101 for beta testing --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 480acdbd8..09585f83d 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ done. + cancel saving… importing… exporting… -- cgit v1.2.3 From 91a2ecb15ce5acd720c8f23c3a09e60aad2baa1a Mon Sep 17 00:00:00 2001 From: Jessica Yuen Date: Sun, 2 Mar 2014 17:33:21 -0500 Subject: #226: Activity no longer closes if progress is canceled for key creation in EditKeyActivity --- .../keychain/service/KeychainIntentServiceHandler.java | 7 ++++--- .../sufficientlysecure/keychain/ui/EditKeyActivity.java | 2 +- .../keychain/ui/dialog/DeleteFileDialogFragment.java | 2 +- .../keychain/ui/dialog/ProgressDialogFragment.java | 14 ++++++++++---- .../sufficientlysecure/keychain/ui/widget/SectionView.java | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java index 530bbc7ac..5711be596 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java @@ -57,14 +57,15 @@ public class KeychainIntentServiceHandler extends Handler { } public KeychainIntentServiceHandler(Activity activity, int progressDialogMessageId, int progressDialogStyle) { - this(activity, progressDialogMessageId, progressDialogStyle, false); + this(activity, progressDialogMessageId, progressDialogStyle, false, false); } public KeychainIntentServiceHandler(Activity activity, int progressDialogMessageId, - int progressDialogStyle, boolean cancelable) { + int progressDialogStyle, boolean cancelable, + boolean finishActivityOnCancel) { this.mActivity = activity; this.mProgressDialogFragment = ProgressDialogFragment.newInstance(progressDialogMessageId, - progressDialogStyle, cancelable); + progressDialogStyle, cancelable, finishActivityOnCancel); } public void showProgressDialog(FragmentActivity activity) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index cb76e37c6..09b258fcb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -185,7 +185,7 @@ public class EditKeyActivity extends ActionBarActivity { // Message is received after generating is done in ApgService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler( - this, R.string.progress_generating, ProgressDialog.STYLE_SPINNER, true) { + this, R.string.progress_generating, ProgressDialog.STYLE_SPINNER, true, true) { @Override public void handleMessage(Message message) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java index 8d428edd6..dc4384886 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java @@ -83,7 +83,7 @@ public class DeleteFileDialogFragment extends DialogFragment { intent.putExtra(KeychainIntentService.EXTRA_DATA, data); ProgressDialogFragment deletingDialog = ProgressDialogFragment.newInstance( - R.string.progress_deleting_securely, ProgressDialog.STYLE_HORIZONTAL, false); + R.string.progress_deleting_securely, ProgressDialog.STYLE_HORIZONTAL, false, false); // Message is received after deleting is done in ApgService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(activity, deletingDialog) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java index cac257c85..0bfd4185e 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java @@ -32,6 +32,7 @@ public class ProgressDialogFragment extends DialogFragment { private static final String ARG_MESSAGE_ID = "message_id"; private static final String ARG_STYLE = "style"; private static final String ARG_CANCELABLE = "cancelable"; + private static final String ARG_FINISH_ON_CANCEL = "finish_activity_on_cancel"; /** * Creates new instance of this fragment @@ -41,13 +42,14 @@ public class ProgressDialogFragment extends DialogFragment { * @param cancelable * @return */ - public static ProgressDialogFragment newInstance(int messageId, int style, - boolean cancelable) { + public static ProgressDialogFragment newInstance(int messageId, int style, boolean cancelable, + boolean finishActivityOnCancel) { ProgressDialogFragment frag = new ProgressDialogFragment(); Bundle args = new Bundle(); args.putInt(ARG_MESSAGE_ID, messageId); args.putInt(ARG_STYLE, style); args.putBoolean(ARG_CANCELABLE, cancelable); + args.putBoolean(ARG_FINISH_ON_CANCEL, finishActivityOnCancel); frag.setArguments(args); return frag; @@ -118,8 +120,12 @@ public class ProgressDialogFragment extends DialogFragment { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); - activity.setResult(Activity.RESULT_CANCELED); - activity.finish(); + + boolean finishActivity = getArguments().getBoolean(ARG_FINISH_ON_CANCEL); + if (finishActivity) { + activity.setResult(Activity.RESULT_CANCELED); + activity.finish(); + } } }); } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java index 038b8a613..89d1e187c 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java @@ -238,7 +238,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor // show progress dialog mGeneratingDialog = ProgressDialogFragment.newInstance(R.string.progress_generating, - ProgressDialog.STYLE_SPINNER, true); + ProgressDialog.STYLE_SPINNER, true, false); // Message is received after generating is done in ApgService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(mActivity, -- cgit v1.2.3 From e4e3c555e9ac89cffad594dfc922715309b3b299 Mon Sep 17 00:00:00 2001 From: Jessica Yuen Date: Sun, 2 Mar 2014 20:55:13 -0500 Subject: #226: Async key gen task is stopped if progress is canceled --- .../service/KeychainIntentServiceHandler.java | 6 +++--- .../keychain/ui/EditKeyActivity.java | 16 +++++++++++++-- .../ui/dialog/DeleteFileDialogFragment.java | 2 +- .../keychain/ui/dialog/ProgressDialogFragment.java | 23 +++++++++++++--------- .../keychain/ui/widget/SectionView.java | 10 ++++++++-- 5 files changed, 40 insertions(+), 17 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java index 5711be596..6eba9cc83 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentServiceHandler.java @@ -57,15 +57,15 @@ public class KeychainIntentServiceHandler extends Handler { } public KeychainIntentServiceHandler(Activity activity, int progressDialogMessageId, int progressDialogStyle) { - this(activity, progressDialogMessageId, progressDialogStyle, false, false); + this(activity, progressDialogMessageId, progressDialogStyle, false, null); } public KeychainIntentServiceHandler(Activity activity, int progressDialogMessageId, int progressDialogStyle, boolean cancelable, - boolean finishActivityOnCancel) { + OnCancelListener onCancelListener) { this.mActivity = activity; this.mProgressDialogFragment = ProgressDialogFragment.newInstance(progressDialogMessageId, - progressDialogStyle, cancelable, finishActivityOnCancel); + progressDialogStyle, cancelable, onCancelListener); } public void showProgressDialog(FragmentActivity activity) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 09b258fcb..0bed6f264 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -44,8 +44,10 @@ import org.sufficientlysecure.keychain.ui.widget.UserIdEditor; import org.sufficientlysecure.keychain.util.IterableIterator; import org.sufficientlysecure.keychain.util.Log; +import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; @@ -173,7 +175,7 @@ public class EditKeyActivity extends ActionBarActivity { if (generateDefaultKeys) { // Send all information needed to service generate keys in other thread - Intent serviceIntent = new Intent(this, KeychainIntentService.class); + final Intent serviceIntent = new Intent(this, KeychainIntentService.class); serviceIntent.setAction(KeychainIntentService.ACTION_GENERATE_DEFAULT_RSA_KEYS); // fill values for this action @@ -185,7 +187,17 @@ public class EditKeyActivity extends ActionBarActivity { // Message is received after generating is done in ApgService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler( - this, R.string.progress_generating, ProgressDialog.STYLE_SPINNER, true, true) { + this, R.string.progress_generating, ProgressDialog.STYLE_SPINNER, true, + + new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + // Stop key generation on cancel + stopService(serviceIntent); + EditKeyActivity.this.setResult(Activity.RESULT_CANCELED); + EditKeyActivity.this.finish(); + } + }) { @Override public void handleMessage(Message message) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java index dc4384886..cd8bc79a9 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/DeleteFileDialogFragment.java @@ -83,7 +83,7 @@ public class DeleteFileDialogFragment extends DialogFragment { intent.putExtra(KeychainIntentService.EXTRA_DATA, data); ProgressDialogFragment deletingDialog = ProgressDialogFragment.newInstance( - R.string.progress_deleting_securely, ProgressDialog.STYLE_HORIZONTAL, false, false); + R.string.progress_deleting_securely, ProgressDialog.STYLE_HORIZONTAL, false, null); // Message is received after deleting is done in ApgService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(activity, deletingDialog) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java index 0bfd4185e..6c62d14e0 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java @@ -21,6 +21,7 @@ import android.app.Activity; import android.app.Dialog; import android.app.ProgressDialog; import android.content.DialogInterface; +import android.content.DialogInterface.OnCancelListener; import android.content.DialogInterface.OnKeyListener; import android.os.Bundle; import android.support.v4.app.DialogFragment; @@ -32,7 +33,8 @@ public class ProgressDialogFragment extends DialogFragment { private static final String ARG_MESSAGE_ID = "message_id"; private static final String ARG_STYLE = "style"; private static final String ARG_CANCELABLE = "cancelable"; - private static final String ARG_FINISH_ON_CANCEL = "finish_activity_on_cancel"; + + private OnCancelListener mOnCancelListener; /** * Creates new instance of this fragment @@ -43,15 +45,16 @@ public class ProgressDialogFragment extends DialogFragment { * @return */ public static ProgressDialogFragment newInstance(int messageId, int style, boolean cancelable, - boolean finishActivityOnCancel) { + OnCancelListener onCancelListener) { ProgressDialogFragment frag = new ProgressDialogFragment(); Bundle args = new Bundle(); args.putInt(ARG_MESSAGE_ID, messageId); args.putInt(ARG_STYLE, style); args.putBoolean(ARG_CANCELABLE, cancelable); - args.putBoolean(ARG_FINISH_ON_CANCEL, finishActivityOnCancel); frag.setArguments(args); + frag.mOnCancelListener = onCancelListener; + return frag; } @@ -94,6 +97,14 @@ public class ProgressDialogFragment extends DialogFragment { dialog.setMax(max); } + @Override + public void onCancel(DialogInterface dialog) { + super.onCancel(dialog); + + if (this.mOnCancelListener != null) + this.mOnCancelListener.onCancel(dialog); + } + /** * Creates dialog */ @@ -120,12 +131,6 @@ public class ProgressDialogFragment extends DialogFragment { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); - - boolean finishActivity = getArguments().getBoolean(ARG_FINISH_ON_CANCEL); - if (finishActivity) { - activity.setResult(Activity.RESULT_CANCELED); - activity.finish(); - } } }); } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java index 89d1e187c..a95d80a4e 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java @@ -18,6 +18,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; @@ -211,7 +212,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor private void createKey() { // Send all information needed to service to edit key in other thread - Intent intent = new Intent(mActivity, KeychainIntentService.class); + final Intent intent = new Intent(mActivity, KeychainIntentService.class); intent.setAction(KeychainIntentService.ACTION_GENERATE_KEY); @@ -238,7 +239,12 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor // show progress dialog mGeneratingDialog = ProgressDialogFragment.newInstance(R.string.progress_generating, - ProgressDialog.STYLE_SPINNER, true, false); + ProgressDialog.STYLE_SPINNER, true, new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + mActivity.stopService(intent); + } + }); // Message is received after generating is done in ApgService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(mActivity, -- cgit v1.2.3 From 122e562675bd64ab6fe7fa2327b12097fa122c30 Mon Sep 17 00:00:00 2001 From: Emantor Date: Mon, 3 Mar 2014 11:48:45 +0100 Subject: Fix ScrollViewSize Lint Warnings --- OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml | 4 ++-- OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml | 4 ++-- OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml b/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml index c60416494..aa9d59004 100644 --- a/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml @@ -6,7 +6,7 @@ @@ -26,4 +26,4 @@ tools:layout="@layout/api_app_settings_fragment" /> - \ No newline at end of file + diff --git a/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml b/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml index d4fb5103a..d83c8e87d 100644 --- a/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml @@ -6,7 +6,7 @@ @@ -18,4 +18,4 @@ tools:layout="@layout/api_app_settings_fragment" /> - \ No newline at end of file + diff --git a/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml b/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml index 8b99e5d2f..4a09e4240 100644 --- a/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml +++ b/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml @@ -71,8 +71,8 @@ - \ No newline at end of file + -- cgit v1.2.3 From 736eac074d23091c7cd1f12ba8eea390890e2b77 Mon Sep 17 00:00:00 2001 From: Emantor Date: Mon, 3 Mar 2014 11:50:48 +0100 Subject: Fix DefaultLocale Lint Warnings --- .../java/org/sufficientlysecure/keychain/util/HkpKeyServer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java index 61fe13ffb..9c169506b 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.Locale import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -172,11 +173,11 @@ public class HkpKeyServer extends KeyServer { if (e.getCode() == 404) { return results; } else { - if (e.getData().toLowerCase().contains("no keys found")) { + if (e.getData().toLowerCase(Locale.US).contains("no keys found")) { return results; - } else if (e.getData().toLowerCase().contains("too many")) { + } else if (e.getData().toLowerCase(Locale.US).contains("too many")) { throw new TooManyResponses(); - } else if (e.getData().toLowerCase().contains("insufficient")) { + } else if (e.getData().toLowerCase(Locale.US).contains("insufficient")) { throw new InsufficientQuery(); } } -- cgit v1.2.3 From ed7485e91d38c1201154843c983581162b2f0c0a Mon Sep 17 00:00:00 2001 From: Emantor Date: Mon, 3 Mar 2014 11:55:36 +0100 Subject: Fix NewApi Lint Errors Fix missing ; import android.annotation.TargetApi where needed --- .../org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java | 7 +++++-- .../org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java | 2 ++ .../java/org/sufficientlysecure/keychain/util/HkpKeyServer.java | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java index c28d57627..0afa556cb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java @@ -33,6 +33,7 @@ import se.emilsjolander.stickylistheaders.ApiLevelTooLowException; import se.emilsjolander.stickylistheaders.StickyListHeadersListView; import android.annotation.SuppressLint; +import android.annotation.TargetApi; import android.content.Intent; import android.database.Cursor; import android.net.Uri; @@ -276,7 +277,8 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte viewIntent.setData(KeychainContract.KeyRings.buildPublicKeyRingsUri(Long.toString(id))); startActivity(viewIntent); } - + + @TargetApi(11) public void encrypt(ActionMode mode, long[] keyRingRowIds) { // get master key ids from row ids long[] keyRingIds = new long[keyRingRowIds.length]; @@ -298,6 +300,7 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte * * @param keyRingRowIds */ + @TargetApi(11) public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) { // Message is received after key is deleted Handler returnHandler = new Handler() { @@ -332,4 +335,4 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte deleteKeyDialog.show(getActivity().getSupportFragmentManager(), "deleteKeyDialog"); } -} \ No newline at end of file +} diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java index f9d267f27..7bb77b60f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java @@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.ui.adapter.KeyListSecretAdapter; import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment; import android.annotation.SuppressLint; +import android.annotation.TargetApi; import android.content.Intent; import android.database.Cursor; import android.net.Uri; @@ -209,6 +210,7 @@ public class KeyListSecretFragment extends ListFragment implements * * @param keyRingRowIds */ + @TargetApi(11) public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) { // Message is received after key is deleted Handler returnHandler = new Handler() { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java index 9c169506b..b94c42e90 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.Locale +import java.util.Locale; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; -- cgit v1.2.3 From 94e161fe0d08149d26b0d5dcd41bb883d1162ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 3 Mar 2014 15:45:53 +0100 Subject: change ordering in Intent descriptions for better readability in small dialogs --- OpenPGP-Keychain/src/main/res/values/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/values/strings.xml b/OpenPGP-Keychain/src/main/res/values/strings.xml index 91359701f..46ffe5493 100644 --- a/OpenPGP-Keychain/src/main/res/values/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values/strings.xml @@ -371,10 +371,10 @@ Get key from clipboard - OpenKeychain: Decrypt File - OpenKeychain: Import Key - OpenKeychain: Encrypt - OpenKeychain: Decrypt + Decrypt File with OpenKeychain + Import Key with OpenKeychain + Encrypt with OpenKeychain + Decrypt with OpenKeychain No registered applications!\n\nThird-party applications can request access to OpenKeychain. After granting access, they will be listed here. -- cgit v1.2.3 From af6713dc78448b7686a546d77c022f4aacd58dfb Mon Sep 17 00:00:00 2001 From: Jessica Yuen Date: Mon, 3 Mar 2014 23:04:55 -0500 Subject: #226: Small fix to prevent message from being sent if IntentService is canceled --- .../keychain/service/KeychainIntentService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 3904a91d8..302dbea0b 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -203,10 +203,18 @@ public class KeychainIntentService extends IntentService implements ProgressDial Messenger mMessenger; + private boolean mIsCanceled; + public KeychainIntentService() { super("ApgService"); } + @Override + public void onDestroy() { + super.onDestroy(); + this.mIsCanceled = true; + } + /** * The IntentService calls this method from the default worker thread with the intent that * started the service. When this method returns, IntentService stops the service, as @@ -815,6 +823,10 @@ public class KeychainIntentService extends IntentService implements ProgressDial } private void sendErrorToHandler(Exception e) { + // Service was canceled. Do not send error to handler. + if (this.mIsCanceled) + return; + Log.e(Constants.TAG, "ApgService Exception: ", e); e.printStackTrace(); @@ -824,6 +836,10 @@ public class KeychainIntentService extends IntentService implements ProgressDial } private void sendMessageToHandler(Integer arg1, Integer arg2, Bundle data) { + // Service was canceled. Do not send message to handler. + if (this.mIsCanceled) + return; + Message msg = Message.obtain(); msg.arg1 = arg1; if (arg2 != null) { -- cgit v1.2.3 From e4461b788f85d30b0549a6e7df5e9b1d4097b033 Mon Sep 17 00:00:00 2001 From: mj7007 Date: Tue, 4 Mar 2014 13:57:20 +0530 Subject: Smooth Activity Switch Fixed --- .../keychain/ui/DrawerActivity.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java index 53a57c4cd..08ca262c3 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java @@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.service.remote.RegisteredAppsListActivity; +import org.sufficientlysecure.keychain.util.Log; import android.app.Activity; import android.content.Context; @@ -52,6 +53,7 @@ public class DrawerActivity extends ActionBarActivity { private static Class[] mItemsClass = new Class[] { KeyListPublicActivity.class, EncryptActivity.class, DecryptActivity.class, ImportKeysActivity.class, KeyListSecretActivity.class, RegisteredAppsListActivity.class }; + private Class mSelectedItem; private static final int MENU_ID_PREFERENCE = 222; private static final int MENU_ID_HELP = 223; @@ -94,6 +96,17 @@ public class DrawerActivity extends ActionBarActivity { getSupportActionBar().setTitle(mTitle); // creates call to onPrepareOptionsMenu() supportInvalidateOptionsMenu(); + + // call intent activity if selected + if(mSelectedItem != null) { + finish(); + overridePendingTransition(0, 0); + + Intent intent = new Intent(DrawerActivity.this, mSelectedItem); + startActivity(intent); + // disable animation of activity start + overridePendingTransition(0, 0); + } } public void onDrawerOpened(View drawerView) { @@ -182,14 +195,8 @@ public class DrawerActivity extends ActionBarActivity { mDrawerList.setItemChecked(position, true); // setTitle(mDrawerTitles[position]); mDrawerLayout.closeDrawer(mDrawerList); - - finish(); - overridePendingTransition(0, 0); - - Intent intent = new Intent(this, mItemsClass[position]); - startActivity(intent); - // disable animation of activity start - overridePendingTransition(0, 0); + // set selected class + mSelectedItem = mItemsClass[position]; } /** -- cgit v1.2.3 From 0a12c41ca96977188bf08d60e49cd266c7ba147a Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Tue, 4 Mar 2014 18:45:06 +0530 Subject: Extend DatePickerDialog and override setTitle() method. --- .../sufficientlysecure/keychain/ui/widget/KeyEditor.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index 6c265057e..60f505858 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -114,7 +114,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { date = new GregorianCalendar(TimeZone.getTimeZone("UTC")); } - DatePickerDialog dialog = new DatePickerDialog(getContext(), + DatePickerDialog dialog = new ExpiryDatePickerDialog(getContext(), mExpiryDateSetListener, date.get(Calendar.YEAR), date.get(Calendar.MONTH), date.get(Calendar.DAY_OF_MONTH)); mDatePickerResultCount = 0; @@ -253,3 +253,14 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { } } + +class ExpiryDatePickerDialog extends DatePickerDialog { + + public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) { + super(context, callBack, year, monthOfYear, dayOfMonth); + } + + public void setTitle(CharSequence title) { + super.setTitle("Set date"); + } +} -- cgit v1.2.3 From 50813ef188aefb78166a001f57b1f09b538a6aef Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Tue, 4 Mar 2014 19:20:56 +0530 Subject: Hide CalendarView in tablets --- .../main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index 60f505858..b88d3bd32 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -129,6 +129,9 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { } } }); + //setCalendarViewShown() is supported from API 11 onwards. + if (android.os.Build.VERSION.SDK_INT >= 11) + dialog.getDatePicker().setCalendarViewShown(false); dialog.show(); } }); -- cgit v1.2.3 From 89a4c38cc09425ac2e302882a63a30bdfe8a7e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 15:18:05 +0100 Subject: return SIGNATURE_SUCCESS_UNCERTIFIED from service --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 3 ++- .../org/sufficientlysecure/keychain/service/remote/OpenPgpService.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 749229115..cec1422d9 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -22,7 +22,8 @@ Remarks about the ugly android:pathPattern: - We are matching all files with a specific file ending. This is done in an ugly way because of Android limitations. - Read http://stackoverflow.com/questions/1733195/android-intent-filter-for-a-particular-file-extension and http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i/8599921 + Read http://stackoverflow.com/questions/1733195/android-intent-filter-for-a-particular-file-extension + and http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i/8599921 for more information. - Do _not_ set mimeType for gpg! Cyanogenmod's file manager will only show Keychain for gpg files if no mimeType is set! diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index 8c8e6f00a..5d2f5a815 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -369,9 +369,10 @@ public class OpenPgpService extends RemoteService { boolean signatureOnly = outputBundle .getBoolean(KeychainIntentService.RESULT_CLEARTEXT_SIGNATURE_ONLY, false); + // TODO: SIGNATURE_SUCCESS_CERTIFIED is currently not implemented int signatureStatus = OpenPgpSignatureResult.SIGNATURE_ERROR; if (signatureSuccess) { - signatureStatus = OpenPgpSignatureResult.SIGNATURE_SUCCESS_CERTIFIED; + signatureStatus = OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED; } else if (signatureUnknown) { signatureStatus = OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY; -- cgit v1.2.3 From 06f9134eb1c386446d56fe58fa49c35b7482ed86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 20:53:44 +0100 Subject: Enforce private key for applications, verify signed-only texts without passphrase input, better internal decrypt and verify method --- .../keychain/pgp/PgpDecryptVerify.java | 137 +++++++++++++++------ .../keychain/pgp/PgpDecryptVerifyResult.java | 88 +++++++++++++ .../keychain/service/KeychainIntentService.java | 19 ++- .../keychain/service/remote/OpenPgpService.java | 111 +++-------------- .../keychain/ui/DecryptActivity.java | 57 ++++++--- 5 files changed, 250 insertions(+), 162 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyResult.java (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index fb97f3a5c..be80da4e3 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -18,8 +18,8 @@ package org.sufficientlysecure.keychain.pgp; import android.content.Context; -import android.os.Bundle; +import org.openintents.openpgp.OpenPgpSignatureResult; import org.spongycastle.bcpg.ArmoredInputStream; import org.spongycastle.bcpg.SignatureSubpacketTags; import org.spongycastle.openpgp.PGPCompressedData; @@ -36,6 +36,7 @@ import org.spongycastle.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKeyEncryptedData; import org.spongycastle.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPSecretKey; +import org.spongycastle.openpgp.PGPSecretKeyRing; import org.spongycastle.openpgp.PGPSignature; import org.spongycastle.openpgp.PGPSignatureList; import org.spongycastle.openpgp.PGPSignatureSubpacketVector; @@ -53,7 +54,7 @@ import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.service.KeychainIntentService; +import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.ProgressDialogUpdater; @@ -75,9 +76,10 @@ public class PgpDecryptVerify { private InputData data; private OutputStream outStream; - private ProgressDialogUpdater progress; - boolean assumeSymmetric; - String passphrase; + private ProgressDialogUpdater progressDialogUpdater; + private boolean assumeSymmetric; + private String passphrase; + private long enforcedKeyId; private PgpDecryptVerify(Builder builder) { // private Constructor can only be called from Builder @@ -85,9 +87,10 @@ public class PgpDecryptVerify { this.data = builder.data; this.outStream = builder.outStream; - this.progress = builder.progress; + this.progressDialogUpdater = builder.progressDialogUpdater; this.assumeSymmetric = builder.assumeSymmetric; this.passphrase = builder.passphrase; + this.enforcedKeyId = builder.enforcedKeyId; } public static class Builder { @@ -97,9 +100,10 @@ public class PgpDecryptVerify { private OutputStream outStream; // optional - private ProgressDialogUpdater progress = null; + private ProgressDialogUpdater progressDialogUpdater = null; private boolean assumeSymmetric = false; private String passphrase = ""; + private long enforcedKeyId = 0; public Builder(Context context, InputData data, OutputStream outStream) { this.context = context; @@ -107,8 +111,8 @@ public class PgpDecryptVerify { this.outStream = outStream; } - public Builder progress(ProgressDialogUpdater progress) { - this.progress = progress; + public Builder progressDialogUpdater(ProgressDialogUpdater progressDialogUpdater) { + this.progressDialogUpdater = progressDialogUpdater; return this; } @@ -122,20 +126,32 @@ public class PgpDecryptVerify { return this; } + /** + * Allow this key id alone for decryption. + * This means only ciphertexts encrypted for this private key can be decrypted. + * + * @param enforcedKeyId + * @return + */ + public Builder enforcedKeyId(long enforcedKeyId) { + this.enforcedKeyId = enforcedKeyId; + return this; + } + public PgpDecryptVerify build() { return new PgpDecryptVerify(this); } } public void updateProgress(int message, int current, int total) { - if (progress != null) { - progress.setProgress(message, current, total); + if (progressDialogUpdater != null) { + progressDialogUpdater.setProgress(message, current, total); } } public void updateProgress(int current, int total) { - if (progress != null) { - progress.setProgress(current, total); + if (progressDialogUpdater != null) { + progressDialogUpdater.setProgress(current, total); } } @@ -177,9 +193,8 @@ public class PgpDecryptVerify { * @throws PGPException * @throws SignatureException */ - public Bundle execute() + public PgpDecryptVerifyResult execute() throws IOException, PgpGeneralException, PGPException, SignatureException { - // automatically works with ascii armor input and binary InputStream in = PGPUtil.getDecoderStream(data.getInputStream()); if (in instanceof ArmoredInputStream) { @@ -207,9 +222,9 @@ public class PgpDecryptVerify { * @throws PGPException * @throws SignatureException */ - private Bundle decryptVerify(InputStream in) + private PgpDecryptVerifyResult decryptVerify(InputStream in) throws IOException, PgpGeneralException, PGPException, SignatureException { - Bundle returnData = new Bundle(); + PgpDecryptVerifyResult returnData = new PgpDecryptVerifyResult(); PGPObjectFactory pgpF = new PGPObjectFactory(in); PGPEncryptedDataList enc; @@ -277,9 +292,38 @@ public class PgpDecryptVerify { PGPPublicKeyEncryptedData encData = (PGPPublicKeyEncryptedData) obj; secretKey = ProviderHelper.getPGPSecretKeyByKeyId(context, encData.getKeyID()); if (secretKey != null) { + // secret key exists in database + + // allow only a specific key for decryption? + if (enforcedKeyId != 0) { + // TODO: improve this code! get master key directly! + PGPSecretKeyRing secretKeyRing = ProviderHelper.getPGPSecretKeyRingByKeyId(context, encData.getKeyID()); + long masterKeyId = PgpKeyHelper.getMasterKey(secretKeyRing).getKeyID(); + Log.d(Constants.TAG, "encData.getKeyID():" + encData.getKeyID()); + Log.d(Constants.TAG, "enforcedKeyId: " + enforcedKeyId); + Log.d(Constants.TAG, "masterKeyId: " + masterKeyId); + + if (enforcedKeyId != masterKeyId) { + throw new PgpGeneralException(context.getString(R.string.error_no_secret_key_found)); + } + } + pbe = encData; + + // passphrase handling... + if (passphrase == null) { + // try to get cached passphrase + passphrase = PassphraseCacheService.getCachedPassphrase(context, encData.getKeyID()); + } + // if passphrase was not cached, return here! + if (passphrase == null) { + returnData.setKeyPassphraseNeeded(true); + return returnData; + } break; } + + } } @@ -317,6 +361,7 @@ public class PgpDecryptVerify { PGPObjectFactory plainFact = new PGPObjectFactory(clear); Object dataChunk = plainFact.nextObject(); PGPOnePassSignature signature = null; + OpenPgpSignatureResult signatureResult = null; PGPPublicKey signatureKey = null; int signatureIndex = -1; @@ -334,7 +379,7 @@ public class PgpDecryptVerify { if (dataChunk instanceof PGPOnePassSignatureList) { updateProgress(R.string.progress_processing_signature, currentProgress, 100); - returnData.putBoolean(KeychainIntentService.RESULT_SIGNATURE, true); + signatureResult = new OpenPgpSignatureResult(); PGPOnePassSignatureList sigList = (PGPOnePassSignatureList) dataChunk; for (int i = 0; i < sigList.size(); ++i) { signature = sigList.get(i); @@ -354,12 +399,12 @@ public class PgpDecryptVerify { if (signKeyRing != null) { userId = PgpKeyHelper.getMainUserId(PgpKeyHelper.getMasterKey(signKeyRing)); } - returnData.putString(KeychainIntentService.RESULT_SIGNATURE_USER_ID, userId); + signatureResult.setUserId(userId); break; } } - returnData.putLong(KeychainIntentService.RESULT_SIGNATURE_KEY_ID, signatureKeyId); + signatureResult.setKeyId(signatureKeyId); if (signature != null) { JcaPGPContentVerifierBuilderProvider contentVerifierBuilderProvider = new JcaPGPContentVerifierBuilderProvider() @@ -367,7 +412,7 @@ public class PgpDecryptVerify { signature.init(contentVerifierBuilderProvider, signatureKey); } else { - returnData.putBoolean(KeychainIntentService.RESULT_SIGNATURE_UNKNOWN, true); + signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY); } dataChunk = plainFact.nextObject(); @@ -395,25 +440,24 @@ public class PgpDecryptVerify { } int n; - // TODO: progress calculation is broken here! Try to rework it based on commented code! -// int progress = 0; + // TODO: progressDialogUpdater calculation is broken here! Try to rework it based on commented code! +// int progressDialogUpdater = 0; long startPos = data.getStreamPosition(); while ((n = dataIn.read(buffer)) > 0) { outStream.write(buffer, 0, n); -// progress += n; +// progressDialogUpdater += n; if (signature != null) { try { signature.update(buffer, 0, n); } catch (SignatureException e) { - returnData - .putBoolean(KeychainIntentService.RESULT_SIGNATURE_SUCCESS, false); + signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_ERROR); signature = null; } } // TODO: dead code?! - // unknown size, but try to at least have a moving, slowing down progress bar -// currentProgress = startProgress + (endProgress - startProgress) * progress -// / (progress + 100000); + // unknown size, but try to at least have a moving, slowing down progressDialogUpdater bar +// currentProgress = startProgress + (endProgress - startProgress) * progressDialogUpdater +// / (progressDialogUpdater + 100000); if (data.getSize() - startPos == 0) { currentProgress = endProgress; } else { @@ -430,17 +474,20 @@ public class PgpDecryptVerify { PGPSignature messageSignature = signatureList.get(signatureIndex); // these are not cleartext signatures! - returnData.putBoolean(KeychainIntentService.RESULT_CLEARTEXT_SIGNATURE_ONLY, false); + // TODO: what about binary signatures? + signatureResult.setSignatureOnly(false); //Now check binding signatures boolean keyBinding_isok = verifyKeyBinding(context, messageSignature, signatureKey); boolean sig_isok = signature.verify(messageSignature); - returnData.putBoolean(KeychainIntentService.RESULT_SIGNATURE_SUCCESS, keyBinding_isok & sig_isok); + // TODO: implement CERTIFIED! + if (keyBinding_isok & sig_isok) { + signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED); + } } } - // TODO: test if this integrity really check works! if (encryptedData.isIntegrityProtected()) { updateProgress(R.string.progress_verifying_integrity, 95, 100); @@ -455,9 +502,12 @@ public class PgpDecryptVerify { } else { // no integrity check Log.e(Constants.TAG, "Encrypted data was not integrity protected!"); + // TODO: inform user? } updateProgress(R.string.progress_done, 100, 100); + + returnData.setSignatureResult(signatureResult); return returnData; } @@ -474,11 +524,12 @@ public class PgpDecryptVerify { * @throws PGPException * @throws SignatureException */ - private Bundle verifyCleartextSignature(ArmoredInputStream aIn) + private PgpDecryptVerifyResult verifyCleartextSignature(ArmoredInputStream aIn) throws IOException, PgpGeneralException, PGPException, SignatureException { - Bundle returnData = new Bundle(); + PgpDecryptVerifyResult returnData = new PgpDecryptVerifyResult(); + OpenPgpSignatureResult signatureResult = new OpenPgpSignatureResult(); // cleartext signatures are never encrypted ;) - returnData.putBoolean(KeychainIntentService.RESULT_CLEARTEXT_SIGNATURE_ONLY, true); + signatureResult.setSignatureOnly(true); ByteArrayOutputStream out = new ByteArrayOutputStream(); @@ -504,8 +555,6 @@ public class PgpDecryptVerify { byte[] clearText = out.toByteArray(); outStream.write(clearText); - returnData.putBoolean(KeychainIntentService.RESULT_SIGNATURE, true); - updateProgress(R.string.progress_processing_signature, 60, 100); PGPObjectFactory pgpFact = new PGPObjectFactory(aIn); @@ -533,15 +582,15 @@ public class PgpDecryptVerify { if (signKeyRing != null) { userId = PgpKeyHelper.getMainUserId(PgpKeyHelper.getMasterKey(signKeyRing)); } - returnData.putString(KeychainIntentService.RESULT_SIGNATURE_USER_ID, userId); + signatureResult.setUserId(userId); break; } } - returnData.putLong(KeychainIntentService.RESULT_SIGNATURE_KEY_ID, signatureKeyId); + signatureResult.setKeyId(signatureKeyId); if (signature == null) { - returnData.putBoolean(KeychainIntentService.RESULT_SIGNATURE_UNKNOWN, true); + signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY); updateProgress(R.string.progress_done, 100, 100); return returnData; } @@ -574,9 +623,15 @@ public class PgpDecryptVerify { //Now check binding signatures boolean keyBinding_isok = verifyKeyBinding(context, signature, signatureKey); - returnData.putBoolean(KeychainIntentService.RESULT_SIGNATURE_SUCCESS, sig_isok & keyBinding_isok); + if (sig_isok & keyBinding_isok) { + signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED); + } + + // TODO: what about SIGNATURE_SUCCESS_CERTIFIED and SIGNATURE_ERROR???? updateProgress(R.string.progress_done, 100, 100); + + returnData.setSignatureResult(signatureResult); return returnData; } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyResult.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyResult.java new file mode 100644 index 000000000..0477c4fdf --- /dev/null +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyResult.java @@ -0,0 +1,88 @@ +/* + * 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.os.Parcel; +import android.os.Parcelable; + +import org.openintents.openpgp.OpenPgpSignatureResult; + +public class PgpDecryptVerifyResult implements Parcelable { + boolean symmetricPassphraseNeeded; + boolean keyPassphraseNeeded; + OpenPgpSignatureResult signatureResult; + + public boolean isSymmetricPassphraseNeeded() { + return symmetricPassphraseNeeded; + } + + public void setSymmetricPassphraseNeeded(boolean symmetricPassphraseNeeded) { + this.symmetricPassphraseNeeded = symmetricPassphraseNeeded; + } + + public boolean isKeyPassphraseNeeded() { + return keyPassphraseNeeded; + } + + public void setKeyPassphraseNeeded(boolean keyPassphraseNeeded) { + this.keyPassphraseNeeded = keyPassphraseNeeded; + } + + public OpenPgpSignatureResult getSignatureResult() { + return signatureResult; + } + + public void setSignatureResult(OpenPgpSignatureResult signatureResult) { + this.signatureResult = signatureResult; + } + + public PgpDecryptVerifyResult() { + + } + + public PgpDecryptVerifyResult(PgpDecryptVerifyResult b) { + this.symmetricPassphraseNeeded = b.symmetricPassphraseNeeded; + this.keyPassphraseNeeded = b.keyPassphraseNeeded; + this.signatureResult = b.signatureResult; + } + + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel dest, int flags) { + dest.writeByte((byte) (symmetricPassphraseNeeded ? 1 : 0)); + dest.writeByte((byte) (keyPassphraseNeeded ? 1 : 0)); + dest.writeParcelable(signatureResult, 0); + } + + public static final Creator CREATOR = new Creator() { + public PgpDecryptVerifyResult createFromParcel(final Parcel source) { + PgpDecryptVerifyResult vr = new PgpDecryptVerifyResult(); + vr.symmetricPassphraseNeeded = source.readByte() == 1; + vr.keyPassphraseNeeded = source.readByte() == 1; + vr.signatureResult = source.readParcelable(OpenPgpSignatureResult.class.getClassLoader()); + return vr; + } + + public PgpDecryptVerifyResult[] newArray(final int size) { + return new PgpDecryptVerifyResult[size]; + } + }; +} diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 302dbea0b..9c499ebd7 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -44,6 +44,7 @@ import org.sufficientlysecure.keychain.helper.OtherHelper; import org.sufficientlysecure.keychain.helper.Preferences; import org.sufficientlysecure.keychain.pgp.PgpConversionHelper; import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify; +import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult; import org.sufficientlysecure.keychain.pgp.PgpHelper; import org.sufficientlysecure.keychain.pgp.PgpImportExport; import org.sufficientlysecure.keychain.pgp.PgpKeyOperation; @@ -181,13 +182,7 @@ public class KeychainIntentService extends IntentService implements ProgressDial // decrypt/verify public static final String RESULT_DECRYPTED_STRING = "decrypted_message"; public static final String RESULT_DECRYPTED_BYTES = "decrypted_data"; - public static final String RESULT_SIGNATURE = "signature"; - public static final String RESULT_SIGNATURE_KEY_ID = "signature_key_id"; - public static final String RESULT_SIGNATURE_USER_ID = "signature_user_id"; - public static final String RESULT_CLEARTEXT_SIGNATURE_ONLY = "signature_only"; - - public static final String RESULT_SIGNATURE_SUCCESS = "signature_success"; - public static final String RESULT_SIGNATURE_UNKNOWN = "signature_unknown"; + public static final String RESULT_DECRYPT_VERIFY_RESULT = "signature"; // import public static final String RESULT_IMPORT_ADDED = "added"; @@ -489,15 +484,17 @@ public class KeychainIntentService extends IntentService implements ProgressDial // verifyText and decrypt returning additional resultData values for the // verification of signatures PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder(this, inputData, outStream); - builder.progress(this); + builder.progressDialogUpdater(this); builder.assumeSymmetric(assumeSymmetricEncryption) .passphrase(PassphraseCacheService.getCachedPassphrase(this, secretKeyId)); - resultData = builder.build().execute(); + PgpDecryptVerifyResult decryptVerifyResult = builder.build().execute(); outStream.close(); + resultData.putParcelable(RESULT_DECRYPT_VERIFY_RESULT, decryptVerifyResult); + /* Output */ switch (target) { @@ -867,10 +864,10 @@ public class KeychainIntentService extends IntentService implements ProgressDial } /** - * Set progress of ProgressDialog by sending message to handler on UI thread + * Set progressDialogUpdater of ProgressDialog by sending message to handler on UI thread */ public void setProgress(String message, int progress, int max) { - Log.d(Constants.TAG, "Send message by setProgress with progress=" + progress + ", max=" + Log.d(Constants.TAG, "Send message by setProgress with progressDialogUpdater=" + progress + ", max=" + max); Bundle data = new Bundle(); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index 5d2f5a815..8b34c4421 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -21,7 +21,6 @@ import android.app.PendingIntent; import android.content.Intent; import android.database.Cursor; import android.net.Uri; -import android.os.Bundle; import android.os.IBinder; import android.os.ParcelFileDescriptor; @@ -33,9 +32,10 @@ import org.spongycastle.util.Arrays; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify; +import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult; import org.sufficientlysecure.keychain.pgp.PgpSignEncrypt; +import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.KeychainContract; -import org.sufficientlysecure.keychain.service.KeychainIntentService; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.Log; @@ -284,98 +284,29 @@ public class OpenPgpService extends RemoteService { Intent result = new Intent(); try { - // TODO: - // fix the mess: http://stackoverflow.com/questions/148130/how-do-i-peek-at-the-first-two-bytes-in-an-inputstream - // should we allow to decrypt everything under every key id or only the one set? - // TODO: instead of trying to get the passphrase before - // pause stream when passphrase is missing and then resume - - // TODO: put this code into PgpDecryptVerify class - - // TODO: This allows to decrypt messages with ALL secret keys, not only the one for the - // app, Fix this? -// String passphrase = null; -// if (!signedOnly) { -// // BEGIN Get key -// // TODO: this input stream is consumed after PgpMain.getDecryptionKeyId()... do it -// // better! -// InputStream inputStream2 = new ByteArrayInputStream(inputBytes); -// -// // TODO: duplicates functions from DecryptActivity! -// long secretKeyId; -// try { -// if (inputStream2.markSupported()) { -// // should probably set this to the max size of two -// // pgpF objects, if it even needs to be anything other -// // than 0. -// inputStream2.mark(200); -// } -// secretKeyId = PgpHelper.getDecryptionKeyId(this, inputStream2); -// if (secretKeyId == Id.key.none) { -// throw new PgpGeneralException(getString(R.string.error_no_secret_key_found)); -// } -// } catch (NoAsymmetricEncryptionException e) { -// if (inputStream2.markSupported()) { -// inputStream2.reset(); -// } -// secretKeyId = Id.key.symmetric; -// if (!PgpDecryptVerify.hasSymmetricEncryption(this, inputStream2)) { -// throw new PgpGeneralException( -// getString(R.string.error_no_known_encryption_found)); -// } -// // we do not support symmetric decryption from the API! -// throw new Exception("Symmetric decryption is not supported!"); -// } -// -// Log.d(Constants.TAG, "secretKeyId " + secretKeyId); - - // NOTE: currently this only gets the passphrase for the key set for this client - String passphrase; - if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) { - passphrase = data.getStringExtra(OpenPgpApi.EXTRA_PASSPHRASE); - } else { - passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId()); - } - if (passphrase == null) { - // get PendingIntent for passphrase input, add it to given params and return to client - Intent passphraseBundle = getPassphraseBundleIntent(data, appSettings.getKeyId()); - return passphraseBundle; - } - + String passphrase = data.getStringExtra(OpenPgpApi.EXTRA_PASSPHRASE); long inputLength = is.available(); InputData inputData = new InputData(is, inputLength); - Bundle outputBundle; PgpDecryptVerify.Builder builder = new PgpDecryptVerify.Builder(this, inputData, os); - - builder.assumeSymmetric(false) + builder.assumeSymmetric(false) // no support for symmetric encryption + .enforcedKeyId(appSettings.getKeyId()) // allow only the private key for this app for decryption .passphrase(passphrase); - // TODO: this also decrypts with other secret keys that have no passphrase!!! - outputBundle = builder.build().execute(); - - //TODO: instead of using all these wrapping use OpenPgpSignatureResult directly - // in DecryptVerify class and then in DecryptActivity - boolean signature = outputBundle.getBoolean(KeychainIntentService.RESULT_SIGNATURE, false); - if (signature) { - long signatureKeyId = outputBundle - .getLong(KeychainIntentService.RESULT_SIGNATURE_KEY_ID, 0); - String signatureUserId = outputBundle - .getString(KeychainIntentService.RESULT_SIGNATURE_USER_ID); - boolean signatureSuccess = outputBundle - .getBoolean(KeychainIntentService.RESULT_SIGNATURE_SUCCESS, false); - boolean signatureUnknown = outputBundle - .getBoolean(KeychainIntentService.RESULT_SIGNATURE_UNKNOWN, false); - boolean signatureOnly = outputBundle - .getBoolean(KeychainIntentService.RESULT_CLEARTEXT_SIGNATURE_ONLY, false); - - // TODO: SIGNATURE_SUCCESS_CERTIFIED is currently not implemented - int signatureStatus = OpenPgpSignatureResult.SIGNATURE_ERROR; - if (signatureSuccess) { - signatureStatus = OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED; - } else if (signatureUnknown) { - signatureStatus = OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY; + // TODO: currently does not support binary signed-only content + PgpDecryptVerifyResult decryptVerifyResult = builder.build().execute(); + if (decryptVerifyResult.isKeyPassphraseNeeded()) { + // get PendingIntent for passphrase input, add it to given params and return to client + Intent passphraseBundle = getPassphraseBundleIntent(data, appSettings.getKeyId()); + return passphraseBundle; + } else if (decryptVerifyResult.isSymmetricPassphraseNeeded()) { + throw new PgpGeneralException("Decryption of symmetric content not supported by API!"); + } + + OpenPgpSignatureResult signatureResult = decryptVerifyResult.getSignatureResult(); + if (signatureResult != null) { + if (signatureResult.getStatus() == OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY) { // If signature is unknown we return an additional PendingIntent // to retrieve the missing key // TODO!!! @@ -390,11 +321,9 @@ public class OpenPgpService extends RemoteService { result.putExtra(OpenPgpApi.RESULT_INTENT, pi); } - - OpenPgpSignatureResult sigResult = new OpenPgpSignatureResult(signatureStatus, - signatureUserId, signatureOnly, signatureKeyId); - result.putExtra(OpenPgpApi.RESULT_SIGNATURE, sigResult); + result.putExtra(OpenPgpApi.RESULT_SIGNATURE, signatureResult); } + } finally { is.close(); os.close(); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java index 9bb675db0..a81576687 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java @@ -25,6 +25,7 @@ import java.io.FileNotFoundException; import java.io.InputStream; import java.util.regex.Matcher; +import org.openintents.openpgp.OpenPgpSignatureResult; import org.spongycastle.openpgp.PGPPublicKeyRing; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.Id; @@ -32,6 +33,7 @@ import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.compatibility.ClipboardReflection; import org.sufficientlysecure.keychain.helper.ActionBarHelper; import org.sufficientlysecure.keychain.helper.FileHelper; +import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult; import org.sufficientlysecure.keychain.pgp.PgpHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify; @@ -690,11 +692,15 @@ public class DecryptActivity extends DrawerActivity { } - if (returnData.getBoolean(KeychainIntentService.RESULT_SIGNATURE)) { - String userId = returnData - .getString(KeychainIntentService.RESULT_SIGNATURE_USER_ID); - mSignatureKeyId = returnData - .getLong(KeychainIntentService.RESULT_SIGNATURE_KEY_ID); + PgpDecryptVerifyResult decryptVerifyResult = + returnData.getParcelable(KeychainIntentService.RESULT_DECRYPT_VERIFY_RESULT); + + OpenPgpSignatureResult signatureResult = decryptVerifyResult.getSignatureResult(); + + if (signatureResult != null) { + + String userId = signatureResult.getUserId(); + mSignatureKeyId = signatureResult.getKeyId(); mUserIdRest.setText("id: " + PgpKeyHelper.convertKeyIdToHex(mSignatureKeyId)); if (userId == null) { @@ -707,19 +713,32 @@ public class DecryptActivity extends DrawerActivity { } mUserId.setText(userId); - if (returnData.getBoolean(KeychainIntentService.RESULT_SIGNATURE_SUCCESS)) { - mSignatureStatusImage.setImageResource(R.drawable.overlay_ok); - mLookupKey.setVisibility(View.GONE); - } else if (returnData - .getBoolean(KeychainIntentService.RESULT_SIGNATURE_UNKNOWN)) { - mSignatureStatusImage.setImageResource(R.drawable.overlay_error); - mLookupKey.setVisibility(View.VISIBLE); - AppMsg.makeText(DecryptActivity.this, - R.string.unknown_signature, - AppMsg.STYLE_ALERT).show(); - } else { - mSignatureStatusImage.setImageResource(R.drawable.overlay_error); - mLookupKey.setVisibility(View.GONE); + switch (signatureResult.getStatus()) { + case OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED: { + mSignatureStatusImage.setImageResource(R.drawable.overlay_ok); + mLookupKey.setVisibility(View.GONE); + break; + } + + // TODO! +// case OpenPgpSignatureResult.SIGNATURE_SUCCESS_CERTIFIED: { +// break; +// } + + case OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY: { + mSignatureStatusImage.setImageResource(R.drawable.overlay_error); + mLookupKey.setVisibility(View.VISIBLE); + AppMsg.makeText(DecryptActivity.this, + R.string.unknown_signature, + AppMsg.STYLE_ALERT).show(); + break; + } + + default: { + mSignatureStatusImage.setImageResource(R.drawable.overlay_error); + mLookupKey.setVisibility(View.GONE); + break; + } } mSignatureLayout.setVisibility(View.VISIBLE); } @@ -733,7 +752,7 @@ public class DecryptActivity extends DrawerActivity { Messenger messenger = new Messenger(saveHandler); intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger); - // show progress dialog + // show progressDialogUpdater dialog saveHandler.showProgressDialog(this); // start service with intent -- cgit v1.2.3 From fe8044d18172faf21ac8085c823eb4f8e13a35ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 20:58:53 +0100 Subject: 2.3.1 beta2 --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 4 ++-- .../main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index cec1422d9..76c4c6a2e 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="23102" + android:versionName="2.3.1 beta2"> - OpenKeychain: Datei entschlüsseln - OpenKeychain: Schlüssel importieren - OpenKeychain: Verschlüsseln - OpenKeychain: Entschlüsseln Keine registrierten Anwendungen vorhanden!\n\nAnwendungen von Dritten können Zugriff auf OpenKeychain erbitten. Nachdem Zugriff gewährt wurde, werden diese hier aufgelistet. Erweiterte Einstellungen anzeigen diff --git a/OpenPGP-Keychain/src/main/res/values-es/strings.xml b/OpenPGP-Keychain/src/main/res/values-es/strings.xml index 48ea6cc69..e07e049cd 100644 --- a/OpenPGP-Keychain/src/main/res/values-es/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-es/strings.xml @@ -266,6 +266,9 @@ la fecha de caducidad debe ser posterior a la fecha de creación no puedes eliminar este contacto porque eres tú mismo. no puedes eliminar los siguientes contactos porque son tú mismo:\n%s + Consulta al servidor insuficiente + La consulta al servidor de claves ha fallado + Demasiadas respuestas Por favor, bórralo desde la pantalla \'Mis claves\'! Por favor, bórralos desde la pantalla \'Mis claves\'! @@ -337,10 +340,10 @@ Ayuda Tomar la clave desde el portapapeles - OpenKeychain: Descifrar archivo - OpenKeychain: Importar clave - OpenKeychain: Cifrar - OpenKeychain: Descifrar + Descifrar archivo con OpenKeychain + Importar clave con OpenKeychain + Cifrar con OpenKeychain + Descifrar con OpenKeychain ¡No hay aplicaciones registradas!\n\nLas aplicaciones de terceros pueden pedir permiso de acceso a OpenKeychain. Después de obtener acceso, serán enumeradas aquí. Mostrar la configuración avanzada diff --git a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml index bf66756cf..563ee636e 100644 --- a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml @@ -340,10 +340,10 @@ Aide Obtenir la clef depuis le presse-papiers - OpenKeychain : déchiffrer le ficher - OpenKeychain : importer la clef - OpenKeychain : chiffrer - OpenKeychain : déchiffrer + Déchiffrer le fichier avec OpenKeychain + Importer la clef avec OpenKeychain + Chiffrer avec OpenKeychain + Déchiffrer avec OpenKeychain Aucune application enregistrée !\n\nLes applications tierces peuvent demander l\'accès à OpenKeychain. Après avoir autorisé l\'accès, elles seront listées ici. Afficher les paramètres avancés diff --git a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml index 86a094c41..041a9d0f1 100644 --- a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml @@ -340,10 +340,10 @@ Aiuto Ottieni chiave dagli appunti - OpenKeyChain: Decodifica File - OpenKeyChain: Importa Chiave - OpenKeychain: Codifica - OpenKeychain: Decodifica + Decodifica File con OpenKeychain + Importa Chiave con OpenKeychain + Codifica con OpenKeychain + Decodifica con OpenKeychain Nessuna app registrata!\n\nApp di terza parti possono richiedere accesso a OpenKeychain. Dopo aver concesso l\'accesso, saranno elencate qui. Mostra impostazioni avanzate diff --git a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml index c99f8b31c..0c80d4a2c 100644 --- a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml @@ -329,10 +329,10 @@ ヘルプ クリップボードから鍵を取得 - OpenKeychain: ファイル復号化 - OpenKeychain: 鍵のインポート - OpenKeychain: 暗号化 - OpenKeychain: 復号化 + OpenKeychainでファイルを復号化 + OpenKeychainに鍵をインポート + OpenKeychainで暗号化 + OpenKeychainで復号化 登録されていないアプリケーション!\n\nサードパーティアプリケーションはOpenKeychainにアクセスを要求できます。アクセスを与えた後、それらはここにリストされます。 拡張設定を表示 diff --git a/OpenPGP-Keychain/src/main/res/values-uk/strings.xml b/OpenPGP-Keychain/src/main/res/values-uk/strings.xml index 7f1766a5c..c883ea583 100644 --- a/OpenPGP-Keychain/src/main/res/values-uk/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-uk/strings.xml @@ -351,10 +351,10 @@ Довідка Отримати ключ з буфера обміну - OpenPGP: розшифрувати файл - OpenPGP: імпортувати ключ - OpenPGP: зашифрувати - OpenPGP: розшифрувати + Розшифрувати файл з OpenKeychain + Імпортувати ключ з OpenKeychain + Зашифрувати з OpenKeychain + Розшифрувати з OpenKeychain Нема зареєстрованих програм!\n\nСтороні програми можуть вимагати доступ до OpenPGP Keychain. Після надання доступу вони будуть наведені тут. Показати додаткові налаштування -- cgit v1.2.3 From e1f525a0ac9614ed10538ce1552cf036c06fb88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 22:17:45 +0100 Subject: name KeychainIntentService properly --- .../org/sufficientlysecure/keychain/service/KeychainIntentService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 9c499ebd7..cf507826e 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -201,7 +201,7 @@ public class KeychainIntentService extends IntentService implements ProgressDial private boolean mIsCanceled; public KeychainIntentService() { - super("ApgService"); + super("KeychainIntentService"); } @Override -- cgit v1.2.3 From a83c18bafbb8bb0316716a1d934363e43bec93f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 22:20:59 +0100 Subject: Remove unused imports --- .../main/java/org/sufficientlysecure/keychain/util/KeyServer.java | 6 ------ 1 file changed, 6 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java index 072affb1f..3d72c00c0 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java @@ -16,14 +16,8 @@ package org.sufficientlysecure.keychain.util; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; import java.util.List; -import android.os.Parcel; -import android.os.Parcelable; - import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry; public abstract class KeyServer { -- cgit v1.2.3 From 61ee811d600f9f0d27fc4ac5ef0b6ca32a5b1ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 22:42:44 +0100 Subject: Fix license header of key server files --- .../main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java | 4 +++- .../src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java index b94c42e90..921d22f21 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java @@ -1,6 +1,8 @@ /* + * Copyright (C) 2012-2014 Dominik Schürmann + * Copyright (C) 2011 Thialfihar * Copyright (C) 2011 Senecaso - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java index 3d72c00c0..b1e6b3c71 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java @@ -1,6 +1,8 @@ /* + * Copyright (C) 2012-2014 Dominik Schürmann + * Copyright (C) 2011 Thialfihar * Copyright (C) 2011 Senecaso - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- cgit v1.2.3 From 875adae40c669620f617307d0a7f9bb4241aaac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 4 Mar 2014 23:14:52 +0100 Subject: Code cleaning in PgpDecryptVerify --- .../keychain/pgp/PgpDecryptVerify.java | 88 +++++++++++----------- 1 file changed, 46 insertions(+), 42 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index be80da4e3..345069d9d 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -440,12 +440,12 @@ public class PgpDecryptVerify { } int n; - // TODO: progressDialogUpdater calculation is broken here! Try to rework it based on commented code! -// int progressDialogUpdater = 0; + // TODO: progress calculation is broken here! Try to rework it based on commented code! +// int progress = 0; long startPos = data.getStreamPosition(); while ((n = dataIn.read(buffer)) > 0) { outStream.write(buffer, 0, n); -// progressDialogUpdater += n; +// progress += n; if (signature != null) { try { signature.update(buffer, 0, n); @@ -455,9 +455,9 @@ public class PgpDecryptVerify { } } // TODO: dead code?! - // unknown size, but try to at least have a moving, slowing down progressDialogUpdater bar -// currentProgress = startProgress + (endProgress - startProgress) * progressDialogUpdater -// / (progressDialogUpdater + 100000); + // unknown size, but try to at least have a moving, slowing down progress bar +// currentProgress = startProgress + (endProgress - startProgress) * progress +// / (progress + 100000); if (data.getSize() - startPos == 0) { currentProgress = endProgress; } else { @@ -478,11 +478,11 @@ public class PgpDecryptVerify { signatureResult.setSignatureOnly(false); //Now check binding signatures - boolean keyBinding_isok = verifyKeyBinding(context, messageSignature, signatureKey); - boolean sig_isok = signature.verify(messageSignature); + boolean validKeyBinding = verifyKeyBinding(context, messageSignature, signatureKey); + boolean validSignature = signature.verify(messageSignature); // TODO: implement CERTIFIED! - if (keyBinding_isok & sig_isok) { + if (validKeyBinding & validSignature) { signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED); } } @@ -618,12 +618,11 @@ public class PgpDecryptVerify { } while (lookAhead != -1); } - boolean sig_isok = signature.verify(); - //Now check binding signatures - boolean keyBinding_isok = verifyKeyBinding(context, signature, signatureKey); + boolean validKeyBinding = verifyKeyBinding(context, signature, signatureKey); + boolean validSignature = signature.verify(); - if (sig_isok & keyBinding_isok) { + if (validSignature & validKeyBinding) { signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED); } @@ -637,34 +636,34 @@ public class PgpDecryptVerify { private static boolean verifyKeyBinding(Context context, PGPSignature signature, PGPPublicKey signatureKey) { long signatureKeyId = signature.getKeyID(); - boolean keyBinding_isok = false; - String userId = null; + boolean validKeyBinding = false; + PGPPublicKeyRing signKeyRing = ProviderHelper.getPGPPublicKeyRingByKeyId(context, signatureKeyId); PGPPublicKey mKey = null; if (signKeyRing != null) { mKey = PgpKeyHelper.getMasterKey(signKeyRing); } + if (signature.getKeyID() != mKey.getKeyID()) { - keyBinding_isok = verifyKeyBinding(mKey, signatureKey); + validKeyBinding = verifyKeyBinding(mKey, signatureKey); } else { //if the key used to make the signature was the master key, no need to check binding sigs - keyBinding_isok = true; + validKeyBinding = true; } - return keyBinding_isok; + return validKeyBinding; } private static boolean verifyKeyBinding(PGPPublicKey masterPublicKey, PGPPublicKey signingPublicKey) { - boolean subkeyBinding_isok = false; - boolean tmp_subkeyBinding_isok = false; - boolean primkeyBinding_isok = false; - JcaPGPContentVerifierBuilderProvider contentVerifierBuilderProvider = new JcaPGPContentVerifierBuilderProvider() - .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME); + boolean validSubkeyBinding = false; + boolean validTempSubkeyBinding = false; + boolean validPrimaryKeyBinding = false; + + JcaPGPContentVerifierBuilderProvider contentVerifierBuilderProvider = + new JcaPGPContentVerifierBuilderProvider() + .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME); Iterator itr = signingPublicKey.getSignatures(); - subkeyBinding_isok = false; - tmp_subkeyBinding_isok = false; - primkeyBinding_isok = false; while (itr.hasNext()) { //what does gpg do if the subkey binding is wrong? //gpg has an invalid subkey binding error on key import I think, but doesn't shout //about keys without subkey signing. Can't get it to import a slightly broken one @@ -674,32 +673,36 @@ public class PgpDecryptVerify { //check and if ok, check primary key binding. try { sig.init(contentVerifierBuilderProvider, masterPublicKey); - tmp_subkeyBinding_isok = sig.verifyCertification(masterPublicKey, signingPublicKey); + validTempSubkeyBinding = sig.verifyCertification(masterPublicKey, signingPublicKey); } catch (PGPException e) { continue; } catch (SignatureException e) { continue; } - if (tmp_subkeyBinding_isok) - subkeyBinding_isok = true; - if (tmp_subkeyBinding_isok) { - primkeyBinding_isok = verifyPrimaryBinding(sig.getUnhashedSubPackets(), masterPublicKey, signingPublicKey); - if (primkeyBinding_isok) + if (validTempSubkeyBinding) + validSubkeyBinding = true; + if (validTempSubkeyBinding) { + validPrimaryKeyBinding = verifyPrimaryKeyBinding(sig.getUnhashedSubPackets(), + masterPublicKey, signingPublicKey); + if (validPrimaryKeyBinding) break; - primkeyBinding_isok = verifyPrimaryBinding(sig.getHashedSubPackets(), masterPublicKey, signingPublicKey); - if (primkeyBinding_isok) + validPrimaryKeyBinding = verifyPrimaryKeyBinding(sig.getHashedSubPackets(), + masterPublicKey, signingPublicKey); + if (validPrimaryKeyBinding) break; } } } - return (subkeyBinding_isok & primkeyBinding_isok); + return (validSubkeyBinding & validPrimaryKeyBinding); } - private static boolean verifyPrimaryBinding(PGPSignatureSubpacketVector Pkts, PGPPublicKey masterPublicKey, PGPPublicKey signingPublicKey) { - boolean primkeyBinding_isok = false; - JcaPGPContentVerifierBuilderProvider contentVerifierBuilderProvider = new JcaPGPContentVerifierBuilderProvider() - .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME); + private static boolean verifyPrimaryKeyBinding(PGPSignatureSubpacketVector Pkts, + PGPPublicKey masterPublicKey, PGPPublicKey signingPublicKey) { + boolean validPrimaryKeyBinding = false; + JcaPGPContentVerifierBuilderProvider contentVerifierBuilderProvider = + new JcaPGPContentVerifierBuilderProvider() + .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME); PGPSignatureList eSigList; if (Pkts.hasSubpacket(SignatureSubpacketTags.EMBEDDED_SIGNATURE)) { @@ -715,8 +718,8 @@ public class PgpDecryptVerify { if (emSig.getSignatureType() == PGPSignature.PRIMARYKEY_BINDING) { try { emSig.init(contentVerifierBuilderProvider, signingPublicKey); - primkeyBinding_isok = emSig.verifyCertification(masterPublicKey, signingPublicKey); - if (primkeyBinding_isok) + validPrimaryKeyBinding = emSig.verifyCertification(masterPublicKey, signingPublicKey); + if (validPrimaryKeyBinding) break; } catch (PGPException e) { continue; @@ -726,7 +729,8 @@ public class PgpDecryptVerify { } } } - return primkeyBinding_isok; + + return validPrimaryKeyBinding; } /** -- cgit v1.2.3 From a1230bbe53d279b44038268d05d85f86ae0ff840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 5 Mar 2014 02:06:44 +0100 Subject: Fix passphrase retrieval --- .../keychain/pgp/PgpDecryptVerify.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 345069d9d..c568f462a 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -310,16 +310,18 @@ public class PgpDecryptVerify { pbe = encData; - // passphrase handling... + // if no passphrase was explicitly set try to get it from the cache service if (passphrase == null) { - // try to get cached passphrase + // returns "" if key has no passphrase passphrase = PassphraseCacheService.getCachedPassphrase(context, encData.getKeyID()); + + // if passphrase was not cached, return here indicating that a passphrase is missing! + if (passphrase == null) { + returnData.setKeyPassphraseNeeded(true); + return returnData; + } } - // if passphrase was not cached, return here! - if (passphrase == null) { - returnData.setKeyPassphraseNeeded(true); - return returnData; - } + break; } @@ -644,7 +646,7 @@ public class PgpDecryptVerify { if (signKeyRing != null) { mKey = PgpKeyHelper.getMasterKey(signKeyRing); } - + if (signature.getKeyID() != mKey.getKeyID()) { validKeyBinding = verifyKeyBinding(mKey, signatureKey); } else { //if the key used to make the signature was the master key, no need to check binding sigs -- cgit v1.2.3 From 7a957840748766345f0180b2a3f8dee761161be4 Mon Sep 17 00:00:00 2001 From: Bhargav Golla Date: Tue, 4 Mar 2014 22:37:56 -0500 Subject: Adding a min date not to go below creation date --- .../java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index 6c265057e..b8bb547ee 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -106,7 +106,8 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { mDeleteButton.setOnClickListener(this); setExpiryDate(null); - + String creationDate = mCreationDate.getText().toString(); + Date date = DateFormat.getDateInstance().parse(creationDate); mExpiryDateButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { GregorianCalendar date = mExpiryDate; @@ -129,6 +130,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { } } }); + dialog.getDatePicker().setMinDate(date.getTime()); dialog.show(); } }); -- cgit v1.2.3 From e482fe18fe9f61575dae191aa3fc5d3819962786 Mon Sep 17 00:00:00 2001 From: Daniel Hammann Date: Wed, 5 Mar 2014 17:44:55 +0100 Subject: =?UTF-8?q?Lint=20Issue:=20TypographyEllipsis:=20Ellipsis=20string?= =?UTF-8?q?=20can=20be=20replaced=20with=20ellipsis=20character=20Replace?= =?UTF-8?q?=20"..."=20with=20ellipsis=20character=20(=E2=80=A6,=20…)?= =?UTF-8?q?=20...=20->=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/values-de/strings.xml | 58 ++++++++-------- .../src/main/res/values-es-rCO/strings.xml | 2 +- .../src/main/res/values-es/strings.xml | 74 ++++++++++---------- .../src/main/res/values-fr/strings.xml | 76 ++++++++++----------- .../src/main/res/values-it-rIT/strings.xml | 74 ++++++++++---------- .../src/main/res/values-ja/strings.xml | 72 ++++++++++---------- .../src/main/res/values-nl-rNL/strings.xml | 54 +++++++-------- .../src/main/res/values-ru/strings.xml | 78 +++++++++++----------- .../src/main/res/values-tr/strings.xml | 24 +++---- .../src/main/res/values-zh/strings.xml | 14 ++-- 10 files changed, 263 insertions(+), 263 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/values-de/strings.xml b/OpenPGP-Keychain/src/main/res/values-de/strings.xml index df76f4e52..493a3a9bb 100644 --- a/OpenPGP-Keychain/src/main/res/values-de/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-de/strings.xml @@ -15,7 +15,7 @@ Schlüsselserver Passwort ändern Passwort setzen - E-Mail senden... + E-Mail senden… In eine Datei verschlüsseln In eine Datei entschlüsseln Schlüssel importieren @@ -163,7 +163,7 @@ DSA ElGamal RSA - Öffnen... + Öffnen… Warnung Fehler Fehler: %s @@ -273,40 +273,40 @@ fertig. - speichern... - importieren... - exportieren... - erstelle Schlüssel, dies kann bis zu 3 Minuten dauern... - erstelle Schlüssel... - Hauptschlüssel wird vorbereitet... - Hauptschlüssel wird beglaubigt... - erstelle Hauptring... - füge Unterschlüssel hinzu... - Schlüssel wird gespeichert... + speichern… + importieren… + exportieren… + erstelle Schlüssel, dies kann bis zu 3 Minuten dauern… + erstelle Schlüssel… + Hauptschlüssel wird vorbereitet… + Hauptschlüssel wird beglaubigt… + erstelle Hauptring… + füge Unterschlüssel hinzu… + Schlüssel wird gespeichert… Schlüssel wird exportiert… Schlüssel werden exportiert… - extrahiere Signaturschlüssel... - extrahiere Schlüssel... - Datenstrom wird vorbereitet... - Daten werden verschlüsselt... - Daten werden entschlüsselt... - Signatur wird vorbereitet... - Signatur wird erstellt... - Signatur wird verarbeitet... - Signatur wird verifiziert... - signiere... - Daten werden gelesen... - Schlüssel wird gesucht... - Daten werden entpackt... - Integrität wird überprüft... - \'%s\' wird sicher gelöscht... - Anfrage wird gestellt... + extrahiere Signaturschlüssel… + extrahiere Schlüssel… + Datenstrom wird vorbereitet… + Daten werden verschlüsselt… + Daten werden entschlüsselt… + Signatur wird vorbereitet… + Signatur wird erstellt… + Signatur wird verarbeitet… + Signatur wird verifiziert… + signiere… + Daten werden gelesen… + Schlüssel wird gesucht… + Daten werden entpackt… + Integrität wird überprüft… + \'%s\' wird sicher gelöscht… + Anfrage wird gestellt… Öffentliche Schlüssel suchen Private Schlüssel suchen - Teile Schlüssel über... + Teile Schlüssel über… 512 1024 diff --git a/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml b/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml index 6efe9548d..e43cecc2c 100644 --- a/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml @@ -12,7 +12,7 @@ Aplicaciones registradas Cambiar contraseña Establecer contraseña - Enviar correo electrónico... + Enviar correo electrónico… Cifrar a archivo Descifrar a archivo Importar claves diff --git a/OpenPGP-Keychain/src/main/res/values-es/strings.xml b/OpenPGP-Keychain/src/main/res/values-es/strings.xml index e07e049cd..edf190184 100644 --- a/OpenPGP-Keychain/src/main/res/values-es/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-es/strings.xml @@ -15,7 +15,7 @@ Prioridad del servidor de claves Cambiar la frase de contraseña Establecer frase de contraseña - Enviar email... + Enviar email… Cifrar hacia archivo Descifrar hacia archivo Importar claves @@ -61,7 +61,7 @@ Siguiente Volver Portapapeles - Compartir con... + Compartir con… Buscar clave Ajustes @@ -80,10 +80,10 @@ Actualizar desde servidor de claves Cargar al servidor de claves Compartir - Compartir la huella digital... - Compartir la clave completa... - con... - con... + Compartir la huella digital… + Compartir la clave completa… + con… + con… con código QR con código QR con NFC @@ -91,7 +91,7 @@ Clave de firma Ajustes de Beam Cancelar - Cifrar hacia... + Cifrar hacia… Firmar Mensaje @@ -163,7 +163,7 @@ DSA ElGamal RSA - Abrir... + Abrir… Advertencia Error Error: %s @@ -275,40 +275,40 @@ hecho. - guardando... - importando... - exportando... - generando la clave, esto puede tardar más de 3 minutos... - construyendo la clave... - preparando la clave maestra... - certificando la clave maestra... - construyendo el anillo maestro... - añadiendo las subclaves... - guardando claves... + guardando… + importando… + exportando… + generando la clave, esto puede tardar más de 3 minutos… + construyendo la clave… + preparando la clave maestra… + certificando la clave maestra… + construyendo el anillo maestro… + añadiendo las subclaves… + guardando claves… - exportando clave... - exportando claves... + exportando clave… + exportando claves… - extrayendo la clave de firma... - extrayendo la clave... - preparando las transmisiones... - cifrando los datos... - descifrando los datos... - preparando la firma... - generando la firma... - procesando la firma... - verificando la firma... - firmando... - leyendo los datos... - localizando la clave... - descomprimiendo los datos... - verificando la integridad... + extrayendo la clave de firma… + extrayendo la clave… + preparando las transmisiones… + cifrando los datos… + descifrando los datos… + preparando la firma… + generando la firma… + procesando la firma… + verificando la firma… + firmando… + leyendo los datos… + localizando la clave… + descomprimiendo los datos… + verificando la integridad… borrando \'%s\' de forma segura… - consultando... + consultando… Buscar claves públicas Buscar claves secretas - Compartir la clave con... + Compartir la clave con… 512 1024 @@ -374,7 +374,7 @@ 1 clave seleccionada. %d claves seleccionadas. - Aún no hay claves disponibles... + Aún no hay claves disponibles… Puedes empezar por o crear tu propia clave diff --git a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml index 563ee636e..171ce1fa5 100644 --- a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml @@ -15,7 +15,7 @@ Préférences du serveur de clefs Changer la phrase de passe Définir la phrase de passe - Envoyer un courriel... + Envoyer un courriel… Chiffrer vers un fichier Déchiffrer vers un fichier importer des clefs @@ -61,7 +61,7 @@ Suivant Retour Presse-papiers - Partager avec... + Partager avec… Rechercher la clef Paramètres @@ -80,10 +80,10 @@ 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... + Partager l\'empreinte… + Partager la clef entière… + avec… + avec… par un code QR par un code QR par la NFC @@ -91,7 +91,7 @@ Signer la clef Paramètres Beam Annuler - Chiffrer vers... + Chiffrer vers… Signer Message @@ -163,7 +163,7 @@ DSA ElGamal RSA - Ouvrir... + Ouvrir… Avertissement Erreur Erreur : %s @@ -275,40 +275,40 @@ fait. - sauvegarde... - importation... - exportation... - génération de la clef, ceci peut prendre jusqu\'à 3 minutes... - assemblage de la clef... - préparation de la clef maîtresse... - certification de la clef maîtresse... - assemblage du trousseau maître... - ajout des sous-clefs... - sauvegarde de la clef... + sauvegarde… + importation… + exportation… + génération de la clef, ceci peut prendre jusqu\'à 3 minutes… + assemblage de la clef… + préparation de la clef maîtresse… + certification de la clef maîtresse… + assemblage du trousseau maître… + ajout des sous-clefs… + sauvegarde de la clef… - exportation de la clef... - exportation des clefs... + exportation de la clef… + exportation des clefs… - extraction de la clef de signature... - extraction de la clef... - préparation des flux... - chiffrement des données... - déchiffrement des données... - préparation de la signature... - génération de la signature... - traitement de la signature... - vérification de la signature... - signature... - lecture des données... - recherche de la clef... - décompression des données... - vérification de l\'intégrité... - suppression sûre de « %s »... - interrogation... + extraction de la clef de signature… + extraction de la clef… + préparation des flux… + chiffrement des données… + déchiffrement des données… + préparation de la signature… + génération de la signature… + traitement de la signature… + vérification de la signature… + signature… + lecture des données… + recherche de la clef… + décompression des données… + vérification de l\'intégrité… + suppression sûre de « %s »… + interrogation… Rechercher des clefs publiques Rechercher des clefs secrètes - Partager la clef avec... + Partager la clef avec… 512 1024 @@ -374,7 +374,7 @@ 1 clef choisie %d clefs choisies - Aucune clef encore disponible... + Aucune clef encore disponible… Vous pouvez commencer par ou créer votre propre clef diff --git a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml index 041a9d0f1..5ceb4f45b 100644 --- a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml @@ -15,7 +15,7 @@ Preferenze Server delle Chiavi Cambia Frase di Accesso Imposta Frase di Accesso - Invia Mail... + Invia Mail… Codifica File Decodifica File Importa Chiavi @@ -61,7 +61,7 @@ Prossimo Precedente Appunti - Condividi con... + Condividi con… Chiave di ricerca Impostazioni @@ -80,10 +80,10 @@ Aggiorna dal server delle chiavi Carica chiave nel server Condividi - Condivi impronta... - Condividi intera chiave... + Condivi impronta… + Condividi intera chiave… con.. - con... + con… con Codice QR con Codice QR con NFC @@ -91,7 +91,7 @@ Firma chiave Impostazioni Beam Annulla - Codifica su... + Codifica su… Firma Messaggio @@ -163,7 +163,7 @@ DSA ElGamal RSA - Apri... + Apri… Attenzione Errore Errore: %s @@ -275,40 +275,40 @@ fatto. - salvataggio... - importazione... - esportazione... - generazione chiave, richiede fino a 3 minuti... - fabbricazione chiave... - preparazione chiave principale... - certificazione chiave principale... - fabbricazione portachiavi principale... - aggiunta sottochiavi... - salvataggio chiavi... + salvataggio… + importazione… + esportazione… + generazione chiave, richiede fino a 3 minuti… + fabbricazione chiave… + preparazione chiave principale… + certificazione chiave principale… + fabbricazione portachiavi principale… + aggiunta sottochiavi… + salvataggio chiavi… - esportazione chiave... - esportazione chiavi... + esportazione chiave… + esportazione chiavi… - estrazione chiavi di firma... - estrazione chiave... - preparazione flussi... - codifica dati... - decodifica dati... - preparazione firma... - generazione firma... - elaborazione firma... - verifica firma... - firma... - lettura dati... - ricerca chiave... - decompressione dati... - verifica integrita\'... - eliminazione sicura di \'%s\'... - interrogazione... + estrazione chiavi di firma… + estrazione chiave… + preparazione flussi… + codifica dati… + decodifica dati… + preparazione firma… + generazione firma… + elaborazione firma… + verifica firma… + firma… + lettura dati… + ricerca chiave… + decompressione dati… + verifica integrita\'… + eliminazione sicura di \'%s\'… + interrogazione… Ricerca Chiavi Pubbliche Cerca Chiave Privata - Condividi chiave con... + Condividi chiave con… 512 1024 @@ -374,7 +374,7 @@ 1 chiave selezionata. %d chiavi selezionate. - Nessuna chiave disponibile... + Nessuna chiave disponibile… Puoi iniziare da o creazione della tua chiave diff --git a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml index 0c80d4a2c..0ba511c1e 100644 --- a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml @@ -15,7 +15,7 @@ 鍵サーバ設定 パスフレーズの変更 パスフレーズの設定 - メールの送信... + メールの送信… 暗号化してファイルに 復号化してファイルに 鍵のインポート @@ -61,7 +61,7 @@ 戻る クリップボード - 共有... + 共有… 鍵検出 設定 @@ -80,10 +80,10 @@ 鍵サーバからの更新 鍵サーバへのアップロード 共有 - 指紋の共有... - すべての鍵の共有... - ...(指紋) - ...(鍵) + 指紋の共有… + すべての鍵の共有… + …(指紋) + …(鍵) QRコードで共有(鍵) QRコードで共有(指紋) NFCで共有 @@ -91,7 +91,7 @@ 鍵を署名 Beamの設定 キャンセル - 暗号化... + 暗号化… 署名 メッセージ @@ -161,7 +161,7 @@ DSA ElGamal RSA - 開く... + 開く… 注意 エラー エラー: %s @@ -266,39 +266,39 @@ 完了。 - 保存... - インポート... - エクスポート... - 鍵の生成、3分ほどかかります... - 鍵の構築中... - 主鍵の準備中... - 主鍵の検証中... - 主鍵輪の構築中... - 副鍵の追加中... - 鍵の保存... + 保存… + インポート… + エクスポート… + 鍵の生成、3分ほどかかります… + 鍵の構築中… + 主鍵の準備中… + 主鍵の検証中… + 主鍵輪の構築中… + 副鍵の追加中… + 鍵の保存… - 鍵のエクスポート... + 鍵のエクスポート… - 署名鍵の取り出し中... - 鍵の取り出し中... - ストリームの準備中... - データの暗号化中... - データの復号化中... - 署名の準備中... - 署名の生成中... - 署名処理中... - 署名の検証中... - 署名中... - データ読み込み中... - 鍵検索中... - データの展開中... - 完全性の検証中... + 署名鍵の取り出し中… + 鍵の取り出し中… + ストリームの準備中… + データの暗号化中… + データの復号化中… + 署名の準備中… + 署名の生成中… + 署名処理中… + 署名の検証中… + 署名中… + データ読み込み中… + 鍵検索中… + データの展開中… + 完全性の検証中… \'%s\' を完全に削除中… - 要求中... + 要求中… 公開鍵の検索 秘密鍵の検索 - 鍵の共有... + 鍵の共有… 512 1024 @@ -362,7 +362,7 @@ %d の鍵を選択。 - すでにその鍵は存在しません... + すでにその鍵は存在しません… で始める もしくは あなた所有の鍵を作る diff --git a/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml b/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml index 7d7efa616..35a0b5a03 100644 --- a/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml @@ -12,7 +12,7 @@ Geregistreerde apps Wachtwoord wijzigen Wachtwoord instellen - E-mail verzenden... + E-mail verzenden… Versleutelen naar bestand Ontsleutelen naar bestand Sleutels importeren @@ -109,7 +109,7 @@ DSA ElGamal RSA - Openen... + Openen… Waarschuwing Fout Fout: %s @@ -172,34 +172,34 @@ Niets te importeren gereed. - opslaan... - importeren... - exporteren... - sleutel maken... - hoofdsleutel voorbereiden... - hoofdsleutel certificeren... - hoofdsleutelbos maken... - sub-sleutels toevoegen... - ondertekeningssleutel uitpakken... - sleutel uitpakken... - streams voorbereiden... - gegevens versleutelen... - gegevens ontsleutelen... - handtekening voorbereiden... - handtekening genereren... - handtekening verwerken... - handtekening verifiëren... - ondertekenen... - gegevens lezen... - sleutel opzoeken... - gegevens decomprimeren... - integriteit verifiëren... - \'%s\' veilig verwijderen... - opvragen... + opslaan… + importeren… + exporteren… + sleutel maken… + hoofdsleutel voorbereiden… + hoofdsleutel certificeren… + hoofdsleutelbos maken… + sub-sleutels toevoegen… + ondertekeningssleutel uitpakken… + sleutel uitpakken… + streams voorbereiden… + gegevens versleutelen… + gegevens ontsleutelen… + handtekening voorbereiden… + handtekening genereren… + handtekening verwerken… + handtekening verifiëren… + ondertekenen… + gegevens lezen… + sleutel opzoeken… + gegevens decomprimeren… + integriteit verifiëren… + \'%s\' veilig verwijderen… + opvragen… Publieke sleutels zoeken Privésleutels zoeken - Sleutel delen met... + Sleutel delen met… 512 1024 diff --git a/OpenPGP-Keychain/src/main/res/values-ru/strings.xml b/OpenPGP-Keychain/src/main/res/values-ru/strings.xml index 7d865cc23..c8aff125b 100644 --- a/OpenPGP-Keychain/src/main/res/values-ru/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ru/strings.xml @@ -15,7 +15,7 @@ Настройки сервера ключей Изменить пароль Задать пароль - Отправить... + Отправить… Зашифровать в файл Расшифровать в файл Импорт ключей @@ -61,7 +61,7 @@ Далее Назад Буфер обмена - Поделиться... + Поделиться… Найти ключ Настройки @@ -79,9 +79,9 @@ Импорт с сервера ключей Обновить с сервера ключей Загрузить на сервер ключей - Отправить... - Отправить отпечаток... - Отправить ключ... + Отправить… + Отправить отпечаток… + Отправить ключ… Отправить Отправить QR код @@ -91,7 +91,7 @@ Подписать ключ Настройки Beam Отмена - Зашифровать.... + Зашифровать…. Подписать Сообщение @@ -115,7 +115,7 @@ Серверы ключей ID ключа Создан - Годен до... + Годен до… Применение Размер ключа Основной ID пользователя @@ -165,7 +165,7 @@ DSA ElGamal RSA - Открыть... + Открыть… Внимание Ошибка Ошибка: %s @@ -284,41 +284,41 @@ готово. - сохранение... - импорт... - экспорт... - создание ключа. это может занять до 3 минут... - создание ключа... - подготовка основного ключа... - сертификация основного ключа... - создание основной связки... - добавление доп. ключей... - сохранение ключа... + сохранение… + импорт… + экспорт… + создание ключа. это может занять до 3 минут… + создание ключа… + подготовка основного ключа… + сертификация основного ключа… + создание основной связки… + добавление доп. ключей… + сохранение ключа… - экспорт ключа... - экспорт ключей... - экспорт ключей... + экспорт ключа… + экспорт ключей… + экспорт ключей… - извлечение подписи ключа... - извлечение ключа... - подготовка к передаче... - шифрование данных... - расшифровка данных... - подготовка подписи... - формирование подписи... - обработка подписи... - проверка подписи... - подписание... - чтение данных... - поиск ключа... - распаковка данных... - проверка целостности... - безопасное удаление \'%s\'... - запрос... + извлечение подписи ключа… + извлечение ключа… + подготовка к передаче… + шифрование данных… + расшифровка данных… + подготовка подписи… + формирование подписи… + обработка подписи… + проверка подписи… + подписание… + чтение данных… + поиск ключа… + распаковка данных… + проверка целостности… + безопасное удаление \'%s\'… + запрос… Найти публичные ключи Найти секретные ключи - Отправить... + Отправить… 512 1024 @@ -386,7 +386,7 @@ %d ключей выбрано. %d ключей выбрано. - У вас пока нет ключей... + У вас пока нет ключей… Но Вы можете или создать свой ключ diff --git a/OpenPGP-Keychain/src/main/res/values-tr/strings.xml b/OpenPGP-Keychain/src/main/res/values-tr/strings.xml index 5bb5225b5..4f1becaa1 100644 --- a/OpenPGP-Keychain/src/main/res/values-tr/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-tr/strings.xml @@ -76,7 +76,7 @@ DSA ElGamal RSA - Aç... + Aç… Uyarı Hata Hata: %s @@ -96,17 +96,17 @@ bozuk veri bitti. - kaydediliyor... - alıyor... - veriyor... - anahtar oluşturuluyor... - imza hazırlanıyor... - imza oluşturuluyor... - imza işleniyor... - imza doğrulanıyor... - imzalanıyor... - veri okunuyor... - anahtar bulunuyor... + kaydediliyor… + alıyor… + veriyor… + anahtar oluşturuluyor… + imza hazırlanıyor… + imza oluşturuluyor… + imza işleniyor… + imza doğrulanıyor… + imzalanıyor… + veri okunuyor… + anahtar bulunuyor… 512 diff --git a/OpenPGP-Keychain/src/main/res/values-zh/strings.xml b/OpenPGP-Keychain/src/main/res/values-zh/strings.xml index f9422b64b..5848fb8db 100644 --- a/OpenPGP-Keychain/src/main/res/values-zh/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-zh/strings.xml @@ -24,7 +24,7 @@ 复制到剪贴板 签署密钥 取消 - 加密到... + 加密到… 签署 讯息 @@ -64,7 +64,7 @@ 4小时 8小时 永远 - 打开... + 打开… 警告 错误 @@ -106,13 +106,13 @@ 错误的密语 完成。 - 保存... - 导入中... - 导出中... + 保存… + 导入中… + 导出中… 建立密钥 正在准备主密钥 - 正在验证签名... - 正在签名... + 正在验证签名… + 正在签名… 正在读取数据 正在查找密钥 正在查询 -- cgit v1.2.3 From 92ba91de1483e64d173b135c73012851bd372cbe Mon Sep 17 00:00:00 2001 From: Bhargav Golla Date: Wed, 5 Mar 2014 12:48:24 -0500 Subject: Set min date to one day after Created Date. Works on Honeycomb and above --- .../keychain/ui/widget/KeyEditor.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index b8bb547ee..7344248f7 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -34,6 +34,7 @@ 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; @@ -58,6 +59,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { Spinner mUsage; TextView mCreationDate; BootstrapButton mExpiryDateButton; + GregorianCalendar mCreatedDate; GregorianCalendar mExpiryDate; private int mDatePickerResultCount = 0; @@ -106,8 +108,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { mDeleteButton.setOnClickListener(this); setExpiryDate(null); - String creationDate = mCreationDate.getText().toString(); - Date date = DateFormat.getDateInstance().parse(creationDate); + mExpiryDateButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { GregorianCalendar date = mExpiryDate; @@ -130,7 +131,18 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { } } }); - dialog.getDatePicker().setMinDate(date.getTime()); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { + if ( dialog != null && mCreatedDate != null ) { + dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); + android.util.Log.w("Date picker", "Date min set"); + } else { + //When created date isn't available + dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); + android.util.Log.w("Date picker", "Date min set using current time"); + } + } else { + android.util.Log.w("Date picker", "API Level < 11 so not restricting date range..."); + } dialog.show(); } }); @@ -207,7 +219,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); cal.setTime(PgpKeyHelper.getCreationDate(key)); - mCreationDate.setText(DateFormat.getDateInstance().format(cal.getTime())); + setCreatedDate(cal); cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); Date expiryDate = PgpKeyHelper.getExpiryDate(key); if (expiryDate == null) { @@ -237,6 +249,15 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { mEditorListener = listener; } + private void setCreatedDate(GregorianCalendar date) { + mCreatedDate = date; + if (date == null) { + mCreationDate.setText(getContext().getString(R.string.none)); + } else { + mCreationDate.setText(DateFormat.getDateInstance().format(date.getTime())); + } + } + private void setExpiryDate(GregorianCalendar date) { mExpiryDate = date; if (date == null) { -- cgit v1.2.3 From 2000959997249bf948d61717edab5df7080278cf Mon Sep 17 00:00:00 2001 From: uberspot Date: Wed, 5 Mar 2014 20:42:11 +0200 Subject: Put Preferences in subscreen --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 11 +- .../keychain/ui/PreferencesActivity.java | 292 ++++++++++++++++----- .../src/main/res/xml/adv_preferences.xml | 48 ++++ .../src/main/res/xml/gen_preferences.xml | 32 +++ .../src/main/res/xml/preference_headers.xml | 25 ++ .../src/main/res/xml/preference_headers_legacy.xml | 29 ++ OpenPGP-Keychain/src/main/res/xml/preferences.xml | 63 ----- 7 files changed, 370 insertions(+), 130 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/res/xml/adv_preferences.xml create mode 100644 OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml create mode 100644 OpenPGP-Keychain/src/main/res/xml/preference_headers.xml create mode 100644 OpenPGP-Keychain/src/main/res/xml/preference_headers_legacy.xml delete mode 100644 OpenPGP-Keychain/src/main/res/xml/preferences.xml (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 76c4c6a2e..10a307bfb 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -277,7 +277,16 @@ + android:label="@string/title_preferences" > + + + + + + + + + target) { + super.onBuildHeaders(target); + loadHeadersFromResource(R.xml.preference_headers, target); + } + + /** This fragment shows the general preferences in android 3.0+ */ + public static class GeneralPrefsFragment extends PreferenceFragment { + + private PreferenceScreen mKeyServerPreference = null; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Load the preferences from an XML resource + addPreferencesFromResource(R.xml.gen_preferences); + + initializePassPassPhraceCacheTtl( + (IntegerListPreference) findPreference(Constants.pref.PASS_PHRASE_CACHE_TTL)); + + mKeyServerPreference = (PreferenceScreen) findPreference(Constants.pref.KEY_SERVERS); + String servers[] = mPreferences.getKeyServers(); + mKeyServerPreference.setSummary(getResources().getQuantityString(R.plurals.n_key_servers, + servers.length, servers.length)); + mKeyServerPreference + .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + public boolean onPreferenceClick(Preference preference) { + Intent intent = new Intent(getActivity(), + PreferencesKeyServerActivity.class); + intent.putExtra(PreferencesKeyServerActivity.EXTRA_KEY_SERVERS, + mPreferences.getKeyServers()); + startActivityForResult(intent, Id.request.key_server_preference); + return false; + } + }); + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + switch (requestCode) { + case Id.request.key_server_preference: { + if (resultCode == RESULT_CANCELED || data == null) { + return; + } + String servers[] = data + .getStringArrayExtra(PreferencesKeyServerActivity.EXTRA_KEY_SERVERS); + mPreferences.setKeyServers(servers); + mKeyServerPreference.setSummary(getResources().getQuantityString( + R.plurals.n_key_servers, servers.length, servers.length)); + break; + } + + default: { + super.onActivityResult(requestCode, resultCode, data); + break; + } + } + } + } + + /** This fragment shows the advanced preferences in android 3.0+ */ + public static class AdvancedPrefsFragment extends PreferenceFragment { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Load the preferences from an XML resource + addPreferencesFromResource(R.xml.adv_preferences); + + initializeEncryptionAlgorithm( + (IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM)); + + int[] valueIds = new int[] { Id.choice.compression.none, Id.choice.compression.zip, + Id.choice.compression.zlib, Id.choice.compression.bzip2, }; + String[] entries = new String[] { + getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")", + "ZIP (" + getString(R.string.compression_fast) + ")", + "ZLIB (" + getString(R.string.compression_fast) + ")", + "BZIP2 (" + getString(R.string.compression_very_slow) + ")", }; + String[] values = new String[valueIds.length]; + for (int i = 0; i < values.length; ++i) { + values[i] = "" + valueIds[i]; + } + + initializeHashAlgorithm( + (IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM), + valueIds, entries, values); + + initializeMessageCompression( + (IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION), + valueIds, entries, values); + + initializeFileCompression( + (IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION), + entries, values); - mPassPhraseCacheTtl = (IntegerListPreference) findPreference(Constants.pref.PASS_PHRASE_CACHE_TTL); + initializeAsciiArmour((CheckBoxPreference) findPreference(Constants.pref.DEFAULT_ASCII_ARMOUR)); + + initializeForceV3Signatures((CheckBoxPreference) findPreference(Constants.pref.FORCE_V3_SIGNATURES)); + } + } + + protected boolean isValidFragment (String fragmentName) { + return AdvancedPrefsFragment.class.getName().equals(fragmentName) + || GeneralPrefsFragment.class.getName().equals(fragmentName) + || super.isValidFragment(fragmentName); + } + + private static void initializePassPassPhraceCacheTtl(final IntegerListPreference mPassPhraseCacheTtl) { mPassPhraseCacheTtl.setValue("" + mPreferences.getPassPhraseCacheTtl()); mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry()); mPassPhraseCacheTtl @@ -67,8 +267,9 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); + } - mEncryptionAlgorithm = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM); + private static void initializeEncryptionAlgorithm(final IntegerListPreference mEncryptionAlgorithm) { int valueIds[] = { PGPEncryptedData.AES_128, PGPEncryptedData.AES_192, PGPEncryptedData.AES_256, PGPEncryptedData.BLOWFISH, PGPEncryptedData.TWOFISH, PGPEncryptedData.CAST5, PGPEncryptedData.DES, PGPEncryptedData.TRIPLE_DES, @@ -93,8 +294,10 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); + } - mHashAlgorithm = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM); + private static void initializeHashAlgorithm + (final IntegerListPreference mHashAlgorithm, int[] valueIds, String[] entries, String[] values) { valueIds = new int[] { HashAlgorithmTags.MD5, HashAlgorithmTags.RIPEMD160, HashAlgorithmTags.SHA1, HashAlgorithmTags.SHA224, HashAlgorithmTags.SHA256, HashAlgorithmTags.SHA384, HashAlgorithmTags.SHA512, }; @@ -116,19 +319,10 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); + } - mMessageCompression = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION); - valueIds = new int[] { Id.choice.compression.none, Id.choice.compression.zip, - Id.choice.compression.zlib, Id.choice.compression.bzip2, }; - entries = new String[] { - getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")", - "ZIP (" + getString(R.string.compression_fast) + ")", - "ZLIB (" + getString(R.string.compression_fast) + ")", - "BZIP2 (" + getString(R.string.compression_very_slow) + ")", }; - values = new String[valueIds.length]; - for (int i = 0; i < values.length; ++i) { - values[i] = "" + valueIds[i]; - } + private static void initializeMessageCompression + (final IntegerListPreference mMessageCompression, int[] valueIds, String[] entries, String[] values) { mMessageCompression.setEntries(entries); mMessageCompression.setEntryValues(values); mMessageCompression.setValue("" + mPreferences.getDefaultMessageCompression()); @@ -143,8 +337,10 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); + } - mFileCompression = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION); + private static void initializeFileCompression + (final IntegerListPreference mFileCompression, String[] entries, String[] values) { mFileCompression.setEntries(entries); mFileCompression.setEntryValues(values); mFileCompression.setValue("" + mPreferences.getDefaultFileCompression()); @@ -157,8 +353,9 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); + } - mAsciiArmour = (CheckBoxPreference) findPreference(Constants.pref.DEFAULT_ASCII_ARMOUR); + private static void initializeAsciiArmour(final CheckBoxPreference mAsciiArmour) { mAsciiArmour.setChecked(mPreferences.getDefaultAsciiArmour()); mAsciiArmour.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { @@ -167,8 +364,9 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); + } - mForceV3Signatures = (CheckBoxPreference) findPreference(Constants.pref.FORCE_V3_SIGNATURES); + private static void initializeForceV3Signatures(final CheckBoxPreference mForceV3Signatures) { mForceV3Signatures.setChecked(mPreferences.getForceV3Signatures()); mForceV3Signatures .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @@ -178,43 +376,5 @@ public class PreferencesActivity extends PreferenceActivity { return false; } }); - - mKeyServerPreference = (PreferenceScreen) findPreference(Constants.pref.KEY_SERVERS); - String servers[] = mPreferences.getKeyServers(); - mKeyServerPreference.setSummary(getResources().getQuantityString(R.plurals.n_key_servers, - servers.length, servers.length)); - mKeyServerPreference - .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - public boolean onPreferenceClick(Preference preference) { - Intent intent = new Intent(PreferencesActivity.this, - PreferencesKeyServerActivity.class); - intent.putExtra(PreferencesKeyServerActivity.EXTRA_KEY_SERVERS, - mPreferences.getKeyServers()); - startActivityForResult(intent, Id.request.key_server_preference); - return false; - } - }); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - switch (requestCode) { - case Id.request.key_server_preference: { - if (resultCode == RESULT_CANCELED || data == null) { - return; - } - String servers[] = data - .getStringArrayExtra(PreferencesKeyServerActivity.EXTRA_KEY_SERVERS); - mPreferences.setKeyServers(servers); - mKeyServerPreference.setSummary(getResources().getQuantityString( - R.plurals.n_key_servers, servers.length, servers.length)); - break; - } - - default: { - super.onActivityResult(requestCode, resultCode, data); - break; - } - } } -} +} \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/res/xml/adv_preferences.xml b/OpenPGP-Keychain/src/main/res/xml/adv_preferences.xml new file mode 100644 index 000000000..2705bd22f --- /dev/null +++ b/OpenPGP-Keychain/src/main/res/xml/adv_preferences.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml b/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml new file mode 100644 index 000000000..f83fcb0f6 --- /dev/null +++ b/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml @@ -0,0 +1,32 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/res/xml/preference_headers.xml b/OpenPGP-Keychain/src/main/res/xml/preference_headers.xml new file mode 100644 index 000000000..3506ba322 --- /dev/null +++ b/OpenPGP-Keychain/src/main/res/xml/preference_headers.xml @@ -0,0 +1,25 @@ + + + + +
    +
    + \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/res/xml/preference_headers_legacy.xml b/OpenPGP-Keychain/src/main/res/xml/preference_headers_legacy.xml new file mode 100644 index 000000000..141bf93e5 --- /dev/null +++ b/OpenPGP-Keychain/src/main/res/xml/preference_headers_legacy.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OpenPGP-Keychain/src/main/res/xml/preferences.xml b/OpenPGP-Keychain/src/main/res/xml/preferences.xml deleted file mode 100644 index f5b46c232..000000000 --- a/OpenPGP-Keychain/src/main/res/xml/preferences.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3 From a7a8f0a78ef083965f4ca2fe07d6811032fdc65a Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Thu, 6 Mar 2014 01:13:08 +0530 Subject: Add documentation --- .../org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index b88d3bd32..b844a0619 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -113,7 +113,11 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { if (date == null) { date = new GregorianCalendar(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, date.get(Calendar.YEAR), date.get(Calendar.MONTH), date.get(Calendar.DAY_OF_MONTH)); @@ -129,8 +133,9 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { } } }); - //setCalendarViewShown() is supported from API 11 onwards. + // setCalendarViewShown() is supported from API 11 onwards. if (android.os.Build.VERSION.SDK_INT >= 11) + // Hide calendarView in tablets because of the unix warparound bug. dialog.getDatePicker().setCalendarViewShown(false); dialog.show(); } @@ -262,7 +267,7 @@ 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("Set date"); } -- cgit v1.2.3 From 42fc15e66e3efbb98fa0587569dc8b1f426c0b8a Mon Sep 17 00:00:00 2001 From: Bhargav Golla Date: Wed, 5 Mar 2014 14:46:38 -0500 Subject: Removed log statements as per Dominik's suggestions --- .../java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index 7344248f7..b9d8eb81c 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -134,14 +134,10 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { if ( dialog != null && mCreatedDate != null ) { dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); - android.util.Log.w("Date picker", "Date min set"); } else { //When created date isn't available dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS); - android.util.Log.w("Date picker", "Date min set using current time"); } - } else { - android.util.Log.w("Date picker", "API Level < 11 so not restricting date range..."); } dialog.show(); } -- cgit v1.2.3 From 127ab0fd817efa62b5375e9e158c68d5e50dad6c Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Thu, 6 Mar 2014 01:27:35 +0530 Subject: Use string from strings.xml --- .../main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 2 +- OpenPGP-Keychain/src/main/res/values/strings.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index b844a0619..4598b54b1 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -269,6 +269,6 @@ class ExpiryDatePickerDialog extends DatePickerDialog { } //Set permanent title. public void setTitle(CharSequence title) { - super.setTitle("Set date"); + super.setTitle(getContext().getString(R.string.expiry_date_dialog_title)); } } diff --git a/OpenPGP-Keychain/src/main/res/values/strings.xml b/OpenPGP-Keychain/src/main/res/values/strings.xml index 3ca5f5426..9689010ed 100644 --- a/OpenPGP-Keychain/src/main/res/values/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values/strings.xml @@ -130,6 +130,7 @@ Upload key to selected keyserver after certification Fingerprint Select + Set expiry date %d selected -- cgit v1.2.3 From 53f61893018403047c87e3d9618c82e9f03b0c55 Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Thu, 6 Mar 2014 02:24:13 +0530 Subject: Implement search for KeyListPublicFragment --- .../keychain/ui/KeyListPublicFragment.java | 47 +++++++++++++++++++-- .../main/res/drawable-mdpi/ic_action_search.png | Bin 0 -> 2349 bytes .../src/main/res/menu/key_list_public.xml | 7 ++- 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_search.png (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java index 0afa556cb..af5d946eb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java @@ -46,9 +46,13 @@ 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.support.v4.view.MenuItemCompat; +import android.support.v7.widget.SearchView; +import android.text.TextUtils; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; +import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; @@ -64,23 +68,25 @@ import com.beardedhen.androidbootstrap.BootstrapButton; * Public key list with sticky list headers. It does _not_ extend ListFragment because it uses * StickyListHeaders library which does not extend upon ListView. */ -public class KeyListPublicFragment extends Fragment implements AdapterView.OnItemClickListener, +public class KeyListPublicFragment extends Fragment implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener, LoaderManager.LoaderCallbacks { private KeyListPublicAdapter mAdapter; private StickyListHeadersListView mStickyList; - + private String mCurQuery; + private SearchView mSearchView; // empty list layout private BootstrapButton mButtonEmptyCreate; private BootstrapButton mButtonEmptyImport; + /** * Load custom layout with StickyListView from library */ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.key_list_public_fragment, container, false); - + setHasOptionsMenu(true); mButtonEmptyCreate = (BootstrapButton) view.findViewById(R.id.key_list_empty_button_create); mButtonEmptyCreate.setOnClickListener(new OnClickListener() { @@ -232,10 +238,13 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte // This is called when a new Loader needs to be created. This // sample only has one Loader, so we don't care about the ID. Uri baseUri = KeyRings.buildPublicKeyRingsUri(); + String where = null; + if(mCurQuery != null) + where = KeychainContract.UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\""; // Now create and return a CursorLoader that will take care of // creating a Cursor for the data being displayed. - return new CursorLoader(getActivity(), baseUri, PROJECTION, null, null, SORT_ORDER); + return new CursorLoader(getActivity(), baseUri, PROJECTION, where, null, SORT_ORDER); } @Override @@ -335,4 +344,34 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte deleteKeyDialog.show(getActivity().getSupportFragmentManager(), "deleteKeyDialog"); } + + @Override + public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { + + // Get the searchview + MenuItem searchItem = menu.findItem(R.id.menu_key_list_public_search); + mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem); + + // Execute this when searching + mSearchView.setOnQueryTextListener(this); + + super.onCreateOptionsMenu(menu, inflater); + + } + + @Override + public boolean onQueryTextSubmit(String s) { + return true; + } + + @Override + public boolean onQueryTextChange(String s) { + // Called when the action bar search text has changed. Update + // the search filter, and restart the loader to do a new query + // with this filter. + String newQuery = !TextUtils.isEmpty(s) ? s : null; + mCurQuery = newQuery; + getLoaderManager().restartLoader(0, null, this); + return true; + } } diff --git a/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_search.png b/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_search.png new file mode 100644 index 000000000..f6719d228 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_search.png differ diff --git a/OpenPGP-Keychain/src/main/res/menu/key_list_public.xml b/OpenPGP-Keychain/src/main/res/menu/key_list_public.xml index cdd755dc3..35a8f3926 100644 --- a/OpenPGP-Keychain/src/main/res/menu/key_list_public.xml +++ b/OpenPGP-Keychain/src/main/res/menu/key_list_public.xml @@ -11,5 +11,10 @@ android:id="@+id/menu_key_list_public_export" app:showAsAction="never" android:title="@string/menu_export_keys" /> - + \ No newline at end of file -- cgit v1.2.3 From 7932dd8a81345f4f4cc10a4618c8f0856d9f45d1 Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Thu, 6 Mar 2014 03:37:04 +0530 Subject: Implement search for SelectPublicKeyFragment --- .../keychain/ui/SelectPublicKeyFragment.java | 36 +++++++++++++++++++--- .../main/res/layout/select_public_key_activity.xml | 8 +++++ 2 files changed, 39 insertions(+), 5 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java index 59b46dd00..e3e5c55fb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java @@ -38,17 +38,22 @@ import android.os.Bundle; import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.widget.EditText; import android.widget.ListView; -public class SelectPublicKeyFragment extends ListFragmentWorkaround implements +public class SelectPublicKeyFragment extends ListFragmentWorkaround implements TextWatcher, LoaderManager.LoaderCallbacks { public static final String ARG_PRESELECTED_KEY_IDS = "preselected_key_ids"; private Activity mActivity; private SelectKeyCursorAdapter mAdapter; private ListView mListView; - + private EditText mSearchView; private long mSelectedMasterKeyIds[]; + private String mCurQuery; /** * Creates new instance of this fragment @@ -67,7 +72,8 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + mSearchView = (EditText)getActivity().findViewById(R.id.select_public_key_search); + mSearchView.addTextChangedListener(this); mSelectedMasterKeyIds = getArguments().getLongArray(ARG_PRESELECTED_KEY_IDS); } @@ -82,7 +88,6 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements mListView = getListView(); mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); - // Give some text to display if there is no data. In a real // application this would come from a resource. setEmptyText(getString(R.string.list_empty)); @@ -220,10 +225,14 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements // sort by selected master keys orderBy = inMasterKeyList + " DESC, " + orderBy; } + String where = null; + if(mCurQuery != null) + where = UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\""; + // Now create and return a CursorLoader that will take care of // creating a Cursor for the data being displayed. - return new CursorLoader(getActivity(), baseUri, projection, null, null, orderBy); + return new CursorLoader(getActivity(), baseUri, projection, where, null, orderBy); } @Override @@ -250,4 +259,21 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements // longer using it. mAdapter.swapCursor(null); } + + @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 newQuery = !TextUtils.isEmpty(editable.toString()) ? editable.toString() : null; + mCurQuery = newQuery; + getLoaderManager().restartLoader(0, null, this); + } } diff --git a/OpenPGP-Keychain/src/main/res/layout/select_public_key_activity.xml b/OpenPGP-Keychain/src/main/res/layout/select_public_key_activity.xml index a18ce46fc..5337433c6 100644 --- a/OpenPGP-Keychain/src/main/res/layout/select_public_key_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/select_public_key_activity.xml @@ -4,8 +4,16 @@ android:layout_height="match_parent" android:layout_centerHorizontal="true" > + + -- cgit v1.2.3 From fab549c2b5cf637a4afc94c38f7745bfa733b316 Mon Sep 17 00:00:00 2001 From: Miroojin Bakshi Date: Thu, 6 Mar 2014 16:27:35 +0530 Subject: Use selectionArgs parameter to pass mCurquery. --- .../sufficientlysecure/keychain/ui/KeyListPublicFragment.java | 10 ++++++---- .../keychain/ui/SelectPublicKeyFragment.java | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java index af5d946eb..95267e01f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java @@ -239,12 +239,14 @@ public class KeyListPublicFragment extends Fragment implements SearchView.OnQuer // sample only has one Loader, so we don't care about the ID. Uri baseUri = KeyRings.buildPublicKeyRingsUri(); String where = null; - if(mCurQuery != null) - where = KeychainContract.UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\""; - + String whereArgs[] = null; + if(mCurQuery != null){ + where = KeychainContract.UserIds.USER_ID + " LIKE ?"; + whereArgs = new String[]{mCurQuery+"%"}; + } // Now create and return a CursorLoader that will take care of // creating a Cursor for the data being displayed. - return new CursorLoader(getActivity(), baseUri, PROJECTION, where, null, SORT_ORDER); + return new CursorLoader(getActivity(), baseUri, PROJECTION, where, whereArgs, SORT_ORDER); } @Override diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java index e3e5c55fb..a43c84cf4 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java @@ -226,13 +226,15 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T orderBy = inMasterKeyList + " DESC, " + orderBy; } String where = null; - if(mCurQuery != null) - where = UserIds.USER_ID + " LIKE \"" + mCurQuery + "%\""; - + String whereArgs[] = null; + if(mCurQuery != null){ + where = UserIds.USER_ID + " LIKE ?"; + whereArgs = new String[]{mCurQuery+"%"}; + } // Now create and return a CursorLoader that will take care of // creating a Cursor for the data being displayed. - return new CursorLoader(getActivity(), baseUri, projection, where, null, orderBy); + return new CursorLoader(getActivity(), baseUri, projection, where, whereArgs, orderBy); } @Override -- cgit v1.2.3 From d374f0ffbd848bf5376f59b05f909216178831cd Mon Sep 17 00:00:00 2001 From: uberspot Date: Thu, 6 Mar 2014 14:33:04 +0200 Subject: Add search icon for other dpi --- .../src/main/res/drawable-hdpi/ic_action_search.png | Bin 0 -> 702 bytes .../src/main/res/drawable-xhdpi/ic_action_search.png | Bin 0 -> 900 bytes .../src/main/res/drawable-xxhdpi/ic_action_search.png | Bin 0 -> 1153 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_search.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_search.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_search.png (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_search.png b/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_search.png new file mode 100644 index 000000000..f594b4e48 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_search.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_search.png b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_search.png new file mode 100644 index 000000000..aad535e97 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_search.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_search.png b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_search.png new file mode 100644 index 000000000..9c0ea3ca0 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_search.png differ -- cgit v1.2.3 From 036fdc2b388dc45dea1b26f640d3f601e8c06aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 6 Mar 2014 14:02:06 +0100 Subject: Fix verify of cleartext signatures with unknown keys --- .../org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index c568f462a..ccd6ff8df 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -335,7 +335,7 @@ public class PgpDecryptVerify { currentProgress += 5; updateProgress(R.string.progress_extracting_key, currentProgress, 100); - PGPPrivateKey privateKey = null; + PGPPrivateKey privateKey; try { PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder() .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build( @@ -593,6 +593,8 @@ public class PgpDecryptVerify { if (signature == null) { signatureResult.setStatus(OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY); + returnData.setSignatureResult(signatureResult); + updateProgress(R.string.progress_done, 100, 100); return returnData; } @@ -630,9 +632,9 @@ public class PgpDecryptVerify { // TODO: what about SIGNATURE_SUCCESS_CERTIFIED and SIGNATURE_ERROR???? - updateProgress(R.string.progress_done, 100, 100); - returnData.setSignatureResult(signatureResult); + + updateProgress(R.string.progress_done, 100, 100); return returnData; } -- cgit v1.2.3 From 4c49bdccccdba14113b950aafb1595ff02663dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 6 Mar 2014 14:02:21 +0100 Subject: Fix documentation and variable naming in API --- .../keychain/service/remote/OpenPgpService.java | 14 +++++++------- .../keychain/service/remote/RemoteService.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index 8b34c4421..e1801d9e7 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -180,7 +180,7 @@ public class OpenPgpService extends RemoteService { } catch (Exception e) { Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); - result.putExtra(OpenPgpApi.RESULT_ERRORS, + result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } @@ -209,7 +209,7 @@ public class OpenPgpService extends RemoteService { } else { Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); - result.putExtra(OpenPgpApi.RESULT_ERRORS, + result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, "Missing parameter user_ids or key_ids!")); return result; } @@ -268,7 +268,7 @@ public class OpenPgpService extends RemoteService { } catch (Exception e) { Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); - result.putExtra(OpenPgpApi.RESULT_ERRORS, + result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } @@ -334,7 +334,7 @@ public class OpenPgpService extends RemoteService { } catch (Exception e) { Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); - result.putExtra(OpenPgpApi.RESULT_ERRORS, + result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } @@ -361,7 +361,7 @@ public class OpenPgpService extends RemoteService { if (data == null) { Intent result = new Intent(); OpenPgpError error = new OpenPgpError(OpenPgpError.GENERIC_ERROR, "params Bundle required!"); - result.putExtra(OpenPgpApi.RESULT_ERRORS, error); + result.putExtra(OpenPgpApi.RESULT_ERROR, error); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } @@ -370,7 +370,7 @@ public class OpenPgpService extends RemoteService { if (data.getIntExtra(OpenPgpApi.EXTRA_API_VERSION, -1) != OpenPgpApi.API_VERSION) { Intent result = new Intent(); OpenPgpError error = new OpenPgpError(OpenPgpError.INCOMPATIBLE_API_VERSIONS, "Incompatible API versions!"); - result.putExtra(OpenPgpApi.RESULT_ERRORS, error); + result.putExtra(OpenPgpApi.RESULT_ERROR, error); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } @@ -401,7 +401,7 @@ public class OpenPgpService extends RemoteService { return signImpl(data, input, output, appSettings); } else if (OpenPgpApi.ACTION_ENCRYPT.equals(action)) { return encryptAndSignImpl(data, input, output, appSettings, false); - } else if (OpenPgpApi.ACTION_SIGN_AND_ENCTYPT.equals(action)) { + } else if (OpenPgpApi.ACTION_SIGN_AND_ENCRYPT.equals(action)) { return encryptAndSignImpl(data, input, output, appSettings, true); } else if (OpenPgpApi.ACTION_DECRYPT_VERIFY.equals(action)) { return decryptAndVerifyImpl(data, input, output, appSettings); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java index e7b3b2945..cb556be39 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/RemoteService.java @@ -72,7 +72,7 @@ public abstract class RemoteService extends Service { // return error Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); - result.putExtra(OpenPgpApi.RESULT_ERRORS, + result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); return result; } -- cgit v1.2.3 From e8fbf976da8ea9f276fe7ad19c4d2693b1f90847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 6 Mar 2014 14:02:51 +0100 Subject: 2.3.1 beta3 --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 10a307bfb..976b84e01 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="23103" + android:versionName="2.3.1 beta3"> Sign -- cgit v1.2.3 From 633cca21a0a4310c62804caf64bf0d6f5d52cc78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 6 Mar 2014 19:41:07 +0100 Subject: remove unused search definitions from manifest --- OpenPGP-Keychain/src/main/AndroidManifest.xml | 40 --------------------------- 1 file changed, 40 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml index 976b84e01..8aa37393f 100644 --- a/OpenPGP-Keychain/src/main/AndroidManifest.xml +++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml @@ -69,30 +69,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - - - - -- cgit v1.2.3 From 8e29b82d6daa689f07a8318bf194c8fb17133c95 Mon Sep 17 00:00:00 2001 From: Ankush Date: Thu, 6 Mar 2014 10:05:43 +0530 Subject: corrected commit mCurrentPassPhrase, mChangePassPhrase Minor variable naming Issue #338 --- .../org/sufficientlysecure/keychain/Constants.java | 2 +- .../java/org/sufficientlysecure/keychain/Id.java | 10 +++---- .../keychain/pgp/PgpImportExport.java | 4 +-- .../keychain/pgp/PgpKeyOperation.java | 10 +++---- .../keychain/provider/ProviderHelper.java | 2 +- .../keychain/service/KeychainIntentService.java | 2 +- .../keychain/ui/EditKeyActivity.java | 34 +++++++++++----------- .../keychain/ui/EncryptActivity.java | 24 +++++++-------- .../keychain/ui/PreferencesActivity.java | 12 ++++---- .../keychain/ui/adapter/ImportKeysListLoader.java | 2 +- .../ui/dialog/PassphraseDialogFragment.java | 8 ++--- .../ui/dialog/SetPassphraseDialogFragment.java | 10 +++---- .../keychain/ui/widget/SectionView.java | 8 ++--- .../keychain/util/KeyServer.java | 2 +- .../src/main/res/layout/edit_key_activity.xml | 2 +- .../src/main/res/layout/encrypt_activity.xml | 8 ++--- .../src/main/res/values-de/strings.xml | 2 +- .../src/main/res/values-es-rCO/strings.xml | 2 +- .../src/main/res/values-es/strings.xml | 2 +- .../src/main/res/values-fr/strings.xml | 2 +- .../src/main/res/values-it-rIT/strings.xml | 2 +- .../src/main/res/values-ja/strings.xml | 2 +- .../src/main/res/values-nl-rNL/strings.xml | 2 +- .../src/main/res/values-ru/strings.xml | 2 +- .../src/main/res/values-uk/strings.xml | 2 +- OpenPGP-Keychain/src/main/res/values/arrays.xml | 4 +-- OpenPGP-Keychain/src/main/res/values/strings.xml | 2 +- .../src/main/res/xml/gen_preferences.xml | 6 ++-- 28 files changed, 85 insertions(+), 85 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java index c1809e4e1..4428c7133 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java @@ -51,7 +51,7 @@ public final class Constants { public static final String DEFAULT_ASCII_ARMOUR = "defaultAsciiArmour"; public static final String DEFAULT_MESSAGE_COMPRESSION = "defaultMessageCompression"; public static final String DEFAULT_FILE_COMPRESSION = "defaultFileCompression"; - public static final String PASS_PHRASE_CACHE_TTL = "passPhraseCacheTtl"; + public static final String PASS_PHRASE_CACHE_TTL = "passphraseCacheTtl"; public static final String LANGUAGE = "language"; public static final String FORCE_V3_SIGNATURES = "forceV3Signatures"; public static final String KEY_SERVERS = "keyServers"; diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Id.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Id.java index a1571e491..1d79edd43 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Id.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Id.java @@ -30,7 +30,7 @@ public final class Id { public static final class menu { public static final class option { - public static final int new_pass_phrase = 0x21070001; + public static final int new_passphrase = 0x21070001; public static final int create = 0x21070002; public static final int about = 0x21070003; public static final int manage_public_keys = 0x21070004; @@ -85,12 +85,12 @@ public final class Id { } public static final class dialog { - public static final int pass_phrase = 0x21070001; + public static final int passphrase = 0x21070001; public static final int encrypting = 0x21070002; public static final int decrypting = 0x21070003; - public static final int new_pass_phrase = 0x21070004; - public static final int pass_phrases_do_not_match = 0x21070005; - public static final int no_pass_phrase = 0x21070006; + public static final int new_passphrase = 0x21070004; + public static final int passphrases_do_not_match = 0x21070005; + public static final int no_passphrase = 0x21070006; public static final int saving = 0x21070007; public static final int delete_key = 0x21070008; public static final int import_keys = 0x21070009; diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java index a7a574ee7..2495a212c 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpImportExport.java @@ -90,8 +90,8 @@ public class PgpImportExport { aos.write(keyring.getEncoded()); aos.close(); - String armouredKey = bos.toString("UTF-8"); - server.add(armouredKey); + String armoredKey = bos.toString("UTF-8"); + server.add(armoredKey); return true; } catch (IOException e) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index 7caee4048..e1ca88fb0 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -107,7 +107,7 @@ public class PgpKeyOperation { * * @param algorithmChoice * @param keySize - * @param passPhrase + * @param passphrase * @param isMasterKey * @return * @throws NoSuchAlgorithmException @@ -118,7 +118,7 @@ public class PgpKeyOperation { */ // TODO: key flags? - public PGPSecretKey createKey(int algorithmChoice, int keySize, String passPhrase, + public PGPSecretKey createKey(int algorithmChoice, int keySize, String passphrase, boolean isMasterKey) throws NoSuchAlgorithmException, PGPException, NoSuchProviderException, PgpGeneralException, InvalidAlgorithmParameterException { @@ -126,8 +126,8 @@ public class PgpKeyOperation { throw new PgpGeneralException(mContext.getString(R.string.error_key_size_minimum512bit)); } - if (passPhrase == null) { - passPhrase = ""; + if (passphrase == null) { + passphrase = ""; } int algorithm = 0; @@ -181,7 +181,7 @@ public class PgpKeyOperation { // Build key encrypter and decrypter based on passphrase PBESecretKeyEncryptor keyEncryptor = new JcePBESecretKeyEncryptorBuilder( PGPEncryptedData.CAST5, sha1Calc) - .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passPhrase.toCharArray()); + .setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.toCharArray()); PGPSecretKey secKey = new PGPSecretKey(keyPair.getPrivateKey(), keyPair.getPublicKey(), sha1Calc, isMasterKey, keyEncryptor); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java index 9bee42973..8b642967f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java @@ -628,7 +628,7 @@ public class ProviderHelper { String armoredKey = bos.toString("UTF-8"); - Log.d(Constants.TAG, "armouredKey:" + armoredKey); + Log.d(Constants.TAG, "armoredKey:" + armoredKey); output.add(armoredKey); } catch (IOException e) { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index cf507826e..313655766 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -748,7 +748,7 @@ public class KeychainIntentService extends IntentService implements ProgressDial */ // need to have access to the bufferedInput, so we can reuse it for the possible // PGPObject chunks after the first one, e.g. files with several consecutive ASCII - // armour blocks + // armor blocks BufferedInputStream bufferedInput = new BufferedInputStream(new ByteArrayInputStream(downloadedKey)); try { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 0bed6f264..647ab2728 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -92,12 +92,12 @@ public class EditKeyActivity extends ActionBarActivity { private SectionView mUserIdsView; private SectionView mKeysView; - private String mCurrentPassPhrase = null; + private String mCurrentPassphrase = null; private String mNewPassPhrase = null; private String mSavedNewPassPhrase = null; private boolean mIsPassPhraseSet; - private BootstrapButton mChangePassPhrase; + private BootstrapButton mChangePassphrase; private CheckBox mNoPassphrase; @@ -150,7 +150,7 @@ public class EditKeyActivity extends ActionBarActivity { Bundle extras = intent.getExtras(); - mCurrentPassPhrase = ""; + mCurrentPassphrase = ""; if (extras != null) { // if userId is given, prefill the fields @@ -165,7 +165,7 @@ public class EditKeyActivity extends ActionBarActivity { if (noPassphrase) { // check "no passphrase" checkbox and remove button mNoPassphrase.setChecked(true); - mChangePassPhrase.setVisibility(View.GONE); + mChangePassphrase.setVisibility(View.GONE); } } @@ -181,7 +181,7 @@ public class EditKeyActivity extends ActionBarActivity { // fill values for this action Bundle data = new Bundle(); data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, - mCurrentPassPhrase); + mCurrentPassphrase); serviceIntent.putExtra(KeychainIntentService.EXTRA_DATA, data); @@ -281,9 +281,9 @@ public class EditKeyActivity extends ActionBarActivity { @Override public void handleMessage(Message message) { if (message.what == PassphraseDialogFragment.MESSAGE_OKAY) { - String passPhrase = PassphraseCacheService.getCachedPassphrase( + String passphrase = PassphraseCacheService.getCachedPassphrase( EditKeyActivity.this, masterKeyId); - mCurrentPassPhrase = passPhrase; + mCurrentPassphrase = passphrase; finallySaveClicked(); } } @@ -373,14 +373,14 @@ public class EditKeyActivity extends ActionBarActivity { } } - mCurrentPassPhrase = ""; + mCurrentPassphrase = ""; buildLayout(); mIsPassPhraseSet = PassphraseCacheService.hasPassphrase(this, masterKeyId); if (!mIsPassPhraseSet) { // check "no passphrase" checkbox and remove button mNoPassphrase.setChecked(true); - mChangePassPhrase.setVisibility(View.GONE); + mChangePassphrase.setVisibility(View.GONE); } } @@ -410,7 +410,7 @@ public class EditKeyActivity extends ActionBarActivity { // set title based on isPassphraseSet() int title = -1; if (isPassphraseSet()) { - title = R.string.title_change_pass_phrase; + title = R.string.title_change_passphrase; } else { title = R.string.title_set_passphrase; } @@ -429,7 +429,7 @@ public class EditKeyActivity extends ActionBarActivity { setContentView(R.layout.edit_key_activity); // find views - mChangePassPhrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_pass_phrase); + mChangePassphrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_passphrase); mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase); // Build layout based on given userIds and keys @@ -449,7 +449,7 @@ public class EditKeyActivity extends ActionBarActivity { updatePassPhraseButtonText(); - mChangePassPhrase.setOnClickListener(new OnClickListener() { + mChangePassphrase.setOnClickListener(new OnClickListener() { public void onClick(View v) { showSetPassphraseDialog(); } @@ -464,10 +464,10 @@ public class EditKeyActivity extends ActionBarActivity { // remove passphrase mSavedNewPassPhrase = mNewPassPhrase; mNewPassPhrase = ""; - mChangePassPhrase.setVisibility(View.GONE); + mChangePassphrase.setVisibility(View.GONE); } else { mNewPassPhrase = mSavedNewPassPhrase; - mChangePassPhrase.setVisibility(View.VISIBLE); + mChangePassphrase.setVisibility(View.VISIBLE); } } }); @@ -506,7 +506,7 @@ public class EditKeyActivity extends ActionBarActivity { if (passphrase == null) { showPassphraseDialog(masterKeyId, masterCanSign); } else { - mCurrentPassPhrase = passphrase; + mCurrentPassphrase = passphrase; finallySaveClicked(); } } catch (PgpGeneralException e) { @@ -525,7 +525,7 @@ public class EditKeyActivity extends ActionBarActivity { // fill values for this action Bundle data = new Bundle(); data.putString(KeychainIntentService.SAVE_KEYRING_CURRENT_PASSPHRASE, - mCurrentPassPhrase); + mCurrentPassphrase); data.putString(KeychainIntentService.SAVE_KEYRING_NEW_PASSPHRASE, mNewPassPhrase); data.putStringArrayList(KeychainIntentService.SAVE_KEYRING_USER_IDS, getUserIds(mUserIdsView)); @@ -696,7 +696,7 @@ public class EditKeyActivity extends ActionBarActivity { } private void updatePassPhraseButtonText() { - mChangePassPhrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase) + mChangePassphrase.setText(isPassphraseSet() ? getString(R.string.btn_change_passphrase) : getString(R.string.btn_set_passphrase)); } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 9da6c1b9f..faac9b157 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -101,8 +101,8 @@ public class EncryptActivity extends DrawerActivity { private int mEncryptTarget; - private EditText mPassPhrase = null; - private EditText mPassPhraseAgain = null; + private EditText mPassphrase = null; + private EditText mPassphraseAgain = null; private CheckBox mAsciiArmor = null; private Spinner mFileCompression = null; @@ -436,14 +436,14 @@ public class EncryptActivity extends DrawerActivity { // symmetric encryption if (mMode.getCurrentView().getId() == R.id.modeSymmetric) { boolean gotPassPhrase = false; - String passPhrase = mPassPhrase.getText().toString(); - String passPhraseAgain = mPassPhraseAgain.getText().toString(); - if (!passPhrase.equals(passPhraseAgain)) { + String passphrase = mPassphrase.getText().toString(); + String passphraseAgain = mPassphraseAgain.getText().toString(); + if (!passphrase.equals(passphraseAgain)) { AppMsg.makeText(this, R.string.passphrases_do_not_match, AppMsg.STYLE_ALERT).show(); return; } - gotPassPhrase = (passPhrase.length() != 0); + gotPassPhrase = (passphrase.length() != 0); if (!gotPassPhrase) { AppMsg.makeText(this, R.string.passphrase_must_not_be_empty, AppMsg.STYLE_ALERT) .show(); @@ -550,11 +550,11 @@ public class EncryptActivity extends DrawerActivity { if (mMode.getCurrentView().getId() == R.id.modeSymmetric) { Log.d(Constants.TAG, "Symmetric encryption enabled!"); - String passPhrase = mPassPhrase.getText().toString(); - if (passPhrase.length() == 0) { - passPhrase = null; + String passphrase = mPassphrase.getText().toString(); + if (passphrase.length() == 0) { + passphrase = null; } - data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passPhrase); + data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passphrase); } else { mSecretKeyIdToPass = mSecretKeyId; encryptionKeyIds = mEncryptionKeyIds; @@ -766,8 +766,8 @@ public class EncryptActivity extends DrawerActivity { mMainUserId = (TextView) findViewById(R.id.mainUserId); mMainUserIdRest = (TextView) findViewById(R.id.mainUserIdRest); - mPassPhrase = (EditText) findViewById(R.id.passPhrase); - mPassPhraseAgain = (EditText) findViewById(R.id.passPhraseAgain); + mPassphrase = (EditText) findViewById(R.id.passphrase); + mPassphraseAgain = (EditText) findViewById(R.id.passphraseAgain); // measure the height of the source_file view and set the message view's min height to that, // so it fills mSource fully... bit of a hack. diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java index a508e6b33..af20b499b 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/PreferencesActivity.java @@ -255,14 +255,14 @@ public class PreferencesActivity extends PreferenceActivity { || super.isValidFragment(fragmentName); } - private static void initializePassPassPhraceCacheTtl(final IntegerListPreference mPassPhraseCacheTtl) { - mPassPhraseCacheTtl.setValue("" + mPreferences.getPassPhraseCacheTtl()); - mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry()); - mPassPhraseCacheTtl + private static void initializePassPassPhraceCacheTtl(final IntegerListPreference mPassphraseCacheTtl) { + mPassphraseCacheTtl.setValue("" + mPreferences.getPassPhraseCacheTtl()); + mPassphraseCacheTtl.setSummary(mPassphraseCacheTtl.getEntry()); + mPassphraseCacheTtl .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { - mPassPhraseCacheTtl.setValue(newValue.toString()); - mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry()); + mPassphraseCacheTtl.setValue(newValue.toString()); + mPassphraseCacheTtl.setSummary(mPassphraseCacheTtl.getEntry()); mPreferences.setPassPhraseCacheTtl(Integer.parseInt(newValue.toString())); return false; } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java index 29e418db7..76649b27b 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListLoader.java @@ -97,7 +97,7 @@ public class ImportKeysListLoader extends AsyncTaskLoader 0) { PGPSecretKey masterKey = ((KeyEditor) mEditors.getChildAt(0)).getValue(); - passPhrase = PassphraseCacheService + passphrase = PassphraseCacheService .getCachedPassphrase(mActivity, masterKey.getKeyID()); isMasterKey = false; } else { - passPhrase = ""; + passphrase = ""; isMasterKey = true; } data.putBoolean(KeychainIntentService.GENERATE_KEY_MASTER_KEY, isMasterKey); - data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passPhrase); + data.putString(KeychainIntentService.GENERATE_KEY_SYMMETRIC_PASSPHRASE, passphrase); data.putInt(KeychainIntentService.GENERATE_KEY_ALGORITHM, mNewKeyAlgorithmChoice.getId()); data.putInt(KeychainIntentService.GENERATE_KEY_KEY_SIZE, mNewKeySize); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java index b1e6b3c71..7049820e8 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/KeyServer.java @@ -48,5 +48,5 @@ public abstract class KeyServer { abstract String get(long keyId) throws QueryException; - abstract void add(String armouredText) throws AddKeyException; + abstract void add(String armoredText) throws AddKeyException; } diff --git a/OpenPGP-Keychain/src/main/res/layout/edit_key_activity.xml b/OpenPGP-Keychain/src/main/res/layout/edit_key_activity.xml index 182540dc5..fc4422cf0 100644 --- a/OpenPGP-Keychain/src/main/res/layout/edit_key_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/edit_key_activity.xml @@ -27,7 +27,7 @@ android:text="@string/label_no_passphrase" /> @@ -153,7 +153,7 @@ diff --git a/OpenPGP-Keychain/src/main/res/values-de/strings.xml b/OpenPGP-Keychain/src/main/res/values-de/strings.xml index 493a3a9bb..ea1e550e3 100644 --- a/OpenPGP-Keychain/src/main/res/values-de/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-de/strings.xml @@ -13,7 +13,7 @@ Einstellungen Registrierte Anwendungen Schlüsselserver - Passwort ändern + Passwort ändern Passwort setzen E-Mail senden… In eine Datei verschlüsseln diff --git a/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml b/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml index e43cecc2c..d1f0bd75b 100644 --- a/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-es-rCO/strings.xml @@ -10,7 +10,7 @@ Editar clave Preferencias Aplicaciones registradas - Cambiar contraseña + Cambiar contraseña Establecer contraseña Enviar correo electrónico… Cifrar a archivo diff --git a/OpenPGP-Keychain/src/main/res/values-es/strings.xml b/OpenPGP-Keychain/src/main/res/values-es/strings.xml index edf190184..de680337f 100644 --- a/OpenPGP-Keychain/src/main/res/values-es/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-es/strings.xml @@ -13,7 +13,7 @@ Preferencias Aplicaciones registradas Prioridad del servidor de claves - Cambiar la frase de contraseña + Cambiar la frase de contraseña Establecer frase de contraseña Enviar email… Cifrar hacia archivo diff --git a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml index 171ce1fa5..aa9b59287 100644 --- a/OpenPGP-Keychain/src/main/res/values-fr/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-fr/strings.xml @@ -13,7 +13,7 @@ Préférences Applications enregistrées Préférences du serveur de clefs - Changer la phrase de passe + Changer la phrase de passe Définir la phrase de passe Envoyer un courriel… Chiffrer vers un fichier diff --git a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml index 5ceb4f45b..825115bc9 100644 --- a/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-it-rIT/strings.xml @@ -13,7 +13,7 @@ Preferenze App Registrate Preferenze Server delle Chiavi - Cambia Frase di Accesso + Cambia Frase di Accesso Imposta Frase di Accesso Invia Mail… Codifica File diff --git a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml index 0ba511c1e..97d5a72f4 100644 --- a/OpenPGP-Keychain/src/main/res/values-ja/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ja/strings.xml @@ -13,7 +13,7 @@ 設定 登録済みのアプリケーション 鍵サーバ設定 - パスフレーズの変更 + パスフレーズの変更 パスフレーズの設定 メールの送信… 暗号化してファイルに diff --git a/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml b/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml index 35a0b5a03..863932a80 100644 --- a/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-nl-rNL/strings.xml @@ -10,7 +10,7 @@ Sleutel bewerken Instellingen Geregistreerde apps - Wachtwoord wijzigen + Wachtwoord wijzigen Wachtwoord instellen E-mail verzenden… Versleutelen naar bestand diff --git a/OpenPGP-Keychain/src/main/res/values-ru/strings.xml b/OpenPGP-Keychain/src/main/res/values-ru/strings.xml index c8aff125b..f69cf8789 100644 --- a/OpenPGP-Keychain/src/main/res/values-ru/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-ru/strings.xml @@ -13,7 +13,7 @@ Настройки Связанные приложения Настройки сервера ключей - Изменить пароль + Изменить пароль Задать пароль Отправить… Зашифровать в файл diff --git a/OpenPGP-Keychain/src/main/res/values-uk/strings.xml b/OpenPGP-Keychain/src/main/res/values-uk/strings.xml index c883ea583..8997ef5ce 100644 --- a/OpenPGP-Keychain/src/main/res/values-uk/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values-uk/strings.xml @@ -13,7 +13,7 @@ Налаштування Зареєстровані програми Налаштування сервера ключів - Змінити парольну фразу + Змінити парольну фразу Задати парольну фразу Надіслати листа… Зашифрувати до файлу diff --git a/OpenPGP-Keychain/src/main/res/values/arrays.xml b/OpenPGP-Keychain/src/main/res/values/arrays.xml index 974239110..5244de419 100644 --- a/OpenPGP-Keychain/src/main/res/values/arrays.xml +++ b/OpenPGP-Keychain/src/main/res/values/arrays.xml @@ -1,7 +1,7 @@ - + @string/choice_15secs @string/choice_1min @string/choice_3mins @@ -15,7 +15,7 @@ @string/choice_8hours @string/choice_forever - + 15 60 180 diff --git a/OpenPGP-Keychain/src/main/res/values/strings.xml b/OpenPGP-Keychain/src/main/res/values/strings.xml index 9689010ed..34dc26571 100644 --- a/OpenPGP-Keychain/src/main/res/values/strings.xml +++ b/OpenPGP-Keychain/src/main/res/values/strings.xml @@ -14,7 +14,7 @@ Preferences Registered Applications Keyserver Preference - Change Passphrase + Change Passphrase Set Passphrase "Send Mail…" Encrypt To File diff --git a/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml b/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml index f83fcb0f6..9f1883df0 100644 --- a/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml +++ b/OpenPGP-Keychain/src/main/res/xml/gen_preferences.xml @@ -18,9 +18,9 @@ -- cgit v1.2.3 From b9a9bbe429542078ace00f7bf9719de16601768a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 6 Mar 2014 22:46:04 +0100 Subject: remove icon from nfc dialog --- .../sufficientlysecure/keychain/ui/dialog/ShareNfcDialogFragment.java | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareNfcDialogFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareNfcDialogFragment.java index 03e09cdcb..b850638a6 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareNfcDialogFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareNfcDialogFragment.java @@ -53,7 +53,6 @@ public class ShareNfcDialogFragment extends DialogFragment { AlertDialog.Builder alert = new AlertDialog.Builder(activity); - alert.setIcon(android.R.drawable.ic_dialog_info); alert.setTitle(R.string.share_nfc_dialog); alert.setCancelable(true); -- cgit v1.2.3 From 59067f9f8b0a12f875ba928b30f8f35fc284356c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Fri, 7 Mar 2014 11:24:53 +0100 Subject: API: get key --- .../keychain/service/remote/OpenPgpService.java | 57 +++++++++++++++++----- 1 file changed, 45 insertions(+), 12 deletions(-) (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java index e1801d9e7..f697faa6e 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java @@ -36,6 +36,7 @@ import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult; import org.sufficientlysecure.keychain.pgp.PgpSignEncrypt; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; import org.sufficientlysecure.keychain.provider.KeychainContract; +import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.util.InputData; import org.sufficientlysecure.keychain.util.Log; @@ -103,9 +104,8 @@ public class OpenPgpService extends RemoteService { // return PendingIntent to be executed by client Intent result = new Intent(); - result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); result.putExtra(OpenPgpApi.RESULT_INTENT, pi); - + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); return result; } @@ -114,8 +114,8 @@ public class OpenPgpService extends RemoteService { } Intent result = new Intent(); - result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); result.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keyIdsArray); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); return result; } @@ -130,9 +130,8 @@ public class OpenPgpService extends RemoteService { // return PendingIntent to be executed by client Intent result = new Intent(); - result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); result.putExtra(OpenPgpApi.RESULT_INTENT, pi); - + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); return result; } @@ -179,9 +178,9 @@ public class OpenPgpService extends RemoteService { return result; } catch (Exception e) { Intent result = new Intent(); - result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } } @@ -208,9 +207,9 @@ public class OpenPgpService extends RemoteService { } } else { Intent result = new Intent(); - result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, "Missing parameter user_ids or key_ids!")); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } @@ -267,9 +266,9 @@ public class OpenPgpService extends RemoteService { return result; } catch (Exception e) { Intent result = new Intent(); - result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } } @@ -307,7 +306,7 @@ public class OpenPgpService extends RemoteService { OpenPgpSignatureResult signatureResult = decryptVerifyResult.getSignatureResult(); if (signatureResult != null) { if (signatureResult.getStatus() == OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY) { - // If signature is unknown we return an additional PendingIntent + // If signature is unknown we return an _additional_ PendingIntent // to retrieve the missing key // TODO!!! Intent intent = new Intent(getBaseContext(), RemoteServiceActivity.class); @@ -333,9 +332,44 @@ public class OpenPgpService extends RemoteService { return result; } catch (Exception e) { Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_ERROR, + new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); + return result; + } + } + + private Intent getKeyImpl(Intent data) { + try { + long keyId = data.getLongExtra(OpenPgpApi.EXTRA_KEY_ID, 0); + + if (ProviderHelper.getPGPPublicKeyByKeyId(this, keyId) == null) { + Intent result = new Intent(); + + // If keys are not in db we return an additional PendingIntent + // to retrieve the missing key + // TODO!!! + Intent intent = new Intent(getBaseContext(), RemoteServiceActivity.class); + intent.setAction(RemoteServiceActivity.ACTION_ERROR_MESSAGE); + intent.putExtra(RemoteServiceActivity.EXTRA_ERROR_MESSAGE, "todo"); + intent.putExtra(RemoteServiceActivity.EXTRA_DATA, data); + + PendingIntent pi = PendingIntent.getActivity(getBaseContext(), + PRIVATE_REQUEST_CODE_GET_KEYS, intent, 0); + + result.putExtra(OpenPgpApi.RESULT_INTENT, pi); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED); + return result; + } else { + Intent result = new Intent(); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); + return result; + } + } catch (Exception e) { + Intent result = new Intent(); result.putExtra(OpenPgpApi.RESULT_ERROR, new OpenPgpError(OpenPgpError.GENERIC_ERROR, e.getMessage())); + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR); return result; } } @@ -405,9 +439,8 @@ public class OpenPgpService extends RemoteService { return encryptAndSignImpl(data, input, output, appSettings, true); } else if (OpenPgpApi.ACTION_DECRYPT_VERIFY.equals(action)) { return decryptAndVerifyImpl(data, input, output, appSettings); - } else if (OpenPgpApi.ACTION_DOWNLOAD_KEYS.equals(action)) { - // TODO! - return null; + } else if (OpenPgpApi.ACTION_GET_KEY.equals(action)) { + return getKeyImpl(data); } else if (OpenPgpApi.ACTION_GET_KEY_IDS.equals(action)) { return getKeyIdsImpl(data); } else { -- cgit v1.2.3