FIRCLSInternalReport.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Copyright 2019 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #include "Crashlytics/Crashlytics/Helpers/FIRCLSFeatures.h"
  16. extern NSString *const FIRCLSCustomFatalIndicatorFile;
  17. extern NSString *const FIRCLSReportBinaryImageFile;
  18. extern NSString *const FIRCLSReportExceptionFile;
  19. extern NSString *const FIRCLSReportCustomExceptionAFile;
  20. extern NSString *const FIRCLSReportCustomExceptionBFile;
  21. extern NSString *const FIRCLSReportSignalFile;
  22. extern NSString *const FIRCLSMetricKitFatalReportFile;
  23. extern NSString *const FIRCLSMetricKitNonfatalReportFile;
  24. #if CLS_MACH_EXCEPTION_SUPPORTED
  25. extern NSString *const FIRCLSReportMachExceptionFile;
  26. #endif
  27. extern NSString *const FIRCLSReportErrorAFile;
  28. extern NSString *const FIRCLSReportErrorBFile;
  29. extern NSString *const FIRCLSReportLogAFile;
  30. extern NSString *const FIRCLSReportLogBFile;
  31. extern NSString *const FIRCLSReportMetadataFile;
  32. extern NSString *const FIRCLSReportInternalIncrementalKVFile;
  33. extern NSString *const FIRCLSReportInternalCompactedKVFile;
  34. extern NSString *const FIRCLSReportUserIncrementalKVFile;
  35. extern NSString *const FIRCLSReportUserCompactedKVFile;
  36. extern NSString *const FIRCLSReportRolloutsFile;
  37. @class FIRCLSFileManager;
  38. @interface FIRCLSInternalReport : NSObject
  39. + (instancetype)reportWithPath:(NSString *)path;
  40. - (instancetype)initWithPath:(NSString *)path
  41. executionIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;
  42. - (instancetype)initWithPath:(NSString *)path;
  43. - (instancetype)init NS_UNAVAILABLE;
  44. + (instancetype)new NS_UNAVAILABLE;
  45. + (NSArray *)crashFileNames;
  46. @property(nonatomic, copy, readonly) NSString *directoryName;
  47. @property(nonatomic, copy) NSString *path;
  48. @property(nonatomic, assign, readonly) BOOL hasAnyEvents;
  49. // content paths
  50. @property(nonatomic, copy, readonly) NSString *binaryImagePath;
  51. @property(nonatomic, copy, readonly) NSString *metadataPath;
  52. - (void)enumerateSymbolicatableFilesInContent:(void (^)(NSString *path))block;
  53. - (NSString *)pathForContentFile:(NSString *)name;
  54. // Metadata Helpers
  55. /**
  56. * Returns the org id for the report.
  57. **/
  58. @property(nonatomic, copy, readonly) NSString *orgID;
  59. /**
  60. * Returns the Install UUID for the report.
  61. **/
  62. @property(nonatomic, copy, readonly) NSString *installID;
  63. /**
  64. * Returns true if report contains a signal, mach exception or unhandled exception record, false
  65. * otherwise.
  66. **/
  67. @property(nonatomic, assign, readonly) BOOL isCrash;
  68. /**
  69. * Returns the session identifier for the report.
  70. **/
  71. @property(nonatomic, copy, readonly) NSString *identifier;
  72. /**
  73. * Returns the custom key value data for the report.
  74. **/
  75. @property(nonatomic, copy, readonly) NSDictionary *customKeys;
  76. /**
  77. * Returns the CFBundleVersion of the application that generated the report.
  78. **/
  79. @property(nonatomic, copy, readonly) NSString *bundleVersion;
  80. /**
  81. * Returns the CFBundleShortVersionString of the application that generated the report.
  82. **/
  83. @property(nonatomic, copy, readonly) NSString *bundleShortVersionString;
  84. /**
  85. * Returns the date that the report was created.
  86. **/
  87. @property(nonatomic, copy, readonly) NSDate *dateCreated;
  88. @property(nonatomic, copy, readonly) NSDate *crashedOnDate;
  89. /**
  90. * Returns the os version that the application crashed on.
  91. **/
  92. @property(nonatomic, copy, readonly) NSString *OSVersion;
  93. /**
  94. * Returns the os build version that the application crashed on.
  95. **/
  96. @property(nonatomic, copy, readonly) NSString *OSBuildVersion;
  97. @end