Skip to content

Commit aff5194

Browse files
author
Wonday
committed
update aliyunpush SDK Android (3.1.0)iOS (1.9.6)
1 parent cd3bd88 commit aff5194

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1402
-40
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ import com.alibaba.sdk.android.push.register.MiPushRegister;
150150
- AlicloudUtils.framework
151151
- CloudPushSDK.framework
152152
- UTDID.framework
153+
- UTMini.framework
153154

154155
3. 点击项目根节点,在targets app的属性BuildPhase的Link Binary With Libraries中添加公共包依赖
155156

1.59 MB
Binary file not shown.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
//
2+
// ABSBootingProtection.h
3+
// AntilockBrakeSystem
4+
//
5+
// Created by 地风(ElonChan) on 16/5/16.
6+
// Copyright © 2016年 Ali. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
typedef void (^ABSBoolCompletionHandler)(BOOL succeeded, NSError *error);
12+
typedef void (^ABSRepairBlock)(ABSBoolCompletionHandler completionHandler);
13+
typedef void (^ABSReportBlock)(NSUInteger crashCounts);
14+
15+
typedef NS_ENUM(NSInteger, ABSBootingProtectionStatus) {
16+
ABSBootingProtectionStatusNormal, /**< APP 启动正常 */
17+
ABSBootingProtectionStatusNormalChecking, /**< 正在检测是否会在特定时间内是否会 Crash,注意:检测状态下“连续启动崩溃计数”个数小于或等于上限值 */
18+
ABSBootingProtectionStatusNeedFix, /**< APP 出现连续启动 Crash,需要采取修复措施 */
19+
ABSBootingProtectionStatusFixing, /**< APP 出现连续启动 Crash,正在修复中... */
20+
};
21+
22+
/**
23+
* 启动连续 crash 保护。
24+
* 启动后 `_crashOnLaunchTimeIntervalThreshold` 秒内 crash,反复超过 `_continuousCrashOnLaunchNeedToReport` 次则上报日志,超过 `_continuousCrashOnLaunchNeedToFix` 则启动修复操作。
25+
*/
26+
@interface ABSBootingProtection : NSObject
27+
28+
/**
29+
* 启动连续 crash 保护方法。
30+
* 前置条件:在 App 启动时注册 crash 处理函数,在 crash 时调用[ABSBootingProtection addCrashCountIfNeeded]。
31+
* 启动后一定时间内(`crashOnLaunchTimeIntervalThreshold`秒内)crash,反复超过一定次数(`continuousCrashOnLaunchNeedToReport`次)则上报日志,超过一定次数(`continuousCrashOnLaunchNeedToFix`次)则启动修复程序;在一定时间内(`crashOnLaunchTimeIntervalThreshold`秒) 秒后若没有 crash 将“连续启动崩溃计数”计数置零。
32+
`reportBlock` 上报逻辑,
33+
`repairtBlock` 修复逻辑,完成后执行 `[self setCrashCount:0]`
34+
35+
*/
36+
- (void)launchContinuousCrashProtect;
37+
38+
/*!
39+
* 当前启动Crash的状态
40+
*/
41+
@property (nonatomic, assign, readonly) ABSBootingProtectionStatus bootingProtectionStatus;
42+
43+
/*!
44+
* 达到需要执行上报操作的“连续启动崩溃计数”个数。
45+
*/
46+
@property (nonatomic, assign, readonly) NSUInteger continuousCrashOnLaunchNeedToReport;
47+
48+
/*!
49+
* 达到需要执行修复操作的“连续启动崩溃计数”个数。
50+
*/
51+
@property (nonatomic, assign, readonly) NSUInteger continuousCrashOnLaunchNeedToFix;
52+
53+
/*!
54+
* APP 启动后经过多少秒,可以将“连续启动崩溃计数”清零
55+
*/
56+
@property (nonatomic, assign, readonly) NSTimeInterval crashOnLaunchTimeIntervalThreshold;
57+
58+
/*!
59+
* 借助 context 可以让多个模块注册事件,并且事件 block 能独立执行,互不干扰。
60+
*/
61+
@property (nonatomic, copy, readonly) NSString *context;
62+
63+
/*!
64+
* @details 启动后kCrashOnLaunchTimeIntervalThreshold秒内crash,反复超过continuousCrashOnLaunchNeedToReport次则上报日志,超过continuousCrashOnLaunchNeedToFix则启动修复程序;当所有操作完成后,执行 completion。在 crashOnLaunchTimeIntervalThreshold 秒后若没有 crash 将 kContinuousCrashOnLaunchCounterKey 计数置零。
65+
* @param context 借助 context 可以让多个模块注册事件,并且事件 block 能独立执行,互不干扰。
66+
*/
67+
- (instancetype)initWithContinuousCrashOnLaunchNeedToReport:(NSUInteger)continuousCrashOnLaunchNeedToReport
68+
continuousCrashOnLaunchNeedToFix:(NSUInteger)continuousCrashOnLaunchNeedToFix
69+
crashOnLaunchTimeIntervalThreshold:(NSTimeInterval)crashOnLaunchTimeIntervalThreshold
70+
context:(NSString *)context;
71+
/*!
72+
* 当前“连续启动崩溃“的状态
73+
*/
74+
+ (ABSBootingProtectionStatus)bootingProtectionStatusWithContext:(NSString *)context continuousCrashOnLaunchNeedToFix:(NSUInteger)continuousCrashOnLaunchNeedToFix;
75+
76+
/*!
77+
* 设置上报逻辑,参数 crashCounts 为启动连续 crash 次数
78+
*/
79+
- (void)setReportBlock:(ABSReportBlock)reportBlock;
80+
81+
/*!
82+
* 设置修复逻辑
83+
*/
84+
- (void)setRepairBlock:(ABSRepairBlock)repairtBlock;
85+
86+
@end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// ABSUncaughtExceptionHandler.h
3+
// AntilockBrakeSystem
4+
//
5+
// Created by 地风(ElonChan) on 16/5/16.
6+
// Copyright © 2016年 Ali. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
typedef void (^ABSUncaughtExceptionCallback)(NSException *exception);
11+
12+
@interface ABSUncaughtExceptionHandler : NSObject
13+
14+
+ (void)registerExceptionHandlerWithCallback:(ABSUncaughtExceptionCallback)callback;
15+
16+
@end
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// ABSUtil.h
3+
// AntilockBrakeSystem
4+
//
5+
// Created by 地风(ElonChan) on 16/5/16.
6+
// Copyright © 2016年 Ali. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface ABSUtil : NSObject
12+
13+
// 设置日志逻辑
14+
+ (void)setLogger:(void (^)(NSString *))logger;
15+
16+
+ (void)Logger:(NSString *)log;
17+
18+
+ (BOOL)isValidString:(id)notValidString;
19+
20+
+ (BOOL)isWhiteListClass:(Class)class;
21+
22+
+ (void)deleteCacheWithfilePathsToRemove:(NSArray *)filePathsToRemove;
23+
24+
@end

ios/libs/AlicloudUtils.framework/Headers/AlicloudIPv6Adapter.h

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,40 +71,33 @@
7171
+ (instancetype)getInstance;
7272

7373
/**
74-
* @brief 判断当前是否为IPv6-Only网络
75-
*
76-
* @return
74+
* 判断当前是否为IPv6-Only网络
7775
*/
7876
- (BOOL)isIPv6OnlyNetwork;
7977

8078
/**
81-
* @brief 手动刷新IPv6-Only网络的判定
82-
*
83-
* @return
79+
* 手动刷新IPv6-Only网络的判定
8480
*/
8581
- (BOOL)reResolveIPv6OnlyStatus;
8682

8783
/**
88-
* @brief 自动完成对IPv4地址的适配
89-
* IPv6-Only网络环境:IPv4 address -> IPv4 Embedded IPv6 address
90-
例:42.156.220.114 -> 64:ff9b::2a9c:dc72
91-
* @param addr
92-
*
93-
* @return
84+
IPv4 > IPv6地址转换\n
85+
- 输入IPv4地址无效,返回原地址
86+
- IPv6-Only网络,返回转换后的IPv6地址
87+
- 非IPv6-Only网络,返回原地址
88+
89+
@param addr IPv4地址
90+
@return 转换后的v6地址 或 原地址
9491
*/
9592
- (NSString *)handleIpv4Address:(NSString *)addr;
9693

9794
/**
98-
* @brief 判断是否为IPv4地址
99-
*
100-
* @return
95+
* 判断是否为IPv4地址
10196
*/
10297
- (BOOL)isIPv4Address:(NSString *)addr;
10398

10499
/**
105-
* @brief 判断是否为IPv6地址
106-
*
107-
* @return
100+
* 判断是否为IPv6地址
108101
*/
109102
- (BOOL)isIPv6Address:(NSString *)addr;
110103

ios/libs/AlicloudUtils.framework/Headers/AlicloudReachabilityManager.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,39 @@ typedef enum {
2323

2424
/**
2525
* 获取Reachability单例对象
26-
*
27-
* @return
2826
*/
2927
+ (AlicloudReachabilityManager *)shareInstance;
3028

3129
/**
3230
* 获取Reachability单例对象,为保证全局维护一个netInfo实例,可从外部传入netInfo对象的引用
3331
* warn: netInfo多次实例化,有一定几率crash
3432
*
35-
* @param netInfo
36-
*
37-
* @return
3833
*/
3934
+ (AlicloudReachabilityManager *)shareInstanceWithNetInfo:(CTTelephonyNetworkInfo *)netInfo;
4035

4136
/**
42-
* @brief 返回当前网络状态(同步调用,可能会阻塞调用线程)
43-
*
44-
* @return
37+
* 返回当前网络状态(同步调用,可能会阻塞调用线程)
4538
*/
4639
- (AlicloudNetworkStatus)currentNetworkStatus;
4740

4841
/**
49-
* @brief 返回之前网络状态
50-
*
51-
* @return
42+
* 返回之前网络状态
5243
*/
5344
- (AlicloudNetworkStatus)preNetworkStatus;
5445

5546
/**
56-
* @brief 检测网络是否连通(同步调用,阻塞调用线程)
57-
*
58-
* @return
47+
* 检测网络是否连通(同步调用,阻塞调用线程)
5948
*/
6049
- (BOOL)checkInternetConnection;
6150

51+
/**
52+
* 检测Wifi网络是否联通
53+
*/
54+
- (BOOL)isReachableViaWifi;
55+
56+
/**
57+
* 检测蜂窝网络是否联通
58+
*/
59+
- (BOOL)isReachableViaWWAN;
60+
6261
@end

ios/libs/AlicloudUtils.framework/Headers/AlicloudReport.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
#ifndef AlicloudReport_h
1010
#define AlicloudReport_h
1111

12+
extern const NSString *EXT_INFO_KEY_VERSION;
13+
extern const NSString *EXT_INFO_KEY_PACKAGE;
14+
1215
// SDK标识
1316
typedef NS_ENUM(NSInteger, AMSService) {
1417
AMSMAN = 0,
1518
AMSHTTPDNS,
1619
AMSMPUSH,
1720
AMSMAC,
18-
AMSAPI
21+
AMSAPI,
22+
AMSHOTFIX,
23+
AMSFEEDBACK,
24+
AMSIM
1925
};
2026

2127
// 上报状态
@@ -33,6 +39,14 @@ typedef NS_ENUM(NSInteger, AMSReportStatus) {
3339
*/
3440
+ (void)statAsync:(AMSService)tag;
3541

42+
/**
43+
* 异步上报活跃设备统计并携带附加信息
44+
*
45+
@param tag SDK标识
46+
@param extInfo 附加上报信息 { EXT_INFO_KEY_VERSION :"x.x.x", EXT_INFO_KEY_PACKAGE: "xxx"}
47+
*/
48+
+ (void)statAsync:(AMSService)tag extInfo:(NSDictionary *)extInfo;
49+
3650
/**
3751
* 获取指定SDK标识上报状态
3852
*
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// AlicloudTracker.h
3+
// AlicloudUtils
4+
//
5+
// Created by junmo on 2017/6/30.
6+
// Copyright © 2017年 Ali. All rights reserved.
7+
//
8+
9+
#ifndef AlicloudTracker_h
10+
#define AlicloudTracker_h
11+
12+
@interface AlicloudTracker : NSObject
13+
14+
@property (nonatomic, copy) NSString *sdkId;
15+
@property (nonatomic, copy) NSString *sdkVersion;
16+
17+
/**
18+
设置Tracker的通用打点属性,每次上报都携带该参数
19+
20+
@param key 通用属性Key
21+
@param value 通用属性Value
22+
*/
23+
- (void)setGlobalProperty:(NSString *)key value:(NSString *)value;
24+
25+
26+
/**
27+
删除Tracker通用打点属性
28+
29+
@param key 通用属性Key
30+
*/
31+
- (void)removeGlobalProperty:(NSString *)key;
32+
33+
/**
34+
自定义打点上报
35+
36+
@param eventName 事件名
37+
@param duration 时长
38+
@param properties 额外参数
39+
*/
40+
- (void)sendCustomHit:(NSString *)eventName
41+
duration:(long long)duration
42+
properties:(NSDictionary *)properties;
43+
44+
@end
45+
#endif /* AlicloudTracker_h */
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// AlicloudTrackerManager.h
3+
// AlicloudUtils
4+
//
5+
// Created by junmo on 2017/7/4.
6+
// Copyright © 2017年 Ali. All rights reserved.
7+
//
8+
9+
#ifndef AlicloudTrackerManager_h
10+
#define AlicloudTrackerManager_h
11+
12+
#import "AlicloudTracker.h"
13+
14+
@interface AlicloudTrackerManager : NSObject
15+
16+
/**
17+
获取上报通道管理器对象,并初始化UT
18+
19+
@return 管理器对象
20+
*/
21+
+ (instancetype)getInstance;
22+
23+
/**
24+
根据SDK标识和版本号获取上报通道
25+
26+
@param sdkId SDK标识
27+
@param version SDK版本号
28+
@return 上报通道对象
29+
*/
30+
- (AlicloudTracker *)getTrackerBySdkId:(NSString *)sdkId version:(NSString *)version;
31+
32+
@end
33+
34+
#endif /* AlicloudTrackerManager_h */

0 commit comments

Comments
 (0)