├── Android ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── dimens.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── xml │ │ │ │ │ └── provider_paths.xml │ │ │ │ ├── values-w820dp │ │ │ │ │ └── dimens.xml │ │ │ │ └── layout │ │ │ │ │ └── activity_main.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── stenerud │ │ │ │ └── kscrash │ │ │ │ ├── KSCrashReportFilteringFailedException.java │ │ │ │ └── KSCrashReportFilterDeleteFiles.java │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── stenerud │ │ │ │ └── kscrash │ │ │ │ └── ExampleInstrumentedTest.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── stenerud │ │ │ └── kscrash │ │ │ └── KSCrashReportFilterJSONEncodeTest.java │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── .idea │ ├── copyright │ │ └── profiles_settings.xml │ ├── modules.xml │ ├── runConfigurations.xml │ ├── gradle.xml │ └── compiler.xml ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradle.properties └── Source │ ├── KSJNI.cpp │ ├── KSJNI.h │ ├── monitors │ └── KSCrashMonitor_System.h │ ├── tools │ ├── KSThread.c │ ├── KSMemory.c │ ├── KSMachineContext_Android.h │ └── KSDynamicLinker.c │ └── KSCrashCachedData.c ├── Webapp ├── .gitignore ├── clean.sh ├── run_internal.sh ├── run_external.sh ├── module_locator.py ├── README.md └── listener.py ├── Source ├── KSCrash │ ├── swift │ │ └── Basic │ │ │ ├── ValueWitnessMangling.def │ │ │ ├── Platform.h │ │ │ ├── Fallthrough.h │ │ │ └── Malloc.h │ ├── Recording │ │ ├── KSCrashDoctor.h │ │ ├── KSCrashReportVersion.h │ │ ├── Tools │ │ │ ├── KSDemangle_CPP.cpp │ │ │ ├── KSID.h │ │ │ ├── KSCxaThrowSwapper.h │ │ │ ├── KSDebug.h │ │ │ ├── KSDemangle_Swift.cpp │ │ │ ├── KSDemangle_CPP.h │ │ │ ├── KSDemangle_Swift.h │ │ │ ├── KSgetsect.h │ │ │ ├── KSStackCursor_SelfThread.h │ │ │ ├── KSPlatformSpecificDefines.h │ │ │ ├── KSStackCursor_MachineContext.h │ │ │ ├── KSSymbolicator.h │ │ │ └── KSStackCursor_SelfThread.c │ │ ├── Monitors │ │ │ ├── KSCrashMonitor_System.h │ │ │ ├── KSCrashMonitor_Signal.h │ │ │ ├── KSCrashMonitor_CPPException.h │ │ │ ├── KSCrashMonitor_NSException.h │ │ │ ├── KSCrashMonitor_MachException.h │ │ │ └── KSCrashMonitor_Deadlock.h │ │ ├── KSCrashCachedData.h │ │ └── KSCrashReportFixer.h │ ├── llvm │ │ └── ADT │ │ │ └── None.h │ ├── Reporting │ │ ├── Tools │ │ │ ├── NSString+URLEncode.h │ │ │ ├── NSString+URLEncode.m │ │ │ └── NSMutableData+AppendUTF8.h │ │ ├── Filters │ │ │ ├── KSCrashReportFilterStringify.h │ │ │ ├── KSCrashReportFilterSets.h │ │ │ └── KSCrashReportFilterGZip.h │ │ └── Sinks │ │ │ ├── KSCrashReportSinkConsole.h │ │ │ └── KSCrashReportSinkStandard.h │ └── Installations │ │ ├── KSCrashInstallationStandard.h │ │ └── KSCrashInstallationConsole.h ├── Framework │ ├── module.modulemap │ └── KSCrashFramework.h ├── KSCrash-Tests │ ├── KSCrashTests-Info.plist │ ├── TestThread.h │ ├── KSDebug_Tests.m │ ├── XCTestCase+KSCrash.h │ ├── FileBasedTestCase.h │ ├── TestThread.m │ ├── KSCrashMonitor_Tests.m │ └── KSCrashReportFixer_Tests.m └── Common-Examples │ ├── Crasher.h │ ├── CrashTesterCommands.h │ └── LoadableCategory.h ├── Mac ├── KSCrash │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── KSCrash-Prefix.pch │ ├── KSCrash-Info.plist │ └── PrivacyInfo.xcprivacy ├── Crash-Tester │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── Credits.rtf │ ├── Crash-Tester-Prefix.pch │ ├── main.m │ ├── AppDelegate.h │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ └── Crash-Tester-Info.plist ├── KSCrashTests │ ├── en.lproj │ │ └── InfoPlist.strings │ └── KSCrashTests-Info.plist ├── Simple-Example │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── Credits.rtf │ ├── Simple-Example-Prefix.pch │ ├── main.m │ ├── AppDelegate.h │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ └── Simple-Example-Info.plist ├── KSCrash-Mac.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── KSCrashLib │ └── KSCrashLib-Prefix.pch ├── Example-Apps-Mac.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── Configuration.h ├── iOS ├── KSCrash │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── KSCrash-Prefix.pch │ ├── KSCrash-Info.plist │ └── KSCrash_static-Info.plist ├── Crash-Tester │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── AppDelegate+UI.h │ ├── main.m │ ├── Crash-Tester-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── CommandTVC.h │ └── Crash-Tester-Info.plist ├── KSCrashTests │ ├── en.lproj │ │ └── InfoPlist.strings │ └── KSCrashTests-Info.plist ├── Simple-Example │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── ViewController.h │ ├── AppDelegate.h │ ├── ViewController.m │ ├── main.m │ ├── Simple-Example-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ └── Simple-Example-Info.plist ├── Advanced-Example │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── LoaderVC.h │ ├── MainVC.h │ ├── AppDelegate.h │ ├── main.m │ ├── Advanced-Example-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── Advanced-Example-Info.plist │ └── LoaderVC.m ├── Swift-Tester │ ├── BridgeHeader.h │ ├── ViewController.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── Base.lproj │ │ └── LaunchScreen.storyboard ├── KSCrash-iOS.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Example-Apps-iOS.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── CrashLib │ └── CrashLib │ │ ├── CrashLib.h │ │ └── Info.plist └── Configuration.h ├── .gitmodules ├── TVOS ├── SimpleExample │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── App Icon & Top Shelf Image.brandassets │ │ │ ├── App Icon - Large.imagestack │ │ │ │ ├── Back.imagestacklayer │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Content.imageset │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Front.imagestacklayer │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Content.imageset │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Middle.imagestacklayer │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Content.imageset │ │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── App Icon - Small.imagestack │ │ │ │ ├── Back.imagestacklayer │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Content.imageset │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Front.imagestacklayer │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Content.imageset │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── Middle.imagestacklayer │ │ │ │ │ ├── Contents.json │ │ │ │ │ └── Content.imageset │ │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Top Shelf Image.imageset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.m │ ├── Info.plist │ └── AppDelegate.m ├── KSCrashTests │ └── Info.plist └── KSCrash │ ├── Info.plist │ └── PrivacyInfo.xcprivacy ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── WatchOS ├── KSCrash.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── CrashExample │ ├── CrashExample │ │ ├── ViewController.h │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── ViewController.m │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ ├── CrashExample WatchKit Extension │ │ ├── ExtensionDelegate.h │ │ ├── InterfaceController.h │ │ ├── Assets.xcassets │ │ │ └── Complication.complicationset │ │ │ │ ├── Modular.imageset │ │ │ │ └── Contents.json │ │ │ │ ├── Circular.imageset │ │ │ │ └── Contents.json │ │ │ │ ├── Utilitarian.imageset │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ ├── InterfaceController.m │ │ └── Info.plist │ └── CrashExample WatchKit App │ │ ├── Info.plist │ │ ├── Base.lproj │ │ └── Interface.storyboard │ │ └── Assets.xcassets │ │ └── AppIcon.appiconset │ │ └── Contents.json └── KSCrash │ ├── Info.plist │ └── PrivacyInfo.xcprivacy ├── Mac.xcworkspace ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── contents.xcworkspacedata ├── iOS.xcworkspace ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── contents.xcworkspacedata ├── TVOS.xcworkspace ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── contents.xcworkspacedata ├── WatchOS.xcworkspace ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── contents.xcworkspacedata ├── .travis.yml ├── .gitignore ├── Makefile ├── PrivacyInfo.xcprivacy └── LICENSE /Android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Webapp/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | posts 3 | -------------------------------------------------------------------------------- /Android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /Source/KSCrash/swift/Basic/ValueWitnessMangling.def: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Webapp/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -rf posts 4 | rm *.pyc 5 | -------------------------------------------------------------------------------- /Mac/KSCrash/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS/KSCrash/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Mac/Crash-Tester/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Mac/KSCrashTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Mac/Simple-Example/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS/Crash-Tester/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS/KSCrashTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS/Simple-Example/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS/Swift-Tester/BridgeHeader.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /Webapp/run_internal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export FLASK_APP=listener.py 4 | export FLASK_DEBUG=1 5 | 6 | flask run 7 | -------------------------------------------------------------------------------- /Android/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | KSCrash 3 | 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Source/CrashProbe"] 2 | path = Source/CrashProbe 3 | url = https://github.com/bitstadium/CrashProbe.git 4 | -------------------------------------------------------------------------------- /Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoho/KSCrash/master/Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Webapp/run_external.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export FLASK_APP=listener.py 4 | export FLASK_DEBUG=1 5 | 6 | flask run --host=0.0.0.0 7 | -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoho/KSCrash/master/Android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoho/KSCrash/master/Android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoho/KSCrash/master/Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoho/KSCrash/master/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Source/Framework/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module KSCrash { 2 | umbrella header "KSCrashFramework.h" 3 | 4 | export * 5 | module * { export * } 6 | } -------------------------------------------------------------------------------- /Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoho/KSCrash/master/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/LoaderVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoaderVC.h 3 | // Advanced-Example 4 | // 5 | 6 | #import 7 | 8 | @interface LoaderVC : UIViewController 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/MainVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainVC.h 3 | // Advanced-Example 4 | // 5 | 6 | #import 7 | 8 | @interface MainVC : UITableViewController 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Android/app/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Mac/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 | -------------------------------------------------------------------------------- /WatchOS/KSCrash.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Mac/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 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Mac/KSCrash-Mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Mac/KSCrashLib/KSCrashLib-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 | -------------------------------------------------------------------------------- /iOS/KSCrash-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Mac/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 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /Mac/Example-Apps-Mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS/Example-Apps-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 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.14.1-all.zip 7 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Mac.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /iOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TVOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WatchOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SimpleExample 4 | // 5 | // Created by karl on 2016-04-08. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Mac.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /iOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Mac/Crash-Tester/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Crash-Tester 4 | // 5 | // Created by Karl Stenerud on 9/27/13. 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) 12 | { 13 | return NSApplicationMain(argc, argv); 14 | } 15 | -------------------------------------------------------------------------------- /TVOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Mac/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 | int main(int argc, const char * argv[]) 12 | { 13 | return NSApplicationMain(argc, argv); 14 | } 15 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "tv", 5 | "scale" : "1x" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CrashExample 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Mac/KSCrash-Mac.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WatchOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /iOS/KSCrash-iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "landscape", 5 | "idiom" : "tv", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "9.0", 8 | "scale" : "1x" 9 | } 10 | ], 11 | "info" : { 12 | "version" : 1, 13 | "author" : "xcode" 14 | } 15 | } -------------------------------------------------------------------------------- /Mac/Simple-Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 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 | @interface AppDelegate : NSObject 12 | 13 | @property (assign) IBOutlet NSWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode8 3 | script: 4 | - make test 5 | - make lint 6 | matrix: 7 | include: 8 | - env: SCHEME=KSCrash WORKSPACE=Mac.xcworkspace SDK=macosx10.12 9 | - env: SCHEME=KSCrashLib WORKSPACE=iOS.xcworkspace SDK=iphonesimulator 10 | - env: SCHEME=KSCrash-TVOS WORKSPACE=TVOS.xcworkspace SDK=appletvsimulator 11 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Advanced-Example 4 | // 5 | 6 | #import 7 | 8 | @class KSCrashInstallation; 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (strong, nonatomic) UIWindow* window; 13 | @property (strong, nonatomic) KSCrashInstallation* crashInstallation; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SimpleExample 4 | // 5 | // Created by karl on 2016-04-08. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/ExtensionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDelegate.h 3 | // CrashExample WatchKit Extension 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExtensionDelegate : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CrashExample 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /.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 | *.xcscmblueprint 24 | Carthage/Build 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/InterfaceController.h: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.h 3 | // CrashExample WatchKit Extension 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface InterfaceController : WKInterfaceController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SimpleExample 4 | // 5 | // Created by karl on 2016-04-08. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "layers" : [ 3 | { 4 | "filename" : "Front.imagestacklayer" 5 | }, 6 | { 7 | "filename" : "Middle.imagestacklayer" 8 | }, 9 | { 10 | "filename" : "Back.imagestacklayer" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "layers" : [ 3 | { 4 | "filename" : "Front.imagestacklayer" 5 | }, 6 | { 7 | "filename" : "Middle.imagestacklayer" 8 | }, 9 | { 10 | "filename" : "Back.imagestacklayer" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CrashExample 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Advanced-Example 4 | // 5 | // Created by Karl Stenerud on 9/27/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/Advanced-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Mac/Crash-Tester/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Crash-Tester 4 | // 5 | // Created by Karl Stenerud on 9/27/13. 6 | // Copyright (c) 2013 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | @property (nonatomic, assign) IBOutlet NSWindow* window; 14 | 15 | @property (nonatomic, weak) IBOutlet NSTextFieldCell* reportCountLabel; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "screenWidth" : "{130,145}", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "screenWidth" : "{146,165}", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /TVOS/SimpleExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SimpleExample 4 | // 5 | // Created by karl on 2016-04-08. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (IBAction)onCrash:(id)sender 18 | { 19 | [NSException raise:@"CrashException" format:@"It dun crashed!"]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /iOS/Advanced-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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Webapp/module_locator.py: -------------------------------------------------------------------------------- 1 | # from http://stackoverflow.com/questions/2632199/how-do-i-get-the-path-of-the-current-executed-file-in-python 2 | 3 | import os 4 | import sys 5 | 6 | def we_are_frozen(): 7 | # All of the modules are built-in to the interpreter, e.g., by py2exe 8 | return hasattr(sys, "frozen") 9 | 10 | def module_path(): 11 | encoding = sys.getfilesystemencoding() 12 | if we_are_frozen(): 13 | return os.path.dirname(unicode(sys.executable, encoding)) 14 | return os.path.dirname(unicode(__file__, encoding)) 15 | -------------------------------------------------------------------------------- /Mac/Crash-Tester/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /Mac/Simple-Example/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "idiom" : "watch", 5 | "filename" : "Circular.imageset", 6 | "role" : "circular" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "filename" : "Modular.imageset", 11 | "role" : "modular" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "filename" : "Utilitarian.imageset", 16 | "role" : "utilitarian" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /iOS/CrashLib/CrashLib/CrashLib.h: -------------------------------------------------------------------------------- 1 | // 2 | // CrashLib.h 3 | // CrashLib 4 | // 5 | // Created by Karl Stenerud on 2017-01-25. 6 | // Copyright © 2017 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for CrashLib. 12 | FOUNDATION_EXPORT double CrashLibVersionNumber; 13 | 14 | //! Project version string for CrashLib. 15 | FOUNDATION_EXPORT const unsigned char CrashLibVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /iOS/Advanced-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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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.2.3' 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 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | WORKSPACE:=iOS.xcworkspace 2 | SCHEME:=KSCrashLib 3 | SDK:=iphonesimulator 4 | BUILD_ARGS=-workspace $(WORKSPACE) -scheme $(SCHEME) -sdk $(SDK) 5 | 6 | all: build 7 | 8 | .PHONY: build lint test 9 | 10 | build: ## Build the selected target. Default is iOS. 11 | xcodebuild $(BUILD_ARGS) build 12 | 13 | lint: ## Lint the podspec 14 | pod lib lint 15 | 16 | test: ## Test the selected target 17 | xcodebuild $(BUILD_ARGS) test 18 | 19 | help: ## Show help text 20 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 21 | -------------------------------------------------------------------------------- /Android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CrashExample 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "size" : "1280x768", 5 | "idiom" : "tv", 6 | "filename" : "App Icon - Large.imagestack", 7 | "role" : "primary-app-icon" 8 | }, 9 | { 10 | "size" : "400x240", 11 | "idiom" : "tv", 12 | "filename" : "App Icon - Small.imagestack", 13 | "role" : "primary-app-icon" 14 | }, 15 | { 16 | "size" : "1920x720", 17 | "idiom" : "tv", 18 | "filename" : "Top Shelf Image.imageset", 19 | "role" : "top-shelf-image" 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /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 /Users/karl/Library/Android/sdk/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 | -------------------------------------------------------------------------------- /Android/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Mac/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /TVOS/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 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /iOS/CrashLib/CrashLib/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 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Android/app/src/androidTest/java/org/stenerud/kscrash/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package org.stenerud.kscrash; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("org.stenerud.kscrash", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TVOS/KSCrash/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 | -------------------------------------------------------------------------------- /WatchOS/KSCrash/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/InterfaceController.m: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.m 3 | // CrashExample WatchKit Extension 4 | // 5 | // Created by Karl on 2016-10-18. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import "InterfaceController.h" 10 | 11 | 12 | @interface InterfaceController() 13 | 14 | @end 15 | 16 | 17 | @implementation InterfaceController 18 | 19 | - (void)awakeWithContext:(id)context { 20 | [super awakeWithContext:context]; 21 | 22 | // Configure interface objects here. 23 | } 24 | 25 | - (void)willActivate { 26 | // This method is called when watch view controller is about to be visible to user 27 | [super willActivate]; 28 | } 29 | 30 | - (void)didDeactivate { 31 | // This method is called when watch view controller is no longer visible 32 | [super didDeactivate]; 33 | } 34 | 35 | - (IBAction)onCrash:(id)sender { 36 | [NSException raise:@"TestException" format:@"Testing"]; 37 | } 38 | 39 | @end 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/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 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | arm64 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TVOS/SimpleExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SimpleExample 4 | // 5 | // Created by karl on 2016-04-08. 6 | // Copyright © 2016 Karl Stenerud. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | KSCrashInstallationConsole* installation = [KSCrashInstallationConsole new]; 21 | installation.printAppleFormat = NO; 22 | [installation install]; 23 | 24 | [installation sendAllReportsWithCompletion:^(NSArray* reports, BOOL completed, NSError* error) 25 | { 26 | if(completed) 27 | { 28 | NSLog(@"Sent %d reports", (int)[reports count]); 29 | } 30 | else 31 | { 32 | NSLog(@"Failed to send reports: %@", error); 33 | } 34 | }]; 35 | 36 | return YES; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Mac/KSCrash/KSCrash-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSHumanReadableCopyright 26 | Copyright © 2013 Karl Stenerud. All rights reserved. 27 | NSPrincipalClass 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | 1C8F.1 13 | 14 | 15 | 16 | NSPrivacyCollectedDataTypes 17 | 18 | 19 | NSPrivacyCollectedDataType 20 | NSPrivacyCollectedDataTypeCrashData 21 | NSPrivacyCollectedDataTypeLinked 22 | 23 | NSPrivacyCollectedDataTypeTracking 24 | 25 | NSPrivacyCollectedDataTypePurposes 26 | 27 | NSPrivacyCollectedDataTypePurposeAppFunctionality 28 | 29 | 30 | 31 | NSPrivacyTracking 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Android/app/src/test/java/org/stenerud/kscrash/KSCrashReportFilterJSONEncodeTest.java: -------------------------------------------------------------------------------- 1 | package org.stenerud.kscrash; 2 | 3 | import org.json.JSONObject; 4 | import org.junit.Test; 5 | 6 | import java.util.HashMap; 7 | import java.util.LinkedList; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | /** 14 | * Created by karl on 2017-01-12. 15 | */ 16 | 17 | public class KSCrashReportFilterJSONEncodeTest { 18 | @Test 19 | public void test_encode_dictionary() throws Exception { 20 | final String expected = "{}"; 21 | Map dictionary = new HashMap(); 22 | List reports = new LinkedList(); 23 | reports.add(new JSONObject(dictionary)); 24 | KSCrashReportFilter filter = new KSCrashReportFilterJSONEncode(); 25 | filter.filterReports(reports, new KSCrashReportFilter.CompletionCallback() { 26 | @Override 27 | public void onCompletion(List reports) throws KSCrashReportFilteringFailedException { 28 | assertEquals(expected, reports.get(0)); 29 | } 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Webapp/README.md: -------------------------------------------------------------------------------- 1 | Simple Backend 2 | ============== 3 | 4 | A very basic Flask webapp for receiving a report from a KSCrash standard installation. 5 | 6 | It will store each request in its on directory under the "posts" subdir. 7 | 8 | 9 | Requirements 10 | ------------ 11 | 12 | - Python 13 | - Flask (pip install flask) 14 | 15 | 16 | Usage 17 | ----- 18 | 19 | - run_internal.sh: Run in internal mode (only allow connections from the local machine) 20 | - run_external.sh: Run in external mode (allow connections from anywhere) 21 | - clean.sh: Delete all .pyc files and the posts directory. 22 | 23 | 24 | ### KSCrash Installation URL 25 | 26 | The webapp listens on port 5000, and the post method resides at /crashreport 27 | 28 | The URL you can use depends on your device and setup. 29 | 30 | If you're using the simulator or Android emulator, you can connect to your local machine. The URLs are as follows: 31 | 32 | - On iPhone Simulator, the URL is http://localhost:5000/crashreport 33 | - On Android emulator, the URL is http://10.0.2.2:5000/crashreport 34 | 35 | For all other setups, you must connect over a network in the usual way (e.g. example.com:5000/crashreport) 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Karl Stenerud 2 | 3 | Licencing: MIT (https://opensource.org/licenses/MIT) 4 | 5 | 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: 6 | 7 | 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). 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Mac/Crash-Tester/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Mac/Simple-Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /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 @":5000/crashreport"] 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | CrashExample WatchKit App 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 | CFBundleVersion 22 | 1 23 | UISupportedInterfaceOrientations 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | 28 | WKCompanionAppBundleIdentifier 29 | org.stenerud.testkscrash.CrashExample 30 | WKWatchKitApp 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Mac/Crash-Tester/Crash-Tester-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 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 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2013 Karl Stenerud. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Mac/Simple-Example/Simple-Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 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 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2013 Karl Stenerud. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "org.stenerud.kscrash" 8 | minSdkVersion 15 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | externalNativeBuild { 14 | cmake { 15 | cppFlags "-fexceptions" 16 | } 17 | } 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | externalNativeBuild { 26 | cmake { 27 | path "CMakeLists.txt" 28 | } 29 | } 30 | } 31 | 32 | dependencies { 33 | compile fileTree(dir: 'libs', include: ['*.jar']) 34 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 35 | exclude group: 'com.android.support', module: 'support-annotations' 36 | }) 37 | compile 'com.android.support:appcompat-v7:25.1.0' 38 | testCompile 'junit:junit:4.12' 39 | testCompile 'org.json:json:20140107' 40 | } 41 | -------------------------------------------------------------------------------- /Mac/KSCrash/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | 1C8F.1 13 | 14 | 15 | 16 | NSPrivacyCollectedDataTypes 17 | 18 | 19 | NSPrivacyCollectedDataType 20 | NSPrivacyCollectedDataTypeCrashData 21 | NSPrivacyCollectedDataTypeLinked 22 | 23 | NSPrivacyCollectedDataTypeTracking 24 | 25 | NSPrivacyCollectedDataTypePurposes 26 | 27 | NSPrivacyCollectedDataTypePurposeAppFunctionality 28 | 29 | 30 | 31 | NSPrivacyTracking 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /TVOS/KSCrash/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | 1C8F.1 13 | 14 | 15 | 16 | NSPrivacyCollectedDataTypes 17 | 18 | 19 | NSPrivacyCollectedDataType 20 | NSPrivacyCollectedDataTypeCrashData 21 | NSPrivacyCollectedDataTypeLinked 22 | 23 | NSPrivacyCollectedDataTypeTracking 24 | 25 | NSPrivacyCollectedDataTypePurposes 26 | 27 | NSPrivacyCollectedDataTypePurposeAppFunctionality 28 | 29 | 30 | 31 | NSPrivacyTracking 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /WatchOS/KSCrash/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | 1C8F.1 13 | 14 | 15 | 16 | NSPrivacyCollectedDataTypes 17 | 18 | 19 | NSPrivacyCollectedDataType 20 | NSPrivacyCollectedDataTypeCrashData 21 | NSPrivacyCollectedDataTypeLinked 22 | 23 | NSPrivacyCollectedDataTypeTracking 24 | 25 | NSPrivacyCollectedDataTypePurposes 26 | 27 | NSPrivacyCollectedDataTypePurposeAppFunctionality 28 | 29 | 30 | 31 | NSPrivacyTracking 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit Extension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | CrashExample WatchKit Extension 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionAttributes 26 | 27 | WKAppBundleIdentifier 28 | org.stenerud.testkscrash.CrashExample.watchkitapp 29 | 30 | NSExtensionPointIdentifier 31 | com.apple.watchkit 32 | 33 | WKExtensionDelegateClassName 34 | ExtensionDelegate 35 | 36 | 37 | -------------------------------------------------------------------------------- /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 "KSCrashC.h" 15 | #import "KSCrashInstallation.h" 16 | #import "KSCrashInstallation+Alert.h" 17 | #import "KSCrashInstallation+Private.h" 18 | #import "KSCrashInstallationConsole.h" 19 | #import "KSCrashInstallationEmail.h" 20 | #import "KSCrashInstallationStandard.h" 21 | #import "KSCrashInstallationVictory.h" 22 | #import "KSCrashMonitorContext.h" 23 | #import "KSCrashMonitor_System.h" 24 | #import "KSCrashReportFilter.h" 25 | #import "KSCrashReportFilterAlert.h" 26 | #import "KSCrashReportFilterAppleFmt.h" 27 | #import "KSCrashReportFilterBasic.h" 28 | #import "KSCrashReportFilterGZip.h" 29 | #import "KSCrashReportFilterJSON.h" 30 | #import "KSCrashReportFilterSets.h" 31 | #import "KSCrashReportFilterStringify.h" 32 | #import "KSCrashReportSinkConsole.h" 33 | #import "KSCrashReportSinkEMail.h" 34 | #import "KSCrashReportSinkStandard.h" 35 | #import "KSCrashReportSinkVictory.h" 36 | #import "KSCrashReportWriter.h" 37 | #import "KSJSONCodecObjC.h" 38 | #import "NSData+KSGZip.h" 39 | 40 | #endif /* KSCrashFramework_h */ 41 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit App/Base.lproj/Interface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "24x24", 5 | "idiom" : "watch", 6 | "scale" : "2x", 7 | "role" : "notificationCenter", 8 | "subtype" : "38mm" 9 | }, 10 | { 11 | "size" : "27.5x27.5", 12 | "idiom" : "watch", 13 | "scale" : "2x", 14 | "role" : "notificationCenter", 15 | "subtype" : "42mm" 16 | }, 17 | { 18 | "size" : "29x29", 19 | "idiom" : "watch", 20 | "role" : "companionSettings", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "size" : "29x29", 25 | "idiom" : "watch", 26 | "role" : "companionSettings", 27 | "scale" : "3x" 28 | }, 29 | { 30 | "size" : "40x40", 31 | "idiom" : "watch", 32 | "scale" : "2x", 33 | "role" : "appLauncher", 34 | "subtype" : "38mm" 35 | }, 36 | { 37 | "size" : "86x86", 38 | "idiom" : "watch", 39 | "scale" : "2x", 40 | "role" : "quickLook", 41 | "subtype" : "38mm" 42 | }, 43 | { 44 | "size" : "98x98", 45 | "idiom" : "watch", 46 | "scale" : "2x", 47 | "role" : "quickLook", 48 | "subtype" : "42mm" 49 | } 50 | ], 51 | "info" : { 52 | "version" : 1, 53 | "author" : "xcode" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Mac/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/Advanced-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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/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 | } -------------------------------------------------------------------------------- /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 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Android/Source/KSJNI.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KSJNI.c 3 | // 4 | // Copyright (c) 2016 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 "KSJNI.h" 27 | 28 | static JNIEnv* g_jniEnv; 29 | 30 | 31 | extern "C" void ksjni_init(JNIEnv* jniEnv) 32 | { 33 | g_jniEnv = jniEnv; 34 | } 35 | 36 | extern "C" JNIEnv* ksjni_getEnv() 37 | { 38 | return g_jniEnv; 39 | } 40 | -------------------------------------------------------------------------------- /Source/KSCrash/swift/Basic/Platform.h: -------------------------------------------------------------------------------- 1 | //===-- SwiftDemangle/Platform.h - SwiftDemangle Platform Decls -*- C++ -*-===// 2 | // 3 | // This source file is part of the Swift.org open source project 4 | // 5 | // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 6 | // Licensed under Apache License v2.0 with Runtime Library Exception 7 | // 8 | // See https://swift.org/LICENSE.txt for license information 9 | // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors 10 | // 11 | //===----------------------------------------------------------------------===// 12 | 13 | #ifndef SWIFT_DEMANGLE_PLATFORM_H 14 | #define SWIFT_DEMANGLE_PLATFORM_H 15 | 16 | #if defined(__cplusplus) 17 | extern "C" { 18 | #endif 19 | 20 | #if defined(swiftDemangle_EXPORTS) 21 | # if defined(__ELF__) 22 | # define SWIFT_DEMANGLE_LINKAGE __attribute__((__visibility__("protected"))) 23 | # elif defined(__MACH__) 24 | # define SWIFT_DEMANGLE_LINKAGE __attribute__((__visibility__("default"))) 25 | # else 26 | # define SWIFT_DEMANGLE_LINKAGE __declspec(dllexport) 27 | # endif 28 | #else 29 | # if defined(__ELF__) 30 | # define SWIFT_DEMANGLE_LINKAGE __attribute__((__visibility__("default"))) 31 | # elif defined(__MACH__) 32 | # define SWIFT_DEMANGLE_LINKAGE __attribute__((__visibility__("default"))) 33 | # else 34 | # define SWIFT_DEMANGLE_LINKAGE __declspec(dllimport) 35 | # endif 36 | #endif 37 | 38 | #if defined(__cplusplus) 39 | } 40 | #endif 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /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.3.0" 31 | 32 | #endif /* HDR_KSCrashReportVersion_h */ 33 | -------------------------------------------------------------------------------- /Source/KSCrash-Tests/TestThread.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestThread.h 3 | // 4 | // Created by Karl Stenerud on 2012-03-03. 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 | #import 30 | 31 | 32 | @interface TestThread: NSThread 33 | 34 | @property(nonatomic, readwrite, assign) thread_t thread; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Android/Source/KSJNI.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSJNI.h 3 | // 4 | // Copyright (c) 2016 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_KSJNI_h 26 | #define HDR_KSJNI_h 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | void ksjni_init(JNIEnv* jniEnv); 36 | 37 | JNIEnv* ksjni_getEnv(); 38 | 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif // HDR_KSJNI_h 45 | -------------------------------------------------------------------------------- /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_BASIC_FALLTHROUGH_H 21 | #define SWIFT_BASIC_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 // SWIFT_BASIC_FALLTHROUGH_H 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | + (instancetype) sharedInstance; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Source/KSCrash-Tests/KSDebug_Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ksmemory_Tests.m 3 | // 4 | // Created by Karl Stenerud on 2012-03-03. 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 "KSDebug.h" 31 | 32 | 33 | @interface KSDebug_Tests : XCTestCase @end 34 | 35 | @implementation KSDebug_Tests 36 | 37 | - (void) testIsBeingTraced 38 | { 39 | bool traced = ksdebug_isBeingTraced(); 40 | XCTAssertTrue(traced, @""); 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | - (NSString*) generateTempFilePath; 36 | - (NSString*) generateFileWithData:(NSData*) data; 37 | - (NSString*) generateFileWithString:(NSString*) string; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Source/KSCrash-Tests/TestThread.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestThread.m 3 | // 4 | // Created by Karl Stenerud on 2012-03-03. 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 "TestThread.h" 29 | #import "KSThread.h" 30 | 31 | 32 | @implementation TestThread 33 | 34 | @synthesize thread = _thread; 35 | 36 | - (void) main 37 | { 38 | self.thread = (thread_t)ksthread_self(); 39 | while(!self.isCancelled) 40 | { 41 | [[self class] sleepForTimeInterval:0.1]; 42 | } 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSDemangle_CPP.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KSDemangle_CPP.cpp 3 | // 4 | // Created by Karl Stenerud on 2016-11-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 | #include 29 | #include "KSDemangle_CPP.h" 30 | #include "KSLogger.h" 31 | 32 | extern "C" char* ksdm_demangleCPP(const char* mangledSymbol) 33 | { 34 | int status = 0; 35 | char* demangled = __cxxabiv1::__cxa_demangle(mangledSymbol, NULL, NULL, &status); 36 | return status == 0 ? demangled : NULL; 37 | } 38 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Android/Source/monitors/KSCrashMonitor_System.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashMonitor_System.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-05. 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 KSCrashMonitor_System_h 28 | #define KSCrashMonitor_System_h 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | #include "KSCrashMonitor.h" 36 | 37 | 38 | /** Access the Monitor API. 39 | */ 40 | KSCrashMonitorAPI* kscm_system_getAPI(); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Monitors/KSCrashMonitor_System.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashMonitor_System.h 3 | // 4 | // Created by Karl Stenerud on 2012-02-05. 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 KSCrashMonitor_System_h 28 | #define KSCrashMonitor_System_h 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | #include "KSCrashMonitor.h" 36 | 37 | 38 | /** Access the Monitor API. 39 | */ 40 | KSCrashMonitorAPI* kscm_system_getAPI(void); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSID.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSID.h 3 | // 4 | // Copyright (c) 2016 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_KSID_h 26 | #define HDR_KSID_h 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | 33 | /** Generate a new human readabale, null terminated, globally unique ID string. 34 | * 35 | * @param destinationBuffer37Bytes Buffer of at least 37 bytes to hold the ID. 36 | */ 37 | void ksid_generate(char* destinationBuffer37Bytes); 38 | 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif // HDR_KSID_h 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /iOS/Advanced-Example/LoaderVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoaderVC.m 3 | // Advanced-Example 4 | // 5 | 6 | #import "LoaderVC.h" 7 | 8 | #import "AppDelegate.h" 9 | #import 10 | 11 | /** 12 | * Defers application loading until all error reports have been sent. 13 | * This allows error reports to be sent even if the app's initialization 14 | * code is causing a crash. 15 | * 16 | * Normally you'd just have this view display Default.png so that it looks 17 | * no different from the launch view. 18 | */ 19 | @implementation LoaderVC 20 | 21 | - (void) viewDidAppear:(BOOL) animated 22 | { 23 | [super viewDidAppear:animated]; 24 | 25 | // Send all outstanding reports, then show the main view controller. 26 | AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate; 27 | [appDelegate.crashInstallation sendAllReportsWithCompletion:^(NSArray* reports, BOOL completed, NSError* error) 28 | { 29 | if(completed) 30 | { 31 | NSLog(@"Sent %lu reports", (unsigned long)[reports count]); 32 | } 33 | else 34 | { 35 | NSLog(@"Failed to send reports: %@", error); 36 | } 37 | 38 | // If you added an alert to the installation, it will interfere with replacing 39 | // the root view controller. Delaying by 0.3 seconds mitigates this. 40 | [self performSelector:@selector(showMainVC) withObject:nil afterDelay:0.3]; 41 | }]; 42 | 43 | } 44 | 45 | - (void) showMainVC 46 | { 47 | UIViewController* vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MainVC"]; 48 | [UIApplication sharedApplication].keyWindow.rootViewController = vc; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/KSCrashCachedData.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashCachedData.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 | /* Maintains a cache of difficult-to-retrieve data. 27 | */ 28 | 29 | 30 | #include "KSThread.h" 31 | 32 | void ksccd_init(int pollingIntervalInSeconds); 33 | 34 | void ksccd_freeze(void); 35 | void ksccd_unfreeze(void); 36 | 37 | void ksccd_setSearchQueueNames(bool searchQueueNames); 38 | 39 | KSThread* ksccd_getAllThreads(int* threadCount); 40 | 41 | const char* ksccd_getThreadName(KSThread thread); 42 | 43 | const char* ksccd_getQueueName(KSThread thread); 44 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSCxaThrowSwapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCxaThrowSwapper.h 3 | // 4 | // Copyright (c) 2019 YANDEX LLC. 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 KSCxaThrowSwapper_h 26 | #define KSCxaThrowSwapper_h 27 | 28 | #ifdef __cplusplus 29 | 30 | #include 31 | 32 | extern "C" { 33 | 34 | typedef void (*cxa_throw_type)(void *, std::type_info *, void (*)(void *)); 35 | #else 36 | typedef void (*cxa_throw_type)(void *, void *, void (*)(void *)); 37 | #endif 38 | 39 | int ksct_swap(const cxa_throw_type handler); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* KSCxaThrowSwapper_h */ 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Monitors/KSCrashMonitor_Signal.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashMonitor_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_KSCrashMonitor_Signal_h 33 | #define HDR_KSCrashMonitor_Signal_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | #include "KSCrashMonitor.h" 41 | 42 | 43 | /** Access the Monitor API. 44 | */ 45 | KSCrashMonitorAPI* kscm_signal_getAPI(void); 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // HDR_KSCrashMonitor_Signal_h 53 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Android/app/src/main/java/org/stenerud/kscrash/KSCrashReportFilteringFailedException.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Karl Stenerud. 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 | 23 | package org.stenerud.kscrash; 24 | 25 | import java.util.List; 26 | 27 | public class KSCrashReportFilteringFailedException extends Exception { 28 | public final List reports; 29 | public KSCrashReportFilteringFailedException(Throwable cause, List reports) { 30 | super(cause); 31 | this.reports = reports; 32 | } 33 | public KSCrashReportFilteringFailedException(String message, Throwable cause, List reports) { 34 | super(message, cause); 35 | this.reports = reports; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSDebug.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSDebug.h 3 | // 4 | // Created by Karl Stenerud on 2012-01-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 | /* Utility functions for querying the mach kernel. 29 | */ 30 | 31 | 32 | #ifndef HDR_KSDebug_h 33 | #define HDR_KSDebug_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | #include 41 | 42 | 43 | /** Check if the current process is being traced or not. 44 | * 45 | * @return true if we're being traced. 46 | */ 47 | bool ksdebug_isBeingTraced(void); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif // HDR_KSDebug_h 54 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Monitors/KSCrashMonitor_CPPException.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashMonitor_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_KSCrashMonitor_CPPException_h 26 | #define HDR_KSCrashMonitor_CPPException_h 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #include "KSCrashMonitor.h" 33 | 34 | /** Enable swapping of __cxa_trow symbol with lazy symbols table 35 | */ 36 | void kscm_enableSwapCxaThrow(void); 37 | 38 | /** Access the Monitor API. 39 | */ 40 | KSCrashMonitorAPI* kscm_cppexception_getAPI(void); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // HDR_KSCrashMonitor_CPPException_h 48 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSDemangle_Swift.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KSDemangle_Swift.cc 3 | // 4 | // Created by Karl Stenerud on 2016-11-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 | #include "Demangle.h" 29 | #include "KSDemangle_Swift.h" 30 | 31 | extern "C" char* ksdm_demangleSwift(const char* mangledSymbol) 32 | { 33 | swift::Demangle::DemangleOptions options = swift::Demangle::DemangleOptions::SimplifiedUIDemangleOptions(); 34 | std::string demangled = swift::Demangle::demangleSymbolAsString(mangledSymbol, options); 35 | if(demangled.length() == 0) 36 | { 37 | return NULL; 38 | } 39 | return strdup(demangled.c_str()); 40 | } 41 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Monitors/KSCrashMonitor_NSException.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashMonitor_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_KSCrashMonitor_NSException_h 33 | #define HDR_KSCrashMonitor_NSException_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | #include "KSCrashMonitor.h" 41 | 42 | 43 | /** Access the Monitor API. 44 | */ 45 | KSCrashMonitorAPI* kscm_nsexception_getAPI(void); 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // HDR_KSCrashMonitor_NSException_h 53 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /WatchOS/CrashExample/CrashExample/Base.lproj/Main.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 | -------------------------------------------------------------------------------- /Android/Source/tools/KSThread.c: -------------------------------------------------------------------------------- 1 | // 2 | // KSThread.c 3 | // 4 | // Created by Karl Stenerud on 2012-01-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 | #include "KSThread.h" 29 | 30 | #include "KSSystemCapabilities.h" 31 | 32 | //#define KSLogger_LocalLevel TRACE 33 | #include "KSLogger.h" 34 | 35 | #include 36 | 37 | 38 | KSThread ksthread_self() 39 | { 40 | return (KSThread)pthread_self(); 41 | } 42 | 43 | bool ksthread_getThreadName(const KSThread thread, char* const buffer, int bufLength) 44 | { 45 | return NULL; 46 | } 47 | 48 | bool ksthread_getQueueName(const KSThread thread, char* const buffer, int bufLength) 49 | { 50 | return NULL; 51 | } 52 | -------------------------------------------------------------------------------- /Android/Source/KSCrashCachedData.c: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashCachedData.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 "KSCrashCachedData.h" 27 | 28 | //#define KSLogger_LocalLevel TRACE 29 | #include "KSLogger.h" 30 | 31 | void ksccd_init(__unused int pollingIntervalInSeconds) 32 | { 33 | } 34 | 35 | void ksccd_freeze() 36 | { 37 | } 38 | 39 | void ksccd_unfreeze() 40 | { 41 | } 42 | 43 | KSThread* ksccd_getAllThreads(__unused int* threadCount) 44 | { 45 | return NULL; 46 | } 47 | 48 | const char* ksccd_getThreadName(__unused KSThread thread) 49 | { 50 | return NULL; 51 | } 52 | 53 | const char* ksccd_getQueueName(__unused KSThread thread) 54 | { 55 | return NULL; 56 | } 57 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Monitors/KSCrashMonitor_MachException.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSCrashMonitor_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_KSCrashMonitor_MachException_h 33 | #define HDR_KSCrashMonitor_MachException_h 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | #include "KSCrashMonitor.h" 40 | #include 41 | 42 | 43 | /** Access the Monitor API. 44 | */ 45 | KSCrashMonitorAPI* kscm_machexception_getAPI(void); 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // HDR_KSCrashMonitor_MachException_h 53 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSDemangle_CPP.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSDemangle_CPP.h 3 | // 4 | // Created by Karl Stenerud on 2016-11-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 | #ifndef HDR_KSDemangle_CPP_h 28 | #define HDR_KSDemangle_CPP_h 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** Demangle a C++ symbol. 35 | * 36 | * @param mangledSymbol The mangled symbol. 37 | * 38 | * @return A demangled symbol, or NULL if demangling failed. 39 | * MEMORY MANAGEMENT WARNING: User is responsible for calling free() on the returned value. 40 | */ 41 | char* ksdm_demangleCPP(const char* mangledSymbol); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // HDR_KSDemangle_CPP_h 48 | -------------------------------------------------------------------------------- /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_BASIC_MALLOC_H 19 | #define SWIFT_BASIC_MALLOC_H 20 | 21 | #include 22 | #if defined(_MSC_VER) 23 | #include 24 | #else 25 | #include 26 | #endif 27 | 28 | namespace swift { 29 | 30 | // FIXME: Use C11 aligned_alloc if available. 31 | inline void *AlignedAlloc(size_t size, size_t align) { 32 | // posix_memalign only accepts alignments greater than sizeof(void*). 33 | // 34 | if (align < sizeof(void*)) 35 | align = sizeof(void*); 36 | 37 | void *r; 38 | #if defined(_WIN32) 39 | r = _aligned_malloc(size, align); 40 | assert(r && "_aligned_malloc failed"); 41 | #else 42 | int res = posix_memalign(&r, align, size); 43 | assert(res == 0 && "posix_memalign failed"); 44 | (void)res; // Silence the unused variable warning. 45 | #endif 46 | return r; 47 | } 48 | 49 | inline void AlignedFree(void *p) { 50 | #if defined(_WIN32) 51 | _aligned_free(p); 52 | #else 53 | free(p); 54 | #endif 55 | } 56 | 57 | } // end namespace swift 58 | 59 | #endif // SWIFT_BASIC_MALLOC_H 60 | -------------------------------------------------------------------------------- /Source/KSCrash/Recording/Tools/KSDemangle_Swift.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSDemangle_Swift.h 3 | // 4 | // Created by Karl Stenerud on 2016-11-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 | #ifndef HDR_KSDemangle_Swift_h 28 | #define HDR_KSDemangle_Swift_h 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** Demangle a Swift symbol. 35 | * 36 | * @param mangledSymbol The mangled symbol. 37 | * 38 | * @return A demangled symbol, or NULL if demangling failed. 39 | * MEMORY MANAGEMENT WARNING: User is responsible for calling free() on the returned value. 40 | */ 41 | char* ksdm_demangleSwift(const char* mangledSymbol); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // HDR_KSDemangle_Swift_h 48 | -------------------------------------------------------------------------------- /Webapp/listener.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from flask import request 3 | import module_locator 4 | import os 5 | 6 | def ensure_path_exists(path): 7 | if not os.path.exists(path): 8 | os.makedirs(path) 9 | 10 | def get_next_post_index(path): 11 | dirs = [f for f in os.listdir(path) if os.path.isdir(os.path.join(path, f))] 12 | if len(dirs) == 0: 13 | return 1 14 | dirname = max(dirs) 15 | return int(os.path.basename(os.path.normpath(dirname))) + 1 16 | 17 | posts_path = os.path.join(module_locator.module_path(), "posts") 18 | ensure_path_exists(posts_path) 19 | next_post_index = get_next_post_index(posts_path) 20 | print "Next post index: %d" % next_post_index 21 | 22 | app = Flask(__name__) 23 | 24 | def save_text_fields(fields, filename): 25 | text_file = open(filename, "w") 26 | print "Text Fields:" 27 | for key in fields: 28 | field_string = "%s: %s" % (key, fields[key]) 29 | print " %s" % field_string 30 | text_file.write(field_string) 31 | text_file.close() 32 | 33 | def save_file_fields(fields, path): 34 | ensure_path_exists(path) 35 | print "File Fields:" 36 | for filename in fields: 37 | data_file = fields[filename] 38 | save_path = os.path.join(path, filename) 39 | print " %s" % filename 40 | data_file.save(save_path) 41 | 42 | def save_post(request, index): 43 | print "Post #%d" % index 44 | base_path = os.path.join(posts_path, str(index)) 45 | ensure_path_exists(base_path) 46 | save_text_fields(request.form, os.path.join(base_path, "text_fields.txt")) 47 | save_file_fields(request.files, os.path.join(base_path, "file_fields")) 48 | 49 | @app.route('/crashreport', methods=['POST']) 50 | def crashreport(): 51 | global next_post_index 52 | save_post(request, next_post_index) 53 | next_post_index += 1 54 | return 'OK' 55 | -------------------------------------------------------------------------------- /Android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 18 | 19 |