├── .gitignore ├── Example ├── .buckconfig ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── Example.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── autoSetup.sh ├── index.android.js ├── index.ios.js ├── ios │ ├── Example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Example.xcscheme │ ├── Example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── KSCrash-master │ │ │ ├── .gitignore │ │ │ ├── Architecture.md │ │ │ ├── KSCrash.podspec │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── Source │ │ │ │ ├── Common-Examples │ │ │ │ │ ├── CrashTesterCommands.h │ │ │ │ │ ├── CrashTesterCommands.m │ │ │ │ │ ├── Crasher.h │ │ │ │ │ ├── Crasher.mm │ │ │ │ │ └── LoadableCategory.h │ │ │ │ ├── Framework │ │ │ │ │ ├── KSCrashFramework.h │ │ │ │ │ └── module.modulemap │ │ │ │ ├── KSCrash-Tests │ │ │ │ │ ├── Container+DeepSearch_Tests.m │ │ │ │ │ ├── FileBasedTestCase.h │ │ │ │ │ ├── FileBasedTestCase.m │ │ │ │ │ ├── KSCString_Tests.m │ │ │ │ │ ├── KSCrashInstallationEmail_Tests.m │ │ │ │ │ ├── KSCrashInstallationQuincyHockey_Tests.m │ │ │ │ │ ├── KSCrashInstallationStandard_Tests.m │ │ │ │ │ ├── KSCrashInstallationVictory_Tests.m │ │ │ │ │ ├── KSCrashReportConverter_Tests.m │ │ │ │ │ ├── KSCrashReportFilterAlert_Tests.m │ │ │ │ │ ├── KSCrashReportFilterGZip_Tests.m │ │ │ │ │ ├── KSCrashReportFilterJSON_Tests.m │ │ │ │ │ ├── KSCrashReportFilter_Tests.m │ │ │ │ │ ├── KSCrashReportStore_Tests.m │ │ │ │ │ ├── KSCrashSentry_Deadlock_Tests.m │ │ │ │ │ ├── KSCrashSentry_NSException_Tests.m │ │ │ │ │ ├── KSCrashSentry_Signal_Tests.m │ │ │ │ │ ├── KSCrashSentry_Tests.m │ │ │ │ │ ├── KSCrashState_Tests.m │ │ │ │ │ ├── KSCrashTests-Info.plist │ │ │ │ │ ├── KSDynamicLinker_Tests.m │ │ │ │ │ ├── KSFileUtils_Tests.m │ │ │ │ │ ├── KSJSONCodec_Tests.m │ │ │ │ │ ├── KSLogger_Tests.m │ │ │ │ │ ├── KSMach_Tests.m │ │ │ │ │ ├── KSObjC_Tests.m │ │ │ │ │ ├── KSSafeCollections_Tests.m │ │ │ │ │ ├── KSSignalInfo_Tests.m │ │ │ │ │ ├── KSString_Tests.m │ │ │ │ │ ├── KSSysCtl_Tests.m │ │ │ │ │ ├── KSSystemInfo_Tests.m │ │ │ │ │ ├── KSZombie_Tests.m │ │ │ │ │ ├── NSData+Gzip_Tests.m │ │ │ │ │ ├── NSDictionary+Merge_Tests.m │ │ │ │ │ ├── NSError+SimpleConstructor_Tests.m │ │ │ │ │ ├── NSMutableData+AppendUTF8_Tests.m │ │ │ │ │ ├── RFC3339DateTool_Tests.m │ │ │ │ │ ├── XCTestCase+KSCrash.h │ │ │ │ │ └── XCTestCase+KSCrash.m │ │ │ │ └── KSCrash │ │ │ │ │ ├── Installations │ │ │ │ │ ├── KSCrashInstallation+Alert.h │ │ │ │ │ ├── KSCrashInstallation+Alert.m │ │ │ │ │ ├── KSCrashInstallation+Private.h │ │ │ │ │ ├── KSCrashInstallation.h │ │ │ │ │ ├── KSCrashInstallation.m │ │ │ │ │ ├── KSCrashInstallationConsole.h │ │ │ │ │ ├── KSCrashInstallationConsole.m │ │ │ │ │ ├── KSCrashInstallationEmail.h │ │ │ │ │ ├── KSCrashInstallationEmail.m │ │ │ │ │ ├── KSCrashInstallationQuincyHockey.h │ │ │ │ │ ├── KSCrashInstallationQuincyHockey.m │ │ │ │ │ ├── KSCrashInstallationStandard.h │ │ │ │ │ ├── KSCrashInstallationStandard.m │ │ │ │ │ ├── KSCrashInstallationVictory.h │ │ │ │ │ └── KSCrashInstallationVictory.m │ │ │ │ │ ├── Recording │ │ │ │ │ ├── KSCrash.h │ │ │ │ │ ├── KSCrash.m │ │ │ │ │ ├── KSCrashAdvanced.h │ │ │ │ │ ├── KSCrashC.c │ │ │ │ │ ├── KSCrashC.h │ │ │ │ │ ├── KSCrashContext.h │ │ │ │ │ ├── KSCrashDoctor.h │ │ │ │ │ ├── KSCrashDoctor.m │ │ │ │ │ ├── KSCrashReport.c │ │ │ │ │ ├── KSCrashReport.h │ │ │ │ │ ├── KSCrashReportFields.h │ │ │ │ │ ├── KSCrashReportStore.h │ │ │ │ │ ├── KSCrashReportStore.m │ │ │ │ │ ├── KSCrashReportVersion.h │ │ │ │ │ ├── KSCrashReportWriter.h │ │ │ │ │ ├── KSCrashState.c │ │ │ │ │ ├── KSCrashState.h │ │ │ │ │ ├── KSCrashType.c │ │ │ │ │ ├── KSCrashType.h │ │ │ │ │ ├── KSSystemCapabilities.h │ │ │ │ │ ├── KSSystemInfo.h │ │ │ │ │ ├── KSSystemInfo.m │ │ │ │ │ ├── KSSystemInfoC.h │ │ │ │ │ ├── Sentry │ │ │ │ │ │ ├── KSCrashSentry.c │ │ │ │ │ │ ├── KSCrashSentry.h │ │ │ │ │ │ ├── KSCrashSentry_CPPException.h │ │ │ │ │ │ ├── KSCrashSentry_CPPException.mm │ │ │ │ │ │ ├── KSCrashSentry_Deadlock.h │ │ │ │ │ │ ├── KSCrashSentry_Deadlock.m │ │ │ │ │ │ ├── KSCrashSentry_MachException.c │ │ │ │ │ │ ├── KSCrashSentry_MachException.h │ │ │ │ │ │ ├── KSCrashSentry_NSException.h │ │ │ │ │ │ ├── KSCrashSentry_NSException.m │ │ │ │ │ │ ├── KSCrashSentry_Private.h │ │ │ │ │ │ ├── KSCrashSentry_Signal.c │ │ │ │ │ │ ├── KSCrashSentry_Signal.h │ │ │ │ │ │ ├── KSCrashSentry_User.c │ │ │ │ │ │ └── KSCrashSentry_User.h │ │ │ │ │ └── Tools │ │ │ │ │ │ ├── KSArchSpecific.h │ │ │ │ │ │ ├── KSBacktrace.c │ │ │ │ │ │ ├── KSBacktrace.h │ │ │ │ │ │ ├── KSBacktrace_Private.h │ │ │ │ │ │ ├── KSCrashCallCompletion.h │ │ │ │ │ │ ├── KSCrashCallCompletion.m │ │ │ │ │ │ ├── KSDynamicLinker.c │ │ │ │ │ │ ├── KSDynamicLinker.h │ │ │ │ │ │ ├── KSFileUtils.c │ │ │ │ │ │ ├── KSFileUtils.h │ │ │ │ │ │ ├── KSJSONCodec.c │ │ │ │ │ │ ├── KSJSONCodec.h │ │ │ │ │ │ ├── KSJSONCodecObjC.h │ │ │ │ │ │ ├── KSJSONCodecObjC.m │ │ │ │ │ │ ├── KSLogger.h │ │ │ │ │ │ ├── KSLogger.m │ │ │ │ │ │ ├── KSMach.c │ │ │ │ │ │ ├── KSMach.h │ │ │ │ │ │ ├── KSMachApple.h │ │ │ │ │ │ ├── KSMach_Arm.c │ │ │ │ │ │ ├── KSMach_Arm64.c │ │ │ │ │ │ ├── KSMach_x86_32.c │ │ │ │ │ │ ├── KSMach_x86_64.c │ │ │ │ │ │ ├── KSObjC.c │ │ │ │ │ │ ├── KSObjC.h │ │ │ │ │ │ ├── KSObjCApple.h │ │ │ │ │ │ ├── KSSafeCollections.h │ │ │ │ │ │ ├── KSSafeCollections.m │ │ │ │ │ │ ├── KSSignalInfo.c │ │ │ │ │ │ ├── KSSignalInfo.h │ │ │ │ │ │ ├── KSSingleton.h │ │ │ │ │ │ ├── KSString.c │ │ │ │ │ │ ├── KSString.h │ │ │ │ │ │ ├── KSSysCtl.c │ │ │ │ │ │ ├── KSSysCtl.h │ │ │ │ │ │ ├── KSZombie.h │ │ │ │ │ │ ├── KSZombie.m │ │ │ │ │ │ ├── NSDictionary+Merge.h │ │ │ │ │ │ ├── NSDictionary+Merge.m │ │ │ │ │ │ ├── NSError+SimpleConstructor.h │ │ │ │ │ │ ├── NSError+SimpleConstructor.m │ │ │ │ │ │ ├── NSString+Demangle.h │ │ │ │ │ │ ├── NSString+Demangle.mm │ │ │ │ │ │ ├── RFC3339DateTool.h │ │ │ │ │ │ └── RFC3339DateTool.m │ │ │ │ │ ├── Reporting │ │ │ │ │ ├── Filters │ │ │ │ │ │ ├── KSCrashReportFilter.h │ │ │ │ │ │ ├── KSCrashReportFilter.m │ │ │ │ │ │ ├── KSCrashReportFilterAlert.h │ │ │ │ │ │ ├── KSCrashReportFilterAlert.m │ │ │ │ │ │ ├── KSCrashReportFilterAppleFmt.h │ │ │ │ │ │ ├── KSCrashReportFilterAppleFmt.m │ │ │ │ │ │ ├── KSCrashReportFilterBasic.h │ │ │ │ │ │ ├── KSCrashReportFilterBasic.m │ │ │ │ │ │ ├── KSCrashReportFilterGZip.h │ │ │ │ │ │ ├── KSCrashReportFilterGZip.m │ │ │ │ │ │ ├── KSCrashReportFilterJSON.h │ │ │ │ │ │ ├── KSCrashReportFilterJSON.m │ │ │ │ │ │ ├── KSCrashReportFilterSets.h │ │ │ │ │ │ ├── KSCrashReportFilterSets.m │ │ │ │ │ │ ├── KSCrashReportFilterStringify.h │ │ │ │ │ │ ├── KSCrashReportFilterStringify.m │ │ │ │ │ │ └── Tools │ │ │ │ │ │ │ ├── Container+DeepSearch.h │ │ │ │ │ │ │ ├── Container+DeepSearch.m │ │ │ │ │ │ │ ├── KSVarArgs.h │ │ │ │ │ │ │ ├── NSData+GZip.h │ │ │ │ │ │ │ └── NSData+GZip.m │ │ │ │ │ ├── Sinks │ │ │ │ │ │ ├── KSCrashReportSinkConsole.h │ │ │ │ │ │ ├── KSCrashReportSinkConsole.m │ │ │ │ │ │ ├── KSCrashReportSinkEMail.h │ │ │ │ │ │ ├── KSCrashReportSinkEMail.m │ │ │ │ │ │ ├── KSCrashReportSinkQuincyHockey.h │ │ │ │ │ │ ├── KSCrashReportSinkQuincyHockey.m │ │ │ │ │ │ ├── KSCrashReportSinkStandard.h │ │ │ │ │ │ ├── KSCrashReportSinkStandard.m │ │ │ │ │ │ ├── KSCrashReportSinkVictory.h │ │ │ │ │ │ └── KSCrashReportSinkVictory.m │ │ │ │ │ └── Tools │ │ │ │ │ │ ├── KSCString.h │ │ │ │ │ │ ├── KSCString.m │ │ │ │ │ │ ├── KSHTTPMultipartPostBody.h │ │ │ │ │ │ ├── KSHTTPMultipartPostBody.m │ │ │ │ │ │ ├── KSHTTPRequestSender.h │ │ │ │ │ │ ├── KSHTTPRequestSender.m │ │ │ │ │ │ ├── KSReachabilityKSCrash.h │ │ │ │ │ │ ├── KSReachabilityKSCrash.m │ │ │ │ │ │ ├── NSMutableData+AppendUTF8.h │ │ │ │ │ │ ├── NSMutableData+AppendUTF8.m │ │ │ │ │ │ ├── NSString+URLEncode.h │ │ │ │ │ │ └── NSString+URLEncode.m │ │ │ │ │ ├── llvm │ │ │ │ │ ├── ADT │ │ │ │ │ │ ├── None.h │ │ │ │ │ │ ├── Optional.h │ │ │ │ │ │ └── StringRef.h │ │ │ │ │ ├── Config │ │ │ │ │ │ └── llvm-config.h │ │ │ │ │ ├── LICENSE.TXT │ │ │ │ │ └── Support │ │ │ │ │ │ ├── AlignOf.h │ │ │ │ │ │ ├── Casting.h │ │ │ │ │ │ ├── Compiler.h │ │ │ │ │ │ └── type_traits.h │ │ │ │ │ └── swift │ │ │ │ │ ├── Basic │ │ │ │ │ ├── Demangle.cpp │ │ │ │ │ ├── Demangle.h │ │ │ │ │ ├── DemangleNodes.h │ │ │ │ │ ├── Fallthrough.h │ │ │ │ │ ├── LLVM.h │ │ │ │ │ ├── Malloc.h │ │ │ │ │ ├── Punycode.cpp │ │ │ │ │ └── Punycode.h │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ └── SwiftStrings.h │ │ │ ├── iOS.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── iOS │ │ │ │ ├── Configuration.h │ │ │ │ ├── Crash-Tester │ │ │ │ ├── AppDelegate+UI.h │ │ │ │ ├── AppDelegate+UI.m │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── AppDelegate.m │ │ │ │ ├── CommandTVC.h │ │ │ │ ├── CommandTVC.m │ │ │ │ ├── Crash-Tester-Info.plist │ │ │ │ ├── Crash-Tester-Prefix.pch │ │ │ │ ├── Images.xcassets │ │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── LaunchImage.launchimage │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── en.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── main.m │ │ │ │ ├── Example-Apps-iOS.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ ├── Advanced-Example.xcscheme │ │ │ │ │ ├── Crash-Tester.xcscheme │ │ │ │ │ ├── Simple-Example.xcscheme │ │ │ │ │ └── Swift-Tester.xcscheme │ │ │ │ ├── KSCrash-iOS.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ ├── KSCrash-iOS.xcscheme │ │ │ │ │ ├── KSCrashLib.xcscheme │ │ │ │ │ └── KSCrash_static.xcscheme │ │ │ │ ├── KSCrash │ │ │ │ ├── KSCrash-Info.plist │ │ │ │ ├── KSCrash-Prefix.pch │ │ │ │ ├── KSCrash_static-Info.plist │ │ │ │ └── en.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── KSCrashTests │ │ │ │ ├── KSCrashTests-Info.plist │ │ │ │ └── en.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── Simple-Example │ │ │ │ ├── AppDelegate.h │ │ │ │ ├── AppDelegate.m │ │ │ │ ├── Base.lproj │ │ │ │ │ └── Main.storyboard │ │ │ │ ├── Images.xcassets │ │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── LaunchImage.launchimage │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Simple-Example-Info.plist │ │ │ │ ├── Simple-Example-Prefix.pch │ │ │ │ ├── ViewController.h │ │ │ │ ├── ViewController.m │ │ │ │ ├── en.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── main.m │ │ │ │ └── Swift-Tester │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ │ ├── BridgeHeader.h │ │ │ │ ├── Info.plist │ │ │ │ └── ViewController.swift │ │ ├── bugsnag-cocoa-5.2.1 │ │ │ ├── .gitignore │ │ │ ├── .gitmodules │ │ │ ├── .travis.yml │ │ │ ├── Bugsnag.podspec.json │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── Cartfile.private │ │ │ ├── Cartfile.resolved │ │ │ ├── LICENSE.txt │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── Source │ │ │ │ ├── BSGKSCrashReportWriter.h │ │ │ │ ├── Bugsnag.h │ │ │ │ ├── Bugsnag.m │ │ │ │ ├── BugsnagBreadcrumb.h │ │ │ │ ├── BugsnagBreadcrumb.m │ │ │ │ ├── BugsnagCollections.h │ │ │ │ ├── BugsnagCollections.m │ │ │ │ ├── BugsnagConfiguration.h │ │ │ │ ├── BugsnagConfiguration.m │ │ │ │ ├── BugsnagCrashReport.h │ │ │ │ ├── BugsnagCrashReport.m │ │ │ │ ├── BugsnagMetaData.h │ │ │ │ ├── BugsnagMetaData.m │ │ │ │ ├── BugsnagNotifier.h │ │ │ │ ├── BugsnagNotifier.m │ │ │ │ ├── BugsnagSink.h │ │ │ │ └── BugsnagSink.m │ │ │ ├── Tests │ │ │ │ ├── BugsnagBreadcrumbsTest.m │ │ │ │ ├── BugsnagCrashReportTests.m │ │ │ │ ├── BugsnagSinkTests.m │ │ │ │ └── report.json │ │ │ ├── VERSION │ │ │ ├── iOS.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ └── iOS.xcscmblueprint │ │ │ └── iOS │ │ │ │ ├── Bugsnag.xcodeproj │ │ │ │ ├── project.pbxproj │ │ │ │ └── xcshareddata │ │ │ │ │ └── xcschemes │ │ │ │ │ └── Bugsnag.xcscheme │ │ │ │ ├── Info.plist │ │ │ │ ├── TestsInfo.plist │ │ │ │ └── module.modulemap │ │ └── main.m │ ├── ExampleTests │ │ ├── ExampleTests.m │ │ └── Info.plist │ └── Podfile └── package.json ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── pintersudoplz │ └── rnbugsnag │ ├── RNBugsnagModule.java │ └── RNBugsnagPackage.java ├── index.js ├── ios ├── RNBugsnag.xcodeproj │ └── project.pbxproj └── RNBugsnag │ ├── RNBugsnag.h │ └── RNBugsnag.m ├── lib └── RNBugsnag.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | tmp/ 3 | 4 | # OSX 5 | # 6 | .DS_Store 7 | 8 | # Xcode 9 | # 10 | build/ 11 | *.pbxuser 12 | !default.pbxuser 13 | *.mode1v3 14 | !default.mode1v3 15 | *.mode2v3 16 | !default.mode2v3 17 | *.perspectivev3 18 | !default.perspectivev3 19 | xcuserdata 20 | *.xccheckout 21 | *.moved-aside 22 | DerivedData 23 | *.hmap 24 | *.ipa 25 | *.xcuserstate 26 | project.xcworkspace 27 | Example.xcworkspace 28 | 29 | #Cocoapods 30 | Pods/ 31 | 32 | # Android/IJ 33 | # 34 | .idea 35 | .gradle 36 | local.properties 37 | 38 | # node.js 39 | # 40 | node_modules/ 41 | npm-debug.log 42 | 43 | # BUCK 44 | buck-out/ 45 | \.buckd/ 46 | android/app/libs 47 | android/keystores/debug.keystore 48 | -------------------------------------------------------------------------------- /Example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Cocoapods 26 | Pods/ 27 | Podfile.lock 28 | 29 | # Android/IJ 30 | # 31 | *.iml 32 | .idea 33 | .gradle 34 | local.properties 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | android/app/libs 45 | android/keystores/debug.keystore 46 | -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.example', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.example', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /Example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /Example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.shell.MainReactPackage; 6 | 7 | import com.pintersudoplz.rnbugsnag.RNBugsnagPackage; 8 | 9 | 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | public class MainActivity extends ReactActivity { 14 | 15 | /** 16 | * Returns the name of the main component registered from JavaScript. 17 | * This is used to schedule rendering of the component. 18 | */ 19 | @Override 20 | protected String getMainComponentName() { 21 | return "Example"; 22 | } 23 | /** 24 | * Returns whether dev mode should be enabled. 25 | * This enables e.g. the dev menu. 26 | */ 27 | @Override 28 | protected boolean getUseDeveloperSupport() { 29 | return BuildConfig.DEBUG; 30 | } 31 | 32 | /** 33 | * A list of packages used by the app. If the app uses additional views 34 | * or modules besides the default ones, add more packages here. 35 | */ 36 | @Override 37 | protected List getPackages() { 38 | return Arrays.asList( 39 | new MainReactPackage(), 40 | new RNBugsnagPackage() 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SudoPlz/react-native-bugsnag/e9104b2525657d02f3e2f356b849f218f7f9c566/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SudoPlz/react-native-bugsnag/e9104b2525657d02f3e2f356b849f218f7f9c566/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SudoPlz/react-native-bugsnag/e9104b2525657d02f3e2f356b849f218f7f9c566/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SudoPlz/react-native-bugsnag/e9104b2525657d02f3e2f356b849f218f7f9c566/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Example 3 | 4 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.1.2' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SudoPlz/react-native-bugsnag/e9104b2525657d02f3e2f356b849f218f7f9c566/Example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jul 04 12:56:42 EEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /Example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /Example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /Example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /Example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Example' 2 | 3 | include ':app' 4 | include ':react-native-bugsnag' 5 | project(':react-native-bugsnag').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bugsnag/android') 6 | -------------------------------------------------------------------------------- /Example/autoSetup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | INFO_PLIST_MATCH_REG='\*\*\* Your bugsnag API key \*\*\*/' 4 | BUGSNAG_ID_LEN=32 5 | 6 | 7 | curdir=`pwd` 8 | 9 | #install npm modules 10 | npm i 11 | 12 | 13 | 14 | 15 | cd ios 16 | 17 | #install Pods 18 | pod install 19 | 20 | #Read bugsnag id 21 | read -p " : " BUSNAG_ID; 22 | #Get the length of the id 23 | size=${#BUSNAG_ID} 24 | 25 | #If the size is correct 26 | if [ "$size" == $BUGSNAG_ID_LEN ]; then 27 | echo "BUGSNAG ID correct" 28 | 29 | #Look for the default string 30 | grep -F '*** Your bugsnag API key ***' Example/Info.plist -q 31 | if [ "$?" == 0 ]; then 32 | echo "Now replacing *** Your bugsnag API key *** with $BUSNAG_ID within the Example/Info.plist file." 33 | #Replace for the default string with the user bugsnag id 34 | sed -i.bak "s/$INFO_PLIST_MATCH_REG$BUSNAG_ID/" Example/Info.plist 35 | if [ "$?" == 0 ]; then 36 | sleep 1 37 | #Open the xcode workspace 38 | open Example.xcworkspace 39 | echo "You are ready to roll. Hit Run on Xcode." 40 | cd $curdir 41 | else 42 | echo "Unable to replace with your bugsnag key, please edit Example/Info.plist manually." 43 | cd $curdir 44 | fi 45 | else 46 | echo "Could not replace with bugsnag key. Terminating" 47 | cd $curdir 48 | fi 49 | 50 | else 51 | echo "BUGSNAG ID incorrect. Its length should be $BUGSNAG_ID_LEN characters. Nothing done." 52 | cd $curdir 53 | fi -------------------------------------------------------------------------------- /Example/index.android.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { AppRegistry } from 'react-native'; 3 | import Example from './Example'; 4 | AppRegistry.registerComponent('Example', () => Example); 5 | -------------------------------------------------------------------------------- /Example/index.ios.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import { AppRegistry } from 'react-native'; 3 | import Example from './Example'; 4 | AppRegistry.registerComponent('Example', () => Example); 5 | -------------------------------------------------------------------------------- /Example/ios/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/ios/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | #import "RCTBridgeModule.h" 12 | 13 | 14 | #import "RCTRootView.h" 15 | #import "RNBugsnag.h" 16 | 17 | @implementation AppDelegate 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 20 | { 21 | 22 | 23 | 24 | NSURL *jsCodeLocation; 25 | 26 | /** 27 | * Loading JavaScript code - uncomment the one you want. 28 | * 29 | * OPTION 1 30 | * Load from development server. Start the server from the repository root: 31 | * 32 | * $ npm start 33 | * 34 | * To run on device, change `localhost` to the IP address of your computer 35 | * (you can get this by typing `ifconfig` into the terminal and selecting the 36 | * `inet` value under `en0:`) and make sure your computer and iOS device are 37 | * on the same Wi-Fi network. 38 | */ 39 | 40 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 41 | 42 | /** 43 | * OPTION 2 44 | * Load from pre-bundled file on disk. The static bundle is automatically 45 | * generated by the "Bundle React Native code and images" build step when 46 | * running the project on an actual device or running the project on the 47 | * simulator in the "Release" build configuration. 48 | */ 49 | 50 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 51 | 52 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 53 | moduleName:@"Example" 54 | initialProperties:nil 55 | launchOptions:launchOptions]; 56 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 57 | 58 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 59 | UIViewController *rootViewController = [UIViewController new]; 60 | rootViewController.view = rootView; 61 | self.window.rootViewController = rootViewController; 62 | [self.window makeKeyAndVisible]; 63 | [RNBugsnag init]; 64 | 65 | return YES; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/ios/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BUGSNAG_API_KEY 6 | *** Your bugsnag API key *** 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSTemporaryExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | KSCrash/build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | xcuserdata 12 | profile 13 | *.moved-aside 14 | DerivedData 15 | .DS_Store 16 | Thumbs.db 17 | .svn 18 | .BridgeSort 19 | *.bak 20 | .~* 21 | *.orig 22 | *.xccheckout 23 | Carthage/Build 24 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Architecture.md: -------------------------------------------------------------------------------- 1 | KSCrash Architecture 2 | ==================== 3 | 4 | KSCrash is implemented as a layered architecture. Each layer can in theory be 5 | compiled without the layers adjacent or above. 6 | 7 | +-------------------------------------------------------------+ 8 | | Installation | 9 | | +----------------------------------------------------+ 10 | | | KSCrash | 11 | | +--------------------------------------------------------+ 12 | | | Crash Reporting | Crash Recording | Crash Report Store | 13 | +----+-----------------+-----------------+--------------------+ 14 | | Filters | Sentry | 15 | +----------------------+-----------------+ 16 | 17 | 18 | ### Installation 19 | 20 | This top level layer provides a "clean" interface to the crash system. 21 | It is expected that the API at this level will be largely idiomatic to 22 | the backend system it will be communicating with. 23 | 24 | Primary entry points: KSCrashInstallation.h, KSCrashInstallationXYZ.h 25 | 26 | 27 | ### KSCrash 28 | 29 | Handles high level configuration and installation of the crash recording and 30 | crash reporting systems. 31 | 32 | Primary entry point: KSCrash.h 33 | 34 | 35 | ### Crash Report Store 36 | 37 | Provides storage and retrieval of crash reports and other configuration data. 38 | Also provides file paths for more primitive access by other layers. 39 | 40 | Primary entry point: KSCrashReportStore.h 41 | 42 | 43 | ### Crash Recording 44 | 45 | Records a single crash event. This layer is implemented in async-safe C. 46 | 47 | Primary entry point: KSCrashC.h 48 | 49 | 50 | ### Crash Reporting 51 | 52 | Processes, transforms, and sends reports to a remote system. 53 | 54 | Primary entry point: KSCrash.h 55 | 56 | 57 | ### Sentry 58 | 59 | Traps application errors and passes control to a supplied function. 60 | It handles the following errors: 61 | 62 | * Mach Exception 63 | * Signal 64 | * NSException 65 | * Main Thread Deadlock 66 | 67 | Primary entry point: KSCrashSentry.h 68 | 69 | 70 | ### Filters 71 | 72 | Low level interface for transforming, processing, and sending crash reports. 73 | 74 | Primary entry points: KSCrashReportFilter.h, KSCrashReportFilterXYZ.h 75 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Karl Stenerud 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in the documentation of any redistributions of the template files themselves (but not in projects built using the templates). 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/Common-Examples/CrashTesterCommands.h: -------------------------------------------------------------------------------- 1 | // 2 | // CrashTesterCommands.h 3 | // Example-Apps-Mac 4 | // 5 | // Created by Karl Stenerud on 9/28/13. 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CrashTesterCommands : NSObject 12 | 13 | + (NSString*) reportCountString; 14 | 15 | + (void) showAlertWithTitle:(NSString*) title 16 | message:(NSString*) fmt, ...; 17 | 18 | + (void) printStandard; 19 | 20 | + (void) printUnsymbolicated; 21 | 22 | + (void) printPartiallySymbolicated; 23 | 24 | + (void) printSymbolicated; 25 | 26 | + (void) printSideBySide; 27 | 28 | + (void) printSideBySideWithUserAndSystemData; 29 | 30 | + (void) mailStandard; 31 | 32 | + (void) mailUnsymbolicated; 33 | 34 | + (void) mailPartiallySymbolicated; 35 | 36 | + (void) mailSymbolicated; 37 | 38 | + (void) mailSideBySide; 39 | 40 | + (void) mailSideBySideWithUserAndSystemData; 41 | 42 | + (void) sendToKSWithCompletion:(KSCrashReportFilterCompletion)completion; 43 | 44 | + (void) sendToQuincyWithCompletion:(KSCrashReportFilterCompletion)completion; 45 | 46 | + (void) sendToHockeyWithCompletion:(KSCrashReportFilterCompletion)completion; 47 | 48 | + (void) sendToVictoryWithUserName:(NSString*)userName 49 | completion:(KSCrashReportFilterCompletion)completion; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/Common-Examples/Crasher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Crasher.h 3 | // 4 | // Created by Karl Stenerud on 2012-01-28. 5 | // 6 | 7 | #import 8 | 9 | @interface Crasher : NSObject 10 | 11 | - (void) throwUncaughtNSException; 12 | 13 | - (void) dereferenceBadPointer; 14 | 15 | - (void) dereferenceNullPointer; 16 | 17 | - (void) useCorruptObject; 18 | 19 | - (void) spinRunloop; 20 | 21 | - (void) causeStackOverflow; 22 | 23 | - (void) doAbort; 24 | 25 | - (void) doDiv0; 26 | 27 | - (void) doIllegalInstruction; 28 | 29 | - (void) accessDeallocatedObject; 30 | 31 | - (void) accessDeallocatedPtrProxy; 32 | 33 | - (void) zombieNSException; 34 | 35 | - (void) corruptMemory; 36 | 37 | - (void) deadlock; 38 | 39 | - (void) pthreadAPICrash; 40 | 41 | - (void) userDefinedCrash; 42 | 43 | - (void) throwUncaughtCPPException; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/Common-Examples/LoadableCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadableCategory.h 3 | // Objective-Gems 4 | // 5 | // Copyright 2011 Karl Stenerud 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall remain in place 15 | // in this source code. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | 27 | /** Make all categories in the current file loadable without using -load-all. 28 | * 29 | * Normally, compilers will skip linking files that contain only categories. 30 | * Adding a call to this macro adds a dummy class, which causes the linker 31 | * to add the file. 32 | * 33 | * @param UNIQUE_NAME A globally unique name. 34 | */ 35 | #define MAKE_CATEGORIES_LOADABLE(UNIQUE_NAME) \ 36 | @interface FORCELOAD_##UNIQUE_NAME: NSObject @end \ 37 | @implementation FORCELOAD_##UNIQUE_NAME @end 38 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/Framework/KSCrashFramework.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashFramework.h 3 | // KSCrash-iOS 4 | // 5 | // Created by Josh Holtz on 3/2/16. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #ifndef KSCrashFramework_h 10 | #define KSCrashFramework_h 11 | 12 | #import "KSCrash.h" 13 | 14 | #import "KSArchSpecific.h" 15 | #import "KSCrashAdvanced.h" 16 | #import "KSCrashC.h" 17 | #import "KSCrashContext.h" 18 | #import "KSCrashInstallation.h" 19 | #import "KSCrashInstallation+Alert.h" 20 | #import "KSCrashInstallation+Private.h" 21 | #import "KSCrashInstallationConsole.h" 22 | #import "KSCrashInstallationEmail.h" 23 | #import "KSCrashInstallationQuincyHockey.h" 24 | #import "KSCrashInstallationStandard.h" 25 | #import "KSCrashInstallationVictory.h" 26 | #import "KSCrashReportFilterAlert.h" 27 | #import "KSCrashReportFilterAppleFmt.h" 28 | #import "KSCrashReportFilterBasic.h" 29 | #import "KSCrashReportFilterGZip.h" 30 | #import "KSCrashReportFilterJSON.h" 31 | #import "KSCrashReportFilterSets.h" 32 | #import "KSCrashReportFilterStringify.h" 33 | #import "KSCrashReportSinkConsole.h" 34 | #import "KSCrashReportSinkEMail.h" 35 | #import "KSCrashReportSinkQuincyHockey.h" 36 | #import "KSCrashReportSinkStandard.h" 37 | #import "KSCrashReportSinkVictory.h" 38 | #import "KSCrashReportStore.h" 39 | #import "KSCrashSentry.h" 40 | #import "KSCrashState.h" 41 | #import "KSJSONCodecObjC.h" 42 | #import "KSArchSpecific.h" 43 | #import "KSCrashAdvanced.h" 44 | 45 | #import "NSData+GZip.h" 46 | 47 | #endif /* KSCrashFramework_h */ 48 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/Framework/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module KSCrash { 2 | umbrella header "KSCrashFramework.h" 3 | 4 | export * 5 | module * { export * } 6 | } -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/FileBasedTestCase.h: -------------------------------------------------------------------------------- 1 | // 2 | // FileBasedTestCase.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | @interface FileBasedTestCase : XCTestCase 32 | 33 | @property(nonatomic,readwrite,retain) NSString* tempPath; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/FileBasedTestCase.m: -------------------------------------------------------------------------------- 1 | // 2 | // FileBasedTestCase.m 3 | // 4 | // Created by Karl Stenerud on 2012-02-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "FileBasedTestCase.h" 29 | #import "XCTestCase+KSCrash.h" 30 | 31 | 32 | @implementation FileBasedTestCase 33 | 34 | @synthesize tempPath = _tempPath; 35 | 36 | - (void) setUp 37 | { 38 | [super setUp]; 39 | self.tempPath = [self createTempPath]; 40 | } 41 | 42 | - (void) tearDown 43 | { 44 | [super tearDown]; 45 | [self removePath:self.tempPath]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashInstallationStandard_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationStandard_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-03-09. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashInstallationStandard.h" 31 | 32 | 33 | @interface KSCrashInstallationStandard_Tests : XCTestCase @end 34 | 35 | 36 | @implementation KSCrashInstallationStandard_Tests 37 | 38 | - (void) testInstall 39 | { 40 | KSCrashInstallationStandard* installation = [KSCrashInstallationStandard sharedInstance]; 41 | installation.url = [NSURL URLWithString:@"www.google.com"]; 42 | [installation install]; 43 | [installation sendAllReportsWithCompletion:^(__unused NSArray *filteredReports, BOOL completed, NSError *error) 44 | { 45 | // There are no reports, so this will succeed. 46 | XCTAssertTrue(completed, @""); 47 | XCTAssertNil(error, @""); 48 | }]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashInstallationVictory_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationStandard_Tests.m 3 | // 4 | // Created by Kelp on 2013-03-14. 5 | // 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashInstallationVictory.h" 31 | 32 | 33 | @interface KSCrashInstallationVictory_Tests : XCTestCase @end 34 | 35 | 36 | @implementation KSCrashInstallationVictory_Tests 37 | 38 | - (void) testInstall 39 | { 40 | KSCrashInstallationVictory* installation = [KSCrashInstallationVictory sharedInstance]; 41 | installation.url = [NSURL URLWithString:@"https://victory-demo.appspot.com/api/v1/crash/0571f5f6-652d-413f-8043-0e9531e1b689"]; 42 | installation.userName = nil; 43 | installation.userEmail = nil; 44 | 45 | [installation install]; 46 | [installation sendAllReportsWithCompletion:^(__unused NSArray *filteredReports, BOOL completed, NSError *error) 47 | { 48 | // There are no reports, so this will succeed. 49 | XCTAssertTrue(completed, @""); 50 | XCTAssertNil(error, @""); 51 | }]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashReportFilterAlert_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterAlert_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-03-09. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashReportFilterAlert.h" 31 | 32 | 33 | @interface KSCrashReportFilterAlert_Tests : XCTestCase @end 34 | 35 | 36 | @implementation KSCrashReportFilterAlert_Tests 37 | 38 | - (void) testAlert 39 | { 40 | id filter = [KSCrashReportFilterAlert filterWithTitle:@"title" 41 | message:@"message" 42 | yesAnswer:@"YES" 43 | noAnswer:@"NO"]; 44 | 45 | [filter filterReports:[NSArray array] onCompletion:^(__unused NSArray* filteredReports, 46 | BOOL completed, 47 | NSError* error) 48 | { 49 | XCTAssertTrue(completed, @""); 50 | XCTAssertNil(error, @""); 51 | }]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashSentry_Deadlock_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_Deadlock_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-01-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashSentry_Deadlock.h" 31 | 32 | 33 | @interface KSCrashSentry_Deadlock_Tests : XCTestCase @end 34 | 35 | 36 | @implementation KSCrashSentry_Deadlock_Tests 37 | 38 | - (void) testInstallAndRemove 39 | { 40 | bool success; 41 | KSCrash_SentryContext context; 42 | kscrashsentry_setDeadlockHandlerWatchdogInterval(10); 43 | success = kscrashsentry_installDeadlockHandler(&context); 44 | XCTAssertTrue(success, @""); 45 | [NSThread sleepForTimeInterval:0.1]; 46 | kscrashsentry_uninstallDeadlockHandler(); 47 | } 48 | 49 | - (void) testDoubleInstallAndRemove 50 | { 51 | bool success; 52 | KSCrash_SentryContext context; 53 | success = kscrashsentry_installDeadlockHandler(&context); 54 | XCTAssertTrue(success, @""); 55 | success = kscrashsentry_installDeadlockHandler(&context); 56 | XCTAssertTrue(success, @""); 57 | kscrashsentry_uninstallDeadlockHandler(); 58 | kscrashsentry_uninstallDeadlockHandler(); 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashSentry_NSException_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_NSException_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-01-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashSentry_NSException.h" 31 | 32 | 33 | @interface KSCrashSentry_NSException_Tests : XCTestCase @end 34 | 35 | 36 | @implementation KSCrashSentry_NSException_Tests 37 | 38 | - (void) testInstallAndRemove 39 | { 40 | bool success; 41 | KSCrash_SentryContext context; 42 | success = kscrashsentry_installNSExceptionHandler(&context); 43 | XCTAssertTrue(success, @""); 44 | [NSThread sleepForTimeInterval:0.1]; 45 | kscrashsentry_uninstallNSExceptionHandler(); 46 | } 47 | 48 | - (void) testDoubleInstallAndRemove 49 | { 50 | bool success; 51 | KSCrash_SentryContext context; 52 | success = kscrashsentry_installNSExceptionHandler(&context); 53 | XCTAssertTrue(success, @""); 54 | success = kscrashsentry_installNSExceptionHandler(&context); 55 | XCTAssertTrue(success, @""); 56 | kscrashsentry_uninstallNSExceptionHandler(); 57 | kscrashsentry_uninstallNSExceptionHandler(); 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashSentry_Signal_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_Signal_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-01-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashSentry_Signal.h" 31 | 32 | 33 | @interface KSCrashSentry_Signal_Tests : XCTestCase @end 34 | 35 | 36 | @implementation KSCrashSentry_Signal_Tests 37 | 38 | - (void) testInstallAndRemove 39 | { 40 | bool success; 41 | KSCrash_SentryContext context; 42 | success = kscrashsentry_installSignalHandler(&context); 43 | XCTAssertTrue(success, @""); 44 | [NSThread sleepForTimeInterval:0.1]; 45 | kscrashsentry_uninstallSignalHandler(); 46 | } 47 | 48 | - (void) testDoubleInstallAndRemove 49 | { 50 | bool success; 51 | KSCrash_SentryContext context; 52 | success = kscrashsentry_installSignalHandler(&context); 53 | XCTAssertTrue(success, @""); 54 | success = kscrashsentry_installSignalHandler(&context); 55 | XCTAssertTrue(success, @""); 56 | kscrashsentry_uninstallSignalHandler(); 57 | kscrashsentry_uninstallSignalHandler(); 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashSentry_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-03-09. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSCrashSentry.h" 31 | #import "KSCrashSentry_Private.h" 32 | 33 | static void onCrash(void) 34 | { 35 | // Do nothing 36 | } 37 | 38 | @interface KSCrashSentry_Tests : XCTestCase @end 39 | 40 | 41 | @implementation KSCrashSentry_Tests 42 | 43 | - (void) testInstallUninstall 44 | { 45 | KSCrash_SentryContext context; 46 | kscrashsentry_installWithContext(&context, KSCrashTypeAll, onCrash); 47 | kscrashsentry_uninstall(KSCrashTypeAll); 48 | } 49 | 50 | - (void) testSuspendResumeThreads 51 | { 52 | kscrashsentry_suspendThreads(); 53 | kscrashsentry_suspendThreads(); 54 | kscrashsentry_resumeThreads(); 55 | kscrashsentry_resumeThreads(); 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSCrashTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.stenerud.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/KSDynamicLinker_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSDynamicLinker_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2013-10-02. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "KSDynamicLinker.h" 31 | 32 | @interface KSDynamicLinker_Tests : XCTestCase @end 33 | 34 | @implementation KSDynamicLinker_Tests 35 | 36 | - (void) testImageUUID 37 | { 38 | // Just abritrarily grab the name of the 4th image... 39 | const char* name = _dyld_get_image_name(4); 40 | const uint8_t* uuidBytes = ksdl_imageUUID(name, true); 41 | XCTAssertTrue(uuidBytes != NULL, @""); 42 | } 43 | 44 | - (void) testImageUUIDInvalidName 45 | { 46 | const uint8_t* uuidBytes = ksdl_imageUUID("sdfgserghwerghwrh", true); 47 | XCTAssertTrue(uuidBytes == NULL, @""); 48 | } 49 | 50 | - (void) testImageUUIDNULLName 51 | { 52 | const uint8_t* uuidBytes = ksdl_imageUUID(NULL, true); 53 | XCTAssertTrue(uuidBytes == NULL, @""); 54 | } 55 | 56 | - (void) testImageUUIDPartialMatch 57 | { 58 | const uint8_t* uuidBytes = ksdl_imageUUID("libSystem", false); 59 | XCTAssertTrue(uuidBytes != NULL, @""); 60 | } 61 | 62 | - (void) testGetImageNameNULL 63 | { 64 | uint32_t imageIdx = ksdl_imageNamed(NULL, false); 65 | XCTAssertEqual(imageIdx, UINT32_MAX, @""); 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/NSMutableData+AppendUTF8_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableData_AppendUTF8_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2012-02-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | #import "NSMutableData+AppendUTF8.h" 31 | 32 | 33 | @interface NSMutableData_AppendUTF8_Tests : XCTestCase @end 34 | 35 | 36 | @implementation NSMutableData_AppendUTF8_Tests 37 | 38 | - (void) testAppendUTF8String 39 | { 40 | NSString* expected = @"testテスト"; 41 | NSMutableData* data = [NSMutableData data]; 42 | [data appendUTF8String:expected]; 43 | NSString* actual = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 44 | 45 | XCTAssertEqualObjects(actual, expected, @""); 46 | } 47 | 48 | - (void) testAppendUTF8Format 49 | { 50 | NSString* expected = @"Testing 1 2.0 3"; 51 | NSMutableData* data = [NSMutableData data]; 52 | [data appendUTF8Format:@"Testing %d %.1f %@", 1, 2.0, @"3"]; 53 | NSString* actual = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 54 | 55 | XCTAssertEqualObjects(actual, expected, @""); 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash-Tests/XCTestCase+KSCrash.h: -------------------------------------------------------------------------------- 1 | // 2 | // SenTestCase+KSCrash.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | @interface XCTestCase (XCTestCase_KSCrash) 32 | 33 | - (NSString*) createTempPath; 34 | 35 | - (void) removePath:(NSString*) path; 36 | 37 | - (void) createTempReportsAtPath:(NSString*) reportsPath 38 | prefix:(NSString*) reportPrefix; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Installations/KSCrashInstallation+Alert.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallation+Alert.h 3 | // 4 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall remain in place 14 | // in this source code. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "KSCrashInstallation.h" 26 | 27 | @interface KSCrashInstallation (Alert) 28 | 29 | /** Show an alert before sending any reports. Reports will only be sent if the user 30 | * presses the "yes" button. 31 | * 32 | * @param title The alert title. 33 | * @param message The message to show the user. 34 | * @param yesAnswer The text to display in the "yes" box. 35 | * @param noAnswer The text to display in the "no" box. 36 | */ 37 | - (void) addConditionalAlertWithTitle:(NSString*) title 38 | message:(NSString*) message 39 | yesAnswer:(NSString*) yesAnswer 40 | noAnswer:(NSString*) noAnswer; 41 | 42 | /** Show an alert before sending any reports. Reports will be unconditionally sent 43 | * when the alert is dismissed. 44 | * 45 | * @param title The alert title. 46 | * @param message The message to show the user. 47 | * @param dismissButtonText The text to display in the dismiss button. 48 | */ 49 | - (void) addUnconditionalAlertWithTitle:(NSString*) title 50 | message:(NSString*) message 51 | dismissButtonText:(NSString*) dismissButtonText; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Installations/KSCrashInstallationConsole.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationConsole.h 3 | // KSCrash-iOS 4 | // 5 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall remain in place 15 | // in this source code. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "KSCrashInstallation.h" 27 | 28 | /** Prints all reports to the console. 29 | * This class is intended for testing purposes. 30 | */ 31 | @interface KSCrashInstallationConsole : KSCrashInstallation 32 | 33 | @property(nonatomic,readwrite) BOOL printAppleFormat; 34 | 35 | + (instancetype) sharedInstance; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Installations/KSCrashInstallationStandard.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationStandard.h 3 | // 4 | // Created by Karl Stenerud on 2013-03-02. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashInstallation.h" 29 | 30 | 31 | @interface KSCrashInstallationStandard : KSCrashInstallation 32 | 33 | /** The URL to connect to. */ 34 | @property(nonatomic,readwrite,retain) NSURL* url; 35 | 36 | + (KSCrashInstallationStandard*) sharedInstance; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Installations/KSCrashInstallationStandard.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationStandard.m 3 | // 4 | // Created by Karl Stenerud on 2013-03-02. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashInstallationStandard.h" 29 | #import "KSCrashInstallation+Private.h" 30 | #import "KSSingleton.h" 31 | #import "KSCrashReportSinkStandard.h" 32 | 33 | 34 | @implementation KSCrashInstallationStandard 35 | 36 | IMPLEMENT_EXCLUSIVE_SHARED_INSTANCE(KSCrashInstallationStandard) 37 | 38 | @synthesize url = _url; 39 | 40 | - (id) init 41 | { 42 | if((self = [super initWithRequiredProperties:[NSArray arrayWithObjects: 43 | @"url", 44 | nil]])) 45 | { 46 | } 47 | return self; 48 | } 49 | 50 | - (id) sink 51 | { 52 | KSCrashReportSinkStandard* sink = [KSCrashReportSinkStandard sinkWithURL:self.url]; 53 | return [KSCrashReportFilterPipeline filterWithFilters:[sink defaultCrashReportFilterSet], nil]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Installations/KSCrashInstallationVictory.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationVictory.h 3 | // 4 | // Created by Kelp on 2013-03-14. 5 | // 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashInstallation.h" 29 | 30 | 31 | /** 32 | Victory is an error reporting server in Python. It runs on Google App Engine. 33 | https://github.com/kelp404/Victory 34 | 35 | You could download this project and then deploy to GAE with free plan. 36 | Your app could send error information to Victory with RESTful API. 37 | This is a demo site: https://victory-demo.appspot.com/ 38 | */ 39 | @interface KSCrashInstallationVictory : KSCrashInstallation 40 | 41 | /** The URL to connect to. */ 42 | @property(nonatomic,readwrite,retain) NSURL* url; 43 | /** The user name of crash information *required. If value is nil it will be replaced with UIDevice.currentDevice.name */ 44 | @property(nonatomic,readwrite,retain) NSString* userName; 45 | /** The user email of crash information *optional */ 46 | @property(nonatomic,readwrite,retain) NSString* userEmail; 47 | 48 | + (KSCrashInstallationVictory*) sharedInstance; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Installations/KSCrashInstallationVictory.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashInstallationVictory.m 3 | // 4 | // Created by Kelp on 2013-03-13. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashInstallationVictory.h" 29 | #import "KSCrashInstallation+Private.h" 30 | #import "KSSingleton.h" 31 | #import "KSCrashReportSinkVictory.h" 32 | 33 | 34 | @implementation KSCrashInstallationVictory 35 | 36 | IMPLEMENT_EXCLUSIVE_SHARED_INSTANCE(KSCrashInstallationVictory) 37 | 38 | @synthesize url = _url; 39 | @synthesize userName = _userName; 40 | @synthesize userEmail = _userEmail; 41 | 42 | - (id) init 43 | { 44 | if((self = [super initWithRequiredProperties:[NSArray arrayWithObjects: 45 | @"url", 46 | nil]])) 47 | { 48 | } 49 | return self; 50 | } 51 | 52 | - (id) sink 53 | { 54 | KSCrashReportSinkVictory* sink = [KSCrashReportSinkVictory sinkWithURL:self.url userName:self.userName userEmail:self.userEmail]; 55 | return [KSCrashReportFilterPipeline filterWithFilters:[sink defaultCrashReportFilterSet], nil]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/KSCrashDoctor.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashDoctor.h 3 | // KSCrash 4 | // 5 | // Created by Karl Stenerud on 2012-11-10. 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KSCrashDoctor : NSObject 12 | 13 | + (KSCrashDoctor*) doctor; 14 | 15 | - (NSString*) diagnoseCrash:(NSDictionary*) crashReport; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/KSCrashReportVersion.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportVersion.h 3 | // 4 | // Created by Karl Stenerud on 2016-03-10. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #ifndef HDR_KSCrashReportVersion_h 28 | #define HDR_KSCrashReportVersion_h 29 | 30 | #define KSCRASH_REPORT_VERSION "3.1.0" 31 | 32 | #endif /* HDR_KSCrashReportVersion_h */ 33 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/KSCrashType.c: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashType.c 3 | // 4 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall remain in place 14 | // in this source code. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | 26 | #include "KSCrashType.h" 27 | 28 | #include 29 | 30 | 31 | static const struct 32 | { 33 | const KSCrashType type; 34 | const char* const name; 35 | } g_crashTypes[] = 36 | { 37 | #define CRASHTYPE(NAME) {NAME, #NAME} 38 | CRASHTYPE(KSCrashTypeMachException), 39 | CRASHTYPE(KSCrashTypeSignal), 40 | CRASHTYPE(KSCrashTypeCPPException), 41 | CRASHTYPE(KSCrashTypeNSException), 42 | CRASHTYPE(KSCrashTypeMainThreadDeadlock), 43 | CRASHTYPE(KSCrashTypeUserReported), 44 | }; 45 | static const int g_crashTypesCount = sizeof(g_crashTypes) / sizeof(*g_crashTypes); 46 | 47 | 48 | const char* kscrashtype_name(const KSCrashType crashType) 49 | { 50 | for(int i = 0; i < g_crashTypesCount; i++) 51 | { 52 | if(g_crashTypes[i].type == crashType) 53 | { 54 | return g_crashTypes[i].name; 55 | } 56 | } 57 | return NULL; 58 | } 59 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/KSSystemCapabilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSSystemCapabilities.h 3 | // 4 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall remain in place 14 | // in this source code. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | 26 | #ifndef HDR_KSSystemCapabilities_h 27 | #define HDR_KSSystemCapabilities_h 28 | 29 | #include 30 | 31 | #define KSCRASH_HOST_IOS TARGET_OS_IOS 32 | #define KSCRASH_HOST_TVOS TARGET_OS_TV 33 | #define KSCRASH_HOST_WATCH TARGET_OS_WATCH 34 | #define KSCRASH_HOST_OSX (TARGET_OS_MAC && !(TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH)) 35 | 36 | #if KSCRASH_HOST_IOS || KSCRASH_HOST_TVOS 37 | #define KSCRASH_HAS_UIKIT 1 38 | #else 39 | #define KSCRASH_HAS_UIKIT 0 40 | #endif 41 | 42 | #if KSCRASH_HOST_IOS 43 | #define KSCRASH_HAS_MESSAGEUI 1 44 | #else 45 | #define KSCRASH_HAS_MESSAGEUI 0 46 | #endif 47 | 48 | #if KSCRASH_HOST_IOS || KSCRASH_HOST_TVOS 49 | #define KSCRASH_HAS_UIDEVICE 1 50 | #else 51 | #define KSCRASH_HAS_UIDEVICE 0 52 | #endif 53 | 54 | #if KSCRASH_HOST_IOS || KSCRASH_HOST_OSX 55 | #define KSCRASH_HAS_ALERTVIEW 1 56 | #else 57 | #define KSCRASH_HAS_ALERTVIEW 0 58 | #endif 59 | 60 | #if KSCRASH_HOST_IOS 61 | #define KSCRASH_HAS_UIALERTVIEW 1 62 | #else 63 | #define KSCRASH_HAS_UIALERTVIEW 0 64 | #endif 65 | 66 | #if KSCRASH_HOST_OSX 67 | #define KSCRASH_HAS_NSALERT 1 68 | #else 69 | #define KSCRASH_HAS_NSALERT 0 70 | #endif 71 | 72 | #if KSCRASH_HOST_IOS || KSCRASH_HOST_OSX 73 | #define KSCRASH_HAS_MACH 1 74 | #else 75 | #define KSCRASH_HAS_MACH 0 76 | #endif 77 | 78 | 79 | #endif // HDR_KSSystemCapabilities_h 80 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/KSSystemInfoC.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSSystemInfoC.h 3 | // 4 | // Created by Karl Stenerud on 2012-05-08. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | /* C interface to the system information. 29 | */ 30 | 31 | 32 | #ifndef KSCrash_KSSystemInfoC_h 33 | #define KSCrash_KSSystemInfoC_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** Get the complete system info dictionary encoded to JSON. 41 | * 42 | * @return System info as JSON. Caller is responsible for calling free(). 43 | */ 44 | const char* kssysteminfo_toJSON(void); 45 | 46 | /** Create a copy of the current process name. 47 | * 48 | * @return The process name. Caller is responsible for calling free(). 49 | */ 50 | char* kssysteminfo_copyProcessName(void); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Sentry/KSCrashSentry_CPPException.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_CPPException.h 3 | // 4 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall remain in place 14 | // in this source code. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #ifndef HDR_KSCrashSentry_CPPException_h 26 | #define HDR_KSCrashSentry_CPPException_h 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #include "KSCrashSentry.h" 33 | 34 | 35 | /** Install the C++ exception handler. 36 | * 37 | * @param context Contextual information for the crash handler. 38 | * 39 | * @return true if installation was succesful. 40 | */ 41 | bool kscrashsentry_installCPPExceptionHandler(KSCrash_SentryContext* context); 42 | 43 | /** Uninstall the C++ exception handler. 44 | */ 45 | void kscrashsentry_uninstallCPPExceptionHandler(void); 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // HDR_KSCrashSentry_CPPException_h 53 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Sentry/KSCrashSentry_Deadlock.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_Deadlock.h 3 | // 4 | // Created by Karl Stenerud on 2012-12-09. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | /* Catches deadlocks in threads and queues. 28 | */ 29 | 30 | 31 | #ifndef HDR_KSCrashSentry_Deadlock_h 32 | #define HDR_KSCrashSentry_Deadlock_h 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | 39 | #include "KSCrashSentry.h" 40 | 41 | 42 | /** Install the deadlock handler. 43 | * 44 | * @param context The crash context to fill out when a crash occurs. 45 | * 46 | * @return true if installation was succesful. 47 | */ 48 | bool kscrashsentry_installDeadlockHandler(KSCrash_SentryContext* context); 49 | 50 | /** Uninstall our custome NSException handler. 51 | */ 52 | void kscrashsentry_uninstallDeadlockHandler(void); 53 | 54 | /** Set the interval between watchdog checks on the main thread. 55 | * Default is 5 seconds. 56 | * 57 | * @param value The number of seconds between checks (0 = disabled). 58 | */ 59 | void kscrashsentry_setDeadlockHandlerWatchdogInterval(double value); 60 | 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif // HDR_KSCrashSentry_Deadlock_h 67 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Sentry/KSCrashSentry_MachException.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_MachException.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-04. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | /* Catches mach exceptions. 29 | */ 30 | 31 | 32 | #ifndef HDR_KSCrashSentry_MachException_h 33 | #define HDR_KSCrashSentry_MachException_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | #include "KSCrashSentry.h" 40 | #include 41 | 42 | 43 | /** Install our custom mach exception handler. 44 | * 45 | * @param context Contextual information for the crash handler. 46 | * 47 | * @return true if installation was succesful. 48 | */ 49 | bool kscrashsentry_installMachHandler(KSCrash_SentryContext* context); 50 | 51 | /** Uninstall our custom mach exception handler. 52 | */ 53 | void kscrashsentry_uninstallMachHandler(void); 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // HDR_KSCrashSentry_MachException_h 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Sentry/KSCrashSentry_NSException.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_NSException.h 3 | // 4 | // Created by Karl Stenerud on 2012-01-28. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | /* Catches Objective-C exceptions. 29 | */ 30 | 31 | 32 | #ifndef HDR_KSCrashSentry_NSException_h 33 | #define HDR_KSCrashSentry_NSException_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | #include "KSCrashSentry.h" 41 | 42 | 43 | /** Install our custom NSException handler. 44 | * 45 | * @param context The crash context to fill out when a crash occurs. 46 | * 47 | * @return true if installation was succesful. 48 | */ 49 | bool kscrashsentry_installNSExceptionHandler(KSCrash_SentryContext* context); 50 | 51 | /** Uninstall our custome NSException handler. 52 | */ 53 | void kscrashsentry_uninstallNSExceptionHandler(void); 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // HDR_KSCrashSentry_NSException_h 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Sentry/KSCrashSentry_Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_Private.h 3 | // 4 | // Created by Karl Stenerud on 2012-09-29. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #ifndef HDR_KSCrashSentry_Private_h 29 | #define HDR_KSCrashSentry_Private_h 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | 36 | #include "KSCrashSentry.h" 37 | 38 | 39 | /** Suspend all non-reserved threads. 40 | * 41 | * Reserved threads include the current thread and all threads in 42 | "reservedThreads" in the context. 43 | */ 44 | void kscrashsentry_suspendThreads(void); 45 | 46 | /** Resume all non-reserved threads. 47 | * 48 | * Reserved threads include the current thread and all threads in 49 | * "reservedThreads" in the context. 50 | */ 51 | void kscrashsentry_resumeThreads(void); 52 | 53 | /** Prepare the context for handling a new crash. 54 | */ 55 | void kscrashsentry_beginHandlingCrash(KSCrash_SentryContext* context); 56 | 57 | /** Clear a crash sentry context. 58 | */ 59 | void kscrashsentry_clearContext(KSCrash_SentryContext* context); 60 | 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif // HDR_KSCrashSentry_Private_h 67 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Sentry/KSCrashSentry_Signal.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashSentry_Signal.h 3 | // 4 | // Created by Karl Stenerud on 2012-01-28. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | /* Catches fatal unix signals. 29 | */ 30 | 31 | 32 | #ifndef HDR_KSCrashSentry_Signal_h 33 | #define HDR_KSCrashSentry_Signal_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | #include "KSCrashSentry.h" 41 | 42 | 43 | /** Install our custom signal handler. 44 | * 45 | * @param context The crash context to fill out when a crash occurs. 46 | * 47 | * @return true if installation was succesful. 48 | */ 49 | bool kscrashsentry_installSignalHandler(KSCrash_SentryContext* context); 50 | 51 | /** Uninstall our custom signal handlers and restore the previous ones. 52 | */ 53 | void kscrashsentry_uninstallSignalHandler(void); 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // HDR_KSCrashSentry_Signal_h 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/KSArchSpecific.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSArchSpecific.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-17. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | /* Architecture-dependent defines. 29 | */ 30 | 31 | 32 | #ifndef HDR_KSArchSpecific_h 33 | #define HDR_KSArchSpecific_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | #include 41 | 42 | #ifdef __LP64__ 43 | #define STRUCT_NLIST struct nlist_64 44 | #else 45 | #define STRUCT_NLIST struct nlist 46 | #endif 47 | 48 | 49 | #ifdef __arm64__ 50 | #define STRUCT_MCONTEXT_L _STRUCT_MCONTEXT64 51 | #else 52 | #define STRUCT_MCONTEXT_L _STRUCT_MCONTEXT 53 | #endif 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // HDR_KSArchSpecific_h 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/KSCrashCallCompletion.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashCallCompletion.h 3 | // 4 | // Created by Karl Stenerud on 2013-02-10. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "KSCrashReportFilter.h" 28 | 29 | /** Conditionally call a completion method if it's not nil. 30 | * 31 | * @param onCompletion The completion block. If nil, this function does nothing. 32 | * @param filteredReports The parameter to send as "filteredReports". 33 | * @param completed The parameter to send as "completed". 34 | * @param error The parameter to send as "error". 35 | */ 36 | void kscrash_i_callCompletion(KSCrashReportFilterCompletion onCompletion, 37 | NSArray* filteredReports, 38 | BOOL completed, 39 | NSError* error); 40 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/KSCrashCallCompletion.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashCallCompletion.m 3 | // 4 | // Created by Karl Stenerud on 2013-02-10. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "KSCrashCallCompletion.h" 28 | 29 | void kscrash_i_callCompletion(KSCrashReportFilterCompletion onCompletion, 30 | NSArray* filteredReports, 31 | BOOL completed, 32 | NSError* error) 33 | { 34 | if(onCompletion) 35 | { 36 | onCompletion(filteredReports, completed, error); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/KSSafeCollections.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSSafeCollections.h 3 | // 4 | // Created by Karl Stenerud on 2012-08-21. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | @interface NSMutableArray (KSSafeCollections) 32 | 33 | - (void) addObjectIfNotNil:(id) object; 34 | 35 | - (void) safeAddObject:(id) object; 36 | 37 | - (void) insertObjectIfNotNil:(id) object atIndex:(NSUInteger) index; 38 | 39 | - (void) safeInsertObject:(id) object atIndex:(NSUInteger) index; 40 | 41 | @end 42 | 43 | 44 | @interface NSMutableDictionary (KSSafeCollections) 45 | 46 | - (void) setObjectIfNotNil:(id) object forKey:(id) key; 47 | 48 | - (void) safeSetObject:(id) object forKey:(id) key; 49 | 50 | - (void) setValueIfNotNil:(id) value forKey:(NSString*) key; 51 | 52 | - (void) safeSetValue:(id) value forKey:(NSString*) key; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/NSDictionary+Merge.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Merge.h 3 | // 4 | // Created by Karl Stenerud on 2012-10-01. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | /** Adds dictionary merging capabilities. 32 | */ 33 | @interface NSDictionary (KSMerge) 34 | 35 | /** Recursively merge this dictionary into the destination dictionary. 36 | * If the same key exists in both dictionaries, the following occurs: 37 | * - If both entries are dictionaries, the sub-dictionaries are merged and 38 | * placed into the merged dictionary. 39 | * - Otherwise the entry from this dictionary overrides the entry from the 40 | * destination in the merged dictionary. 41 | * 42 | * Note: Neither this dictionary nor the destination will be modified by this 43 | * operation. 44 | * 45 | * @param dest The dictionary to merge into. Can be nil or empty, in which case 46 | * this dictionary is returned. 47 | * 48 | * @return The merged dictionary. 49 | */ 50 | - (NSDictionary*) mergedInto:(NSDictionary*) dest; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/NSDictionary+Merge.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+Merge.m 3 | // 4 | // Created by Karl Stenerud on 2012-10-01. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "NSDictionary+Merge.h" 29 | 30 | 31 | @implementation NSDictionary (KSMerge) 32 | 33 | - (NSDictionary*) mergedInto:(NSDictionary*) dest 34 | { 35 | if([dest count] == 0) 36 | { 37 | return self; 38 | } 39 | if([self count] == 0) 40 | { 41 | return dest; 42 | } 43 | 44 | NSMutableDictionary* dict = [dest mutableCopy]; 45 | for(id key in [self allKeys]) 46 | { 47 | id srcEntry = [self objectForKey:key]; 48 | id dstEntry = [dest objectForKey:key]; 49 | if([dstEntry isKindOfClass:[NSDictionary class]] && 50 | [srcEntry isKindOfClass:[NSDictionary class]]) 51 | { 52 | srcEntry = [srcEntry mergedInto:dstEntry]; 53 | } 54 | [dict setObject:srcEntry forKey:key]; 55 | } 56 | return dict; 57 | } 58 | 59 | @end 60 | 61 | @interface NSDictionary_Merge_O8FG4A : NSObject @end @implementation NSDictionary_Merge_O8FG4A @end 62 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/NSString+Demangle.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableData+AppendUTF8.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | /** Demangles C++ or Swift symbols. 32 | */ 33 | @interface NSString (Demangle) 34 | 35 | /** Demangle a symbol into a human readable format. 36 | * 37 | * @return The demangled symbol, or the original string if it couldn't be demangled. 38 | */ 39 | - (NSString*) demangledSymbol; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/RFC3339DateTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // RFC3339DateTool.h 3 | // 4 | // Copyright 2010 Karl Stenerud 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall remain in place 14 | // in this source code. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | 26 | #import 27 | 28 | 29 | /** 30 | * Tool for converting to/from RFC3339 compliant date strings. 31 | */ 32 | @interface RFC3339DateTool : NSObject 33 | 34 | /** Convert a date to an RFC3339 string representation. 35 | * 36 | * @param date The date to convert. 37 | * 38 | * @return The RFC3339 date string. 39 | */ 40 | + (NSString*) stringFromDate:(NSDate*) date; 41 | 42 | /** Convert an RFC3339 string representation to a date. 43 | * 44 | * @param string The string to convert. 45 | * 46 | * @return The date. 47 | */ 48 | + (NSDate*) dateFromString:(NSString*) string; 49 | 50 | /** Convert a UNIX timestamp to an RFC3339 string representation. 51 | * 52 | * @param date The date to convert. 53 | * 54 | * @return The RFC3339 date string. 55 | */ 56 | + (NSString*) stringFromUNIXTimestamp:(unsigned long long) timestamp; 57 | 58 | /** Convert an RFC3339 string representation to a UNIX timestamp. 59 | * 60 | * @param string The string to convert. 61 | * 62 | * @return The timestamp. 63 | */ 64 | + (unsigned long long) UNIXTimestampFromString:(NSString*) string; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Recording/Tools/RFC3339DateTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // RFC3339DateTool.m 3 | // 4 | // Copyright 2010 Karl Stenerud 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall remain in place 14 | // in this source code. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | 26 | #import "RFC3339DateTool.h" 27 | 28 | 29 | @implementation RFC3339DateTool 30 | 31 | static NSDateFormatter* g_formatter; 32 | 33 | + (void) initialize 34 | { 35 | g_formatter = [[NSDateFormatter alloc] init]; 36 | NSLocale* locale = [[NSLocale alloc] 37 | initWithLocaleIdentifier:@"en_US_POSIX"]; 38 | [g_formatter setLocale:locale]; 39 | [g_formatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; 40 | [g_formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; 41 | } 42 | 43 | + (NSString*) stringFromDate:(NSDate*) date 44 | { 45 | if(![date isKindOfClass:[NSDate class]]) 46 | { 47 | return nil; 48 | } 49 | return [g_formatter stringFromDate:date]; 50 | } 51 | 52 | + (NSDate*) dateFromString:(NSString*) string 53 | { 54 | if(![string isKindOfClass:[NSString class]]) 55 | { 56 | return nil; 57 | } 58 | return [g_formatter dateFromString:string]; 59 | } 60 | 61 | + (NSString*) stringFromUNIXTimestamp:(unsigned long long) timestamp 62 | { 63 | return [self stringFromDate:[NSDate dateWithTimeIntervalSince1970:timestamp]]; 64 | } 65 | 66 | + (unsigned long long) UNIXTimestampFromString:(NSString*) string 67 | { 68 | return (unsigned long long)[[self dateFromString:string] timeIntervalSince1970]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/KSCrashReportFilterBasic.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterBasic.h 3 | // 4 | // Created by Karl Stenerud on 2012-05-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | 30 | 31 | /** 32 | * Convert UTF-8 data to an NSString. 33 | * 34 | * Input: NSData 35 | * Output: NSString 36 | */ 37 | @interface KSCrashReportFilterDataToString : NSObject 38 | 39 | + (KSCrashReportFilterDataToString*) filter; 40 | 41 | @end 42 | 43 | 44 | /** 45 | * Convert NSString to UTF-8 encoded NSData. 46 | * 47 | * Input: NSString 48 | * Output: NSData 49 | */ 50 | @interface KSCrashReportFilterStringToData : NSObject 51 | 52 | + (KSCrashReportFilterStringToData*) filter; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/KSCrashReportFilterGZip.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterGZip.h 3 | // 4 | // Created by Karl Stenerud on 2012-05-10. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | 30 | 31 | /** Gzip compresses reports. 32 | * 33 | * Input: NSData 34 | * Output: NSData 35 | */ 36 | @interface KSCrashReportFilterGZipCompress : NSObject 37 | 38 | /** Constructor. 39 | * 40 | * @param compressionLevel 0 = none, 9 = best, -1 = default 41 | */ 42 | + (KSCrashReportFilterGZipCompress*) filterWithCompressionLevel:(int) compressionLevel; 43 | 44 | - (id) initWithCompressionLevel:(int) compressionLevel; 45 | 46 | @end 47 | 48 | /** Gzip decompresses reports. 49 | * 50 | * Input: NSData 51 | * Output: NSData 52 | */ 53 | @interface KSCrashReportFilterGZipDecompress : NSObject 54 | 55 | + (KSCrashReportFilterGZipDecompress*) filter; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/KSCrashReportFilterJSON.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterJSON.h 3 | // 4 | // Created by Karl Stenerud on 2012-05-09. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | #import "KSJSONCodecObjC.h" 30 | 31 | 32 | /** Converts reports from dict to JSON. 33 | * 34 | * Input: NSDictionary 35 | * Output: NSData 36 | */ 37 | @interface KSCrashReportFilterJSONEncode : NSObject 38 | 39 | + (KSCrashReportFilterJSONEncode*) filterWithOptions:(KSJSONEncodeOption) options; 40 | 41 | - (id) initWithOptions:(KSJSONEncodeOption) options; 42 | 43 | @end 44 | 45 | 46 | /** Converts reports from JSON to dict. 47 | * 48 | * Input: NSData 49 | * Output: NSDictionary 50 | */ 51 | @interface KSCrashReportFilterJSONDecode : NSObject 52 | 53 | + (KSCrashReportFilterJSONDecode*) filterWithOptions:(KSJSONDecodeOption) options; 54 | 55 | - (id) initWithOptions:(KSJSONDecodeOption) options; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/KSCrashReportFilterSets.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterSets.h 3 | // 4 | // Created by Karl Stenerud on 2012-08-21. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | #import "KSCrashReportFilterAppleFmt.h" 30 | 31 | 32 | /** 33 | * Common filter sets. 34 | */ 35 | @interface KSCrashFilterSets : NSObject 36 | 37 | /** Create an Apple format filter that includes system and user data in JSON format. 38 | */ 39 | + (id) appleFmtWithUserAndSystemData:(KSAppleReportStyle) reportStyle 40 | compressed:(BOOL) compressed; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/KSCrashReportFilterStringify.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterStringify.h 3 | // KSCrash 4 | // 5 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall remain in place 15 | // in this source code. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "KSCrashReportFilter.h" 27 | 28 | /** Converts objects into strings. 29 | */ 30 | @interface KSCrashReportFilterStringify : NSObject 31 | 32 | + (KSCrashReportFilterStringify*) filter; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/KSCrashReportFilterStringify.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportFilterStringify.m 3 | // KSCrash 4 | // 5 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall remain in place 15 | // in this source code. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "KSCrashReportFilterStringify.h" 27 | #import "KSCrashCallCompletion.h" 28 | 29 | @implementation KSCrashReportFilterStringify 30 | 31 | + (KSCrashReportFilterStringify*) filter 32 | { 33 | return [[self alloc] init]; 34 | } 35 | 36 | - (NSString*) stringifyObject:(id) object 37 | { 38 | if([object isKindOfClass:[NSString class]]) 39 | { 40 | return object; 41 | } 42 | if([object isKindOfClass:[NSData class]]) 43 | { 44 | return [[NSString alloc] initWithData:object encoding:NSUTF8StringEncoding]; 45 | } 46 | return [NSString stringWithFormat:@"%@", object]; 47 | } 48 | 49 | - (void) filterReports:(NSArray*) reports 50 | onCompletion:(KSCrashReportFilterCompletion) onCompletion 51 | { 52 | NSMutableArray* filteredReports = [NSMutableArray arrayWithCapacity:[reports count]]; 53 | for(id report in reports) 54 | { 55 | [filteredReports addObject:[self stringifyObject:report]]; 56 | } 57 | 58 | kscrash_i_callCompletion(onCompletion, filteredReports, YES, nil); 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Filters/Tools/NSData+GZip.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+GZip.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-19. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | /** 32 | * GNU zip/unzip support for NSData. 33 | */ 34 | @interface NSData (GZip) 35 | 36 | /** 37 | * Gzip the data in this object (no header). 38 | * 39 | * @param compressionLevel The GZip compression level to use: 40 | * 0 = no compression. 41 | * 1 = best speed. 42 | * 9 = best compression. 43 | * -1 = default. 44 | * 45 | * @param error (optional) Set to any error that occurs, or nil if no error. 46 | * Pass nil to ignore. 47 | * 48 | * @return A new NSData with the gzipped contents of this object. 49 | */ 50 | - (NSData*) gzippedWithCompressionLevel:(int) compressionLevel 51 | error:(NSError**) error; 52 | 53 | /** 54 | * Gunzip the data in this object (no header). 55 | * 56 | * @param error (optional) Set to any error that occurs, or nil if no error. 57 | * Pass nil to ignore. 58 | * 59 | * @return A new NSData with the gunzipped contents of this object. 60 | */ 61 | - (NSData*) gunzippedWithError:(NSError**) error; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Sinks/KSCrashReportSinkConsole.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportSinkConsole.h 3 | // 4 | // Created by Karl Stenerud on 12-05-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | 30 | /** 31 | * Prints reports directly to the console. 32 | * 33 | * Input: Anything 34 | * Output: Same as input (passthrough) 35 | */ 36 | @interface KSCrashReportSinkConsole : NSObject 37 | 38 | + (KSCrashReportSinkConsole*) filter; 39 | 40 | - (id ) defaultCrashReportFilterSet; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Sinks/KSCrashReportSinkConsole.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportSinkConsole.m 3 | // 4 | // Created by Karl Stenerud on 2012-05-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportSinkConsole.h" 29 | #import "KSCrashCallCompletion.h" 30 | #import "KSCrashReportFilterAppleFmt.h" 31 | 32 | 33 | @implementation KSCrashReportSinkConsole 34 | 35 | + (KSCrashReportSinkConsole*) filter 36 | { 37 | return [[self alloc] init]; 38 | } 39 | 40 | - (id ) defaultCrashReportFilterSet 41 | { 42 | return [KSCrashReportFilterPipeline filterWithFilters: 43 | [KSCrashReportFilterAppleFmt filterWithReportStyle:KSAppleReportStyleSymbolicated], 44 | self, 45 | nil]; 46 | } 47 | 48 | - (void) filterReports:(NSArray*) reports 49 | onCompletion:(KSCrashReportFilterCompletion) onCompletion 50 | { 51 | int i = 0; 52 | for(NSString* report in reports) 53 | { 54 | NSLog(@"Report %d:\n%@", ++i, report); 55 | } 56 | 57 | kscrash_i_callCompletion(onCompletion, reports, YES, nil); 58 | } 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Sinks/KSCrashReportSinkStandard.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportSinkStandard.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-18. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | 30 | 31 | /** 32 | * Sends crash reports to an HTTP server. 33 | * 34 | * Input: NSDictionary 35 | * Output: Same as input (passthrough) 36 | */ 37 | @interface KSCrashReportSinkStandard : NSObject 38 | 39 | /** Constructor. 40 | * 41 | * @param url The URL to connect to. 42 | */ 43 | + (KSCrashReportSinkStandard*) sinkWithURL:(NSURL*) url; 44 | 45 | /** Constructor. 46 | * 47 | * @param url The URL to connect to. 48 | */ 49 | - (id) initWithURL:(NSURL*) url; 50 | 51 | - (id ) defaultCrashReportFilterSet; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Sinks/KSCrashReportSinkVictory.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReportSinkVictory.h 3 | // 4 | // Created by Kelp on 2013-03-14. 5 | // 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "KSCrashReportFilter.h" 29 | 30 | 31 | /** 32 | * Sends crash reports to Victory server. 33 | * 34 | * Input: NSDictionary 35 | * Output: Same as input (passthrough) 36 | */ 37 | @interface KSCrashReportSinkVictory : NSObject 38 | 39 | /** Constructor. 40 | * 41 | * @param url The URL to connect to. 42 | * @param userName The user name of crash information *required. If value is nil it will be replaced with UIDevice.currentDevice.name 43 | * @param userEmail The user email of crash information *optional 44 | */ 45 | + (KSCrashReportSinkVictory*) sinkWithURL:(NSURL*) url 46 | userName:(NSString*) userName 47 | userEmail:(NSString*) userEmail;; 48 | 49 | /** Constructor. 50 | * 51 | * @param url The URL to connect to. 52 | * @param userName The user name of crash information *required. If value is nil it will be replaced with UIDevice.currentDevice.name 53 | * @param userEmail The user email of crash information *optional 54 | */ 55 | - (id) initWithURL:(NSURL*) url 56 | userName:(NSString*) userName 57 | userEmail:(NSString*) userEmail; 58 | 59 | - (id ) defaultCrashReportFilterSet; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Tools/KSCString.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCString.h 3 | // 4 | // Created by Karl Stenerud on 2013-02-23. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | /** 30 | * A string, stored C style with null termination. 31 | */ 32 | @interface KSCString : NSObject 33 | 34 | /** Length of the string in bytes (not characters!). Length does not include null terminator. */ 35 | @property(nonatomic,readonly,assign) size_t length; 36 | 37 | /** String contents, including null terminator */ 38 | @property(nonatomic,readonly,assign) const char* bytes; 39 | 40 | /** Constructor for NSString */ 41 | + (KSCString*) stringWithString:(NSString*) string; 42 | 43 | /** Constructor for null-terminated C string (assumes UTF-8 encoding). */ 44 | + (KSCString*) stringWithCString:(const char*) string; 45 | 46 | /** Constructor for string contained in NSData (assumes UTF-8 encoding). */ 47 | + (KSCString*) stringWithData:(NSData*) data; 48 | 49 | /** Constructor for non-terminated string (assumes UTF-8 encoding). */ 50 | + (KSCString*) stringWithData:(const char*) data length:(size_t) length; 51 | 52 | - (id) initWithString:(NSString*) string; 53 | - (id) initWithCString:(const char*) string; 54 | - (id) initWithData:(NSData*) data; 55 | - (id) initWithData:(const char*) data length:(size_t) length; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Tools/KSHTTPRequestSender.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSHTTPRequestSender.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-19. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | /** 32 | * Sends HTTP requests via the global dispatch queue, informing the caller of 33 | * success, failure, or errors via blocks. 34 | */ 35 | @interface KSHTTPRequestSender : NSObject 36 | 37 | /** Constructor. 38 | */ 39 | + (KSHTTPRequestSender*) sender; 40 | 41 | /** Send an HTTP request. 42 | * The request gets sent via the global dispatch queue using default priority. 43 | * Result blocks will be invoked on the main thread. 44 | * 45 | * @param request The request to send. 46 | * 47 | * @param successBlock Gets executed when the request completes successfully. 48 | * 49 | * @param failureBlock Gets executed if the request fails or receives an HTTP 50 | * response indicating failure. 51 | * 52 | * @param errorBlock Gets executed if an error prevents the request from being 53 | * sent or an invalid (non-HTTP) response is received. 54 | */ 55 | - (void) sendRequest:(NSURLRequest*) request 56 | onSuccess:(void(^)(NSHTTPURLResponse* response, NSData* data)) successBlock 57 | onFailure:(void(^)(NSHTTPURLResponse* response, NSData* data)) failureBlock 58 | onError:(void(^)(NSError* error)) errorBlock; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Tools/NSMutableData+AppendUTF8.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableData+AppendUTF8.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import 29 | 30 | 31 | /** Encodes strings to UTF-8 format. 32 | */ 33 | @interface NSMutableData (AppendUTF8) 34 | 35 | /** Append a string encoded as UTF-8. 36 | * 37 | * @param format Printf-stype format. 38 | */ 39 | - (void) appendUTF8Format:(NSString*) format, ...; 40 | 41 | /** Append a string encoded as UTF-8. 42 | * 43 | * @param string The string to append. 44 | */ 45 | - (void) appendUTF8String:(NSString*) string; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Tools/NSMutableData+AppendUTF8.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableData+AppendUTF8.m 3 | // 4 | // Created by Karl Stenerud on 2012-02-26. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | 28 | #import "NSMutableData+AppendUTF8.h" 29 | 30 | 31 | @implementation NSMutableData (AppendUTF8) 32 | 33 | - (void) appendUTF8String:(NSString*) string 34 | { 35 | const char* cstring = [string UTF8String]; 36 | [self appendBytes:cstring length:strlen(cstring)]; 37 | } 38 | 39 | - (void) appendUTF8Format:(NSString*) format, ... 40 | { 41 | va_list args; 42 | va_start(args, format); 43 | NSString* string = [[NSString alloc] initWithFormat:format arguments:args]; 44 | va_end(args); 45 | const char* cstring = [string UTF8String]; 46 | [self appendBytes:cstring length:strlen(cstring)]; 47 | } 48 | 49 | @end 50 | 51 | @interface NSMutableData_AppendUTF8_GHO92D : NSObject @end @implementation NSMutableData_AppendUTF8_GHO92D @end 52 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Tools/NSString+URLEncode.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+URLEncode.h 3 | // 4 | // Created by karl on 2016-04-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @interface NSString (URLEncode) 30 | 31 | - (NSString*) URLEncoded; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/Reporting/Tools/NSString+URLEncode.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+URLEncode.m 3 | // 4 | // Created by karl on 2016-04-11. 5 | // 6 | // Copyright (c) 2012 Karl Stenerud. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import "NSString+URLEncode.h" 28 | 29 | @implementation NSString (URLEncode) 30 | 31 | - (NSString*) URLEncoded 32 | { 33 | #if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 34 | return [self stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 35 | #else 36 | return [self stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; 37 | #endif 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/llvm/ADT/None.h: -------------------------------------------------------------------------------- 1 | //===-- None.h - Simple null value for implicit construction ------*- C++ -*-=// 2 | // 3 | // The LLVM Compiler Infrastructure 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | // 10 | // This file provides None, an enumerator for use in implicit constructors 11 | // of various (usually templated) types to make such construction more 12 | // terse. 13 | // 14 | //===----------------------------------------------------------------------===// 15 | 16 | #ifndef LLVM_ADT_NONE_H 17 | #define LLVM_ADT_NONE_H 18 | 19 | namespace llvm { 20 | /// \brief A simple null object to allow implicit construction of Optional 21 | /// and similar types without having to spell out the specialization's name. 22 | enum class NoneType { None }; 23 | const NoneType None = None; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/swift/Basic/Fallthrough.h: -------------------------------------------------------------------------------- 1 | //===--- Fallthrough.h - switch fallthrough annotation macro ----*- C++ -*-===// 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | //===----------------------------------------------------------------------===// 12 | // 13 | // This file defines a SWIFT_FALLTHROUGH macro to annotate intentional 14 | // fallthrough between switch cases. For compilers that support the 15 | // "clang::fallthrough" attribute, it expands to an empty statement with the 16 | // attribute applied; otherwise, it expands to just an empty statement. 17 | // 18 | //===----------------------------------------------------------------------===// 19 | 20 | #ifndef __SWIFT_FALLTHROUGH_H__ 21 | #define __SWIFT_FALLTHROUGH_H__ 22 | 23 | #ifndef __has_attribute 24 | # define __has_attribute(x) 0 25 | #endif 26 | 27 | #ifndef __has_cpp_attribute 28 | # define __has_cpp_attribute(x) 0 29 | #endif 30 | 31 | #if __has_attribute(fallthrough) 32 | # define SWIFT_FALLTHROUGH [[clang::fallthrough]] 33 | #elif __has_cpp_attribute(clang::fallthrough) 34 | # define SWIFT_FALLTHROUGH [[clang::fallthrough]] 35 | #else 36 | # define SWIFT_FALLTHROUGH 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/swift/Basic/Malloc.h: -------------------------------------------------------------------------------- 1 | //===--- Malloc.h - Aligned malloc interface --------------------*- C++ -*-===// 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | //===----------------------------------------------------------------------===// 12 | // 13 | // This file provides an implementation of C11 aligned_alloc(3) for platforms 14 | // that don't have it yet, using posix_memalign(3). 15 | // 16 | //===----------------------------------------------------------------------===// 17 | 18 | #ifndef __SWIFT_MALLOC_H__ 19 | #define __SWIFT_MALLOC_H__ 20 | 21 | #include 22 | #include 23 | 24 | namespace swift { 25 | 26 | // FIXME: Use C11 aligned_alloc or Windows _aligned_malloc if available. 27 | inline void *AlignedAlloc(size_t size, size_t align) { 28 | // posix_memalign only accepts alignments greater than sizeof(void*). 29 | // 30 | if (align < sizeof(void*)) 31 | align = sizeof(void*); 32 | 33 | void *r; 34 | int res = posix_memalign(&r, align, size); 35 | assert(res == 0 && "posix_memalign failed"); 36 | (void)res; // Silence the unused variable warning 37 | return r; 38 | } 39 | 40 | // FIXME: Use Windows _aligned_free if available. 41 | inline void AlignedFree(void *p) { 42 | free(p); 43 | } 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/swift/Basic/Punycode.h: -------------------------------------------------------------------------------- 1 | //===--- Punycode.h - UTF-8 to Punycode transcoding -------------*- C++ -*-===// 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | //===----------------------------------------------------------------------===// 12 | // 13 | // These functions implement a variant of the Punycode algorithm from RFC3492, 14 | // originally designed for encoding international domain names, for the purpose 15 | // of encoding Swift identifiers into mangled symbol names. This version differs 16 | // from RFC3492 in the following respects: 17 | // - '_' is used as the encoding delimiter instead of '-'. 18 | // - Encoding digits are represented using [a-zA-J] instead of [a-z0-9], because 19 | // symbol names are case-sensitive, and Swift mangled identifiers cannot begin 20 | // with a digit. 21 | // 22 | //===----------------------------------------------------------------------===// 23 | 24 | #ifndef SWIFT_BASIC_PUNYCODE_H 25 | #define SWIFT_BASIC_PUNYCODE_H 26 | 27 | #include "LLVM.h" 28 | #include "StringRef.h" 29 | // KS: Not needed for demangling 30 | //#include "llvm/ADT/SmallVector.h" 31 | #include 32 | #include 33 | 34 | namespace swift { 35 | namespace Punycode { 36 | 37 | /// Encodes a sequence of code points into Punycode. 38 | /// 39 | /// Returns false if input contains surrogate code points. 40 | bool encodePunycode(const std::vector &InputCodePoints, 41 | std::string &OutPunycode); 42 | 43 | /// Decodes a Punycode string into a sequence of Unicode scalars. 44 | /// 45 | /// Returns false if decoding failed. 46 | bool decodePunycode(StringRef InputPunycode, 47 | std::vector &OutCodePoints); 48 | 49 | bool encodePunycodeUTF8(StringRef InputUTF8, std::string &OutPunycode); 50 | 51 | bool decodePunycodeUTF8(StringRef InputPunycode, std::string &OutUTF8); 52 | 53 | } // end namespace Punycode 54 | } // end namespace swift 55 | 56 | #endif // LLVM_SWIFT_BASIC_PUNYCODE_H 57 | 58 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/Source/KSCrash/swift/SwiftStrings.h: -------------------------------------------------------------------------------- 1 | //===--- Strings.h - Shared string constants across components --*- C++ -*-===// 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See http://swift.org/LICENSE.txt for license information 9 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #ifndef SWIFT_STRINGS_H 14 | #define SWIFT_STRINGS_H 15 | 16 | namespace swift { 17 | /// The extension for serialized modules. 18 | static const char SERIALIZED_MODULE_EXTENSION[] = "swiftmodule"; 19 | /// The extension for serialized documentation comments. 20 | static const char SERIALIZED_MODULE_DOC_EXTENSION[] = "swiftdoc"; 21 | /// The extension for SIL files. 22 | static const char SIL_EXTENSION[] = "sil"; 23 | /// The extension for SIB files. 24 | static const char SIB_EXTENSION[] = "sib"; 25 | /// The extension for LLVM IR files. 26 | static const char LLVM_BC_EXTENSION[] = "bc"; 27 | static const char LLVM_IR_EXTENSION[] = "ll"; 28 | /// The name of the standard library, which is a reserved module name. 29 | static const char STDLIB_NAME[] = "Swift"; 30 | /// The name of the SwiftShims module, which contains private stdlib decls. 31 | static const char SWIFT_SHIMS_NAME[] = "SwiftShims"; 32 | /// The prefix of module names used by LLDB to capture Swift expressions 33 | static const char LLDB_EXPRESSIONS_MODULE_NAME_PREFIX[] = "__lldb_expr_"; 34 | 35 | /// The name of the fake module used to hold imported Objective-C things. 36 | static const char MANGLING_MODULE_OBJC[] = "__ObjC"; 37 | /// The name of the fake module used to hold imported C things. 38 | static const char MANGLING_MODULE_C[] = "__C"; 39 | } // end namespace swift 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Configuration.h: -------------------------------------------------------------------------------- 1 | // 2 | // Configuration.h 3 | // CrashTester 4 | // 5 | 6 | #ifndef CrashTester_Configuration_h 7 | #define CrashTester_Configuration_h 8 | 9 | 10 | // Takanshi error reporting server. 11 | // (A Python open source project. It runs on Google App Engine) 12 | // https://github.com/kelp404/Victory 13 | // "victory-demo.appspot.com" is your server domain 14 | // "cf22ec3f-1703-476c-9a72-57d72bdebaa1" is your application key 15 | #define kVictoryURL [NSURL URLWithString:@"https://victory-demo.appspot.com/api/v1/crash/cf22ec3f-1703-476c-9a72-57d72bdebaa1"] 16 | 17 | // Hockey configuration. Please get your own app ID. This one is for internal testing! 18 | //#define kHockeyAppID @"7f74dc8aae8bf6effd35b48e32a08298" // Don't use this ID! 19 | #define kHockeyAppID @"PLEASE_GET_YOUR_OWN_APP_ID_AT_HOCKEYAPP.NET" 20 | 21 | // Quincy configuration. Reconfigure to point to your Quincy app. 22 | #define kQuincyReportURL [NSURL URLWithString:@"http://localhost:8888/quincy/crash_v200.php"] 23 | 24 | // JSON API configuration. 25 | #define kReportHost @"localhost" 26 | //#define kReportHost @"192.168.1.214" 27 | #define kReportURL [NSURL URLWithString:@"http://" kReportHost @":8000/api/crashes/"] 28 | 29 | 30 | // Set to true to write all log entries to Library/Caches/KSCrashReports/Crash-Tester/Crash-Tester-CrashLog.txt 31 | #define kRedirectConsoleLogToDefaultFile false 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/AppDelegate+UI.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate+UI.h 3 | // 4 | // Created by Karl Stenerud on 2012-03-04. 5 | // 6 | 7 | #import "AppDelegate.h" 8 | 9 | @interface AppDelegate (UI) 10 | 11 | - (UIViewController*) createRootViewController; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // 4 | // Created by Karl Stenerud on 2012-03-04. 5 | // 6 | 7 | #import 8 | #import "Crasher.h" 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (retain, nonatomic) UIWindow* window; 13 | 14 | @property (retain, nonatomic) UIViewController* viewController; 15 | 16 | @property(nonatomic, readwrite, assign) BOOL crashInHandler; 17 | 18 | @property (nonatomic, readwrite, retain) Crasher* crasher; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/CommandTVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommandTVC.h 3 | // 4 | // Created by Karl Stenerud on 2012-03-04. 5 | // 6 | 7 | #import 8 | 9 | 10 | @interface CommandEntry: NSObject 11 | 12 | @property(nonatomic,readwrite,retain) NSString* name; 13 | @property(nonatomic,readwrite,copy) void (^block)(UIViewController* controller); 14 | @property(nonatomic,readwrite,assign) UITableViewCellAccessoryType accessoryType; 15 | 16 | + (CommandEntry*) commandWithName:(NSString*) name 17 | accessoryType:(UITableViewCellAccessoryType) accessoryType 18 | block:(void(^)(UIViewController* controller)) block; 19 | 20 | - (id) initWithName:(NSString*) name 21 | accessoryType:(UITableViewCellAccessoryType) accessoryType 22 | block:(void(^)(UIViewController* controller)) block; 23 | 24 | - (void) executeWithViewController:(UIViewController*) controller; 25 | 26 | @end 27 | 28 | 29 | @interface CommandTVC : UITableViewController 30 | 31 | @property(nonatomic,readonly,retain) NSMutableArray* commands; 32 | @property(nonatomic,readwrite,copy) NSString* (^getTitleBlock)(UIViewController* controller); 33 | 34 | - (void) reloadTitle; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/Crash-Tester-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/Crash-Tester-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Crash-Tester/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CrashTester 4 | // 5 | // Created by Karl Stenerud on 2012-04-29. 6 | // 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char* argv[]) 13 | { 14 | @autoreleasepool { 15 | 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/KSCrash/KSCrash-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/KSCrash/KSCrash-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/KSCrash/KSCrash_static-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/KSCrash/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/KSCrashTests/KSCrashTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/KSCrashTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Simple-Example 4 | // 5 | 6 | #import 7 | 8 | @interface AppDelegate : UIResponder 9 | 10 | @property (strong, nonatomic) UIWindow* window; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/Simple-Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/Simple-Example-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Simple-Example 4 | // 5 | 6 | #import 7 | 8 | @interface ViewController : UIViewController 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Simple-Example 4 | // 5 | 6 | #import "ViewController.h" 7 | 8 | @implementation ViewController 9 | 10 | - (IBAction) onCrash:(__unused id) sender 11 | { 12 | char* ptr = (char*)-1; 13 | *ptr = 10; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Simple-Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Simple-Example 4 | // 5 | // Created by Karl Stenerud on 9/19/13. 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Swift-Tester/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Swift-Tester/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Swift-Tester/BridgeHeader.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Swift-Tester/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/ios/Example/KSCrash-master/iOS/Swift-Tester/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Swift-Tester 4 | // 5 | // Created by karl on 2016-01-28. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | @IBAction func onButtonPressed(sender: AnyObject) { 24 | var emptyDictionary = Dictionary() 25 | print(emptyDictionary[1]!) 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build/ 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | xcuserdata 12 | *.xccheckout 13 | *.moved-aside 14 | DerivedData 15 | *.hmap 16 | *.ipa 17 | *.xcuserstate 18 | *.log 19 | Pods 20 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Carthage/Checkouts/KSCrash"] 2 | path = Carthage/Checkouts/KSCrash 3 | url = https://github.com/kstenerud/KSCrash 4 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | matrix: 3 | include: 4 | - osx_image: xcode7.3 5 | env: SDK=macosx10.11 BUILD_OSX=1 6 | - osx_image: xcode7.3 7 | env: SDK=iphonesimulator9.3 8 | - osx_image: xcode7.2 9 | env: SDK=iphonesimulator9.2 10 | install: make bootstrap 11 | script: make test 12 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Bugsnag.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Bugsnag", 3 | "version": "5.2.1", 4 | "summary": "Cocoa notifier for SDK for bugsnag.com", 5 | "homepage": "https://bugsnag.com", 6 | "license": "MIT", 7 | "authors": { 8 | "Bugsnag": "notifiers@bugsnag.com" 9 | }, 10 | "source": { 11 | "git": "https://github.com/bugsnag/bugsnag-cocoa.git", 12 | "tag": "v5.2.1" 13 | }, 14 | "frameworks": "Foundation", 15 | "platforms": { 16 | "ios": "6.0", 17 | "osx": "10.8" 18 | }, 19 | "source_files": [ 20 | "Source/*.{m,h,mm,c,cpp}" 21 | ], 22 | "requires_arc": true, 23 | "public_header_files": [ 24 | "Source/BSGKSCrashReportWriter.h", 25 | "Source/Bugsnag{,MetaData,Configuration,Breadcrumb}.h" 26 | ], 27 | "dependencies": { 28 | "KSCrash/RecordingAdvanced": [ 29 | "~> 1.5.8" 30 | ] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | We love people filing issues and sending pull requests! 3 | 4 | How to contribute 5 | ----------------- 6 | 7 | - [Fork](https://help.github.com/articles/fork-a-repo) the [notifier on github](https://github.com/bugsnag/bugsnag-cocoa) 8 | - Commit and push until you are happy with your contribution 9 | - Test your changes 10 | - [Make a pull request](https://help.github.com/articles/using-pull-requests) 11 | - Thanks! 12 | 13 | Running the tests 14 | ----------------- 15 | 16 | Run the tests using the default SDK (iOS 9.2) by using: 17 | 18 | make test 19 | 20 | Alternately, you can specify an iOS SDK: 21 | 22 | make SDK=iphonesimulator8.1 test 23 | 24 | Or test on OS X: 25 | 26 | make BUILD_OSX=1 test 27 | 28 | If you are interested in cleaner formatting, run `make bootstrap` to install 29 | [xcpretty](https://github.com/supermarin/xcpretty) as an output formatter. 30 | 31 | 32 | Releasing a new version 33 | ----------------------- 34 | 35 | If you're a member of the core team, you can release the cocoa pod as follows: 36 | 37 | ### One time setup 38 | 39 | * Install Cocoapods 40 | 41 | ``` 42 | gem install cocoapods 43 | ``` 44 | 45 | * Register 46 | 47 | ``` 48 | pod trunk register notifiers@bugsnag.com 'Bugsnag Notifiers' --description='your name' 49 | ``` 50 | 51 | * Click the link in the email that got sent to support 52 | 53 | ### Every time 54 | 55 | * Update the CHANGELOG. Update the README.md if appropriate. 56 | * Update the version number in `VERSION`, `Source/Bugsnag/BugsnagNotifier.m`, 57 | and `Bugsnag.podspec.json` 58 | * Commit tag and push 59 | 60 | ``` 61 | git commit -am v5.x.x 62 | git tag v5.x.x 63 | git push origin master v5.x.x 64 | ``` 65 | 66 | * Update cocoapods 67 | 68 | ``` 69 | pod trunk push 70 | ``` 71 | 72 | * Build a new Zipfile to build/relase/Bugsnag-5.x.x.zip 73 | 74 | ``` 75 | make release 76 | ``` 77 | 78 | * Create a new release https://github.com/bugsnag/bugsnag-cocoa/releases/new 79 | * Select the tag you just pushed 80 | * Set the title to the tag (v5.x.x) 81 | * Copy the changelog entries into the release notes 82 | * Drag and drop the zipfile 83 | * Click "Publish Release" 84 | * Update the setup guides for Objective-C and Swift on docs.bugsnag.com with any 85 | new content 86 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Cartfile.private: -------------------------------------------------------------------------------- 1 | github "kstenerud/KSCrash" "1.6.0" 2 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "kstenerud/KSCrash" "1.6.0" 2 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Bugsnag, https://bugsnag.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(SDK),) 2 | SDK=iphonesimulator9.3 3 | endif 4 | ifeq ($(BUILD_OSX), 1) 5 | PLATFORM=OSX 6 | RELEASE_DIR=Release 7 | BUILD_FLAGS=-workspace OSX.xcworkspace -scheme Bugsnag 8 | BUILD_ONLY_FLAGS=CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 9 | else 10 | PLATFORM=iOS 11 | RELEASE_DIR=Release-iphoneos 12 | BUILD_FLAGS=-workspace iOS.xcworkspace -scheme Bugsnag 13 | BUILD_ONLY_FLAGS=-sdk $(SDK) -destination "platform=iOS Simulator,name=iPhone 5" -configuration Debug 14 | endif 15 | XCODEBUILD=set -o pipefail && xcodebuild 16 | VERSION=$(shell cat VERSION) 17 | ifneq ($(strip $(shell which xcpretty)),) 18 | FORMATTER = | tee xcodebuild.log | xcpretty 19 | endif 20 | 21 | all: build 22 | 23 | # Vendored dependency on KSCrash, pinned to the required version 24 | KSCRASH_DEP = Carthage/Checkouts/KSCrash 25 | $(KSCRASH_DEP): 26 | @git submodule update --init 27 | 28 | # Generated framework package for Bugsnag for either iOS or macOS 29 | build/Build/Products/$(RELEASE_DIR)/Bugsnag.framework: 30 | @xcodebuild $(BUILD_FLAGS) \ 31 | -configuration Release \ 32 | -derivedDataPath build clean build $(FORMATTER) 33 | 34 | # Compressed bundle for release version of Bugsnag framework 35 | build/Bugsnag-%-$(VERSION).zip: build/Build/Products/$(RELEASE_DIR)/Bugsnag.framework 36 | @cd build/Build/Products/$(RELEASE_DIR); \ 37 | zip --symlinks -rq ../../../Bugsnag-$*-$(VERSION).zip Bugsnag.framework 38 | 39 | .PHONY: all build test 40 | 41 | bootstrap: 42 | @gem install xcpretty --quiet --no-ri --no-rdoc 43 | 44 | build: $(KSCRASH_DEP) 45 | @$(XCODEBUILD) $(BUILD_FLAGS) $(BUILD_ONLY_FLAGS) build $(FORMATTER) 46 | 47 | clean: $(KSCRASH_DEP) 48 | @$(XCODEBUILD) $(BUILD_FLAGS) clean $(FORMATTER) 49 | @rm -rf build 50 | 51 | test: $(KSCRASH_DEP) 52 | @$(XCODEBUILD) $(BUILD_FLAGS) $(BUILD_ONLY_FLAGS) test $(FORMATTER) 53 | 54 | archive: build/Bugsnag-$(PLATFORM)-$(VERSION).zip 55 | 56 | release: 57 | @$(MAKE) archive 58 | @$(MAKE) BUILD_OSX=1 archive 59 | @open build 60 | @open 'https://github.com/bugsnag/bugsnag-cocoa/releases/new?tag=v'$(VERSION) 61 | 62 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Source/BugsnagCollections.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Bugsnag, Inc. All rights reserved. 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall remain in place 12 | // in this source code. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | /** 25 | * Insert an object or NSNull into a collection 26 | * 27 | * @param dict a mutable dictionary 28 | * @param object an object or nil 29 | */ 30 | void BSGDictSetSafeObject(NSMutableDictionary *dict, id object, 31 | id key); 32 | 33 | /** 34 | * Insert an object or NSNull into a collection 35 | * 36 | * @param dict a mutable array 37 | * @param object an object or nil 38 | */ 39 | void BSGArrayAddSafeObject(NSMutableArray *array, id object); 40 | 41 | /** 42 | * Insert an object into a collection only if not nil 43 | * 44 | * @param dict a mutable dictionary 45 | * @param object an object or nil 46 | * @param key the key of the object 47 | */ 48 | void BSGDictInsertIfNotNil(NSMutableDictionary *dict, id object, 49 | id key); 50 | 51 | /** 52 | * Insert an object into a collection only if not nil 53 | * 54 | * @param dict a mutable array 55 | * @param object an object or nil 56 | */ 57 | void BSGArrayInsertIfNotNil(NSMutableArray *array, id object); -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Source/BugsnagCollections.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016 Bugsnag, Inc. All rights reserved. 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall remain in place 12 | // in this source code. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "BugsnagCollections.h" 23 | 24 | void BSGDictSetSafeObject(NSMutableDictionary *dict, id object, 25 | id key) { 26 | dict[key] = object ?: [NSNull null]; 27 | } 28 | 29 | void BSGArrayAddSafeObject(NSMutableArray *array, id object) { 30 | [array addObject:object ?: [NSNull null]]; 31 | } 32 | 33 | void BSGDictInsertIfNotNil(NSMutableDictionary *dict, id object, 34 | id key) { 35 | if (object && key) { 36 | dict[key] = object; 37 | } 38 | } 39 | 40 | void BSGArrayInsertIfNotNil(NSMutableArray *array, id object) { 41 | if (object) { 42 | [array addObject:object]; 43 | } 44 | } -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Source/BugsnagCrashReport.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashReport.h 3 | // Bugsnag 4 | // 5 | // Created by Simon Maynard on 11/26/14. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface BugsnagCrashReport : NSObject 12 | 13 | @property(readonly, nonnull) NSDictionary *ksReport; 14 | 15 | - (instancetype _Nonnull)initWithKSReport:(NSDictionary *_Nonnull)report; 16 | - (NSDictionary *_Nonnull)serializableValueWithTopLevelData: 17 | (NSMutableDictionary *_Nonnull)data; 18 | 19 | - (NSString *_Nullable)releaseStage; 20 | - (NSArray *_Nullable)notifyReleaseStages; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Source/BugsnagMetaData.h: -------------------------------------------------------------------------------- 1 | // 2 | // BugsnagMetaData.h 3 | // 4 | // Created by Conrad Irwin on 2014-10-01. 5 | // 6 | // Copyright (c) 2014 Bugsnag, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | @protocol BugsnagMetaDataDelegate; 30 | 31 | @interface BugsnagMetaData : NSObject 32 | 33 | - (instancetype _Nonnull)initWithDictionary:(NSMutableDictionary *_Nonnull)dict; 34 | 35 | - (NSMutableDictionary *_Nonnull)getTab:(NSString *_Nonnull)tabName; 36 | 37 | - (void)clearTab:(NSString *_Nonnull)tabName; 38 | 39 | - (NSDictionary *_Nonnull)toDictionary; 40 | 41 | - (void)addAttribute:(NSString *_Nonnull)attributeName 42 | withValue:(id _Nullable)value 43 | toTabWithName:(NSString *_Nonnull)tabName; 44 | 45 | @property(unsafe_unretained) id _Nullable delegate; 46 | 47 | @end 48 | 49 | @protocol BugsnagMetaDataDelegate 50 | 51 | - (void)metaDataChanged:(BugsnagMetaData *_Nonnull)metaData; 52 | @end 53 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Source/BugsnagNotifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // BugsnagMetaData.m 3 | // 4 | // Created by Conrad Irwin on 2014-10-01. 5 | // 6 | // Copyright (c) 2014 Bugsnag, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | 29 | #import "BugsnagConfiguration.h" 30 | #import "BugsnagMetaData.h" 31 | 32 | @interface BugsnagNotifier : NSObject 33 | 34 | @property(nonatomic, readwrite, retain) 35 | BugsnagConfiguration *_Nullable configuration; 36 | @property(nonatomic, readwrite, retain) BugsnagMetaData *_Nonnull state; 37 | @property(nonatomic, readwrite, retain) NSDictionary *_Nonnull details; 38 | @property(nonatomic, readwrite, retain) NSLock *_Nonnull metaDataLock; 39 | 40 | - (instancetype _Nonnull)initWithConfiguration: 41 | (BugsnagConfiguration *_Nonnull)configuration; 42 | - (void)start; 43 | 44 | /** Notify bugsnag of an exception. 45 | * 46 | * @param exception The NSException 47 | * 48 | * @param metaData Any metaData to include in the report 49 | * 50 | * @param severity The severity (default BugsnagSeverityWarning) 51 | * 52 | * @param depth How many stack frames to remove from the report. 53 | */ 54 | - (void)notify:(NSException *_Nonnull)exception 55 | withData:(NSDictionary *_Nullable)metaData 56 | atSeverity:(NSString *_Nullable)severity 57 | atDepth:(NSUInteger)depth; 58 | 59 | /** 60 | * Write breadcrumbs to the cached metadata for error reports 61 | */ 62 | - (void)serializeBreadcrumbs; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Source/BugsnagSink.h: -------------------------------------------------------------------------------- 1 | // 2 | // BugsnagSink.h 3 | // 4 | // Created by Conrad Irwin on 2014-10-01. 5 | // 6 | // Copyright (c) 2014 Bugsnag, Inc. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall remain in place 16 | // in this source code. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | 27 | #import 28 | #import 29 | 30 | @interface BugsnagSink : NSObject 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/Tests/BugsnagCrashReportTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BugsnagCrashReportTests.m 3 | // Bugsnag 4 | // 5 | // Created by Simon Maynard on 12/1/14. 6 | // 7 | // 8 | 9 | #import "BugsnagCrashReport.h" 10 | #import 11 | #import 12 | 13 | @interface BugsnagCrashReportTests : XCTestCase 14 | @property BugsnagCrashReport *report; 15 | @end 16 | 17 | @implementation BugsnagCrashReportTests 18 | 19 | - (void)setUp { 20 | [super setUp]; 21 | NSBundle *bundle = [NSBundle bundleForClass:[self class]]; 22 | NSString *path = [bundle pathForResource:@"report" ofType:@"json"]; 23 | NSString *contents = [NSString stringWithContentsOfFile:path 24 | encoding:NSUTF8StringEncoding 25 | error:nil]; 26 | NSDictionary *dictionary = [NSJSONSerialization 27 | JSONObjectWithData:[contents dataUsingEncoding:NSUTF8StringEncoding] 28 | options:0 29 | error:nil]; 30 | self.report = [[BugsnagCrashReport alloc] initWithKSReport:dictionary]; 31 | } 32 | 33 | - (void)tearDown { 34 | [super tearDown]; 35 | self.report = nil; 36 | } 37 | 38 | - (void)testReleaseStage { 39 | XCTAssertEqualObjects(self.report.releaseStage, @"production"); 40 | } 41 | 42 | - (void)testNotifyReleaseStages { 43 | XCTAssertEqualObjects(self.report.notifyReleaseStages, 44 | (@[ @"production", @"development" ])); 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/VERSION: -------------------------------------------------------------------------------- 1 | 5.2.1 2 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/iOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/iOS.xcworkspace/xcshareddata/iOS.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "C4519EFDD2C3B96E9BD67A5CED575450FFB87C90", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "D2885296440547CB23891301E79B480A22EAC5F6" : 0, 8 | "C4519EFDD2C3B96E9BD67A5CED575450FFB87C90" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "103C8171-87E2-4033-A0B3-0E14C4C49F02", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "D2885296440547CB23891301E79B480A22EAC5F6" : "bugsnag-cocoa-r\/Carthage\/Checkouts\/KSCrash\/", 13 | "C4519EFDD2C3B96E9BD67A5CED575450FFB87C90" : "bugsnag-cocoa-r\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "iOS", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "iOS.xcworkspace", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:bugsnag\/bugsnag-cocoa", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C4519EFDD2C3B96E9BD67A5CED575450FFB87C90" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/kstenerud\/KSCrash", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D2885296440547CB23891301E79B480A22EAC5F6" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/iOS/TestsInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/ios/Example/bugsnag-cocoa-5.2.1/iOS/module.modulemap: -------------------------------------------------------------------------------- 1 | module Bugsnag { 2 | umbrella header "Bugsnag.h" 3 | 4 | header "BugsnagConfiguration.h" 5 | header "BugsnagMetaData.h" 6 | header "BugsnagBreadcrumb.h" 7 | 8 | export * 9 | module * { export * } 10 | } -------------------------------------------------------------------------------- /Example/ios/Example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/ios/ExampleTests/ExampleTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface ExampleTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation ExampleTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/ios/ExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'Example' do 5 | # Uncomment this line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | 8 | # Pods for Example 9 | pod 'Bugsnag' 10 | 11 | end 12 | -------------------------------------------------------------------------------- /Example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "setupIOS": "sh autoSetup.sh" 8 | }, 9 | "dependencies": { 10 | "react": "15.3.2", 11 | "react-native": "0.33.0", 12 | "react-native-bugsnag": "file:../", 13 | "undefined": "^0.1.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Cory Smith 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | } 17 | } 18 | } 19 | 20 | dependencies { 21 | compile 'com.facebook.react:react-native:+' 22 | compile 'com.bugsnag:bugsnag-android:3.4.0' 23 | } 24 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/com/pintersudoplz/rnbugsnag/RNBugsnagPackage.java: -------------------------------------------------------------------------------- 1 | package com.pintersudoplz.rnbugsnag; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.JavaScriptModule; 5 | import com.facebook.react.bridge.NativeModule; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.uimanager.ViewManager; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | public class RNBugsnagPackage implements ReactPackage { 14 | /** 15 | * @param reactContext react application context that can be used to create modules 16 | * @return list of native modules to register with the newly created catalyst instance 17 | */ 18 | @Override 19 | public List createNativeModules(ReactApplicationContext reactContext) { 20 | List modules = new ArrayList<>(); 21 | modules.add(new RNBugsnagModule(reactContext)); 22 | 23 | return modules; 24 | } 25 | 26 | /** 27 | * @return list of JS modules to register with the newly created catalyst instance. 28 | *

29 | * IMPORTANT: Note that only modules that needs to be accessible from the native code should be 30 | * listed here. Also listing a native module here doesn't imply that the JS implementation of it 31 | * will be automatically included in the JS bundle. 32 | */ 33 | @Override 34 | public List> createJSModules() { 35 | return Collections.emptyList(); 36 | } 37 | 38 | /** 39 | * @param reactContext 40 | * @return a list of view managers that should be registered with {@link UIManagerModule} 41 | */ 42 | @Override 43 | public List createViewManagers(ReactApplicationContext reactContext) { 44 | return Collections.emptyList(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | import RNBugsnag from './lib/RNBugsnag'; 3 | module.exports = (initData)=>new RNBugsnag(initData) -------------------------------------------------------------------------------- /ios/RNBugsnag/RNBugsnag.h: -------------------------------------------------------------------------------- 1 | #import "RCTBridgeModule.h" 2 | 3 | @interface RNBugsnag : NSObject 4 | @property BOOL suppressDev; 5 | + (RNBugsnag*)init; 6 | - (void)notifyWithTitle: (NSString *)exceptionTitle 7 | andReason:(NSString *)exceptionReason 8 | withSeverity:(NSString *)severity 9 | andOtherData:(NSDictionary *) otherData; 10 | @end 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-bugsnag", 3 | "version": "1.0.2", 4 | "description": "Community-created Bugsnag package for React Native. It consumes the Bugsnag API to report errors from both the React Native (Javascript) environment AND the native (Obj-C or Java) environment.", 5 | "nativePackage": true, 6 | "homepage": "https://github.com/joshuapinter/react-native-bugsnag", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/joshuapinter/react-native-bugsnag.git" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/joshuapinter/react-native-bugsnag/issues" 13 | }, 14 | "rnpm": { 15 | "android": { 16 | "packageInstance": "new RNBugsnagPackage()" 17 | }, 18 | "ios": { 19 | "project": "ios/RNBugsnag.xcodeproj" 20 | } 21 | }, 22 | "license": "MIT", 23 | "keywords": [ 24 | "android", 25 | "bugsnag", 26 | "errors", 27 | "exceptions", 28 | "ios", 29 | "macos", 30 | "mobile", 31 | "osx", 32 | "react", 33 | "react-bugsnag", 34 | "react-component", 35 | "react-native", 36 | "react-native-bugsnag", 37 | "react-native-component", 38 | "rnbugsnag" 39 | ], 40 | "contributors": [ 41 | "Ioannis Kokkinidis (http://linkedin.com/in/sudoplz/)", 42 | "Joshua Pinter (http://about.me/joshuapinter)" 43 | ], 44 | "main": "index.js", 45 | "scripts": { 46 | "test": "echo \"Error: no test specified\" && exit 1" 47 | }, 48 | "dependencies": { 49 | }, 50 | "devDependencies": { 51 | } 52 | } 53 | --------------------------------------------------------------------------------