diff --git a/Classes/BITAppVersionMetaInfo.m b/Classes/BITAppVersionMetaInfo.m index 3f4906e0..4814ce7e 100644 --- a/Classes/BITAppVersionMetaInfo.m +++ b/Classes/BITAppVersionMetaInfo.m @@ -45,7 +45,7 @@ + (BITAppVersionMetaInfo *)appVersionMetaInfoFromDict:(NSDictionary *)dict { appVersionMetaInfo.version = [dict objectForKey:@"version"]; appVersionMetaInfo.shortVersion = [dict objectForKey:@"shortversion"]; appVersionMetaInfo.minOSVersion = [dict objectForKey:@"minimum_os_version"]; - [appVersionMetaInfo setDateWithTimestamp:[[dict objectForKey:@"timestamp"] doubleValue]]; + [appVersionMetaInfo setDateWithTimestamp:[(NSNumber *)[dict objectForKey:@"timestamp"] doubleValue]]; appVersionMetaInfo.size = [dict objectForKey:@"appsize"]; appVersionMetaInfo.notes = [dict objectForKey:@"notes"]; appVersionMetaInfo.mandatory = [dict objectForKey:@"mandatory"]; @@ -62,7 +62,7 @@ + (BITAppVersionMetaInfo *)appVersionMetaInfoFromDict:(NSDictionary *)dict { - (BOOL)isEqual:(id)other { if (other == self) return YES; - if (!other || ![other isKindOfClass:[self class]]) + if (!other || ![(NSObject *)other isKindOfClass:[self class]]) return NO; return [self isEqualToAppVersionMetaInfo:other]; } diff --git a/Classes/BITAttributedLabel.m b/Classes/BITAttributedLabel.m index 0e48cea4..458ba01f 100644 --- a/Classes/BITAttributedLabel.m +++ b/Classes/BITAttributedLabel.m @@ -33,7 +33,6 @@ #define kBITLineBreakWordWrapTextWidthScalingFactor (M_PI / M_E) #pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wunused-variable" #pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wcast-qual" @@ -882,9 +881,9 @@ - (void)drawBackground:(CTFrameRef)frame NSDictionary *attributes = (__bridge NSDictionary *)CTRunGetAttributes((__bridge CTRunRef) glyphRun); CGColorRef strokeColor = CGColorRefFromColor([attributes objectForKey:kBITBackgroundStrokeColorAttributeName]); CGColorRef fillColor = CGColorRefFromColor([attributes objectForKey:kBITBackgroundFillColorAttributeName]); - UIEdgeInsets fillPadding = [[attributes objectForKey:kBITBackgroundFillPaddingAttributeName] UIEdgeInsetsValue]; - CGFloat cornerRadius = [[attributes objectForKey:kBITBackgroundCornerRadiusAttributeName] floatValue]; - CGFloat lineWidth = [[attributes objectForKey:kBITBackgroundLineWidthAttributeName] floatValue]; + UIEdgeInsets fillPadding = [(NSValue *)[attributes objectForKey:kBITBackgroundFillPaddingAttributeName] UIEdgeInsetsValue]; + CGFloat cornerRadius = [(NSNumber *)[attributes objectForKey:kBITBackgroundCornerRadiusAttributeName] floatValue]; + CGFloat lineWidth = [(NSNumber *)[attributes objectForKey:kBITBackgroundLineWidthAttributeName] floatValue]; if (strokeColor || fillColor) { CGRect runBounds = CGRectZero; @@ -951,8 +950,8 @@ - (void)drawStrike:(CTFrameRef)frame for (id glyphRun in (__bridge NSArray *)CTLineGetGlyphRuns((__bridge CTLineRef)line)) { NSDictionary *attributes = (__bridge NSDictionary *)CTRunGetAttributes((__bridge CTRunRef) glyphRun); - BOOL strikeOut = [[attributes objectForKey:kBITStrikeOutAttributeName] boolValue]; - NSInteger superscriptStyle = [[attributes objectForKey:(id)kCTSuperscriptAttributeName] integerValue]; + BOOL strikeOut = [(NSNumber *)[attributes objectForKey:kBITStrikeOutAttributeName] boolValue]; + NSInteger superscriptStyle = [(NSNumber *)[attributes objectForKey:(id)kCTSuperscriptAttributeName] integerValue]; if (strikeOut) { CGRect runBounds = CGRectZero; @@ -1019,9 +1018,9 @@ - (void)drawStrike:(CTFrameRef)frame #pragma mark - BITAttributedLabel - (void)setText:(id)text { - NSParameterAssert(!text || [text isKindOfClass:[NSAttributedString class]] || [text isKindOfClass:[NSString class]]); + NSParameterAssert(!text || [(NSObject *)text isKindOfClass:[NSAttributedString class]] || [(NSObject *)text isKindOfClass:[NSString class]]); - if ([text isKindOfClass:[NSString class]]) { + if ([(NSObject *)text isKindOfClass:[NSString class]]) { [self setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:nil]; return; } @@ -1051,7 +1050,7 @@ - (void)setText:(id)text { [self.attributedText enumerateAttribute:NSLinkAttributeName inRange:NSMakeRange(0, self.attributedText.length) options:0 usingBlock:^(id value, NSRange range, __unused BOOL *stop) { if (value) { - NSURL *URL = [value isKindOfClass:[NSString class]] ? [NSURL URLWithString:value] : value; + NSURL *URL = [(NSObject *)value isKindOfClass:[NSString class]] ? [NSURL URLWithString:value] : value; [self addLinkToURL:URL withRange:range]; } }]; @@ -1061,7 +1060,7 @@ - (void)setText:(id)text afterInheritingLabelAttributesAndConfiguringWithBlock:(NSMutableAttributedString * (^)(NSMutableAttributedString *mutableAttributedString))block { NSMutableAttributedString *mutableAttributedString = nil; - if ([text isKindOfClass:[NSString class]]) { + if ([(NSObject *)text isKindOfClass:[NSString class]]) { mutableAttributedString = [[NSMutableAttributedString alloc] initWithString:text attributes:NSAttributedStringAttributesFromLabel(self)]; } else { mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:text]; @@ -1299,7 +1298,7 @@ - (NSArray *)accessibilityElements { continue; } - NSString *sourceText = [self.text isKindOfClass:[NSString class]] ? self.text : [(NSAttributedString *)self.text string]; + NSString *sourceText = [(NSObject *)self.text isKindOfClass:[NSString class]] ? self.text : [(NSAttributedString *)self.text string]; NSString *accessibilityLabel = [sourceText substringWithRange:link.result.range]; NSString *accessibilityValue = link.accessibilityValue; @@ -1631,7 +1630,7 @@ - (id)initWithCoder:(NSCoder *)coder { [self commonInit]; if ([coder containsValueForKey:NSStringFromSelector(@selector(enabledTextCheckingTypes))]) { - self.enabledTextCheckingTypes = [[coder decodeObjectForKey:NSStringFromSelector(@selector(enabledTextCheckingTypes))] unsignedLongLongValue]; + self.enabledTextCheckingTypes = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(enabledTextCheckingTypes))] unsignedLongLongValue]; } if ([NSMutableParagraphStyle class]) { @@ -1658,11 +1657,11 @@ - (id)initWithCoder:(NSCoder *)coder { } if ([coder containsValueForKey:NSStringFromSelector(@selector(shadowRadius))]) { - self.shadowRadius = [[coder decodeObjectForKey:NSStringFromSelector(@selector(shadowRadius))] floatValue]; + self.shadowRadius = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(shadowRadius))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(highlightedShadowRadius))]) { - self.highlightedShadowRadius = [[coder decodeObjectForKey:NSStringFromSelector(@selector(highlightedShadowRadius))] floatValue]; + self.highlightedShadowRadius = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(highlightedShadowRadius))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(highlightedShadowOffset))]) { @@ -1674,27 +1673,27 @@ - (id)initWithCoder:(NSCoder *)coder { } if ([coder containsValueForKey:NSStringFromSelector(@selector(kern))]) { - self.kern = [[coder decodeObjectForKey:NSStringFromSelector(@selector(kern))] floatValue]; + self.kern = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(kern))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(firstLineIndent))]) { - self.firstLineIndent = [[coder decodeObjectForKey:NSStringFromSelector(@selector(firstLineIndent))] floatValue]; + self.firstLineIndent = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(firstLineIndent))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(lineSpacing))]) { - self.lineSpacing = [[coder decodeObjectForKey:NSStringFromSelector(@selector(lineSpacing))] floatValue]; + self.lineSpacing = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(lineSpacing))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(minimumLineHeight))]) { - self.minimumLineHeight = [[coder decodeObjectForKey:NSStringFromSelector(@selector(minimumLineHeight))] floatValue]; + self.minimumLineHeight = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(minimumLineHeight))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(maximumLineHeight))]) { - self.maximumLineHeight = [[coder decodeObjectForKey:NSStringFromSelector(@selector(maximumLineHeight))] floatValue]; + self.maximumLineHeight = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(maximumLineHeight))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(lineHeightMultiple))]) { - self.lineHeightMultiple = [[coder decodeObjectForKey:NSStringFromSelector(@selector(lineHeightMultiple))] floatValue]; + self.lineHeightMultiple = [(NSNumber *)[coder decodeObjectForKey:NSStringFromSelector(@selector(lineHeightMultiple))] floatValue]; } if ([coder containsValueForKey:NSStringFromSelector(@selector(textInsets))]) { @@ -1803,7 +1802,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder { #pragma mark - static inline CGColorRef CGColorRefFromColor(id color) { - return [color isKindOfClass:[UIColor class]] ? [color CGColor] : (__bridge CGColorRef)color; + return [(NSObject *)color isKindOfClass:[UIColor class]] ? [(UIColor *)color CGColor] : (__bridge CGColorRef)color; } static inline CTFontRef CTFontRefFromUIFont(UIFont * font) { @@ -1832,9 +1831,9 @@ static inline CTFontRef CTFontRefFromUIFont(UIFont * font) { key = [NSToCTAttributeNamesMap objectForKey:key] ? : key; if (![NSMutableParagraphStyle class]) { - if ([value isKindOfClass:[UIFont class]]) { + if ([(NSObject *)value isKindOfClass:[UIFont class]]) { value = (__bridge id)CTFontRefFromUIFont(value); - } else if ([value isKindOfClass:[UIColor class]]) { + } else if ([(NSObject *)value isKindOfClass:[UIColor class]]) { value = (__bridge id)((UIColor *)value).CGColor; } } diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 5a04d64d..b7e7248f 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -52,9 +52,6 @@ static NSString *const kBITAuthenticatorAuthTokenTypeKey = @"BITAuthenticatorAuthTokenTypeKey"; typedef unsigned int bit_uint32; -static unsigned char kBITPNGHeader[8] = {137, 80, 78, 71, 13, 10, 26, 10}; -static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44}; - @interface BITAuthenticator() @@ -158,7 +155,6 @@ - (void)identifyWithCompletion:(void (^)(BOOL identified, NSError *))completion return; } - [self processFullSizeImage]; if (self.identified) { if (completion) { completion(YES, nil); } return; @@ -202,7 +198,7 @@ - (void)identifyWithCompletion:(void (^)(BOOL identified, NSError *))completion viewController.tableViewTitle = BITHockeyLocalizedString(@"HockeyAuthenticationViewControllerDataEmailDescription"); break; } - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(authenticator:willShowAuthenticationController:)]) { [strongDelegate authenticator:self willShowAuthenticationController:viewController]; } @@ -370,7 +366,7 @@ + (BOOL)isValidationResponseValid:(id)response error:(NSError *__autoreleasing * } return NO; } - if (![jsonObject isKindOfClass:[NSDictionary class]]) { + if (![(NSObject *)jsonObject isKindOfClass:[NSDictionary class]]) { if (error) { *error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain code:BITAuthenticatorAPIServerReturnedInvalidResponse @@ -587,7 +583,7 @@ + (NSString *)authenticationTokenFromURLResponse:(NSHTTPURLResponse *)urlRespons options:0 error:&jsonParseError]; //no json or unexpected json - if (nil == jsonObject || ![jsonObject isKindOfClass:[NSDictionary class]]) { + if (nil == jsonObject || ![(NSObject *)jsonObject isKindOfClass:[NSDictionary class]]) { if (error) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey:BITHockeyLocalizedString(@"HockeyAuthenticationFailedAuthenticate")}; if (jsonParseError) { @@ -718,7 +714,7 @@ + (NSString *)UDIDFromOpenURL:(NSURL *)url annotation:(id) __unused annotation { //there should actually only one static NSString *const UDIDQuerySpecifier = @"udid"; for (NSString *queryComponents in [query componentsSeparatedByString:@"&"]) { - NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; + NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; if (2 == parameterComponents.count && [parameterComponents[0] isEqualToString:UDIDQuerySpecifier]) { udid = parameterComponents[1]; break; @@ -733,7 +729,7 @@ + (void)email:(NSString *__autoreleasing *)email andIUID:(NSString *__autoreleas static NSString *const EmailQuerySpecifier = @"email"; static NSString *const IUIDQuerySpecifier = @"iuid"; for (NSString *queryComponents in [query componentsSeparatedByString:@"&"]) { - NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; + NSArray *parameterComponents = [queryComponents componentsSeparatedByString:@"="]; if (email && 2 == parameterComponents.count && [parameterComponents[0] isEqualToString:EmailQuerySpecifier]) { *email = parameterComponents[1]; } else if (iuid && 2 == parameterComponents.count && [parameterComponents[0] isEqualToString:IUIDQuerySpecifier]) { @@ -766,93 +762,6 @@ - (void)cleanupInternalStorage { [self removeKeyFromKeychain:kBITAuthenticatorAuthTokenTypeKey]; } -- (void)processFullSizeImage { -#ifdef BIT_INTERNAL_DEBUG - NSString* path = [[NSBundle mainBundle] pathForResource:@"iTunesArtwork" ofType:@"png"]; -#else - NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/../iTunesArtwork"]; -#endif - - struct stat fs; - int fd = open([path UTF8String], O_RDONLY, 0); - if (fstat(fd, &fs) < 0) { - // File not found - close(fd); - return; - } - - BITHockeyLogDebug(@"Processing full size image for possible authentication"); - - unsigned char *buffer, *source; - source = (unsigned char *)malloc((unsigned long)fs.st_size); - if (read(fd, source, (unsigned long)fs.st_size) != fs.st_size) { - close(fd); - // Couldn't read file - free(source); - return; - } - - if ((fs.st_size < 20) || (memcmp(source, kBITPNGHeader, 8))) { - // Not a PNG - free(source); - return; - } - - buffer = source + 8; - - NSString *result = nil; - bit_uint32 length; - unsigned char *name; - unsigned char *data; - int chunk_index = 0; - long long bytes_left = fs.st_size - 8; - do { - memcpy(&length, buffer, 4); - length = ntohl(length); - - buffer += 4; - name = (unsigned char *)malloc(5); - name[4] = 0; - memcpy(name, buffer, 4); - - buffer += 4; - data = (unsigned char *)malloc(length + 1); - - if (bytes_left >= length) { - memcpy(data, buffer, length); - - buffer += length; - buffer += 4; - if (!strcmp((const char *)name, "tEXt")) { - data[length] = 0; - NSString *key = [NSString stringWithCString:(char *)data encoding:NSUTF8StringEncoding]; - - if ([key isEqualToString:@"Data"]) { - result = [NSString stringWithCString:(char *)(data + key.length + 1) encoding:NSUTF8StringEncoding]; - } - } - - if (!memcmp(name, kBITPNGEndChunk, 4)) { - chunk_index = 128; - } - } - - free(data); - free(name); - - bytes_left -= (length + 3 * 4); - } while ((chunk_index++ < 128) && (bytes_left > 8)); - - free(source); - - if (result) { - BITHockeyLogDebug(@"Authenticating using full size image information: %@", result); - [self handleOpenURL:[NSURL URLWithString:result] sourceApplication:nil annotation:nil]; - } else { - BITHockeyLogDebug(@"No authentication information found"); - } -} - #pragma mark - NSNotification - (void)registerObservers { diff --git a/Classes/BITCrashCXXExceptionHandler.mm b/Classes/BITCrashCXXExceptionHandler.mm index 233ab5ea..162d1164 100644 --- a/Classes/BITCrashCXXExceptionHandler.mm +++ b/Classes/BITCrashCXXExceptionHandler.mm @@ -130,8 +130,6 @@ static inline void BITCrashIterateExceptionHandlers_unlocked(const BITCrashUncau } } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" static void BITCrashUncaughtCXXTerminateHandler(void) { BITCrashUncaughtCXXExceptionInfo info = { @@ -240,7 +238,6 @@ + (void)removeCXXExceptionHandler:(BITCrashUncaughtCXXExceptionHandler)handler } } OSSpinLockUnlock(&_BITCrashCXXExceptionHandlingLock); } -#pragma clang diagnostic pop @end diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 61da7ad1..4bd429f6 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -478,7 +478,8 @@ - (void) registerObservers { NSNotificationName name = UIApplicationDidBecomeActiveNotification; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" - if (bit_isRunningInAppExtension() && &NSExtensionHostDidBecomeActiveNotification != NULL) { +#pragma clang diagnostic ignored "-Wtautological-pointer-compare" + if (bit_isRunningInAppExtension() && &NSExtensionHostDidBecomeActiveNotification != nil) { name = NSExtensionHostDidBecomeActiveNotification; } #pragma clang diagnostic pop @@ -515,7 +516,8 @@ - (void) registerObservers { NSNotificationName name = UIApplicationDidEnterBackgroundNotification; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" - if (bit_isRunningInAppExtension() && &NSExtensionHostDidEnterBackgroundNotification != NULL) { +#pragma clang diagnostic ignored "-Wtautological-pointer-compare" + if (bit_isRunningInAppExtension() && &NSExtensionHostDidEnterBackgroundNotification != nil) { name = NSExtensionHostDidEnterBackgroundNotification; } #pragma clang diagnostic pop @@ -532,7 +534,8 @@ - (void) registerObservers { NSNotificationName name = UIApplicationWillEnterForegroundNotification; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" - if (bit_isRunningInAppExtension() && &NSExtensionHostWillEnterForegroundNotification != NULL) { +#pragma clang diagnostic ignored "-Wtautological-pointer-compare" + if (bit_isRunningInAppExtension() && &NSExtensionHostWillEnterForegroundNotification != nil) { name = NSExtensionHostWillEnterForegroundNotification; } #pragma clang diagnostic pop @@ -607,11 +610,11 @@ - (void)appEnteredForeground { static dispatch_once_t predAppData; dispatch_once(&predAppData, ^{ - id marketingVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; + id marketingVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; if (marketingVersion && [marketingVersion isKindOfClass:[NSString class]]) [[NSUserDefaults standardUserDefaults] setObject:marketingVersion forKey:kBITAppMarketingVersion]; - id bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; + id bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; if (bundleVersion && [bundleVersion isKindOfClass:[NSString class]]) [[NSUserDefaults standardUserDefaults] setObject:bundleVersion forKey:kBITAppVersion]; @@ -682,7 +685,7 @@ - (NSString *)userIDForCrashReport { if (userIdFromKeychain) { userID = userIdFromKeychain; } - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(userIDForHockeyManager:componentManager:)]) { userID = [strongDelegate userIDForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self]; } @@ -697,7 +700,7 @@ - (NSString *)userIDForCrashReport { - (NSString *)userNameForCrashReport { // first check the global keychain storage NSString *username = [self stringValueFromKeychainForKey:kBITHockeyMetaUserName] ?: @""; - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(userNameForHockeyManager:componentManager:)]) { username = [strongDelegate userNameForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self] ?: @""; } @@ -724,7 +727,7 @@ - (NSString *)userEmailForCrashReport { useremail = self.installationIdentification; } #endif - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(userEmailForHockeyManager:componentManager:)]) { useremail = [strongDelegate userEmailForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self] ?: @""; } @@ -797,7 +800,7 @@ - (void)storeMetaDataForCrashReportFilename:(NSString *)filename { [self addStringValueToKeychain:[self userNameForCrashReport] forKey:[NSString stringWithFormat:@"%@.%@", filename, kBITCrashMetaUserName]]; [self addStringValueToKeychain:[self userEmailForCrashReport] forKey:[NSString stringWithFormat:@"%@.%@", filename, kBITCrashMetaUserEmail]]; [self addStringValueToKeychain:[self userIDForCrashReport] forKey:[NSString stringWithFormat:@"%@.%@", filename, kBITCrashMetaUserID]]; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(applicationLogForCrashManager:)]) { applicationLog = [strongDelegate applicationLogForCrashManager:self] ?: @""; } @@ -835,7 +838,7 @@ - (void)storeMetaDataForCrashReportFilename:(NSString *)filename { } - (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; switch (userInput) { case BITCrashManagerUserInputDontSend: if ([strongDelegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) { @@ -999,9 +1002,9 @@ - (BOOL)hasPendingCrashReport { for (NSString *file in dirArray) { NSString *filePath = [self.crashesDir stringByAppendingPathComponent:file]; - NSDictionary *fileAttributes = [self.fileManager attributesOfItemAtPath:filePath error:&error]; - if ([[fileAttributes objectForKey:NSFileType] isEqualToString:NSFileTypeRegular] && - [[fileAttributes objectForKey:NSFileSize] intValue] > 0 && + NSDictionary *fileAttributes = [self.fileManager attributesOfItemAtPath:filePath error:&error]; + if ([(NSString *)[fileAttributes objectForKey:NSFileType] isEqualToString:NSFileTypeRegular] && + [(NSNumber *)[fileAttributes objectForKey:NSFileSize] intValue] > 0 && ![file hasSuffix:@".DS_Store"] && ![file hasSuffix:@".analyzer"] && ![file hasSuffix:@".plist"] && @@ -1018,7 +1021,7 @@ - (BOOL)hasPendingCrashReport { return YES; } else { if (self.didCrashInLastSession) { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) { [strongDelegate crashManagerWillCancelSendingCrashReport:self]; } @@ -1090,7 +1093,7 @@ - (void)invokeDelayedProcessing { #if !defined (HOCKEYSDK_CONFIGURATION_ReleaseCrashOnlyExtensions) } else if (self.crashManagerStatus != BITCrashManagerStatusAutoSend && notApprovedReportFilename) { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(crashManagerWillShowSubmitCrashReportAlert:)]) { [strongDelegate crashManagerWillShowSubmitCrashReportAlert:self]; } @@ -1263,7 +1266,7 @@ - (void)startManager { if (!didAppSwitchToBackgroundSafely) { BOOL considerReport = YES; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(considerAppNotTerminatedCleanlyReportForCrashManager:)]) { considerReport = [strongDelegate considerAppNotTerminatedCleanlyReportForCrashManager:self]; } @@ -1278,7 +1281,7 @@ - (void)startManager { } #if !defined (HOCKEYSDK_CONFIGURATION_ReleaseCrashOnlyExtensions) - if ([BITHockeyHelper applicationState] != BITApplicationStateActive) { + if ([BITHockeyHelper applicationState] == BITApplicationStateActive) { [self appEnteredForeground]; } #else @@ -1612,7 +1615,7 @@ - (void)processUploadResultWithFilename:(NSString *)filename responseData:(NSDat dispatch_async(dispatch_get_main_queue(), ^{ self.sendingInProgress = NO; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if (nil == theError) { if (nil == responseData || [responseData length] == 0) { theError = [NSError errorWithDomain:kBITCrashErrorDomain @@ -1695,7 +1698,7 @@ - (void)sendCrashReportWithFilename:(NSString *)filename xml:(NSString*)xml atta [uploadTask resume]; } - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(crashManagerWillSendCrashReport:)]) { [strongDelegate crashManagerWillSendCrashReport:self]; } diff --git a/Classes/BITCrashManagerPrivate.h b/Classes/BITCrashManagerPrivate.h index 0add0c80..25d5c9e6 100644 --- a/Classes/BITCrashManagerPrivate.h +++ b/Classes/BITCrashManagerPrivate.h @@ -51,7 +51,7 @@ @see `[BITHockeyManager setDelegate:]` */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; /** * must be set diff --git a/Classes/BITCrashReportTextFormatter.m b/Classes/BITCrashReportTextFormatter.m index 4c896802..992e423a 100644 --- a/Classes/BITCrashReportTextFormatter.m +++ b/Classes/BITCrashReportTextFormatter.m @@ -52,28 +52,19 @@ #import "BITCrashReportTextFormatter.h" -/* - * XXX: The ARM64 CPU type, and ARM_V7S and ARM_V8 Mach-O CPU subtypes are not - * defined in the Mac OS X 10.8 headers. +/** + * Before macOS Mojave, the new ARM64E architecture, used by iPhone XS and XR, is not yet in the headers. */ -#ifndef CPU_SUBTYPE_ARM_V7S -# define CPU_SUBTYPE_ARM_V7S 11 -#endif - -#ifndef CPU_TYPE_ARM64 -#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) -#endif - -#ifndef CPU_SUBTYPE_ARM_V8 -# define CPU_SUBTYPE_ARM_V8 13 +#ifndef CPU_SUBTYPE_ARM64E +# define CPU_SUBTYPE_ARM64E ((cpu_subtype_t) 2) #endif /** * Sort PLCrashReportBinaryImageInfo instances by their starting address. */ static NSInteger bit_binaryImageSort(id binary1, id binary2, void *__unused context) { - uint64_t addr1 = [binary1 imageBaseAddress]; - uint64_t addr2 = [binary2 imageBaseAddress]; + uint64_t addr1 = [(BITPLCrashReportBinaryImageInfo *)binary1 imageBaseAddress]; + uint64_t addr2 = [(BITPLCrashReportBinaryImageInfo *)binary2 imageBaseAddress]; if (addr1 < addr2) return NSOrderedAscending; @@ -277,8 +268,7 @@ + (NSString *)stringValueForCrashReport:(BITPLCrashReport *)report crashReporter if (codeType != nil) break; } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /* If we were unable to determine the code type, fall back on the legacy architecture value. */ if (codeType == nil) { switch (report.systemInfo.architecture) { @@ -305,7 +295,6 @@ + (NSString *)stringValueForCrashReport:(BITPLCrashReport *)report crashReporter break; } } -#pragma GCC diagnostic pop } { @@ -463,19 +452,21 @@ + (NSString *)stringValueForCrashReport:(BITPLCrashReport *)report crashReporter // search the registers value for the current arch #if TARGET_OS_SIMULATOR if (lp64) { - foundSelector = [[self class] selectorForRegisterWithName:@"rsi" ofThread:crashed_thread report:report]; - if (foundSelector == NULL) - foundSelector = [[self class] selectorForRegisterWithName:@"rdx" ofThread:crashed_thread report:report]; + foundSelector = [[self class] selectorForRegisterWithName:@"rsi" ofThread:crashed_thread report:report lp64:lp64]; + if (foundSelector == NULL) { + foundSelector = [[self class] selectorForRegisterWithName:@"rdx" ofThread:crashed_thread report:report lp64:lp64]; + } } else { - foundSelector = [[self class] selectorForRegisterWithName:@"ecx" ofThread:crashed_thread report:report]; + foundSelector = [[self class] selectorForRegisterWithName:@"ecx" ofThread:crashed_thread report:report lp64:lp64]; } #else if (lp64) { - foundSelector = [[self class] selectorForRegisterWithName:@"x1" ofThread:crashed_thread report:report]; + foundSelector = [[self class] selectorForRegisterWithName:@"x1" ofThread:crashed_thread report:report lp64:lp64]; } else { - foundSelector = [[self class] selectorForRegisterWithName:@"r1" ofThread:crashed_thread report:report]; - if (foundSelector == NULL) - foundSelector = [[self class] selectorForRegisterWithName:@"r2" ofThread:crashed_thread report:report]; + foundSelector = [[self class] selectorForRegisterWithName:@"r1" ofThread:crashed_thread report:report lp64:lp64]; + if (foundSelector == NULL) { + foundSelector = [[self class] selectorForRegisterWithName:@"r2" ofThread:crashed_thread report:report lp64:lp64]; + } } #endif @@ -497,7 +488,7 @@ + (NSString *)stringValueForCrashReport:(BITPLCrashReport *)report crashReporter * post-processed report, Apple writes this out as full frame entries. We use the latter format. */ for (NSUInteger frame_idx = 0; frame_idx < [exception.stackFrames count]; frame_idx++) { BITPLCrashReportStackFrameInfo *frameInfo = exception.stackFrames[frame_idx]; - [text appendString: [[self class] bit_formatStackFrame: frameInfo frameIndex: frame_idx report: report lp64: lp64]]; + [text appendString: [[self class] bit_formatStackFrame:frameInfo frameIndex:frame_idx report:report lp64:lp64]]; } [text appendString: @"\n"]; } @@ -632,7 +623,7 @@ + (NSString *)stringValueForCrashReport:(BITPLCrashReport *)report crashReporter * * @return The selector as a C string or NULL if no selector was found */ -+ (NSString *)selectorForRegisterWithName:(NSString *)regName ofThread:(BITPLCrashReportThreadInfo *)thread report:(BITPLCrashReport *)report { ++ (NSString *)selectorForRegisterWithName:(NSString *)regName ofThread:(BITPLCrashReportThreadInfo *)thread report:(BITPLCrashReport *)report lp64:(boolean_t)lp64 { // get the address for the register uint64_t regAddress = 0; @@ -643,13 +634,20 @@ + (NSString *)selectorForRegisterWithName:(NSString *)regName ofThread:(BITPLCra } } - if (regAddress == 0) + if (regAddress == 0) { return nil; + } + + // When on an ARM64 architecture, normalize the address to remove possible pointer signatures + uint64_t normalizedRegAddress = regAddress; + if (lp64) { + normalizedRegAddress = regAddress & 0x0000000fffffffff; + } - BITPLCrashReportBinaryImageInfo *imageForRegAddress = [report imageForAddress:regAddress]; + BITPLCrashReportBinaryImageInfo *imageForRegAddress = [report imageForAddress:normalizedRegAddress]; if (imageForRegAddress) { // get the SEL - const char *foundSelector = findSEL([imageForRegAddress.imageName UTF8String], imageForRegAddress.imageUUID, regAddress - (uint64_t)imageForRegAddress.imageBaseAddress); + const char *foundSelector = findSEL([imageForRegAddress.imageName UTF8String], imageForRegAddress.imageUUID, normalizedRegAddress - (uint64_t)imageForRegAddress.imageBaseAddress); if (foundSelector != NULL) { return [NSString stringWithUTF8String:foundSelector]; @@ -773,14 +771,18 @@ + (NSString *)bit_archNameFromCPUType:(uint64_t)cpuType subType:(uint64_t)subTyp case CPU_TYPE_ARM64: /* Apple includes subtype for ARM64 binaries. */ switch (subType) { - case CPU_SUBTYPE_ARM_ALL: + case CPU_SUBTYPE_ARM64_ALL: archName = @"arm64"; break; - case CPU_SUBTYPE_ARM_V8: + case CPU_SUBTYPE_ARM64_V8: archName = @"arm64"; break; + case CPU_SUBTYPE_ARM64E: + archName = @"arm64e"; + break; + default: archName = @"arm64-unknown"; break; @@ -830,11 +832,16 @@ + (NSString *)bit_formatStackFrame: (BITPLCrashReportStackFrameInfo *) frameInfo NSString *imageName = @"\?\?\?"; NSString *symbolString = nil; - BITPLCrashReportBinaryImageInfo *imageInfo = [report imageForAddress: frameInfo.instructionPointer]; + // When on an ARM64 architecture, normalize the address to remove possible pointer signatures + uint64_t normalizedInstructionPointer = lp64 ? (frameInfo.instructionPointer & 0x0000000fffffffff) : frameInfo.instructionPointer; + uint64_t untouchedInstructionPointer = frameInfo.instructionPointer; + + BITPLCrashReportBinaryImageInfo *imageInfo = [report imageForAddress: normalizedInstructionPointer]; + if (imageInfo != nil) { imageName = [imageInfo.imageName lastPathComponent]; baseAddress = imageInfo.imageBaseAddress; - pcOffset = frameInfo.instructionPointer - imageInfo.imageBaseAddress; + pcOffset = normalizedInstructionPointer - imageInfo.imageBaseAddress; } /* Make sure UTF8/16 characters are handled correctly */ @@ -880,7 +887,7 @@ + (NSString *)bit_formatStackFrame: (BITPLCrashReportStackFrameInfo *) frameInfo } - uint64_t symOffset = frameInfo.instructionPointer - frameInfo.symbolInfo.startAddress; + uint64_t symOffset = normalizedInstructionPointer - frameInfo.symbolInfo.startAddress; symbolString = [NSString stringWithFormat: @"%@ + %" PRId64, symbolName, symOffset]; } else { symbolString = [NSString stringWithFormat: @"0x%" PRIx64 " + %" PRId64, baseAddress, pcOffset]; @@ -892,7 +899,7 @@ + (NSString *)bit_formatStackFrame: (BITPLCrashReportStackFrameInfo *) frameInfo return [NSString stringWithFormat: @"%-4ld%-35S 0x%0*" PRIx64 " %@\n", (long) frameIndex, (const uint16_t *)[imageName cStringUsingEncoding: NSUTF16StringEncoding], - lp64 ? 16 : 8, frameInfo.instructionPointer, + lp64 ? 16 : 8, untouchedInstructionPointer, symbolString]; } diff --git a/Classes/BITFeedbackActivity.m b/Classes/BITFeedbackActivity.m index 08e17750..652be5b4 100644 --- a/Classes/BITFeedbackActivity.m +++ b/Classes/BITFeedbackActivity.m @@ -111,7 +111,7 @@ - (BOOL)canPerformWithActivityItems:(NSArray *)activityItems { } - (void)prepareWithActivityItems:(NSArray *)activityItems { - for (id item in activityItems) { + for (id item in activityItems) { if ([item isKindOfClass:[NSString class]] || [item isKindOfClass:[UIImage class]] || [item isKindOfClass:[NSData class]] || diff --git a/Classes/BITFeedbackComposeViewController.m b/Classes/BITFeedbackComposeViewController.m index de7274fb..e948a677 100644 --- a/Classes/BITFeedbackComposeViewController.m +++ b/Classes/BITFeedbackComposeViewController.m @@ -39,13 +39,38 @@ #import "BITFeedbackUserDataViewController.h" #import "BITHockeyBaseManagerPrivate.h" - #import "BITHockeyHelper.h" - #import "BITImageAnnotationViewController.h" #import "BITHockeyAttachment.h" -@interface BITFeedbackComposeViewController () { +#import + + +static const CGFloat kPhotoCompressionQuality = (CGFloat)0.7; +static const CGFloat kSscrollViewWidth = 100; + + +@interface InputAccessoryView : UIView +@end + +@implementation InputAccessoryView + +- (id)init { + self = [super initWithFrame:CGRectZero]; + if (self) { + self.backgroundColor = [UIColor colorWithRed:(CGFloat)0.9 green:(CGFloat)0.9 blue:(CGFloat)0.9 alpha:(CGFloat)1.0]; + self.autoresizingMask = UIViewAutoresizingFlexibleHeight; + } + return self; +} + +- (CGSize)intrinsicContentSize { + return CGSizeZero; +} + +@end + +@interface BITFeedbackComposeViewController () { } @property (nonatomic, weak) BITFeedbackManager *manager; @@ -54,6 +79,8 @@ @interface BITFeedbackComposeViewController () item in items) { if ([item isKindOfClass:[NSString class]]) { self.text = [(self.text ? self.text : @"") stringByAppendingFormat:@"%@%@", (self.text ? @" " : @""), item]; } else if ([item isKindOfClass:[NSURL class]]) { self.text = [(self.text ? self.text : @"") stringByAppendingFormat:@"%@%@", (self.text ? @" " : @""), [(NSURL *)item absoluteString]]; } else if ([item isKindOfClass:[UIImage class]]) { - UIImage *image = item; + UIImage *image = (UIImage *)item; BITFeedbackMessageAttachment *attachment = [BITFeedbackMessageAttachment attachmentWithData:UIImageJPEGRepresentation(image, (CGFloat)0.7) contentType:@"image/jpeg"]; attachment.originalFilename = [NSString stringWithFormat:@"Image_%li.jpg", (unsigned long)[self.attachments count]]; [self.attachments addObject:attachment]; [self.imageAttachments addObject:attachment]; } else if ([item isKindOfClass:[NSData class]]) { - BITFeedbackMessageAttachment *attachment = [BITFeedbackMessageAttachment attachmentWithData:item contentType:@"application/octet-stream"]; + BITFeedbackMessageAttachment *attachment = [BITFeedbackMessageAttachment attachmentWithData:(NSData *)item contentType:@"application/octet-stream"]; attachment.originalFilename = [NSString stringWithFormat:@"Attachment_%li.data", (unsigned long)[self.attachments count]]; [self.attachments addObject:attachment]; } else if ([item isKindOfClass:[BITHockeyAttachment class]]) { @@ -147,50 +174,24 @@ - (void)prepareWithItems:(NSArray *)items { #pragma mark - Keyboard -- (void)keyboardWasShown:(NSNotification*)aNotification { - NSDictionary* info = [aNotification userInfo]; - CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - - BOOL isPortraitOrientation = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]); - - CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); - if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) { - frame.size.height -= kbSize.height; - } else { - CGSize windowSize = [[UIScreen mainScreen] bounds].size; - CGFloat windowHeight = windowSize.height - 20; - CGFloat navBarHeight = self.navigationController.navigationBar.frame.size.height; - - if (isPortraitOrientation) { - frame.size.height = windowHeight - navBarHeight - kbSize.height; - } else { - windowHeight = windowSize.height - 20; - CGFloat modalGap = 0.0; - if (windowHeight - kbSize.height < self.view.bounds.size.height) { - modalGap = 30; - } else { - modalGap = (windowHeight - self.view.bounds.size.height) / 2; - } - frame.size.height = windowSize.height - navBarHeight - modalGap - kbSize.height; - } - } - [self.contentViewContainer setFrame:frame]; - - [self performSelector:@selector(refreshAttachmentScrollview) withObject:nil afterDelay:0.0]; -} +- (void)keyboardWillChange:(NSNotification *)notification { + NSDictionary *info = [notification userInfo]; + NSTimeInterval animationDuration = [(NSNumber *)[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; + CGRect keyboardFrame = [(NSValue *)[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + self.keyboardConstraint.constant = keyboardFrame.origin.y - CGRectGetHeight(self.view.frame); -- (void)keyboardWillBeHidden:(NSNotification*) __unused aNotification { - CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); - [self.contentViewContainer setFrame:frame]; + [UIView animateWithDuration:animationDuration animations:^{ + [self.view layoutIfNeeded]; + }]; } - #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; self.title = BITHockeyLocalizedString(@"HockeyFeedbackComposeTitle"); + self.edgesForExtendedLayout = UIRectEdgeNone; self.view.backgroundColor = [UIColor whiteColor]; // Do any additional setup after loading the view. @@ -204,38 +205,89 @@ - (void)viewDidLoad { // Container that contains both the textfield and eventually the photo scroll view on the right side self.contentViewContainer = [[UIView alloc] initWithFrame:self.view.bounds]; - self.contentViewContainer.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; - + self.contentViewContainer.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSubview:self.contentViewContainer]; - // message input textfield - self.textView = [[UITextView alloc] initWithFrame:self.view.bounds]; + // Use keyboard constraint + self.keyboardConstraint = [NSLayoutConstraint constraintWithItem:self.contentViewContainer + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationGreaterThanOrEqual + toItem:self.view + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:0]; + self.keyboardConstraint.priority = UILayoutPriorityDefaultLow; + [self.view addConstraints:@[self.keyboardConstraint]]; + + // Use safe area constraints +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0 + if (@available(iOS 11, *)) { + UILayoutGuide *safeArea = self.view.safeAreaLayoutGuide; + [NSLayoutConstraint activateConstraints:@[ + [self.contentViewContainer.trailingAnchor constraintEqualToAnchor:safeArea.trailingAnchor], + [self.contentViewContainer.leadingAnchor constraintEqualToAnchor:safeArea.leadingAnchor], + [self.contentViewContainer.topAnchor constraintEqualToAnchor:safeArea.topAnchor], + [self.contentViewContainer.bottomAnchor constraintLessThanOrEqualToAnchor:safeArea.bottomAnchor] + ]]; + } else +#endif + { + [NSLayoutConstraint activateConstraints:@[ + [self.contentViewContainer.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor], + [self.contentViewContainer.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor], + [self.contentViewContainer.topAnchor constraintEqualToAnchor:self.topLayoutGuide.bottomAnchor], + [self.contentViewContainer.bottomAnchor constraintLessThanOrEqualToAnchor:self.bottomLayoutGuide.topAnchor] + ]]; + } + + // Message input textfield + self.textView = [[UITextView alloc] initWithFrame:CGRectZero]; self.textView.font = [UIFont systemFontOfSize:17]; self.textView.delegate = self; self.textView.backgroundColor = [UIColor whiteColor]; self.textView.returnKeyType = UIReturnKeyDefault; - self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; + self.textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.textView.accessibilityHint = BITHockeyLocalizedString(@"HockeyAccessibilityHintRequired"); [self.contentViewContainer addSubview:self.textView]; // Add Photo Button + Container that's displayed above the keyboard. - if([BITHockeyHelper isPhotoAccessPossible]) { - self.textAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 44)]; - self.textAccessoryView.backgroundColor = [UIColor colorWithRed:(CGFloat)0.9 green:(CGFloat)0.9 blue:(CGFloat)0.9 alpha:(CGFloat)1.0]; - + if ([BITHockeyHelper isPhotoAccessPossible]) { + self.addPhotoButton = [UIButton buttonWithType:UIButtonTypeCustom]; [self.addPhotoButton setTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentAddImage") forState:UIControlStateNormal]; [self.addPhotoButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal]; [self.addPhotoButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled]; - self.addPhotoButton.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 44); [self.addPhotoButton addTarget:self action:@selector(addPhotoAction:) forControlEvents:UIControlEventTouchUpInside]; - self.addPhotoButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin; + [self.addPhotoButton setTranslatesAutoresizingMaskIntoConstraints:NO]; + [NSLayoutConstraint activateConstraints:@[ + [self.addPhotoButton.heightAnchor constraintGreaterThanOrEqualToConstant:44] + ]]; + + self.textAccessoryView = [[InputAccessoryView alloc] init]; [self.textAccessoryView addSubview:self.addPhotoButton]; + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0 + if (@available(iOS 11, *)) { + UILayoutGuide *safeArea = self.textAccessoryView.safeAreaLayoutGuide; + [NSLayoutConstraint activateConstraints:@[ + [self.addPhotoButton.leadingAnchor constraintEqualToAnchor:safeArea.leadingAnchor], + [self.addPhotoButton.trailingAnchor constraintEqualToAnchor:safeArea.trailingAnchor], + [self.addPhotoButton.topAnchor constraintEqualToAnchor:safeArea.topAnchor], + [self.addPhotoButton.bottomAnchor constraintEqualToAnchor:safeArea.bottomAnchor] + ]]; + } else +#endif + { + [NSLayoutConstraint activateConstraints:@[ + [self.addPhotoButton.leadingAnchor constraintEqualToAnchor:self.textAccessoryView.leadingAnchor], + [self.addPhotoButton.trailingAnchor constraintEqualToAnchor:self.textAccessoryView.trailingAnchor], + [self.addPhotoButton.topAnchor constraintEqualToAnchor:self.textAccessoryView.topAnchor], + [self.addPhotoButton.bottomAnchor constraintEqualToAnchor:self.textAccessoryView.bottomAnchor] + ]]; + } } - - if (!self.hideImageAttachmentButton) { self.textView.inputAccessoryView = self.textAccessoryView; } @@ -245,7 +297,7 @@ - (void)viewDidLoad { self.attachmentScrollView.scrollEnabled = YES; self.attachmentScrollView.bounces = YES; self.attachmentScrollView.autoresizesSubviews = NO; - self.attachmentScrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleRightMargin; + self.attachmentScrollView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0 if (@available(iOS 11.0, *)) { self.attachmentScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAlways; @@ -256,12 +308,9 @@ - (void)viewDidLoad { - (void)viewWillAppear:(BOOL)animated { [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWasShown:) - name:UIKeyboardDidShowNotification object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillBeHidden:) - name:UIKeyboardWillHideNotification object:nil]; + selector:@selector(keyboardWillChange:) + name:UIKeyboardWillChangeFrameNotification + object:nil]; self.manager.currentFeedbackComposeViewController = self; @@ -305,8 +354,7 @@ - (void)viewDidAppear:(BOOL)animated { } - (void)viewWillDisappear:(BOOL)animated { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil]; self.manager.currentFeedbackComposeViewController = nil; @@ -319,39 +367,16 @@ - (void)viewDidDisappear:(BOOL)animated { - (void)refreshAttachmentScrollview { CGFloat scrollViewWidth = 0; - - if (self.imageAttachments.count){ - scrollViewWidth = 100; - } - - CGRect textViewFrame = self.textView.frame; - - CGRect scrollViewFrame = self.attachmentScrollView.frame; - - BOOL alreadySetup = CGRectGetWidth(scrollViewFrame) > 0; - - if (alreadySetup && self.imageAttachments.count == 0) { - textViewFrame.size.width += 100; - self.textView.frame = textViewFrame; - scrollViewFrame.size.width = 0; - self.attachmentScrollView.frame = scrollViewFrame; - return; - } - - if (!alreadySetup) { - CGSize tempTextViewSize = CGSizeMake(self.contentViewContainer.frame.size.width, self.contentViewContainer.frame.size.height); - textViewFrame.size = tempTextViewSize; - textViewFrame.size.width -= scrollViewWidth; - // height has to be identical to the textview! - scrollViewFrame = CGRectMake(CGRectGetMaxX(textViewFrame), self.view.frame.origin.y, scrollViewWidth, CGRectGetHeight(self.textView.bounds)); - self.textView.frame = textViewFrame; - self.attachmentScrollView.frame = scrollViewFrame; - self.attachmentScrollView.contentInset = self.textView.contentInset; + if (self.imageAttachments.count) { + scrollViewWidth = kSscrollViewWidth; } + CGSize contentSize = self.contentViewContainer.frame.size; + self.textView.frame = CGRectMake(0, 0, contentSize.width - scrollViewWidth, contentSize.height); + self.attachmentScrollView.frame = CGRectMake(CGRectGetMaxX(self.textView.frame), 0, scrollViewWidth, contentSize.height); - if (self.imageAttachments.count > self.attachmentScrollViewImageViews.count){ + if (self.imageAttachments.count > self.attachmentScrollViewImageViews.count) { NSInteger numberOfViewsToCreate = self.imageAttachments.count - self.attachmentScrollViewImageViews.count; - for (int i = 0; i 0 ) { - self.navigationItem.rightBarButtonItem.enabled = YES; - } else { - self.navigationItem.rightBarButtonItem.enabled = NO; - } - - if(self.addPhotoButton) { - if (self.imageAttachments.count > 2){ - [self.addPhotoButton setEnabled:NO]; - } else { - [self.addPhotoButton setEnabled:YES]; - } + self.navigationItem.rightBarButtonItem.enabled = self.textView.text.length > 0; + if (self.addPhotoButton) { + [self.addPhotoButton setEnabled:self.imageAttachments.count <= 2]; } } @@ -414,22 +424,6 @@ - (void)removeAttachmentScrollView { self.textView.frame = frame; } - -#pragma mark - UIViewController Rotation - -- (UIInterfaceOrientationMask)supportedInterfaceOrientations{ - return UIInterfaceOrientationMaskAll; -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation) __unused fromInterfaceOrientation { - [self removeAttachmentScrollView]; - - [self refreshAttachmentScrollview]; -} -#pragma clang diagnostic pop - #pragma mark - Private methods - (void)setUserDataAction { @@ -464,7 +458,7 @@ - (void)sendAction:(id) __unused sender { } - (void)dismissWithResult:(BITFeedbackComposeResult) result { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if([strongDelegate respondsToSelector:@selector(feedbackComposeViewController:didFinishWithResult:)]) { [strongDelegate feedbackComposeViewController:self didFinishWithResult:result]; } else { @@ -500,9 +494,8 @@ - (void)paste:(id) __unused sender { - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *pickedImage = info[UIImagePickerControllerOriginalImage]; - - if (pickedImage){ - NSData *imageData = UIImageJPEGRepresentation(pickedImage, (CGFloat)0.7); + if (pickedImage) { + NSData *imageData = UIImageJPEGRepresentation(pickedImage, kPhotoCompressionQuality); BITFeedbackMessageAttachment *newAttachment = [BITFeedbackMessageAttachment attachmentWithData:imageData contentType:@"image/jpeg"]; NSURL *imagePath = [info objectForKey:@"UIImagePickerControllerReferenceURL"]; NSString *imageName = [imagePath lastPathComponent]; @@ -510,7 +503,6 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking [self.attachments addObject:newAttachment]; [self.imageAttachments addObject:newAttachment]; } - [picker dismissViewControllerAnimated:YES completion:nil]; } @@ -518,55 +510,45 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [picker dismissViewControllerAnimated:YES completion:nil]; } +// Click on screenshot in the scroll view - (void)imageButtonAction:(UIButton *)sender { - // determine the index of the feedback - NSInteger index = [self.attachmentScrollViewImageViews indexOfObject:sender]; + // Determine the index of the feedback + NSInteger index = [self.attachmentScrollViewImageViews indexOfObject:sender]; self.selectedAttachmentIndex = (self.attachmentScrollViewImageViews.count - index - 1); __weak typeof(self) weakSelf = self; - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; - - - UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentCancel") - style:UIAlertActionStyleCancel - handler:^(UIAlertAction __unused *action) { - typeof(self) strongSelf = weakSelf; - [strongSelf cancelAction]; - strongSelf.actionSheetVisible = NO; - }]; - - [alertController addAction:cancelAction]; - - UIAlertAction *editAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentEdit") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction __unused *action) { - typeof(self) strongSelf = weakSelf; - [strongSelf editAction]; - strongSelf.actionSheetVisible = NO; - }]; - - [alertController addAction:editAction]; - - UIAlertAction *deleteAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentDelete") - style:UIAlertActionStyleDestructive - handler:^(UIAlertAction __unused *action) { - typeof(self) strongSelf = weakSelf; - [strongSelf deleteAction]; - strongSelf.actionSheetVisible = NO; - }]; - - [alertController addAction:deleteAction]; - + [alertController + addAction:[UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentCancel") + style:UIAlertActionStyleCancel + handler:^(UIAlertAction __unused *action) { + typeof(self) strongSelf = weakSelf; + [strongSelf cancelAction]; + strongSelf.actionSheetVisible = NO; + }]]; + [alertController + addAction:[UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentEdit") + style:UIAlertActionStyleDefault + handler:^(UIAlertAction __unused *action) { + typeof(self) strongSelf = weakSelf; + [strongSelf editAction]; + strongSelf.actionSheetVisible = NO; + }]]; + [alertController + addAction:[UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackComposeAttachmentDelete") + style:UIAlertActionStyleDestructive + handler:^(UIAlertAction __unused *action) { + typeof(self) strongSelf = weakSelf; + [strongSelf deleteAction]; + strongSelf.actionSheetVisible = NO; + }]]; [self presentViewController:alertController animated:YES completion:nil]; self.actionSheetVisible = YES; - if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) || ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}])) { - [self.textView resignFirstResponder]; - } + [self.textView resignFirstResponder]; } @@ -607,7 +589,7 @@ - (void)textViewDidChange:(UITextView *) __unused textView { #pragma mark - UIActionSheet Delegate - (void)deleteAction { - if (self.selectedAttachmentIndex != NSNotFound){ + if (self.selectedAttachmentIndex != NSNotFound) { UIButton *imageButton = self.attachmentScrollViewImageViews[self.selectedAttachmentIndex]; BITFeedbackMessageAttachment *attachment = self.imageAttachments[self.selectedAttachmentIndex]; [attachment deleteContents]; // mandatory call to delete the files associated. @@ -619,14 +601,11 @@ - (void)deleteAction { self.selectedAttachmentIndex = NSNotFound; [self refreshAttachmentScrollview]; - - if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) || ([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}])) { - [self.textView becomeFirstResponder]; - } + [self.textView becomeFirstResponder]; } - (void)editAction { - if (self.selectedAttachmentIndex != NSNotFound){ + if (self.selectedAttachmentIndex != NSNotFound) { BITFeedbackMessageAttachment *attachment = self.imageAttachments[self.selectedAttachmentIndex]; BITImageAnnotationViewController *annotationEditor = [[BITImageAnnotationViewController alloc ] init]; annotationEditor.delegate = self; @@ -637,29 +616,15 @@ - (void)editAction { } - (void)cancelAction { - if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) || ([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){9,0,0}])) { - [self.textView becomeFirstResponder]; - } -} - -- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { - if (buttonIndex == [actionSheet destructiveButtonIndex]) { - [self deleteAction]; - } else if (buttonIndex != [actionSheet cancelButtonIndex]) { - [self editAction]; - } else { - [self cancelAction]; - } - self.actionSheetVisible = NO; + [self.textView becomeFirstResponder]; } - #pragma mark - Image Annotation Delegate - (void)annotationController:(BITImageAnnotationViewController *) __unused annotationController didFinishWithImage:(UIImage *)image { - if (self.selectedAttachmentIndex != NSNotFound){ + if (self.selectedAttachmentIndex != NSNotFound) { BITFeedbackMessageAttachment *attachment = self.imageAttachments[self.selectedAttachmentIndex]; - [attachment replaceData:UIImageJPEGRepresentation(image, (CGFloat)0.7)]; + [attachment replaceData:UIImageJPEGRepresentation(image, kPhotoCompressionQuality)]; } self.selectedAttachmentIndex = NSNotFound; diff --git a/Classes/BITFeedbackListViewCell.m b/Classes/BITFeedbackListViewCell.m index 59d661ad..bac44bbf 100644 --- a/Classes/BITFeedbackListViewCell.m +++ b/Classes/BITFeedbackListViewCell.m @@ -148,7 +148,7 @@ - (void) updateAttachmentFromNotification:(NSNotification *)note { if (!self.message.attachments) return; if (self.message.attachments.count == 0) return; if (!note.object) return; - if (![note.object isKindOfClass:[BITFeedbackMessageAttachment class]]) return; + if (![(NSObject *)note.object isKindOfClass:[BITFeedbackMessageAttachment class]]) return; BITFeedbackMessageAttachment *attachment = (BITFeedbackMessageAttachment *)note.object; if (![self.message.attachments containsObject:attachment]) return; @@ -197,28 +197,11 @@ + (CGFloat) heightForRowWithMessage:(BITFeedbackMessage *)message tableViewWidth + (CGFloat) heightForTextInRowWithMessage:(BITFeedbackMessage *)message tableViewWidth:(CGFloat)width { - CGFloat calculatedHeight; - - if ([message.text respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) { - CGRect calculatedRect = [message.text boundingRectWithSize:CGSizeMake(width - (2 * FRAME_SIDE_BORDER), CGFLOAT_MAX) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading - attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:TEXT_FONTSIZE]} - context:nil]; - calculatedHeight = calculatedRect.size.height + FRAME_TOP_BORDER + LABEL_TEXT_Y + FRAME_BOTTOM_BORDER; - - // added to make space for the images. - - - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - calculatedHeight = [message.text sizeWithFont:[UIFont systemFontOfSize:TEXT_FONTSIZE] - constrainedToSize:CGSizeMake(width - (2 * FRAME_SIDE_BORDER), CGFLOAT_MAX) - ].height + FRAME_TOP_BORDER + LABEL_TEXT_Y + FRAME_BOTTOM_BORDER; - -#pragma clang diagnostic pop - } - + CGRect calculatedRect = [message.text boundingRectWithSize:CGSizeMake(width - (2 * FRAME_SIDE_BORDER), CGFLOAT_MAX) + options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading + attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:TEXT_FONTSIZE]} + context:nil]; + CGFloat calculatedHeight = calculatedRect.size.height + FRAME_TOP_BORDER + LABEL_TEXT_Y + FRAME_BOTTOM_BORDER; return ceil(calculatedHeight); } @@ -341,7 +324,7 @@ - (void)layoutSubviews { } - (void)imageButtonPressed:(id)sender { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(listCell:didSelectAttachment:)]) { NSUInteger index = [self.attachmentViews indexOfObject:sender]; if (index != NSNotFound && [self.message previewableAttachments].count > index) { diff --git a/Classes/BITFeedbackListViewController.h b/Classes/BITFeedbackListViewController.h index 62fd91d5..427ca708 100644 --- a/Classes/BITFeedbackListViewController.h +++ b/Classes/BITFeedbackListViewController.h @@ -55,7 +55,7 @@ This ensures that the presentation on iOS 6 and iOS 7 will use the current design on each OS Version. */ -@interface BITFeedbackListViewController : BITHockeyBaseViewController { +@interface BITFeedbackListViewController : BITHockeyBaseViewController { } @end diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 09d05230..d4c5c211 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -364,36 +364,12 @@ - (void)feedbackComposeViewController:(BITFeedbackComposeViewController *)compos } else { [self dismissViewControllerAnimated:YES completion:^(void){}]; } - id strongDelegate = strongManager.delegate; + id strongDelegate = strongManager.delegate; if ([strongDelegate respondsToSelector:@selector(feedbackComposeViewController:didFinishWithResult:)]) { [strongDelegate feedbackComposeViewController:composeViewController didFinishWithResult:composeResult]; } } - -#pragma mark - UIViewController Rotation - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - self.numberOfSectionsBeforeRotation = [self numberOfSectionsInTableView:self.tableView]; - self.numberOfMessagesBeforeRotation = [self.manager numberOfMessages]; - [self.tableView reloadData]; - [self.tableView beginUpdates]; - [self.tableView endUpdates]; - - self.numberOfSectionsBeforeRotation = -1; - self.numberOfMessagesBeforeRotation = -1; - [self.tableView reloadData]; - - [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; -} -#pragma clang diagnostic pop - -- (UIInterfaceOrientationMask)supportedInterfaceOrientations{ - return UIInterfaceOrientationMaskAll; -} - #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *) __unused tableView { @@ -672,47 +648,23 @@ - (void)attributedLabel:(BITAttributedLabel *) __unused label didSelectLinkWithU UIAlertController *linkAction = [UIAlertController alertControllerWithTitle:[url absoluteString] message:nil preferredStyle:controllerStyle]; - UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCancel") - style:UIAlertActionStyleCancel - handler:^(UIAlertAction __unused *action) {}]; - [linkAction addAction:cancelAction]; - UIAlertAction* openAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionOpen") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction __unused *action) { - [[UIApplication sharedApplication] openURL:(NSURL*)[NSURL URLWithString:(NSString*)[url absoluteString]]]; - }]; - [linkAction addAction:openAction]; - UIAlertAction* copyAction = [UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCopy") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction __unused *action) { - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - pasteboard.URL = [NSURL URLWithString:(NSString*)[url absoluteString]]; - }]; - [linkAction addAction:copyAction]; + [linkAction addAction:[UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCancel") + style:UIAlertActionStyleCancel + handler:nil]]; + [linkAction addAction:[UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionOpen") + style:UIAlertActionStyleDefault + handler:^(UIAlertAction __unused *action) { + [[UIApplication sharedApplication] openURL:url]; + }]]; + [linkAction addAction:[UIAlertAction actionWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCopy") + style:UIAlertActionStyleDefault + handler:^(UIAlertAction __unused *action) { + UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; + pasteboard.URL = url; + }]]; [self presentViewController:linkAction animated:YES completion:nil]; } -#pragma mark - UIActionSheetDelegate - -- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { - if (buttonIndex == actionSheet.cancelButtonIndex) { - return; - } - - if ([actionSheet tag] == 0) { - if (buttonIndex == [actionSheet destructiveButtonIndex]) { - [self deleteAllMessages]; - } - } else { - if (buttonIndex == [actionSheet firstOtherButtonIndex]) { - [[UIApplication sharedApplication] openURL:(NSURL *)[NSURL URLWithString:actionSheet.title]]; - } else { - UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; - pasteboard.URL = [NSURL URLWithString:actionSheet.title]; - } - } -} - #pragma mark - ListViewCellDelegate - (void)listCell:(id) __unused cell didSelectAttachment:(BITFeedbackMessageAttachment *)attachment { diff --git a/Classes/BITFeedbackManager.h b/Classes/BITFeedbackManager.h index 507788df..ba4f4272 100644 --- a/Classes/BITFeedbackManager.h +++ b/Classes/BITFeedbackManager.h @@ -70,7 +70,7 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) { */ BITFeedbackObservationNone = 0, /** - * Triggers when the user takes a screenshot. This will grab the latest image from the camera roll. Requires iOS 7 or later! + * Triggers when the user takes a screenshot. This will grab the latest image from the camera roll. */ BITFeedbackObservationModeOnScreenshot = 1, /** diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index caaa619a..9a3a8e23 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -227,7 +227,7 @@ - (BITFeedbackComposeViewController *)feedbackComposeViewController { BITFeedbackComposeViewController *composeViewController = [[BITFeedbackComposeViewController alloc] init]; NSArray *preparedItems = [NSArray array]; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(preparedItemsForFeedbackManager:)]) { preparedItems = [preparedItems arrayByAddingObjectsFromArray:(NSArray *)[strongDelegate preparedItemsForFeedbackManager:self]]; } @@ -288,7 +288,7 @@ - (void)startManager { - (BOOL)allowFetchingNewMessages { BOOL fetchNewMessages = YES; - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(allowAutomaticFetchingForNewFeedbackForManager:)]) { fetchNewMessages = [strongDelegate allowAutomaticFetchingForNewFeedbackForManager:self]; } @@ -317,7 +317,7 @@ - (BOOL)updateUserIDUsingKeychainAndDelegate { BOOL availableViaDelegate = NO; NSString *userID = [self stringValueFromKeychainForKey:kBITHockeyMetaUserID]; - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(userIDForHockeyManager:componentManager:)]) { userID = [strongDelegate userIDForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self]; } @@ -334,7 +334,7 @@ - (BOOL)updateUserNameUsingKeychainAndDelegate { BOOL availableViaDelegate = NO; NSString *userName = [self stringValueFromKeychainForKey:kBITHockeyMetaUserName]; - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(userNameForHockeyManager:componentManager:)]) { userName = [strongDelegate userNameForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self]; } @@ -352,7 +352,7 @@ - (BOOL)updateUserEmailUsingKeychainAndDelegate { BOOL availableViaDelegate = NO; NSString *userEmail = [self stringValueFromKeychainForKey:kBITHockeyMetaUserEmail]; - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(userEmailForHockeyManager:componentManager:)]) { userEmail = [strongDelegate userEmailForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self]; } @@ -649,7 +649,7 @@ - (void)deleteAllMessages { } - (BOOL)shouldForceNewThread { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if (strongDelegate && [strongDelegate respondsToSelector:@selector(forceNewFeedbackThreadForFeedbackManager:)]) { return [strongDelegate forceNewFeedbackThreadForFeedbackManager:self]; } else { @@ -762,7 +762,7 @@ - (void)updateMessageListFromResponse:(NSDictionary *)jsonDictionary { // TODO: match messages in state conflict [messagesSendInProgress enumerateObjectsUsingBlock:^(id objSendInProgressMessage, NSUInteger __unused messagesSendInProgressIdx, BOOL *stop2) { - if ([[(NSDictionary *) objMessage objectForKey:@"token"] isEqualToString:[(BITFeedbackMessage *) objSendInProgressMessage token]]) { + if ([(NSString *)[(NSDictionary *) objMessage objectForKey:@"token"] isEqualToString:[(BITFeedbackMessage *) objSendInProgressMessage token]]) { matchingSendInProgressOrInConflictMessage = objSendInProgressMessage; *stop2 = YES; } @@ -826,7 +826,7 @@ - (void)updateMessageListFromResponse:(NSDictionary *)jsonDictionary { BITFeedbackMessage *latestMessage = [self lastMessageHavingID]; if (self.userEmail && latestMessage.email && [self.userEmail compare:latestMessage.email] == NSOrderedSame) latestMessageFromUser = YES; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if (!latestMessageFromUser) { if ([strongDelegate respondsToSelector:@selector(feedbackManagerDidReceiveNewFeedback:)]) { [strongDelegate feedbackManagerDidReceiveNewFeedback:self]; diff --git a/Classes/BITFeedbackMessageAttachment.m b/Classes/BITFeedbackMessageAttachment.m index 1ea27ed7..a23bdd76 100644 --- a/Classes/BITFeedbackMessageAttachment.m +++ b/Classes/BITFeedbackMessageAttachment.m @@ -178,24 +178,17 @@ - (UIImage *)thumbnailWithSize:(CGSize)size { } CGFloat scale = [UIScreen mainScreen].scale; - if (scale != image.scale) { - CGSize scaledSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale)); - UIImage *thumbnail = bit_imageToFitSize(image, scaledSize, YES) ; - + UIImage *thumbnail = bit_imageToFitSize(image, scaledSize, YES); UIImage *scaledThumbnail = [UIImage imageWithCGImage:(CGImageRef)thumbnail.CGImage scale:scale orientation:thumbnail.imageOrientation]; if (thumbnail) { [self.thumbnailRepresentations setObject:scaledThumbnail forKey:cacheKey]; } - } else { UIImage *thumbnail = bit_imageToFitSize(image, size, YES) ; - [self.thumbnailRepresentations setObject:thumbnail forKey:cacheKey]; - } - } return self.thumbnailRepresentations[cacheKey]; diff --git a/Classes/BITHockeyBaseManager.m b/Classes/BITHockeyBaseManager.m index bf971881..6a1cff66 100644 --- a/Classes/BITHockeyBaseManager.m +++ b/Classes/BITHockeyBaseManager.m @@ -194,7 +194,7 @@ - (UINavigationController *)customNavigationControllerWithRootViewController:(UI - (UIViewController *)visibleWindowRootViewController { UIViewController *parentViewController = nil; - id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; + id strongDelegate = [BITHockeyManager sharedHockeyManager].delegate; if ([strongDelegate respondsToSelector:@selector(viewControllerForHockeyManager:componentManager:)]) { parentViewController = [strongDelegate viewControllerForHockeyManager:[BITHockeyManager sharedHockeyManager] componentManager:self]; } diff --git a/Classes/BITHockeyHelper.m b/Classes/BITHockeyHelper.m index c4d6a1cc..4af664bf 100644 --- a/Classes/BITHockeyHelper.m +++ b/Classes/BITHockeyHelper.m @@ -95,7 +95,7 @@ static bit_info_t hockeyapp_library_info __attribute__((section("__TEXT,__bit_io NSFileManager *fileManager = [[NSFileManager alloc] init]; // temporary directory for crashes grabbed from PLCrashReporter - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); settingsDir = [[paths objectAtIndex:0] stringByAppendingPathComponent:BITHOCKEY_IDENTIFIER]; if (![fileManager fileExistsAtPath:settingsDir]) { @@ -736,8 +736,7 @@ BOOL bit_hasAlpha(UIImage *inputImage) { #pragma mark UIImage helpers UIImage *bit_imageToFitSize(UIImage *inputImage, CGSize fitSize, BOOL honorScaleFactor) { - - if (!inputImage){ + if (!inputImage) { return nil; } diff --git a/Classes/BITHockeyManager.h b/Classes/BITHockeyManager.h index 1060a1f2..6774aa85 100644 --- a/Classes/BITHockeyManager.h +++ b/Classes/BITHockeyManager.h @@ -212,6 +212,8 @@ NS_ASSUME_NONNULL_BEGIN @see BITCrashManagerDelegate @see BITUpdateManagerDelegate @see BITFeedbackManagerDelegate + @see BITAuthenticatorDelegate + @see BITStoreUpdateManagerDelegate */ @property (nonatomic, weak, nullable) id delegate; diff --git a/Classes/BITHockeyManagerDelegate.h b/Classes/BITHockeyManagerDelegate.h index c4f099b7..ea863900 100644 --- a/Classes/BITHockeyManagerDelegate.h +++ b/Classes/BITHockeyManagerDelegate.h @@ -41,6 +41,10 @@ #import "BITFeedbackManagerDelegate.h" #endif +#if HOCKEYSDK_FEATURE_STORE_UPDATES +#import "BITStoreUpdateManagerDelegate.h" +#endif + #if HOCKEYSDK_FEATURE_AUTHENTICATOR #import "BITAuthenticator.h" #endif @@ -63,6 +67,9 @@ #if HOCKEYSDK_FEATURE_FEEDBACK , BITFeedbackManagerDelegate #endif +#if HOCKEYSDK_FEATURE_STORE_UPDATES + , BITStoreUpdateManagerDelegate +#endif #if HOCKEYSDK_FEATURE_AUTHENTICATOR , BITAuthenticatorDelegate #endif diff --git a/Classes/BITImageAnnotationViewController.m b/Classes/BITImageAnnotationViewController.m index f8d95972..763d5ef6 100644 --- a/Classes/BITImageAnnotationViewController.m +++ b/Classes/BITImageAnnotationViewController.m @@ -82,11 +82,6 @@ - (void)viewDidLoad { [self.editingControls setImage:bit_imageNamed(imageName, BITHOCKEYSDK_BUNDLE) forSegmentAtIndex:i++]; } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.editingControls setSegmentedControlStyle:UISegmentedControlStyleBar]; -#pragma clang diagnostic pop - self.navigationItem.titleView = self.editingControls; self.objects = [NSMutableArray new]; @@ -349,50 +344,12 @@ - (void)pinched:(UIPinchGestureRecognizer *)gestureRecognizer { } - (void)tapped:(UIGestureRecognizer *) __unused tapRecognizer { - - // TODO: remove pre-iOS 8 code. - - // This toggles the nav and status bar. Since iOS7 and pre-iOS7 behave weirdly different, - // this might look rather hacky, but hiding the navbar under iOS6 leads to some ugly - // animation effect which is avoided by simply hiding the navbar setting it's alpha to 0. // moritzh - - if (self.navigationController.navigationBar.alpha == 0 || self.navigationController.navigationBarHidden ){ - - [UIView animateWithDuration:0.35 animations:^{ - [self.navigationController setNavigationBarHidden:NO animated:NO]; - - if ([self respondsToSelector:@selector(prefersStatusBarHidden)]) { - [self setNeedsStatusBarAppearanceUpdate]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [[UIApplication sharedApplication] setStatusBarHidden:NO]; -#pragma clang diagnostic pop - } - - } completion:^(BOOL __unused finished) { - [self fitImageViewFrame]; - - }]; - } else { - [UIView animateWithDuration:0.35 animations:^{ - [self.navigationController setNavigationBarHidden:YES animated:NO]; - - if ([self respondsToSelector:@selector(prefersStatusBarHidden)]) { - [self setNeedsStatusBarAppearanceUpdate]; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [[UIApplication sharedApplication] setStatusBarHidden:YES]; -#pragma clang diagnostic pop - } - - } completion:^(BOOL __unused finished) { - [self fitImageViewFrame]; - - }]; - } - + [UIView animateWithDuration:0.35 animations:^{ + [self.navigationController setNavigationBarHidden:!self.prefersStatusBarHidden animated:NO]; + [self setNeedsStatusBarAppearanceUpdate]; + } completion:^(BOOL __unused finished) { + [self fitImageViewFrame]; + }]; } #pragma mark - Helpers diff --git a/Classes/BITStoreButton.m b/Classes/BITStoreButton.m index 8ac67a3e..8c4142f2 100644 --- a/Classes/BITStoreButton.m +++ b/Classes/BITStoreButton.m @@ -206,23 +206,11 @@ - (instancetype)initWithPadding:(CGPoint)padding style:(BITStoreButtonStyle)styl - (CGSize)sizeThatFits:(CGSize) __unused size { CGSize constr = (CGSize){.height = self.frame.size.height, .width = BIT_MAX_WIDTH}; - CGSize newSize; - - if ([self.buttonData.label respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) { - CGRect calculatedRect = [self.buttonData.label boundingRectWithSize:constr - options:NSStringDrawingUsesFontLeading - attributes:@{NSFontAttributeName:(id)self.titleLabel.font} - context:nil]; - newSize = calculatedRect.size; - } else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - newSize = [self.buttonData.label sizeWithFont:self.titleLabel.font - constrainedToSize:constr - lineBreakMode:NSLineBreakByTruncatingMiddle]; -#pragma clang diagnostic pop - } - + CGRect calculatedRect = [self.buttonData.label boundingRectWithSize:constr + options:NSStringDrawingUsesFontLeading + attributes:@{NSFontAttributeName:(id)self.titleLabel.font} + context:nil]; + CGSize newSize = calculatedRect.size; CGFloat newWidth = newSize.width + ((CGFloat)BIT_PADDING * 2); CGFloat newHeight = (CGFloat)BIT_MIN_HEIGHT > newSize.height ? (CGFloat)BIT_MIN_HEIGHT : newSize.height; diff --git a/Classes/BITStoreUpdateManager.m b/Classes/BITStoreUpdateManager.m index 65e06a7c..1e52574f 100644 --- a/Classes/BITStoreUpdateManager.m +++ b/Classes/BITStoreUpdateManager.m @@ -179,7 +179,7 @@ - (BOOL)hasNewVersion:(NSDictionary *)dictionary { NSString *lastStoreVersion = [self lastStoreVersion]; - if ([[dictionary objectForKey:@"results"] isKindOfClass:[NSArray class]] && + if ([(NSObject *)[dictionary objectForKey:@"results"] isKindOfClass:[NSArray class]] && [(NSArray *)[dictionary objectForKey:@"results"] count] > 0 ) { self.lastCheckFailed = NO; @@ -300,7 +300,7 @@ - (BOOL)processStoreResponseWithString:(NSString *)responseString { } if ([self isUpdateAvailable]) { - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(detectedUpdateFromStoreUpdateManager:newVersion:storeURL:)]) { [strongDelegate detectedUpdateFromStoreUpdateManager:self newVersion:self.latestStoreVersion storeURL:[NSURL URLWithString:self.appStoreURLString]]; } diff --git a/Classes/BITStoreUpdateManagerPrivate.h b/Classes/BITStoreUpdateManagerPrivate.h index 156913c5..a092a43c 100644 --- a/Classes/BITStoreUpdateManagerPrivate.h +++ b/Classes/BITStoreUpdateManagerPrivate.h @@ -41,7 +41,7 @@ /** Sets the optional `BITStoreUpdateManagerDelegate` delegate. */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; // is an update available? diff --git a/Classes/BITUpdateManager.m b/Classes/BITUpdateManager.m index c52bf7b9..7a173b41 100644 --- a/Classes/BITUpdateManager.m +++ b/Classes/BITUpdateManager.m @@ -111,7 +111,7 @@ - (void)didBecomeActiveActions { // was tapped, so we assume the user agreed if (self.didStartUpdateProcess) { self.didStartUpdateProcess = NO; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(updateManagerWillExitApp:)]) { [strongDelegate updateManagerWillExitApp:self]; } @@ -217,7 +217,7 @@ - (void)checkExpiryDateReached { if (![self expiryDateReached]) return; BOOL shouldShowDefaultAlert = YES; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(shouldDisplayExpiryAlertForUpdateManager:)]) { shouldShowDefaultAlert = [strongDelegate shouldDisplayExpiryAlertForUpdateManager:self]; } @@ -353,7 +353,7 @@ - (void)checkUpdateAvailable { [self saveAppCache]; } else { [self.appVersions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if (idx > 0 && [obj isKindOfClass:[BITAppVersionMetaInfo class]]) { + if (idx > 0 && [(NSObject *)obj isKindOfClass:[BITAppVersionMetaInfo class]]) { NSComparisonResult compareVersions = bit_versionCompare([(BITAppVersionMetaInfo *)obj version], self.currentAppVersion); BOOL uuidFound = [(BITAppVersionMetaInfo *)obj hasUUID:self.uuid]; @@ -449,7 +449,7 @@ - (instancetype)init { if ([[NSUserDefaults standardUserDefaults] objectForKey:kBITUpdateDateOfLastCheck]) { // we did write something else in the past, so for compatibility reasons do this id tempLastCheck = [[NSUserDefaults standardUserDefaults] objectForKey:kBITUpdateDateOfLastCheck]; - if ([tempLastCheck isKindOfClass:[NSDate class]]) { + if ([(NSObject *)tempLastCheck isKindOfClass:[NSDate class]]) { _lastCheck = tempLastCheck; } } @@ -523,7 +523,7 @@ - (void)showUpdateView { - (void)showCheckForUpdateAlert { if (self.appEnvironment != BITEnvironmentOther) return; if ([self isUpdateManagerDisabled]) return; - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(shouldDisplayUpdateAlertForUpdateManager:forShortVersion:forVersion:)] && ![strongDelegate shouldDisplayUpdateAlertForUpdateManager:self forShortVersion:[self.newestAppVersion shortVersion] forVersion:[self.newestAppVersion version]]) { return; @@ -837,7 +837,7 @@ - (BOOL)initiateAppDownload { NSString *iOSUpdateURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", bit_URLEncodedString(hockeyAPIURL)]; // Notify delegate of update intent before placing the call - id stronDelegate = self.delegate; + id stronDelegate = self.delegate; if ([stronDelegate respondsToSelector:@selector(willStartDownloadAndUpdate:)]) { [stronDelegate willStartDownloadAndUpdate:self]; } @@ -860,7 +860,7 @@ - (void)startManager { if ([self isUpdateManagerDisabled]) return; BITHockeyLogDebug(@"INFO: Starting UpdateManager"); - id strongDelegate = self.delegate; + id strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(updateManagerShouldSendUsageData:)]) { self.sendUsageData = [strongDelegate updateManagerShouldSendUsageData:self]; } @@ -907,7 +907,7 @@ - (void)finishLoading { NSError *error = nil; NSDictionary *json = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:(NSData *)[responseString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:&error]; - self.companyName = (([[json valueForKey:@"company"] isKindOfClass:[NSString class]]) ? [json valueForKey:@"company"] : nil); + self.companyName = (([(NSObject *)[json valueForKey:@"company"] isKindOfClass:[NSString class]]) ? [json valueForKey:@"company"] : nil); if (self.appEnvironment == BITEnvironmentOther) { NSArray *feedArray = (NSArray *)[json valueForKey:@"versions"]; diff --git a/Classes/BITUpdateManagerPrivate.h b/Classes/BITUpdateManagerPrivate.h index f578247a..bb60aa91 100644 --- a/Classes/BITUpdateManagerPrivate.h +++ b/Classes/BITUpdateManagerPrivate.h @@ -50,7 +50,7 @@ @see `[BITHockeyManager setDelegate:]` */ -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; // is an update available? diff --git a/Classes/BITUpdateViewController.m b/Classes/BITUpdateViewController.m index ee9ab55d..d32a4c07 100644 --- a/Classes/BITUpdateViewController.m +++ b/Classes/BITUpdateViewController.m @@ -54,7 +54,6 @@ @interface BITUpdateViewController () @property (nonatomic) BOOL showAllVersions; @property (nonatomic, strong) BITAppStoreHeader *appStoreHeader; @property (nonatomic, strong) BITStoreButton *appStoreButton; -@property (nonatomic, strong) id popOverController; @property (nonatomic, strong) NSMutableArray *cells; @property (nonatomic) BITEnvironment appEnvironment; @@ -254,7 +253,6 @@ - (instancetype)initWithStyle:(UITableViewStyle) __unused style { self.title = BITHockeyLocalizedString(@"UpdateScreenTitle"); self.cells = [[NSMutableArray alloc] initWithCapacity:5]; - self.popOverController = nil; } return self; } @@ -336,8 +334,6 @@ - (void)viewWillAppear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated { self.updateManager.currentHockeyViewController = nil; - //if the popover is still visible, dismiss it - [self.popOverController dismissPopoverAnimated:YES]; [super viewWillDisappear:animated]; } @@ -474,17 +470,6 @@ - (UITableViewCell *)tableView:(UITableView *) __unused tableView cellForRowAtIn } } - -#pragma mark - Rotation - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" -- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) __unused interfaceOrientation duration:(NSTimeInterval) __unused duration { - // update all cells - [self.cells makeObjectsPerformSelector:@selector(addWebView)]; -} -#pragma clang diagnostic pop - #pragma mark - PSAppStoreHeaderDelegate - (void)setAppStoreButtonState:(AppStoreButtonState)anAppStoreButtonState { diff --git a/Classes/HockeySDK.h b/Classes/HockeySDK.h index 07abc822..b206efb0 100644 --- a/Classes/HockeySDK.h +++ b/Classes/HockeySDK.h @@ -29,12 +29,6 @@ #import - -#if !defined (TARGET_OS_IOS) // Defined starting in iOS 9 -#define TARGET_OS_IOS 1 -#endif - - #import "HockeySDKFeatureConfig.h" #import "HockeySDKEnums.h" #import "HockeySDKNullability.h" @@ -42,6 +36,8 @@ #import "BITHockeyManager.h" #import "BITHockeyManagerDelegate.h" +#import "BITHockeyLogger.h" + #if HOCKEYSDK_FEATURE_CRASH_REPORTER || HOCKEYSDK_FEATURE_FEEDBACK #import "BITHockeyAttachment.h" #endif diff --git a/Documentation/Guides/Changelog.md b/Documentation/Guides/Changelog.md index 64aa7af5..bf187283 100644 --- a/Documentation/Guides/Changelog.md +++ b/Documentation/Guides/Changelog.md @@ -1,3 +1,10 @@ +## 5.1.3 + +- [FIX] Support new arm64e architecture in crash reports. [#527](https://github.com/bitstadium/HockeySDK-iOS/pull/526) +- [FIX] Fix bug in app termination heuristic. [#523](https://github.com/bitstadium/HockeySDK-iOS/pull/523) +- [FIX] Fix Feedback UI on iPhone X. [#513](https://github.com/bitstadium/HockeySDK-iOS/pull/513)[#508](https://github.com/bitstadium/HockeySDK-iOS/pull/508) +- [IMPROVEMENT] Make it possible to use own logging handler. [#516](https://github.com/bitstadium/HockeySDK-iOS/pull/516) + ## 5.1.2 - [IMPROVEMENT] This release uses Xcode 9.2 to compile the SDK. [#502](https://github.com/bitstadium/HockeySDK-iOS/pull/503) diff --git a/Documentation/Guides/Installation & Setup.md b/Documentation/Guides/Installation & Setup.md index 2ca0440c..04a6b2f7 100644 --- a/Documentation/Guides/Installation & Setup.md +++ b/Documentation/Guides/Installation & Setup.md @@ -3,9 +3,9 @@ [![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK) [![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net) -## Version 5.1.2 +## Version 5.1.3 -- [Changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.2/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.3/docs/docs/Changelog.html) **NOTE** If your are using the binary integration of our SDK, make sure that the `HockeySDKResources.bundle` inside the `HockeySDK.embeddedframework`-folder has been added to your application. @@ -64,7 +64,7 @@ This document contains the following sections: ## 1. Requirements 1. We assume that you already have a project in Xcode and that this project is opened in Xcode 8 or later. -2. The SDK supports iOS 8.0 and later. +2. The SDK supports iOS 9.0 and later. ## 2. Setup @@ -215,7 +215,7 @@ Note that not using clang modules also means that you can't use the `@import` sy **Podfile** ```ruby -platform :ios, '8.0' +platform :ios, '9.0' pod "HockeySDK" ``` @@ -224,7 +224,7 @@ pod "HockeySDK" The default and recommended distribution is a binary (static library) and a resource bundle with translations and images for all SDK features. ```ruby -platform :ios, '8.0' +platform :ios, '9.0' pod "HockeySDK" ``` @@ -821,7 +821,7 @@ To check if data is send properly to HockeyApp and also see some additional SDK ## 4. Documentation -Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/5.1.2/index.html). +Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/5.1.3/index.html). ## 5.Troubleshooting @@ -835,7 +835,7 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/ Make sure none of the following files are copied into your app bundle, check under app target, `Build Phases`, `Copy Bundle Resources` or in the `.app` bundle after building: - `HockeySDK.framework` (except if you build a dynamic framework version of the SDK yourself!) - - `de.bitstadium.HockeySDK-iOS-5.1.2.docset` + - `de.bitstadium.HockeySDK-iOS-5.1.3.docset` ### Features are not working as expected diff --git a/Documentation/Guides/Set Custom AlertViewHandler.md b/Documentation/Guides/Set Custom AlertViewHandler.md index b11ea780..15c64ed2 100644 --- a/Documentation/Guides/Set Custom AlertViewHandler.md +++ b/Documentation/Guides/Set Custom AlertViewHandler.md @@ -18,59 +18,63 @@ The following example shows how this could be implemented. We'll present a custo **Objective-C** ```objc -@interface BITAppDelegate () -@end - @implementation BITAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [self.window makeKeyAndVisible]; + [self.window makeKeyAndVisible]; - [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"<>" - delegate:nil]; - - // optionally enable logging to get more information about states. - [BITHockeyManager sharedHockeyManager].debugLogEnabled = YES; - - [[BITHockeyManager sharedHockeyManager].crashManager setAlertViewHandler:^(){ - NSString *exceptionReason = [[BITHockeyManager sharedHockeyManager].crashManager lastSessionCrashDetails].exceptionReason; - UIAlertView *customAlertView = [[UIAlertView alloc] initWithTitle: @"Oh no! The App crashed" - message: nil - delegate: self - cancelButtonTitle: @"Don't send" - otherButtonTitles: @"Send", @"Always send", nil]; - if (exceptionReason) { - customAlertView.message = @"We would like to send a crash report to the developers. Please enter a short description of what happened:"; - customAlertView.alertViewStyle = UIAlertViewStylePlainTextInput; - } else { - customAlertView.message = @"We would like to send a crash report to the developers"; - } + [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER" delegate:nil]; - [customAlertView show]; - }]; - - [[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation]; - - return YES; -} - -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { - BITCrashMetaData *crashMetaData = [BITCrashMetaData new]; - if (alertView.alertViewStyle != UIAlertViewStyleDefault) { - crashMetaData.userDescription = [alertView textFieldAtIndex:0].text; - } - switch (buttonIndex) { - case 0: - [[BITHockeyManager sharedHockeyManager].crashManager handleUserInput:BITCrashManagerUserInputDontSend withUserProvidedMetaData:nil]; - break; - case 1: - [[BITHockeyManager sharedHockeyManager].crashManager handleUserInput:BITCrashManagerUserInputSend withUserProvidedMetaData:crashMetaData]; - break; - case 2: - [[BITHockeyManager sharedHockeyManager].crashManager handleUserInput:BITCrashManagerUserInputAlwaysSend withUserProvidedMetaData:crashMetaData]; - break; - } + // optionally enable logging to get more information about states. + [BITHockeyManager sharedHockeyManager].logLevel = BITLogLevelVerbose; + + [[BITHockeyManager sharedHockeyManager].crashManager setAlertViewHandler:^() { + NSString *exceptionReason = [[BITHockeyManager sharedHockeyManager].crashManager lastSessionCrashDetails].exceptionReason; + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Oh no! The App crashed" + message:@"We would like to send a crash report to the developers." + preferredStyle:UIAlertControllerStyleAlert]; + if (exceptionReason) { + alertController.message = [NSString stringWithFormat:@"%@ Please enter a short description of what happened:", alertController.message]; + [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) { + textField.placeholder = @"Description"; + textField.keyboardType = UIKeyboardTypeDefault; + }]; + } + [alertController addAction:[UIAlertAction actionWithTitle:@"Don't send" + style:UIAlertActionStyleCancel + handler:^(UIAlertAction __unused *action) { + [[BITHockeyManager sharedHockeyManager].crashManager + handleUserInput:BITCrashManagerUserInputDontSend + withUserProvidedMetaData:nil]; + }]]; + [alertController addAction:[UIAlertAction actionWithTitle:@"Send" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction __unused *action) { + BITCrashMetaData *crashMetaData = [BITCrashMetaData new]; + if (exceptionReason) { + crashMetaData.userProvidedDescription = alertController.textFields[0].text; + } + [[BITHockeyManager sharedHockeyManager].crashManager + handleUserInput:BITCrashManagerUserInputSend + withUserProvidedMetaData:crashMetaData]; +c }]]; + [alertController addAction:[UIAlertAction actionWithTitle:@"Always send" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction __unused *action) { + BITCrashMetaData *crashMetaData = [BITCrashMetaData new]; + if (exceptionReason) { + crashMetaData.userProvidedDescription = alertController.textFields[0].text; + } + [[BITHockeyManager sharedHockeyManager].crashManager + handleUserInput:BITCrashManagerUserInputAlwaysSend + withUserProvidedMetaData:crashMetaData]; + }]]; + + [self.window.rootViewController presentViewController:alertController animated:YES completion:nil]; + }]; + + return YES; } @end @@ -79,55 +83,48 @@ The following example shows how this could be implemented. We'll present a custo **Swift** ```swift -import UIKit -import HockeySDK @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, UIAlertViewDelegate { - +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? - + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { window?.makeKeyAndVisible() - + BITHockeyManager.shared().configure(withIdentifier: "APP_IDENTIFIER") + // optionally enable logging to get more information about states. BITHockeyManager.shared().logLevel = BITLogLevel.verbose - + BITHockeyManager.shared().crashManager.setAlertViewHandler { let exceptionReason = BITHockeyManager.shared().crashManager.lastSessionCrashDetails.exceptionReason - let customAlertView = UIAlertView.init(title: "Oh no! The App crashed", - message: "The App crashed", - delegate: self, - cancelButtonTitle: "Don't send", - otherButtonTitles: "Send", "Always send") - if (exceptionReason != nil) { - customAlertView.message = "We would like to send a crash report to the developers. Please enter a short description of what happened:" - customAlertView.alertViewStyle = UIAlertViewStyle.plainTextInput; - } else { - customAlertView.message = "We would like to send a crash report to the developers" + let alertController = UIAlertController(title: "Oh no! The App crashed", message: "We would like to send a crash report to the developers.", preferredStyle: .alert) + if exceptionReason != nil { + alertController.message = alertController.message! + " Please enter a short description of what happened:" + alertController.addTextField(configurationHandler: { (textField) in + textField.placeholder = "Description" + textField.keyboardType = .default + }) } - customAlertView.show() + alertController.addAction(UIAlertAction(title: "Don't send", style: .cancel, handler: { (action) in + BITHockeyManager.shared().crashManager.handle(BITCrashManagerUserInput.dontSend, withUserProvidedMetaData: nil) + })) + alertController.addAction(UIAlertAction(title: "Send", style: .default, handler: { (action) in + let crashMetaData = BITCrashMetaData() + crashMetaData.userProvidedDescription = alertController.textFields?[0].text + BITHockeyManager.shared().crashManager.handle(BITCrashManagerUserInput.send, withUserProvidedMetaData: crashMetaData) + })) + alertController.addAction(UIAlertAction(title: "Always send", style: .default, handler: { (action) in + let crashMetaData = BITCrashMetaData() + crashMetaData.userProvidedDescription = alertController.textFields?[0].text + BITHockeyManager.shared().crashManager.handle(BITCrashManagerUserInput.alwaysSend, withUserProvidedMetaData: crashMetaData) + })) + self.window?.rootViewController?.present(alertController, animated: true) } - + return true } - - func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) { - let crashMetaData = BITCrashMetaData(); - if (alertView.alertViewStyle != UIAlertViewStyle.default) { - crashMetaData.userProvidedDescription = alertView.textField(at: 0)?.text - } - switch (buttonIndex) { - case 0: - BITHockeyManager.shared().crashManager.handle(BITCrashManagerUserInput.dontSend, withUserProvidedMetaData: nil) - case 1: - BITHockeyManager.shared().crashManager.handle(BITCrashManagerUserInput.send, withUserProvidedMetaData: crashMetaData) - case 2: - BITHockeyManager.shared().crashManager.handle(BITCrashManagerUserInput.alwaysSend, withUserProvidedMetaData: crashMetaData) - } - } } -``` - +``` diff --git a/Documentation/HockeySDK/.jazzy.yaml b/Documentation/HockeySDK/.jazzy.yaml index 5e5c34f9..71127bc5 100644 --- a/Documentation/HockeySDK/.jazzy.yaml +++ b/Documentation/HockeySDK/.jazzy.yaml @@ -5,7 +5,7 @@ sdk: iphonesimulator theme: ../Themes/apple module: HockeySDK -module_version: 5.1.2 +module_version: 5.1.3 author: Microsoft Corp author_url: https://www.microsoft.com diff --git a/HockeySDK-Source.podspec b/HockeySDK-Source.podspec index ae63f81b..87adc47e 100644 --- a/HockeySDK-Source.podspec +++ b/HockeySDK-Source.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK-Source' - s.version = '5.1.2' + s.version = '5.1.3' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC @@ -18,14 +18,14 @@ Pod::Spec.new do |s| s.author = { 'Microsoft' => 'support@hockeyapp.net' } s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS.git', :tag => s.version.to_s } - s.platform = :ios, '8.0' + s.platform = :ios, '9.0' s.source_files = 'Classes' s.requires_arc = true s.frameworks = 'CoreGraphics', 'CoreTelephony', 'CoreText', 'MobileCoreServices', 'Photos', 'QuartzCore', 'QuickLook', 'Security', 'SystemConfiguration', 'UIKit' s.libraries = 'c++', 'z' s.vendored_frameworks = 'Vendor/CrashReporter.framework' - s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"108\\"" BITHOCKEY_C_BUILD="\\"108\\""} } + s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"109\\"" BITHOCKEY_C_BUILD="\\"109\\""} } s.resource_bundle = { 'HockeySDKResources' => ['Resources/*.png', 'Resources/*.lproj'] } s.preserve_paths = 'Resources', 'Support' s.private_header_files = 'Classes/*Private.h' diff --git a/HockeySDK.podspec b/HockeySDK.podspec index 99227a97..c4531ed0 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK' - s.version = '5.1.2' + s.version = '5.1.3' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT', :file => 'HockeySDK-iOS/LICENSE' } s.author = { 'Microsoft' => 'support@hockeyapp.net' } - s.platform = :ios, '8.0' + s.platform = :ios, '9.0' s.requires_arc = true s.preserve_path = 'HockeySDK-iOS/README.md' diff --git a/README.md b/README.md index fc2126c6..6a75155c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -[![Build Status](https://app.bitrise.io/app/30bf519f6bd0a5e2/status.svg?token=RKqHc7-ojjLiEFds53d-ZA&branch=master)](https://app.bitrise.io/app/30bf519f6bd0a5e2) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK) [![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net) -## Version 5.1.2 +## Version 5.1.3 HockeySDK-iOS implements support for using HockeyApp in your iOS applications. @@ -23,13 +22,13 @@ The following features are currently supported: ## 1. Setup -It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation](https://www.hockeyapp.net/help/sdk/ios/5.1.2/index.html) and onboard your app within minutes. +It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation](https://www.hockeyapp.net/help/sdk/ios/5.1.3/index.html) and onboard your app within minutes. ## 2. Documentation -Please visit [our landing page](https://www.hockeyapp.net/help/sdk/ios/5.1.2/index.html) as a starting point for all of our documentation. +Please visit [our landing page](https://www.hockeyapp.net/help/sdk/ios/5.1.3/index.html) as a starting point for all of our documentation. -Please check out our [changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.2/changelog.html), as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.2/installation--setup.html#troubleshooting). +Please check out our [changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.3/changelog.html), as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.3/installation--setup.html#troubleshooting). ## 3. Contributing @@ -53,4 +52,4 @@ You must sign a [Contributor License Agreement](https://cla.microsoft.com/) befo ## 4. Contact -If you have further questions or are running into trouble that cannot be resolved by any of the steps [in our troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.2/installation--setup.html#troubleshooting), feel free to open an issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). +If you have further questions or are running into trouble that cannot be resolved by any of the steps [in our troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.3/installation--setup.html#troubleshooting), feel free to open an issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). diff --git a/Resources/AppIconPlaceHolder.png b/Resources/AppIconPlaceHolder.png index 02831a38..2e4eb52e 100644 Binary files a/Resources/AppIconPlaceHolder.png and b/Resources/AppIconPlaceHolder.png differ diff --git a/Resources/Blur@3x.png b/Resources/Blur@3x.png index ce252305..db1de728 100644 Binary files a/Resources/Blur@3x.png and b/Resources/Blur@3x.png differ diff --git a/Resources/FeedbackPlaceholder.png b/Resources/FeedbackPlaceholder.png index 4f09d361..41ea7bd7 100644 Binary files a/Resources/FeedbackPlaceholder.png and b/Resources/FeedbackPlaceholder.png differ diff --git a/Support/HockeySDK.xcodeproj/project.pbxproj b/Support/HockeySDK.xcodeproj/project.pbxproj index 4011ac93..c9257b3f 100644 --- a/Support/HockeySDK.xcodeproj/project.pbxproj +++ b/Support/HockeySDK.xcodeproj/project.pbxproj @@ -376,8 +376,8 @@ 807756411BC6B6050037C3DA /* HockeySDKEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 8077563F1BC6A44D0037C3DA /* HockeySDKEnums.h */; settings = {ATTRIBUTES = (Public, ); }; }; 807F75051C9AEDAA009E6DCB /* BITChannelPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 807F75041C9AEDAA009E6DCB /* BITChannelPrivate.h */; }; 807F75061C9AEDAA009E6DCB /* BITChannelPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 807F75041C9AEDAA009E6DCB /* BITChannelPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 8080576D1C5818AE00BB319D /* BITHockeyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 8080576B1C5818AE00BB319D /* BITHockeyLogger.h */; }; - 8080576E1C5818AE00BB319D /* BITHockeyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 8080576B1C5818AE00BB319D /* BITHockeyLogger.h */; }; + 8080576D1C5818AE00BB319D /* BITHockeyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 8080576B1C5818AE00BB319D /* BITHockeyLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8080576E1C5818AE00BB319D /* BITHockeyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 8080576B1C5818AE00BB319D /* BITHockeyLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8080576F1C5818AE00BB319D /* BITHockeyLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 8080576C1C5818AE00BB319D /* BITHockeyLogger.m */; }; 808057701C5818AE00BB319D /* BITHockeyLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 8080576C1C5818AE00BB319D /* BITHockeyLogger.m */; }; 80807B8C1C46BF2F00F4C44F /* OCHamcrestIOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80807B8A1C46BF2F00F4C44F /* OCHamcrestIOS.framework */; }; @@ -2067,7 +2067,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; VALIDATE_PRODUCT = NO; @@ -2125,7 +2125,7 @@ "$(SRCROOT)/HockeySDKTests/Vendor/**", ); INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2170,6 +2170,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + STRIP_PNG_TEXT = NO; WRAPPER_EXTENSION = bundle; }; name = ReleaseCrashOnlyExtensions; @@ -2212,7 +2213,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "HockeySDK Framework/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios; @@ -2254,7 +2255,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/Vendor"; INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2386,6 +2387,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + STRIP_PNG_TEXT = NO; WRAPPER_EXTENSION = bundle; }; name = Debug; @@ -2399,6 +2401,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + STRIP_PNG_TEXT = NO; WRAPPER_EXTENSION = bundle; }; name = ReleaseDefault; @@ -2431,7 +2434,7 @@ "$(SRCROOT)/HockeySDKTests/Vendor/**", ); INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2489,7 +2492,7 @@ "$(SRCROOT)/HockeySDKTests/Vendor/**", ); INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2564,8 +2567,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.9; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -2609,6 +2612,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + STRIP_PNG_TEXT = NO; WRAPPER_EXTENSION = bundle; }; name = ReleaseCrashOnly; @@ -2653,7 +2657,7 @@ "$(SRCROOT)/HockeySDKTests/Vendor/**", ); INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2743,7 +2747,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = "HockeySDK Framework/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios; @@ -2793,7 +2797,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = "HockeySDK Framework/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios; @@ -2844,7 +2848,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = "HockeySDK Framework/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios; @@ -2891,7 +2895,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/Vendor"; INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2955,7 +2959,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/Vendor"; INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3020,7 +3024,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/Vendor"; INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3096,7 +3100,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; VALIDATE_PRODUCT = NO; @@ -3154,7 +3158,7 @@ "$(SRCROOT)/HockeySDKTests/Vendor/**", ); INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3199,6 +3203,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + STRIP_PNG_TEXT = NO; WRAPPER_EXTENSION = bundle; }; name = ReleaseFeedbackOnly; @@ -3241,7 +3246,7 @@ HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "HockeySDK Framework/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios; @@ -3283,7 +3288,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/Vendor"; INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3376,8 +3381,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.9; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -3435,7 +3440,7 @@ "$(SRCROOT)/HockeySDKTests/Vendor/**", ); INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3480,6 +3485,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + STRIP_PNG_TEXT = NO; WRAPPER_EXTENSION = bundle; }; name = Release; @@ -3521,7 +3527,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; INFOPLIST_FILE = "HockeySDK Framework/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios; @@ -3563,7 +3569,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/Vendor"; INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/HockeySDKTests/Vendor"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -3663,8 +3669,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = YES; @@ -3711,8 +3717,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.9; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; diff --git a/Support/HockeySDKBase.xcconfig b/Support/HockeySDKBase.xcconfig index b915fd0f..26de90c2 100644 --- a/Support/HockeySDKBase.xcconfig +++ b/Support/HockeySDKBase.xcconfig @@ -1,5 +1,5 @@ -BUILD_NUMBER = 108 -VERSION_STRING = 5.1.2 +BUILD_NUMBER = 109 +VERSION_STRING = 5.1.3 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(HOCKEYSDK_GCC_PREPROCESSOR_DEFINITIONS) HOCKEYSDK_CONFIGURATION_$(CONFIGURATION) BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" BIT_ARM_ARCHS = armv7 armv7s arm64 BIT_SIM_ARCHS = x86_64 i386