From e0a3cccbb824cc84beed52e8193a2849338dfa3d Mon Sep 17 00:00:00 2001 From: Zouhair Mahieddine Date: Wed, 15 Jan 2014 11:18:16 +0100 Subject: [PATCH 01/11] MAC Address MD5 Tracking switch method added for security reasons --- AdjustIo/AIActivityHandler.h | 1 + AdjustIo/AIActivityHandler.m | 4 +++- AdjustIo/AdjustIo.h | 9 +++++++++ AdjustIo/AdjustIo.m | 9 +++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/AdjustIo/AIActivityHandler.h b/AdjustIo/AIActivityHandler.h index 0de2f7a40..6dc79522d 100644 --- a/AdjustIo/AIActivityHandler.h +++ b/AdjustIo/AIActivityHandler.h @@ -12,6 +12,7 @@ @property (nonatomic, copy) NSString *environment; @property (nonatomic, assign) BOOL bufferEvents; +@property (nonatomic, assign) BOOL macAddressMd5TrackingEnabled; + (AIActivityHandler *)handlerWithAppToken:(NSString *)appToken; - (id)initWithAppToken:(NSString *)appToken; diff --git a/AdjustIo/AIActivityHandler.m b/AdjustIo/AIActivityHandler.m index 2441cede6..5faa10da4 100644 --- a/AdjustIo/AIActivityHandler.m +++ b/AdjustIo/AIActivityHandler.m @@ -330,7 +330,9 @@ - (void)injectGeneralAttributes:(AIPackageBuilder *)builder { builder.userAgent = self.userAgent; builder.clientSdk = self.clientSdk; builder.appToken = self.appToken; - builder.macShortMd5 = self.macShortMd5; + if (self.macAddressMd5TrackingEnabled) { + builder.macShortMd5 = self.macShortMd5; + } builder.macSha1 = self.macSha1; builder.trackingEnabled = self.trackingEnabled; builder.idForAdvertisers = self.idForAdvertisers; diff --git a/AdjustIo/AdjustIo.h b/AdjustIo/AdjustIo.h index b8f8dbd57..aa840ebc4 100644 --- a/AdjustIo/AdjustIo.h +++ b/AdjustIo/AdjustIo.h @@ -107,4 +107,13 @@ static NSString * const AIEnvironmentProduction = @"production"; // Special method used by SDK wrappers such as Adobe Air SDK. + (void)setSdkPrefix:(NSString *)sdkPrefix __attribute__((deprecated)); +/** + * Enable or disable MAC Address tracking as MD5 + * + * For security reasons, it might be useful for you to deactivate MD5 Tracking. + * The MD5 is only used for devices that are still using iOS 6 first version + * to overcome an issue with the hard-coded IDFA. + */ ++ (void)setMacAddressMd5TrackingEnabled:(BOOL)enabled; + @end diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 6351e6cf2..279b46b24 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -80,5 +80,14 @@ + (void)setEventBufferingEnabled:(BOOL)enabled { + (void)setLogLevel:(AILogLevel)logLevel { [AILogger setLogLevel:logLevel]; } ++ (void)setMacAddressMd5TrackingEnabled:(BOOL)enabled { + if (activityHandler == nil) { + [AILogger error:@"Please call `setMacAddressMd5TrackingEnabled` after `appDidLaunch`!"]; + return; + } + + activityHandler.macAddressMd5TrackingEnabled = enabled; + [AILogger info:[NSString stringWithFormat:@"Event buffering is %@", enabled?@"enabled" :@"disabled"]]; +} @end From 1bbd6ced9affa91b4f5813711c25ba3ad3938e4a Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 13:43:41 +0100 Subject: [PATCH 02/11] Rename setMac{Address,}Md5TrackingEnabled: --- AdjustIo/AdjustIo.h | 2 +- AdjustIo/AdjustIo.m | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AdjustIo/AdjustIo.h b/AdjustIo/AdjustIo.h index aa840ebc4..3f15f7e0a 100644 --- a/AdjustIo/AdjustIo.h +++ b/AdjustIo/AdjustIo.h @@ -114,6 +114,6 @@ static NSString * const AIEnvironmentProduction = @"production"; * The MD5 is only used for devices that are still using iOS 6 first version * to overcome an issue with the hard-coded IDFA. */ -+ (void)setMacAddressMd5TrackingEnabled:(BOOL)enabled; ++ (void)setMacMd5TrackingEnabled:(BOOL)enabled; @end diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 279b46b24..3c979394c 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -80,9 +80,10 @@ + (void)setEventBufferingEnabled:(BOOL)enabled { + (void)setLogLevel:(AILogLevel)logLevel { [AILogger setLogLevel:logLevel]; } -+ (void)setMacAddressMd5TrackingEnabled:(BOOL)enabled { + ++ (void)setMacMd5TrackingEnabled:(BOOL)enabled { if (activityHandler == nil) { - [AILogger error:@"Please call `setMacAddressMd5TrackingEnabled` after `appDidLaunch`!"]; + [AILogger error:@"Please call `setMacMd5TrackingEnabled` after `appDidLaunch`!"]; return; } From c78b6f87fd97c5b43db355df778199bb2e4f766a Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 13:45:42 +0100 Subject: [PATCH 03/11] Reorder methods in public interface --- AdjustIo/AdjustIo.h | 40 ++++++++++++++++++++-------------------- AdjustIo/AdjustIo.m | 8 ++++---- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/AdjustIo/AdjustIo.h b/AdjustIo/AdjustIo.h index 3f15f7e0a..c86bfb095 100644 --- a/AdjustIo/AdjustIo.h +++ b/AdjustIo/AdjustIo.h @@ -67,6 +67,23 @@ static NSString * const AIEnvironmentProduction = @"production"; + (void)trackRevenue:(double)amountInCents forEvent:(NSString *)eventToken; + (void)trackRevenue:(double)amountInCents forEvent:(NSString *)eventToken withParameters:(NSDictionary *)parameters; +/** + * Change the verbosity of AdjustIo's logs. + * + * You can increase or reduce the amount of logs from AdjustIo by passing + * one of the following parameters. Use Log.ASSERT to disable all logging. + * + * @param logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - AILogLevelVerbose (enable all logging) + * - AILogLevelDebug (enable more logging) + * - AILogLevelInfo (the default) + * - AILogLevelWarn (disable info logging) + * - AILogLevelError (disable warnings as well) + * - AILogLevelAssert (disable errors as well) + */ ++ (void)setLogLevel:(AILogLevel)logLevel; + /** * Set the tracking environment to sandbox or production. * @@ -87,26 +104,6 @@ static NSString * const AIEnvironmentProduction = @"production"; */ + (void)setEventBufferingEnabled:(BOOL)enabled; -/** - * Change the verbosity of AdjustIo's logs. - * - * You can increase or reduce the amount of logs from AdjustIo by passing - * one of the following parameters. Use Log.ASSERT to disable all logging. - * - * @param logLevel The desired minimum log level (default: info) - * Must be one of the following: - * - AILogLevelVerbose (enable all logging) - * - AILogLevelDebug (enable more logging) - * - AILogLevelInfo (the default) - * - AILogLevelWarn (disable info logging) - * - AILogLevelError (disable warnings as well) - * - AILogLevelAssert (disable errors as well) - */ -+ (void)setLogLevel:(AILogLevel)logLevel; - -// Special method used by SDK wrappers such as Adobe Air SDK. -+ (void)setSdkPrefix:(NSString *)sdkPrefix __attribute__((deprecated)); - /** * Enable or disable MAC Address tracking as MD5 * @@ -116,4 +113,7 @@ static NSString * const AIEnvironmentProduction = @"production"; */ + (void)setMacMd5TrackingEnabled:(BOOL)enabled; +// Special method used by SDK wrappers such as Adobe Air SDK. ++ (void)setSdkPrefix:(NSString *)sdkPrefix __attribute__((deprecated)); + @end diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 3c979394c..3d8ac6a03 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -51,6 +51,10 @@ + (void)trackRevenue:(double)amountInCents [activityHandler trackRevenue:amountInCents forEvent:eventToken withParameters:parameters]; } ++ (void)setLogLevel:(AILogLevel)logLevel { + [AILogger setLogLevel:logLevel]; +} + + (void)setEnvironment:(NSString *)environment { if (activityHandler == nil) { [AILogger error:@"Please call `setEnvironment` after `appDidLaunch`!"]; @@ -77,10 +81,6 @@ + (void)setEventBufferingEnabled:(BOOL)enabled { if (enabled) [AILogger info:@"Event buffering is enabled"]; } -+ (void)setLogLevel:(AILogLevel)logLevel { - [AILogger setLogLevel:logLevel]; -} - + (void)setMacMd5TrackingEnabled:(BOOL)enabled { if (activityHandler == nil) { [AILogger error:@"Please call `setMacMd5TrackingEnabled` after `appDidLaunch`!"]; From 51afa7a0a989a4d000d1f71c71e019499a394961 Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 13:47:35 +0100 Subject: [PATCH 04/11] Remove trailing whitespace --- AdjustIo/AdjustIo.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 3d8ac6a03..163e72805 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -86,7 +86,7 @@ + (void)setMacMd5TrackingEnabled:(BOOL)enabled { [AILogger error:@"Please call `setMacMd5TrackingEnabled` after `appDidLaunch`!"]; return; } - + activityHandler.macAddressMd5TrackingEnabled = enabled; [AILogger info:[NSString stringWithFormat:@"Event buffering is %@", enabled?@"enabled" :@"disabled"]]; } From c527886673fb21a475449a3d26df79cfda152985 Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 13:53:01 +0100 Subject: [PATCH 05/11] Rename AIActivityHandler.{macAddressMd5TrackingEnabled,trackMacMd5} --- AdjustIo/AIActivityHandler.h | 2 +- AdjustIo/AIActivityHandler.m | 2 +- AdjustIo/AdjustIo.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AdjustIo/AIActivityHandler.h b/AdjustIo/AIActivityHandler.h index 6dc79522d..ea53ea96b 100644 --- a/AdjustIo/AIActivityHandler.h +++ b/AdjustIo/AIActivityHandler.h @@ -12,7 +12,7 @@ @property (nonatomic, copy) NSString *environment; @property (nonatomic, assign) BOOL bufferEvents; -@property (nonatomic, assign) BOOL macAddressMd5TrackingEnabled; +@property (nonatomic, assign) BOOL trackMacMd5; + (AIActivityHandler *)handlerWithAppToken:(NSString *)appToken; - (id)initWithAppToken:(NSString *)appToken; diff --git a/AdjustIo/AIActivityHandler.m b/AdjustIo/AIActivityHandler.m index 5faa10da4..7c36babff 100644 --- a/AdjustIo/AIActivityHandler.m +++ b/AdjustIo/AIActivityHandler.m @@ -330,7 +330,7 @@ - (void)injectGeneralAttributes:(AIPackageBuilder *)builder { builder.userAgent = self.userAgent; builder.clientSdk = self.clientSdk; builder.appToken = self.appToken; - if (self.macAddressMd5TrackingEnabled) { + if (self.trackMacMd5) { builder.macShortMd5 = self.macShortMd5; } builder.macSha1 = self.macSha1; diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 163e72805..776cd1247 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -87,7 +87,7 @@ + (void)setMacMd5TrackingEnabled:(BOOL)enabled { return; } - activityHandler.macAddressMd5TrackingEnabled = enabled; + activityHandler.trackMacMd5 = enabled; [AILogger info:[NSString stringWithFormat:@"Event buffering is %@", enabled?@"enabled" :@"disabled"]]; } From 5155a90b0b929f990e0b104b8e7b5dc65bf086a9 Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 13:57:40 +0100 Subject: [PATCH 06/11] Fix logging about macMd5 tracking --- AdjustIo/AdjustIo.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 776cd1247..41d3a1d88 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -88,7 +88,7 @@ + (void)setMacMd5TrackingEnabled:(BOOL)enabled { } activityHandler.trackMacMd5 = enabled; - [AILogger info:[NSString stringWithFormat:@"Event buffering is %@", enabled?@"enabled" :@"disabled"]]; + [AILogger info:[NSString stringWithFormat:@"Tracking of macMd5 is %@", enabled?@"enabled" :@"disabled"]]; } @end From 830a87117d755c4c49f128ced91937397daa8a5a Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 14:00:48 +0100 Subject: [PATCH 07/11] Remove unnecessary NSString.stringWithFormat --- AdjustIo/AdjustIo.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 41d3a1d88..9799e0d73 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -88,7 +88,7 @@ + (void)setMacMd5TrackingEnabled:(BOOL)enabled { } activityHandler.trackMacMd5 = enabled; - [AILogger info:[NSString stringWithFormat:@"Tracking of macMd5 is %@", enabled?@"enabled" :@"disabled"]]; + [AILogger info:@"Tracking of macMd5 is %@", enabled ? @"enabled" : @"disabled"]; } @end From a01346ca0f588927a6464c5914d015063f56bed9 Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 14:05:42 +0100 Subject: [PATCH 08/11] Add default value trackMacMd5=YES --- AdjustIo/AIActivityHandler.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AdjustIo/AIActivityHandler.m b/AdjustIo/AIActivityHandler.m index 7c36babff..43137e7a2 100644 --- a/AdjustIo/AIActivityHandler.m +++ b/AdjustIo/AIActivityHandler.m @@ -59,9 +59,12 @@ - (id)initWithAppToken:(NSString *)yourAppToken { [self addNotificationObserver]; self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); - self.environment = @"unknown"; // default value self.clientSdk = AIUtil.clientSdk; + // default values + self.environment = @"unknown"; + self.trackMacMd5 = YES; + dispatch_async(self.internalQueue, ^{ [self initInternal:yourAppToken]; }); From 4044db6f6997c7a3b965093bc32f5243ea76e7b1 Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 14:10:19 +0100 Subject: [PATCH 09/11] Move conditional parts to the end of AIActivityHandler.injectGeneralAttributes --- AdjustIo/AIActivityHandler.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AdjustIo/AIActivityHandler.m b/AdjustIo/AIActivityHandler.m index 43137e7a2..0701a2726 100644 --- a/AdjustIo/AIActivityHandler.m +++ b/AdjustIo/AIActivityHandler.m @@ -333,14 +333,15 @@ - (void)injectGeneralAttributes:(AIPackageBuilder *)builder { builder.userAgent = self.userAgent; builder.clientSdk = self.clientSdk; builder.appToken = self.appToken; - if (self.trackMacMd5) { - builder.macShortMd5 = self.macShortMd5; - } builder.macSha1 = self.macSha1; builder.trackingEnabled = self.trackingEnabled; builder.idForAdvertisers = self.idForAdvertisers; builder.fbAttributionId = self.fbAttributionId; builder.environment = self.environment; + + if (self.trackMacMd5) { + builder.macShortMd5 = self.macShortMd5; + } } # pragma mark - timer From 56b9ba72a216ae21ef3bf1c689ee4bbf2ca27d1b Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 14:20:53 +0100 Subject: [PATCH 10/11] Shorten the comment explaining the new method to disable macMd5 tracking --- AdjustIo/AdjustIo.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/AdjustIo/AdjustIo.h b/AdjustIo/AdjustIo.h index c86bfb095..e241f0dd4 100644 --- a/AdjustIo/AdjustIo.h +++ b/AdjustIo/AdjustIo.h @@ -105,11 +105,9 @@ static NSString * const AIEnvironmentProduction = @"production"; + (void)setEventBufferingEnabled:(BOOL)enabled; /** - * Enable or disable MAC Address tracking as MD5 + * Enable or disable tracking of the MD5 hash of the MAC address * - * For security reasons, it might be useful for you to deactivate MD5 Tracking. - * The MD5 is only used for devices that are still using iOS 6 first version - * to overcome an issue with the hard-coded IDFA. + * Disable macMd5 tracking if your privacy constraints require it. */ + (void)setMacMd5TrackingEnabled:(BOOL)enabled; From 5248a5a2a120271657b8f875806e1f8885197d55 Mon Sep 17 00:00:00 2001 From: Christian Wellenbrock Date: Wed, 15 Jan 2014 14:31:09 +0100 Subject: [PATCH 11/11] Update version to 2.1.4 --- AdjustIO.podspec | 4 ++-- AdjustIo/AIUtil.m | 2 +- README.md | 2 +- VERSION | 2 +- doc/migration.md | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AdjustIO.podspec b/AdjustIO.podspec index e0fac1844..957351d91 100644 --- a/AdjustIO.podspec +++ b/AdjustIO.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "AdjustIO" - s.version = "2.1.3" + s.version = "2.1.4" s.summary = "This is the iOS SDK of AdjustIo. You can read more about it at http://adjust.io." s.homepage = "http://adjust.io" s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } s.author = { "Christian Wellenbrock" => "welle@adeven.com" } - s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v2.1.3" } + s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v2.1.4" } s.platform = :ios, '4.3' s.framework = 'AdSupport', 'SystemConfiguration' s.source_files = 'AdjustIo/*.{h,m}', 'AdjustIo/AIAdditions/*.{h,m}' diff --git a/AdjustIo/AIUtil.m b/AdjustIo/AIUtil.m index b06e391a8..34e8451e9 100644 --- a/AdjustIo/AIUtil.m +++ b/AdjustIo/AIUtil.m @@ -13,7 +13,7 @@ #include static NSString * const kBaseUrl = @"https://app.adjust.io"; -static NSString * const kClientSdk = @"ios2.1.3"; +static NSString * const kClientSdk = @"ios2.1.4"; #pragma mark - diff --git a/README.md b/README.md index 39be052fb..7f2ded24c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue with [step 3](#step3): ```ruby -pod 'AdjustIO', :git => 'git://github.com/adeven/adjust_ios_sdk.git', :tag => 'v2.1.3' +pod 'AdjustIO', :git => 'git://github.com/adeven/adjust_ios_sdk.git', :tag => 'v2.1.4' ``` ### 1. Get the SDK diff --git a/VERSION b/VERSION index ac2cdeba0..7d2ed7c70 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.3 +2.1.4 diff --git a/doc/migration.md b/doc/migration.md index 85805f0f3..8d908635f 100644 --- a/doc/migration.md +++ b/doc/migration.md @@ -1,7 +1,7 @@ -## Migrate your AdjustIo SDK for iOS from v1.x to v2.1.3 +## Migrate your AdjustIo SDK for iOS from v1.x to v2.1.4 1. Delete the old `AdjustIo` source folder from your Xcode project. Download - version v2.1.3 and drag the new folder into your Xcode project. + version v2.1.4 and drag the new folder into your Xcode project. ![][drag] @@ -55,7 +55,7 @@ 2. The `appDidLaunch` method now expects your App Token instead of your App ID. You can find your App Token in your [dashboard]. -2. The AdjustIo SDK for iOS 2.1.3 uses [ARC][arc]. If you haven't done already, +2. The AdjustIo SDK for iOS 2.1.4 uses [ARC][arc]. If you haven't done already, we recommend [transitioning your project to use ARC][transition] as well. If you don't want to use ARC, you have to enable ARC for all files of the AdjustIo SDK. Please consult the [README] for details.