diff options
author | pedroGitt <pedro.contreiras@amdocs.com> | 2016-11-14 11:56:37 +0100 |
---|---|---|
committer | pedroGitt <pedro.contreiras@amdocs.com> | 2016-11-14 11:56:37 +0100 |
commit | 04fd4c5a1301545419fb72533c57e4253085bdc0 (patch) | |
tree | 642de7b2fb37daebfdfc7a9ca80744bf58a5e044 /java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java | |
parent | d944d5fad70283e4cc095802fd893b87309f341d (diff) |
Fix the decrypt issue (crash on V5.1.1) when the message to decrypt contains emojis:AndroidSdk_v0.2.0
- add an internal specific JNI function (javaCStringToUtf8()) to perform the UTF-8 conversion
- the SDK is configured to enable/disable the use of javaCStringToUtf8()
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java')
-rw-r--r-- | java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java index 50e77f7..fa4ca1d 100644 --- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java +++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java @@ -123,16 +123,26 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri private native int initInboundGroupSessionWithSessionKeyJni(String aSessionKey); + /** + * Retrieve the base64-encoded identifier for this inbound group session. + * @return the session ID if operation succeed, null otherwise + */ public String sessionIdentifier() { return sessionIdentifierJni(); } private native String sessionIdentifierJni(); + /** + * Decrypt the message passed in parameter. + * @param aEncryptedMsg the message to be decrypted + * @return the decrypted message if operation succeed, null otherwise. + */ public String decryptMessage(String aEncryptedMsg) { - return decryptMessageJni(aEncryptedMsg); + String decryptedMessage = decryptMessageJni(aEncryptedMsg, OlmManager.ENABLE_STRING_UTF8_SPECIFIC_CONVERSION); + return decryptedMessage; } - private native String decryptMessageJni(String aEncryptedMsg); + private native String decryptMessageJni(String aEncryptedMsg, boolean aIsUtf8ConversionRequired); /** |