Clean up some more naming and disable logging in App Store

- Change last BITHockeySDK.. into BITHockey…
- Disable BITHockeyLog when running in an App Store build
This commit is contained in:
Andreas Linde 2012-07-21 22:58:40 +02:00
parent e75eef7136
commit 812d0b4a35
13 changed files with 102 additions and 102 deletions

View File

@ -140,7 +140,7 @@
- (NSString *)versionString { - (NSString *)versionString {
NSString *shortString = ([self.shortVersion respondsToSelector:@selector(length)] && [self.shortVersion length]) ? [NSString stringWithFormat:@"%@", self.shortVersion] : @""; NSString *shortString = ([self.shortVersion respondsToSelector:@selector(length)] && [self.shortVersion length]) ? [NSString stringWithFormat:@"%@", self.shortVersion] : @"";
NSString *versionString = [shortString length] ? [NSString stringWithFormat:@" (%@)", self.version] : self.version; NSString *versionString = [shortString length] ? [NSString stringWithFormat:@" (%@)", self.version] : self.version;
return [NSString stringWithFormat:@"%@ %@%@", BITHockeySDKLocalizedString(@"UpdateVersion"), shortString, versionString]; return [NSString stringWithFormat:@"%@ %@%@", BITHockeyLocalizedString(@"UpdateVersion"), shortString, versionString];
} }
- (NSString *)dateString { - (NSString *)dateString {

View File

@ -72,7 +72,7 @@
- (id)initWithAppIdentifier:(NSString *)appIdentifier { - (id)initWithAppIdentifier:(NSString *)appIdentifier {
if ((self = [super init])) { if ((self = [super init])) {
BITHockeySDKLog(@"Initializing CrashReporter"); BITHockeyLog(@"Initializing CrashReporter");
_appIdentifier = appIdentifier; _appIdentifier = appIdentifier;
@ -136,7 +136,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BITHockeyNetworkDidBecomeReachableNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BITHockeyNetworkDidBecomeReachableNotification object:nil];
} }
if (!BITHockeySDKBundle()) { if (!BITHockeyBundle()) {
NSLog(@"WARNING: %@.bundle is missing, will send reports automatically!", BITHOCKEYSDK_BUNDLE); NSLog(@"WARNING: %@.bundle is missing, will send reports automatically!", BITHOCKEYSDK_BUNDLE);
} }
} }
@ -187,7 +187,7 @@
- (void)startManager { - (void)startManager {
if (!_sendingInProgress && [self hasPendingCrashReport]) { if (!_sendingInProgress && [self hasPendingCrashReport]) {
_sendingInProgress = YES; _sendingInProgress = YES;
if (!BITHockeySDKBundle()) { if (!BITHockeyBundle()) {
NSLog(@"WARNING: HockeySDKResource.bundle is missing, sending reports automatically!"); NSLog(@"WARNING: HockeySDKResource.bundle is missing, sending reports automatically!");
[self sendCrashReports]; [self sendCrashReports];
} else if (![self autoSendCrashReports] && [self hasNonApprovedCrashReports]) { } else if (![self autoSendCrashReports] && [self hasNonApprovedCrashReports]) {
@ -198,14 +198,14 @@
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashDataFoundTitle"), appName] UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:BITHockeyLocalizedString(@"CrashDataFoundTitle"), appName]
message:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashDataFoundDescription"), appName] message:[NSString stringWithFormat:BITHockeyLocalizedString(@"CrashDataFoundDescription"), appName]
delegate:self delegate:self
cancelButtonTitle:BITHockeySDKLocalizedString(@"CrashDontSendReport") cancelButtonTitle:BITHockeyLocalizedString(@"CrashDontSendReport")
otherButtonTitles:BITHockeySDKLocalizedString(@"CrashSendReport"), nil]; otherButtonTitles:BITHockeyLocalizedString(@"CrashSendReport"), nil];
if ([self isShowingAlwaysButton]) { if ([self isShowingAlwaysButton]) {
[alertView addButtonWithTitle:BITHockeySDKLocalizedString(@"CrashSendReportAlways")]; [alertView addButtonWithTitle:BITHockeyLocalizedString(@"CrashSendReportAlways")];
} }
[alertView setTag: BITCrashAlertTypeSend]; [alertView setTag: BITCrashAlertTypeSend];
@ -294,7 +294,7 @@
} }
if ([_crashFiles count] > 0) { if ([_crashFiles count] > 0) {
BITHockeySDKLog(@"Pending crash reports found."); BITHockeyLog(@"Pending crash reports found.");
return YES; return YES;
} else } else
return NO; return NO;
@ -308,29 +308,29 @@
if (_serverResult >= BITCrashStatusAssigned && if (_serverResult >= BITCrashStatusAssigned &&
_crashIdenticalCurrentVersion && _crashIdenticalCurrentVersion &&
BITHockeySDKBundle()) { BITHockeyBundle()) {
// show some feedback to the user about the crash status // show some feedback to the user about the crash status
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
switch (_serverResult) { switch (_serverResult) {
case BITCrashStatusAssigned: case BITCrashStatusAssigned:
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseTitle"), appName ] alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseNextRelease"), appName] message: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseNextRelease"), appName]
delegate: self delegate: self
cancelButtonTitle: BITHockeySDKLocalizedString(@"HockeyOK") cancelButtonTitle: BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles: nil]; otherButtonTitles: nil];
break; break;
case BITCrashStatusSubmitted: case BITCrashStatusSubmitted:
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseTitle"), appName ] alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseWaitingApple"), appName] message: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseWaitingApple"), appName]
delegate: self delegate: self
cancelButtonTitle: BITHockeySDKLocalizedString(@"HockeyOK") cancelButtonTitle: BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles: nil]; otherButtonTitles: nil];
break; break;
case BITCrashStatusAvailable: case BITCrashStatusAvailable:
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseTitle"), appName ] alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseAvailable"), appName] message: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseAvailable"), appName]
delegate: self delegate: self
cancelButtonTitle: BITHockeySDKLocalizedString(@"HockeyOK") cancelButtonTitle: BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles: nil]; otherButtonTitles: nil];
break; break;
default: default:
@ -479,7 +479,7 @@
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
if (crashes != nil) { if (crashes != nil) {
BITHockeySDKLog(@"Sending crash reports:\n%@", crashes); BITHockeyLog(@"Sending crash reports:\n%@", crashes);
[self postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", crashes] [self postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", crashes]
toURL:[NSURL URLWithString:BITHOCKEYSDK_URL]]; toURL:[NSURL URLWithString:BITHOCKEYSDK_URL]];
@ -529,9 +529,9 @@
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; _urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (!_urlConnection) { if (!_urlConnection) {
BITHockeySDKLog(@"Requesting feedback status could not start!"); BITHockeyLog(@"Requesting feedback status could not start!");
} else { } else {
BITHockeySDKLog(@"Requesting feedback status."); BITHockeyLog(@"Requesting feedback status.");
} }
} }
@ -581,14 +581,14 @@
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; _urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (!_urlConnection) { if (!_urlConnection) {
BITHockeySDKLog(@"Sending crash reports could not start!"); BITHockeyLog(@"Sending crash reports could not start!");
_sendingInProgress = NO; _sendingInProgress = NO;
} else { } else {
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReporterWillSendCrashReport:)]) { if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReporterWillSendCrashReport:)]) {
[self.delegate crashReporterWillSendCrashReport:self]; [self.delegate crashReporterWillSendCrashReport:self];
} }
BITHockeySDKLog(@"Sending crash reports started."); BITHockeyLog(@"Sending crash reports started.");
} }
} }
@ -609,7 +609,7 @@
[self.delegate crashReporter:self didFailWithError:error]; [self.delegate crashReporter:self didFailWithError:error];
} }
BITHockeySDKLog(@"ERROR: %@", [error localizedDescription]); BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
_sendingInProgress = NO; _sendingInProgress = NO;
@ -631,7 +631,7 @@
mutabilityOption:NSPropertyListMutableContainersAndLeaves mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:nil format:nil
errorDescription:NULL]; errorDescription:NULL];
BITHockeySDKLog(@"Received API response: %@", response); BITHockeyLog(@"Received API response: %@", response);
_serverResult = (BITCrashStatus)[[response objectForKey:@"status"] intValue]; _serverResult = (BITCrashStatus)[[response objectForKey:@"status"] intValue];
if ([response objectForKey:@"id"]) { if ([response objectForKey:@"id"]) {
@ -668,7 +668,7 @@
[self.delegate crashReporter:self didFailWithError:error]; [self.delegate crashReporter:self didFailWithError:error];
} }
BITHockeySDKLog(@"ERROR: %@", [error localizedDescription]); BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
} else { } else {
if (_responseData == nil || [_responseData length] == 0) { if (_responseData == nil || [_responseData length] == 0) {
error = [NSError errorWithDomain:kBITCrashErrorDomain error = [NSError errorWithDomain:kBITCrashErrorDomain
@ -684,7 +684,7 @@
[self.delegate crashReporter:self didFailWithError:error]; [self.delegate crashReporter:self didFailWithError:error];
} }
BITHockeySDKLog(@"ERROR: %@", [error localizedDescription]); BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
} }
_sendingInProgress = NO; _sendingInProgress = NO;

View File

@ -33,6 +33,7 @@
@protocol BITHockeyManagerDelegate; @protocol BITHockeyManagerDelegate;
@class BITCrashManager; @class BITCrashManager;
@class BITUpdateManager;
@interface BITHockeyManager : NSObject { @interface BITHockeyManager : NSObject {
@private @private

View File

@ -110,15 +110,15 @@
- (void)startManager { - (void)startManager {
BITHockeySDKLog(@"Starting HockeyManager"); BITHockeyLog(@"Starting HockeyManager");
_startManagerIsInvoked = YES; _startManagerIsInvoked = YES;
// start CrashManager // start CrashManager
BITHockeySDKLog(@"Start crashManager"); BITHockeyLog(@"Start crashManager");
[_crashManager performSelector:@selector(startManager) withObject:nil afterDelay:1.0f]; [_crashManager performSelector:@selector(startManager) withObject:nil afterDelay:1.0f];
// Setup UpdateManager // Setup UpdateManager
BITHockeySDKLog(@"Start UpdateManager"); BITHockeyLog(@"Start UpdateManager");
[_updateManager performSelector:@selector(startManager) withObject:nil afterDelay:0.0f]; [_updateManager performSelector:@selector(startManager) withObject:nil afterDelay:0.0f];
} }
@ -162,15 +162,15 @@
_startManagerIsInvoked = NO; _startManagerIsInvoked = NO;
if (_validAppIdentifier) { if (_validAppIdentifier) {
BITHockeySDKLog(@"Setup CrashManager"); BITHockeyLog(@"Setup CrashManager");
self.crashManager = [[[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier] autorelease]; self.crashManager = [[[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier] autorelease];
BITHockeySDKLog(@"Setup UpdateManager"); BITHockeyLog(@"Setup UpdateManager");
self.updateManager = [[[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_isAppStoreEnvironment] autorelease]; self.updateManager = [[[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_isAppStoreEnvironment] autorelease];
// Only if JMC is part of the project // Only if JMC is part of the project
if ([[self class] isJMCPresent]) { if ([[self class] isJMCPresent]) {
BITHockeySDKLog(@"Setup JMC"); BITHockeyLog(@"Setup JMC");
[_updateManager setCheckForTracker:YES]; [_updateManager setCheckForTracker:YES];
[_updateManager addObserver:self forKeyPath:@"trackerConfig" options:0 context:nil]; [_updateManager addObserver:self forKeyPath:@"trackerConfig" options:0 context:nil];
[[self class] disableJMCCrashReporter]; [[self class] disableJMCCrashReporter];

View File

@ -111,15 +111,15 @@
#pragma mark - private #pragma mark - private
- (void)reportError:(NSError *)error { - (void)reportError:(NSError *)error {
BITHockeySDKLog(@"Error: %@", [error localizedDescription]); BITHockeyLog(@"Error: %@", [error localizedDescription]);
_lastCheckFailed = YES; _lastCheckFailed = YES;
// only show error if we enable that // only show error if we enable that
if (_showFeedback) { if (_showFeedback) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateError") UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateError")
message:[error localizedDescription] message:[error localizedDescription]
delegate:nil delegate:nil
cancelButtonTitle:BITHockeySDKLocalizedString(@"OK") otherButtonTitles:nil]; cancelButtonTitle:BITHockeyLocalizedString(@"OK") otherButtonTitles:nil];
[alert show]; [alert show];
[alert release]; [alert release];
_showFeedback = NO; _showFeedback = NO;
@ -222,7 +222,7 @@
} }
- (NSString *)authenticationToken { - (NSString *)authenticationToken {
return [BITHockeySDKMD5([NSString stringWithFormat:@"%@%@%@%@", return [BITHockeyMD5([NSString stringWithFormat:@"%@%@%@%@",
_authenticationSecret, _authenticationSecret,
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"],
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"],
@ -289,7 +289,7 @@
if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) { if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) {
if ([window rootViewController]) { if ([window rootViewController]) {
visibleWindow = window; visibleWindow = window;
BITHockeySDKLog(@"UIWindow with rootViewController found: %@", visibleWindow); BITHockeyLog(@"UIWindow with rootViewController found: %@", visibleWindow);
break; break;
} }
} }
@ -386,7 +386,7 @@
self.userAllowsSendUsageTime = YES; self.userAllowsSendUsageTime = YES;
} }
if (!BITHockeySDKBundle()) { if (!BITHockeyBundle()) {
NSLog(@"WARNING: %@.bundle is missing, make sure it is added!", BITHOCKEYSDK_BUNDLE); NSLog(@"WARNING: %@.bundle is missing, make sure it is added!", BITHOCKEYSDK_BUNDLE);
} }
@ -442,7 +442,7 @@
} }
if (_currentHockeyViewController) { if (_currentHockeyViewController) {
BITHockeySDKLog(@"update view already visible, aborting"); BITHockeyLog(@"update view already visible, aborting");
return; return;
} }
@ -503,24 +503,24 @@
if (!_updateAlertShowing) { if (!_updateAlertShowing) {
if ([self hasNewerMandatoryVersion]) { if ([self hasNewerMandatoryVersion]) {
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateAvailable") UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
message:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]] message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
delegate:self delegate:self
cancelButtonTitle:BITHockeySDKLocalizedString(@"UpdateInstall") cancelButtonTitle:BITHockeyLocalizedString(@"UpdateInstall")
otherButtonTitles:nil otherButtonTitles:nil
] autorelease]; ] autorelease];
[alertView setTag:2]; [alertView setTag:2];
[alertView show]; [alertView show];
_updateAlertShowing = YES; _updateAlertShowing = YES;
} else { } else {
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateAvailable") UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
message:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"UpdateAlertTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]] message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
delegate:self delegate:self
cancelButtonTitle:BITHockeySDKLocalizedString(@"UpdateIgnore") cancelButtonTitle:BITHockeyLocalizedString(@"UpdateIgnore")
otherButtonTitles:BITHockeySDKLocalizedString(@"UpdateShow"), nil otherButtonTitles:BITHockeyLocalizedString(@"UpdateShow"), nil
] autorelease]; ] autorelease];
if (self.isShowingDirectInstallOption) { if (self.isShowingDirectInstallOption) {
[alertView addButtonWithTitle:BITHockeySDKLocalizedString(@"UpdateInstall")]; [alertView addButtonWithTitle:BITHockeyLocalizedString(@"UpdateInstall")];
} }
[alertView setTag:0]; [alertView setTag:0];
[alertView show]; [alertView show];
@ -704,7 +704,7 @@
// build request & send // build request & send
NSString *url = [NSString stringWithFormat:@"%@%@", BITHOCKEYSDK_URL, parameter]; NSString *url = [NSString stringWithFormat:@"%@%@", BITHOCKEYSDK_URL, parameter];
BITHockeySDKLog(@"sending api request to %@", url); BITHockeyLog(@"sending api request to %@", url);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
[request setHTTPMethod:@"GET"]; [request setHTTPMethod:@"GET"];
@ -728,7 +728,7 @@
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Server returned empty response.", NSLocalizedDescriptionKey, nil]]]; userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Server returned empty response.", NSLocalizedDescriptionKey, nil]]];
return; return;
} else { } else {
BITHockeySDKLog(@"Received API response: %@", responseString); BITHockeyLog(@"Received API response: %@", responseString);
NSString *token = [[feedDict objectForKey:@"authcode"] lowercaseString]; NSString *token = [[feedDict objectForKey:@"authcode"] lowercaseString];
failed = NO; failed = NO;
if ([[self authenticationToken] compare:token] == NSOrderedSame) { if ([[self authenticationToken] compare:token] == NSOrderedSame) {
@ -748,21 +748,21 @@
} }
} else { } else {
// different token, block this version // different token, block this version
BITHockeySDKLog(@"AUTH FAILURE: %@", [self authenticationToken]); BITHockeyLog(@"AUTH FAILURE: %@", [self authenticationToken]);
// store the new data // store the new data
[[NSUserDefaults standardUserDefaults] setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] forKey:kBITUpdateAuthorizedVersion]; [[NSUserDefaults standardUserDefaults] setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] forKey:kBITUpdateAuthorizedVersion];
[[NSUserDefaults standardUserDefaults] setObject:token forKey:kBITUpdateAuthorizedVersion]; [[NSUserDefaults standardUserDefaults] setObject:token forKey:kBITUpdateAuthorizedVersion];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"]; [self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"];
} }
} }
} }
if (failed) { if (failed) {
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationOffline") image:@"authorize_request.png"]; [self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationOffline") image:@"authorize_request.png"];
} }
} }
@ -784,7 +784,7 @@
// do we need to update? // do we need to update?
if (![self shouldCheckForUpdates] && !_currentHockeyViewController) { if (![self shouldCheckForUpdates] && !_currentHockeyViewController) {
BITHockeySDKLog(@"update not needed right now"); BITHockeyLog(@"update not needed right now");
self.checkInProgress = NO; self.checkInProgress = NO;
return; return;
} }
@ -818,7 +818,7 @@
// build request & send // build request & send
NSString *url = [NSString stringWithFormat:@"%@%@", BITHOCKEYSDK_URL, parameter]; NSString *url = [NSString stringWithFormat:@"%@%@", BITHOCKEYSDK_URL, parameter];
BITHockeySDKLog(@"sending api request to %@", url); BITHockeyLog(@"sending api request to %@", url);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
[request setHTTPMethod:@"GET"]; [request setHTTPMethod:@"GET"];
@ -838,12 +838,12 @@
if (_isAppStoreEnvironment) return NO; if (_isAppStoreEnvironment) return NO;
if (!self.isUpdateAvailable) { if (!self.isUpdateAvailable) {
BITHockeySDKLog(@"Warning: No update available. Aborting."); BITHockeyLog(@"Warning: No update available. Aborting.");
return NO; return NO;
} }
#if TARGET_IPHONE_SIMULATOR #if TARGET_IPHONE_SIMULATOR
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:hockeySDKLocalizedString(@"UpdateWarning") message:hockeySDKLocalizedString(@"UpdateSimulatorMessage") delegate:nil cancelButtonTitle:hockeySDKLocalizedString(@"HockeyOK") otherButtonTitles:nil] autorelease]; UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateWarning") message:BITHockeyLocalizedString(@"UpdateSimulatorMessage") delegate:nil cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK") otherButtonTitles:nil] autorelease];
[alert show]; [alert show];
return NO; return NO;
#endif #endif
@ -856,9 +856,9 @@
NSString *hockeyAPIURL = [NSString stringWithFormat:@"%@api/2/apps/%@?format=plist%@", BITHOCKEYSDK_URL, [self encodedAppIdentifier], extraParameter]; NSString *hockeyAPIURL = [NSString stringWithFormat:@"%@api/2/apps/%@?format=plist%@", BITHOCKEYSDK_URL, [self encodedAppIdentifier], extraParameter];
NSString *iOSUpdateURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", [hockeyAPIURL bit_URLEncodedString]]; NSString *iOSUpdateURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", [hockeyAPIURL bit_URLEncodedString]];
BITHockeySDKLog(@"API Server Call: %@, calling iOS with %@", hockeyAPIURL, iOSUpdateURL); BITHockeyLog(@"API Server Call: %@, calling iOS with %@", hockeyAPIURL, iOSUpdateURL);
BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iOSUpdateURL]]; BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iOSUpdateURL]];
BITHockeySDKLog(@"System returned: %d", success); BITHockeyLog(@"System returned: %d", success);
return success; return success;
} }
@ -880,7 +880,7 @@
BITUpdateAuthorizationState state = [self authorizationState]; BITUpdateAuthorizationState state = [self authorizationState];
if (state == BITUpdateAuthorizationDenied) { if (state == BITUpdateAuthorizationDenied) {
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"]; [self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"];
} else if (state == BITUpdateAuthorizationAllowed) { } else if (state == BITUpdateAuthorizationAllowed) {
self.requireAuthorization = NO; self.requireAuthorization = NO;
return YES; return YES;
@ -894,7 +894,7 @@
- (void)startManager { - (void)startManager {
if (![self appVersionIsAuthorized]) { if (![self appVersionIsAuthorized]) {
if ([self authorizationState] == BITUpdateAuthorizationPending) { if ([self authorizationState] == BITUpdateAuthorizationPending) {
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationProgress") image:@"authorize_request.png"]; [self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationProgress") image:@"authorize_request.png"];
[self performSelector:@selector(checkForAuthorization) withObject:nil afterDelay:0.0f]; [self performSelector:@selector(checkForAuthorization) withObject:nil afterDelay:0.0f];
} }
@ -950,7 +950,7 @@
if ([self.receivedData length]) { if ([self.receivedData length]) {
NSString *responseString = [[[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding] autorelease]; NSString *responseString = [[[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding] autorelease];
BITHockeySDKLog(@"Received API response: %@", responseString); BITHockeyLog(@"Received API response: %@", responseString);
id json = [self parseJSONResultString:responseString]; id json = [self parseJSONResultString:responseString];
self.trackerConfig = (([self checkForTracker] && [[json valueForKey:@"tracker"] isKindOfClass:[NSDictionary class]]) ? [json valueForKey:@"tracker"] : nil); self.trackerConfig = (([self checkForTracker] && [[json valueForKey:@"tracker"] isKindOfClass:[NSDictionary class]]) ? [json valueForKey:@"tracker"] : nil);
@ -1005,12 +1005,12 @@
NSString *shortVersionString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; NSString *shortVersionString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
shortVersionString = shortVersionString ? [NSString stringWithFormat:@"%@ ", shortVersionString] : @""; shortVersionString = shortVersionString ? [NSString stringWithFormat:@"%@ ", shortVersionString] : @"";
versionString = [shortVersionString length] ? [NSString stringWithFormat:@"(%@)", versionString] : versionString; versionString = [shortVersionString length] ? [NSString stringWithFormat:@"(%@)", versionString] : versionString;
NSString *currentVersionString = [NSString stringWithFormat:@"%@ %@ %@%@", self.newestAppVersion.name, BITHockeySDKLocalizedString(@"UpdateVersion"), shortVersionString, versionString]; NSString *currentVersionString = [NSString stringWithFormat:@"%@ %@ %@%@", self.newestAppVersion.name, BITHockeyLocalizedString(@"UpdateVersion"), shortVersionString, versionString];
NSString *alertMsg = [NSString stringWithFormat:BITHockeySDKLocalizedString(@"UpdateNoUpdateAvailableMessage"), currentVersionString]; NSString *alertMsg = [NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateNoUpdateAvailableMessage"), currentVersionString];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateNoUpdateAvailableTitle") UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateNoUpdateAvailableTitle")
message:alertMsg message:alertMsg
delegate:nil delegate:nil
cancelButtonTitle:BITHockeySDKLocalizedString(@"HockeyOK") cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles:nil]; otherButtonTitles:nil];
[alert show]; [alert show];
[alert release]; [alert release];

View File

@ -48,7 +48,7 @@
- (id)init:(BITUpdateManager *)newUpdateManager { - (id)init:(BITUpdateManager *)newUpdateManager {
if ((self = [super init])) { if ((self = [super init])) {
self.updateManager = newUpdateManager; self.updateManager = newUpdateManager;
self.title = BITHockeySDKLocalizedString(@"UpdateSettingsTitle"); self.title = BITHockeyLocalizedString(@"UpdateSettingsTitle");
CGRect frame = self.view.frame; CGRect frame = self.view.frame;
frame.origin = CGPointZero; frame.origin = CGPointZero;
@ -95,7 +95,7 @@
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if (section == [self numberOfSections] - 1) { if (section == [self numberOfSections] - 1) {
return BITHockeySDKLocalizedString(@"UpdateSectionCheckTitle"); return BITHockeyLocalizedString(@"UpdateSectionCheckTitle");
} else { } else {
return nil; return nil;
} }
@ -120,9 +120,9 @@
footer.font = [UIFont systemFontOfSize:13]; footer.font = [UIFont systemFontOfSize:13];
if (section == 0 && [_updateManager isAllowUserToDisableSendData] && [_updateManager shouldSendUserData]) { if (section == 0 && [_updateManager isAllowUserToDisableSendData] && [_updateManager shouldSendUserData]) {
footer.text = BITHockeySDKLocalizedString(@"UpdateSettingsUserDataDescription"); footer.text = BITHockeyLocalizedString(@"UpdateSettingsUserDataDescription");
} else if ([_updateManager isAllowUserToDisableSendData] && section < [self numberOfSections]) { } else if ([_updateManager isAllowUserToDisableSendData] && section < [self numberOfSections]) {
footer.text = BITHockeySDKLocalizedString(@"UpdateSettingsUsageDataDescription"); footer.text = BITHockeyLocalizedString(@"UpdateSettingsUsageDataDescription");
} }
UIView* view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 285, footer.frame.size.height + 6 + 11)] autorelease]; UIView* view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 285, footer.frame.size.height + 6 + 11)] autorelease];
@ -201,19 +201,19 @@
BITUpdateSetting hockeyAutoUpdateSetting = [_updateManager updateSetting]; BITUpdateSetting hockeyAutoUpdateSetting = [_updateManager updateSetting];
if (indexPath.row == 0) { if (indexPath.row == 0) {
// on startup // on startup
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSectionCheckStartup"); cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSectionCheckStartup");
if (hockeyAutoUpdateSetting == BITUpdateCheckStartup) { if (hockeyAutoUpdateSetting == BITUpdateCheckStartup) {
cell.accessoryType = UITableViewCellAccessoryCheckmark; cell.accessoryType = UITableViewCellAccessoryCheckmark;
} }
} else if (indexPath.row == 1) { } else if (indexPath.row == 1) {
// daily // daily
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSectionCheckDaily"); cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSectionCheckDaily");
if (hockeyAutoUpdateSetting == BITUpdateCheckDaily) { if (hockeyAutoUpdateSetting == BITUpdateCheckDaily) {
cell.accessoryType = UITableViewCellAccessoryCheckmark; cell.accessoryType = UITableViewCellAccessoryCheckmark;
} }
} else { } else {
// manually // manually
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSectionCheckManually"); cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSectionCheckManually");
if (hockeyAutoUpdateSetting == BITUpdateCheckManually) { if (hockeyAutoUpdateSetting == BITUpdateCheckManually) {
cell.accessoryType = UITableViewCellAccessoryCheckmark; cell.accessoryType = UITableViewCellAccessoryCheckmark;
} }
@ -223,14 +223,14 @@
if (indexPath.section == 0 && [_updateManager shouldSendUserData] && [_updateManager isAllowUserToDisableSendData]) { if (indexPath.section == 0 && [_updateManager shouldSendUserData] && [_updateManager isAllowUserToDisableSendData]) {
// send user data // send user data
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSettingsUserData"); cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSettingsUserData");
[toggleSwitch addTarget:self action:@selector(sendUserData:) [toggleSwitch addTarget:self action:@selector(sendUserData:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[toggleSwitch setOn:[_updateManager doesUserAllowsSendUserData]]; [toggleSwitch setOn:[_updateManager doesUserAllowsSendUserData]];
} else if ([_updateManager shouldSendUsageTime] && [_updateManager isAllowUserToDisableSendData]) { } else if ([_updateManager shouldSendUsageTime] && [_updateManager isAllowUserToDisableSendData]) {
// send usage time // send usage time
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSettingsUsageData"); cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSettingsUsageData");
[toggleSwitch addTarget:self action:@selector(sendUsageData:) [toggleSwitch addTarget:self action:@selector(sendUsageData:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[toggleSwitch setOn:[_updateManager doesUserAllowsSendUsageTime]]; [toggleSwitch setOn:[_updateManager doesUserAllowsSendUsageTime]];

View File

@ -179,7 +179,7 @@
footerButton.layer.shadowColor = [[UIColor blackColor] CGColor]; footerButton.layer.shadowColor = [[UIColor blackColor] CGColor];
footerButton.layer.shadowRadius = 2.0f; footerButton.layer.shadowRadius = 2.0f;
footerButton.titleLabel.font = [UIFont boldSystemFontOfSize:14]; footerButton.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[footerButton setTitle:BITHockeySDKLocalizedString(@"UpdateShowPreviousVersions") forState:UIControlStateNormal]; [footerButton setTitle:BITHockeyLocalizedString(@"UpdateShowPreviousVersions") forState:UIControlStateNormal];
[footerButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [footerButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[footerButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; [footerButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
[footerButton setBackgroundImage:[UIImage bit_imageNamed:@"buttonHighlight.png" bundle:BITHOCKEYSDK_BUNDLE] forState:UIControlStateHighlighted]; [footerButton setBackgroundImage:[UIImage bit_imageNamed:@"buttonHighlight.png" bundle:BITHOCKEYSDK_BUNDLE] forState:UIControlStateHighlighted];
@ -201,7 +201,7 @@
// create web view for a version // create web view for a version
NSString *installed = @""; NSString *installed = @"";
if ([appVersion.version isEqualToString:[_updateManager currentAppVersion]]) { if ([appVersion.version isEqualToString:[_updateManager currentAppVersion]]) {
installed = [NSString stringWithFormat:@"<span style=\"float:%@;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\"><b>%@</b></span>", [appVersion isEqual:_updateManager.newestAppVersion] ? @"left" : @"right", BITHockeySDKLocalizedString(@"UpdateInstalled")]; installed = [NSString stringWithFormat:@"<span style=\"float:%@;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\"><b>%@</b></span>", [appVersion isEqual:_updateManager.newestAppVersion] ? @"left" : @"right", BITHockeyLocalizedString(@"UpdateInstalled")];
} }
if ([appVersion isEqual:_updateManager.newestAppVersion]) { if ([appVersion isEqual:_updateManager.newestAppVersion]) {
@ -209,7 +209,7 @@
installed = [NSString stringWithFormat:@"<p>&nbsp;%@</p>", installed]; installed = [NSString stringWithFormat:@"<p>&nbsp;%@</p>", installed];
cell.webViewContent = [NSString stringWithFormat:@"%@%@", installed, appVersion.notes]; cell.webViewContent = [NSString stringWithFormat:@"%@%@", installed, appVersion.notes];
} else { } else {
cell.webViewContent = [NSString stringWithFormat:@"<div style=\"min-height:200px;vertical-align:middle;text-align:center;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</div>", BITHockeySDKLocalizedString(@"UpdateNoReleaseNotesAvailable")]; cell.webViewContent = [NSString stringWithFormat:@"<div style=\"min-height:200px;vertical-align:middle;text-align:center;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</div>", BITHockeyLocalizedString(@"UpdateNoReleaseNotesAvailable")];
} }
} else { } else {
cell.webViewContent = [NSString stringWithFormat:@"<p><b style=\"text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</b>%@<br/><small>%@</small></p><p>%@</p>", [appVersion versionString], installed, [appVersion dateString], [appVersion notesOrEmptyString]]; cell.webViewContent = [NSString stringWithFormat:@"<p><b style=\"text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</b>%@<br/><small>%@</small></p><p>%@</p>", [appVersion versionString], installed, [appVersion dateString], [appVersion notesOrEmptyString]];
@ -231,7 +231,7 @@
self.updateManager = newUpdateManager; self.updateManager = newUpdateManager;
self.modal = newModal; self.modal = newModal;
self.modalAnimated = YES; self.modalAnimated = YES;
self.title = BITHockeySDKLocalizedString(@"UpdateScreenTitle"); self.title = BITHockeyLocalizedString(@"UpdateScreenTitle");
_isAppStoreEnvironment = [BITHockeyManager sharedHockeyManager].isAppStoreEnvironment; _isAppStoreEnvironment = [BITHockeyManager sharedHockeyManager].isAppStoreEnvironment;
@ -562,7 +562,7 @@
if ([_cells count] > (NSUInteger)indexPath.row) { if ([_cells count] > (NSUInteger)indexPath.row) {
return [_cells objectAtIndex:indexPath.row]; return [_cells objectAtIndex:indexPath.row];
} else { } else {
BITHockeySDKLog(@"Warning: cells_ and indexPath do not match? forgot calling redrawTableView?"); BITHockeyLog(@"Warning: cells_ and indexPath do not match? forgot calling redrawTableView?");
} }
return nil; return nil;
} }
@ -601,19 +601,19 @@
switch (anAppStoreButtonState) { switch (anAppStoreButtonState) {
case AppStoreButtonStateOffline: case AppStoreButtonStateOffline:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonOffline") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated]; [_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonOffline") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
break; break;
case AppStoreButtonStateCheck: case AppStoreButtonStateCheck:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonCheck") colors:[PSStoreButton appStoreGreenColor] enabled:YES] animated:animated]; [_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonCheck") colors:[PSStoreButton appStoreGreenColor] enabled:YES] animated:animated];
break; break;
case AppStoreButtonStateSearching: case AppStoreButtonStateSearching:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonSearching") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated]; [_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonSearching") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
break; break;
case AppStoreButtonStateUpdate: case AppStoreButtonStateUpdate:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonUpdate") colors:[PSStoreButton appStoreBlueColor] enabled:YES] animated:animated]; [_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonUpdate") colors:[PSStoreButton appStoreBlueColor] enabled:YES] animated:animated];
break; break;
case AppStoreButtonStateInstalling: case AppStoreButtonStateInstalling:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonInstalling") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated]; [_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonInstalling") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
break; break;
default: default:
break; break;

View File

@ -41,6 +41,7 @@
#import "BITUpdateViewController.h" #import "BITUpdateViewController.h"
#import "BITUpdateSettingsViewController.h" #import "BITUpdateSettingsViewController.h"
// Notification message which HockeyManager is listening to, to retry requesting updated from the server // Notification message which HockeyManager is listening to, to retry requesting updated from the server
#define BITHockeyNetworkDidBecomeReachableNotification @"BITHockeyNetworkDidBecomeReachable" #define BITHockeyNetworkDidBecomeReachableNotification @"BITHockeyNetworkDidBecomeReachable"

View File

@ -52,11 +52,11 @@
#define BITHOCKEYSDK_BUNDLE @"HockeySDKResources" #define BITHOCKEYSDK_BUNDLE @"HockeySDKResources"
#define BITHOCKEYSDK_URL @"https://sdk.hockeyapp.net/" #define BITHOCKEYSDK_URL @"https://sdk.hockeyapp.net/"
#define BITHockeySDKLog(fmt, ...) do { if([BITHockeyManager sharedHockeyManager].isLoggingEnabled) { NSLog((@"[HockeySDK] %s/%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); }} while(0) #define BITHockeyLog(fmt, ...) do { if([BITHockeyManager sharedHockeyManager].isLoggingEnabled && ![BITHockeyManager sharedHockeyManager].isAppStoreEnvironment) { NSLog((@"[HockeySDK] %s/%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); }} while(0)
NSBundle *BITHockeySDKBundle(void); NSBundle *BITHockeyBundle(void);
NSString *BITHockeySDKLocalizedString(NSString *stringToken); NSString *BITHockeyLocalizedString(NSString *stringToken);
NSString *BITHockeySDKMD5(NSString *str); NSString *BITHockeyMD5(NSString *str);
// compatibility helper // compatibility helper

View File

@ -32,7 +32,7 @@
// Load the framework bundle. // Load the framework bundle.
NSBundle *BITHockeySDKBundle(void) { NSBundle *BITHockeyBundle(void) {
static NSBundle *bundle = nil; static NSBundle *bundle = nil;
static dispatch_once_t predicate; static dispatch_once_t predicate;
dispatch_once(&predicate, ^{ dispatch_once(&predicate, ^{
@ -43,15 +43,15 @@ NSBundle *BITHockeySDKBundle(void) {
return bundle; return bundle;
} }
NSString *BITHockeySDKLocalizedString(NSString *stringToken) { NSString *BITHockeyLocalizedString(NSString *stringToken) {
if (BITHockeySDKBundle()) { if (BITHockeyBundle()) {
return NSLocalizedStringFromTableInBundle(stringToken, @"HockeySDK", BITHockeySDKBundle(), @""); return NSLocalizedStringFromTableInBundle(stringToken, @"HockeySDK", BITHockeyBundle(), @"");
} else { } else {
return stringToken; return stringToken;
} }
} }
NSString *BITHockeySDKMD5(NSString *str) { NSString *BITHockeyMD5(NSString *str) {
const char *cStr = [str UTF8String]; const char *cStr = [str UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH]; unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, strlen(cStr), result ); CC_MD5( cStr, strlen(cStr), result );

View File

@ -1,5 +1,5 @@
// //
// UIImage+BITHockeySDKAdditions.h // UIImage+BITHockeyAdditions.h
// //
// Created by Peter Steinberger on 10.01.11. // Created by Peter Steinberger on 10.01.11.
// Copyright (c) 2011-2012 Peter Steinberger. // Copyright (c) 2011-2012 Peter Steinberger.
@ -26,7 +26,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface UIImage (BITHockeySDKAdditions) @interface UIImage (BITHockeyAdditions)
- (UIImage *)bit_roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize; - (UIImage *)bit_roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize;
- (UIImage *)bit_imageToFitSize:(CGSize)fitSize honorScaleFactor:(BOOL)honorScaleFactor; - (UIImage *)bit_imageToFitSize:(CGSize)fitSize honorScaleFactor:(BOOL)honorScaleFactor;

View File

@ -1,5 +1,5 @@
// //
// UIImage+BITHockeySDKAdditions.m // UIImage+BITHockeyAdditions.m
// //
// Created by Peter Steinberger on 10.01.11. // Created by Peter Steinberger on 10.01.11.
// Copyright (c) 2011-2012 Peter Steinberger. // Copyright (c) 2011-2012 Peter Steinberger.

View File

@ -65,7 +65,6 @@
1E59557115B6F84700A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; }; 1E59557115B6F84700A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557315B6F84D00A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; }; 1E59557315B6F84D00A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557515B6F85700A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; }; 1E59557515B6F85700A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557715B6F85E00A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557C15B6F8CC00A03429 /* HockeySDKResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 1E59550A15B6F45800A03429 /* HockeySDKResources.bundle */; }; 1E59557C15B6F8CC00A03429 /* HockeySDKResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 1E59550A15B6F45800A03429 /* HockeySDKResources.bundle */; };
1E59558D15B6FDA500A03429 /* PSAppStoreHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = E41EB469148D7BF50015DEDC /* PSAppStoreHeader.h */; }; 1E59558D15B6FDA500A03429 /* PSAppStoreHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = E41EB469148D7BF50015DEDC /* PSAppStoreHeader.h */; };
1E59558E15B6FDA500A03429 /* PSStoreButton.h in Headers */ = {isa = PBXBuildFile; fileRef = E41EB46B148D7BF50015DEDC /* PSStoreButton.h */; }; 1E59558E15B6FDA500A03429 /* PSStoreButton.h in Headers */ = {isa = PBXBuildFile; fileRef = E41EB46B148D7BF50015DEDC /* PSStoreButton.h */; };
@ -230,7 +229,7 @@
E41EB45D148D7BF50015DEDC /* BITUpdateManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BITUpdateManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E41EB45D148D7BF50015DEDC /* BITUpdateManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BITUpdateManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
E41EB45F148D7BF50015DEDC /* BITUpdateSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITUpdateSettingsViewController.h; sourceTree = "<group>"; }; E41EB45F148D7BF50015DEDC /* BITUpdateSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITUpdateSettingsViewController.h; sourceTree = "<group>"; };
E41EB460148D7BF50015DEDC /* BITUpdateSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITUpdateSettingsViewController.m; sourceTree = "<group>"; }; E41EB460148D7BF50015DEDC /* BITUpdateSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITUpdateSettingsViewController.m; sourceTree = "<group>"; };
E41EB464148D7BF50015DEDC /* BITCrashManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITCrashManager.m; sourceTree = "<group>"; }; E41EB464148D7BF50015DEDC /* BITCrashManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BITCrashManager.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E41EB465148D7BF50015DEDC /* BITHockeyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITHockeyManager.h; sourceTree = "<group>"; }; E41EB465148D7BF50015DEDC /* BITHockeyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITHockeyManager.h; sourceTree = "<group>"; };
E41EB466148D7BF50015DEDC /* BITHockeyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITHockeyManager.m; sourceTree = "<group>"; }; E41EB466148D7BF50015DEDC /* BITHockeyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITHockeyManager.m; sourceTree = "<group>"; };
E41EB468148D7BF50015DEDC /* NSString+BITHockeyAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+BITHockeyAdditions.m"; sourceTree = "<group>"; }; E41EB468148D7BF50015DEDC /* NSString+BITHockeyAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+BITHockeyAdditions.m"; sourceTree = "<group>"; };
@ -671,7 +670,6 @@
1E59557115B6F84700A03429 /* HockeySDK.strings in Resources */, 1E59557115B6F84700A03429 /* HockeySDK.strings in Resources */,
1E59557315B6F84D00A03429 /* HockeySDK.strings in Resources */, 1E59557315B6F84D00A03429 /* HockeySDK.strings in Resources */,
1E59557515B6F85700A03429 /* HockeySDK.strings in Resources */, 1E59557515B6F85700A03429 /* HockeySDK.strings in Resources */,
1E59557715B6F85E00A03429 /* HockeySDK.strings in Resources */,
1E5955C615B71C8600A03429 /* authorize_denied.png in Resources */, 1E5955C615B71C8600A03429 /* authorize_denied.png in Resources */,
1E5955C715B71C8600A03429 /* authorize_denied@2x.png in Resources */, 1E5955C715B71C8600A03429 /* authorize_denied@2x.png in Resources */,
1E5955C815B71C8600A03429 /* authorize_request.png in Resources */, 1E5955C815B71C8600A03429 /* authorize_request.png in Resources */,