parent
8da1e1399c
commit
49ba0ff942
|
@ -52,6 +52,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
DDLogWarn(@"%@ applicationDidEnterBackground.", self.tag);
|
||||
|
||||
[DDLog flushLog];
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
|
@ -68,6 +70,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
- (void)applicationWillTerminate:(UIApplication *)application
|
||||
{
|
||||
DDLogWarn(@"%@ applicationWillTerminate.", self.tag);
|
||||
|
||||
[DDLog flushLog];
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
@ -312,6 +316,8 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
[application endBackgroundTask:bgTask];
|
||||
bgTask = UIBackgroundTaskInvalid;
|
||||
});
|
||||
|
||||
[DDLog flushLog];
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application
|
||||
|
@ -543,6 +549,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
|
|||
|
||||
if (![TSStorageManager isDatabasePasswordAccessible]) {
|
||||
DDLogInfo(@"%@ exiting because we are in the background and the database password is not accessible.", self.tag);
|
||||
[DDLog flushLog];
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,8 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
|
|||
addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"ADDRESSBOOK_RESTRICTED_ALERT_BUTTON", nil)
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
exit(0);
|
||||
[DDLog flushLog];
|
||||
exit(0);
|
||||
}]];
|
||||
|
||||
[[UIApplication sharedApplication]
|
||||
|
|
|
@ -312,10 +312,26 @@ static Environment *environment = nil;
|
|||
}
|
||||
|
||||
+ (void)resetAppData {
|
||||
// This _should_ be wiped out below.
|
||||
DDLogError(@"%@ %s", self.tag, __PRETTY_FUNCTION__);
|
||||
[DDLog flushLog];
|
||||
|
||||
[[TSStorageManager sharedManager] resetSignalStorage];
|
||||
[Environment.preferences clear];
|
||||
[DebugLogger.sharedLogger wipeLogs];
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#pragma mark - Logging
|
||||
|
||||
+ (NSString *)tag
|
||||
{
|
||||
return [NSString stringWithFormat:@"[%@]", self.class];
|
||||
}
|
||||
|
||||
- (NSString *)tag
|
||||
{
|
||||
return self.class.tag;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
UIAlertAction *quitAction = [UIAlertAction actionWithTitle:@"Quit"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *_Nonnull action) {
|
||||
[DDLog flushLog];
|
||||
exit(0);
|
||||
}];
|
||||
[alertController addAction:quitAction];
|
||||
|
|
Loading…
Reference in New Issue