diff --git a/FlowCrypt/build.gradle b/FlowCrypt/build.gradle index 7a4c10edda..054e8fccc1 100644 --- a/FlowCrypt/build.gradle +++ b/FlowCrypt/build.gradle @@ -17,6 +17,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: "androidx.navigation.safeargs.kotlin" apply plugin: "com.starter.easylauncher" +apply plugin: "kotlin-parcelize" def keystoreProperties = new Properties() File propertiesFile = project.file("keystore.properties") diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json index ecf0da1d9c..aaa98b80ef 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json @@ -57,12 +57,13 @@ "uid": 17 }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "This is an encrypted message with inline attachment" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json index 2ee180d234..81b4a230e3 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json @@ -42,12 +42,13 @@ "isEncrypted": true }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "Encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json index 05115ab78c..adde4279c7 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json @@ -55,12 +55,13 @@ "uidAsHEX": "18" }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json index 0dafb7ed6d..16a8bb9a60 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json @@ -42,12 +42,13 @@ "uidAsHEX": "12" }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "It\u0027s an encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json index 4a509ad6e5..de8b088f90 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json @@ -42,12 +42,13 @@ "uid": 14 }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "Simple encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json index dde1594ab6..3450836b4d 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json @@ -61,11 +61,12 @@ }, "text": "", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": false, "isPartialSigned": false, - "isSigned": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json index 8d3c0e38b9..c5d8d4caf4 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json @@ -67,12 +67,13 @@ "isEncrypted": true }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid IE29GpAIe19wKAAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 11:50:40 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 69234B2058E\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 11:50:40 +0000 (UTC)\r\nContent-Type: multipart/mixed;\r\n boundary\u003d\"----sinikael-?\u003d_1-16018986371740.9899334451956217\"\r\nTo: default@flowcrypt.test\r\nFrom: denbond7@flowcrypt.test\r\nSubject: only one pubkey used for encryption - possibly sender\u0027s error.\r\nDate: Mon, 05 Oct 2020 11:50:37 +0000\r\nMessage-Id: \u003c1601898637180-545631c7-a98f62fb-091da09b@flowcrypt.test\u003e\r\nMime-Version: 1.0", "text": "The message below should show a note telling the user that there was only one pubkey used for encryption - possibly sender\u0027s error.\n\nIt should also allow the user import a missing key if they have one." diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json index f39752b1bf..73fc90c7cf 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json @@ -68,12 +68,13 @@ "uid": 16 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json index 7d61174b7e..444a7804cb 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json @@ -43,12 +43,13 @@ "uid": 16 }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "It\u0027s a message with a missing key." } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json index b13ab12b42..8747006165 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json @@ -42,12 +42,13 @@ "uid": 12 }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "It\u0027s an encrypted message with one encrypted attachment." } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json index 1b6bd4c09c..d762c196c9 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json @@ -80,12 +80,13 @@ "uid": 13 }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "It\u0027s an encrypted message with my pub key" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key_mod_after_revoked.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key_mod_after_revoked.json index 1e545650c4..b56b8ea295 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key_mod_after_revoked.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key_mod_after_revoked.json @@ -1566,12 +1566,12 @@ }, "text": "This message contains a pub key that has latModified \u003e than a revoked key. It can be used to test updating revoked keys from the message details screen.", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": true, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": false, + "hasMixedSignatures": false, "isPartialSigned": true, - "keyIdOfSigningKeys": [] + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json index 4aeea8908f..829f1e650b 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json @@ -51,12 +51,13 @@ "uidAsHEX": "19" }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "33333" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json index d80a6ad39d..58ed24946b 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json @@ -59,12 +59,13 @@ "uidAsHEX": "12" }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json index 992b6babc8..61d2c716cf 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json @@ -57,12 +57,13 @@ "uidAsHEX": "e" }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json index c00dc1ea7e..474534440e 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json @@ -43,12 +43,13 @@ "uidAsHEX": "16" }, "verificationResult": { - "isEncrypted": true, - "isSigned": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "Some encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/message_with_broken_base64.json b/FlowCrypt/src/androidTest/assets/messages/info/message_with_broken_base64.json index ee37ad5f9f..c67b6edc16 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/message_with_broken_base64.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/message_with_broken_base64.json @@ -42,11 +42,12 @@ }, "text": "We have an activity which has a NavHostFragment. The activity receives certain values in its intent. I want to pass this data to the first fragment i.e startDestination of the navigat", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": false, "isPartialSigned": false, - "isSigned": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json b/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json index f953855917..ceca075f02 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json @@ -44,12 +44,13 @@ "uid": 17 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid 3yVQLfBPe1+6QAAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 16:55:12 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id B623BB20B92\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 16:55:12 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nSubject: 8bit encoded utf broken\r\nAutocrypt: addr\u003ddenbond7@flowcrypt.test; keydata\u003d\r\n mQENBFyM4vkBCACr8FvuG4MAZsz90hrZ2B+oEznArD46QUbAGrPT8JU6zz27SfLmTTbTA86q\r\n +DVAZC94CZ2lqJaG7KY7eqHFqJObetA8mcUk0Oo3EshphpK0MnNv+bHFpKf/srJgKSDmpCF+\r\n JSHeZs2WAPtrdfoTO1KPy5IZexMWdnhYZy8d0xUr4rPZ7i2UyrkdV3k2O9x4aG5tD1Zo/Wkm\r\n lTv8z2BtAwAziqUQFxABQLu1fzcRkMHTMcGVXrB+73GITl03GbfeJHvFuThhofqP09o/p3Y1\r\n 8Zm+zVWL/T4zsA5P+Cp6kwnwUnQkL3Tc49a0qIJShlP4LbSbPBqFGWTHxceCkFBkMVoJABEB\r\n AAG0LWRlbmJvbmQ3QGRlbmJvbmQ3LmNvbSA8ZGVuYm9uZDdAZGVuYm9uZDcuY29tPokBPwQQ\r\n AQgAKQUCXIzjAQYLCQcIAwIJEGoVBlPxgAh0BBUICgIDFgIBAhkBAhsDAh4BAAoJEGoVBlPx\r\n gAh0L2EIAJRM22lnSHhgQ+waiCf0p739L3XKs2eDZUkxAX+4an654wnn1OjxWrG7lls2GgN1\r\n ziKHHdGgxU4PQ8PmQrgyc6F05vmYihRFaVFDQ97xF16+IvO4xiuYMuJk7ovsr5mrlI43CWE4\r\n f7GPtmJ7QYTlxeYW3s7KLqr0TKxqGG8f6qRjy/Q1ky3qnseR5Fp1GjIwijVI2rncfH0lOkNm\r\n BHj4aYugN60HNlUJbosb2vjJkz5dsqe+nY3XVKI6Iqq07I+Jvankn6jyvlMP8jNLxQMUsqrt\r\n Bki/C6ett3z+JeP2+2Nh+mp1vDW/kO7gSgRHUEPJ9w/VVIpWIOTEv+Bsz3l28h65AQ0EXIzj\r\n AAEIAJKbKexaP/2HqUAj/DxOebhKqw2ddK5HsYacv12pHVTEVjOnLQELyroZ1ikO21UK8Z/z\r\n ng9+8DlCz72SMql+/uZYpoEdgqMy9PU3zPDzGcAeOr07R56G08l+hUO/i3FMW4v2ZT6gLCIn\r\n AJ417wSvF4wg6dJzfrBFkj7o2lyTOwfD87CehQozyGza1cb+yS3ZPC8oc99a1jwSqFYecDI2\r\n 7Cgy7KWSbhSfoPcJG4KPTLDrvVn2Y+U2jxx6OiYXRai8wwlheAmIohmZNpHLaCQiTZTWRYPK\r\n vP0kb6aoN9O4fGhgMh3QAbc2BVwh299rToBieI/zow+I9OcrScejwQNI2VUAEQEAAYkBKQQY\r\n AQgAEwUCXIzjAgkQahUGU/GACHQCGwwACgkQahUGU/GACHSfcQf/euBJSXopDZxAVniN9HDQ\r\n Dga+ccwJYWZvyiDOaGSoSxW3QDhTOWbCH66GkZiOp9KLObHs54KzoOGaOJbQmhWGR4rwNdGS\r\n np8oWimyyXVEHHhir2BmT8MZrMC3WpMPmUlY2v9CMFD7hF2OfmXd1M9fuFT41aZQVDgGSdYc\r\n IQchOmUv3NQUiBJyOlp1bF1RT7Yf3UjAQANyENz19fYHKd2yh9Ltv3CYVjwRB4crQmuESxM8\r\n 7IEXDVNnYOBP0F5WaSQEesFAhjk+cVjxTUfcmM04YEFhedBStsV8kWF50ojYgF9te4yRM/zo\r\n NRi6SjWLSeEw/zIfvkggDvn1UfA2bGFk8Q\u003d\u003d\r\nMessage-ID: \u003c6e66bc34-0e1f-bb13-ccdc-8e61bdf63f6a@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 19:55:12 +0300\r\nMime-Version: 1.0\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------FD1FA5F98C2FD885200F7353\"\r\nContent-Language: en-US", "text": "Text: Ваше оголошення" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_missing_pub_key_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_missing_pub_key_only_signed.json index 97c9aa11a3..f41101d7a5 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_missing_pub_key_only_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_missing_pub_key_only_signed.json @@ -49,14 +49,14 @@ }, "text": "It\u0026#39;s a cleartext signed message. It was signed with a wrong private key.Sender and signer are different.", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": true, + "hasMixedSignatures": false, "isPartialSigned": false, "keyIdOfSigningKeys": [ -5209761791998677675 - ] + ], + "hasBadSignatures": false, + "hasUnverifiedSignatures": true } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed.json index 61a74b91b2..2814d8abc0 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed.json @@ -47,12 +47,12 @@ }, "text": "It\u0026#39;s a cleartext signed message", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": false, + "hasMixedSignatures": false, "isPartialSigned": false, - "keyIdOfSigningKeys": [] + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_mixed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_mixed.json index 81914ea401..298ad7281c 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_mixed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_mixed.json @@ -47,12 +47,12 @@ }, "text": "It\u0026#39;s a cleartext signed with the first key\nIt\u0026#39;s a cleartext signed with the second key", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": true, "hasSignedParts": true, - "hasUnverifiedSignatures": false, + "hasMixedSignatures": true, "isPartialSigned": false, - "keyIdOfSigningKeys": [] + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_partially.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_partially.json index 8394243d92..d8c211e4fa 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_partially.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_cleartext_only_signed_partially.json @@ -47,12 +47,12 @@ }, "text": "It\u0027s a regular unsigned and unencrypted text.\nIt\u0026#39;s a cleartext signed message", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": false, + "hasMixedSignatures": false, "isPartialSigned": true, - "keyIdOfSigningKeys": [] + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed.json index b3c7441eaf..80dc9d6112 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed.json @@ -48,11 +48,12 @@ }, "text": "NOT encrypted + signed(detached)", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": false, - "isPartialSigned": false + "hasMixedSignatures": false, + "isPartialSigned": false, + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key.json index a9e8396918..07ee7e90e0 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key.json @@ -827,11 +827,12 @@ }, "text": "NOT encrypted + signed(detached) + public key", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": false, - "isPartialSigned": false + "hasMixedSignatures": false, + "isPartialSigned": false, + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key_attachment.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key_attachment.json index 3722adc023..1b9b21a995 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key_attachment.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_detached_only_signed_public_key_attachment.json @@ -837,11 +837,12 @@ }, "text": "NOT encrypted + signed(detached) + public key + attachment", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": true, - "hasUnverifiedSignatures": false, - "isPartialSigned": false + "hasMixedSignatures": false, + "isPartialSigned": false, + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json index bced61e816..8eb16c78bf 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json @@ -44,11 +44,12 @@ }, "text": "It's encrypted and signed message", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": true, + "hasSignedParts": true, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": true, "isPartialSigned": false, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json index 026cd5b834..376c37aa74 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json @@ -45,11 +45,12 @@ }, "text": "Encrypted + signed with the primary key\nEncrypted + signed with the second key", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": true, + "hasSignedParts": true, "hasMixedSignatures": true, - "hasUnverifiedSignatures": true, - "isEncrypted": true, "isPartialSigned": false, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": true } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json index d56c542565..3fbcd04f42 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json @@ -44,11 +44,12 @@ }, "text": "Some encrypted and signed text\nIt\u0027s encrypted only message", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": true, + "hasSignedParts": true, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": true, "isPartialSigned": true, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json index cb57f4ab08..36122fba88 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json @@ -44,11 +44,12 @@ }, "text": "It\u0027s an encrypted message that was signed with a wrong private key. Sender and signer are different.", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": true, + "hasSignedParts": true, "hasMixedSignatures": false, - "hasUnverifiedSignatures": true, - "isEncrypted": true, "isPartialSigned": false, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": true } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json index 880023eac9..13a518ebc9 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json @@ -44,11 +44,12 @@ }, "text": "It's a regular message that was signed with a wrong private key. Sender and signer are different.", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": false, + "hasSignedParts": true, "hasMixedSignatures": false, - "hasUnverifiedSignatures": true, - "isEncrypted": false, "isPartialSigned": false, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": true } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json index dac129a54f..5cd58939ae 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json @@ -44,11 +44,12 @@ }, "text": "It\u0027s encrypted only message", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": true, + "hasSignedParts": false, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": true, "isPartialSigned": false, - "isSigned": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json index 615daf7ebb..8fdf82becb 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json @@ -43,11 +43,12 @@ }, "text": "It's signed (Inband) only message.", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": false, + "hasSignedParts": true, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": false, "isPartialSigned": false, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json index bb71f70cf2..7798838e45 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json @@ -45,11 +45,12 @@ }, "text": "Signed with a primary key\nSigned with the second key", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": false, + "hasSignedParts": true, "hasMixedSignatures": true, - "hasUnverifiedSignatures": true, - "isEncrypted": false, "isPartialSigned": false, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": true } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json index c1eb8ba5a7..edd476e139 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json @@ -43,11 +43,12 @@ }, "text": "Some plain text\nOnly signed message", "verificationResult": { - "hasBadSignatures": false, + "hasEncryptedParts": false, + "hasSignedParts": true, "hasMixedSignatures": false, - "hasUnverifiedSignatures": false, - "isEncrypted": false, "isPartialSigned": true, - "isSigned": true + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json index 4bb902c02d..34a45ea8d0 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json @@ -43,12 +43,13 @@ "uidAsHEX": "1a" }, "verificationResult": { - "isEncrypted": false, - "isSigned": true, + "hasEncryptedParts": false, + "hasSignedParts": true, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "Signed text for default@flowcrypt.test" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json index 0467a70120..112877a413 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json @@ -43,12 +43,13 @@ "uidAsHEX": "1c" }, "verificationResult": { - "isEncrypted": false, - "isSigned": true, + "hasEncryptedParts": false, + "hasSignedParts": true, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "Some important text that is signed" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json index 2880685a81..163360f4d1 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json @@ -53,11 +53,12 @@ }, "text": "", "verificationResult": { - "hasBadSignatures": false, "hasEncryptedParts": false, - "hasMixedSignatures": false, "hasSignedParts": false, - "hasUnverifiedSignatures": false, - "isPartialSigned": false + "hasMixedSignatures": false, + "isPartialSigned": false, + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false } } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json index f53b30b35a..9228e86959 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json @@ -44,12 +44,13 @@ "uid": 5 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_outbox.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_outbox.json index aeeb956587..63dd2ace7d 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_outbox.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_outbox.json @@ -43,12 +43,13 @@ "uid": 5 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json index 44572b5cf8..d450712a26 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json @@ -49,12 +49,13 @@ "uid": 5 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json index defda0e4c3..5d32f166fd 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json @@ -48,12 +48,13 @@ "uid": 5 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json index c301dc4924..451da1d2bd 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json @@ -44,12 +44,13 @@ "uid": 6 }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid YISlMxbcel9GEwAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:40:54 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id D03A0A2098A\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:40:54 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003cfacd4f6d-9e74-977b-3f11-abbe7cd467eb@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:40:54 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message + one attachment\r\nContent-Type: multipart/mixed;\r\n boundary\u003d\"------------9575DD1DBF2C2FFA08F4568A\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext and one attachment" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json index 445bbc1c17..a02a7eac00 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json @@ -48,12 +48,13 @@ } ], "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id E24B021EE5\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:36 +0000 (UTC)\r\nAuthentication-Results: mail.flowcrypt.test (amavisd-new); dkim\u003dpass\r\n\treason\u003d\"pass (just generated, assumed good)\" header.d\u003dflowcrypt.test\r\nDKIM-Signature: v\u003d1; a\u003drsa-sha256; c\u003drelaxed/simple; d\u003dflowcrypt.test; h\u003d\r\n\tuser-agent:message-id:reply-to:subject:subject:to:from:from:date\r\n\t:date:content-transfer-encoding:content-type:content-type\r\n\t:mime-version; s\u003ddkim; t\u003d1569929122; x\u003d1570793123; bh\u003dx1bgGo2MG/\r\n\tBhDI0wq3RU1YBrrUGERXYHxNAJggBUVNU\u003d; b\u003dHMAJby/fdCu+baav9xxlUpzo4f\r\n\toCJrkHjltgdAUnwvCA7gmFG0rOH366G57fQME7Vv0KtjodHoG3ijNotoJUw+66VS\r\n\tww9CjSWXadPriTIXN/cRzJBnNN9Lvp5qEcg93MI0kTvX5kJHZEAG7jbZZUXX3LUw\r\n\tXWKNohPwqcECOM8fI\u003d\r\nX-Virus-Scanned: Debian amavisd-new at mail.flowcrypt.test\r\nReceived: from mail.flowcrypt.test ([127.0.0.1])\r\n\tby mail.flowcrypt.test (mail.flowcrypt.test [127.0.0.1]) (amavisd-new, port 10026)\r\n\twith ESMTP id 640VPIOx-Lcz for \u003cdefault@flowcrypt.test\u003e;\r\n\tTue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nReceived: from flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTPSA id 6D12421ED6\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset\u003dUS-ASCII; format\u003dflowed\r\nContent-Transfer-Encoding: 7bit\r\nDate: Tue, 01 Oct 2019 14:25:21 +0300\r\nFrom: denbond7@flowcrypt.test\r\nTo: Default \u003cdefault@flowcrypt.test\u003e\r\nSubject: Honor reply-to address\r\nReply-To: android@flowcrypt.test\r\nMail-Reply-To: android@flowcrypt.test\r\nMessage-ID: \u003c8b50eeb45d3b6cd88be8d06907b171de@flowcrypt.test\u003e\r\nX-Sender: denbond7@flowcrypt.test\r\nUser-Agent: Roundcube Webmail", "text": "Some message with some text. See details here https://github.com/FlowCrypt/flowcrypt-android/issues/602" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json index 22f4f3837d..a0710b5fb0 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json @@ -54,12 +54,13 @@ } ], "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id E24B021EE5\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:36 +0000 (UTC)\r\nAuthentication-Results: mail.flowcrypt.test (amavisd-new); dkim\u003dpass\r\n\treason\u003d\"pass (just generated, assumed good)\" header.d\u003dflowcrypt.test\r\nDKIM-Signature: v\u003d1; a\u003drsa-sha256; c\u003drelaxed/simple; d\u003dflowcrypt.test; h\u003d\r\n\tuser-agent:message-id:reply-to:subject:subject:to:from:from:date\r\n\t:date:content-transfer-encoding:content-type:content-type\r\n\t:mime-version; s\u003ddkim; t\u003d1569929122; x\u003d1570793123; bh\u003dx1bgGo2MG/\r\n\tBhDI0wq3RU1YBrrUGERXYHxNAJggBUVNU\u003d; b\u003dHMAJby/fdCu+baav9xxlUpzo4f\r\n\toCJrkHjltgdAUnwvCA7gmFG0rOH366G57fQME7Vv0KtjodHoG3ijNotoJUw+66VS\r\n\tww9CjSWXadPriTIXN/cRzJBnNN9Lvp5qEcg93MI0kTvX5kJHZEAG7jbZZUXX3LUw\r\n\tXWKNohPwqcECOM8fI\u003d\r\nX-Virus-Scanned: Debian amavisd-new at mail.flowcrypt.test\r\nReceived: from mail.flowcrypt.test ([127.0.0.1])\r\n\tby mail.flowcrypt.test (mail.flowcrypt.test [127.0.0.1]) (amavisd-new, port 10026)\r\n\twith ESMTP id 640VPIOx-Lcz for \u003cdefault@flowcrypt.test\u003e;\r\n\tTue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nReceived: from flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTPSA id 6D12421ED6\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset\u003dUS-ASCII; format\u003dflowed\r\nContent-Transfer-Encoding: 7bit\r\nDate: Tue, 01 Oct 2019 14:25:21 +0300\r\nFrom: denbond7@flowcrypt.test\r\nTo: Default \u003cdefault@flowcrypt.test\u003e\r\nSubject: Honor reply-to address\r\nReply-To: android@flowcrypt.test\r\nMail-Reply-To: android@flowcrypt.test\r\nMessage-ID: \u003c8b50eeb45d3b6cd88be8d06907b171de@flowcrypt.test\u003e\r\nX-Sender: denbond7@flowcrypt.test\r\nUser-Agent: Roundcube Webmail", "text": "Some message with some text. See details here https://github.com/FlowCrypt/flowcrypt-android/issues/602" diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json index e79dcbc118..e8c43b4e67 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json @@ -107,12 +107,13 @@ "uidAsHEX": "1d" }, "verificationResult": { - "isEncrypted": false, - "isSigned": false, + "hasEncryptedParts": false, + "hasSignedParts": false, "hasMixedSignatures": false, "isPartialSigned": false, - "hasUnverifiedSignatures": false, - "hasBadSignatures": false + "keyIdOfSigningKeys": [], + "hasBadSignatures": false, + "hasUnverifiedSignatures": false }, "text": "This message has an attached pub key that has no suitable encryption subkeys" } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AttachmentInfo.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AttachmentInfo.kt index 1bdda9667d..f5cfb718d7 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AttachmentInfo.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AttachmentInfo.kt @@ -6,12 +6,11 @@ package com.flowcrypt.email.api.email.model import android.net.Uri -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.Constants import com.flowcrypt.email.core.msg.RawBlockParser -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt import com.flowcrypt.email.security.SecurityUtils +import kotlinx.parcelize.Parcelize /** * Simple POJO which defines information about email attachments. @@ -21,6 +20,7 @@ import com.flowcrypt.email.security.SecurityUtils * Time: 18:38 * E-mail: DenBond7@gmail.com */ +@Parcelize data class AttachmentInfo constructor( var rawData: ByteArray? = null, var email: String? = null, @@ -55,54 +55,6 @@ data class AttachmentInfo constructor( ) } - constructor(source: Parcel) : this( - source.createByteArray(), - source.readString(), - source.readString(), - source.readLong(), - source.readString(), - source.readLong(), - source.readString(), - source.readLong(), - source.readString()!!, - source.readString(), - source.readString()!!, - source.readParcelableViaExt(Uri::class.java), - source.readByte() != 0.toByte(), - source.readByte() != 0.toByte(), - source.readByte() != 0.toByte(), - source.readByte() != 0.toByte(), - source.readInt(), - source.readByte() != 0.toByte(), - ) - - override fun describeContents(): Int { - return 0 - } - - override fun writeToParcel(dest: Parcel, flags: Int) { - with(dest) { - writeByteArray(rawData) - writeString(email) - writeString(folder) - writeLong(uid) - writeString(fwdFolder) - writeLong(fwdUid) - writeString(name) - writeLong(encodedSize) - writeString(type) - writeString(id) - writeString(path) - writeParcelable(uri, flags) - writeByte(if (isProtected) 1.toByte() else 0.toByte()) - writeByte(if (isForwarded) 1.toByte() else 0.toByte()) - writeByte(if (isDecrypted) 1.toByte() else 0.toByte()) - writeByte(if (isEncryptionAllowed) 1.toByte() else 0.toByte()) - writeInt(orderNumber) - writeByte(if (decryptWhenForward) 1.toByte() else 0.toByte()) - } - } - override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false @@ -168,12 +120,5 @@ data class AttachmentInfo constructor( companion object { const val DEPTH_SEPARATOR = "/" const val INNER_ATTACHMENT_PREFIX = "inner_" - - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator = object : Parcelable.Creator { - override fun createFromParcel(source: Parcel): AttachmentInfo = AttachmentInfo(source) - override fun newArray(size: Int): Array = arrayOfNulls(size) - } } } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthCredentials.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthCredentials.kt index fd1996115a..1b5bb11eff 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthCredentials.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthCredentials.kt @@ -5,11 +5,10 @@ package com.flowcrypt.email.api.email.model -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.api.email.JavaEmailConstants import com.flowcrypt.email.database.entity.AccountEntity -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt +import kotlinx.parcelize.Parcelize /** * This class describes a details information about auth settings for some IMAP and SMTP servers. @@ -19,6 +18,7 @@ import com.flowcrypt.email.extensions.android.os.readParcelableViaExt * Time: 15:11. * E-mail: DenBond7@gmail.com */ +@Parcelize data class AuthCredentials constructor( val email: String, val username: String, @@ -37,47 +37,6 @@ data class AuthCredentials constructor( val displayName: String? = null, val authTokenInfo: AuthTokenInfo? = null ) : Parcelable { - constructor(source: Parcel) : this( - source.readString()!!, - source.readString()!!, - source.readString()!!, - source.readString()!!, - source.readInt(), - source.readParcelableViaExt(SecurityType.Option::class.java)!!, - source.readString()!!, - source.readInt(), - source.readParcelableViaExt(SecurityType.Option::class.java)!!, - source.readByte() != 0.toByte(), - source.readString(), - source.readString(), - source.readString(), - source.readByte() != 0.toByte(), - source.readString(), - source.readParcelableViaExt(AuthTokenInfo::class.java) - ) - - override fun describeContents() = 0 - - override fun writeToParcel(dest: Parcel, flags: Int) { - with(dest) { - writeString(email) - writeString(username) - writeString(password) - writeString(imapServer) - writeInt(imapPort) - writeParcelable(imapOpt, flags) - writeString(smtpServer) - writeInt(smtpPort) - writeParcelable(smtpOpt, flags) - writeInt((if (hasCustomSignInForSmtp) 1 else 0)) - writeString(smtpSigInUsername) - writeString(smtpSignInPassword) - writeString(faqUrl) - writeInt((if (useOAuth2) 1 else 0)) - writeString(displayName) - writeParcelable(authTokenInfo, flags) - } - } fun peekPassword(): String { return if (useOAuth2) authTokenInfo?.accessToken ?: password else password @@ -88,14 +47,6 @@ data class AuthCredentials constructor( } companion object { - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator = - object : Parcelable.Creator { - override fun createFromParcel(source: Parcel): AuthCredentials = AuthCredentials(source) - override fun newArray(size: Int): Array = arrayOfNulls(size) - } - fun from(accountEntity: AccountEntity): AuthCredentials { with(accountEntity) { var imapOpt: SecurityType.Option = SecurityType.Option.NONE diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthTokenInfo.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthTokenInfo.kt index 38d371aec5..f9fbf48b19 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthTokenInfo.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/AuthTokenInfo.kt @@ -5,8 +5,8 @@ package com.flowcrypt.email.api.email.model -import android.os.Parcel import android.os.Parcelable +import kotlinx.parcelize.Parcelize /** * @author Denis Bondarenko @@ -14,37 +14,10 @@ import android.os.Parcelable * Time: 4:57 PM * E-mail: DenBond7@gmail.com */ +@Parcelize data class AuthTokenInfo constructor( val email: String?, val accessToken: String? = null, val expiresAt: Long? = null, val refreshToken: String? = null -) : Parcelable { - constructor(parcel: Parcel) : this( - parcel.readString(), - parcel.readString(), - parcel.readValue(Long::class.java.classLoader) as? Long, - parcel.readString() - ) - - override fun writeToParcel(parcel: Parcel, flags: Int) { - parcel.writeString(email) - parcel.writeString(accessToken) - parcel.writeValue(expiresAt) - parcel.writeString(refreshToken) - } - - override fun describeContents(): Int { - return 0 - } - - companion object CREATOR : Parcelable.Creator { - override fun createFromParcel(parcel: Parcel): AuthTokenInfo { - return AuthTokenInfo(parcel) - } - - override fun newArray(size: Int): Array { - return arrayOfNulls(size) - } - } -} +) : Parcelable diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/ExtraActionInfo.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/ExtraActionInfo.kt index 0f3ceeee53..72a63511b5 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/ExtraActionInfo.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/ExtraActionInfo.kt @@ -8,13 +8,12 @@ package com.flowcrypt.email.api.email.model import android.content.Context import android.content.Intent import android.net.Uri -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.api.email.EmailUtil import com.flowcrypt.email.extensions.android.content.getParcelableArrayListExtraViaExt import com.flowcrypt.email.extensions.android.content.getParcelableExtraViaExt -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt import com.flowcrypt.email.util.RFC6068Parser +import kotlinx.parcelize.Parcelize /** * This class describes information about incoming extra info from the intent with one of next actions: @@ -30,34 +29,13 @@ import com.flowcrypt.email.util.RFC6068Parser * Time: 16:16 * E-mail: DenBond7@gmail.com */ +@Parcelize data class ExtraActionInfo( val atts: List = emptyList(), val initializationData: InitializationData ) : Parcelable { - constructor(parcel: Parcel) : this( - mutableListOf().apply { parcel.readTypedList(this, AttachmentInfo.CREATOR) }, - requireNotNull(parcel.readParcelableViaExt(InitializationData::class.java)) - ) - - override fun describeContents(): Int { - return 0 - } - - override fun writeToParcel(dest: Parcel, flags: Int) { - dest.writeTypedList(atts) - dest.writeParcelable(initializationData, flags) - } - companion object { - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator = - object : Parcelable.Creator { - override fun createFromParcel(source: Parcel): ExtraActionInfo = ExtraActionInfo(source) - override fun newArray(size: Int): Array = arrayOfNulls(size) - } - /** * Parse incoming information from the intent which can have the next actions: * diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/GeneralMessageDetails.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/GeneralMessageDetails.kt index b064554c6d..13ed793a01 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/GeneralMessageDetails.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/GeneralMessageDetails.kt @@ -5,12 +5,10 @@ package com.flowcrypt.email.api.email.model -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.database.MessageState -import com.flowcrypt.email.extensions.android.os.readListViaExt -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt import jakarta.mail.internet.InternetAddress +import kotlinx.parcelize.Parcelize /** * Simple POJO class which describe a general message details. @@ -20,7 +18,7 @@ import jakarta.mail.internet.InternetAddress * Time: 11:51 * E-mail: DenBond7@gmail.com */ - +@Parcelize data class GeneralMessageDetails constructor( val email: String, val label: String, @@ -69,70 +67,4 @@ data class GeneralMessageDetails constructor( return emails } - - constructor(source: Parcel) : this( - source.readString()!!, - source.readString()!!, - source.readInt(), - source.readInt(), - source.readLong(), - source.readLong(), - mutableListOf().apply { - source.readListViaExt(this, InternetAddress::class.java) - }, - mutableListOf().apply { - source.readListViaExt(this, InternetAddress::class.java) - }, - mutableListOf().apply { - source.readListViaExt(this, InternetAddress::class.java) - }, - mutableListOf().apply { - source.readListViaExt(this, InternetAddress::class.java) - }, - source.readString(), - source.createStringArrayList()!!, - 1 == source.readInt(), - 1 == source.readInt(), - 1 == source.readInt(), - source.readParcelableViaExt(MessageState::class.java)!!, - source.readString(), - source.readString() - ) - - override fun describeContents() = 0 - - override fun writeToParcel(dest: Parcel, flags: Int) { - with(dest) { - writeString(email) - writeString(label) - writeInt(uid) - writeInt(id) - writeLong(receivedDate) - writeLong(sentDate) - writeList(from) - writeList(replyTo) - writeList(to) - writeList(cc) - writeString(subject) - writeStringList(msgFlags) - writeInt((if (isRawMsgAvailable) 1 else 0)) - writeInt((if (hasAtts) 1 else 0)) - writeInt((if (isEncrypted) 1 else 0)) - writeParcelable(msgState, flags) - writeString(attsDir) - writeString(errorMsg) - } - } - - companion object { - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator = - object : Parcelable.Creator { - override fun createFromParcel(source: Parcel): GeneralMessageDetails = - GeneralMessageDetails(source) - - override fun newArray(size: Int): Array = arrayOfNulls(size) - } - } } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt index f8924163b7..aa2f80582d 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt @@ -6,19 +6,17 @@ package com.flowcrypt.email.api.email.model import android.content.Context -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.R import com.flowcrypt.email.api.email.EmailUtil import com.flowcrypt.email.api.email.FoldersManager -import com.flowcrypt.email.api.retrofit.response.model.GenericMsgBlock import com.flowcrypt.email.api.retrofit.response.model.MsgBlock import com.flowcrypt.email.api.retrofit.response.model.VerificationResult import com.flowcrypt.email.database.entity.MessageEntity -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt import com.flowcrypt.email.model.MessageEncryptionType import com.flowcrypt.email.model.MessageType import jakarta.mail.internet.InternetAddress +import kotlinx.parcelize.Parcelize import java.util.Date import java.util.regex.Pattern @@ -30,7 +28,7 @@ import java.util.regex.Pattern * Time: 11:20 * E-mail: DenBond7@gmail.com */ - +@Parcelize data class IncomingMessageInfo constructor( val msgEntity: MessageEntity, var atts: List? = null, @@ -220,40 +218,4 @@ data class IncomingMessageInfo constructor( return false } - - constructor(source: Parcel) : this( - source.readParcelableViaExt(MessageEntity::class.java)!!, - source.createTypedArrayList(AttachmentInfo.CREATOR), - source.readParcelableViaExt(LocalFolder::class.java), - source.readString(), - source.readString(), - mutableListOf().apply { source.readTypedList(this, GenericMsgBlock.CREATOR) }, - source.readParcelableViaExt(MessageEncryptionType::class.java)!!, - source.readParcelableViaExt(VerificationResult::class.java)!! - ) - - override fun describeContents() = 0 - - override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) { - writeParcelable(msgEntity, flags) - writeTypedList(atts) - writeParcelable(localFolder, flags) - writeString(text) - writeString(inlineSubject) - writeTypedList(msgBlocks) - writeParcelable(encryptionType, flags) - writeParcelable(verificationResult, flags) - } - - companion object { - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator = - object : Parcelable.Creator { - override fun createFromParcel(source: Parcel): IncomingMessageInfo = - IncomingMessageInfo(source) - - override fun newArray(size: Int): Array = arrayOfNulls(size) - } - } } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/InitializationData.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/InitializationData.kt index 3402311a9b..5e9a46706f 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/InitializationData.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/InitializationData.kt @@ -5,38 +5,14 @@ package com.flowcrypt.email.api.email.model -import android.os.Parcel import android.os.Parcelable +import kotlinx.parcelize.Parcelize +@Parcelize data class InitializationData( var subject: String? = null, var body: String? = null, val toAddresses: java.util.ArrayList = arrayListOf(), val ccAddresses: java.util.ArrayList = arrayListOf(), val bccAddresses: java.util.ArrayList = arrayListOf() -) : Parcelable { - constructor(parcel: Parcel) : this( - parcel.readString(), - parcel.readString(), - parcel.createStringArrayList() ?: arrayListOf(), - parcel.createStringArrayList() ?: arrayListOf(), - parcel.createStringArrayList() ?: arrayListOf() - ) - - override fun writeToParcel(parcel: Parcel, flags: Int) { - parcel.writeString(subject) - parcel.writeString(body) - parcel.writeStringList(toAddresses) - parcel.writeStringList(ccAddresses) - parcel.writeStringList(bccAddresses) - } - - override fun describeContents(): Int { - return 0 - } - - companion object CREATOR : Parcelable.Creator { - override fun createFromParcel(parcel: Parcel): InitializationData = InitializationData(parcel) - override fun newArray(size: Int): Array = arrayOfNulls(size) - } -} +) : Parcelable diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/LocalFolder.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/LocalFolder.kt index cd6710c75b..c98d5d032f 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/LocalFolder.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/LocalFolder.kt @@ -5,11 +5,12 @@ package com.flowcrypt.email.api.email.model -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.api.email.FoldersManager import com.flowcrypt.email.api.email.JavaEmailConstants import com.flowcrypt.email.database.entity.LabelEntity +import kotlinx.parcelize.IgnoredOnParcel +import kotlinx.parcelize.Parcelize /** * This is a simple POJO object, which describe information about the email folder. @@ -19,7 +20,7 @@ import com.flowcrypt.email.database.entity.LabelEntity * Time: 14:49 * E-mail: DenBond7@gmail.com */ - +@Parcelize data class LocalFolder constructor( val account: String, val fullName: String, @@ -29,17 +30,6 @@ data class LocalFolder constructor( var msgCount: Int = 0, var searchQuery: String? = null ) : Parcelable { - - constructor(source: Parcel) : this( - source.readString()!!, - source.readString()!!, - source.readString(), - source.createStringArrayList(), - source.readInt() == 1, - source.readInt(), - source.readString() - ) - constructor(source: LabelEntity) : this( source.email, source.name, @@ -50,35 +40,16 @@ data class LocalFolder constructor( null ) + @IgnoredOnParcel val isOutbox: Boolean = JavaEmailConstants.FOLDER_OUTBOX.equals(fullName, ignoreCase = true) + + @IgnoredOnParcel val isAll: Boolean = JavaEmailConstants.FOLDER_ALL_MAIL.equals(fullName, ignoreCase = true) + + @IgnoredOnParcel val isDrafts: Boolean = FoldersManager.FolderType.DRAFTS == getFolderType() fun getFolderType(): FoldersManager.FolderType? { return FoldersManager.getFolderType(this) } - - override fun describeContents(): Int { - return 0 - } - - override fun writeToParcel(dest: Parcel, flags: Int) = - with(dest) { - writeString(account) - writeString(fullName) - writeString(folderAlias) - writeStringList(attributes) - writeInt((if (isCustom) 1 else 0)) - writeInt(msgCount) - writeString(searchQuery) - } - - companion object { - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator = object : Parcelable.Creator { - override fun createFromParcel(source: Parcel): LocalFolder = LocalFolder(source) - override fun newArray(size: Int): Array = arrayOfNulls(size) - } - } } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/OutgoingMessageInfo.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/OutgoingMessageInfo.kt index 11121d80ba..2fe9038783 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/OutgoingMessageInfo.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/OutgoingMessageInfo.kt @@ -5,14 +5,13 @@ package com.flowcrypt.email.api.email.model -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.database.entity.MessageEntity -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt -import com.flowcrypt.email.extensions.android.os.readSerializableViaExt import com.flowcrypt.email.model.MessageEncryptionType import com.flowcrypt.email.model.MessageType import jakarta.mail.internet.InternetAddress +import kotlinx.parcelize.IgnoredOnParcel +import kotlinx.parcelize.Parcelize /** * Simple POJO class which describe an outgoing message model. @@ -22,6 +21,7 @@ import jakarta.mail.internet.InternetAddress * Time: 11:20 * E-mail: DenBond7@gmail.com */ +@Parcelize data class OutgoingMessageInfo constructor( val account: String? = null, val subject: String? = null, @@ -39,6 +39,7 @@ data class OutgoingMessageInfo constructor( val password: CharArray? = null ) : Parcelable { + @IgnoredOnParcel val isPasswordProtected = password?.isNotEmpty() /** @@ -54,47 +55,6 @@ data class OutgoingMessageInfo constructor( return allRecipients } - @Suppress("UNCHECKED_CAST") - constructor(parcel: Parcel) : this( - parcel.readString(), - parcel.readString(), - parcel.readString(), - parcel.readValue(InternetAddress::class.java.classLoader) as List?, - parcel.readValue(InternetAddress::class.java.classLoader) as List?, - parcel.readValue(InternetAddress::class.java.classLoader) as List?, - parcel.readSerializableViaExt(InternetAddress::class.java), - parcel.readValue(AttachmentInfo::class.java.classLoader) as List?, - parcel.readValue(AttachmentInfo::class.java.classLoader) as List?, - parcel.readParcelableViaExt(MessageEncryptionType::class.java)!!, - parcel.readInt(), - parcel.readParcelableViaExt(MessageEntity::class.java), - parcel.readLong(), - parcel.createCharArray() - ) - - override fun describeContents(): Int { - return 0 - } - - override fun writeToParcel(dest: Parcel, flags: Int) { - with(dest) { - writeString(account) - writeString(subject) - writeString(msg) - writeValue(toRecipients) - writeValue(ccRecipients) - writeValue(bccRecipients) - writeSerializable(from) - writeValue(atts) - writeValue(forwardedAtts) - writeParcelable(encryptionType, flags) - writeInt(messageType) - writeParcelable(replyToMsgEntity, flags) - writeLong(uid) - writeCharArray(password) - } - } - override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false @@ -141,9 +101,4 @@ data class OutgoingMessageInfo constructor( result = 31 * result + (isPasswordProtected?.hashCode() ?: 0) return result } - - companion object CREATOR : Parcelable.Creator { - override fun createFromParcel(parcel: Parcel) = OutgoingMessageInfo(parcel) - override fun newArray(size: Int): Array = arrayOfNulls(size) - } } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/SecurityType.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/SecurityType.kt index e6d3da1e76..2b2f9249e5 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/SecurityType.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/SecurityType.kt @@ -6,11 +6,10 @@ package com.flowcrypt.email.api.email.model import android.content.Context -import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.R import com.flowcrypt.email.api.email.JavaEmailConstants -import com.flowcrypt.email.extensions.android.os.readParcelableViaExt +import kotlinx.parcelize.Parcelize /** * This class describes settings for some security type. @@ -20,6 +19,7 @@ import com.flowcrypt.email.extensions.android.os.readParcelableViaExt * Time: 14:35 * E-mail: DenBond7@gmail.com */ +@Parcelize data class SecurityType constructor( val name: String = "", val opt: Option = Option.SSL_TLS, @@ -27,57 +27,16 @@ data class SecurityType constructor( val defSmtpPort: Int = 465 ) : Parcelable { - constructor(parcel: Parcel) : this( - parcel.readString()!!, - parcel.readParcelableViaExt(Option::class.java)!!, - parcel.readInt(), - parcel.readInt() - ) - override fun toString(): String { return name } - override fun describeContents(): Int { - return 0 - } - - override fun writeToParcel(dest: Parcel, flags: Int) { - dest.writeString(this.name) - dest.writeParcelable(opt, flags) - dest.writeInt(this.defImapPort) - dest.writeInt(this.defSmtpPort) - } - + @Parcelize enum class Option : Parcelable { NONE, SSL_TLS, STARTLS; - - companion object { - @JvmField - @Suppress("unused") - val CREATOR: Parcelable.Creator