Skip to content

Commit 6e8de77

Browse files
authored
Merge pull request #11 from BranchMetrics/staging
SDK-979 prep 1.2.2 release
2 parents 60322df + 4d9664c commit 6e8de77

File tree

8 files changed

+56
-22
lines changed

8 files changed

+56
-22
lines changed

Branch.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@
11841184
CODE_SIGN_IDENTITY = "Mac Developer";
11851185
CODE_SIGN_STYLE = Automatic;
11861186
DEVELOPMENT_TEAM = "";
1187-
MARKETING_VERSION = 1.2.1;
1187+
MARKETING_VERSION = 1.2.2;
11881188
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.mac;
11891189
PROVISIONING_PROFILE_SPECIFIER = "";
11901190
};
@@ -1196,7 +1196,7 @@
11961196
CODE_SIGN_IDENTITY = "";
11971197
CODE_SIGN_STYLE = Automatic;
11981198
DEVELOPMENT_TEAM = "";
1199-
MARKETING_VERSION = 1.2.1;
1199+
MARKETING_VERSION = 1.2.2;
12001200
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.mac;
12011201
PROVISIONING_PROFILE_SPECIFIER = "";
12021202
};
@@ -1300,7 +1300,7 @@
13001300
CODE_SIGN_IDENTITY = "";
13011301
CODE_SIGN_STYLE = Automatic;
13021302
DEVELOPMENT_TEAM = "";
1303-
MARKETING_VERSION = 1.2.1;
1303+
MARKETING_VERSION = 1.2.2;
13041304
PRODUCT_BUNDLE_IDENTIFIER = io.branch.sdk.mac;
13051305
PROVISIONING_PROFILE_SPECIFIER = "";
13061306
};

Branch/BNCDevice.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,28 @@ - (NSString *)vendorID {
287287
#endif
288288

289289
- (NSString *)hardwareID {
290-
// INTENG-8458 server only wants hardware id and hardware id type for idfa and idfv.
291290
NSString *s = nil;
292291
s = [self advertisingID];
293292
if (s) {
294293
_hardwareIDType = @"idfa";
295294
return s;
296295
}
296+
297297
s = [self vendorID];
298298
if (s) {
299299
_hardwareIDType = @"vendor_id";
300300
return s;
301301
}
302+
303+
s = [self netAddress];
304+
if (s) {
305+
_hardwareIDType = @"mac_address";
306+
return s;
307+
}
308+
309+
s = [[NSUUID UUID] UUIDString];
310+
_hardwareIDType = @"random";
311+
302312
return s;
303313
}
304314

Branch/BNCNetworkInformation.m

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ @implementation BNCNetworkInformation
4242
+ (NSString*) etherString:(struct sockaddr_dl*)sdl {
4343
if (sdl->sdl_alen) {
4444
u_char *cp = (u_char *)LLADDR(sdl);
45-
return [NSString stringWithFormat:@"%x:%x:%x:%x:%x:%x",
45+
return [NSString stringWithFormat:@"%02x:%02x:%02x:%02x:%02x:%02x",
4646
cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]];
4747
}
4848
return @"";
@@ -198,22 +198,13 @@ + (NSString*) etherString:(struct sockaddr_dl*)sdl {
198198
return currentInterfaces;
199199
}
200200

201+
// returns first local network interface
201202
+ (BNCNetworkInformation*) local {
202-
uint8_t const kLocalAddress[] = { 0xfe, 0x80 };
203203
NSArray*areaEntries = [self areaEntries];
204204
NSArray*localEntries = [self currentInterfaces];
205205
for (BNCNetworkInformation*le in localEntries) {
206206
for (BNCNetworkInformation*ae in areaEntries) {
207-
if (ae.inetAddress && le.inetAddress && [ae.inetAddress isEqualToData:le.inetAddress]) {
208-
le.address = ae.address;
209-
le.displayAddress = ae.displayAddress;
210-
return le;
211-
} else
212-
if (ae.inetAddress.length == 16 &&
213-
le.inetAddress.length == 16 &&
214-
memcmp([ae.inetAddress bytes], kLocalAddress, 2) == 0 &&
215-
memcmp([le.inetAddress bytes], kLocalAddress, 2) == 0 &&
216-
memcmp([le.inetAddress bytes] + 8, [ae.inetAddress bytes] + 8, 8) == 0) {
207+
if (![self isTouchBarInterface:ae] && [self canMergeLocalEntry:le withAreaEntry:ae]) {
217208
le.address = ae.address;
218209
le.displayAddress = ae.displayAddress;
219210
return le;
@@ -223,6 +214,36 @@ + (BNCNetworkInformation*) local {
223214
return nil;
224215
}
225216

217+
// Ignore the Touchbar iBridge interface on the MacBook Pro
218+
+ (BOOL)isTouchBarInterface:(BNCNetworkInformation *)ae {
219+
NSString *touchBarMacAddress = @"ac:de:48:00:11:22";
220+
if ([touchBarMacAddress isEqualToString:ae.displayAddress]) {
221+
return YES;
222+
}
223+
return NO;
224+
}
225+
226+
// Check if we can merge the entries
227+
+ (BOOL)canMergeLocalEntry:(BNCNetworkInformation *)le withAreaEntry:(BNCNetworkInformation *)ae {
228+
229+
// fairly certain this IP address check never works
230+
if (ae.inetAddress && le.inetAddress && [ae.inetAddress isEqualToData:le.inetAddress]) {
231+
return YES;
232+
}
233+
234+
// This IP address compare works
235+
uint8_t const kLocalAddress[] = { 0xfe, 0x80 };
236+
if (ae.inetAddress.length == 16 &&
237+
le.inetAddress.length == 16 &&
238+
memcmp([ae.inetAddress bytes], kLocalAddress, 2) == 0 &&
239+
memcmp([le.inetAddress bytes], kLocalAddress, 2) == 0 &&
240+
memcmp([le.inetAddress bytes] + 8, [ae.inetAddress bytes] + 8, 8) == 0) {
241+
return YES;
242+
}
243+
244+
return NO;
245+
}
246+
226247
- (NSString*) description {
227248
return [NSString stringWithFormat:@"<%@ %p %@ %@ %@>",
228249
NSStringFromClass(self.class),

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Branch Mac SDK Change Log
22

3+
## v1.2.2 - May 7, 2020
4+
* Fix fallback when idfa is not available
5+
36
## v1.2.1 - December 13, 2019
47
* Fix crash when idfa is not available
58

-36.2 KB
Binary file not shown.

Frameworks/macOS/Branch.framework/Versions/A/Resources/Info.plist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>BuildMachineOSBuild</key>
6-
<string>18G1012</string>
6+
<string>19E287</string>
77
<key>CFBundleDevelopmentRegion</key>
88
<string>en</string>
99
<key>CFBundleExecutable</key>
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.2.1</string>
20+
<string>1.2.2</string>
2121
<key>CFBundleSupportedPlatforms</key>
2222
<array>
2323
<string>MacOSX</string>
@@ -27,17 +27,17 @@
2727
<key>DTCompiler</key>
2828
<string>com.apple.compilers.llvm.clang.1_0</string>
2929
<key>DTPlatformBuild</key>
30-
<string>11C29</string>
30+
<string>11E503a</string>
3131
<key>DTPlatformVersion</key>
3232
<string>GM</string>
3333
<key>DTSDKBuild</key>
34-
<string>19B90</string>
34+
<string>19E258</string>
3535
<key>DTSDKName</key>
3636
<string>macosx10.15</string>
3737
<key>DTXcode</key>
38-
<string>1130</string>
38+
<string>1141</string>
3939
<key>DTXcodeBuild</key>
40-
<string>11C29</string>
40+
<string>11E503a</string>
4141
<key>LSMinimumSystemVersion</key>
4242
<string>10.10</string>
4343
<key>NSHumanReadableCopyright</key>
535 KB
Binary file not shown.
-40 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)