Skip to content

Commit

Permalink
Merge pull request #563 from zapcannon87/master
Browse files Browse the repository at this point in the history
Release v11.6.4
  • Loading branch information
zapcannon87 authored Jul 17, 2019
2 parents 06379f7 + a95c7fb commit 9b45a81
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 735 deletions.
16 changes: 0 additions & 16 deletions AVOS/AVOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
70CA7F771BDE3721000A3B21 /* AVAnalyticsSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419EC1A5A79FF00C5C6C4 /* AVAnalyticsSession.m */; };
70CA7F781BDE3721000A3B21 /* AVAnalyticsUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419EE1A5A79FF00C5C6C4 /* AVAnalyticsUtils.m */; };
70CA7F791BDE3721000A3B21 /* AVDuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F01A5A79FF00C5C6C4 /* AVDuration.m */; };
70CA7F7A1BDE3721000A3B21 /* AVExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F21A5A79FF00C5C6C4 /* AVExceptionHandler.m */; };
70CA7F7B1BDE3721000A3B21 /* AVOSCloud.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F81A5A79FF00C5C6C4 /* AVOSCloud.m */; };
70CA7F7C1BDE3721000A3B21 /* AVCacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419FB1A5A79FF00C5C6C4 /* AVCacheManager.m */; };
70CA7F7D1BDE3721000A3B21 /* AVPersistenceUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419FD1A5A79FF00C5C6C4 /* AVPersistenceUtils.m */; };
Expand Down Expand Up @@ -153,7 +152,6 @@
70CA7FE31BDE42F5000A3B21 /* AVAnalyticsSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419EB1A5A79FF00C5C6C4 /* AVAnalyticsSession.h */; };
70CA7FE41BDE42F5000A3B21 /* AVAnalyticsUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419ED1A5A79FF00C5C6C4 /* AVAnalyticsUtils.h */; };
70CA7FE51BDE42F5000A3B21 /* AVDuration.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419EF1A5A79FF00C5C6C4 /* AVDuration.h */; };
70CA7FE61BDE42F5000A3B21 /* AVExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F11A5A79FF00C5C6C4 /* AVExceptionHandler.h */; };
70CA7FE71BDE42F6000A3B21 /* AVConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F31A5A79FF00C5C6C4 /* AVConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
70CA7FE81BDE42F6000A3B21 /* AVGlobal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F41A5A79FF00C5C6C4 /* AVGlobal.h */; };
70CA7FE91BDE42F6000A3B21 /* AVOSCloud_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F61A5A79FF00C5C6C4 /* AVOSCloud_Internal.h */; };
Expand Down Expand Up @@ -505,7 +503,6 @@
83D8CEA31C17DAF50094279D /* AVSearchSortBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C841A761A5A79FF00C5C6C4 /* AVSearchSortBuilder.m */; };
83D8CEA51C17DAF50094279D /* LCNetworkStatistics.m in Sources */ = {isa = PBXBuildFile; fileRef = 838DD7951B3D309F00C95897 /* LCNetworkStatistics.m */; };
83D8CEA61C17DAF50094279D /* AVDuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F01A5A79FF00C5C6C4 /* AVDuration.m */; };
83D8CEA71C17DAF50094279D /* AVExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F21A5A79FF00C5C6C4 /* AVExceptionHandler.m */; };
83D8CEA81C17DAF50094279D /* AVRole.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419E11A5A79FF00C5C6C4 /* AVRole.m */; };
83D8CEA91C17DAF50094279D /* AVPaasClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C841A6F1A5A79FF00C5C6C4 /* AVPaasClient.m */; };
83D8CEAB1C17DAF50094279D /* AVErrorUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C841AA31A5A7A0000C5C6C4 /* AVErrorUtils.m */; };
Expand Down Expand Up @@ -566,7 +563,6 @@
83D8CF141C17DAF50094279D /* AVAnalyticsUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419ED1A5A79FF00C5C6C4 /* AVAnalyticsUtils.h */; };
83D8CF151C17DAF50094279D /* AVRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C841A6C1A5A79FF00C5C6C4 /* AVRequestOperation.h */; };
83D8CF171C17DAF50094279D /* AVAnalyticsImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419E91A5A79FF00C5C6C4 /* AVAnalyticsImpl.h */; };
83D8CF181C17DAF50094279D /* AVExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F11A5A79FF00C5C6C4 /* AVExceptionHandler.h */; };
83D8CF1A1C17DAF50094279D /* LCDatabasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 83DF02A91AF86032000E289C /* LCDatabasePool.h */; };
83D8CF201C17DAF50094279D /* SDMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 836705AA1BA1358D0050E968 /* SDMacros.h */; };
83D8CF211C17DAF50094279D /* AVFriendQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C841A651A5A79FF00C5C6C4 /* AVFriendQuery.h */; };
Expand Down Expand Up @@ -701,8 +697,6 @@
8C841ABD1A5A7A0000C5C6C4 /* AVAnalyticsUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419EE1A5A79FF00C5C6C4 /* AVAnalyticsUtils.m */; };
8C841ABE1A5A7A0000C5C6C4 /* AVDuration.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419EF1A5A79FF00C5C6C4 /* AVDuration.h */; };
8C841ABF1A5A7A0000C5C6C4 /* AVDuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F01A5A79FF00C5C6C4 /* AVDuration.m */; };
8C841AC01A5A7A0000C5C6C4 /* AVExceptionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F11A5A79FF00C5C6C4 /* AVExceptionHandler.h */; };
8C841AC11A5A7A0000C5C6C4 /* AVExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C8419F21A5A79FF00C5C6C4 /* AVExceptionHandler.m */; };
8C841AC21A5A7A0000C5C6C4 /* AVConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F31A5A79FF00C5C6C4 /* AVConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
8C841AC31A5A7A0000C5C6C4 /* AVGlobal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F41A5A79FF00C5C6C4 /* AVGlobal.h */; };
8C841AC51A5A7A0000C5C6C4 /* AVOSCloud_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C8419F61A5A79FF00C5C6C4 /* AVOSCloud_Internal.h */; };
Expand Down Expand Up @@ -1239,8 +1233,6 @@
8C8419EE1A5A79FF00C5C6C4 /* AVAnalyticsUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AVAnalyticsUtils.m; sourceTree = "<group>"; };
8C8419EF1A5A79FF00C5C6C4 /* AVDuration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVDuration.h; sourceTree = "<group>"; };
8C8419F01A5A79FF00C5C6C4 /* AVDuration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AVDuration.m; sourceTree = "<group>"; };
8C8419F11A5A79FF00C5C6C4 /* AVExceptionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVExceptionHandler.h; sourceTree = "<group>"; };
8C8419F21A5A79FF00C5C6C4 /* AVExceptionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AVExceptionHandler.m; sourceTree = "<group>"; };
8C8419F31A5A79FF00C5C6C4 /* AVConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVConstants.h; sourceTree = "<group>"; };
8C8419F41A5A79FF00C5C6C4 /* AVGlobal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVGlobal.h; sourceTree = "<group>"; };
8C8419F51A5A79FF00C5C6C4 /* AVOSCloud_Art.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AVOSCloud_Art.inc; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1936,8 +1928,6 @@
8C8419EE1A5A79FF00C5C6C4 /* AVAnalyticsUtils.m */,
8C8419EF1A5A79FF00C5C6C4 /* AVDuration.h */,
8C8419F01A5A79FF00C5C6C4 /* AVDuration.m */,
8C8419F11A5A79FF00C5C6C4 /* AVExceptionHandler.h */,
8C8419F21A5A79FF00C5C6C4 /* AVExceptionHandler.m */,
);
path = Analytics;
sourceTree = "<group>";
Expand Down Expand Up @@ -2658,7 +2648,6 @@
70CA7FE31BDE42F5000A3B21 /* AVAnalyticsSession.h in Headers */,
70CA7FE41BDE42F5000A3B21 /* AVAnalyticsUtils.h in Headers */,
70CA7FE51BDE42F5000A3B21 /* AVDuration.h in Headers */,
70CA7FE61BDE42F5000A3B21 /* AVExceptionHandler.h in Headers */,
70CA7FE81BDE42F6000A3B21 /* AVGlobal.h in Headers */,
9A404DD41CE5A9B700DEB3DC /* LCRouter.h in Headers */,
70CA7FE91BDE42F6000A3B21 /* AVOSCloud_Internal.h in Headers */,
Expand Down Expand Up @@ -2853,7 +2842,6 @@
83D8CF141C17DAF50094279D /* AVAnalyticsUtils.h in Headers */,
83D8CF151C17DAF50094279D /* AVRequestOperation.h in Headers */,
83D8CF171C17DAF50094279D /* AVAnalyticsImpl.h in Headers */,
83D8CF181C17DAF50094279D /* AVExceptionHandler.h in Headers */,
83FCB9A21CEDC57C007D8712 /* LCHTTPSessionManager.h in Headers */,
83FCB9C51CEDC57C007D8712 /* LCURLRequestSerialization.h in Headers */,
83D8CF1A1C17DAF50094279D /* LCDatabasePool.h in Headers */,
Expand Down Expand Up @@ -2955,7 +2943,6 @@
8C841ABC1A5A7A0000C5C6C4 /* AVAnalyticsUtils.h in Headers */,
8C841B301A5A7A0000C5C6C4 /* AVRequestOperation.h in Headers */,
8C841AB81A5A7A0000C5C6C4 /* AVAnalyticsImpl.h in Headers */,
8C841AC01A5A7A0000C5C6C4 /* AVExceptionHandler.h in Headers */,
83DF02B41AF86032000E289C /* LCDatabasePool.h in Headers */,
836705AB1BA1358D0050E968 /* SDMacros.h in Headers */,
83BE730D1D810651008ED3CF /* metamacros.h in Headers */,
Expand Down Expand Up @@ -3618,7 +3605,6 @@
70CA7F771BDE3721000A3B21 /* AVAnalyticsSession.m in Sources */,
70CA7F781BDE3721000A3B21 /* AVAnalyticsUtils.m in Sources */,
70CA7F791BDE3721000A3B21 /* AVDuration.m in Sources */,
70CA7F7A1BDE3721000A3B21 /* AVExceptionHandler.m in Sources */,
70CA7F7B1BDE3721000A3B21 /* AVOSCloud.m in Sources */,
83331D591EB9D55100CADC9C /* NSDictionary+LeanCloud.m in Sources */,
70CA7F7C1BDE3721000A3B21 /* AVCacheManager.m in Sources */,
Expand Down Expand Up @@ -3794,7 +3780,6 @@
83D8CEA31C17DAF50094279D /* AVSearchSortBuilder.m in Sources */,
83D8CEA51C17DAF50094279D /* LCNetworkStatistics.m in Sources */,
83D8CEA61C17DAF50094279D /* AVDuration.m in Sources */,
83D8CEA71C17DAF50094279D /* AVExceptionHandler.m in Sources */,
83D8CEA81C17DAF50094279D /* AVRole.m in Sources */,
835092031EB1BDD0000DA884 /* AVSMS.m in Sources */,
83B0E58A1F28375900EE1A75 /* JRSwizzle.m in Sources */,
Expand Down Expand Up @@ -3866,7 +3851,6 @@
8C841B391A5A7A0000C5C6C4 /* AVSearchSortBuilder.m in Sources */,
838DD7971B3D309F00C95897 /* LCNetworkStatistics.m in Sources */,
8C841ABF1A5A7A0000C5C6C4 /* AVDuration.m in Sources */,
8C841AC11A5A7A0000C5C6C4 /* AVExceptionHandler.m in Sources */,
8C841AB11A5A7A0000C5C6C4 /* AVRole.m in Sources */,
835092011EB1BDD0000DA884 /* AVSMS.m in Sources */,
83B0E5881F28375900EE1A75 /* JRSwizzle.m in Sources */,
Expand Down
21 changes: 1 addition & 20 deletions AVOS/AVOSCloud/Analytics/AVAnalytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,35 +88,16 @@ +(void)setAnalyticsEnabled:(BOOL)value
[AVAnalyticsImpl sharedInstance].enableAnalytics = value;
}

+(void)setCrashReportEnabled:(BOOL)value
{
[AVAnalyticsImpl sharedInstance].enableCrashReport = value;
+(void)setCrashReportEnabled:(BOOL)value {
}

+(void)setCrashReportEnabled:(BOOL)value completion:(void (^)(void))completion {
[[AVAnalyticsImpl sharedInstance] setEnableCrashReport:value completion:completion];
}

+ (void)setCrashReportEnabled:(BOOL)value andIgnore:(BOOL)ignore {
[[self class] setCrashReportEnabled:value];
[AVAnalyticsImpl sharedInstance].enableIgnoreCrash = ignore;
}

+ (void)setCrashReportEnabled:(BOOL)value withIgnoreAlertTitle:(NSString*)alertTitle andMessage:(NSString*)alertMsg andQuitTitle:(NSString*)alertQuit andContinueTitle:(NSString*)alertContinue {
[[self class] setCrashReportEnabled:value];
if (value) {
[AVAnalyticsImpl sharedInstance].enableIgnoreCrash = YES;

NSMutableDictionary *dict=[NSMutableDictionary dictionaryWithCapacity:5];
if (alertTitle) [dict setObject:alertTitle forKey:@"title"];
if (alertMsg) [dict setObject:alertMsg forKey:@"msg"];
if (alertQuit) [dict setObject:alertQuit forKey:@"quit"];
if (alertContinue) [dict setObject:alertContinue forKey:@"continue"];

if (dict.count>0) {
[AVAnalyticsImpl sharedInstance].ignoreCrashAlertStrings = dict;
}
}
}

+ (void)logPageView:(NSString *)pageName seconds:(int)seconds
Expand Down
10 changes: 0 additions & 10 deletions AVOS/AVOSCloud/Analytics/AVAnalyticsImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
@interface AVAnalyticsImpl : NSObject

@property (nonatomic, readwrite) BOOL enableAnalytics;
@property (nonatomic, readwrite) BOOL enableCrashReport;
@property (nonatomic, readwrite) BOOL enableIgnoreCrash;
@property (nonatomic, readwrite) BOOL enableDebugLog;
@property (nonatomic, retain) NSDictionary *ignoreCrashAlertStrings;
@property (nonatomic, readwrite) AVReportPolicy reportPolicy;
@property (nonatomic, readwrite) BOOL enableReport;
@property (nonatomic, readwrite, copy) NSString * appChannel;
Expand All @@ -28,7 +25,6 @@

+(AVAnalyticsImpl *)sharedInstance;

-(void)setEnableCrashReport:(BOOL)enabled completion:(void (^)(void))completion;
-(void)beginSession;
-(void)endSession;
-(AVAnalyticsSession *)currentSession;
Expand All @@ -54,12 +50,6 @@
key:(NSString *)key
attributes:(NSDictionary *)attributes;

/**
* send crash report
* @param exception the exception with trace userinfo
*/
-(void)addException:(NSException *)exception;

-(void)setLatitude:(double)latitude longitude:(double)longitude;
-(void)clearLocation;

Expand Down
73 changes: 0 additions & 73 deletions AVOS/AVOSCloud/Analytics/AVAnalyticsImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import "AVAnalyticsImpl.h"
#import "AVAnalyticsSession.h"
#import "AVExceptionHandler.h"
#import "AVPaasClient.h"
#import "AVAnalyticsUtils.h"
#import "AVGlobal.h"
Expand Down Expand Up @@ -63,7 +62,6 @@ -(instancetype)init

_sendInterval = AV_DEFAULT_REPORT_INTERVAL;
_enableDebugLog = NO;
// _enableCrashReport = YES;
_reportPolicy = AV_SEND_INTERVAL;
_enableReport = YES;
_enableAnalytics = YES;
Expand Down Expand Up @@ -100,77 +98,6 @@ -(void)loadOnlineConfig:(NSDictionary *)dict {
self.onlineConfig = [dict valueForKey:@"parameters"];
}

-(void)_enableCrashReportRunloop{
[AVExceptionHandler installAVOSUncaughtExceptionHandler];
}

-(void)setEnableCrashReport:(BOOL)e {
[self setEnableCrashReport:e completion:nil];
}

-(void)setEnableCrashReport:(BOOL)enabled completion:(void (^)(void))completion {
_enableCrashReport = enabled;
if (self.enableCrashReport) {
//tick exception handler out of main runloop,
//in case some app start with a crash in `application:didFinishLaunchingWithOptions:`
dispatch_async(dispatch_get_main_queue(), ^{
[AVExceptionHandler installAVOSUncaughtExceptionHandler];
if (completion) {
completion();
}
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[AVExceptionHandler uninstallAVOSUncaughtExceptionHandler];
if (completion) {
completion();
}
});
}
}
-(void)addException:(NSException *)exception{
if (!self.enableAnalytics) {
return;
}

NSArray *trace=[[exception userInfo] objectForKey:AVOS_UncaughtExceptionHandlerAddressesKey];
NSString *strace=nil;

if (trace.count>0) {
strace=[trace componentsJoinedByString:@"\n"];
} else {
strace=@"";
}

NSMutableDictionary * dict = [AVAnalyticsUtils deviceInfo];

[dict addEntriesFromDictionary:@{
@"type": [exception name],
@"reason": [exception reason],
@"stack_trace": strace,
@"time": @([AVAnalyticsUtils currentTimestamp]),
}];

if (self.customInfo != nil) {
[dict setObject:self.customInfo forKey:@"customInfo"];
}

//add app build uuid to match dSYM
[dict setObject:[AVExceptionHandler appBuildUUID] forKey:@"build_uuid"];

[[AVPaasClient sharedInstance] postObject:[[[self class] myObjectPath] stringByAppendingPathComponent:@"crash"]
withParameters:dict
eventually:YES
block:^(id object, NSError *error)
{
if (error == nil) {
AVLoggerI(@"Save success %@", [object description]);
} else {
AVLoggerI(@"Save failed %@ error %@", dict, error);
}
}];
}

-(AVAnalyticsSession *)currentSession
{
for(AVAnalyticsSession * session in [self.sessions copy]) {
Expand Down
22 changes: 0 additions & 22 deletions AVOS/AVOSCloud/Analytics/AVExceptionHandler.h

This file was deleted.

Loading

0 comments on commit 9b45a81

Please sign in to comment.