From 7763841e260d494b6e9201259d0dfa441b2d9caf Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 18 Dec 2023 02:57:58 +0300 Subject: [PATCH 01/19] IOS-5453: Update ruby deps and fix their versions --- Example/Gemfile | 3 + Example/Gemfile.lock | 107 ++++++++++++++++ Example/Podfile.lock | 2 +- Gemfile | 4 +- Gemfile.lock | 289 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 402 insertions(+), 3 deletions(-) create mode 100644 Example/Gemfile create mode 100644 Example/Gemfile.lock create mode 100644 Gemfile.lock diff --git a/Example/Gemfile b/Example/Gemfile new file mode 100644 index 000000000..207036529 --- /dev/null +++ b/Example/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "cocoapods", "~> 1.14.0" diff --git a/Example/Gemfile.lock b/Example/Gemfile.lock new file mode 100644 index 000000000..66a4411ab --- /dev/null +++ b/Example/Gemfile.lock @@ -0,0 +1,107 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.6) + rexml + activesupport (7.1.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + base64 (0.2.0) + bigdecimal (3.1.5) + claide (1.1.0) + cocoapods (1.14.3) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.14.3) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.14.3) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + drb (2.2.0) + ruby2_keywords + escape (0.0.4) + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.16.3) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + minitest (5.20.0) + molinillo (0.8.0) + mutex_m (0.2.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + public_suffix (4.0.7) + rexml (3.2.6) + ruby-macho (2.5.1) + ruby2_keywords (0.0.5) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + xcodeproj (1.23.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + cocoapods (~> 1.14.0) + +BUNDLED WITH + 2.4.22 diff --git a/Example/Podfile.lock b/Example/Podfile.lock index cf8a783bd..093e4e76e 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: fb4745483d8583db4c8ae8aa3ccbde86ca112a6b -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/Gemfile b/Gemfile index bb94aef51..410fe74e9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" -gem "fastlane" -gem "cocoapods" \ No newline at end of file +gem "fastlane", "~> 2.217.0" +gem "cocoapods", "~> 1.14.0" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..32ccd4039 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,289 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.6) + rexml + activesupport (7.1.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + artifactory (3.0.15) + atomos (0.1.3) + aws-eventstream (1.3.0) + aws-partitions (1.868.0) + aws-sdk-core (3.190.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.8) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.75.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.141.0) + aws-sdk-core (~> 3, >= 3.189.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.2.0) + bigdecimal (3.1.5) + claide (1.1.0) + cocoapods (1.14.3) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.14.3) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.14.3) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + declarative (0.0.20) + digest-crc (0.6.5) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20231109) + dotenv (2.8.1) + drb (2.2.0) + ruby2_keywords + emoji_regex (3.2.3) + escape (0.0.4) + ethon (0.16.0) + ffi (>= 1.15.0) + excon (0.108.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.2.7) + fastlane (2.217.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (~> 3) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + ffi (1.16.3) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.2) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.29.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (2.1.0) + faraday (>= 1.0, < 3.a) + google-cloud-errors (1.3.1) + google-cloud-storage (1.45.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.29.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.9.1) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.1) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) + domain_name (~> 0.5) + httpclient (2.8.3) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + jmespath (1.6.2) + json (2.7.1) + jwt (2.7.1) + mini_magick (4.12.0) + mini_mime (1.1.5) + minitest (5.20.0) + molinillo (0.8.0) + multi_json (1.15.0) + multipart-post (2.3.0) + mutex_m (0.2.0) + nanaimo (0.3.0) + nap (1.1.0) + naturally (2.2.1) + netrc (0.11.0) + optparse (0.1.1) + os (1.1.4) + plist (3.7.0) + public_suffix (4.0.7) + rake (13.1.0) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.6) + rouge (2.0.7) + ruby-macho (2.5.1) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + security (0.1.3) + signet (0.18.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.10) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uber (0.1.0) + unicode-display_width (2.5.0) + webrick (1.8.1) + word_wrap (1.0.0) + xcodeproj (1.23.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + cocoapods (~> 1.14.0) + fastlane (~> 2.217.0) + +BUNDLED WITH + 2.4.22 From 0f57689de8a253952fd40cc5f2ebd7db5488a3d9 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 18 Dec 2023 03:30:42 +0300 Subject: [PATCH 02/19] IOS-5453: Update project using Xcode 15.1.0 --- Example/TangemSdkExample.xcodeproj/project.pbxproj | 7 +++++-- .../xcschemes/TangemSdkExample.xcscheme | 2 +- .../xcschemes/TangemSdkExampleDev.xcscheme | 2 +- TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 13 ++++++++++++- .../xcshareddata/xcschemes/TangemSdk.xcscheme | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Example/TangemSdkExample.xcodeproj/project.pbxproj b/Example/TangemSdkExample.xcodeproj/project.pbxproj index ea9163f59..d1a95f3d3 100644 --- a/Example/TangemSdkExample.xcodeproj/project.pbxproj +++ b/Example/TangemSdkExample.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -281,8 +281,9 @@ 5D78C1AE234F435B008D7478 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1120; - LastUpgradeCheck = 1250; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "Tangem AG"; TargetAttributes = { 5D78C1B5234F435B008D7478 = { @@ -492,6 +493,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -553,6 +555,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme b/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme index f017a6d27..dd81dc8bf 100644 --- a/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme +++ b/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme @@ -1,6 +1,6 @@ Date: Mon, 18 Dec 2023 03:31:19 +0300 Subject: [PATCH 03/19] IOS-5453: Bring back iOS 11.0 as a minimum deployment target --- TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index 00b65ec2f..d81b65b9b 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -2290,7 +2290,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MODULEMAP_FILE = "$(SRCROOT)/TangemSdk/module.modulemap"; MODULEMAP_PRIVATE_FILE = ""; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -2364,7 +2364,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MODULEMAP_FILE = "$(SRCROOT)/TangemSdk/module.modulemap"; MODULEMAP_PRIVATE_FILE = ""; MTL_ENABLE_DEBUG_INFO = NO; @@ -2405,7 +2405,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2454,7 +2454,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", From 818ed79f7dd708059d4da275ca8eb99013ef9ba5 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 18 Dec 2023 03:33:16 +0300 Subject: [PATCH 04/19] IOS-5453: Clean-up podspec file a bit --- TangemSdk.podspec | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/TangemSdk.podspec b/TangemSdk.podspec index 7809c5aa8..3eb140cc0 100644 --- a/TangemSdk.podspec +++ b/TangemSdk.podspec @@ -7,48 +7,48 @@ # Pod::Spec.new do |s| - s.name = 'TangemSdk' - s.version = '3.8.0' - s.summary = 'Use TangemSdk for Tangem cards integration' - -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! - - s.description = <<-DESC + s.name = 'TangemSdk' + s.version = '3.8.0' + s.summary = 'Use TangemSdk for Tangem cards integration' + s.description = <<-DESC Tangem is a Swiss-based secure hardware wallet manufacturer that enables blockchain-based assets to be kept in custody within smart physical banknotes and accessed via NFC technology. Tangem’s mission is to make digital assets accessible, affordable and convenient for consumers. - DESC + DESC - s.homepage = 'https://github.com/Tangem/tangem-sdk-ios' - s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { 'Tangem' => 'hello@tangem.com' } - s.source = { :git => 'https://github.com/Tangem/tangem-sdk-ios.git', :tag => s.version.to_s } + s.homepage = 'https://github.com/Tangem/tangem-sdk-ios' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'Tangem' => 'hello@tangem.com' } + s.source = { :git => 'https://github.com/Tangem/tangem-sdk-ios.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/Tangem' s.platform = :ios s.ios.deployment_target = '11.0' s.swift_version = '5.0' s.source_files = 'TangemSdk/TangemSdk/**/*.{swift}', - 'TangemSdk/TangemSdk/TangemSdk.h', - 'TangemSdk/TangemSdk/Crypto/secp256k1/*/*.{h,c}' - + 'TangemSdk/TangemSdk/TangemSdk.h', + 'TangemSdk/TangemSdk/Crypto/secp256k1/*/*.{h,c}' s.preserve_paths = 'TangemSdk/TangemSdk/module.modulemap', - 'TangemSdk/TangemSdk/Crypto/*' + 'TangemSdk/TangemSdk/Crypto/*' s.public_header_files = 'TangemSdk/TangemSdk/TangemSdk.h' + s.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(PODS_TARGET_SRCROOT)/TangemSdk/**', 'OTHER_CFLAGS' => '-pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-shorten-64-to-32 -Wno-conditional-uninitialized -Wno-unused-function -Wno-long-long -Wno-overlength-strings -O3 -Wundef -Wreserved-identifier -fvisibility=hidden', } - s.weak_frameworks = 'CoreNFC', 'CryptoKit', 'Combine', 'SwiftUI' - - s.resource_bundles = { 'TangemSdk' => ['TangemSdk/TangemSdk/**/*.lproj/*.strings', - 'TangemSdk/TangemSdk/Haptics/*.ahap', - 'TangemSdk/TangemSdk/**/Wordlists/*.txt']} + s.weak_frameworks = 'CoreNFC', + 'CryptoKit', + 'Combine', + 'SwiftUI' + + s.resource_bundles = { + 'TangemSdk' => [ + 'TangemSdk/TangemSdk/**/*.lproj/*.strings', + 'TangemSdk/TangemSdk/Haptics/*.ahap', + 'TangemSdk/TangemSdk/**/Wordlists/*.txt', + ] + } s.vendored_frameworks = 'TangemSdk/TangemSdk/Frameworks/Bls_Signature.xcframework' end From bdf9e6b523b970d41ea6974d030b5b579448c167 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 18 Dec 2023 03:33:47 +0300 Subject: [PATCH 05/19] IOS-5453: Add refs to gemfiles and podfiles --- Example/TangemSdkExample.xcodeproj/project.pbxproj | 8 ++++++++ TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/Example/TangemSdkExample.xcodeproj/project.pbxproj b/Example/TangemSdkExample.xcodeproj/project.pbxproj index d1a95f3d3..26d5022d5 100644 --- a/Example/TangemSdkExample.xcodeproj/project.pbxproj +++ b/Example/TangemSdkExample.xcodeproj/project.pbxproj @@ -41,6 +41,8 @@ 5DDCEC7A25C958220002090D /* UI+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DDCEC7425C957930002090D /* UI+.swift */; }; B00A67B3253D8CAC002D7D53 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = B00A67B2253D8CAC002D7D53 /* Utils.swift */; }; B00A67B6253D8DA2002D7D53 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = B00A67B2253D8CAC002D7D53 /* Utils.swift */; }; + B6B9589C2B2FCA9900E7B74E /* Gemfile in Resources */ = {isa = PBXBuildFile; fileRef = B6B9589A2B2FCA9900E7B74E /* Gemfile */; }; + B6B9589D2B2FCA9900E7B74E /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = B6B9589B2B2FCA9900E7B74E /* Podfile */; }; DC23ED9F2912DD0D0023E626 /* ResetToFactorySettingsTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC23ED9E2912DD0D0023E626 /* ResetToFactorySettingsTask.swift */; }; DC23EDA02912DD520023E626 /* ResetToFactorySettingsTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC23ED9E2912DD0D0023E626 /* ResetToFactorySettingsTask.swift */; }; DC28E0F22877F84B00AE7A84 /* DebugLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC28E0F12877F84B00AE7A84 /* DebugLogger.swift */; }; @@ -93,6 +95,8 @@ 5E2717BD1D7CB2EFFB59D0F4 /* Pods-TangemSdkExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TangemSdkExample.release.xcconfig"; path = "Target Support Files/Pods-TangemSdkExample/Pods-TangemSdkExample.release.xcconfig"; sourceTree = ""; }; ABA3866CD02DAF9913B7E6BD /* Pods-TangemSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TangemSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-TangemSdkExample/Pods-TangemSdkExample.debug.xcconfig"; sourceTree = ""; }; B00A67B2253D8CAC002D7D53 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; + B6B9589A2B2FCA9900E7B74E /* Gemfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Gemfile; sourceTree = ""; }; + B6B9589B2B2FCA9900E7B74E /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = ""; }; DC23ED9E2912DD0D0023E626 /* ResetToFactorySettingsTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetToFactorySettingsTask.swift; sourceTree = ""; }; DC28E0F12877F84B00AE7A84 /* DebugLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLogger.swift; sourceTree = ""; }; E53EB3E423F2C7C90079CC11 /* TangemSdkExampleDevelopmentUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TangemSdkExampleDevelopmentUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -158,6 +162,8 @@ 5D78C1AD234F435B008D7478 = { isa = PBXGroup; children = ( + B6B9589A2B2FCA9900E7B74E /* Gemfile */, + B6B9589B2B2FCA9900E7B74E /* Podfile */, 5D78C1B8234F435B008D7478 /* TangemSdkExample */, E53EB3E523F2C7C90079CC11 /* TangemSdkExampleDevelopmentUITests */, 5D78C1B7234F435B008D7478 /* Products */, @@ -320,7 +326,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + B6B9589C2B2FCA9900E7B74E /* Gemfile in Resources */, 5D78C1C6234F435C008D7478 /* LaunchScreen.storyboard in Resources */, + B6B9589D2B2FCA9900E7B74E /* Podfile in Resources */, 5D78C1C3234F435C008D7478 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index d81b65b9b..d76bd6abe 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -631,6 +631,8 @@ B0EC64FF260110530088F03D /* WalletDeserializer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletDeserializer.swift; sourceTree = ""; }; B0EC6507260110CC0088F03D /* ReadWalletCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadWalletCommand.swift; sourceTree = ""; }; B0EC650D260131220088F03D /* ReadWalletsListCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadWalletsListCommand.swift; sourceTree = ""; }; + B6B958982B2FCA8600E7B74E /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Gemfile; path = ../Gemfile; sourceTree = ""; }; + B6B958992B2FCA8600E7B74E /* TangemSdk.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = TangemSdk.podspec; path = ../TangemSdk.podspec; sourceTree = ""; }; DA216CBF282E4D86003585B9 /* AccessCodeRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessCodeRepository.swift; sourceTree = ""; }; DA6C7529292682650070EEFD /* LAContext+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LAContext+.swift"; sourceTree = ""; }; DADB544F298BAFBC00491102 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; @@ -1236,6 +1238,8 @@ 5DA80C90231D247A00A50A10 = { isa = PBXGroup; children = ( + B6B958982B2FCA8600E7B74E /* Gemfile */, + B6B958992B2FCA8600E7B74E /* TangemSdk.podspec */, 5DDF4F89235F06F600E46EAB /* Info.plist */, 5DA80C9C231D247A00A50A10 /* TangemSdk */, 5DA80CA7231D247A00A50A10 /* TangemSdkTests */, From d5a78744d24bfc0ecc68bef5019e215a86814c66 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 17:17:57 +0300 Subject: [PATCH 06/19] IOS-5453: Fix compilation error due to script sandboxing --- Example/TangemSdkExample.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/TangemSdkExample.xcodeproj/project.pbxproj b/Example/TangemSdkExample.xcodeproj/project.pbxproj index 26d5022d5..73aa8ef14 100644 --- a/Example/TangemSdkExample.xcodeproj/project.pbxproj +++ b/Example/TangemSdkExample.xcodeproj/project.pbxproj @@ -501,7 +501,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -563,7 +563,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; From d31fc7fc9137c3239b2753bff00093220ae4b7a8 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 21:04:34 +0300 Subject: [PATCH 07/19] IOS-5453: Fix C flags --- TangemSdk.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TangemSdk.podspec b/TangemSdk.podspec index 3eb140cc0..77c8741da 100644 --- a/TangemSdk.podspec +++ b/TangemSdk.podspec @@ -34,7 +34,7 @@ Tangem is a Swiss-based secure hardware wallet manufacturer that enables blockch s.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(PODS_TARGET_SRCROOT)/TangemSdk/**', - 'OTHER_CFLAGS' => '-pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-shorten-64-to-32 -Wno-conditional-uninitialized -Wno-unused-function -Wno-long-long -Wno-overlength-strings -O3 -Wundef -Wreserved-identifier -fvisibility=hidden', + 'OTHER_CFLAGS' => '-Wpedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-shorten-64-to-32 -Wno-conditional-uninitialized -Wno-unused-function -Wno-long-long -Wno-overlength-strings -Wundef -Wreserved-identifier -O3 -fvisibility=hidden', } s.weak_frameworks = 'CoreNFC', From 1931371b1e9b78f4153bf311ccaf8929660c9c29 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 21:04:58 +0300 Subject: [PATCH 08/19] IOS-5453: Update example project --- Example/Podfile.lock | 2 +- Example/TangemSdkExample.xcodeproj/project.pbxproj | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 093e4e76e..81f290ee9 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - TangemSdk: f3adf8d0c18bf7a76406462fa31c0efa9f2efa93 + TangemSdk: 61e07ff112d4095cfa688fa7d4694e59fa29f76d PODFILE CHECKSUM: fb4745483d8583db4c8ae8aa3ccbde86ca112a6b diff --git a/Example/TangemSdkExample.xcodeproj/project.pbxproj b/Example/TangemSdkExample.xcodeproj/project.pbxproj index 73aa8ef14..c1ad18751 100644 --- a/Example/TangemSdkExample.xcodeproj/project.pbxproj +++ b/Example/TangemSdkExample.xcodeproj/project.pbxproj @@ -96,7 +96,7 @@ ABA3866CD02DAF9913B7E6BD /* Pods-TangemSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TangemSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-TangemSdkExample/Pods-TangemSdkExample.debug.xcconfig"; sourceTree = ""; }; B00A67B2253D8CAC002D7D53 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; B6B9589A2B2FCA9900E7B74E /* Gemfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Gemfile; sourceTree = ""; }; - B6B9589B2B2FCA9900E7B74E /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = ""; }; + B6B9589B2B2FCA9900E7B74E /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; DC23ED9E2912DD0D0023E626 /* ResetToFactorySettingsTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetToFactorySettingsTask.swift; sourceTree = ""; }; DC28E0F12877F84B00AE7A84 /* DebugLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLogger.swift; sourceTree = ""; }; E53EB3E423F2C7C90079CC11 /* TangemSdkExampleDevelopmentUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TangemSdkExampleDevelopmentUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -301,7 +301,7 @@ }; }; }; - buildConfigurationList = 5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSDKExample" */; + buildConfigurationList = 5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSdkExample" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -709,7 +709,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSDKExample" */ = { + 5D78C1B1234F435B008D7478 /* Build configuration list for PBXProject "TangemSdkExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 5D78C1C8234F435C008D7478 /* Debug */, From 4a87c4bd96dc7609623891f8b9f28ac83e072b99 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 21:09:13 +0300 Subject: [PATCH 09/19] IOS-5453: Fix project file inconsistency --- TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index d76bd6abe..3c3f871a1 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -245,6 +245,7 @@ B0EC6500260110530088F03D /* WalletDeserializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0EC64FF260110530088F03D /* WalletDeserializer.swift */; }; B0EC6508260110CC0088F03D /* ReadWalletCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0EC6507260110CC0088F03D /* ReadWalletCommand.swift */; }; B0EC650E260131220088F03D /* ReadWalletsListCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0EC650D260131220088F03D /* ReadWalletsListCommand.swift */; }; + B6936A672B387B040024826A /* secp256k1_tangem.h in Headers */ = {isa = PBXBuildFile; fileRef = B6936A662B387B040024826A /* secp256k1_tangem.h */; }; DA216CC0282E4D86003585B9 /* AccessCodeRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA216CBF282E4D86003585B9 /* AccessCodeRepository.swift */; }; DA6C752A292682650070EEFD /* LAContext+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA6C7529292682650070EEFD /* LAContext+.swift */; }; DC0665572A7AC8F500CFFCC6 /* Ed25519Slip0010Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC0665562A7AC8F500CFFCC6 /* Ed25519Slip0010Tests.swift */; }; @@ -305,7 +306,6 @@ DCD2D7F42A1CE66000AB00B6 /* secp256k1_recovery.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D7832A1CE66000AB00B6 /* secp256k1_recovery.h */; }; DCD2D7F52A1CE66000AB00B6 /* secp256k1_extrakeys.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D7842A1CE66000AB00B6 /* secp256k1_extrakeys.h */; }; DCD2D7F62A1CE66000AB00B6 /* secp256k1_preallocated.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D7852A1CE66000AB00B6 /* secp256k1_preallocated.h */; }; - DCD2D7F72A1CE66000AB00B6 /* secp256k1.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D7862A1CE66000AB00B6 /* secp256k1.h */; }; DCD2D8BA2A1CF64A00AB00B6 /* scalar_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D84E2A1CF64900AB00B6 /* scalar_impl.h */; }; DCD2D8BD2A1CF64A00AB00B6 /* field_10x26_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D8512A1CF64900AB00B6 /* field_10x26_impl.h */; }; DCD2D8BE2A1CF64A00AB00B6 /* testrand_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D8522A1CF64900AB00B6 /* testrand_impl.h */; }; @@ -631,6 +631,7 @@ B0EC64FF260110530088F03D /* WalletDeserializer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletDeserializer.swift; sourceTree = ""; }; B0EC6507260110CC0088F03D /* ReadWalletCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadWalletCommand.swift; sourceTree = ""; }; B0EC650D260131220088F03D /* ReadWalletsListCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadWalletsListCommand.swift; sourceTree = ""; }; + B6936A662B387B040024826A /* secp256k1_tangem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secp256k1_tangem.h; sourceTree = ""; }; B6B958982B2FCA8600E7B74E /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Gemfile; path = ../Gemfile; sourceTree = ""; }; B6B958992B2FCA8600E7B74E /* TangemSdk.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = TangemSdk.podspec; path = ../TangemSdk.podspec; sourceTree = ""; }; DA216CBF282E4D86003585B9 /* AccessCodeRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessCodeRepository.swift; sourceTree = ""; }; @@ -694,7 +695,6 @@ DCD2D7832A1CE66000AB00B6 /* secp256k1_recovery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secp256k1_recovery.h; sourceTree = ""; }; DCD2D7842A1CE66000AB00B6 /* secp256k1_extrakeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secp256k1_extrakeys.h; sourceTree = ""; }; DCD2D7852A1CE66000AB00B6 /* secp256k1_preallocated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secp256k1_preallocated.h; sourceTree = ""; }; - DCD2D7862A1CE66000AB00B6 /* secp256k1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secp256k1.h; sourceTree = ""; }; DCD2D84E2A1CF64900AB00B6 /* scalar_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scalar_impl.h; sourceTree = ""; }; DCD2D8512A1CF64900AB00B6 /* field_10x26_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = field_10x26_impl.h; sourceTree = ""; }; DCD2D8522A1CF64900AB00B6 /* testrand_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testrand_impl.h; sourceTree = ""; }; @@ -792,13 +792,6 @@ path = Frameworks; sourceTree = ""; }; - 5D06F6AE2756676C006A15B9 /* Entities */ = { - isa = PBXGroup; - children = ( - ); - path = Entities; - sourceTree = ""; - }; 5D0BAAEA25CD87DF00E6A2B6 /* Log */ = { isa = PBXGroup; children = ( @@ -1030,7 +1023,6 @@ 5D4B128126D40C67006E173C /* Backup */ = { isa = PBXGroup; children = ( - 5D06F6AE2756676C006A15B9 /* Entities */, 5D4B128226D40C77006E173C /* StartPrimaryCardLinkingCommand.swift */, 5DE43A5B26D4DC6400ECA36A /* StartBackupCardLinkingCommand.swift */, 5DE43A5F26D511CE00ECA36A /* LinkBackupCardsCommand.swift */, @@ -1579,12 +1571,12 @@ DCD2D7802A1CE66000AB00B6 /* include */ = { isa = PBXGroup; children = ( + B6936A662B387B040024826A /* secp256k1_tangem.h */, DCD2D7812A1CE66000AB00B6 /* secp256k1_ecdh.h */, DCD2D7822A1CE66000AB00B6 /* secp256k1_schnorrsig.h */, DCD2D7832A1CE66000AB00B6 /* secp256k1_recovery.h */, DCD2D7842A1CE66000AB00B6 /* secp256k1_extrakeys.h */, DCD2D7852A1CE66000AB00B6 /* secp256k1_preallocated.h */, - DCD2D7862A1CE66000AB00B6 /* secp256k1.h */, ); path = include; sourceTree = ""; @@ -1761,12 +1753,12 @@ DCD2D8F62A1CF64A00AB00B6 /* assumptions.h in Headers */, DCD2D9232A1CFA8400AB00B6 /* precomputed_ecmult_gen.h in Headers */, DCD2D91F2A1CF87200AB00B6 /* libsecp256k1-config.h in Headers */, - DCD2D7F72A1CE66000AB00B6 /* secp256k1.h in Headers */, DCD2D8CD2A1CF64A00AB00B6 /* field_5x52.h in Headers */, DCD2D9012A1CF64A00AB00B6 /* int128_struct_impl.h in Headers */, DCD2D8D72A1CF64A00AB00B6 /* ecmult_gen_compute_table_impl.h in Headers */, DCD2D8FF2A1CF64A00AB00B6 /* ecmult_const.h in Headers */, DCD2D8D22A1CF64A00AB00B6 /* scalar_4x64.h in Headers */, + B6936A672B387B040024826A /* secp256k1_tangem.h in Headers */, DCD2D8C82A1CF64A00AB00B6 /* selftest.h in Headers */, DCD2D8EE2A1CF64A00AB00B6 /* int128_struct.h in Headers */, ); From 73647881a8ee34bf3573ec8b64a7e55eb7a6ff02 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 21:10:13 +0300 Subject: [PATCH 10/19] IOS-5453: Remove unused codegen-related C file --- TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 4 - .../Crypto/secp256k1/src/precompute_ecmult.c | 90 ------------------- 2 files changed, 94 deletions(-) delete mode 100644 TangemSdk/TangemSdk/Crypto/secp256k1/src/precompute_ecmult.c diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index 3c3f871a1..41c611878 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -366,7 +366,6 @@ DCD2D91C2A1CF64A00AB00B6 /* scalar_low.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D8B72A1CF64A00AB00B6 /* scalar_low.h */; }; DCD2D91D2A1CF64A00AB00B6 /* eckey.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D8B82A1CF64A00AB00B6 /* eckey.h */; }; DCD2D91F2A1CF87200AB00B6 /* libsecp256k1-config.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D91E2A1CF87200AB00B6 /* libsecp256k1-config.h */; }; - DCD2D9222A1CFA8400AB00B6 /* precompute_ecmult.c in Sources */ = {isa = PBXBuildFile; fileRef = DCD2D9202A1CFA8400AB00B6 /* precompute_ecmult.c */; }; DCD2D9232A1CFA8400AB00B6 /* precomputed_ecmult_gen.h in Headers */ = {isa = PBXBuildFile; fileRef = DCD2D9212A1CFA8400AB00B6 /* precomputed_ecmult_gen.h */; }; DCD2D9252A1D15A300AB00B6 /* SchnorrSignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD2D9242A1D15A300AB00B6 /* SchnorrSignature.swift */; }; DCEA3ABC2875AEBA00B0B0DA /* BiometricsStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCEA3ABB2875AEBA00B0B0DA /* BiometricsStorage.swift */; }; @@ -755,7 +754,6 @@ DCD2D8B72A1CF64A00AB00B6 /* scalar_low.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scalar_low.h; sourceTree = ""; }; DCD2D8B82A1CF64A00AB00B6 /* eckey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eckey.h; sourceTree = ""; }; DCD2D91E2A1CF87200AB00B6 /* libsecp256k1-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "libsecp256k1-config.h"; sourceTree = ""; }; - DCD2D9202A1CFA8400AB00B6 /* precompute_ecmult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = precompute_ecmult.c; sourceTree = ""; }; DCD2D9212A1CFA8400AB00B6 /* precomputed_ecmult_gen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = precomputed_ecmult_gen.h; sourceTree = ""; }; DCD2D9242A1D15A300AB00B6 /* SchnorrSignature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SchnorrSignature.swift; sourceTree = ""; }; DCEA3ABB2875AEBA00B0B0DA /* BiometricsStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricsStorage.swift; sourceTree = ""; }; @@ -1584,7 +1582,6 @@ DCD2D84C2A1CF64900AB00B6 /* src */ = { isa = PBXGroup; children = ( - DCD2D9202A1CFA8400AB00B6 /* precompute_ecmult.c */, DCD2D9212A1CFA8400AB00B6 /* precomputed_ecmult_gen.h */, DCD2D84E2A1CF64900AB00B6 /* scalar_impl.h */, DCD2D8512A1CF64900AB00B6 /* field_10x26_impl.h */, @@ -2038,7 +2035,6 @@ DC1244E829BB9E0C0037BC05 /* ExtendedKeySerializer.swift in Sources */, 5DA5B61C233E12B30058C720 /* Tlv.swift in Sources */, 5D0E56032757C11F00D46F54 /* CardDataResponse.swift in Sources */, - DCD2D9222A1CFA8400AB00B6 /* precompute_ecmult.c in Sources */, 5D06F6AD27565441006A15B9 /* StartPrimaryCardLinkingTask.swift in Sources */, 5D2F3EE526CBDAA100779CAC /* KeyboardAdaptive.swift in Sources */, 5D7D5FB223449D4000058D69 /* SessionEnvironment.swift in Sources */, diff --git a/TangemSdk/TangemSdk/Crypto/secp256k1/src/precompute_ecmult.c b/TangemSdk/TangemSdk/Crypto/secp256k1/src/precompute_ecmult.c deleted file mode 100644 index 2ff6560cb..000000000 --- a/TangemSdk/TangemSdk/Crypto/secp256k1/src/precompute_ecmult.c +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************************************** - * Copyright (c) 2013, 2014, 2017, 2021 Pieter Wuille, Andrew Poelstra, Jonas Nick, Russell O'Connor * - * Distributed under the MIT software license, see the accompanying * - * file COPYING or https://www.opensource.org/licenses/mit-license.php. * - *****************************************************************************************************/ - -#include -#include - -#include "../include/secp256k1_tangem.h" - -#include "assumptions.h" -#include "util.h" - -#include "field_impl.h" -#include "group_impl.h" -#include "int128_impl.h" -#include "ecmult.h" -#include "ecmult_compute_table_impl.h" - -static void print_table(FILE *fp, const char *name, int window_g, const secp256k1_ge_storage* table) { - int j; - int i; - - fprintf(fp, "const secp256k1_ge_storage %s[ECMULT_TABLE_SIZE(WINDOW_G)] = {\n", name); - fprintf(fp, " S(%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32 - ",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32")\n", - SECP256K1_GE_STORAGE_CONST_GET(table[0])); - - j = 1; - for(i = 3; i <= window_g; ++i) { - fprintf(fp, "#if WINDOW_G > %d\n", i-1); - for(;j < ECMULT_TABLE_SIZE(i); ++j) { - fprintf(fp, ",S(%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32 - ",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32")\n", - SECP256K1_GE_STORAGE_CONST_GET(table[j])); - } - fprintf(fp, "#endif\n"); - } - fprintf(fp, "};\n"); -} - -static void print_two_tables(FILE *fp, int window_g) { - secp256k1_ge_storage* table = malloc(ECMULT_TABLE_SIZE(window_g) * sizeof(secp256k1_ge_storage)); - secp256k1_ge_storage* table_128 = malloc(ECMULT_TABLE_SIZE(window_g) * sizeof(secp256k1_ge_storage)); - - secp256k1_ecmult_compute_two_tables(table, table_128, window_g, &secp256k1_ge_const_g); - - print_table(fp, "secp256k1_pre_g", window_g, table); - print_table(fp, "secp256k1_pre_g_128", window_g, table_128); - - free(table); - free(table_128); -} - -int main(void) { - /* Always compute all tables for window sizes up to 15. */ - int window_g = (ECMULT_WINDOW_SIZE < 15) ? 15 : ECMULT_WINDOW_SIZE; - FILE* fp; - - fp = fopen("src/precomputed_ecmult.c","w"); - if (fp == NULL) { - fprintf(stderr, "Could not open src/precomputed_ecmult.h for writing!\n"); - return -1; - } - - fprintf(fp, "/* This file was automatically generated by precompute_ecmult. */\n"); - fprintf(fp, "/* This file contains an array secp256k1_pre_g with odd multiples of the base point G and\n"); - fprintf(fp, " * an array secp256k1_pre_g_128 with odd multiples of 2^128*G for accelerating the computation of a*P + b*G.\n"); - fprintf(fp, " */\n"); - fprintf(fp, "#include \"../include/secp256k1.h\"\n"); - fprintf(fp, "#include \"group.h\"\n"); - fprintf(fp, "#include \"ecmult.h\"\n"); - fprintf(fp, "#include \"precomputed_ecmult.h\"\n"); - fprintf(fp, "#define S(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) SECP256K1_GE_STORAGE_CONST(0x##a##u,0x##b##u,0x##c##u,0x##d##u,0x##e##u,0x##f##u,0x##g##u,0x##h##u,0x##i##u,0x##j##u,0x##k##u,0x##l##u,0x##m##u,0x##n##u,0x##o##u,0x##p##u)\n"); - fprintf(fp, "#if ECMULT_WINDOW_SIZE > %d\n", window_g); - fprintf(fp, " #error configuration mismatch, invalid ECMULT_WINDOW_SIZE. Try deleting precomputed_ecmult.c before the build.\n"); - fprintf(fp, "#endif\n"); - fprintf(fp, "#ifdef EXHAUSTIVE_TEST_ORDER\n"); - fprintf(fp, "# error Cannot compile precomputed_ecmult.c in exhaustive test mode\n"); - fprintf(fp, "#endif /* EXHAUSTIVE_TEST_ORDER */\n"); - fprintf(fp, "#define WINDOW_G ECMULT_WINDOW_SIZE\n"); - - print_two_tables(fp, window_g); - - fprintf(fp, "#undef S\n"); - fclose(fp); - - return 0; -} From 0150cf71fa9d80a940e33e752eb01719e49a65a7 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 21:14:17 +0300 Subject: [PATCH 11/19] IOS-5453: Fix compilation errors due to transitive imports --- .../Services/Secure/AccessCodeRepository.swift | 2 ++ .../ReadIssuerExtraDataCommand.swift | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/TangemSdk/TangemSdk/Common/Services/Secure/AccessCodeRepository.swift b/TangemSdk/TangemSdk/Common/Services/Secure/AccessCodeRepository.swift index d161f3648..9b8c4bf2d 100644 --- a/TangemSdk/TangemSdk/Common/Services/Secure/AccessCodeRepository.swift +++ b/TangemSdk/TangemSdk/Common/Services/Secure/AccessCodeRepository.swift @@ -6,6 +6,8 @@ // Copyright © 2022 Tangem AG. All rights reserved. // +import Foundation + @available(iOS 13.0, *) public class AccessCodeRepository { var isEmpty: Bool { diff --git a/TangemSdk/TangemSdk/Operations/IssuerAndUserData/ReadIssuerExtraDataCommand.swift b/TangemSdk/TangemSdk/Operations/IssuerAndUserData/ReadIssuerExtraDataCommand.swift index 1fda1a416..f5a2b2e2d 100644 --- a/TangemSdk/TangemSdk/Operations/IssuerAndUserData/ReadIssuerExtraDataCommand.swift +++ b/TangemSdk/TangemSdk/Operations/IssuerAndUserData/ReadIssuerExtraDataCommand.swift @@ -1,11 +1,13 @@ -//// -//// ReadIssuerExtraDataCommand.swift -//// TangemSdk -//// -//// Created by Alexander Osokin on 26.02.2020. -//// Copyright © 2020 Tangem AG. All rights reserved. -//// // +// ReadIssuerExtraDataCommand.swift +// TangemSdk +// +// Created by Alexander Osokin on 26.02.2020. +// Copyright © 2020 Tangem AG. All rights reserved. +// + +import Foundation + /// This enum specifies modes for `ReadIssuerExtraDataCommand` and `WriteIssuerExtraDataCommand`. public enum IssuerExtraDataMode: Byte, InteractionMode { ///This mode is required to read issuer extra data from the card. This mode is required to initiate writing issuer extra data to the card. From 805919062e61d193222ba30bafa3e296940a84bc Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 22:25:32 +0300 Subject: [PATCH 12/19] IOS-5453: Add package manifest --- Package.swift | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Package.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 000000000..28d925163 --- /dev/null +++ b/Package.swift @@ -0,0 +1,67 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "TangemSdk", + defaultLocalization: "en", + platforms: [ + .iOS(.v11) + ], + products: [ + // Products define the executables and libraries a package produces, making them visible to other packages. + .library( + name: "TangemSdk", + targets: [ + "TangemSdk", + ] + ), + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .target( + name: "TangemSdk", + dependencies: [ + "TangemSdk_secp256k1", + "Bls_Signature", + ], + path: "TangemSdk/TangemSdk", + exclude: [ + "Crypto/secp256k1", + "Frameworks", + "module.modulemap", + "TangemSdk.h", + ], + resources: [ + .process("Common/Localization/de.lproj"), + .process("Common/Localization/en.lproj"), + .process("Common/Localization/fr.lproj"), + .process("Common/Localization/it.lproj"), + .process("Common/Localization/ru.lproj"), + .process("Common/Localization/zh-Hant.lproj"), + .copy("Haptics/"), + .copy("Crypto/BIP39/Wordlists/english.txt"), + ] + ), + .target( + name: "TangemSdk_secp256k1", + path: "TangemSdk/TangemSdk/Crypto/secp256k1" + ), + .binaryTarget( + name: "Bls_Signature", + path: "TangemSdk/TangemSdk/Frameworks/Bls_Signature.xcframework" + ), + .testTarget( + name: "TangemSdkTests", + dependencies: [ + "TangemSdk", + ], + path: "TangemSdk/TangemSdkTests", + resources: [ + .copy("Jsons/"), + ] + ), + ] +) From 2027d357622a3d9f55a00ad83ba58b2f5bdcb9ba Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 22:30:52 +0300 Subject: [PATCH 13/19] IOS-5453: Fix bundle resources in unit tests when SPM is used --- TangemSdk/TangemSdkTests/BIP39Tests.swift | 6 +- .../TangemSdkTests/Extensions/Bundle+.swift | 52 ++++++++ TangemSdk/TangemSdkTests/JSONRPCTests.swift | 119 ++++++++---------- 3 files changed, 102 insertions(+), 75 deletions(-) create mode 100644 TangemSdk/TangemSdkTests/Extensions/Bundle+.swift diff --git a/TangemSdk/TangemSdkTests/BIP39Tests.swift b/TangemSdk/TangemSdkTests/BIP39Tests.swift index d7aead555..d8fdb033a 100644 --- a/TangemSdk/TangemSdkTests/BIP39Tests.swift +++ b/TangemSdk/TangemSdkTests/BIP39Tests.swift @@ -111,11 +111,7 @@ class BIP39Tests: XCTestCase { } private func getTestVectors(from filename: String) throws -> [String: Any]? { - guard let url = Bundle(for: type(of: self)).url(forResource: filename, withExtension: "json") else { - return nil - } - - let data = try Data(contentsOf: url) + let data = try Bundle.readFileAsData(name: filename, in: .bip39) guard let dictionary = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else { return nil diff --git a/TangemSdk/TangemSdkTests/Extensions/Bundle+.swift b/TangemSdk/TangemSdkTests/Extensions/Bundle+.swift new file mode 100644 index 000000000..b201286e1 --- /dev/null +++ b/TangemSdk/TangemSdkTests/Extensions/Bundle+.swift @@ -0,0 +1,52 @@ +// +// Bundle+.swift +// TangemSdkTests +// +// Created by m3g0byt3 on 24.12.2023. +// Copyright © 2023 Tangem AG. All rights reserved. +// + +import Foundation + +extension Bundle { + enum Folder: String { + case bip39 = "BIP39" + case files = "Files" + case personalize = "Personalize" + case root = "" + } + + static func readFileAsString(name: String, in folder: Folder) throws -> String { + let filePath = filePath(name: name, in: folder) + + return try String(contentsOfFile: filePath) + } + + static func readFileAsData(name: String, in folder: Folder) throws -> Data { + let filePath = filePath(name: name, in: folder) + + return try Data(contentsOf: URL(fileURLWithPath: filePath)) + } + + /// SPM preserves folder structure for resources, unlike Cocoapods. + /// Therefore, a full file path with all intermediate directories must be constructed. + private static func filePath(name: String, in folder: Folder) -> String { +#if SWIFT_PACKAGE + let bundle = Bundle.module + let resource = [ + "Jsons", + folder.rawValue, + name, + ].joined(separator: "/") +#else + let bundle = Bundle(for: Dummy.self) + let resource = name +#endif // SWIFT_PACKAGE + + return bundle.path(forResource: resource, ofType: "json")! + } +} + +#if !SWIFT_PACKAGE +private final class Dummy {} +#endif // SWIFT_PACKAGE diff --git a/TangemSdk/TangemSdkTests/JSONRPCTests.swift b/TangemSdk/TangemSdkTests/JSONRPCTests.swift index 37ccfd8e3..6f3d03221 100644 --- a/TangemSdk/TangemSdkTests/JSONRPCTests.swift +++ b/TangemSdk/TangemSdkTests/JSONRPCTests.swift @@ -13,10 +13,12 @@ import XCTest @available(iOS 13.0, *) class JSONRPCTests: XCTestCase { var testCard: Card { - let json = readFile(name: "Card") - let data = json.data(using: .utf8) - XCTAssertNotNil(data) - return try! JSONDecoder.tangemSdkDecoder.decode(Card.self, from: data!) + get throws { + let json = try Bundle.readFileAsString(name: "Card", in: .root) + let data = json.data(using: .utf8) + XCTAssertNotNil(data) + return try JSONDecoder.tangemSdkDecoder.decode(Card.self, from: data!) + } } func testDecodeMasterExtendedPublicKey() throws { @@ -112,11 +114,11 @@ class JSONRPCTests: XCTestCase { XCTAssert(data[1] == Data(hexString: "AABBCCDDEEFFGG")) } - func testScan() { - testMethod(name: "Scan", result: testCard) + func testScan() throws { + try testMethod(name: "Scan", in: .root, result: testCard) } - func testCreateWallet() { + func testCreateWallet() throws { let result = CreateWalletResponse(cardId: "c000111122223333", wallet: Card.Wallet(publicKey: Data(hexString: "5130869115a2ff91959774c99d4dc2873f0c41af3e0bb23d027ab16d39de1348"), chainCode: nil, @@ -128,10 +130,10 @@ class JSONRPCTests: XCTestCase { proof: nil, isImported: false, hasBackup: false)) - testMethod(name: "CreateWallet", result: result) + try testMethod(name: "CreateWallet", in: .root, result: result) } - func testImportWalletMnemonic() { + func testImportWalletMnemonic() throws { let result = CreateWalletResponse(cardId: "c000111122223333", wallet: Card.Wallet(publicKey: Data(hexString: "029983A77B155ED3B3B9E1DDD223BD5AA073834C8F61113B2F1B883AAA70971B5F"), chainCode: Data(hexString: "C7A888C4C670406E7AAEB6E86555CE0C4E738A337F9A9BC239F6D7E475110A4E"), @@ -143,95 +145,95 @@ class JSONRPCTests: XCTestCase { proof: nil, isImported: false, hasBackup: false)) - testMethod(name: "ImportWalletMnemonic", result: result) + try testMethod(name: "ImportWalletMnemonic", in: .root, result: result) } - func testPurgeWallet() { + func testPurgeWallet() throws { let result = PurgeWalletCommand.Response(cardId: "c000111122223333") - testMethod(name: "PurgeWallet", result: result) + try testMethod(name: "PurgeWallet", in: .root, result: result) } - func testDepersonalize() { + func testDepersonalize() throws { let result = DepersonalizeResponse(success: true) - testMethod(name: "Depersonalize", result: result) + try testMethod(name: "Depersonalize", in: .root, result: result) } - func testPersonalize() { - testPersonalizeConfig(name: "v4") - testPersonalizeConfig(name: "v3.05ada") + func testPersonalize() throws { + try testPersonalizeConfig(name: "v4") + try testPersonalizeConfig(name: "v3.05ada") } - func testSetPin1() { + func testSetPin1() throws { let result = SuccessResponse(cardId: "c000111122223333") - testMethod(name: "SetAccessCode", result: result) + try testMethod(name: "SetAccessCode", in: .root, result: result) } - func testSetPin2() { + func testSetPin2() throws { let result = SuccessResponse(cardId: "c000111122223333") - testMethod(name: "SetPasscode", result: result) + try testMethod(name: "SetPasscode", in: .root, result: result) } - func testSignHashes() { + func testSignHashes() throws { let result = SignHashesResponse(cardId: "c000111122223333", signatures: [Data(hexString: "eb7411c2b7d871c06dad51e58e44746583ad134f4e214e4899f2fc84802232a1"), Data(hexString: "33443bd93f350b62a90a0c23d30c6d4e9bb164606e809ccace60cf0e2591e58c")], totalSignedHashes: 2) - testMethod(name: "SignHashes", result: result) + try testMethod(name: "SignHashes", in: .root, result: result) } - func testSignHash() { + func testSignHash() throws { let result = SignHashResponse(cardId: "c000111122223333", signature: Data(hexString: "eb7411c2b7d871c06dad51e58e44746583ad134f4e214e4899f2fc84802232a1"), totalSignedHashes: 2) - testMethod(name: "SignHash", result: result) + try testMethod(name: "SignHash", in: .root, result: result) } - func testDerivePublicKey() { + func testDerivePublicKey() throws { let result = ExtendedPublicKey(publicKey: Data(hexString: "0200300397571D99D41BB2A577E2CBE495C04AC5B9A97B7A4ECF999F23CE45E962"), chainCode: Data(hexString: "537F7361175B150732E17508066982B42D9FB1F8239C4D7BFC490088C83A8BBB")) - testMethod(name: "DeriveWalletPublicKey", result: result) + try testMethod(name: "DeriveWalletPublicKey", in: .root, result: result) } - func testDerivePublicKeys() { + func testDerivePublicKeys() throws { let keys = [try! DerivationPath(rawPath: "m/44'/0'") : ExtendedPublicKey(publicKey: Data(hexString: "0200300397571D99D41BB2A577E2CBE495C04AC5B9A97B7A4ECF999F23CE45E962"), chainCode: Data(hexString: "537F7361175B150732E17508066982B42D9FB1F8239C4D7BFC490088C83A8BBB")), try! DerivationPath(rawPath: "m/44'/1'") : ExtendedPublicKey(publicKey: Data(hexString: "0200300397571D99D41BB2A577E2CBE495C04AC5B9A97B7A4ECF999F23CE45E962"), chainCode: Data(hexString: "537F7361175B150732E17508066982B42D9FB1F8239C4D7BFC490088C83A8BBB"))] let result = DerivedKeys(keys: keys) - testMethod(name: "DeriveWalletPublicKeys", result: result) + try testMethod(name: "DeriveWalletPublicKeys", in: .root, result: result) } - func testUserCodeRecoveryAllowed() { + func testUserCodeRecoveryAllowed() throws { let result = SuccessResponse(cardId: "c000111122223333") - testMethod(name: "SetUserCodeRecoveryAllowed", result: result) + try testMethod(name: "SetUserCodeRecoveryAllowed", in: .root, result: result) } - func testAttestCardKey() { + func testAttestCardKey() throws { let result = AttestCardKeyResponse(cardId: "c000111122223333", salt: Data(hexString: "BBBBBBBBBBBB"), cardSignature: Data(hexString: "AAAAAAAAAAAA"), challenge: Data(hexString: "000000000000"), linkedCardPublicKeys: []) - testMethod(name: "AttestCardKey", result: result) + try testMethod(name: "AttestCardKey", in: .root, result: result) } - func testFiles() { - testMethod(name: "ReadFiles", result: [File(data: Data(hexString: "00AABBCCDD"), + func testFiles() throws { + try testMethod(name: "ReadFiles", in: .files, result: [File(data: Data(hexString: "00AABBCCDD"), index: 0, settings: FileSettings(isPermanent: false, visibility: .public))]) - testMethod(name: "DeleteFiles", result: DeleteFilesTask.Response(cardId: "c000111122223333")) - testMethod(name: "WriteFiles", result: WriteFilesTask.Response(cardId: "c000111122223333", filesIndices: [0,1])) - testMethod(name: "ChangeFileSettings", result: ChangeFileSettingsTask.Response(cardId: "c000111122223333")) + try testMethod(name: "DeleteFiles", in: .files, result: DeleteFilesTask.Response(cardId: "c000111122223333")) + try testMethod(name: "WriteFiles", in: .files, result: WriteFilesTask.Response(cardId: "c000111122223333", filesIndices: [0,1])) + try testMethod(name: "ChangeFileSettings", in: .files, result: ChangeFileSettingsTask.Response(cardId: "c000111122223333")) } func testMethodNotFound() { @@ -248,9 +250,9 @@ class JSONRPCTests: XCTestCase { } } - func testParseRequest() { + func testParseRequest() throws { let name = "TestParseRequest" - let fileText = readFile(name: name) + let fileText = try Bundle.readFileAsString(name: name, in: .root) let jsonData = fileText.data(using: .utf8)! do { @@ -299,8 +301,8 @@ class JSONRPCTests: XCTestCase { } } - private func testPersonalizeConfig(name: String) { - guard let testData = getTestData(for: name) else { + private func testPersonalizeConfig(name: String) throws { + guard let testData = try getTestData(for: name, in: .personalize) else { XCTAssert(false, "Failed to create test data \(name)") return } @@ -316,8 +318,8 @@ class JSONRPCTests: XCTestCase { } } - private func testMethod(name: String, result: TResult) { - guard let testData = getTestData(for: name) else { + private func testMethod(name: String, in folder: Bundle.Folder, result: TResult) throws { + guard let testData = try getTestData(for: name, in: folder) else { XCTAssert(false, "Failed to create test data \(name)") return } @@ -345,25 +347,8 @@ class JSONRPCTests: XCTestCase { XCTAssertEqual(resultData.utf8String!.lowercased(), resultJsonData.utf8String!.lowercased()) } - private func testMethodRequest(name: String) { - guard let testData = getTestData(for: name) else { - XCTAssert(false, "Failed to create test data \(name)") - return - } - - //test request - do { - let request = try JSONRPCRequest(jsonString: testData.request) - //test convert request - XCTAssertNoThrow(try JSONRPCConverter.shared.convert(request: request)) - } catch { - XCTAssert(false, "Failed to create request for \(name)") - return - } - } - - private func getTestData(for method: String) -> (request: String, response: Data)? { - let fileText = readFile(name: method) + private func getTestData(for method: String, in folder: Bundle.Folder) throws -> (request: String, response: Data)? { + let fileText = try Bundle.readFileAsString(name: method, in: folder) let jsonData = fileText.data(using: .utf8)! do { @@ -379,7 +364,7 @@ class JSONRPCTests: XCTestCase { if let response = json["response"] { responseData = try JSONSerialization.data(withJSONObject: response, options: .prettyPrinted) } else { - let cardResponse = "{\"result\": \(testCard.json)}" + let cardResponse = "{\"result\": \(try testCard.json)}" responseData = cardResponse.data(using: .utf8)! } @@ -395,10 +380,4 @@ class JSONRPCTests: XCTestCase { return nil } } - - private func readFile(name: String) -> String { - let bundle = Bundle(for: type(of: self)) - let path = bundle.path(forResource: name, ofType: "json")! - return try! String(contentsOfFile: path) - } } From 935d62c330a0a4f7d97c6087170e4762b6ff48da Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 22:47:01 +0300 Subject: [PATCH 14/19] IOS-5453: Fix bundle resources in the main target --- TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 12 ++++++++++ .../TangemSdk/Common/Extensions/Bundle+.swift | 4 ++++ .../TangemSdk/UI/Main/HapticsEngine.swift | 22 ++++++++++++++++--- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index 41c611878..d647711d4 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -246,6 +246,7 @@ B0EC6508260110CC0088F03D /* ReadWalletCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0EC6507260110CC0088F03D /* ReadWalletCommand.swift */; }; B0EC650E260131220088F03D /* ReadWalletsListCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0EC650D260131220088F03D /* ReadWalletsListCommand.swift */; }; B6936A672B387B040024826A /* secp256k1_tangem.h in Headers */ = {isa = PBXBuildFile; fileRef = B6936A662B387B040024826A /* secp256k1_tangem.h */; }; + B6CA42232B38B5AE00C9A5C9 /* Bundle+.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6CA42222B38B5AE00C9A5C9 /* Bundle+.swift */; }; DA216CC0282E4D86003585B9 /* AccessCodeRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA216CBF282E4D86003585B9 /* AccessCodeRepository.swift */; }; DA6C752A292682650070EEFD /* LAContext+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA6C7529292682650070EEFD /* LAContext+.swift */; }; DC0665572A7AC8F500CFFCC6 /* Ed25519Slip0010Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC0665562A7AC8F500CFFCC6 /* Ed25519Slip0010Tests.swift */; }; @@ -633,6 +634,7 @@ B6936A662B387B040024826A /* secp256k1_tangem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = secp256k1_tangem.h; sourceTree = ""; }; B6B958982B2FCA8600E7B74E /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Gemfile; path = ../Gemfile; sourceTree = ""; }; B6B958992B2FCA8600E7B74E /* TangemSdk.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = TangemSdk.podspec; path = ../TangemSdk.podspec; sourceTree = ""; }; + B6CA42222B38B5AE00C9A5C9 /* Bundle+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+.swift"; sourceTree = ""; }; DA216CBF282E4D86003585B9 /* AccessCodeRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessCodeRepository.swift; sourceTree = ""; }; DA6C7529292682650070EEFD /* LAContext+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LAContext+.swift"; sourceTree = ""; }; DADB544F298BAFBC00491102 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; @@ -1266,6 +1268,7 @@ 5DA80CA7231D247A00A50A10 /* TangemSdkTests */ = { isa = PBXGroup; children = ( + B6CA42212B38B5A700C9A5C9 /* Extensions */, 5D38D0672679040C0052F67C /* Jsons */, 5DA80CA8231D247A00A50A10 /* CryptoUtilsTests.swift */, 5DA80CAA231D247A00A50A10 /* Info.plist */, @@ -1485,6 +1488,14 @@ path = Deserialization; sourceTree = ""; }; + B6CA42212B38B5A700C9A5C9 /* Extensions */ = { + isa = PBXGroup; + children = ( + B6CA42222B38B5AE00C9A5C9 /* Bundle+.swift */, + ); + path = Extensions; + sourceTree = ""; + }; DC1244BB29B61DAC0037BC05 /* BIP39 */ = { isa = PBXGroup; children = ( @@ -2178,6 +2189,7 @@ 5DA7942A236C64D100B33DB5 /* IntUtilsTests.swift in Sources */, 5DA80CA9231D247A00A50A10 /* CryptoUtilsTests.swift in Sources */, 5D713B2D236C3F6400E4F6FC /* StringUtilsTest.swift in Sources */, + B6CA42232B38B5AE00C9A5C9 /* Bundle+.swift in Sources */, DC3D97FB2A77E079001EEE7A /* SLIP23Tests.swift in Sources */, DCB5A4E52A1FAC190021E12D /* BLSTests.swift in Sources */, DC1244C929B778750037BC05 /* BIP32Tests.swift in Sources */, diff --git a/TangemSdk/TangemSdk/Common/Extensions/Bundle+.swift b/TangemSdk/TangemSdk/Common/Extensions/Bundle+.swift index 5d9129692..e0ec6a0ef 100644 --- a/TangemSdk/TangemSdk/Common/Extensions/Bundle+.swift +++ b/TangemSdk/TangemSdk/Common/Extensions/Bundle+.swift @@ -10,6 +10,9 @@ import Foundation @available(iOS 13.0, *) extension Bundle { static var sdkBundle: Bundle { +#if SWIFT_PACKAGE + return Bundle.module +#else let selfBundle = Bundle(for: TangemSdk.self) if let path = selfBundle.path(forResource: "TangemSdk", ofType: "bundle"), //for pods let bundle = Bundle(path: path) { @@ -17,5 +20,6 @@ extension Bundle { } else { return selfBundle } +#endif // SWIFT_PACKAGE } } diff --git a/TangemSdk/TangemSdk/UI/Main/HapticsEngine.swift b/TangemSdk/TangemSdk/UI/Main/HapticsEngine.swift index f47a1c2f8..ea7b6b2d8 100644 --- a/TangemSdk/TangemSdk/UI/Main/HapticsEngine.swift +++ b/TangemSdk/TangemSdk/UI/Main/HapticsEngine.swift @@ -23,8 +23,9 @@ class HapticsEngine { func playSuccess() { if supportsHaptics { do { - - guard let path = Bundle.sdkBundle.path(forResource: "Success", ofType: "ahap") else { + let filePath = filePath(forResource: "Success") + + guard let path = Bundle.sdkBundle.path(forResource: filePath, ofType: "ahap") else { return } @@ -40,7 +41,9 @@ class HapticsEngine { func playError() { if supportsHaptics { do { - guard let path = Bundle.sdkBundle.path(forResource: "Error", ofType: "ahap") else { + let filePath = filePath(forResource: "Error") + + guard let path = Bundle.sdkBundle.path(forResource: filePath, ofType: "ahap") else { return } @@ -139,4 +142,17 @@ class HapticsEngine { Log.error("CHHapticEngine error: \(error)") } } + + /// SPM preserves folder structure for resources, unlike Cocoapods. + /// Therefore, a full file path with all intermediate directories must be constructed. + private func filePath(forResource resource: String) -> String { +#if SWIFT_PACKAGE + return [ + "Haptics", + resource, + ].joined(separator: "/") +#else + return resource +#endif // SWIFT_PACKAGE + } } From 6cb5c5ed8d277ff1bac5902d86d9fec96dcbad43 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Sun, 24 Dec 2023 23:28:55 +0300 Subject: [PATCH 15/19] IOS-5453: Fix example project file inconsistency --- Example/TangemSdkExample.xcodeproj/project.pbxproj | 8 ++++---- .../xcshareddata/xcschemes/TangemSdkExample.xcscheme | 6 +++--- .../Info-Development.plist} | 0 3 files changed, 7 insertions(+), 7 deletions(-) rename Example/{TangemSdkExample copy-Info.plist => TangemSdkExample/Info-Development.plist} (100%) diff --git a/Example/TangemSdkExample.xcodeproj/project.pbxproj b/Example/TangemSdkExample.xcodeproj/project.pbxproj index c1ad18751..49bce29a0 100644 --- a/Example/TangemSdkExample.xcodeproj/project.pbxproj +++ b/Example/TangemSdkExample.xcodeproj/project.pbxproj @@ -598,7 +598,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.tangem.TangemSDKExample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = "$(inherited) /Users/alexander.osokin/repos/tangem/tangem-ios/TangemSdk/TangemSdk/TangemSdk/Crypto/Ed25519/CEd25519"; + SWIFT_INCLUDE_PATHS = "$(inherited)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; @@ -620,7 +620,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.tangem.TangemSDKExample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_INCLUDE_PATHS = "$(inherited) /Users/alexander.osokin/repos/tangem/tangem-ios/TangemSdk/TangemSdk/TangemSdk/Crypto/Ed25519/CEd25519"; + SWIFT_INCLUDE_PATHS = "$(inherited)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; @@ -634,7 +634,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 15; DEVELOPMENT_TEAM = 4897UJ6D8C; - INFOPLIST_FILE = "TangemSdkExample copy-Info.plist"; + INFOPLIST_FILE = "TangemSdkExample/Info-Development.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -654,7 +654,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 15; DEVELOPMENT_TEAM = 4897UJ6D8C; - INFOPLIST_FILE = "TangemSdkExample copy-Info.plist"; + INFOPLIST_FILE = "TangemSdkExample/Info-Development.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme b/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme index dd81dc8bf..6018bf456 100644 --- a/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme +++ b/Example/TangemSdkExample.xcodeproj/xcshareddata/xcschemes/TangemSdkExample.xcscheme @@ -17,7 +17,7 @@ BlueprintIdentifier = "5D78C1B5234F435B008D7478" BuildableName = "TangemSdkExample.app" BlueprintName = "TangemSdkExample" - ReferencedContainer = "container:TangemSDKExample.xcodeproj"> + ReferencedContainer = "container:TangemSdkExample.xcodeproj"> @@ -47,7 +47,7 @@ BlueprintIdentifier = "5D78C1B5234F435B008D7478" BuildableName = "TangemSdkExample.app" BlueprintName = "TangemSdkExample" - ReferencedContainer = "container:TangemSDKExample.xcodeproj"> + ReferencedContainer = "container:TangemSdkExample.xcodeproj"> @@ -64,7 +64,7 @@ BlueprintIdentifier = "5D78C1B5234F435B008D7478" BuildableName = "TangemSdkExample.app" BlueprintName = "TangemSdkExample" - ReferencedContainer = "container:TangemSDKExample.xcodeproj"> + ReferencedContainer = "container:TangemSdkExample.xcodeproj"> diff --git a/Example/TangemSdkExample copy-Info.plist b/Example/TangemSdkExample/Info-Development.plist similarity index 100% rename from Example/TangemSdkExample copy-Info.plist rename to Example/TangemSdkExample/Info-Development.plist From 4a69428045fb7875c4ad8f6b7f304944113a3b46 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 25 Dec 2023 00:09:49 +0300 Subject: [PATCH 16/19] IOS-5453: Improve file path for localization resources --- Package.swift | 11 +++-------- .../{ => Resources}/de.lproj/Localizable.strings | 0 .../{ => Resources}/en.lproj/Localizable.strings | 0 .../{ => Resources}/fr.lproj/Localizable.strings | 0 .../{ => Resources}/it.lproj/Localizable.strings | 0 .../{ => Resources}/ru.lproj/Localizable.strings | 0 .../{ => Resources}/zh-Hant.lproj/Localizable.strings | 0 7 files changed, 3 insertions(+), 8 deletions(-) rename TangemSdk/TangemSdk/Common/Localization/{ => Resources}/de.lproj/Localizable.strings (100%) rename TangemSdk/TangemSdk/Common/Localization/{ => Resources}/en.lproj/Localizable.strings (100%) rename TangemSdk/TangemSdk/Common/Localization/{ => Resources}/fr.lproj/Localizable.strings (100%) rename TangemSdk/TangemSdk/Common/Localization/{ => Resources}/it.lproj/Localizable.strings (100%) rename TangemSdk/TangemSdk/Common/Localization/{ => Resources}/ru.lproj/Localizable.strings (100%) rename TangemSdk/TangemSdk/Common/Localization/{ => Resources}/zh-Hant.lproj/Localizable.strings (100%) diff --git a/Package.swift b/Package.swift index 28d925163..759e45d14 100644 --- a/Package.swift +++ b/Package.swift @@ -35,13 +35,8 @@ let package = Package( "TangemSdk.h", ], resources: [ - .process("Common/Localization/de.lproj"), - .process("Common/Localization/en.lproj"), - .process("Common/Localization/fr.lproj"), - .process("Common/Localization/it.lproj"), - .process("Common/Localization/ru.lproj"), - .process("Common/Localization/zh-Hant.lproj"), - .copy("Haptics/"), + .process("Common/Localization/Resources"), + .copy("Haptics"), .copy("Crypto/BIP39/Wordlists/english.txt"), ] ), @@ -60,7 +55,7 @@ let package = Package( ], path: "TangemSdk/TangemSdkTests", resources: [ - .copy("Jsons/"), + .copy("Jsons"), ] ), ] diff --git a/TangemSdk/TangemSdk/Common/Localization/de.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/de.lproj/Localizable.strings similarity index 100% rename from TangemSdk/TangemSdk/Common/Localization/de.lproj/Localizable.strings rename to TangemSdk/TangemSdk/Common/Localization/Resources/de.lproj/Localizable.strings diff --git a/TangemSdk/TangemSdk/Common/Localization/en.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/en.lproj/Localizable.strings similarity index 100% rename from TangemSdk/TangemSdk/Common/Localization/en.lproj/Localizable.strings rename to TangemSdk/TangemSdk/Common/Localization/Resources/en.lproj/Localizable.strings diff --git a/TangemSdk/TangemSdk/Common/Localization/fr.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/fr.lproj/Localizable.strings similarity index 100% rename from TangemSdk/TangemSdk/Common/Localization/fr.lproj/Localizable.strings rename to TangemSdk/TangemSdk/Common/Localization/Resources/fr.lproj/Localizable.strings diff --git a/TangemSdk/TangemSdk/Common/Localization/it.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/it.lproj/Localizable.strings similarity index 100% rename from TangemSdk/TangemSdk/Common/Localization/it.lproj/Localizable.strings rename to TangemSdk/TangemSdk/Common/Localization/Resources/it.lproj/Localizable.strings diff --git a/TangemSdk/TangemSdk/Common/Localization/ru.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/ru.lproj/Localizable.strings similarity index 100% rename from TangemSdk/TangemSdk/Common/Localization/ru.lproj/Localizable.strings rename to TangemSdk/TangemSdk/Common/Localization/Resources/ru.lproj/Localizable.strings diff --git a/TangemSdk/TangemSdk/Common/Localization/zh-Hant.lproj/Localizable.strings b/TangemSdk/TangemSdk/Common/Localization/Resources/zh-Hant.lproj/Localizable.strings similarity index 100% rename from TangemSdk/TangemSdk/Common/Localization/zh-Hant.lproj/Localizable.strings rename to TangemSdk/TangemSdk/Common/Localization/Resources/zh-Hant.lproj/Localizable.strings From 669291bf153f24eba87a4a0fc05e910a9d7f7ed2 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 25 Dec 2023 00:11:00 +0300 Subject: [PATCH 17/19] IOS-5453: Update example project --- Example/TangemSdkExample.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Example/TangemSdkExample.xcodeproj/project.pbxproj b/Example/TangemSdkExample.xcodeproj/project.pbxproj index 49bce29a0..c4d8b9016 100644 --- a/Example/TangemSdkExample.xcodeproj/project.pbxproj +++ b/Example/TangemSdkExample.xcodeproj/project.pbxproj @@ -139,10 +139,10 @@ 5D032008266A8523008472EC /* ExampleButton.swift */, 5DDCEC7425C957930002090D /* UI+.swift */, B00A67B2253D8CAC002D7D53 /* Utils.swift */, - 5D78C1C4234F435C008D7478 /* LaunchScreen.storyboard */, - 5D78C1C2234F435C008D7478 /* Assets.xcassets */, 5D78C1B9234F435B008D7478 /* AppDelegate.swift */, 5D03200D266A85CB008472EC /* ActivityIndicatorView.swift */, + 5D78C1C4234F435C008D7478 /* LaunchScreen.storyboard */, + 5D78C1C2234F435C008D7478 /* Assets.xcassets */, ); path = Common; sourceTree = ""; @@ -185,12 +185,12 @@ 5D78C1B8234F435B008D7478 /* TangemSdkExample */ = { isa = PBXGroup; children = ( + 5D03200C266A8548008472EC /* Common */, 5D2BDF7E26DCE000002F7E19 /* Developer */, 5D032000266A6A15008472EC /* AppModel.swift */, 5D031FFC266A6960008472EC /* ContentView.swift */, - 5D03200C266A8548008472EC /* Common */, - 5D7FE136234F7D6700A1F440 /* TangemSdkExample.entitlements */, 5D1C6C7127214EA900E04A8B /* SettingsView.swift */, + 5D7FE136234F7D6700A1F440 /* TangemSdkExample.entitlements */, ); path = TangemSdkExample; sourceTree = ""; From fb0d4be7096e1b21c43ca39977b4d0c51f628661 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 25 Dec 2023 00:19:24 +0300 Subject: [PATCH 18/19] IOS-5453: Fix compilation error --- TangemSdk/TangemSdk.xcodeproj/project.pbxproj | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj index d647711d4..f53427187 100644 --- a/TangemSdk/TangemSdk.xcodeproj/project.pbxproj +++ b/TangemSdk/TangemSdk.xcodeproj/project.pbxproj @@ -1087,7 +1087,7 @@ 5D6A92D52344E2B400158457 /* Localization */ = { isa = PBXGroup; children = ( - 5D6A92DA2344E2D700158457 /* Localizable.strings */, + B67A9C132B38D79500EE9ED8 /* Resources */, 5D6A92DB2344E3A500158457 /* Localization.swift */, ); path = Localization; @@ -1488,6 +1488,14 @@ path = Deserialization; sourceTree = ""; }; + B67A9C132B38D79500EE9ED8 /* Resources */ = { + isa = PBXGroup; + children = ( + 5D6A92DA2344E2D700158457 /* Localizable.strings */, + ); + path = Resources; + sourceTree = ""; + }; B6CA42212B38B5A700C9A5C9 /* Extensions */ = { isa = PBXGroup; children = ( From fdbe938f7909195051aece02ef86a3ff1086bb18 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Mon, 25 Dec 2023 00:29:53 +0300 Subject: [PATCH 19/19] IOS-5453: Fix some typos and warnings --- .../TangemSdk/Common/Services/Secure/BiometricsStorage.swift | 2 +- TangemSdk/TangemSdk/Common/TLV/Tlv.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TangemSdk/TangemSdk/Common/Services/Secure/BiometricsStorage.swift b/TangemSdk/TangemSdk/Common/Services/Secure/BiometricsStorage.swift index 87bc77172..bb03e7aeb 100644 --- a/TangemSdk/TangemSdk/Common/Services/Secure/BiometricsStorage.swift +++ b/TangemSdk/TangemSdk/Common/Services/Secure/BiometricsStorage.swift @@ -64,7 +64,7 @@ public class BiometricsStorage { Log.debug("BiometricsStorage set - status \(status.message) \(status)") if status == errSecDuplicateItem && overwrite { - var searchQuery: [CFString: Any] = [ + let searchQuery: [CFString: Any] = [ kSecClass: kSecClassGenericPassword, kSecAttrAccount: account, kSecUseDataProtectionKeychain: true, diff --git a/TangemSdk/TangemSdk/Common/TLV/Tlv.swift b/TangemSdk/TangemSdk/Common/TLV/Tlv.swift index 5cd2f9122..2028eefc7 100644 --- a/TangemSdk/TangemSdk/Common/TLV/Tlv.swift +++ b/TangemSdk/TangemSdk/Common/TLV/Tlv.swift @@ -77,13 +77,13 @@ public struct Tlv: Equatable { /// - Parameter dataStream: dataStream initialized with raw tlv private static func readTagLength(_ dataStream: InputStream) -> Int? { guard let shortLengthBytes = dataStream.readByte() else { - Log.error("Failed to read tag lenght") + Log.error("Failed to read tag length") return nil } if (shortLengthBytes == 0xFF) { guard let longLengthBytes = dataStream.readBytes(count: 2) else { - Log.error("Failed to read tag long lenght") + Log.error("Failed to read tag long length") return nil }