Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 4fb5b47

Browse files
authored
Merge pull request #528 from bitstadium/release/5.1.3
Bump version and write changelog
2 parents f778ae7 + 9c33573 commit 4fb5b47

39 files changed

+479
-728
lines changed

Classes/BITAppVersionMetaInfo.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ + (BITAppVersionMetaInfo *)appVersionMetaInfoFromDict:(NSDictionary *)dict {
4545
appVersionMetaInfo.version = [dict objectForKey:@"version"];
4646
appVersionMetaInfo.shortVersion = [dict objectForKey:@"shortversion"];
4747
appVersionMetaInfo.minOSVersion = [dict objectForKey:@"minimum_os_version"];
48-
[appVersionMetaInfo setDateWithTimestamp:[[dict objectForKey:@"timestamp"] doubleValue]];
48+
[appVersionMetaInfo setDateWithTimestamp:[(NSNumber *)[dict objectForKey:@"timestamp"] doubleValue]];
4949
appVersionMetaInfo.size = [dict objectForKey:@"appsize"];
5050
appVersionMetaInfo.notes = [dict objectForKey:@"notes"];
5151
appVersionMetaInfo.mandatory = [dict objectForKey:@"mandatory"];
@@ -62,7 +62,7 @@ + (BITAppVersionMetaInfo *)appVersionMetaInfoFromDict:(NSDictionary *)dict {
6262
- (BOOL)isEqual:(id)other {
6363
if (other == self)
6464
return YES;
65-
if (!other || ![other isKindOfClass:[self class]])
65+
if (!other || ![(NSObject *)other isKindOfClass:[self class]])
6666
return NO;
6767
return [self isEqualToAppVersionMetaInfo:other];
6868
}

Classes/BITAttributedLabel.m

+22-23
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#define kBITLineBreakWordWrapTextWidthScalingFactor (M_PI / M_E)
3434

3535
#pragma clang diagnostic push
36-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
3736
#pragma clang diagnostic ignored "-Wunused-variable"
3837
#pragma clang diagnostic ignored "-Wunused-parameter"
3938
#pragma clang diagnostic ignored "-Wcast-qual"
@@ -882,9 +881,9 @@ - (void)drawBackground:(CTFrameRef)frame
882881
NSDictionary *attributes = (__bridge NSDictionary *)CTRunGetAttributes((__bridge CTRunRef) glyphRun);
883882
CGColorRef strokeColor = CGColorRefFromColor([attributes objectForKey:kBITBackgroundStrokeColorAttributeName]);
884883
CGColorRef fillColor = CGColorRefFromColor([attributes objectForKey:kBITBackgroundFillColorAttributeName]);
885-
UIEdgeInsets fillPadding = [[attributes objectForKey:kBITBackgroundFillPaddingAttributeName] UIEdgeInsetsValue];
886-
CGFloat cornerRadius = [[attributes objectForKey:kBITBackgroundCornerRadiusAttributeName] floatValue];
887-
CGFloat lineWidth = [[attributes objectForKey:kBITBackgroundLineWidthAttributeName] floatValue];
884+
UIEdgeInsets fillPadding = [(NSValue *)[attributes objectForKey:kBITBackgroundFillPaddingAttributeName] UIEdgeInsetsValue];
885+
CGFloat cornerRadius = [(NSNumber *)[attributes objectForKey:kBITBackgroundCornerRadiusAttributeName] floatValue];
886+
CGFloat lineWidth = [(NSNumber *)[attributes objectForKey:kBITBackgroundLineWidthAttributeName] floatValue];
888887

889888
if (strokeColor || fillColor) {
890889
CGRect runBounds = CGRectZero;
@@ -951,8 +950,8 @@ - (void)drawStrike:(CTFrameRef)frame
951950

952951
for (id glyphRun in (__bridge NSArray *)CTLineGetGlyphRuns((__bridge CTLineRef)line)) {
953952
NSDictionary *attributes = (__bridge NSDictionary *)CTRunGetAttributes((__bridge CTRunRef) glyphRun);
954-
BOOL strikeOut = [[attributes objectForKey:kBITStrikeOutAttributeName] boolValue];
955-
NSInteger superscriptStyle = [[attributes objectForKey:(id)kCTSuperscriptAttributeName] integerValue];
953+
BOOL strikeOut = [(NSNumber *)[attributes objectForKey:kBITStrikeOutAttributeName] boolValue];
954+
NSInteger superscriptStyle = [(NSNumber *)[attributes objectForKey:(id)kCTSuperscriptAttributeName] integerValue];
956955

957956
if (strikeOut) {
958957
CGRect runBounds = CGRectZero;
@@ -1019,9 +1018,9 @@ - (void)drawStrike:(CTFrameRef)frame
10191018
#pragma mark - BITAttributedLabel
10201019

10211020
- (void)setText:(id)text {
1022-
NSParameterAssert(!text || [text isKindOfClass:[NSAttributedString class]] || [text isKindOfClass:[NSString class]]);
1021+
NSParameterAssert(!text || [(NSObject *)text isKindOfClass:[NSAttributedString class]] || [(NSObject *)text isKindOfClass:[NSString class]]);
10231022

1024-
if ([text isKindOfClass:[NSString class]]) {
1023+
if ([(NSObject *)text isKindOfClass:[NSString class]]) {
10251024
[self setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:nil];
10261025
return;
10271026
}
@@ -1051,7 +1050,7 @@ - (void)setText:(id)text {
10511050

10521051
[self.attributedText enumerateAttribute:NSLinkAttributeName inRange:NSMakeRange(0, self.attributedText.length) options:0 usingBlock:^(id value, NSRange range, __unused BOOL *stop) {
10531052
if (value) {
1054-
NSURL *URL = [value isKindOfClass:[NSString class]] ? [NSURL URLWithString:value] : value;
1053+
NSURL *URL = [(NSObject *)value isKindOfClass:[NSString class]] ? [NSURL URLWithString:value] : value;
10551054
[self addLinkToURL:URL withRange:range];
10561055
}
10571056
}];
@@ -1061,7 +1060,7 @@ - (void)setText:(id)text
10611060
afterInheritingLabelAttributesAndConfiguringWithBlock:(NSMutableAttributedString * (^)(NSMutableAttributedString *mutableAttributedString))block
10621061
{
10631062
NSMutableAttributedString *mutableAttributedString = nil;
1064-
if ([text isKindOfClass:[NSString class]]) {
1063+
if ([(NSObject *)text isKindOfClass:[NSString class]]) {
10651064
mutableAttributedString = [[NSMutableAttributedString alloc] initWithString:text attributes:NSAttributedStringAttributesFromLabel(self)];
10661065
} else {
10671066
mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:text];
@@ -1299,7 +1298,7 @@ - (NSArray *)accessibilityElements {
12991298
continue;
13001299
}
13011300

1302-
NSString *sourceText = [self.text isKindOfClass:[NSString class]] ? self.text : [(NSAttributedString *)self.text string];
1301+
NSString *sourceText = [(NSObject *)self.text isKindOfClass:[NSString class]] ? self.text : [(NSAttributedString *)self.text string];
13031302

13041303
NSString *accessibilityLabel = [sourceText substringWithRange:link.result.range];
13051304
NSString *accessibilityValue = link.accessibilityValue;
@@ -1631,7 +1630,7 @@ - (id)initWithCoder:(NSCoder *)coder {
16311630
[self commonInit];
16321631

16331632
if ([coder containsValueForKey:NSStringFromSelector(@selector(enabledTextCheckingTypes))]) {
1634-
self.enabledTextCheckingTypes = [[coder decodeObjectForKey:NSStringFromSelector(@selector(enabledTextCheckingTypes))] unsignedLongLongValue];
1633+
self.enabledTextCheckingTypes = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(enabledTextCheckingTypes))] unsignedLongLongValue];
16351634
}
16361635

16371636
if ([NSMutableParagraphStyle class]) {
@@ -1658,11 +1657,11 @@ - (id)initWithCoder:(NSCoder *)coder {
16581657
}
16591658

16601659
if ([coder containsValueForKey:NSStringFromSelector(@selector(shadowRadius))]) {
1661-
self.shadowRadius = [[coder decodeObjectForKey:NSStringFromSelector(@selector(shadowRadius))] floatValue];
1660+
self.shadowRadius = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(shadowRadius))] floatValue];
16621661
}
16631662

16641663
if ([coder containsValueForKey:NSStringFromSelector(@selector(highlightedShadowRadius))]) {
1665-
self.highlightedShadowRadius = [[coder decodeObjectForKey:NSStringFromSelector(@selector(highlightedShadowRadius))] floatValue];
1664+
self.highlightedShadowRadius = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(highlightedShadowRadius))] floatValue];
16661665
}
16671666

16681667
if ([coder containsValueForKey:NSStringFromSelector(@selector(highlightedShadowOffset))]) {
@@ -1674,27 +1673,27 @@ - (id)initWithCoder:(NSCoder *)coder {
16741673
}
16751674

16761675
if ([coder containsValueForKey:NSStringFromSelector(@selector(kern))]) {
1677-
self.kern = [[coder decodeObjectForKey:NSStringFromSelector(@selector(kern))] floatValue];
1676+
self.kern = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(kern))] floatValue];
16781677
}
16791678

16801679
if ([coder containsValueForKey:NSStringFromSelector(@selector(firstLineIndent))]) {
1681-
self.firstLineIndent = [[coder decodeObjectForKey:NSStringFromSelector(@selector(firstLineIndent))] floatValue];
1680+
self.firstLineIndent = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(firstLineIndent))] floatValue];
16821681
}
16831682

16841683
if ([coder containsValueForKey:NSStringFromSelector(@selector(lineSpacing))]) {
1685-
self.lineSpacing = [[coder decodeObjectForKey:NSStringFromSelector(@selector(lineSpacing))] floatValue];
1684+
self.lineSpacing = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(lineSpacing))] floatValue];
16861685
}
16871686

16881687
if ([coder containsValueForKey:NSStringFromSelector(@selector(minimumLineHeight))]) {
1689-
self.minimumLineHeight = [[coder decodeObjectForKey:NSStringFromSelector(@selector(minimumLineHeight))] floatValue];
1688+
self.minimumLineHeight = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(minimumLineHeight))] floatValue];
16901689
}
16911690

16921691
if ([coder containsValueForKey:NSStringFromSelector(@selector(maximumLineHeight))]) {
1693-
self.maximumLineHeight = [[coder decodeObjectForKey:NSStringFromSelector(@selector(maximumLineHeight))] floatValue];
1692+
self.maximumLineHeight = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(maximumLineHeight))] floatValue];
16941693
}
16951694

16961695
if ([coder containsValueForKey:NSStringFromSelector(@selector(lineHeightMultiple))]) {
1697-
self.lineHeightMultiple = [[coder decodeObjectForKey:NSStringFromSelector(@selector(lineHeightMultiple))] floatValue];
1696+
self.lineHeightMultiple = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(lineHeightMultiple))] floatValue];
16981697
}
16991698

17001699
if ([coder containsValueForKey:NSStringFromSelector(@selector(textInsets))]) {
@@ -1803,7 +1802,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
18031802
#pragma mark -
18041803

18051804
static inline CGColorRef CGColorRefFromColor(id color) {
1806-
return [color isKindOfClass:[UIColor class]] ? [color CGColor] : (__bridge CGColorRef)color;
1805+
return [(NSObject *)color isKindOfClass:[UIColor class]] ? [(UIColor *)color CGColor] : (__bridge CGColorRef)color;
18071806
}
18081807

18091808
static inline CTFontRef CTFontRefFromUIFont(UIFont * font) {
@@ -1832,9 +1831,9 @@ static inline CTFontRef CTFontRefFromUIFont(UIFont * font) {
18321831
key = [NSToCTAttributeNamesMap objectForKey:key] ? : key;
18331832

18341833
if (![NSMutableParagraphStyle class]) {
1835-
if ([value isKindOfClass:[UIFont class]]) {
1834+
if ([(NSObject *)value isKindOfClass:[UIFont class]]) {
18361835
value = (__bridge id)CTFontRefFromUIFont(value);
1837-
} else if ([value isKindOfClass:[UIColor class]]) {
1836+
} else if ([(NSObject *)value isKindOfClass:[UIColor class]]) {
18381837
value = (__bridge id)((UIColor *)value).CGColor;
18391838
}
18401839
}

Classes/BITAuthenticator.m

+5-96
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
static NSString *const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAuthTokenTypeKey";
5353

5454
typedef unsigned int bit_uint32;
55-
static unsigned char kBITPNGHeader[8] = {137, 80, 78, 71, 13, 10, 26, 10};
56-
static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44};
57-
5855

5956
@interface BITAuthenticator()
6057

@@ -158,7 +155,6 @@ - (void)identifyWithCompletion:(void (^)(BOOL identified, NSError *))completion
158155
return;
159156
}
160157

161-
[self processFullSizeImage];
162158
if (self.identified) {
163159
if (completion) { completion(YES, nil); }
164160
return;
@@ -202,7 +198,7 @@ - (void)identifyWithCompletion:(void (^)(BOOL identified, NSError *))completion
202198
viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailDescription");
203199
break;
204200
}
205-
id strongDelegate = self.delegate;
201+
id<BITAuthenticatorDelegate> strongDelegate = self.delegate;
206202
if ([strongDelegate respondsToSelector:@selector(authenticator:willShowAuthenticationController:)]) {
207203
[strongDelegate authenticator:self willShowAuthenticationController:viewController];
208204
}
@@ -370,7 +366,7 @@ + (BOOL)isValidationResponseValid:(id)response error:(NSError *__autoreleasing *
370366
}
371367
return NO;
372368
}
373-
if (![jsonObject isKindOfClass:[NSDictionary class]]) {
369+
if (![(NSObject *)jsonObject isKindOfClass:[NSDictionary class]]) {
374370
if (error) {
375371
*error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain
376372
code:BITAuthenticatorAPIServerReturnedInvalidResponse
@@ -587,7 +583,7 @@ + (NSString *)authenticationTokenFromURLResponse:(NSHTTPURLResponse *)urlRespons
587583
options:0
588584
error:&jsonParseError];
589585
//no json or unexpected json
590-
if (nil == jsonObject || ![jsonObject isKindOfClass:[NSDictionary class]]) {
586+
if (nil == jsonObject || ![(NSObject *)jsonObject isKindOfClass:[NSDictionary class]]) {
591587
if (error) {
592588
NSDictionary *userInfo = @{NSLocalizedDescriptionKey:BITHockeyLocalizedString(@"HockeyAuthenticationFailedAuthenticate")};
593589
if (jsonParseError) {
@@ -718,7 +714,7 @@ + (NSString *)UDIDFromOpenURL:(NSURL *)url annotation:(id) __unused annotation {
718714
//there should actually only one
719715
static NSString *const UDIDQuerySpecifier = @"udid";
720716
for (NSString *queryComponents in [query componentsSeparatedByString:@"&"]) {
721-
NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="];
717+
NSArray<NSString *> *parameterComponents = [queryComponents componentsSeparatedByString:@"="];
722718
if (2 == parameterComponents.count && [parameterComponents[0] isEqualToString:UDIDQuerySpecifier]) {
723719
udid = parameterComponents[1];
724720
break;
@@ -733,7 +729,7 @@ + (void)email:(NSString *__autoreleasing *)email andIUID:(NSString *__autoreleas
733729
static NSString *const EmailQuerySpecifier = @"email";
734730
static NSString *const IUIDQuerySpecifier = @"iuid";
735731
for (NSString *queryComponents in [query componentsSeparatedByString:@"&"]) {
736-
NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="];
732+
NSArray<NSString *> *parameterComponents = [queryComponents componentsSeparatedByString:@"="];
737733
if (email && 2 == parameterComponents.count && [parameterComponents[0] isEqualToString:EmailQuerySpecifier]) {
738734
*email = parameterComponents[1];
739735
} else if (iuid && 2 == parameterComponents.count && [parameterComponents[0] isEqualToString:IUIDQuerySpecifier]) {
@@ -766,93 +762,6 @@ - (void)cleanupInternalStorage {
766762
[self removeKeyFromKeychain:kBITAuthenticatorAuthTokenTypeKey];
767763
}
768764

769-
- (void)processFullSizeImage {
770-
#ifdef BIT_INTERNAL_DEBUG
771-
NSString* path = [[NSBundle mainBundle] pathForResource:@"iTunesArtwork" ofType:@"png"];
772-
#else
773-
NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/../iTunesArtwork"];
774-
#endif
775-
776-
struct stat fs;
777-
int fd = open([path UTF8String], O_RDONLY, 0);
778-
if (fstat(fd, &fs) < 0) {
779-
// File not found
780-
close(fd);
781-
return;
782-
}
783-
784-
BITHockeyLogDebug(@"Processing full size image for possible authentication");
785-
786-
unsigned char *buffer, *source;
787-
source = (unsigned char *)malloc((unsigned long)fs.st_size);
788-
if (read(fd, source, (unsigned long)fs.st_size) != fs.st_size) {
789-
close(fd);
790-
// Couldn't read file
791-
free(source);
792-
return;
793-
}
794-
795-
if ((fs.st_size < 20) || (memcmp(source, kBITPNGHeader, 8))) {
796-
// Not a PNG
797-
free(source);
798-
return;
799-
}
800-
801-
buffer = source + 8;
802-
803-
NSString *result = nil;
804-
bit_uint32 length;
805-
unsigned char *name;
806-
unsigned char *data;
807-
int chunk_index = 0;
808-
long long bytes_left = fs.st_size - 8;
809-
do {
810-
memcpy(&length, buffer, 4);
811-
length = ntohl(length);
812-
813-
buffer += 4;
814-
name = (unsigned char *)malloc(5);
815-
name[4] = 0;
816-
memcpy(name, buffer, 4);
817-
818-
buffer += 4;
819-
data = (unsigned char *)malloc(length + 1);
820-
821-
if (bytes_left >= length) {
822-
memcpy(data, buffer, length);
823-
824-
buffer += length;
825-
buffer += 4;
826-
if (!strcmp((const char *)name, "tEXt")) {
827-
data[length] = 0;
828-
NSString *key = [NSString stringWithCString:(char *)data encoding:NSUTF8StringEncoding];
829-
830-
if ([key isEqualToString:@"Data"]) {
831-
result = [NSString stringWithCString:(char *)(data + key.length + 1) encoding:NSUTF8StringEncoding];
832-
}
833-
}
834-
835-
if (!memcmp(name, kBITPNGEndChunk, 4)) {
836-
chunk_index = 128;
837-
}
838-
}
839-
840-
free(data);
841-
free(name);
842-
843-
bytes_left -= (length + 3 * 4);
844-
} while ((chunk_index++ < 128) && (bytes_left > 8));
845-
846-
free(source);
847-
848-
if (result) {
849-
BITHockeyLogDebug(@"Authenticating using full size image information: %@", result);
850-
[self handleOpenURL:[NSURL URLWithString:result] sourceApplication:nil annotation:nil];
851-
} else {
852-
BITHockeyLogDebug(@"No authentication information found");
853-
}
854-
}
855-
856765
#pragma mark - NSNotification
857766

858767
- (void)registerObservers {

Classes/BITCrashCXXExceptionHandler.mm

-3
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ static inline void BITCrashIterateExceptionHandlers_unlocked(const BITCrashUncau
130130
}
131131
}
132132

133-
#pragma clang diagnostic push
134-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
135133
static void BITCrashUncaughtCXXTerminateHandler(void)
136134
{
137135
BITCrashUncaughtCXXExceptionInfo info = {
@@ -240,7 +238,6 @@ + (void)removeCXXExceptionHandler:(BITCrashUncaughtCXXExceptionHandler)handler
240238
}
241239
} OSSpinLockUnlock(&_BITCrashCXXExceptionHandlingLock);
242240
}
243-
#pragma clang diagnostic pop
244241

245242
@end
246243

0 commit comments

Comments
 (0)