集成httpdns

This commit is contained in:
kai60
2022-01-17 11:40:56 +08:00
parent 7b7faab5ce
commit f63f7d216c
82 changed files with 2789 additions and 13 deletions
Binary file not shown.
@@ -0,0 +1,18 @@
//
// EMASRest.h
// EMASRest
//
// Created by sky on 2020/6/11.
// Copyright © 2020 aliyun. All rights reserved.
//
#import <Foundation/Foundation.h>
#define ALICLOUD_EMAS_REST_IOS_SDK_VERSION @"11.1.1.2"
#import <EMASRest/EMASRestConfiguration.h>
#import <EMASRest/EMASRestCacheConfig.h>
#import <EMASRest/EMASRestManager.h>
#import <EMASRest/EMASRestManager.h>
#import <EMASRest/EMASRestSendService+MultiChannel.h>
#import <EMASRest/EMASRestSendService.h>
@@ -0,0 +1,33 @@
//
// EMASRestCacheConfig.h
// AlicloudCommonAnalytics
//
// Created by sky on 2020/7/27.
//
#import <Foundation/Foundation.h>
#import "EMASRestConfiguration.h"
NS_ASSUME_NONNULL_BEGIN
@interface EMASRestCacheConfig : NSObject
@property (nonatomic, assign) int memoryCacheSizeLimit; // 内存size限制
@property (nonatomic, assign) int memoryCacheCountLimit; // 日志条数限制
@property (nonatomic, assign) BOOL memoryCacheSwitch; // 内存缓存开关
@property (nonatomic, assign) BOOL diskCacheSwitch; // 磁盘缓存开关
@property (nonatomic, strong) NSString *cacheName; // 缓存标识,默认为common
// 缓存标识,对应一个实例。
// dataUploadHost+appkey+cacheName共同确认一个实例
@property (nonatomic, strong) NSString *cacheKey;
@property (nonatomic, strong) EMASRestConfiguration *restConfig;
// 是否有效
- (BOOL)isValid;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,36 @@
//
// EMASRestConfiguration.h
// EMASRest
//
// Created by qiulibin on 16/11/12.
// Copyright © 2016年 Taobao lnc. All rights reserved.
//
#ifndef EMASRestConfiguration_h
#define EMASRestConfiguration_h
#import <Foundation/Foundation.h>
//用于返回追加的保留字段信息
@protocol EMASRestReservesProviderProtocol <NSObject>
- (NSDictionary<NSString*, NSString*>*)reserveInfoDictionary;
@end
@interface EMASRestConfiguration : NSObject
@property(nonatomic, copy) NSString * channel;
@property(nonatomic, copy) NSString * appkey;
@property(nonatomic, copy) NSString * secret;
@property(nonatomic, copy) NSString * userId;
@property(nonatomic, copy) NSString * usernick;
@property(nonatomic, copy) NSString * appVersion;
@property(nonatomic, copy) NSString * country;
@property(nonatomic, copy) NSString * dataUploadScheme; // http or https
@property(nonatomic, copy) NSString * dataUploadHost; // data upload host
@end
#endif /* EMASRestConfiguration_h */
@@ -0,0 +1,32 @@
//
// TBDevice2.h
//
//
// Created by Alvin on 4/21/13.
//
// 设备信息的分装类
#ifndef EMASRestDevice_h
#define EMASRestDevice_h
#import <sys/socket.h>
#import <sys/sysctl.h>
#import <net/if.h>
#import <net/if_dl.h>
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonHMAC.h>
#import "EMASRestDeviceInfo.h"
@interface EMASRestDevice : NSObject
// 获取设备信息:部分信息的变化性,因此这里需要提供一个 持久配置模块,用于支持这类数据
+ (EMASRestDeviceInfo *)getDevice;
// 获取Mac地址
+ (NSString *)macAddress;
@end
#endif
@@ -0,0 +1,37 @@
//
// TBDevice.h
//
//
// Created by Alvin on 4/21/13.
//
// 设备信息存储的元类
#ifndef EMASRestDeviceInfo_h
#define EMASRestDeviceInfo_h
#import <Foundation/Foundation.h>
@interface EMASRestDeviceInfo : NSObject
@property(readwrite,strong) NSString * mAppVersion;
@property(readwrite,strong) NSString * mOsName;
@property(readwrite,strong) NSString * mUtdid;
@property(readwrite,strong) NSString * mImei;
@property(readwrite,strong) NSString * mImsi;
@property(readwrite,strong) NSString * mBrand;
@property(readwrite,strong) NSString * mCpu;
@property(readwrite,strong) NSString * mDeviceId;
@property(readwrite,strong) NSString * mDeviceModel;
@property(readwrite,strong) NSString * mResolution;
@property(readwrite,strong) NSString * mCarrier;
@property(readwrite,strong) NSString * mAccess;
@property(readwrite,strong) NSString * mAccessSubType;
@property(readwrite,strong) NSString * mCountry;
@property(readwrite,strong) NSString * mLanguage;
@property(readwrite,strong) NSString * mOsVersion;
//@property(readwrite,strong) NSString * mDebugId;
@end
#endif
@@ -0,0 +1,24 @@
//
// EMASRest.h
// EMASRest
//
// Created by sky on 2020/6/11.
// Copyright © 2020 aliyun. All rights reserved.
//
#import "EMASRestCacheConfig.h"
@interface EMASRestManager : NSObject
+ (void)turnOnDebug;
// 添加rest配置
+ (void)addRestCacheConfigs:(EMASRestCacheConfig *)config;
/**
* 异步接口,注意数据大小不能超过30K
*/
+ (void)sendLogAsyncWithConfiguration:(EMASRestCacheConfig *)config aPageName:(NSObject *)aPageName eventId:(int) aEventId arg1:(NSString*) aArg1 arg2:(NSString*) aArg2 arg3:(NSString*) aArg3 args:(NSDictionary *) aArgs;
@end
@@ -0,0 +1,16 @@
//
// UTMd5.h
//
#import <Foundation/Foundation.h>
@interface EMASRestMd5 : NSObject
+ (NSString *)md5StrForData:(NSData *)data;
+ (NSData *)md5ForData:(NSData *)data;
+ (NSString *)md5StrForNSString:(NSString *) str;
@end
@@ -0,0 +1,29 @@
//
// EMASRestSendService+MultiChannel.h
// AlicloudCommonAnalytics
//
// Created by sky on 2020/6/11.
// Copyright © 2020 aliyun. All rights reserved.
//
#import "EMASRestSendService.h"
#import "EMASRestConfiguration.h"
NS_ASSUME_NONNULL_BEGIN
@interface EMASRestSendService (MultiChannel)
/**
* 异步接口,注意数据大小不能超过30K
*/
+ (void)sendLogAsyncWithConfiguration:(EMASRestConfiguration*)configuration aPageName:(NSObject *)aPageName eventId:(int) aEventId arg1:(NSString*) aArg1 arg2:(NSString*) aArg2 arg3:(NSString*) aArg3 args:(NSDictionary *) aArgs;
/**
* 同步接口,注意数据大小不能超过30K
*/
+ (BOOL)sendLogSyncWithConfiguration:(EMASRestConfiguration*)configuration aPageName:(NSObject *)aPageName eventId:(int) aEventId arg1:(NSString *) aArg1 arg2:(NSString *) aArg2 arg3:(NSString *) aArg3 args:(NSDictionary *) aArgs;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,57 @@
//
// EMASRestSendService.h
// EMASRest
//
// Created by qiulibin on 16/11/12.
// Copyright © 2016年 Taobao lnc. All rights reserved.
//
#ifndef EMASRestSendService_h
#define EMASRestSendService_h
#import <Foundation/Foundation.h>
#import "EMASRestConfiguration.h"
@interface EMASRestSendService : NSObject
//From数据链路打通需求,由一休SDK调用, 文档https://yuque.antfin-inc.com/ubmgda/lh1gwa/dffuy5
@property (nonatomic, copy) NSString* utabtest;
@property (nonatomic, copy) NSString* utabtestpage;
@property (nonatomic, weak) id<EMASRestReservesProviderProtocol> reserveProvider;
+ (EMASRestSendService*)shareInstance;
/**
* 配置初始化,该接口支持更新配置
* 》》》》》》》》》》》》》》》》提醒:只有调用接口比TBCrashReporter的业务才需要进行配置,比如安全模式 》》》》》》
* @param config 配置对象,参数存储在对象中
* @return 配置初始化是否成功,如appkey是必填参数,不可缺少
*/
- (BOOL)configBasicParamWithTBConfiguration:(EMASRestConfiguration*)config;
/**
* 获取配置参数
* @return 已经配置过了,返回配置的结果,否则返回nil
*/
- (EMASRestConfiguration*)obtainConfiguration;
/**
* 同步接口,注意数据大小不能超过30K
*/
-(BOOL)sendLogSync:(NSObject*)aPageName eventId:(int) aEventId arg1:(NSString*) aArg1 arg2:(NSString*) aArg2 arg3:(NSString*) aArg3 args:(NSDictionary *) aArgs;
/**
* 异步接口,注意数据大小不能超过30K
*/
-(void)sendLogAsync:(NSObject*)aPageName eventId:(int) aEventId arg1:(NSString*) aArg1 arg2:(NSString*) aArg2 arg3:(NSString*) aArg3 args:(NSDictionary *) aArgs;
/**
* 自定义url传输(同步),注意数据大小不能超过30K
*/
- (NSData *) sendLogWithUrl:(NSString*)url PageName:(NSObject *)aPageName eventId:(int) aEventId arg1:(NSString *) aArg1 arg2:(NSString *) aArg2 arg3:(NSString *) aArg3 args:(NSDictionary *) aArgs;
@end
#endif /* EMASRestSendService_h */
@@ -0,0 +1,6 @@
framework module EMASRest {
umbrella header "EMASRest.h"
export *
module * { export * }
}