Skip to content

Commit 586f57d

Browse files
authored
Merge pull request #21 from adjust/v4116
Version 4.11.6
2 parents 7b55090 + 6f75d94 commit 586f57d

19 files changed

+99
-277
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ build/
9090
.jira-url
9191
atlassian-ide-plugin.xml
9292

93+
# node 5
94+
package-lock.json
95+
9396
# exceptions
9497
!*adjust-android.jar
9598
!android/libs/adjust*.jar

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### Version 4.11.6 (28th September 2017)
2+
#### Added
3+
- **[iOS]** Improved iOS 11 support.
4+
5+
#### Changed
6+
- **[iOS]** Removed iOS connection validity checks.
7+
- **[iOS]** Updated native iOS SDK to version **4.11.5**.
8+
9+
#### Native SDKs
10+
- **[iOS]** [[email protected]][ios_sdk_v4.11.5]
11+
- **[AND]** [[email protected]][android_sdk_v4.11.4]
12+
13+
---
14+
115
### Version 4.11.5 (22nd August 2017)
216
#### Added
317
- **[iOS]** Added `Podspec` file for Cocoapods support (thanks to @pietropizzi, @tecbot and @dan-manges).
@@ -118,6 +132,7 @@
118132
[ios_sdk_v4.11.0]: https://github.com/adjust/ios_sdk/tree/v4.11.0
119133
[ios_sdk_v4.11.3]: https://github.com/adjust/ios_sdk/tree/v4.11.3
120134
[ios_sdk_v4.11.4]: https://github.com/adjust/ios_sdk/tree/v4.11.4
135+
[ios_sdk_v4.11.5]: https://github.com/adjust/ios_sdk/tree/v4.11.5
121136

122137
[android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4
123138
[android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.11.5
1+
4.11.6

example/ios/Example.xcodeproj/project.pbxproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@
511511
832341AE1AAA6A7D00B99B32 /* Libraries */,
512512
00E356EF1AD99517003FC87E /* exampleTests */,
513513
83CBBA001A601CBA00E9B192 /* Products */,
514+
9DDA88861F7A61A200C66612 /* Recovered References */,
514515
);
515516
indentWidth = 2;
516517
sourceTree = "<group>";
@@ -527,6 +528,14 @@
527528
name = Products;
528529
sourceTree = "<group>";
529530
};
531+
9DDA88861F7A61A200C66612 /* Recovered References */ = {
532+
isa = PBXGroup;
533+
children = (
534+
BFC922DBF74D4E2EB5C22FAE /* libAdjustSdk.a */,
535+
);
536+
name = "Recovered References";
537+
sourceTree = "<group>";
538+
};
530539
9DEF02161F33221100B0FA1B /* Products */ = {
531540
isa = PBXGroup;
532541
children = (

ext/iOS/sdk

Submodule sdk updated 39 files

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var AdjustConfig = function(appToken, environment) {
111111
this.appToken = appToken;
112112
this.environment = environment;
113113

114-
this.sdkPrefix = "react_native4.11.5";
114+
this.sdkPrefix = "react_native4.11.6";
115115
this.logLevel = null;
116116

117117
this.eventBufferingEnabled = null;

ios/Adjust/ADJActivityState.m

Lines changed: 27 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -82,35 +82,40 @@ - (BOOL)findTransactionId:(NSString *)transactionId {
8282
#pragma mark - Private & helper methods
8383

8484
- (void)assignUuid:(NSString *)uuid {
85-
// First check if there's any UUID written in keychain.
86-
// If yes, use keychain value and flag it.
87-
// If not, use given UUID and store it to keychain.
88-
// If successfully written, flag it.
89-
// If writing failed, don't flat it.
90-
// Small addition as of iOS 10.3:
91-
// Keychain needs to be written in different way in order to persist value between (un)installs.
92-
93-
// Check if device supports new writing method.
94-
// kSecAttrAccessGroupToken available since iOS 10.0.
95-
if (NULL == &kSecAttrAccessGroupToken) {
96-
// This device's iOS version doesn't support new writing method.
97-
[self assignUuidOldMethod:uuid];
98-
return;
99-
} else {
100-
// This device's iOS version supports new writing method.
101-
[self assignUuidNewMethod:uuid];
102-
return;
85+
// 1. Check if UUID is written to keychain in v2 way.
86+
// 1.1 If yes, take stored UUID and send it to v1 check.
87+
// 1.2 If not, take given UUID and send it to v1 check.
88+
// v1 check:
89+
// 2.1 If given UUID is found in v1 way, use it.
90+
// 2.2 If given UUID is not found in v1 way, write it in v1 way and use it.
91+
92+
// First check if we have the key written with app's unique key name.
93+
NSString *uniqueKey = [self generateUniqueKey];
94+
NSString *persistedUuidUnique = [ADJKeychain valueForKeychainKeyV2:uniqueKey service:@"deviceInfo"];
95+
96+
if (persistedUuidUnique != nil) {
97+
// Check if value has UUID format.
98+
if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuidUnique]) {
99+
[[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain v2 way"];
100+
101+
// If we read the key with v2 way, write it back in v1 way since in iOS 11, that's the only one that it works.
102+
[self assignUuidOldMethod:persistedUuidUnique];
103+
}
103104
}
105+
106+
// At this point, UUID was not persisted in v2 way or if persisted, didn't have proper UUID format.
107+
// Try the v1 way with given UUID.
108+
[self assignUuidOldMethod:uuid];
104109
}
105110

106111
- (void)assignUuidOldMethod:(NSString *)uuid {
107-
NSString *persistedUuid = [ADJKeychain valueForKeychainKeyOld:@"adjust_persisted_uuid" service:@"deviceInfo"];
112+
NSString *persistedUuid = [ADJKeychain valueForKeychainKeyV1:@"adjust_persisted_uuid" service:@"deviceInfo"];
108113

109114
// Check if value exists in keychain.
110115
if (persistedUuid != nil) {
111116
// Check if value has UUID format.
112117
if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuid]) {
113-
[[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain old way"];
118+
[[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain v1 way"];
114119

115120
// Value written in keychain seems to have UUID format.
116121
self.uuid = persistedUuid;
@@ -120,10 +125,10 @@ - (void)assignUuidOldMethod:(NSString *)uuid {
120125
}
121126
}
122127

123-
// At this point, UUID was not persisted or if persisted, didn't have proper UUID format.
128+
// At this point, UUID was not persisted in v1 way or if persisted, didn't have proper UUID format.
124129

125130
// Since we don't have anything in the keychain, we'll use the passed UUID value.
126-
// Try to save that value to the keychain and flag if successfully written.
131+
// Try to save that value to the keychain in v1 way and flag if successfully written.
127132
self.uuid = uuid;
128133
self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:@"adjust_persisted_uuid" inService:@"deviceInfo"];
129134
}
@@ -144,49 +149,6 @@ - (NSString *)generateUniqueKey {
144149
return [joinedKey adjSha1];
145150
}
146151

147-
- (void)assignUuidNewMethod:(NSString *)uuid {
148-
// First check if we have the key written with app's unique key name.
149-
NSString *uniqueKey = [self generateUniqueKey];
150-
NSString *persistedUuidUnique = [ADJKeychain valueForKeychainKeyNew:uniqueKey service:@"deviceInfo"];
151-
152-
if (persistedUuidUnique != nil) {
153-
// Check if value has UUID format.
154-
if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuidUnique]) {
155-
[[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain new way"];
156-
157-
// Value written in keychain seems to have UUID format.
158-
self.uuid = persistedUuidUnique;
159-
self.isPersisted = YES;
160-
161-
return;
162-
}
163-
}
164-
165-
// At this point, UUID was not persisted with unique key or if persisted, didn't have proper UUID format.
166-
167-
// Check if it's still saved in the keychain with old writing method.
168-
NSString *persistedUuidOld = [ADJKeychain valueForKeychainKeyOld:@"adjust_persisted_uuid" service:@"deviceInfo"];
169-
170-
if (persistedUuidOld != nil) {
171-
// Check if value has UUID format.
172-
if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuidOld]) {
173-
[[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain old way"];
174-
175-
// Since we have the value in the keychain written with old method, we'll use it to save it with new one.
176-
self.uuid = persistedUuidOld;
177-
} else {
178-
// Since found value in the keychain doesn't have propper UUID format, we'll use passed UUID value.
179-
self.uuid = uuid;
180-
}
181-
} else {
182-
// Since we didn't find anything in the keychain with old method as well, we'll use the passed UUID value.
183-
self.uuid = uuid;
184-
}
185-
186-
// Try to save that value to the keychain and flag if successfully written.
187-
self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:uniqueKey inService:@"deviceInfo"];
188-
}
189-
190152
- (NSString *)description {
191153
return [NSString stringWithFormat:@"ec:%d sc:%d ssc:%d ask:%d sl:%.1f ts:%.1f la:%.1f dt:%@",
192154
self.eventCount, self.sessionCount, self.subsessionCount, self.askingAttribution, self.sessionLength,

ios/Adjust/ADJConnectionValidator.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

ios/Adjust/ADJConnectionValidator.m

Lines changed: 0 additions & 88 deletions
This file was deleted.

ios/Adjust/ADJKeychain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
@interface ADJKeychain : NSObject
1212

13-
+ (NSString *)valueForKeychainKeyOld:(NSString *)key service:(NSString *)service;
14-
+ (NSString *)valueForKeychainKeyNew:(NSString *)key service:(NSString *)service;
13+
+ (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service;
14+
+ (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service;
1515
+ (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service;
1616

1717
@end

0 commit comments

Comments
 (0)