From 074b6633b015aba84f8f60a05878a93d4b8ec9b2 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 6 Jun 2015 23:17:42 +0200 Subject: eventbus: initial attempt, replace messenger hack with eventbus communication --- .../keychain/service/KeychainService.java | 89 +--------------------- 1 file changed, 1 insertion(+), 88 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java index b8cb9de27..e4bfd7dee 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java @@ -30,6 +30,7 @@ import android.os.RemoteException; import com.textuality.keybase.lib.Proof; import com.textuality.keybase.lib.prover.Prover; +import de.greenrobot.event.EventBus; import org.json.JSONObject; import org.spongycastle.openpgp.PGPUtil; import org.sufficientlysecure.keychain.Constants; @@ -96,14 +97,9 @@ public class KeychainService extends Service implements Progressable { public static final String EXTRA_DATA = "data"; /* possible actions */ - public static final String ACTION_SIGN_ENCRYPT = Constants.INTENT_PREFIX + "SIGN_ENCRYPT"; - - public static final String ACTION_DECRYPT_VERIFY = Constants.INTENT_PREFIX + "DECRYPT_VERIFY"; public static final String ACTION_VERIFY_KEYBASE_PROOF = Constants.INTENT_PREFIX + "VERIFY_KEYBASE_PROOF"; - public static final String ACTION_DECRYPT_METADATA = Constants.INTENT_PREFIX + "DECRYPT_METADATA"; - public static final String ACTION_EDIT_KEYRING = Constants.INTENT_PREFIX + "EDIT_KEYRING"; public static final String ACTION_PROMOTE_KEYRING = Constants.INTENT_PREFIX + "PROMOTE_KEYRING"; @@ -113,8 +109,6 @@ public class KeychainService extends Service implements Progressable { public static final String ACTION_UPLOAD_KEYRING = Constants.INTENT_PREFIX + "UPLOAD_KEYRING"; - public static final String ACTION_CERTIFY_KEYRING = Constants.INTENT_PREFIX + "SIGN_KEYRING"; - public static final String ACTION_DELETE = Constants.INTENT_PREFIX + "DELETE"; public static final String ACTION_CONSOLIDATE = Constants.INTENT_PREFIX + "CONSOLIDATE"; @@ -123,14 +117,6 @@ public class KeychainService extends Service implements Progressable { /* keys for data bundle */ - // encrypt - public static final String ENCRYPT_DECRYPT_INPUT_URI = "input_uri"; - public static final String ENCRYPT_DECRYPT_OUTPUT_URI = "output_uri"; - public static final String SIGN_ENCRYPT_PARCEL = "sign_encrypt_parcel"; - - // decrypt/verify - public static final String DECRYPT_VERIFY_PARCEL = "decrypt_verify_parcel"; - // keybase proof public static final String KEYBASE_REQUIRED_FINGERPRINT = "keybase_required_fingerprint"; public static final String KEYBASE_PROOF = "keybase_proof"; @@ -158,9 +144,6 @@ public class KeychainService extends Service implements Progressable { // upload key public static final String UPLOAD_KEY_SERVER = "upload_key_server"; - // certify key - public static final String CERTIFY_PARCEL = "certify_parcel"; - // promote key public static final String PROMOTE_MASTER_KEY_ID = "promote_master_key_id"; public static final String PROMOTE_CARD_AID = "promote_card_aid"; @@ -232,23 +215,6 @@ public class KeychainService extends Service implements Progressable { // executeServiceMethod action from extra bundle switch (action) { - case ACTION_CERTIFY_KEYRING: { - - // Input - CertifyActionsParcel parcel = data.getParcelable(CERTIFY_PARCEL); - CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT); - String keyServerUri = data.getString(UPLOAD_KEY_SERVER); - - // Operation - CertifyOperation op = new CertifyOperation(mKeychainService, providerHelper, mKeychainService, - mActionCanceled); - CertifyResult result = op.certify(parcel, cryptoInput, keyServerUri); - - // Result - sendMessageToHandler(MessageStatus.OKAY, result); - - break; - } case ACTION_CONSOLIDATE: { // Operation @@ -264,24 +230,6 @@ public class KeychainService extends Service implements Progressable { break; } - case ACTION_DECRYPT_METADATA: { - - // Input - CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT); - PgpDecryptVerifyInputParcel input = data.getParcelable(DECRYPT_VERIFY_PARCEL); - - // this action is here for compatibility only - input.setDecryptMetadataOnly(true); - - // Operation - PgpDecryptVerify op = new PgpDecryptVerify(mKeychainService, providerHelper, mKeychainService); - DecryptVerifyResult decryptVerifyResult = op.execute(input, cryptoInput); - - // Result - sendMessageToHandler(MessageStatus.OKAY, decryptVerifyResult); - - break; - } case ACTION_VERIFY_KEYBASE_PROOF: { try { @@ -376,25 +324,6 @@ public class KeychainService extends Service implements Progressable { break; } - case ACTION_DECRYPT_VERIFY: { - - // Input - CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT); - PgpDecryptVerifyInputParcel input = data.getParcelable(DECRYPT_VERIFY_PARCEL); - - // for compatibility - // TODO merge with ACTION_DECRYPT_METADATA - input.setDecryptMetadataOnly(false); - - // Operation - PgpDecryptVerify op = new PgpDecryptVerify(mKeychainService, providerHelper, mKeychainService); - DecryptVerifyResult decryptVerifyResult = op.execute(input, cryptoInput); - - // Output - sendMessageToHandler(MessageStatus.OKAY, decryptVerifyResult); - - break; - } case ACTION_DELETE: { // Input @@ -495,22 +424,6 @@ public class KeychainService extends Service implements Progressable { break; } - case ACTION_SIGN_ENCRYPT: { - - // Input - SignEncryptParcel inputParcel = data.getParcelable(SIGN_ENCRYPT_PARCEL); - CryptoInputParcel cryptoInput = data.getParcelable(EXTRA_CRYPTO_INPUT); - - // Operation - SignEncryptOperation op = new SignEncryptOperation( - mKeychainService, providerHelper, mKeychainService, mActionCanceled); - SignEncryptResult result = op.execute(inputParcel, cryptoInput); - - // Result - sendMessageToHandler(MessageStatus.OKAY, result); - - break; - } case ACTION_UPLOAD_KEYRING: { try { -- cgit v1.2.3