This commit is contained in:
启星
2025-08-08 10:49:36 +08:00
parent 6400cf78bb
commit b5ce3d580a
8780 changed files with 978183 additions and 0 deletions

BIN
Pods/Bugly/Bugly.framework/Bugly generated Normal file

Binary file not shown.

163
Pods/Bugly/Bugly.framework/Headers/Bugly.h generated Normal file
View File

@@ -0,0 +1,163 @@
//
// Bugly.h
//
// Version: 2.6(1)
//
// Copyright (c) 2017年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BuglyConfig.h"
#import "BuglyLog.h"
BLY_START_NONNULL
@interface Bugly : NSObject
/**
* 初始化Bugly,使用默认BuglyConfigs
*
* @param appId 注册Bugly分配的应用唯一标识
*/
+ (void)startWithAppId:(NSString * BLY_NULLABLE)appId;
/**
* 使用指定配置初始化Bugly
*
* @param appId 注册Bugly分配的应用唯一标识
* @param config 传入配置的 BuglyConfig
*/
+ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
config:(BuglyConfig * BLY_NULLABLE)config;
/**
* 使用指定配置初始化Bugly
*
* @param appId 注册Bugly分配的应用唯一标识
* @param development 是否开发设备
* @param config 传入配置的 BuglyConfig
*/
+ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
developmentDevice:(BOOL)development
config:(BuglyConfig * BLY_NULLABLE)config;
/**
* 设置用户标识
*
* @param userId 用户标识
*/
+ (void)setUserIdentifier:(NSString *)userId;
/**
* 更新版本信息
*
* @param version 应用版本信息
*/
+ (void)updateAppVersion:(NSString *)version;
/**
* 设置关键数据,随崩溃信息上报
*
* @param value KEY
* @param key VALUE
*/
+ (void)setUserValue:(NSString *)value
forKey:(NSString *)key;
/**
* 获取USER ID
*
* @return USER ID
*/
+ (NSString *)buglyUserIdentifier;
/**
* 获取关键数据
*
* @return 关键数据
*/
+ (NSDictionary * BLY_NULLABLE)allUserValues;
/**
* 设置标签
*
* @param tag 标签ID可在网站生成
*/
+ (void)setTag:(NSUInteger)tag;
/**
* 获取当前设置标签
*
* @return 当前标签ID
*/
+ (NSUInteger)currentTag;
/**
* 获取设备ID
*
* @return 设备ID
*/
+ (NSString *)buglyDeviceId;
/**
* 上报自定义Objective-C异常
*
* @param exception 异常信息
*/
+ (void)reportException:(NSException *)exception;
/**
* 上报错误
*
* @param error 错误信息
*/
+ (void)reportError:(NSError *)error;
/**
* @brief 上报自定义错误
*
* @param category 类型(Cocoa=3,CSharp=4,JS=5,Lua=6)
* @param aName 名称
* @param aReason 错误原因
* @param aStackArray 堆栈
* @param info 附加数据
* @param terminate 上报后是否退出应用进程
*/
+ (void)reportExceptionWithCategory:(NSUInteger)category
name:(NSString *)aName
reason:(NSString *)aReason
callStack:(NSArray *)aStackArray
extraInfo:(NSDictionary *)info
terminateApp:(BOOL)terminate;
/**
* SDK 版本信息
*
* @return SDK版本号
*/
+ (NSString *)sdkVersion;
/**
* APP 版本信息
*
* @return SDK版本号
*/
+ (NSString *)appVersion;
/**
* App 是否发生了连续闪退
* 如果 启动SDK 且 5秒内 闪退,且次数达到 3次 则判定为连续闪退
*
* @return 是否连续闪退
*/
+ (BOOL)isAppCrashedOnStartUpExceedTheLimit;
/**
* 关闭bugly监控
*/
+ (void)closeCrashReport;
BLY_END_NONNULL
@end

View File

@@ -0,0 +1,149 @@
//
// BuglyConfig.h
// Bugly
//
// Copyright (c) 2016年 Tencent. All rights reserved.
//
#pragma once
#define BLY_UNAVAILABLE(x) __attribute__((unavailable(x)))
#if __has_feature(nullability)
#define BLY_NONNULL __nonnull
#define BLY_NULLABLE __nullable
#define BLY_START_NONNULL _Pragma("clang assume_nonnull begin")
#define BLY_END_NONNULL _Pragma("clang assume_nonnull end")
#else
#define BLY_NONNULL
#define BLY_NULLABLE
#define BLY_START_NONNULL
#define BLY_END_NONNULL
#endif
#import <Foundation/Foundation.h>
#import "BuglyLog.h"
BLY_START_NONNULL
@protocol BuglyDelegate <NSObject>
@optional
/**
* 发生异常时回调
*
* @param exception 异常信息
*
* @return 返回需上报记录,随异常上报一起上报
*/
- (NSString * BLY_NULLABLE)attachmentForException:(NSException * BLY_NULLABLE)exception;
/**
* 发生sigkill时回调
*
* @param exception 异常信息
*
* @return 返回需上报记录随sigkill异常上报一起上报返回值由app开发者决定
*/
- (NSString * BLY_NULLABLE)attachmentForSigkill;
/**
* 策略激活时回调
*
* @param tacticInfo
*
* @return app是否弹框展示
*/
- (BOOL) h5AlertForTactic:(NSDictionary *)tacticInfo;
@end
@interface BuglyConfig : NSObject
/**
* SDK Debug信息开关, 默认关闭
*/
@property (nonatomic, assign) BOOL debugMode;
/**
* 设置自定义渠道标识
*/
@property (nonatomic, copy) NSString *channel;
/**
* 设置自定义版本号
*/
@property (nonatomic, copy) NSString *version;
/**
* 设置自定义设备唯一标识
*/
@property (nonatomic, copy) NSString *deviceIdentifier;
/**
* 卡顿监控开关,默认关闭
*/
@property (nonatomic) BOOL blockMonitorEnable;
/**
* 卡顿监控判断间隔,单位为秒
*/
@property (nonatomic) NSTimeInterval blockMonitorTimeout;
/**
* 设置 App Groups Id (如有使用 Bugly iOS Extension SDK请设置该值)
*/
@property (nonatomic, copy) NSString *applicationGroupIdentifier;
/**
* 进程内还原开关,默认开启
*/
@property (nonatomic) BOOL symbolicateInProcessEnable;
/**
* 非正常退出事件记录开关,默认关闭
*/
@property (nonatomic) BOOL unexpectedTerminatingDetectionEnable;
/**
* 页面信息记录开关,默认开启
*/
@property (nonatomic) BOOL viewControllerTrackingEnable;
/**
* Bugly Delegate
*/
@property (nonatomic, assign) id<BuglyDelegate> delegate;
/**
* 控制自定义日志上报默认值为BuglyLogLevelSilent即关闭日志记录功能。
* 如果设置为BuglyLogLevelWarn则在崩溃时会上报Warn、Error接口打印的日志
*/
@property (nonatomic, assign) BuglyLogLevel reportLogLevel;
/**
* 崩溃数据过滤器,如果崩溃堆栈的模块名包含过滤器中设置的关键字,则崩溃数据不会进行上报
* 例如过滤崩溃堆栈中包含搜狗输入法的数据可以添加过滤器关键字SogouInputIPhone.dylib等
*/
@property (nonatomic, copy) NSArray *excludeModuleFilter;
/**
* 控制台日志上报开关,默认开启
*/
@property (nonatomic, assign) BOOL consolelogEnable;
/**
* 崩溃退出超时如果监听到崩溃后App一直没有退出则到达超时时间后会自动abort进程退出
* 默认值 5s 单位 秒
* 当赋值为0时则不会自动abort进程退出
*/
@property (nonatomic, assign) NSUInteger crashAbortTimeout;
/**
* 设置自定义联网、crash上报域名
*/
@property (nonatomic, copy) NSString *crashServerUrl;
@end
BLY_END_NONNULL

View File

@@ -0,0 +1,78 @@
//
// BuglyLog.h
// Bugly
//
// Copyright (c) 2017年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
// Log level for Bugly Log
typedef NS_ENUM(NSUInteger, BuglyLogLevel) {
BuglyLogLevelSilent = 0,
BuglyLogLevelError = 1,
BuglyLogLevelWarn = 2,
BuglyLogLevelInfo = 3,
BuglyLogLevelDebug = 4,
BuglyLogLevelVerbose = 5,
};
#pragma mark -
OBJC_EXTERN void BLYLog(BuglyLogLevel level, NSString *format, ...) NS_FORMAT_FUNCTION(2, 3);
OBJC_EXTERN void BLYLogv(BuglyLogLevel level, NSString *format, va_list args) NS_FORMAT_FUNCTION(2, 0);
#pragma mark -
#define BUGLY_LOG_MACRO(_level, fmt, ...) [BuglyLog level:_level tag:nil log:fmt, ##__VA_ARGS__]
#define BLYLogError(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelError, fmt, ##__VA_ARGS__)
#define BLYLogWarn(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelWarn, fmt, ##__VA_ARGS__)
#define BLYLogInfo(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelInfo, fmt, ##__VA_ARGS__)
#define BLYLogDebug(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelDebug, fmt, ##__VA_ARGS__)
#define BLYLogVerbose(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelVerbose, fmt, ##__VA_ARGS__)
#pragma mark - Interface
@interface BuglyLog : NSObject
/**
* @brief 初始化日志模块
*
* @param level 设置默认日志级别默认BLYLogLevelSilent
*
* @param printConsole 是否打印到控制台默认NO
*/
+ (void)initLogger:(BuglyLogLevel) level consolePrint:(BOOL)printConsole;
/**
* @brief 打印BLYLogLevelInfo日志
*
* @param format 日志内容 总日志大小限制为字符串长度30k条数200
*/
+ (void)log:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
/**
* @brief 打印日志
*
* @param level 日志级别
* @param message 日志内容 总日志大小限制为字符串长度30k条数200
*/
+ (void)level:(BuglyLogLevel) level logs:(NSString *)message;
/**
* @brief 打印日志
*
* @param level 日志级别
* @param format 日志内容 总日志大小限制为字符串长度30k条数200
*/
+ (void)level:(BuglyLogLevel) level log:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
/**
* @brief 打印日志
*
* @param level 日志级别
* @param tag 日志模块分类
* @param format 日志内容 总日志大小限制为字符串长度30k条数200
*/
+ (void)level:(BuglyLogLevel) level tag:(NSString *) tag log:(NSString *)format, ... NS_FORMAT_FUNCTION(3, 4);
@end

View File

@@ -0,0 +1,12 @@
framework module Bugly {
umbrella header "Bugly.h"
export *
module * { export * }
link framework "Foundation"
link framework "Security"
link framework "SystemConfiguration"
link "c++"
link "z"
}

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>