|
|
|
@ -81,22 +81,22 @@
|
|
|
|
|
NSError *error;
|
|
|
|
|
|
|
|
|
|
NSDictionary *attrs = @{NSFileProtectionKey: NSFileProtectionCompleteUntilFirstUserAuthentication};
|
|
|
|
|
[[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:preferencesPath error:&error];
|
|
|
|
|
[NSFileManager.defaultManager setAttributes:attrs ofItemAtPath:preferencesPath error:&error];
|
|
|
|
|
|
|
|
|
|
[pathsToExclude addObject:[[preferencesPath stringByAppendingString:NSBundle.mainBundle.bundleIdentifier] stringByAppendingString:@".plist"]];
|
|
|
|
|
|
|
|
|
|
NSString *logPath = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/Logs/"];
|
|
|
|
|
NSArray *logsFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:logPath error:&error];
|
|
|
|
|
NSArray *logsFiles = [NSFileManager.defaultManager contentsOfDirectoryAtPath:logPath error:&error];
|
|
|
|
|
|
|
|
|
|
attrs = @{NSFileProtectionKey: NSFileProtectionCompleteUntilFirstUserAuthentication};
|
|
|
|
|
[[NSFileManager defaultManager] setAttributes:attrs ofItemAtPath:logPath error:&error];
|
|
|
|
|
[NSFileManager.defaultManager setAttributes:attrs ofItemAtPath:logPath error:&error];
|
|
|
|
|
|
|
|
|
|
for (NSUInteger i = 0; i < logsFiles.count; i++) {
|
|
|
|
|
[pathsToExclude addObject:[logPath stringByAppendingString:logsFiles[i]]];
|
|
|
|
|
for (NSString *logsFile in logsFiles) {
|
|
|
|
|
[pathsToExclude addObject:[logPath stringByAppendingString:logsFile]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (NSUInteger i = 0; i < pathsToExclude.count; i++) {
|
|
|
|
|
[[NSURL fileURLWithPath:pathsToExclude[i]] setResourceValue:@YES
|
|
|
|
|
for (NSString *pathToExclude in pathsToExclude) {
|
|
|
|
|
[[NSURL fileURLWithPath:pathToExclude] setResourceValue:@YES
|
|
|
|
|
forKey:NSURLIsExcludedFromBackupKey
|
|
|
|
|
error:&error];
|
|
|
|
|
}
|
|
|
|
@ -187,15 +187,15 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
|
|
|
|
|
[[PushManager sharedManager].pushNotificationFutureSource trySetResult:deviceToken];
|
|
|
|
|
[PushManager.sharedManager.pushNotificationFutureSource trySetResult:deviceToken];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
|
|
|
|
|
[[PushManager sharedManager].pushNotificationFutureSource trySetFailure:error];
|
|
|
|
|
[PushManager.sharedManager.pushNotificationFutureSource trySetFailure:error];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings{
|
|
|
|
|
[[PushManager sharedManager].userNotificationFutureSource trySetResult:notificationSettings];
|
|
|
|
|
[PushManager.sharedManager.userNotificationFutureSource trySetResult:notificationSettings];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
|
|
|
|
|