Permalink
Browse files

Initial commit

  • Loading branch information...
TheRealKerni committed Apr 13, 2012
0 parents commit 115ff0cf272ffe32ec25620fb8563769b99e4dc4
Showing with 5,130 additions and 0 deletions.
  1. +20 −0 .gitignore
  2. +55 −0 Classes/CNSHockeyManager.h
  3. +104 −0 Classes/CNSHockeyManager.m
  4. +57 −0 Classes/CNSHockeyManagerDelegate.h
  5. +123 −0 Classes/CrashReporting/CNSCrashReportManager.h
  6. +593 −0 Classes/CrashReporting/CNSCrashReportManager.m
  7. +29 −0 Classes/CrashReporting/CNSCrashReportManagerDelegate.h
  8. +64 −0 Classes/CrashReporting/CNSCrashReportTextFormatter.h
  9. +512 −0 Classes/CrashReporting/CNSCrashReportTextFormatter.m
  10. +75 −0 Classes/CrashReporting/CNSCrashReportUI.h
  11. +211 −0 Classes/CrashReporting/CNSCrashReportUI.m
  12. +1,228 −0 Classes/CrashReporting/CNSCrashReportUI.nib/designable.nib
  13. BIN Classes/CrashReporting/CNSCrashReportUI.nib/keyedobjects.nib
  14. +81 −0 LICENSE.txt
  15. +126 −0 README.md
  16. +30 −0 Resources/HockeySDK-Info.plist
  17. +7 −0 Resources/HockeySDK-Prefix.pch
  18. +2 −0 Resources/en.lproj/InfoPlist.strings
  19. +377 −0 Support/HockeySDK.xcodeproj/project.pbxproj
  20. +7 −0 Support/HockeySDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  21. +1 −0 Vendor/CrashReporter.framework/CrashReporter
  22. +1 −0 Vendor/CrashReporter.framework/Headers
  23. +1 −0 Vendor/CrashReporter.framework/Resources
  24. BIN Vendor/CrashReporter.framework/Versions/A/CrashReporter
  25. +229 −0 Vendor/CrashReporter.framework/Versions/A/Headers/CrashReporter.h
  26. +169 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h
  27. +53 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h
  28. +90 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h
  29. +65 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h
  30. +51 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h
  31. +73 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h
  32. +92 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h
  33. +74 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h
  34. +60 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h
  35. +142 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h
  36. +62 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h
  37. +130 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h
  38. +97 −0 Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h
  39. BIN Vendor/CrashReporter.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
  40. +38 −0 Vendor/CrashReporter.framework/Versions/A/Resources/Info.plist
  41. +1 −0 Vendor/CrashReporter.framework/Versions/Current
@@ -0,0 +1,20 @@
+# Xcode
+build/*
+*.pbxuser
+!default.pbxuser
+*.mode?v3
+!default.mode?v3
+*.perspective
+*.perspectivev3
+!default.perspectivev3
+!default.xcworkspace
+xcuserdata
+profile
+*.moved-aside
+
+# osx noise
+.DS_Store
+*.ipa
+*.swp
+*~.nib
+profile
@@ -0,0 +1,55 @@
+// Copyright 2012 Codenauts UG (haftungsbeschränkt). All rights reserved.
+// See LICENSE.txt for author information.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+#import "CNSHockeyManagerDelegate.h"
+
+@interface CNSHockeyManager : NSObject {
+@private
+ id _delegate;
+ NSString *_appIdentifier;
+ NSString *_companyName;
+
+ BOOL _loggingEnabled;
+}
+
+#pragma mark - Public Properties
+
+@property (nonatomic, readonly) NSString *appIdentifier;
+
+// Enable debug logging; ONLY ENABLE THIS FOR DEBUGGING!
+//
+// Default: NO
+@property (nonatomic, assign, getter=isLoggingEnabled) BOOL loggingEnabled;
+
+
+#pragma mark - Public Methods
+
+// Returns the shared manager object
++ (CNSHockeyManager *)sharedHockeyManager;
+
+// Configure HockeyApp with a single app identifier and delegate; use this
+// only for debug or beta versions of your app!
+- (void)configureWithIdentifier:(NSString *)newAppIdentifier companyName:(NSString *)newCompanyName delegate:(id)newDelegate;
+
+- (void)configureWithIdentifier:(NSString *)appIdentifier delegate:(id)delegate;
+
+@end
@@ -0,0 +1,104 @@
+// Copyright 2012 Codenauts UG (haftungsbeschränkt). All rights reserved.
+// See LICENSE.txt for author information.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "CNSHockeyManager.h"
+
+#import "CNSCrashReportManager.h"
+#import "CNSCrashReportManagerDelegate.h"
+
+@interface CNSHockeyManager ()
+
+- (void)configureCrashReportManager;
+
+@end
+
+@implementation CNSHockeyManager
+
+@synthesize appIdentifier = _appIdentifier;
+@synthesize loggingEnabled = _loggingEnabled;
+
+#pragma mark - Public Class Methods
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6
++ (CNSHockeyManager *)sharedHockeyManager {
+ static CNSHockeyManager *sharedInstance = nil;
+ static dispatch_once_t pred;
+
+ dispatch_once(&pred, ^{
+ sharedInstance = [CNSHockeyManager alloc];
+ sharedInstance = [sharedInstance init];
+ });
+
+ return sharedInstance;
+}
+#else
++ (CNSHockeyManager *)sharedHockeyManager {
+ static CNSHockeyManager *hockeyManager = nil;
+
+ if (hockeyManager == nil) {
+ hockeyManager = [[CNSHockeyManager alloc] init];
+ }
+
+ return hockeyManager;
+}
+#endif
+
+
+- (void)dealloc {
+ [_appIdentifier release], _appIdentifier = nil;
+ _delegate = nil;
+
+ [super dealloc];
+}
+
+
+#pragma mark - Private Class Methods
+
+
+#pragma mark - Public Instance Methods (Configuration)
+
+- (void)configureWithIdentifier:(NSString *)newAppIdentifier companyName:(NSString *)newCompanyName delegate:(id)newDelegate {
+ _delegate = newDelegate;
+
+ [_appIdentifier release];
+ _appIdentifier = [newAppIdentifier copy];
+
+ [_companyName release];
+ _companyName = [newCompanyName copy];
+
+ [self configureCrashReportManager];
+}
+
+
+- (void)configureWithIdentifier:(NSString *)newAppIdentifier delegate:(id)newDelegate {
+ [self configureWithIdentifier:newAppIdentifier companyName:@"" delegate:newDelegate];
+}
+
+
+#pragma mark - Private Instance Methods
+
+- (void)configureCrashReportManager {
+ [[CNSCrashReportManager sharedCrashReportManager] setAppIdentifier:_appIdentifier];
+ [[CNSCrashReportManager sharedCrashReportManager] setDelegate:_delegate];
+ [[CNSCrashReportManager sharedCrashReportManager] startManager];
+}
+
+@end
@@ -0,0 +1,57 @@
+//
+// CNSHockeyManagerDelegate.h
+// HockeySDK
+//
+// Created by Andreas Linde on 29.03.12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@protocol CNSHockeyManagerDelegate <NSObject>
+
+@optional
+
+// Invoked when the internet connection is started
+//
+// Implement to let the delegate enable the activity indicator
+- (void)connectionOpened;
+
+// Invoked when the internet connection is closed
+//
+// Implement to let the delegate disable the activity indicator
+- (void)connectionClosed;
+
+// Invoked before a crash report will be sent
+//
+// Return a userid or similar which the crashreport should contain
+//
+// Maximum length: 255 chars
+//
+// Default: empty
+- (NSString *)crashReportUserID;
+
+// Invoked before a crash report will be sent
+//
+// Return contact data, e.g. an email address, for the crash report
+// Maximum length: 255 chars
+//
+// Default: empty
+-(NSString *)crashReportContact;
+
+// Invoked before a crash report will be sent
+//
+// Return a the description for the crashreport should contain; the string
+// will automatically be wrapped into <[DATA[ ]]>, so make sure you don't do
+// that in your string.
+//
+// Default: empty
+-(NSString *)crashReportDescription;
+
+// Invoked before the user is asked to send a crash report
+//
+// Implement to do additional actions, e.g. to make sure to not to ask the
+// user for an app rating :)
+- (void)willShowSubmitCrashReportAlert;
+
+@end
@@ -0,0 +1,123 @@
+/*
+ * Author: Andreas Linde <mail@andreaslinde.de>
+ * Kent Sutherland
+ *
+ * Copyright (c) 2011 Andreas Linde & Kent Sutherland.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "CNSCrashReportManagerDelegate.h"
+
+// flags if the crashlog analyzer is started. since this may theoretically crash we need to track it
+#define kHockeySDKAnalyzerStarted @"HockeySDKCrashReportAnalyzerStarted"
+
+// flags if the QuincyKit is activated at all
+#define kHockeySDKCrashReportActivated @"HockeySDKCrashReportActivated"
+
+// flags if the crashreporter should automatically send crashes without asking the user again
+#define kHockeySDKAutomaticallySendCrashReports @"HockeySDKAutomaticallySendCrashReports"
+
+// stores the set of crashreports that have been approved but aren't sent yet
+#define kHockeySDKApprovedCrashReports @"HockeySDKApprovedCrashReports"
+
+
+typedef enum CrashAlertType {
+ CrashAlertTypeSend = 0,
+ CrashAlertTypeFeedback = 1,
+} CrashAlertType;
+
+typedef enum CrashReportStatus {
+ CrashReportStatusUnknown = 0,
+ CrashReportStatusAssigned = 1,
+ CrashReportStatusSubmitted = 2,
+ CrashReportStatusAvailable = 3,
+} CrashReportStatus;
+
+typedef enum CrashReportMechanism {
+ CrashReportMechanismPLCrashReporter = 0,
+ CrashReportMechanismMacOSX = 1
+} CrashReportMechanism;
+
+@class CNSCrashReportUI;
+
+@interface CNSCrashReportManager : NSObject
+#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+ <NSXMLParserDelegate>
+#endif
+{
+ NSFileManager *_fileManager;
+
+ BOOL _crashReportActivated;
+ CrashReportMechanism _crashReportMechanism;
+
+ CrashReportStatus _serverResult;
+ NSInteger _statusCode;
+
+ NSMutableString *_contentOfProperty;
+
+ id<CNSCrashReportManagerDelegate> _delegate;
+
+ NSString *_appIdentifier;
+ NSString *_submissionURL;
+ NSString *_companyName;
+ BOOL _autoSubmitCrashReport;
+
+ NSString *_crashFile;
+
+ NSMutableArray *_crashFiles;
+ NSString *_crashesDir;
+
+ CNSCrashReportUI *_crashReportUI;
+
+ int _analyzerStarted;
+
+}
+
+- (NSString*) modelVersion;
+
++ (CNSCrashReportManager *)sharedCrashReportManager;
+
+// The HockeyApp app identifier (required)
+@property (nonatomic, retain) NSString *appIdentifier;
+
+// submission URL defines where to send the crash reports to (required)
+@property (nonatomic) CrashReportMechanism crashReportMechanism;
+
+// defines the company name to be shown in the crash reporting dialog
+@property (nonatomic, retain) NSString *companyName;
+
+// delegate is required
+@property (nonatomic, assign) id <CNSCrashReportManagerDelegate> delegate;
+
+// if YES, the crash report will be submitted without asking the user
+// if NO, the user will be asked if the crash report can be submitted (default)
+@property (nonatomic, assign, getter=isAutoSubmitCrashReport) BOOL autoSubmitCrashReport;
+
+- (void) startManager;
+
+- (void) cancelReport;
+- (void) sendReportCrash:(NSString*)crashReport crashNotes:(NSString *)crashNotes ;
+
+@end
Oops, something went wrong.

0 comments on commit 115ff0c

Please sign in to comment.