diff --git a/CHANGELOG b/CHANGELOG index c683fbc6..131bcb64 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,214 +1,11 @@ -* a4e81e76 - (HEAD -> release/3.8.0, tag: develop-231, origin/develop, develop) Merge pull request #264 from tangem/AND-3503_merge_master_into_dev +* 92c42ed9 - (HEAD -> release/3.8.1, tag: develop-233, origin/develop, develop) Merge pull request #269 from tangem/AND-3503_merge_master_into_develop |\ -| * 1ff19c0b - Merge branch 'master' of https://github.com/tangem/tangem-sdk-android into AND-3503_merge_master_into_dev -|/ -* 6d4aedef - (tag: develop-229) Merge pull request #261 from tangem/task/AND-3394_attestation_jsonrpc -|\ -| * 3ab60ff2 - AND-3394: add AttestKey method to TangemSDK, support JSON-RPC for it -|/ -* 6563d9a5 - (tag: develop-228) Merge pull request #260 from tangem/task/AND-3375_fix_json_rpc_tests -|\ -| * 87fc60df - Merge branch 'develop' into task/AND-3375_fix_json_rpc_tests -| |\ -| |/ -|/| -* | ba83391c - (tag: develop-227) Merge pull request #259 from tangem/task/AND-3436_refactor_import_wallet_facade -|\ \ -| | * 13bcd688 - AND-3375: fix JSON-RPC tests -| |/ -| * 968fca9a - AND-3436: Refactor import wallet, update v6 minor, add JSONRPC test -|/ -* f4fa28fa - (tag: develop-226) Merge pull request #258 from tangem/task/AND-3461_fix_card_to_json -|\ -| * f94eccbf - Merge branch 'develop' into task/AND-3461_fix_card_to_json -| |\ -| |/ -|/| -* | 9cc31030 - (tag: develop-225) Merge pull request #257 from tangem/task/AND-3396_add_backup_pre-check -|\ \ -| * \ 74a0c273 - Merge branch 'develop' into task/AND-3396_add_backup_pre-check -| |\ \ -| |/ / -|/| | -| * | f23bafcd - Merge branch 'develop' into task/AND-3396_add_backup_pre-check -| |\ \ -| * | | 0e08bc52 - AND-3396: add pre-check for already backed-up card -| | | * 100f62ac - Merge branch 'develop' into task/AND-3461_fix_card_to_json -| | | |\ -| |_|_|/ -|/| | | -* | | | 11fb6aa6 - (tag: develop-224) Merge pull request #241 from tangem/bugfix/AND-3233_fix_key_invalidated_exception -|\ \ \ \ -| |_|/ / -|/| | | -| * | | 358ca170 - AND-3233 Divide invalid cryptography key exceptions handling -|/ / / -| | * dffd6005 - AND-3461: fix Card's fields conversion for JSON_RPC -| |/ -|/| -* | 1db7cb22 - (tag: develop-223) Merge pull request #256 from tangem/bugfix/AND-3362_fix_encryption -|\ \ -| * \ f5e23432 - Merge branch 'develop' into bugfix/AND-3362_fix_encryption -| |\ \ -| |/ / -|/| | -* | | 79e8a233 - (tag: develop-222) Merge pull request #255 from tangem/revert-254-revert-253-task/AND-3406_add_new_backup_prechecks -|\ \ \ -| * | | a794cd07 - Revert "Revert "AND-3406: add new backup pre-checks"" -|/ / / -| * | 3c6659ff - Merge branch 'develop' into bugfix/AND-3362_fix_encryption -| |\ \ -| |/ / -|/| | -* | | a57073b3 - (tag: develop-221) Merge pull request #252 from tangem/AND-3437-fix-sending-change-callback-usercancelled -|\ \ \ -| * | | 576dd729 - AND-3437 changed call dismiss dialog for correct handle UserCancelled -|/ / / -* | | 81c97324 - (tag: develop-220) Merge pull request #254 from tangem/revert-253-task/AND-3406_add_new_backup_prechecks -|\ \ \ -| * | | ed9670a7 - Revert "AND-3406: add new backup pre-checks" -|/ / / -* | | 565b73ee - (tag: develop-219) Merge pull request #253 from tangem/task/AND-3406_add_new_backup_prechecks -|\ \ \ -| * \ \ 174339db - Merge branch 'develop' into task/AND-3406_add_new_backup_prechecks -| |\ \ \ -| |/ / / -|/| | / -| | |/ -| |/| -* | | cb57997a - (tag: develop-218) Merge pull request #250 from tangem/bugfix/AND-3388_fix_access_code_requesting -|\ \ \ -| * \ \ 3849131f - Merge branch 'develop' into bugfix/AND-3388_fix_access_code_requesting -| |\ \ \ -| |/ / / -|/| | | -* | | | 501ee120 - (tag: develop-217) Merge pull request #251 from tangem/task/AND-3429_max_firmware_for_card_filter -|\ \ \ \ -| * | | | 2a652f22 - AND-3429: add check for max firmware version in CardFilter -|/ / / / -| * / / bf61959c - AND-3388 Fix user codes saving -|/ / / -| * / f646f44e - AND-3406: add new backup pre-checks -|/ / -| * 919d9b7c - AND-3362: fix handling encrypted cards -|/ -* f695feba - (tag: develop-216) Merge pull request #249 from tangem/task/AND-3309_usersetting_code_recovery -|\ -| * 5dedf113 - AND-3309: Add user settings support -|/ -* b60d2c70 - (tag: develop-215) Merge pull request #248 from tangem/task/AND-3308_check_wallet_status -|\ -| * 081ad111 - Merge branch 'develop' into task/AND-3308_check_wallet_status -| |\ -| |/ -|/| -* | ebb2920e - (tag: develop-214) Merge pull request #247 from tangem/task/AND-3310_get_entropy_command -|\ \ -| * | a1237e0a - AND-3310: support GetEntropy Command -|/ / -| * 57d49b56 - AND-3308: check wallet status in attestation command -|/ -* a20fecf2 - (tag: develop-213) Merge pull request #246 from tangem/bugfix/AND-3379_fix_crash_on_session_dialog_launch -|\ -| * 7c83bdb2 - Merge branch 'develop' into bugfix/AND-3379_fix_crash_on_session_dialog_launch +| * d69f9360 - Merge branch 'develop' into AND-3503_merge_master_into_develop | |\ | |/ |/| -* | 6f0e24f2 - (tag: develop-212) Merge pull request #245 from tangem/task/AND-3307_create_wallet_from_seed -|\ \ -| * | 0396f9f7 - AND-3307: support ImportWallet - creating wallet from seed -|/ / -| * 93626eba - AND-3379 Fix crash when launching session dialog -|/ -* 171b1381 - (tag: develop-211) Merge pull request #244 from tangem/task/AND-3324_add_tests_for_extended_master_key -|\ -| * 0b5ed26c - AND-3324: add tests for extended keys and master key from seed -|/ -* f0564610 - (tag: develop-210) Merge pull request #243 from tangem/task/AND-3323_key_from_seed -|\ -| * 61b84b81 - AND-3323: implement ExtendedPrivateKey and its creation from seed -|/ -* 7fe39c45 - (tag: develop-209) Merge pull request #242 from tangem/bugfix/AND-3345_fix_strings_finding -|\ -| * 07e1902f - AND-3245 Fix mapping of core string IDs to Android string resources -|/ -* 261f6227 - (tag: develop-208) Merge pull request #240 from tangem/AND-3300_Add_trailing_comma_rule_in_detekt -|\ -| * d97d989f - AND-3300 Add trailing comma rule in detekt -|/ -* c9765a56 - (tag: develop-207) Merge pull request #239 from tangem/AND-3204-tests-and-parse-words -|\ -| * d781fc1a - AND-3204 added tests for bip39 -|/ -* 0675b9ad - (tag: develop-206) Merge pull request #238 from tangem/bugfix/AND-3290_fix_crash_when_unable_to_find_resource -|\ -| * ff8f7dfb - AND-3290 Fix app crash when unable to find string resource -|/ -* 3a087d96 - Merge pull request #235 from tangem/AND-3202-mnemonic-bip39-impl -|\ -| * 8184154f - AND-3202 added mnemonic and bip39 implementation -|/ -* b9988345 - (tag: develop-205) Merge pull request #232 from tangem/AND-3237-created_contact_bip39 -|\ -| * 05e64ba5 - AND-3237 contract mnemonic and bip39 -|/ -* eebaa8b8 - (tag: develop-204) Merge pull request #231 from tangem/AND-3196_Add_detekt_to_CI_test_lane_config_in_Card_SDK -|\ -| * f1720390 - AND-3196 Add detekt to CI test lane config in Card SDK -|/ -* 9fca7515 - (tag: develop-203) Merge pull request #229 from tangem/AND-3139-Fix_detekt_warnings_in_CardSDK -|\ -| * e7ffbfc8 - AND-3139 Fix detekt warnings in CardSDK -|/ -* 1a6d1f28 - (tag: develop-202) Merge pull request #230 from tangem/bugfix/AND-3197 -|\ -| * ff913bd1 - AND-3197 Fix a Card SDK's issue with artifact loading -|/ -* 5eb353a2 - (tag: develop-201) Merge pull request #228 from tangem/AND-3138-Add_detekt_to_CardSDK -|\ -| * aa56f69d - AND-3138 Add detekt to CardSDK -|/ -* 09b14209 - (tag: develop-200) Merge pull request #227 from tangem/bugfix/AND-3150_fix_key_invalidation -|\ -| * 8022dbcf - AND-3150 Fix biometrics manager behavior after master key invalidation -|/ -* 60431171 - (tag: develop-199) Merge pull request #226 from tangem/bugfix/AND-3137_fix_access_code_saving -|\ -| * 9d252fda - AND-3137 Fix the card session re-closing -|/ -* 52db5e6d - (tag: develop-198) Merge pull request #223 from tangem/AND-3096-set-code-style -|\ -| * aa8725c2 - AND-3096 set code style (without reformatting) -|/ -* 3ba7a7cf - (tag: develop-197) Merge pull request #224 from tangem/AND-3105-restore_showing_error_code_with_error_message -|\ -| * 8960ff00 - AND-3105 restored showing error codes for error with generic translation -|/ -* 218f05a8 - (tag: develop-196) Merge pull request #221 from tangem/AND-3082-add_an_ability_to_send_a_raw_apdu -|\ -| * 81afd979 - AND-3083 selects the wallet applet by default -| * 3c6259a5 - AND-3082 added an ability to send a raw apdu -|/ -* 64716af8 - (tag: develop-195) Merge pull request #219 from tangem/demo/AND-3081-add_ResetToFactory_method -|\ -| * a402a182 - AND-3081 demo: added ResetToFactory method -|/ -* 665c4f62 - (tag: develop-194) Merge pull request #222 from tangem/AND-2896-Add_description_for_part_of_signed_hashes_v2 -|\ -| * f6d9f29f - AND-2896 fixed by PR comments -| * 97e971ad - AND-2896 added the message of a signed part -|/ -* 63dc24b8 - (tag: develop-191) Merge pull request #212 from tangem/bugfix/AND-2907_add_biometric_failure_cause -|\ -| * 5bd3243f - AND-2907 Add the new error types for the biometry -|/ -* aca25141 - (tag: develop-190) Merge pull request #216 from tangem/AND-2974-fix-pin-code-dialog-callback -|\ -| * f6d98c9a - AND-2974 fixed callback on pin dialog dismiss -|/ -* 2da1ef20 - (tag: develop-186) Merge pull request #215 from tangem/bugfix/AND-2911_fix_crash_on_access_code_request -|\ -| * 6f614ed5 - AND-2911 Fix the crash when requesting access code -|/ -* beb838ac - (tag: develop-185) Merge pull request #214 from tangem/bugfix/AND-2915_fix_biometric_manager_initialization -* f1fd0058 - AND-2915 Fix the biometric manager initialization \ No newline at end of file +* | d40d60ba - (tag: develop-232) Merge pull request #267 from tangem/task/AND-3529_derived_keys_json_mapping +* | 3cbb5f06 - Merge branch 'develop' into task/AND-3529_derived_keys_json_mapping +* | e81dbf08 - AND-3529: change mapping of derivedKeys to/from JSON + / +* b01050ff - AND-3529: change mapping of derivedKeys to/from JSON \ No newline at end of file diff --git a/VERSION b/VERSION index 19811903..f2807196 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.8.0 +3.8.1 diff --git a/tangem-sdk-android-demo/src/main/java/com/tangem/demo/Utils.kt b/tangem-sdk-android-demo/src/main/java/com/tangem/demo/Utils.kt index 4432756f..16dd72ee 100644 --- a/tangem-sdk-android-demo/src/main/java/com/tangem/demo/Utils.kt +++ b/tangem-sdk-android-demo/src/main/java/com/tangem/demo/Utils.kt @@ -76,7 +76,7 @@ object Backup { "releaseVersion": true, "issuerName": "TANGEM AG", "series": "AC", - "startNumber": 7900000000000, + "startNumber": 7900000000001, "count": 2500, "numberFormat": "", "PIN": "000000", @@ -125,107 +125,109 @@ object Backup { """ private const val configJsonBackup1 = """ - { - "releaseVersion": true, - "issuerName": "TANGEM AG", - "series": "AC", - "startNumber": 7900000000001, - "count": 2500, - "numberFormat": "", - "PIN": "000000", - "PIN2": "000", - "CVC": "000", - "walletsCount": 6, - "pauseBeforePIN2": 5000, - "smartSecurityDelay": true, - "curveID": "secp256k1", - "SigningMethod": 0, - "isReusable": false, - "allowSwapPIN": false, - "allowSwapPIN2": true, - "useActivation": false, - "useCVC": false, - "useNDEF": true, - "useBlock": false, - "allowSelectBlockchain": true, - "forbidPurgeWallet": false, - "protocolAllowUnencrypted": true, - "protocolAllowStaticEncryption": true, - "forbidDefaultPIN": false, - "skipSecurityDelayIfValidatedByIssuer": false, - "skipCheckPIN2andCVCIfValidatedByIssuer": false, - "skipSecurityDelayIfValidatedByLinkedTerminal": true, - "disableIssuerData": true, - "disableUserData": false, - "disableFiles": false, - "allowHDWallets": true, - "allowBackup": true, - "allowKeysImport": true, - "NDEF": [], - "cardData": { - "date": "2021-03-15", - "batch": "AC01", - "blockchain": "ANY", - "product_note": true, - "product_tag": false, - "product_id_card": false, - "product_id_issuer": false, - "product_twin": false - }, - "createWallet": 0 + { + "releaseVersion": true, + "issuerName": "TANGEM AG", + "series": "AC", + "startNumber": 7900000000002, + "count": 2500, + "numberFormat": "", + "PIN": "000000", + "PIN2": "000", + "CVC": "000", + "walletsCount": 20, + "pauseBeforePIN2": 5000, + "smartSecurityDelay": true, + "curveID": "secp256k1", + "SigningMethod": 0, + "isReusable": false, + "allowSwapPIN": false, + "allowSwapPIN2": true, + "useActivation": false, + "useCVC": false, + "useNDEF": true, + "useBlock": false, + "allowSelectBlockchain": true, + "forbidPurgeWallet": false, + "protocolAllowUnencrypted": true, + "protocolAllowStaticEncryption": true, + "forbidDefaultPIN": false, + "skipSecurityDelayIfValidatedByIssuer": false, + "skipCheckPIN2andCVCIfValidatedByIssuer": false, + "skipSecurityDelayIfValidatedByLinkedTerminal": true, + "disableIssuerData": true, + "disableUserData": false, + "disableFiles": false, + "allowHDWallets": true, + "allowBackup": true, + "allowKeysImport": true, + "NDEF": [], + "cardData": { + "date": "2021-03-15", + "batch": "AC01", + "blockchain": "ANY", + "product_note": true, + "product_tag": false, + "product_id_card": false, + "product_id_issuer": false, + "product_authentication": false, + "product_twin": false + }, + "createWallet": 0 } """ private const val configJsonBackup2 = """ - { - "releaseVersion": true, - "issuerName": "TANGEM AG", - "series": "AC", - "startNumber": 7900000000003, - "count": 2500, - "numberFormat": "", - "PIN": "000000", - "PIN2": "000", - "CVC": "000", - "walletsCount": 6, - "pauseBeforePIN2": 5000, - "smartSecurityDelay": true, - "curveID": "secp256k1", - "SigningMethod": 0, - "isReusable": false, - "allowSwapPIN": false, - "allowSwapPIN2": true, - "useActivation": false, - "useCVC": false, - "useNDEF": true, - "useBlock": false, - "allowSelectBlockchain": true, - "forbidPurgeWallet": false, - "protocolAllowUnencrypted": true, - "protocolAllowStaticEncryption": true, - "forbidDefaultPIN": false, - "skipSecurityDelayIfValidatedByIssuer": false, - "skipCheckPIN2andCVCIfValidatedByIssuer": false, - "skipSecurityDelayIfValidatedByLinkedTerminal": true, - "disableIssuerData": true, - "disableUserData": false, - "disableFiles": false, - "allowHDWallets": true, - "allowBackup": true, + { + "releaseVersion": true, + "issuerName": "TANGEM AG", + "series": "AC", + "startNumber": 7900000000003, + "count": 2500, + "numberFormat": "", + "PIN": "000000", + "PIN2": "000", + "CVC": "000", + "walletsCount": 20, + "pauseBeforePIN2": 5000, + "smartSecurityDelay": true, + "curveID": "secp256k1", + "SigningMethod": 0, + "isReusable": false, + "allowSwapPIN": false, + "allowSwapPIN2": true, + "useActivation": false, + "useCVC": false, + "useNDEF": true, + "useBlock": false, + "allowSelectBlockchain": true, + "forbidPurgeWallet": false, + "protocolAllowUnencrypted": true, + "protocolAllowStaticEncryption": true, + "forbidDefaultPIN": false, + "skipSecurityDelayIfValidatedByIssuer": false, + "skipCheckPIN2andCVCIfValidatedByIssuer": false, + "skipSecurityDelayIfValidatedByLinkedTerminal": true, + "disableIssuerData": true, + "disableUserData": false, + "disableFiles": false, + "allowHDWallets": true, + "allowBackup": true, "allowKeysImport": true, - "NDEF": [], - "cardData": { - "date": "2021-03-15", - "batch": "AC01", - "blockchain": "ANY", - "product_note": true, - "product_tag": false, - "product_id_card": false, - "product_id_issuer": false, - "product_twin": false - }, - "createWallet": 0 + "NDEF": [], + "cardData": { + "date": "2021-03-15", + "batch": "AC01", + "blockchain": "ANY", + "product_note": true, + "product_tag": false, + "product_id_card": false, + "product_id_issuer": false, + "product_authentication": false, + "product_twin": false + }, + "createWallet": 0 } """ diff --git a/tangem-sdk-core/src/main/java/com/tangem/common/card/CardWallet.kt b/tangem-sdk-core/src/main/java/com/tangem/common/card/CardWallet.kt index 2c04c702..61039781 100644 --- a/tangem-sdk-core/src/main/java/com/tangem/common/card/CardWallet.kt +++ b/tangem-sdk-core/src/main/java/com/tangem/common/card/CardWallet.kt @@ -1,11 +1,13 @@ package com.tangem.common.card +import com.squareup.moshi.JsonClass import com.tangem.common.BaseMask import com.tangem.common.Mask import com.tangem.common.card.CardWallet.Status.Companion.initExtendedPublicKey import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.crypto.hdWallet.bip32.ExtendedPublicKey +@JsonClass(generateAdapter = true) data class CardWallet( /** * Wallet's public key. diff --git a/tangem-sdk-core/src/main/java/com/tangem/common/json/MoshiJsonConverter.kt b/tangem-sdk-core/src/main/java/com/tangem/common/json/MoshiJsonConverter.kt index 5125ad92..4b89ce8d 100644 --- a/tangem-sdk-core/src/main/java/com/tangem/common/json/MoshiJsonConverter.kt +++ b/tangem-sdk-core/src/main/java/com/tangem/common/json/MoshiJsonConverter.kt @@ -21,7 +21,6 @@ import com.tangem.common.extensions.toHexString import com.tangem.crypto.hdWallet.DerivationNode import com.tangem.crypto.hdWallet.DerivationPath import com.tangem.crypto.hdWallet.BIP44 -import com.tangem.crypto.hdWallet.bip32.ExtendedPublicKey import com.tangem.operations.PreflightReadMode import com.tangem.operations.attestation.Attestation import com.tangem.operations.attestation.AttestationTask @@ -125,7 +124,6 @@ class MoshiJsonConverter(adapters: List = listOf(), typedAdapters: Map { - val result = mutableMapOf() - - reader.beginArray() - while (reader.hasNext()) { - val path = DerivationPath(reader.nextString()) - val key = reader.readJsonValue() as? ExtendedPublicKey - if (key != null) { - result[path] = key - } - } - reader.endArray() - - return result - } - - @ToJson - fun toJson(writer: JsonWriter, derivedKeys: Map) { - writer.beginArray() - for ((path, key) in derivedKeys) { - writer.value(path.toString()) - writer.value(key.toString()) - } - writer.endArray() - } - } - class CardWalletStatusAdapter { @ToJson fun toJson(src: CardWallet.Status): String = EnumConverter.toJson(src) diff --git a/tangem-sdk-core/src/test/resources/jsonRpc/Card.json b/tangem-sdk-core/src/test/resources/jsonRpc/Card.json index bd0e77c3..666479e8 100644 --- a/tangem-sdk-core/src/test/resources/jsonRpc/Card.json +++ b/tangem-sdk-core/src/test/resources/jsonRpc/Card.json @@ -65,7 +65,7 @@ "index": 0, "hasBackup": false, "isImported": false, - "derivedKeys": [] + "derivedKeys": {} }, { "publicKey": "0440C533E007D029C1F345CA70A9F6016EC7A95C775B6320AE84248F20B647FBBD90FF56A2D9C3A1984279ED2367274A49079789E130444541C2F15907D5570B49", @@ -77,7 +77,7 @@ "index": 1, "hasBackup": false, "isImported": false, - "derivedKeys": [] + "derivedKeys": {} }, { "publicKey": "04DDFACEF55A95EAB2CDCC8E86CE779342D2E2A53CF8F0F20BF2B248336AE3EEA6DD62D1F4C5420A71D6212073B136034CDC878DAD3AE3FDFA3360E6FE6184F470", @@ -89,7 +89,7 @@ "index": 2, "hasBackup": false, "isImported": false, - "derivedKeys": [] + "derivedKeys": {} } ], "isPasscodeSet": true, diff --git a/tangem-sdk-core/src/test/resources/jsonRpc/CreateWallet.json b/tangem-sdk-core/src/test/resources/jsonRpc/CreateWallet.json index 6116c323..b53d3452 100644 --- a/tangem-sdk-core/src/test/resources/jsonRpc/CreateWallet.json +++ b/tangem-sdk-core/src/test/resources/jsonRpc/CreateWallet.json @@ -22,7 +22,7 @@ "index": 1, "hasBackup" : false, "isImported": false, - "derivedKeys" : [] + "derivedKeys" : {} } }, "id": 1 diff --git a/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletMnemonic.json b/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletMnemonic.json index 14775d70..deccbfe6 100644 --- a/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletMnemonic.json +++ b/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletMnemonic.json @@ -25,7 +25,7 @@ "index": 1, "hasBackup" : false, "isImported": false, - "derivedKeys" : [] + "derivedKeys" : {} } }, "id" : 1 diff --git a/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletSeed.json b/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletSeed.json index beb91e22..3172de59 100644 --- a/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletSeed.json +++ b/tangem-sdk-core/src/test/resources/jsonRpc/ImportWalletSeed.json @@ -23,7 +23,7 @@ "index": 1, "hasBackup": false, "isImported": false, - "derivedKeys": [] + "derivedKeys": {} } }, "id": 1