From e319dd2cee7dc2597d4e9fcb8b52fe75b96c7b39 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 6 Mar 2014 19:59:56 +0100 Subject: [PATCH] api bug fix --- src/eu/siacs/conversations/crypto/PgpEngine.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java index 783844410..bc3aaa8c5 100644 --- a/src/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/eu/siacs/conversations/crypto/PgpEngine.java @@ -10,6 +10,7 @@ import org.openintents.openpgp.util.OpenPgpApi; import android.app.PendingIntent; import android.content.Intent; +import android.util.Log; public class PgpEngine { private OpenPgpApi api; @@ -39,7 +40,8 @@ public class PgpEngine { } public String encrypt(long keyId, String message) { - Long[] keys = {keyId}; + Log.d("xmppService","encrypt message: "+message+" for key "+keyId); + long[] keys = {keyId}; Intent params = new Intent(); params.setAction(OpenPgpApi.ACTION_ENCRYPT); params.putExtra(OpenPgpApi.EXTRA_KEY_IDS,keys); @@ -49,6 +51,8 @@ public class PgpEngine { ByteArrayOutputStream os = new ByteArrayOutputStream(); Intent result = api.executeApi(params, is, os); StringBuilder encryptedMessageBody = new StringBuilder(); + Log.d("xmppService","intent: "+result.toString()); + Log.d("xmppService","output: "+os.toString()); String[] lines = os.toString().split("\n"); for (int i = 3; i < lines.length - 1; ++i) { encryptedMessageBody.append(lines[i].trim());