Fix crash protect by delete userdefault

This commit is contained in:
yicheng 2019-11-04 22:51:23 +08:00
parent 1dbb92540e
commit 8226cea7c7
1 changed files with 4 additions and 0 deletions

View File

@ -550,6 +550,10 @@ extension AppDelegate {
//
ConfigFileManager.backupAndRemoveConfigFile()
try? FileManager.default.removeItem(atPath: kConfigFolderPath + "Country.mmdb")
if let domain = Bundle.main.bundleIdentifier {
UserDefaults.standard.removePersistentDomain(forName: domain)
UserDefaults.standard.synchronize()
}
NSUserNotificationCenter.default.post(title: "Fail on launch protect", info: "You origin Config has been renamed")
}
DispatchQueue.global().asyncAfter(deadline: DispatchTime.now() + Double(Int64(1 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: {