Merge remote-tracking branch 'origin/develop_01'
# Conflicts: # .DS_Store
|
|
@ -1,8 +1,5 @@
|
|||
<?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>BuildSystemType</key>
|
||||
<string>Original</string>
|
||||
</dict>
|
||||
<dict/>
|
||||
</plist>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
//
|
||||
// ABSBootingProtection.h
|
||||
// AntilockBrakeSystem
|
||||
//
|
||||
// Created by 地风(ElonChan) on 16/5/16.
|
||||
// Copyright © 2016年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef void (^ABSBoolCompletionHandler)(BOOL succeeded, NSError *error);
|
||||
typedef void (^ABSRepairBlock)(ABSBoolCompletionHandler completionHandler);
|
||||
typedef void (^ABSReportBlock)(NSUInteger crashCounts);
|
||||
|
||||
typedef NS_ENUM(NSInteger, ABSBootingProtectionStatus) {
|
||||
ABSBootingProtectionStatusNormal, /**< APP 启动正常 */
|
||||
ABSBootingProtectionStatusNormalChecking, /**< 正在检测是否会在特定时间内是否会 Crash,注意:检测状态下“连续启动崩溃计数”个数小于或等于上限值 */
|
||||
ABSBootingProtectionStatusNeedFix, /**< APP 出现连续启动 Crash,需要采取修复措施 */
|
||||
ABSBootingProtectionStatusFixing, /**< APP 出现连续启动 Crash,正在修复中... */
|
||||
};
|
||||
|
||||
/**
|
||||
* 启动连续 crash 保护。
|
||||
* 启动后 `_crashOnLaunchTimeIntervalThreshold` 秒内 crash,反复超过 `_continuousCrashOnLaunchNeedToReport` 次则上报日志,超过 `_continuousCrashOnLaunchNeedToFix` 则启动修复操作。
|
||||
*/
|
||||
@interface ABSBootingProtection : NSObject
|
||||
|
||||
/**
|
||||
* 启动连续 crash 保护方法。
|
||||
* 前置条件:在 App 启动时注册 crash 处理函数,在 crash 时调用[ABSBootingProtection addCrashCountIfNeeded]。
|
||||
* 启动后一定时间内(`crashOnLaunchTimeIntervalThreshold`秒内)crash,反复超过一定次数(`continuousCrashOnLaunchNeedToReport`次)则上报日志,超过一定次数(`continuousCrashOnLaunchNeedToFix`次)则启动修复程序;在一定时间内(`crashOnLaunchTimeIntervalThreshold`秒) 秒后若没有 crash 将“连续启动崩溃计数”计数置零。
|
||||
`reportBlock` 上报逻辑,
|
||||
`repairtBlock` 修复逻辑,完成后执行 `[self setCrashCount:0]`
|
||||
|
||||
*/
|
||||
- (void)launchContinuousCrashProtect;
|
||||
|
||||
/*!
|
||||
* 当前启动Crash的状态
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) ABSBootingProtectionStatus bootingProtectionStatus;
|
||||
|
||||
/*!
|
||||
* 达到需要执行上报操作的“连续启动崩溃计数”个数。
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSUInteger continuousCrashOnLaunchNeedToReport;
|
||||
|
||||
/*!
|
||||
* 达到需要执行修复操作的“连续启动崩溃计数”个数。
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSUInteger continuousCrashOnLaunchNeedToFix;
|
||||
|
||||
/*!
|
||||
* APP 启动后经过多少秒,可以将“连续启动崩溃计数”清零
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSTimeInterval crashOnLaunchTimeIntervalThreshold;
|
||||
|
||||
/*!
|
||||
* 借助 context 可以让多个模块注册事件,并且事件 block 能独立执行,互不干扰。
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *context;
|
||||
|
||||
/*!
|
||||
* @details 启动后kCrashOnLaunchTimeIntervalThreshold秒内crash,反复超过continuousCrashOnLaunchNeedToReport次则上报日志,超过continuousCrashOnLaunchNeedToFix则启动修复程序;当所有操作完成后,执行 completion。在 crashOnLaunchTimeIntervalThreshold 秒后若没有 crash 将 kContinuousCrashOnLaunchCounterKey 计数置零。
|
||||
* @param context 借助 context 可以让多个模块注册事件,并且事件 block 能独立执行,互不干扰。
|
||||
*/
|
||||
- (instancetype)initWithContinuousCrashOnLaunchNeedToReport:(NSUInteger)continuousCrashOnLaunchNeedToReport
|
||||
continuousCrashOnLaunchNeedToFix:(NSUInteger)continuousCrashOnLaunchNeedToFix
|
||||
crashOnLaunchTimeIntervalThreshold:(NSTimeInterval)crashOnLaunchTimeIntervalThreshold
|
||||
context:(NSString *)context;
|
||||
/*!
|
||||
* 当前“连续启动崩溃“的状态
|
||||
*/
|
||||
+ (ABSBootingProtectionStatus)bootingProtectionStatusWithContext:(NSString *)context continuousCrashOnLaunchNeedToFix:(NSUInteger)continuousCrashOnLaunchNeedToFix;
|
||||
|
||||
/*!
|
||||
* 设置上报逻辑,参数 crashCounts 为启动连续 crash 次数
|
||||
*/
|
||||
- (void)setReportBlock:(ABSReportBlock)reportBlock;
|
||||
|
||||
/*!
|
||||
* 设置修复逻辑
|
||||
*/
|
||||
- (void)setRepairBlock:(ABSRepairBlock)repairtBlock;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// ABSUncaughtExceptionHandler.h
|
||||
// AntilockBrakeSystem
|
||||
//
|
||||
// Created by 地风(ElonChan) on 16/5/16.
|
||||
// Copyright © 2016年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
typedef void (^ABSUncaughtExceptionCallback)(NSException *exception);
|
||||
|
||||
@interface ABSUncaughtExceptionHandler : NSObject
|
||||
|
||||
+ (void)registerExceptionHandlerWithCallback:(ABSUncaughtExceptionCallback)callback;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// ABSUtil.h
|
||||
// AntilockBrakeSystem
|
||||
//
|
||||
// Created by 地风(ElonChan) on 16/5/16.
|
||||
// Copyright © 2016年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface ABSUtil : NSObject
|
||||
|
||||
// 设置日志逻辑
|
||||
+ (void)setLogger:(void (^)(NSString *))logger;
|
||||
|
||||
+ (void)Logger:(NSString *)log;
|
||||
|
||||
+ (BOOL)isValidString:(id)notValidString;
|
||||
|
||||
+ (BOOL)isWhiteListClass:(Class)class;
|
||||
|
||||
+ (void)deleteCacheWithfilePathsToRemove:(NSArray *)filePathsToRemove;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// AlicloudHTTPDNSMini.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by ryan on 3/6/2016.
|
||||
// Copyright © 2016 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef AlicloudHTTPDNSMini_h
|
||||
#define AlicloudHTTPDNSMini_h
|
||||
|
||||
#define HTTPDNSMINI_RESOLVED_NOTIFY @"HTTPDNSMiniResolvedNotify"
|
||||
|
||||
@interface AlicloudHTTPDNSMini : NSObject
|
||||
|
||||
+ (AlicloudHTTPDNSMini *)sharedInstance;
|
||||
- (NSArray *)getIpsByHostAsync:(NSString *)host;
|
||||
- (void)setPreResolveHosts:(NSArray *)hosts;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* AlicloudHTTPDNSMini_h */
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* Copyright (c) 2000-2015 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)route.h 8.3 (Berkeley) 4/19/94
|
||||
* $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef AlicloudIPv6Adapter_h
|
||||
#define AlicloudIPv6Adapter_h
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface AlicloudIPv6Adapter : NSObject
|
||||
|
||||
+ (instancetype)getInstance;
|
||||
|
||||
/**
|
||||
* 判断当前是否为IPv6-Only网络
|
||||
*/
|
||||
- (BOOL)isIPv6OnlyNetwork;
|
||||
|
||||
/**
|
||||
* 手动刷新IPv6-Only网络的判定
|
||||
*/
|
||||
- (BOOL)reResolveIPv6OnlyStatus;
|
||||
|
||||
/**
|
||||
IPv4 > IPv6地址转换\n
|
||||
- 输入IPv4地址无效,返回原地址
|
||||
- IPv6-Only网络,返回转换后的IPv6地址
|
||||
- 非IPv6-Only网络,返回原地址
|
||||
|
||||
@param addr IPv4地址
|
||||
@return 转换后的v6地址 或 原地址
|
||||
*/
|
||||
- (NSString *)handleIpv4Address:(NSString *)addr;
|
||||
|
||||
/**
|
||||
* 判断是否为IPv4地址
|
||||
*/
|
||||
- (BOOL)isIPv4Address:(NSString *)addr;
|
||||
|
||||
/**
|
||||
* 判断是否为IPv6地址
|
||||
*/
|
||||
- (BOOL)isIPv6Address:(NSString *)addr;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* AlicloudIPv6Adapter_h */
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
//
|
||||
// AlicloudReachabilityManager.h
|
||||
//
|
||||
// Created by 亿刀 on 14-1-9.
|
||||
// Edited by junmo on 15-5-16
|
||||
// Copyright (c) 2014年 Twitter. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
|
||||
|
||||
#define ALICLOUD_NETWOEK_STATUS_NOTIFY @"AlicloudNetworkStatusChangeNotify"
|
||||
|
||||
typedef enum {
|
||||
AlicloudNotReachable = 0,
|
||||
AlicloudReachableViaWiFi,
|
||||
AlicloudReachableVia2G,
|
||||
AlicloudReachableVia3G,
|
||||
AlicloudReachableVia4G
|
||||
} AlicloudNetworkStatus;
|
||||
|
||||
@interface AlicloudReachabilityManager : NSObject
|
||||
|
||||
/**
|
||||
* 获取Reachability单例对象
|
||||
*/
|
||||
+ (AlicloudReachabilityManager *)shareInstance;
|
||||
|
||||
/**
|
||||
* 获取Reachability单例对象,为保证全局维护一个netInfo实例,可从外部传入netInfo对象的引用
|
||||
* warn: netInfo多次实例化,有一定几率crash
|
||||
*
|
||||
*/
|
||||
+ (AlicloudReachabilityManager *)shareInstanceWithNetInfo:(CTTelephonyNetworkInfo *)netInfo;
|
||||
|
||||
/**
|
||||
* 返回当前网络状态(同步调用,可能会阻塞调用线程)
|
||||
*/
|
||||
- (AlicloudNetworkStatus)currentNetworkStatus;
|
||||
|
||||
/**
|
||||
* 返回之前网络状态
|
||||
*/
|
||||
- (AlicloudNetworkStatus)preNetworkStatus;
|
||||
|
||||
/**
|
||||
* 检测网络是否连通(同步调用,阻塞调用线程)
|
||||
*/
|
||||
- (BOOL)checkInternetConnection;
|
||||
|
||||
/**
|
||||
* 检测Wifi网络是否联通
|
||||
*/
|
||||
- (BOOL)isReachableViaWifi;
|
||||
|
||||
/**
|
||||
* 检测蜂窝网络是否联通
|
||||
*/
|
||||
- (BOOL)isReachableViaWWAN;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
//
|
||||
// AlicloudReport.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by ryan on 3/6/2016.
|
||||
// Copyright © 2016 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef AlicloudReport_h
|
||||
#define AlicloudReport_h
|
||||
|
||||
extern const NSString *EXT_INFO_KEY_VERSION;
|
||||
extern const NSString *EXT_INFO_KEY_PACKAGE;
|
||||
|
||||
// SDK标识
|
||||
typedef NS_ENUM(NSInteger, AMSService) {
|
||||
AMSMAN = 0,
|
||||
AMSHTTPDNS,
|
||||
AMSMPUSH,
|
||||
AMSMAC,
|
||||
AMSAPI,
|
||||
AMSHOTFIX,
|
||||
AMSFEEDBACK,
|
||||
AMSIM
|
||||
};
|
||||
|
||||
// 上报状态
|
||||
typedef NS_ENUM(NSInteger, AMSReportStatus) {
|
||||
AMS_UNREPORTED_STATUS,
|
||||
AMS_REPORTED_STATUS
|
||||
};
|
||||
|
||||
@interface AlicloudReport : NSObject
|
||||
|
||||
/**
|
||||
* 异步上报活跃设备统计
|
||||
*
|
||||
@param tag SDK标识
|
||||
*/
|
||||
+ (void)statAsync:(AMSService)tag;
|
||||
|
||||
/**
|
||||
* 异步上报活跃设备统计并携带附加信息
|
||||
*
|
||||
@param tag SDK标识
|
||||
@param extInfo 附加上报信息 { EXT_INFO_KEY_VERSION :"x.x.x", EXT_INFO_KEY_PACKAGE: "xxx"}
|
||||
*/
|
||||
+ (void)statAsync:(AMSService)tag extInfo:(NSDictionary *)extInfo;
|
||||
|
||||
/**
|
||||
* 获取指定SDK标识上报状态
|
||||
*
|
||||
@param tag SDK标识
|
||||
@return 返回上报状态
|
||||
*/
|
||||
+ (AMSReportStatus)getReportStatus:(AMSService)tag;
|
||||
|
||||
/**
|
||||
* 获取上报状态(兼容老版本接口)
|
||||
*
|
||||
@param tag SDK标识
|
||||
@return YES:已经上报 NO:没有上报
|
||||
*/
|
||||
+ (BOOL)isDeviceReported:(AMSService)tag;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* AlicloudReport_h */
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
//
|
||||
// AlicloudTracker.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 2017/6/30.
|
||||
// Copyright © 2017年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef AlicloudTracker_h
|
||||
#define AlicloudTracker_h
|
||||
|
||||
@interface AlicloudTracker : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *sdkId;
|
||||
@property (nonatomic, copy) NSString *sdkVersion;
|
||||
|
||||
/**
|
||||
设置Tracker的通用打点属性,每次上报都携带该参数
|
||||
|
||||
@param key 通用属性Key
|
||||
@param value 通用属性Value
|
||||
*/
|
||||
- (void)setGlobalProperty:(NSString *)key value:(NSString *)value;
|
||||
|
||||
/**
|
||||
删除Tracker通用打点属性
|
||||
|
||||
@param key 通用属性Key
|
||||
*/
|
||||
- (void)removeGlobalProperty:(NSString *)key;
|
||||
|
||||
/**
|
||||
自定义打点上报
|
||||
|
||||
@param eventName 事件名
|
||||
@param duration 时长
|
||||
@param properties 额外参数
|
||||
*/
|
||||
- (void)sendCustomHit:(NSString *)eventName
|
||||
duration:(long long)duration
|
||||
properties:(NSDictionary *)properties;
|
||||
|
||||
@end
|
||||
#endif /* AlicloudTracker_h */
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// AlicloudTrackerManager.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 2017/7/4.
|
||||
// Copyright © 2017年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef AlicloudTrackerManager_h
|
||||
#define AlicloudTrackerManager_h
|
||||
|
||||
#import "AlicloudTracker.h"
|
||||
|
||||
@interface AlicloudTrackerManager : NSObject
|
||||
|
||||
/**
|
||||
获取上报通道管理器对象,并初始化UT
|
||||
|
||||
@return 管理器对象
|
||||
*/
|
||||
+ (instancetype)getInstance;
|
||||
|
||||
/**
|
||||
根据SDK标识和版本号获取上报通道
|
||||
|
||||
@param sdkId SDK标识
|
||||
@param version SDK版本号
|
||||
@return 上报通道对象
|
||||
*/
|
||||
- (AlicloudTracker *)getTrackerBySdkId:(NSString *)sdkId version:(NSString *)version;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* AlicloudTrackerManager_h */
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// AlicloudUtils.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by lingkun on 16/5/16.
|
||||
// Copyright © 2016年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#define ALICLOUDUTILS_VERSION @"1.3.7"
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <AlicloudUtils/PublicHeader.h>
|
||||
|
||||
#import <AlicloudUtils/AlicloudReachabilityManager.h>
|
||||
#import <AlicloudUtils/EMASSecurityModeManager.h>
|
||||
#import <AlicloudUtils/EMASSecurityModeCommon.h>
|
||||
#import <AlicloudUtils/AlicloudTrackerManager.h>
|
||||
#import <AlicloudUtils/AlicloudIPv6Adapter.h>
|
||||
#import <AlicloudUtils/AlicloudHTTPDNSMini.h>
|
||||
#import <AlicloudUtils/AntilockBrakeSystem.h>
|
||||
#import <AlicloudUtils/EMASBeaconService.h>
|
||||
#import <AlicloudUtils/AlicloudTracker.h>
|
||||
#import <AlicloudUtils/AlicloudReport.h>
|
||||
#import <AlicloudUtils/EMASOptions.h>
|
||||
#import <AlicloudUtils/EMASTools.h>
|
||||
#import <AlicloudUtils/UtilLog.h>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
//
|
||||
// AntilockBrakeSystem.h
|
||||
// AntilockBrakeSystem
|
||||
//
|
||||
// Created by 地风(ElonChan) on 16/5/16.
|
||||
// Copyright © 2016年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ABSUncaughtExceptionHandler.h"
|
||||
#import "ABSBootingProtection.h"
|
||||
#import "ABSUtil.h"
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// EMASBeaconService.h
|
||||
// AlicloudBeacon
|
||||
//
|
||||
// Created by junmo on 2017/7/6.
|
||||
// Copyright © 2017年 junmo. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef EMASBeaconService_h
|
||||
#define EMASBeaconService_h
|
||||
|
||||
@interface EMASBeaconConfiguration : NSObject
|
||||
|
||||
- (instancetype)initWithData:(NSData *)data;
|
||||
- (id)getConfigureItemByKey:(NSString *)key;
|
||||
|
||||
@end
|
||||
|
||||
typedef void (^AlicloudBeaconCallbackHandler)(BOOL res, NSError *error);
|
||||
|
||||
@interface EMASBeaconService : NSObject
|
||||
|
||||
- (instancetype)initWithAppKey:(NSString *)appKey
|
||||
appSecret:(NSString *)appSecret
|
||||
SDKVersion:(NSString *)SDKVersion
|
||||
SDKID:(NSString *)SDKID;
|
||||
|
||||
- (instancetype)initWithAppKey:(NSString *)appKey
|
||||
appSecret:(NSString *)appSecret
|
||||
SDKVersion:(NSString *)SDKVersion
|
||||
SDKID:(NSString *)SDKID
|
||||
extension:(NSDictionary *)extension;
|
||||
|
||||
- (void)enableLog:(BOOL)enabled;
|
||||
- (BOOL)isLogEnabled;
|
||||
|
||||
//- (void)getBeaconConfigByKey:(NSString *)key
|
||||
// completionHandler:(void(^)(EMASBeaconConfiguration *configuration, NSError *error))completionHandler;
|
||||
|
||||
- (void)getBeaconConfigStringByKey:(NSString *)key
|
||||
completionHandler:(void(^)(NSString *result, NSError *error))completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* EMASBeaconService_h */
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// EMASOptions.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 2018/3/16.
|
||||
// Copyright © 2018年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef EMASOptions_h
|
||||
#define EMASOptions_h
|
||||
|
||||
@interface EMASOptionSDKServiceItem : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *sdkId;
|
||||
@property (nonatomic, copy) NSString *version;
|
||||
@property (nonatomic, assign) NSNumber *status;
|
||||
|
||||
@end
|
||||
|
||||
@interface EMASOptions : NSObject
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *emasAppKey;
|
||||
@property (nonatomic, copy, readonly) NSString *emasAppSecret;
|
||||
@property (nonatomic, copy, readonly) NSString *emasBundleId;
|
||||
@property (nonatomic, copy, readonly) NSString *hotfixIdSecret;
|
||||
@property (nonatomic, copy, readonly) NSString *hotfixRsaSecret;
|
||||
@property (nonatomic, copy, readonly) NSString *tlogRsaSecret;
|
||||
@property (nonatomic, copy, readonly) NSString *httpdnsAccountId;
|
||||
@property (nonatomic, copy, readonly) NSString *httpdnsSecretKey;
|
||||
|
||||
+ (EMASOptions *)defaultOptions;
|
||||
- (NSString *)optionByConfigKey:(NSString *)key;
|
||||
- (EMASOptionSDKServiceItem *)sdkServiceItemForSdkId:(NSString *)sdkId;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* EMASOptions_h */
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// EMASSecurityModeCommon.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 2018/3/11.
|
||||
// Copyright © 2018年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef EMASSecurityModeCommon_h
|
||||
#define EMASSecurityModeCommon_h
|
||||
|
||||
typedef void (^SDKCheckSuccessHandler)(void);
|
||||
typedef void (^SDKCheckCrashHandler)(NSUInteger crashCount);
|
||||
|
||||
#endif /* EMASSecurityModeCommon_h */
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// EMASSecurityModeManager.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 2018/3/10.
|
||||
// Copyright © 2018年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef EMASSecurityModeManager_h
|
||||
#define EMASSecurityModeManager_h
|
||||
|
||||
#import "EMASSecurityModeCommon.h"
|
||||
|
||||
@interface EMASSecurityModeManager : NSObject
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
- (void)registerSDKComponentAndStartCheck:(NSString *)sdkId
|
||||
sdkVersion:(NSString *)sdkVersion
|
||||
appKey:(NSString *)appKey
|
||||
appSecret:(NSString *)appSecret
|
||||
sdkCrashThreshold:(NSUInteger)crashTimesThreshold
|
||||
onSuccess:(SDKCheckSuccessHandler)successHandler
|
||||
onCrash:(SDKCheckCrashHandler)crashHandler;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* EMASSecurityModeManager_h */
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
//
|
||||
// EMASTools.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 2018/3/14.
|
||||
// Copyright © 2018年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef EMASTools_h
|
||||
#define EMASTools_h
|
||||
|
||||
#define EMAS_SYNC_EXECUTE_BY_KEY(key, executor)\
|
||||
[EMASTools syncExecuteBlockByKey:key block:executor];\
|
||||
|
||||
#define EMAS_SYNC_EXECUTE_BY_QUEUE(queue, executor)\
|
||||
[EMASTools syncExecuteBlockByQueue:queue block:executor];\
|
||||
|
||||
@interface EMASTools : NSObject
|
||||
|
||||
+ (BOOL)isValidString:(id)obj;
|
||||
+ (BOOL)isValidDictionary:(id)obj;
|
||||
+ (BOOL)isValidArray:(id)obj;
|
||||
|
||||
+ (NSString *)md5:(NSString *)str;
|
||||
+ (NSString *)sha1:(NSString *)str;
|
||||
+ (NSString *)hmacSha1:(NSString *)str key:(NSString *)key;
|
||||
+ (NSString *)base64EncodedWithString:(NSString *)str;
|
||||
+ (NSString *)base64DecodedWithString:(NSString *)base64Str;
|
||||
+ (NSData *)aes128CBCEncrypt:(NSData *)data key:(NSData *)key iv:(char *)iv;
|
||||
+ (NSString *)URLEncodedString:(NSString *)str;
|
||||
|
||||
+ (NSString *)convertObjectToJsonString:(id)obj;
|
||||
+ (id)convertJsonStringToObject:(NSString *)jsonStr;
|
||||
+ (id)convertJsonDataToObject:(NSData *)jsonData;
|
||||
|
||||
+ (NSString *)convertDateToGMT0String:(NSDate *)date;
|
||||
+ (NSString *)convertDateToGMT8String:(NSDate *)date;
|
||||
|
||||
+ (void)swizzleClassMethod:(Class)cls originSEL:(SEL)originSEL swizzleSEL:(SEL)swizzleSEL;
|
||||
+ (void)swizzleInstanceMethod:(Class)cls originSEL:(SEL)originSEL swizzleSEL:(SEL)swizzleSEL;
|
||||
|
||||
+ (BOOL)isIPv4Address:(NSString *)addr;
|
||||
+ (BOOL)isIPv6Address:(NSString *)addr;
|
||||
|
||||
+ (dispatch_queue_t)createQueueIfNotExists:(NSString *)key;
|
||||
+ (void)syncExecuteBlockByKey:(NSString *)key block:(void(^)(void))block;
|
||||
+ (void)syncExecuteBlockByQueue:(dispatch_queue_t)queue block:(void(^)(void))block;
|
||||
|
||||
+ (NSString *)bundleIdForApp;
|
||||
+ (NSString *)deviceBrand;
|
||||
+ (NSString *)deviceModel;
|
||||
|
||||
+ (void)threadWaitForSec:(double)sec;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* EMASTools_h */
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// UtilLog.h
|
||||
// AlicloudUtils
|
||||
//
|
||||
// Created by junmo on 16/11/24.
|
||||
// Copyright © 2016年 Ali. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef UtilLog_h
|
||||
#define UtilLog_h
|
||||
|
||||
@interface UtilLog : NSObject
|
||||
|
||||
+ (void)enableLog;
|
||||
|
||||
+ (BOOL)isLogEnabled;
|
||||
|
||||
#define UtilLogD(tag, frmt, ...)\
|
||||
if ([UtilLog isLogEnabled]) {\
|
||||
NSLog(@"[%@]-[D]: %@", tag, [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
|
||||
}
|
||||
|
||||
#define UtilLogI(tag, frmt, ...)\
|
||||
if ([UtilLog isLogEnabled]) {\
|
||||
NSLog(@"[%@]-[I]: %@", tag, [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
|
||||
}
|
||||
|
||||
#define UtilLogE(tag, frmt, ...)\
|
||||
if ([UtilLog isLogEnabled]) {\
|
||||
NSLog(@"[%@]-[E]: %@", tag, [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
|
||||
}
|
||||
@end
|
||||
|
||||
#endif /* UtilLog_h */
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
framework module AlicloudUtils {
|
||||
umbrella header "AlicloudUtils.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// CCPSysMessage.h
|
||||
// CloudPushSDK
|
||||
//
|
||||
// Created by wuxiang on 15/5/18.
|
||||
// Copyright (c) 2015年 aliyun. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CCPSysMessage : NSObject
|
||||
|
||||
@property UInt8 messageType;// 消息类型
|
||||
@property NSData *title; // 标题
|
||||
@property NSData *body; // 内容
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// CloudPushCallbackResult.h
|
||||
// CloudPushSDK
|
||||
//
|
||||
// Created by lingkun on 16/6/16.
|
||||
// Copyright © 2016年 aliyun.mobileService. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef CloudPushCallbackResult_h
|
||||
#define CloudPushCallbackResult_h
|
||||
|
||||
@interface CloudPushCallbackResult : NSObject
|
||||
|
||||
@property(nonatomic, readonly) BOOL success;
|
||||
|
||||
@property(nonatomic, readonly, nullable) id data;
|
||||
|
||||
@property(nonatomic, readonly, nullable) NSError *error;
|
||||
|
||||
+ (nonnull instancetype)resultWithData:(nullable id)data;
|
||||
|
||||
+ (nonnull instancetype)resultWithError:(nullable NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* CloudPushCallbackResult_h */
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
//
|
||||
// CloudPushSDK.h
|
||||
// CloudPushSDK
|
||||
//
|
||||
// Created by junmo on 16/7/26.
|
||||
// Copyright © 2016年 aliyun.mobileService. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "CCPSysMessage.h"
|
||||
#import "MPGerneralDefinition.h"
|
||||
|
||||
/* SDK版本号 */
|
||||
#define MPUSH_IOS_SDK_VERSION @"1.9.9"
|
||||
|
||||
@interface CloudPushSDK : NSObject
|
||||
|
||||
/**
|
||||
Push SDK初始化
|
||||
无需手动配置appKey/appSecret
|
||||
|
||||
@param callback 回调
|
||||
*/
|
||||
+ (void)autoInit:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* Push SDK初始化
|
||||
*
|
||||
* @param appKey appKey
|
||||
* @param appSecret appSecret
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)asyncInit:(NSString *)appKey
|
||||
appSecret:(NSString *)appSecret
|
||||
callback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 打开调试日志
|
||||
*/
|
||||
+ (void)turnOnDebug;
|
||||
|
||||
/**
|
||||
* 获取本机的deviceId (deviceId为推送系统的设备标识)
|
||||
*
|
||||
* @return deviceId
|
||||
*/
|
||||
+ (NSString *)getDeviceId;
|
||||
|
||||
/**
|
||||
* 返回SDK版本
|
||||
*
|
||||
* @return SDK版本
|
||||
*/
|
||||
+ (NSString *)getVersion;
|
||||
|
||||
/**
|
||||
* 返回推送通道的状态
|
||||
*
|
||||
* @return 通道状态
|
||||
*/
|
||||
+ (BOOL)isChannelOpened;
|
||||
|
||||
/**
|
||||
* 返回推送通知ACK到服务器
|
||||
*
|
||||
* @param userInfo 通知相关信息
|
||||
*/
|
||||
+ (void)sendNotificationAck:(NSDictionary *)userInfo;
|
||||
|
||||
/**
|
||||
* 返回推送通知ACK到服务器 (该通知为App处于关闭状态时接收,点击后启动App)
|
||||
* v1.8.1版本之后,由sendNotificationAck替代
|
||||
* @param launchOptions 通知相关信息
|
||||
*/
|
||||
+ (void)handleLaunching:(NSDictionary *)launchOptions DEPRECATED_MSG_ATTRIBUTE("Use 'sendNotificationAck:' instead");
|
||||
|
||||
/**
|
||||
* 返回推送通知ACK到服务器 (该通知为App处于开启状态时接收)
|
||||
* v1.8.1版本之后,由sendNotificationAck替代
|
||||
* @param userInfo 通知相关信息
|
||||
*/
|
||||
+ (void)handleReceiveRemoteNotification:(NSDictionary *)userInfo DEPRECATED_MSG_ATTRIBUTE("Use 'sendNotificationAck:' instead");
|
||||
|
||||
/**
|
||||
* 绑定账号
|
||||
*
|
||||
* @param account 账号名
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)bindAccount:(NSString *)account
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 解绑账号
|
||||
*
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)unbindAccount:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 向指定目标添加自定义标签
|
||||
* 支持向本设备/本设备绑定账号/别名添加自定义标签,目标类型由target指定
|
||||
* @param target 目标类型,1:本设备 2:本设备绑定账号 3:别名
|
||||
* @param tags 标签名
|
||||
* @param alias 别名(仅当target = 3时生效)
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)bindTag:(int)target
|
||||
withTags:(NSArray *)tags
|
||||
withAlias:(NSString *)alias
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 删除指定目标的自定义标签
|
||||
* 支持从本设备/本设备绑定账号/别名删除自定义标签,目标类型由target指定
|
||||
* @param target 目标类型,1:本设备 2:本设备绑定账号 3:别名
|
||||
* @param tags 标签名
|
||||
* @param alias 别名(仅当target = 3时生效)
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)unbindTag:(int)target
|
||||
withTags:(NSArray *)tags
|
||||
withAlias:(NSString *)alias
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 查询绑定标签,查询结果可从callback的data中获取
|
||||
*
|
||||
* @param target 目标类型,1:本设备(当前仅支持查询本设备绑定标签)
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)listTags:(int)target
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 给当前设备打别名
|
||||
*
|
||||
* @param alias 别名名称
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)addAlias:(NSString *)alias
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 删除当前设备的指定别名
|
||||
* 当alias为nil or length = 0时,删除当前设备绑定所有别名
|
||||
* @param alias 别名名称
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)removeAlias:(NSString *)alias
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 查询本设备绑定别名,查询结果可从callback的data中获取
|
||||
*
|
||||
* @param callback 回调
|
||||
*/
|
||||
+ (void)listAliases:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 向阿里云推送注册该设备的deviceToken
|
||||
*
|
||||
* @param deviceToken 苹果APNs服务器返回的deviceToken
|
||||
*/
|
||||
+ (void)registerDevice:(NSData *)deviceToken
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
/**
|
||||
* 获取APNs返回的deviceToken
|
||||
*
|
||||
* @return deviceToken
|
||||
*/
|
||||
+ (NSString *)getApnsDeviceToken;
|
||||
|
||||
/**
|
||||
同步设备通知角标数到推送服务器
|
||||
|
||||
@param num badge数,取值范围[0,99999]
|
||||
@param callback 回调
|
||||
*/
|
||||
+ (void)syncBadgeNum:(NSUInteger)num
|
||||
withCallback:(CallbackHandler)callback;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// MPGerneralDefinition.h
|
||||
// CloudPushSDK
|
||||
//
|
||||
// Created by junmo on 16/10/11.
|
||||
// Copyright © 2016年 aliyun.mobileService. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef MPGerneralDefinition_h
|
||||
#define MPGerneralDefinition_h
|
||||
|
||||
#import "CloudPushCallbackResult.h"
|
||||
|
||||
typedef void (^CallbackHandler)(CloudPushCallbackResult *res);
|
||||
|
||||
// 保证callback不为空且回调不在主线程上执行
|
||||
#define NotNilCallback(funcName, paras)\
|
||||
if (funcName) {\
|
||||
if ([NSThread isMainThread]) {\
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\
|
||||
funcName(paras);\
|
||||
});\
|
||||
} else {\
|
||||
funcName(paras);\
|
||||
}\
|
||||
}
|
||||
|
||||
#endif /* MPGerneralDefinition_h */
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
framework module CloudPushSDK {
|
||||
umbrella header "CloudPushSDK.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
//
|
||||
// UTDevice.h
|
||||
//
|
||||
//
|
||||
// Created by Alvin on 4/21/13.
|
||||
//
|
||||
// 设备信息的分装类:sdk合作开发需要用这个类提供的设备信息接口
|
||||
|
||||
// Version:utdid4all-1.1.0
|
||||
|
||||
#ifndef UTDIDDevice_h
|
||||
#define UTDIDDevice_h
|
||||
|
||||
#import "AidProtocol.h"
|
||||
|
||||
@interface UTDevice : NSObject
|
||||
|
||||
/**
|
||||
* @brief 获取SDK生成的设备唯一标识.
|
||||
*
|
||||
* @warning 调用说明:这个设备唯一标识是持久的,并且格式安全,iOS6以及以下,多应用互通.
|
||||
*
|
||||
* 调用顺序:utdid任意时刻都可以调用.
|
||||
*
|
||||
* @return 24字节的设备唯一标识.
|
||||
*/
|
||||
+(NSString *) utdid;
|
||||
|
||||
/**
|
||||
* @brief 同步获得AID.
|
||||
*
|
||||
* @warning 调用说明:若本地端没有最新AID,将耗费远程通信时间并阻塞线程,建议将此调用置于非主线程,或使用{@link getAidAsync}异步获得AID。
|
||||
*
|
||||
* 调用顺序:aid任意时刻都可以调用.
|
||||
*
|
||||
* @return AID.
|
||||
*/
|
||||
+(NSString *) aid:(NSString *)appName
|
||||
token:(NSString *)token;
|
||||
|
||||
/**
|
||||
* @brief 异步请求AID.
|
||||
*
|
||||
* @warning 调用说明:若本地端没有最新AID,将建立异步请求获得AID,
|
||||
*
|
||||
* 调用顺序:aidAsync任意时刻都可以调用.
|
||||
*
|
||||
*/
|
||||
+(void) aidAsync:(NSString *)appName
|
||||
token:(NSString *)token
|
||||
aidDelegate:(id<AidProtocolDelegate>)aidDelegate;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?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>BuildMachineOSBuild</key>
|
||||
<string>17A405</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>UTDID</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>Taobao.UTDID</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>UTDID</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.0.17-SNAPSHOT</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>iPhoneOS</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>15A372</string>
|
||||
<key>DTPlatformName</key>
|
||||
<string>iphoneos</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>11.0</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>15A372</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>iphoneos11.0</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0900</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>9A235</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>4.3</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// AppMonitorSDK.h
|
||||
// AppMonitorSDK
|
||||
//
|
||||
// Created by junzhan on 14-9-9.
|
||||
// Copyright (c) 2014年 君展. All rights reserved.
|
||||
// 接口类
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "AppMonitorTable.h"
|
||||
#import "AppMonitorAlarm.h"
|
||||
#import "AppMonitorCounter.h"
|
||||
#import "AppMonitorStat.h"
|
||||
|
||||
@interface AppMonitor : NSObject
|
||||
|
||||
+ (BOOL)isInit;
|
||||
|
||||
+ (BOOL) isUTInit;
|
||||
|
||||
+ (void) setUTInit;
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
/*
|
||||
* 设置采样率配置
|
||||
* @param jsonStr JSON串
|
||||
*/
|
||||
+ (void)setSamplingConfigWithJson:(NSString *)jsonStr;
|
||||
|
||||
/**
|
||||
* 关闭采样,紧开发调试用。线上版本请勿调用此API
|
||||
*/
|
||||
+ (void)disableSample;
|
||||
|
||||
/**
|
||||
* 设置采样率(默认是 50%) 值范围在[0~10000] (0表示不上传,10000表示100%上传,5000表示50%上传)
|
||||
*/
|
||||
+ (void)setSampling:(NSString *)sampling;
|
||||
|
||||
////是否开启实时调试模式(与UT同步)
|
||||
+ (BOOL)isTurnOnRealTimeDebug;
|
||||
+ (NSString*)realTimeDebugUploadUrl;
|
||||
+ (NSString*)realTimeDebugId;
|
||||
|
||||
+(void) turnOnAppMonitorRealtimeDebug:(NSDictionary *) pDict;
|
||||
+(void) turnOffAppMonitorRealtimeDebug;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// UT.h
|
||||
// miniUTSDK
|
||||
//
|
||||
// Created by 宋军 on 15/5/19.
|
||||
// Copyright (c) 2015年 ___SONGJUN___. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UT : NSObject
|
||||
|
||||
////=====================================h5&Native接口=====================================
|
||||
/**
|
||||
* @brief h5&Native打通
|
||||
*
|
||||
* @warning 调用说明:由windwave封装,供aplus_wap.js调用
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param dataDict aplus_wap.js采集的h5信息都通过该字典传进来,该字典中必须有key(funcType)
|
||||
* 用来区分采集的是哪个事件信息,比如funcType=2001,则h5UT内部会调用
|
||||
* pageEnter来处理,funcType=2101,则调用ctrlClicked处理
|
||||
*
|
||||
*/
|
||||
+(void) h5UT:(NSDictionary *) dataDict view:(UIView *) pView viewController:(UIViewController *) pViewController;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
//
|
||||
// UTAnalytics.h
|
||||
// miniUTInterface
|
||||
//
|
||||
// Created by 宋军 on 14-10-14.
|
||||
// Copyright (c) 2014年 ___SONGJUN___. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "UTTracker.h"
|
||||
#import "UTIRequestAuthentication.h"
|
||||
#import "UTICrashCaughtListener.h"
|
||||
|
||||
@interface UTAnalytics : NSObject
|
||||
|
||||
|
||||
+ (void) turnOnDev2;
|
||||
|
||||
/**
|
||||
* 单例初始化时,不再会从安全图片和指令plist读取appkey
|
||||
*
|
||||
* @return 返回UTAnalytics单例
|
||||
*
|
||||
*/
|
||||
+(UTAnalytics *) getInstance;
|
||||
|
||||
|
||||
/**
|
||||
* 老接口兼容:接口方式设置主app级appkey/appsecret对
|
||||
* 重复设置抛异常
|
||||
*
|
||||
* @param appKey 主app级的appkey
|
||||
*
|
||||
* @param secret 主app级的appsecret
|
||||
*
|
||||
*/
|
||||
- (void)setAppKey:(NSString *)appKey secret:(NSString *)secret;
|
||||
|
||||
|
||||
/**
|
||||
* 新接口1:从安全图片读取出appkey后,塞給ut,作为主app级的appkey
|
||||
* 重复设置抛异常
|
||||
*
|
||||
* @param appKey 主app级的appkey
|
||||
*
|
||||
* @param authocode 多图片时的后缀;为nil时,对应默认图片
|
||||
*
|
||||
*/
|
||||
- (void)setAppKey4APP:(NSString *)appKey authcode:(NSString *)authcode;
|
||||
|
||||
|
||||
/**
|
||||
* 新接口2:接口方式设置SDK级appkey/appsecret对
|
||||
* !!!请注意:只设置了SDK级appkey,埋点方法(UTTracker *) getTracker:(NSString *) pTrackId将不起作用
|
||||
* !!!请注意:一定要先设置了主app级appkey,埋点方法(UTTracker *) getTracker:(NSString *) pTrackId才会作用
|
||||
*
|
||||
* @param appKey SDK级的appkey
|
||||
*
|
||||
* @param secret SDK级的appsecret
|
||||
*
|
||||
*/
|
||||
- (void)setAppKey4SDK:(NSString *)appKey secret:(NSString *)secret;
|
||||
|
||||
|
||||
/**
|
||||
* 新接口3:从安全图片读取出appkey后,塞給ut,作为SDK级的appkey
|
||||
* !!!请注意:只设置了SDK级appkey,埋点方法(UTTracker *) getTracker:(NSString *) pTrackId将不起作用
|
||||
* !!!请注意:一定要先设置了主app级appkey,埋点方法(UTTracker *) getTracker:(NSString *) pTrackId才会作用
|
||||
*
|
||||
* @param appKey SDK级的appkey
|
||||
*
|
||||
* @param authocode 多图片时的后缀;为nil时,对应默认图片
|
||||
*
|
||||
*/
|
||||
- (void)setAppKey4SDK:(NSString *)appKey authcode:(NSString *)authcode;
|
||||
|
||||
|
||||
+ (void)setDailyEnvironment __deprecated;
|
||||
|
||||
/**
|
||||
* 老接口:对主app级的appkey设置appversion
|
||||
*
|
||||
* @param pAppVersion app级的appversion
|
||||
*
|
||||
*/
|
||||
-(void) setAppVersion:(NSString *) pAppVersion;
|
||||
|
||||
|
||||
-(void) setChannel:(NSString *) pChannel;
|
||||
|
||||
-(void) updateUserAccount:(NSString *) pNick userid:(NSString *) pUserId;
|
||||
|
||||
-(void) userRegister:(NSString *) pUsernick;
|
||||
|
||||
-(void) updateSessionProperties:(NSDictionary *) pDict;
|
||||
|
||||
|
||||
/**
|
||||
* 老接口兼容:获取默认的UTTracker.
|
||||
* 如果设置了app级的appkey,默认的tracker对应app级的生产者
|
||||
* 如果只设置了sdk级的appkey,默认的tracker为空,返回第一个设置appkey的对应生产者
|
||||
*
|
||||
* @return 默认的UTTracker
|
||||
*
|
||||
*/
|
||||
-(UTTracker *) getDefaultTracker;
|
||||
|
||||
|
||||
/**
|
||||
* 老接口兼容:返回trackid对应的UTTracker.
|
||||
* 只能已经设置主app级appkey的前提下,才能有效设置并返回
|
||||
*
|
||||
* @param pTrackId 主app级的trackid
|
||||
*
|
||||
* @return 返回trackid对应的UTTracker
|
||||
*
|
||||
*/
|
||||
-(UTTracker *) getTracker:(NSString *) pTrackId;
|
||||
|
||||
|
||||
/**
|
||||
* 新接口:获取sdk级对应的UTTracker.
|
||||
* 只有已经设置对应的sdk级的appkey的前提下,才能有效返回
|
||||
*
|
||||
* @param pAppkey SDK级的appkey
|
||||
*
|
||||
* @return sdk级对应的UTTracker
|
||||
*
|
||||
*/
|
||||
-(UTTracker *) getTracker4SDK:(NSString *) pAppkey;
|
||||
|
||||
-(void) turnOnDebug;
|
||||
|
||||
-(void) turnOnDev;
|
||||
|
||||
// 以下接口功能已废弃,接口保留
|
||||
-(void) setRequestAuthentication:(id<UTIRequestAuthentication>) pRequestAuth __deprecated;
|
||||
|
||||
- (void)onCrashHandler;
|
||||
|
||||
-(void) turnOffCrashHandler;
|
||||
|
||||
-(void) setCrashCaughtListener:(id<UTICrashCaughtListener>) aListener;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
//
|
||||
// UTTracker.h
|
||||
// miniUTInterface
|
||||
//
|
||||
// Created by 宋军 on 14-10-14.
|
||||
// Copyright (c) 2014年 ___SONGJUN___. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
//#import <UIKit/UIViewController.h>
|
||||
//#import <UIKit/UIWebView.h>
|
||||
@class UTDSDKInfo;
|
||||
|
||||
typedef enum _UTPageStatus{
|
||||
UT_H5_IN_WebView//设置容器中的H5页面事件的eventid为2001,不设置默认为2006
|
||||
} UTPageStatus;
|
||||
|
||||
@interface UTTracker : NSObject
|
||||
|
||||
@property (readonly,copy) UTDSDKInfo * mSdkinfo;
|
||||
|
||||
-(id) initWithTrackId:(NSString *) pTrackId __deprecated;
|
||||
|
||||
-(id) initWithAppKey:(NSString *) pAppkey
|
||||
appsecret:(NSString *) pAppSecret
|
||||
authcode:(NSString *) pAuthCode
|
||||
securitySign:(BOOL) securitySign;
|
||||
|
||||
-(id) initWithTracker:(UTTracker *) pTracker trackid:(NSString *) pTrackId;
|
||||
|
||||
-(NSString *) getAppKey;
|
||||
|
||||
-(void) setGlobalProperty:(NSString *) pKey value:(NSString *) pValue;
|
||||
|
||||
-(void) removeGlobalProperty:(NSString *) pKey;
|
||||
|
||||
-(NSString *) getGlobalProperty:(NSString *) pKey;
|
||||
|
||||
-(void) send:(NSDictionary *) pLogDict;
|
||||
|
||||
#pragma mark 页面埋点
|
||||
/**
|
||||
* @brief 页面进入.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
*
|
||||
* @warning 调用说明:1.必须和pageDisAppear配对使用,否则不会成功埋点
|
||||
* 2.确定页面名称优先级:updatePageName > NSStringFromClass(pObject.class)
|
||||
*
|
||||
* 最佳位置:若是viewcontroller页面,则需在viewDidAppear函数内调用
|
||||
*/
|
||||
-(void) pageAppear:(id) pPageObject;
|
||||
|
||||
/**
|
||||
* @brief 页面进入.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
* @param pPageName 页面名称,如Page_Detail
|
||||
*
|
||||
* @warning 调用说明:1.必须和pageDisAppear配对使用,否则不会成功埋点
|
||||
* 2.确定页面名称优先级:updatePageName > pPageName > NSStringFromClass(pObject.class)
|
||||
* 若当调用pageAppear时已知页面名称,强烈建议使用该接口
|
||||
* 最佳位置:若是viewcontroller页面,则需在viewDidAppear函数内调用
|
||||
*/
|
||||
-(void) pageAppear:(id) pPageObject withPageName:(NSString *) pPageName;
|
||||
|
||||
/**
|
||||
* @brief 页面离开.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
*
|
||||
* @warning 调用说明:必须和pageAppear配对使用,否则不会成功埋点
|
||||
*
|
||||
* 最佳位置:若是viewcontroller页面,则需在viewDidDisAppear函数内调用
|
||||
*/
|
||||
-(void) pageDisAppear:(id) pPageObject;
|
||||
|
||||
/**
|
||||
* @brief 更新页面业务参数.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
* @param pProperties 业务参数,kv对
|
||||
*
|
||||
* @warning 调用说明:必须在pageDisAppear之前调用
|
||||
*
|
||||
* 最佳位置:在pageDisAppear之前调用即可
|
||||
*/
|
||||
-(void) updatePageProperties:(id) pPageObject properties:(NSDictionary *) pProperties;
|
||||
|
||||
/**
|
||||
* @brief 更新页面业务参数.
|
||||
*
|
||||
* @param pProperties 传给下一个页面业务参数,kv对
|
||||
*
|
||||
* @warning 调用说明:必须在下一个页面pageAppear之前调用,否则会携带错误
|
||||
*
|
||||
* 最佳位置:必须在下一个页面pageAppear之前调用
|
||||
*/
|
||||
-(void) updateNextPageProperties:(NSDictionary *) pProperties;
|
||||
|
||||
#pragma mark 页面埋点的辅助函数
|
||||
/**
|
||||
* @brief 更新页面名称.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
* @param pPageName 更新后的页面名称
|
||||
*
|
||||
* @warning 调用说明:只有当调用pageAppear时还未知页面名称,后续可使用该接口更新
|
||||
*
|
||||
* 最佳位置:在pageDisAppear之前调用
|
||||
*/
|
||||
-(void) updatePageName:(id) pPageObject pageName:(NSString *) pPageName;
|
||||
|
||||
/**
|
||||
* @brief 更新页面url.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
* @param pUrl 页面对应的url
|
||||
*
|
||||
* @warning 调用说明:如手淘统一导航将每次页面跳转的url塞给对应的viewcontroller
|
||||
*
|
||||
* 最佳位置:在pageDisAppear之前调用
|
||||
*/
|
||||
-(void) updatePageUrl:(id) pPageObject url:(NSURL *) pUrl;
|
||||
|
||||
/**
|
||||
* @brief 更新页面状态.
|
||||
*
|
||||
* @param pPageObject 页面对象,如viewcontroller指针
|
||||
* @param aStatus 页面状态 enum类型
|
||||
*
|
||||
* @warning 调用说明:告知页面处于某些特殊的业务场景,如回退等
|
||||
*
|
||||
* 最佳位置:必须在pageAppear之前调用
|
||||
*/
|
||||
-(void) updatePageStatus:(id) pPageObject status:(UTPageStatus) aStatus;
|
||||
|
||||
|
||||
-(void) skipPage:(id) pPageObject;
|
||||
|
||||
- (void) ctrlClicked:(NSString *)controlName onPage:(NSObject *) pageName args:(NSDictionary *) dict;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?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>BuildMachineOSBuild</key>
|
||||
<string>17A405</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>UTMini</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.taobao.junzhan.UTMini</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>UTMini</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.2.0.2-appkeys-SNAPSHOT</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>iPhoneOS</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>15A372</string>
|
||||
<key>DTPlatformName</key>
|
||||
<string>iphoneos</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>11.0</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>15A372</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>iphoneos11.0</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0900</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>9A235</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>5.0</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
|
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 765 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 765 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
|
Before Width: | Height: | Size: 1011 B After Width: | Height: | Size: 1011 B |