From b2f7d6027c7ef8ba7cde28ce32d5c1d7dd800f98 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 17 Feb 2015 13:41:58 -0800 Subject: [PATCH 01/30] more experiments with bisector models (disappointing!) --- dmz | 2 +- icc.xcodeproj/project.pbxproj | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dmz b/dmz index 24541e12..dd5e9182 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit 24541e1264bfd0af53ff4850c013e2270405855d +Subproject commit dd5e9182e0ff0bbdaab187a2768fa79f47c84430 diff --git a/icc.xcodeproj/project.pbxproj b/icc.xcodeproj/project.pbxproj index 1726b44e..433dc3d5 100644 --- a/icc.xcodeproj/project.pbxproj +++ b/icc.xcodeproj/project.pbxproj @@ -534,6 +534,14 @@ 3E013400198ADC7D009E579A /* zh-Hans.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans.strings"; path = "assets/strings/zh-Hans.strings"; sourceTree = SOURCE_ROOT; }; 3E013401198ADC7D009E579A /* zh-Hant_TW.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant_TW.strings"; path = "assets/strings/zh-Hant_TW.strings"; sourceTree = SOURCE_ROOT; }; 3E013402198ADC7D009E579A /* zh-Hant.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant.strings"; path = "assets/strings/zh-Hant.strings"; sourceTree = SOURCE_ROOT; }; + 3E15013C1A8DE927005E72BD /* modelm_b8c71409.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = modelm_b8c71409.cpp; path = bisectors/a/modelm_b8c71409.cpp; sourceTree = ""; }; + 3E15013D1A8DE927005E72BD /* modelm_b8c71409.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = modelm_b8c71409.hpp; path = bisectors/a/modelm_b8c71409.hpp; sourceTree = ""; }; + 3E15013E1A8DE92F005E72BD /* modelm_15a2927a.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = modelm_15a2927a.cpp; path = bisectors/b/modelm_15a2927a.cpp; sourceTree = ""; }; + 3E15013F1A8DE92F005E72BD /* modelm_15a2927a.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = modelm_15a2927a.hpp; path = bisectors/b/modelm_15a2927a.hpp; sourceTree = ""; }; + 3E1501401A8DE939005E72BD /* modelm_16d95fdf.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = modelm_16d95fdf.cpp; path = bisectors/c/modelm_16d95fdf.cpp; sourceTree = ""; }; + 3E1501411A8DE939005E72BD /* modelm_16d95fdf.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = modelm_16d95fdf.hpp; path = bisectors/c/modelm_16d95fdf.hpp; sourceTree = ""; }; + 3E1501421A8DE941005E72BD /* modelm_47b13bb4.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = modelm_47b13bb4.cpp; path = bisectors/d/modelm_47b13bb4.cpp; sourceTree = ""; }; + 3E1501431A8DE941005E72BD /* modelm_47b13bb4.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = modelm_47b13bb4.hpp; path = bisectors/d/modelm_47b13bb4.hpp; sourceTree = ""; }; 3E2449E91A817DB800ECC31C /* modelc_bf4dd6c8.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = modelc_bf4dd6c8.cpp; sourceTree = ""; }; 3E2449EA1A817DB800ECC31C /* modelc_bf4dd6c8.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = modelc_bf4dd6c8.hpp; sourceTree = ""; }; 3E362802173887CB00F8D17F /* scan.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = scan.cpp; sourceTree = ""; }; @@ -1613,6 +1621,14 @@ 3ED9F6D71A23CDBE00BD07F8 /* expiry */ = { isa = PBXGroup; children = ( + 3E1501421A8DE941005E72BD /* modelm_47b13bb4.cpp */, + 3E1501431A8DE941005E72BD /* modelm_47b13bb4.hpp */, + 3E1501401A8DE939005E72BD /* modelm_16d95fdf.cpp */, + 3E1501411A8DE939005E72BD /* modelm_16d95fdf.hpp */, + 3E15013E1A8DE92F005E72BD /* modelm_15a2927a.cpp */, + 3E15013F1A8DE92F005E72BD /* modelm_15a2927a.hpp */, + 3E15013C1A8DE927005E72BD /* modelm_b8c71409.cpp */, + 3E15013D1A8DE927005E72BD /* modelm_b8c71409.hpp */, 3E2449E91A817DB800ECC31C /* modelc_bf4dd6c8.cpp */, 3E2449EA1A817DB800ECC31C /* modelc_bf4dd6c8.hpp */, 3ED9F6DC1A23CDBE00BD07F8 /* modelm_730c4cbd.cpp */, From 299be2c3d6d4accefb8025ae6b7db47992908728 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Wed, 18 Feb 2015 16:48:15 -0800 Subject: [PATCH 02/30] update dmz --- dmz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmz b/dmz index 24541e12..26bcfa1d 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit 24541e1264bfd0af53ff4850c013e2270405855d +Subproject commit 26bcfa1dc233d85b66efd2be78037f61c8245cd5 From 83830e4ef59ad429612dab6314785184eb848dfe Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Mon, 23 Feb 2015 17:59:35 -0800 Subject: [PATCH 03/30] update dmz (prevent random expiry results when !SCAN_EXPIRY) --- dmz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmz b/dmz index 26bcfa1d..47dd740b 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit 26bcfa1dc233d85b66efd2be78037f61c8245cd5 +Subproject commit 47dd740b9266ac22a897c292df68271aafa6b17c From 5e83722d3254794fa3855e01d3a971ebbc325958 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Mon, 23 Feb 2015 18:20:23 -0800 Subject: [PATCH 04/30] 5.0.2: update release notes, podspec --- Release/CardIO.podspec | 2 +- Release/release_notes.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Release/CardIO.podspec b/Release/CardIO.podspec index 3b0f0e66..fe47df1c 100644 --- a/Release/CardIO.podspec +++ b/Release/CardIO.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'CardIO' - spec.version = '5.0.1' + spec.version = '5.0.2' spec.license = { type: 'MIT', file: 'LICENSE.md' } spec.homepage = 'https://www.card.io' spec.authors = { 'CardIO' => 'support@paypal.com' } diff --git a/Release/release_notes.txt b/Release/release_notes.txt index 2f2c1df7..bda1418d 100644 --- a/Release/release_notes.txt +++ b/Release/release_notes.txt @@ -1,6 +1,12 @@ card.io iOS SDK release notes ============================= +5.0.2 (Mon 2/23/2015) + +* Re-enable expiry-scanning for 32-bit devices (e.g., iPhone 4S). + +-- + 5.0.1 (Tue 2/10/2015) * Simplify expiry-scanning code to improve accuracy and also decrease library size a bit. From 1b86e817c2b9ddf8c550bad28fd4f7b70ee2d061 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Thu, 26 Feb 2015 11:14:45 -0800 Subject: [PATCH 05/30] update dmz --- dmz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmz b/dmz index 47dd740b..f2160a05 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit 47dd740b9266ac22a897c292df68271aafa6b17c +Subproject commit f2160a05f5b3f421b85bc28f522cb1448d318da8 From aa76592cfeb9644fb4ce9b2e0cd7eb2b33728147 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Fri, 27 Feb 2015 15:30:21 -0800 Subject: [PATCH 06/30] simplify hseg/vseg-passing from dmz layer --- Classes/CardIOCardScanner.mm | 29 ++++++++++------------------- dmz | 2 +- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Classes/CardIOCardScanner.mm b/Classes/CardIOCardScanner.mm index 09417724..83c98422 100644 --- a/Classes/CardIOCardScanner.mm +++ b/Classes/CardIOCardScanner.mm @@ -24,8 +24,6 @@ @interface CardIOCardScanner () @property(assign, readwrite) ScannerState scannerState; @property(strong, readwrite) CardIOReadCardInfo *cardInfoCache; @property(assign, readwrite) BOOL cardInfoCacheDirty; -@property(strong, readwrite) NSArray *xOffsets; -@property(assign, readwrite) uint16_t yOffset; @property(assign, readwrite) BOOL lastFrameWasUsable; @property(assign, readwrite) BOOL lastFrameWasUpsideDown; @property(assign, readwrite) BOOL scanIsComplete; @@ -67,7 +65,6 @@ - (void)addFrame:(CardIOIplImage *)y } FrameScanResult result; - bool collectCardNumber = (_scannerState.timeOfCardNumberCompletionInMilliseconds == 0); // A little bit of a hack, but we prepopulate focusScore and brightness information result.focus_score = focusScore; @@ -79,20 +76,8 @@ - (void)addFrame:(CardIOIplImage *)y result.flipped = flipped; scanner_add_frame_with_expiry(&_scannerState, y.image, scanExpiry, &result); self.lastFrameWasUsable = result.usable; - if (collectCardNumber) { - if(result.usable) { - NSMutableArray *x = [NSMutableArray arrayWithCapacity:result.hseg.n_offsets]; - for(uint8_t i = 0; i < result.hseg.n_offsets; i++) { - NSNumber *xOffset = [NSNumber numberWithUnsignedShort:result.hseg.offsets[i]]; - [x addObject:xOffset]; - } - self.xOffsets = x; - self.yOffset = result.vseg.y_offset; - } else { - self.lastFrameWasUpsideDown = result.upside_down; - self.xOffsets = nil; - self.yOffset = 0; - } + if(!result.usable) { + self.lastFrameWasUpsideDown = result.upside_down; } [self markCachesDirty]; } @@ -156,9 +141,15 @@ - (CardIOReadCardInfo *)cardInfo { } #endif + NSMutableArray *xOffsets = [NSMutableArray arrayWithCapacity:result.hseg.n_offsets]; + for(uint8_t i = 0; i < result.hseg.n_offsets; i++) { + NSNumber *xOffset = [NSNumber numberWithUnsignedShort:result.hseg.offsets[i]]; + [xOffsets addObject:xOffset]; + } + self.cardInfoCache = [CardIOReadCardInfo cardInfoWithNumber:cardNumber - xOffsets:self.xOffsets - yOffset:self.yOffset + xOffsets:xOffsets + yOffset:result.vseg.y_offset expiryMonth:result.expiry_month expiryYear:result.expiry_year #if CARDIO_DEBUG diff --git a/dmz b/dmz index f2160a05..d4550425 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit f2160a05f5b3f421b85bc28f522cb1448d318da8 +Subproject commit d455042588726ed4bff515b6c88b73fff9066830 From b863b8f023652ebfebbdfeb0fde6ba7f591a7032 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Thu, 12 Mar 2015 14:23:03 -0700 Subject: [PATCH 07/30] update to Xcode 6.2 --- icc.xcodeproj/project.pbxproj | 2 +- icc.xcodeproj/xcshareddata/xcschemes/CardIO.xcscheme | 2 +- icc.xcodeproj/xcshareddata/xcschemes/icc.xcscheme | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/icc.xcodeproj/project.pbxproj b/icc.xcodeproj/project.pbxproj index 1726b44e..0650a53f 100644 --- a/icc.xcodeproj/project.pbxproj +++ b/icc.xcodeproj/project.pbxproj @@ -1764,7 +1764,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 0620; TargetAttributes = { 3E9F4C4A181F07B700F33B48 = { DevelopmentTeam = V8KL7848Q4; diff --git a/icc.xcodeproj/xcshareddata/xcschemes/CardIO.xcscheme b/icc.xcodeproj/xcshareddata/xcschemes/CardIO.xcscheme index dc094b1d..0f156eaa 100644 --- a/icc.xcodeproj/xcshareddata/xcschemes/CardIO.xcscheme +++ b/icc.xcodeproj/xcshareddata/xcschemes/CardIO.xcscheme @@ -1,6 +1,6 @@ - + - + Date: Thu, 12 Mar 2015 16:14:39 -0700 Subject: [PATCH 08/30] eliminate visible stutter on canceling the scan See https://github.com/card-io/card.io-iOS-SDK/issues/97 --- Classes/CardIOViewController.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/CardIOViewController.mm b/Classes/CardIOViewController.mm index c63ce22b..6561c59e 100644 --- a/Classes/CardIOViewController.mm +++ b/Classes/CardIOViewController.mm @@ -457,6 +457,10 @@ - (void)manualEntry:(id)sender { - (void)cancel:(id)sender { [self.context.scanReport reportEventWithLabel:@"scan_cancel" withScanner:self.cardIOView.scanner]; + + // Hiding the CardIOView causes it to call its stopSession method, thus eliminating a visible stutter. + // See https://github.com/card-io/card.io-iOS-SDK/issues/97 + self.cardIOView.hidden = YES; [self.navigationController setNavigationBarHidden:NO animated:YES]; // to restore the color of the status bar! From a41ca935ab001a7540f566c042bb1fcf4267f582 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 17 Mar 2015 13:12:35 -0700 Subject: [PATCH 09/30] reset to default focus range restriction when done Fixes #17 --- Classes/CardIOVideoStream.mm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Classes/CardIOVideoStream.mm b/Classes/CardIOVideoStream.mm index 267d843e..bfd1ad3f 100644 --- a/Classes/CardIOVideoStream.mm +++ b/Classes/CardIOVideoStream.mm @@ -496,6 +496,21 @@ - (void)startSession { - (void)stopSession { if (self.running) { +#if USE_CAMERA + [self changeCameraConfiguration:^{ + // restore default focus range + if ([self.camera respondsToSelector:@selector(isAutoFocusRangeRestrictionSupported)]) { + if(self.camera.autoFocusRangeRestrictionSupported) { + self.camera.autoFocusRangeRestriction = AVCaptureAutoFocusRangeRestrictionNone; + } + } + } + #if CARDIO_DEBUG + withErrorMessage:@"CardIO couldn't lock for configuration within stopSession" + #endif + ]; +#endif + dispatch_semaphore_wait(self.cameraConfigurationSemaphore, DISPATCH_TIME_FOREVER); #if USE_CAMERA From a701ea265fc0d448d20463dcd450e5db74f83100 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 17 Mar 2015 13:24:44 -0700 Subject: [PATCH 10/30] 5.0.3: update release notes, podspec --- Release/CardIO.podspec | 2 +- Release/release_notes.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Release/CardIO.podspec b/Release/CardIO.podspec index fe47df1c..a579cc8d 100644 --- a/Release/CardIO.podspec +++ b/Release/CardIO.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'CardIO' - spec.version = '5.0.2' + spec.version = '5.0.3' spec.license = { type: 'MIT', file: 'LICENSE.md' } spec.homepage = 'https://www.card.io' spec.authors = { 'CardIO' => 'support@paypal.com' } diff --git a/Release/release_notes.txt b/Release/release_notes.txt index bda1418d..85344fd4 100644 --- a/Release/release_notes.txt +++ b/Release/release_notes.txt @@ -1,6 +1,15 @@ card.io iOS SDK release notes ============================= +5.0.3 (Tue 3/17/2015) + +* On scan cancelation, eliminate a visual stutter. + (https://github.com/card-io/card.io-iOS-SDK/issues/97) +* On scan completion, reset camera focus range to nonrestricted. + (https://github.com/card-io/card.io-iOS-source/issues/17) + +-- + 5.0.2 (Mon 2/23/2015) * Re-enable expiry-scanning for 32-bit devices (e.g., iPhone 4S). From 7d373980d0780f7693f89dab31e5dfad2dbbea8d Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Fri, 20 Mar 2015 16:10:07 -0700 Subject: [PATCH 11/30] update dmz --- dmz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmz b/dmz index d4550425..0a283433 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit d455042588726ed4bff515b6c88b73fff9066830 +Subproject commit 0a283433b39c7575ca33781def3dbf1b102999e3 From ceb248ff13aebcf630a9107096c8e3480b659eb6 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Sat, 28 Mar 2015 01:49:33 -0700 Subject: [PATCH 12/30] check video permissions before presenting camera view see https://github.com/card-io/card.io-iOS-SDK/issues/99 --- Classes/CardIOUtilities.m | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Classes/CardIOUtilities.m b/Classes/CardIOUtilities.m index 3c60bd09..8493d9f7 100644 --- a/Classes/CardIOUtilities.m +++ b/Classes/CardIOUtilities.m @@ -8,8 +8,11 @@ #import "CardIOGPUGaussianBlurFilter.h" #import "CardIOIccVersion.h" #import "CardIOLocalizer.h" +#import "CardIOMacros.h" #import "CardIOView.h" +#import + @implementation CardIOUtilities #pragma mark - Library version, for bug reporting etc. @@ -70,6 +73,30 @@ + (BOOL)canReadCardWithCamera { cachedScanAvailabilityStatus = ScanAvailabilityNever; return NO; } + + if (iOS_7_PLUS) { + // Check for video permission. + // But don't set cachedScanAvailabilityStatus here, as the user can change this permission at any time. + // (Actually, should the user go to Settings and change this permission for this app, apparently the system + // will immediately SIGKILL (force restart) this app. But let's not depend on this semi-documented behavior.) + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; + if (authStatus == AVAuthorizationStatusDenied || authStatus == AVAuthorizationStatusRestricted){ + return NO; + } + else { + // Either the user has already granted permission, or else the user has not yet been asked. + // + // For the latter case, while we could ask now, unfortunately the necessary + // [AVCaptureDevice requestAccessForMediaType:completionHandler:] method returns the user's choice + // to us asynchronously, which doesn't mix well with canReadCardWithCamera being synchronous. + // + // Rather than making a backward-incompatible change to canReadCardWithCamera, let's simply allow things + // to proceed. When the camera view is finally presented, then the user will be prompted to authorize + // or deny the video permission. If they choose "deny", then they'll probably understand why they're + // looking at a black screen. + return YES; + } + } #endif cachedScanAvailabilityStatus = ScanAvailabilityAlways; From 206dfc338512d0394ae2f0189a04dae3350699cd Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 7 Apr 2015 15:34:24 -0700 Subject: [PATCH 13/30] add compiler flag to theoretically improve performance --- icc.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icc.xcodeproj/project.pbxproj b/icc.xcodeproj/project.pbxproj index 0650a53f..3bd37320 100644 --- a/icc.xcodeproj/project.pbxproj +++ b/icc.xcodeproj/project.pbxproj @@ -41,7 +41,7 @@ 3E9F4BFA181F03F300F33B48 /* CardIOMacros.m in Sources */ = {isa = PBXBuildFile; fileRef = 0393B0B5143A625300A65A00 /* CardIOMacros.m */; }; 3E9F4BFC181F03F300F33B48 /* CardIOTransitionView.m in Sources */ = {isa = PBXBuildFile; fileRef = D1F66D67146456880001F15F /* CardIOTransitionView.m */; }; 3E9F4BFE181F03F300F33B48 /* CardIOCardScanner.mm in Sources */ = {isa = PBXBuildFile; fileRef = 03C8E03C1570272F00569A22 /* CardIOCardScanner.mm */; }; - 3E9F4C00181F03F300F33B48 /* dmz_all.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0378AE18158C01CA00545AAA /* dmz_all.cpp */; settings = {COMPILER_FLAGS = "-O3"; }; }; + 3E9F4C00181F03F300F33B48 /* dmz_all.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0378AE18158C01CA00545AAA /* dmz_all.cpp */; settings = {COMPILER_FLAGS = "-O3 -fslp-vectorize-aggressive"; }; }; 3E9F4C01181F03F300F33B48 /* CardIOAnalytics.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8487783115A39BCB00B08B41 /* CardIOAnalytics.mm */; }; 3E9F4C02181F03F300F33B48 /* mz_ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84979985159E5E0500527FF5 /* mz_ios.mm */; }; 3E9F4C03181F03F300F33B48 /* CardIOGPUFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 8497998C159E5E3C00527FF5 /* CardIOGPUFilter.m */; }; From 5e095d72c09022714dc1679d1eb5d2ca6f44aee9 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 14 Apr 2015 15:26:53 -0700 Subject: [PATCH 14/30] update to latest dmz --- dmz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmz b/dmz index 0a283433..76003549 160000 --- a/dmz +++ b/dmz @@ -1 +1 @@ -Subproject commit 0a283433b39c7575ca33781def3dbf1b102999e3 +Subproject commit 76003549e46a48c3cd4d9213a1cc864f5ad8b481 From 16c854af03983be50abbde4c80e5565f70e0a13e Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 14 Apr 2015 15:39:41 -0700 Subject: [PATCH 15/30] format incoming expiry strings a teensy bit more robustly --- Classes/CardIOCreditCardExpiryFormatter.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/CardIOCreditCardExpiryFormatter.m b/Classes/CardIOCreditCardExpiryFormatter.m index 1efc205a..a5798399 100644 --- a/Classes/CardIOCreditCardExpiryFormatter.m +++ b/Classes/CardIOCreditCardExpiryFormatter.m @@ -5,6 +5,7 @@ #import "CardIOCreditCardExpiryFormatter.h" #import "CardIOCreditCardInfo.h" +#import "CardIOCreditCardNumber.h" @implementation CardIOCreditCardExpiryFormatter @@ -16,12 +17,12 @@ - (BOOL)getObjectValue:(id __autoreleasing *)obj forString:(NSString *)string er NSInteger year = 0; if (values.count > 0) { - month = [[values[0] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] integerValue]; + month = [[CardIOCreditCardNumber stringByRemovingNonNumbers:values[0]] integerValue]; } if (values.count > 1) { - year = [[values[1] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] integerValue]; + year = [[CardIOCreditCardNumber stringByRemovingNonNumbers:values[1]] integerValue]; if (year < 2000) { - year += 2000; + year = 2000 + (year % 100); } } From ff60f081355715dbf88ad36a874b1defbf275c91 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 14 Apr 2015 15:40:27 -0700 Subject: [PATCH 16/30] restrict expiry year manual input to 2 digits --- Classes/CardIOExpiryTextFieldDelegate.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/CardIOExpiryTextFieldDelegate.m b/Classes/CardIOExpiryTextFieldDelegate.m index 9bfd2639..fda91e9f 100644 --- a/Classes/CardIOExpiryTextFieldDelegate.m +++ b/Classes/CardIOExpiryTextFieldDelegate.m @@ -94,7 +94,8 @@ - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRang NSString *numericNewText = [CardIOCreditCardNumber stringByRemovingNonNumbers:newText]; NSString *updatedText = [textField.text stringByReplacingCharactersInRange:range withString:numericNewText]; - if(updatedText.length > 9) { + if(updatedText.length > 7) { + // 7 characters: "MM_/_YY" [CardIOConfigurableTextFieldDelegate vibrate]; return NO; } @@ -104,7 +105,7 @@ - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRang NSString *monthStr = [updatedNumberText substringToIndex:MIN(2, updatedNumberText.length)]; if(monthStr.length > 0) { NSInteger month = [monthStr integerValue]; - if(month < 0 || 12 < month) { + if(month < 0 || month > 12) { [CardIOConfigurableTextFieldDelegate vibrate]; return NO; } From 1cf602cece55475460653172ff8ab42562b01d81 Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 14 Apr 2015 16:28:27 -0700 Subject: [PATCH 17/30] 5.0.4: update release notes, podspec --- Release/CardIO.podspec | 2 +- Release/release_notes.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Release/CardIO.podspec b/Release/CardIO.podspec index a579cc8d..2a3d3c79 100644 --- a/Release/CardIO.podspec +++ b/Release/CardIO.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'CardIO' - spec.version = '5.0.3' + spec.version = '5.0.4' spec.license = { type: 'MIT', file: 'LICENSE.md' } spec.homepage = 'https://www.card.io' spec.authors = { 'CardIO' => 'support@paypal.com' } diff --git a/Release/release_notes.txt b/Release/release_notes.txt index 85344fd4..045be279 100644 --- a/Release/release_notes.txt +++ b/Release/release_notes.txt @@ -1,6 +1,15 @@ card.io iOS SDK release notes ============================= +5.0.4 (Tue 4/14/2015) + +* Check existing video permissions before presenting camera view. + (https://github.com/card-io/card.io-iOS-SDK/issues/99) +* Restrict expiry year manual input to 2 digits in all cases. + (https://github.com/card-io/card.io-iOS-SDK/issues/104) + +-- + 5.0.3 (Tue 3/17/2015) * On scan cancelation, eliminate a visual stutter. From af3f64eb7435f8aadd5d111d2d7b9d5add47a82a Mon Sep 17 00:00:00 2001 From: Dave Goldman Date: Tue, 14 Apr 2015 17:22:50 -0700 Subject: [PATCH 18/30] tweak storyboard for Swift sample app --- .../Base.lproj/Main.storyboard | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Release/SampleApp-Swift/SampleApp-Swift/Base.lproj/Main.storyboard b/Release/SampleApp-Swift/SampleApp-Swift/Base.lproj/Main.storyboard index 5966c55d..345e16db 100644 --- a/Release/SampleApp-Swift/SampleApp-Swift/Base.lproj/Main.storyboard +++ b/Release/SampleApp-Swift/SampleApp-Swift/Base.lproj/Main.storyboard @@ -1,7 +1,7 @@ - + - + @@ -23,11 +23,11 @@ - + -