Skip to content
Browse files

Remove autoSubmitting UDID with crash reports and add # DONT_SEND_UDI…

…D 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
  • Loading branch information...
1 parent fe4307f commit 7705382f6bba376322ea6554c152b8bb4742e2ff @TheRealKerni TheRealKerni committed
View
8 Classes/BWGlobal.h
@@ -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
13 Classes/BWHockeyManager.m
@@ -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 @@ - (NSString *)installationDateString {
}
- (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
5 Classes/BWQuincyManager.h
@@ -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
18 Classes/BWQuincyManager.m
@@ -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 @@ @implementation BWQuincyManager
@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 @@ - (id) init {
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 *)_getDevicePlatform {
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 @@ - (void)_performSendingCrashReports {
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
7 Classes/CNSHockeyManager.h
@@ -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
8 Classes/CNSHockeyManager.m
@@ -206,14 +206,6 @@ - (void)setAutoSubmitCrashReport:(BOOL)autoSubmitCrashReport {
[[BWQuincyManager sharedQuincyManager] setAutoSubmitCrashReport:autoSubmitCrashReport];
}
-- (BOOL)isAutoSubmitDeviceUDID {
- return [[BWQuincyManager sharedQuincyManager] isAutoSubmitDeviceUDID];
-}
-
-- (void)setAutoSubmitDeviceUDID:(BOOL)autoSubmitDeviceUDID {
- [[BWQuincyManager sharedQuincyManager] setAutoSubmitDeviceUDID:autoSubmitDeviceUDID];
-}
-
- (BOOL)didCrashInLastSession {
return [[BWQuincyManager sharedQuincyManager] didCrashInLastSession];
}

0 comments on commit 7705382

Please sign in to comment.
Something went wrong with that request. Please try again.