Skip to content

Commit

Permalink
Release 4.5.18
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyue committed Sep 14, 2023
1 parent 929b921 commit 6f0b25b
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 20 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SensorsAnalyticsSDK"
s.version = "4.5.17"
s.version = "4.5.18"
s.summary = "The official iOS SDK of Sensors Analytics."
s.homepage = "http://www.sensorsdata.cn"
s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" }
Expand Down
3 changes: 2 additions & 1 deletion SensorsAnalyticsSDK/ChannelMatch/SAChannelMatchManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ - (NSDictionary *)channelPropertiesWithEvent:(NSString *)event {
}

- (void)archiveTrackChannelEventNames {
[[SAStoreManager sharedInstance] setObject:self.trackChannelEventNames forKey:kSAEventPropertyChannelDeviceInfo];
NSSet *copyEventNames = [[NSSet alloc] initWithSet:self.trackChannelEventNames copyItems:YES];
[[SAStoreManager sharedInstance] setObject:copyEventNames forKey:kSAEventPropertyChannelDeviceInfo];
}

- (NSDictionary *)channelInfoWithEvent:(NSString *)event {
Expand Down
13 changes: 2 additions & 11 deletions SensorsAnalyticsSDK/Core/SAConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
#import "SensorsAnalyticsSDK+Private.h"
#import "SACoreResources.h"

#if __has_include("SACoreResources+English.h")
#import "SACoreResources+English.h"
#endif

#pragma mark - Track Timer
NSString *const kSAEventIdSuffix = @"_SATimer";

Expand Down Expand Up @@ -153,13 +149,8 @@ void sensorsdata_dispatch_safe_sync(dispatch_queue_t queue,DISPATCH_NOESCAPE dis
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{

#if __has_include("SACoreResources+English.h")
// 获取英文资源
languageResources = [SACoreResources englishLanguageResources];
#else
// 默认加载中文资源
languageResources = [SACoreResources defaultLanguageResources];
#endif
// 加载语言资源
languageResources = [SACoreResources defaultLanguageResources];

});

Expand Down
17 changes: 12 additions & 5 deletions SensorsAnalyticsSDK/Core/SACoreResources.m

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#import "SALimitKeyManager.h"
#import "NSDictionary+SACopyProperties.h"

#define VERSION @"4.5.17"
#define VERSION @"4.5.18"

void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag;

Expand Down
5 changes: 5 additions & 0 deletions SensorsAnalyticsSDK/Store/SAFileStorePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ - (void)setObject:(nullable id)value forKey:(nonnull NSString *)key {
if (!key) {
return;
}
// 屏蔽非法数据类型,防止野指针造成异常
if(!value && ![value conformsToProtocol:@protocol(NSCoding)]) {
return;
}

NSString *filePath = [SAFileStorePlugin filePath:key];
#if TARGET_OS_IOS
/* 为filePath文件设置保护等级 */
Expand Down
2 changes: 1 addition & 1 deletion SensorsAnalyticsTests/Store/SABaseStoreManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (void)testSetStringObject {
}

- (void)testSetArrayObject {
NSArray *object = @[@"123"];
NSArray *object = @[@"123", @"哈哈哈dabn"];
[self.manager setObject:object forKey:kSABaseStoreManagerTestsKey];
XCTAssertTrue([object isEqualToArray:[self.manager objectForKey:kSABaseStoreManagerTestsKey]]);
}
Expand Down
6 changes: 6 additions & 0 deletions SensorsAnalyticsTests/Store/SAFileStorePluginTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ - (void)testSetArrayObject {
XCTAssertTrue([object isEqualToArray:[self.plugin objectForKey:kSAFileStorePluginTestsKey]]);
}

- (void)testSetNSSetObject {
NSSet *set = [[NSSet alloc] initWithArray:@[@"哈哈12casdz", @(123)]];
[self.plugin setObject:set forKey:kSAFileStorePluginTestsKey];
XCTAssertTrue([set isEqualToSet: [self.plugin objectForKey:kSAFileStorePluginTestsKey]]);
}

- (void)testSetDictionaryObject {
NSDictionary *object = @{@"login_id": @"123"};
[self.plugin setObject:object forKey:kSAFileStorePluginTestsKey];
Expand Down
3 changes: 3 additions & 0 deletions SpecialFileSources/SACoreResources+English.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN

@interface SACoreResources (English)

/// 加载英文运营商信息
+ (NSDictionary *)englishMcc;

/// 加载英文资源
+ (NSDictionary *)englishLanguageResources;

Expand Down
4 changes: 4 additions & 0 deletions SpecialFileSources/SACoreResources+English.m

Large diffs are not rendered by default.

0 comments on commit 6f0b25b

Please sign in to comment.