Remove autoSubmitting UDID with crash reports and add # DONT_SEND_UDID macro for disabling usage of UDID

By default DONT_SEND_UDID is set to 0, so UDID data will be send for beta usage. The developers should set it to 1 in their project settings for AppStore configurations
This commit is contained in:
Andreas Linde
2012-03-23 21:20:37 +01:00
parent fe4307fb65
commit 7705382f6b
6 changed files with 13 additions and 46 deletions

View File

@@ -25,8 +25,12 @@
#import "BWHockeyManager.h"
#import "BWApp.h"
#define HOCKEYKIT_VERSION_MAJOR 2
#define HOCKEYKIT_VERSION_MINOR 0
#define SDK_NAME @"HockeySDK"
#define SDK_VERSION @"2.2.6-develop"
#ifndef DONT_SEND_UDID
#define DONT_SEND_UDID 0
#endif
// uncomment this line to enable NSLog-debugging output
//#define kHockeyDebugEnabled

View File

@@ -40,9 +40,6 @@
#define BETA_UPDATE_TIMESTAMP @"timestamp"
#define BETA_UPDATE_APPSIZE @"appsize"
#define SDK_NAME @"HockeySDK"
#define SDK_VERSION @"2.2.4"
@interface BWHockeyManager ()
- (NSString *)getDevicePlatform_;
- (id)parseJSONResultString:(NSString *)jsonString;
@@ -241,12 +238,12 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain";
}
- (NSString *)deviceIdentifier {
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)]) {
#if DONT_SEND_UDID == 0
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)])
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
}
else {
return @"invalid";
}
#endif
return @"invalid";
}
- (NSString *)authenticationToken {

View File

@@ -153,7 +153,6 @@ typedef enum CrashReportStatus {
BOOL _showAlwaysButton;
BOOL _feedbackActivated;
BOOL _autoSubmitCrashReport;
BOOL _autoSubmitDeviceUDID;
BOOL _didCrashInLastSession;
@@ -215,10 +214,6 @@ typedef enum CrashReportStatus {
// if NO, the user will be asked if the crash report can be submitted (default)
@property (nonatomic, assign, getter=isAutoSubmitCrashReport) BOOL autoSubmitCrashReport;
// if YES, the device UDID will be submitted as the user id, without the need to define it in the crashReportUserID delegate (meant for beta versions!)
// if NO, the crashReportUserID delegate defines what to be sent as user id (default)
@property (nonatomic, assign, getter=isAutoSubmitDeviceUDID) BOOL autoSubmitDeviceUDID;
// will return if the last session crashed, to e.g. make sure a "rate my app" alert will not show up
@property (nonatomic, readonly) BOOL didCrashInLastSession;

View File

@@ -30,14 +30,12 @@
#import <CrashReporter/CrashReporter.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <UIKit/UIKit.h>
#import "BWGlobal.h"
#import "BWQuincyManager.h"
#include <sys/sysctl.h>
#include <inttypes.h> //needed for PRIx64 macro
#define SDK_NAME @"HockeySDK"
#define SDK_VERSION @"2.2.6-develop"
NSBundle *quincyBundle(void) {
static NSBundle* bundle = nil;
if (!bundle) {
@@ -87,7 +85,6 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
@synthesize showAlwaysButton = _showAlwaysButton;
@synthesize feedbackActivated = _feedbackActivated;
@synthesize autoSubmitCrashReport = _autoSubmitCrashReport;
@synthesize autoSubmitDeviceUDID = _autoSubmitDeviceUDID;
@synthesize languageStyle = _languageStyle;
@synthesize didCrashInLastSession = _didCrashInLastSession;
@synthesize loggingEnabled = _loggingEnabled;
@@ -136,7 +133,6 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
self.feedbackActivated = NO;
self.showAlwaysButton = NO;
self.autoSubmitCrashReport = NO;
self.autoSubmitDeviceUDID = NO;
NSString *testValue = [[NSUserDefaults standardUserDefaults] stringForKey:kQuincyKitAnalyzerStarted];
if (testValue) {
@@ -462,14 +458,6 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
return platform;
}
- (NSString *)deviceIdentifier {
if ([[UIDevice currentDevice] respondsToSelector:@selector(uniqueIdentifier)]) {
return [[UIDevice currentDevice] performSelector:@selector(uniqueIdentifier)];
}
else {
return @"invalid";
}
}
- (void)_performSendingCrashReports {
NSMutableDictionary *approvedCrashReports = [NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey: kApprovedCrashReports]];
@@ -481,9 +469,7 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
NSString *contact = @"";
NSString *description = @"";
if (self.autoSubmitDeviceUDID && [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
userid = [self deviceIdentifier];
} else if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) {
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) {
userid = [self.delegate crashReportUserID] ?: @"";
}

View File

@@ -123,13 +123,6 @@
// Default: NO
@property (nonatomic, assign, getter=isAutoSubmitCrashReport) BOOL autoSubmitCrashReport;
// Submit the device's UDID in the field UserID if crashReportUserID is not
// implemented (see CNSHockeyManagerDelegate); DO NOT USE THIS FOR LIVE
// VERSION OF YOUR APP AS THIS VIOLATES THE USERS PRIVACY!
//
// Default: NO
@property (nonatomic, assign, getter=isAutoSubmitDeviceUDID) BOOL autoSubmitDeviceUDID;
// Send user data to HockeyApp when checking for a new version; works only
// for beta apps and should not be activated for live apps. User data includes
// the device type, OS version, app version and device UDID.

View File

@@ -206,14 +206,6 @@
[[BWQuincyManager sharedQuincyManager] setAutoSubmitCrashReport:autoSubmitCrashReport];
}
- (BOOL)isAutoSubmitDeviceUDID {
return [[BWQuincyManager sharedQuincyManager] isAutoSubmitDeviceUDID];
}
- (void)setAutoSubmitDeviceUDID:(BOOL)autoSubmitDeviceUDID {
[[BWQuincyManager sharedQuincyManager] setAutoSubmitDeviceUDID:autoSubmitDeviceUDID];
}
- (BOOL)didCrashInLastSession {
return [[BWQuincyManager sharedQuincyManager] didCrashInLastSession];
}