mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Merge branch 'beta'
This commit is contained in:
commit
e3b05e2b99
@ -189,21 +189,23 @@ public func rootPathForBasePath(_ appGroupPath: String) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func performAppGroupUpgrades(appGroupPath: String, rootPath: String) {
|
public func performAppGroupUpgrades(appGroupPath: String, rootPath: String) {
|
||||||
let _ = try? FileManager.default.createDirectory(at: URL(fileURLWithPath: rootPath), withIntermediateDirectories: true, attributes: nil)
|
DispatchQueue.global(qos: .default).async {
|
||||||
|
let _ = try? FileManager.default.createDirectory(at: URL(fileURLWithPath: rootPath), withIntermediateDirectories: true, attributes: nil)
|
||||||
|
|
||||||
if let items = FileManager.default.enumerator(at: URL(fileURLWithPath: appGroupPath), includingPropertiesForKeys: [.isDirectoryKey], options: [.skipsHiddenFiles, .skipsSubdirectoryDescendants], errorHandler: nil) {
|
if let items = FileManager.default.enumerator(at: URL(fileURLWithPath: appGroupPath), includingPropertiesForKeys: [.isDirectoryKey], options: [.skipsHiddenFiles, .skipsSubdirectoryDescendants], errorHandler: nil) {
|
||||||
let allowedDirectories: [String] = [
|
let allowedDirectories: [String] = [
|
||||||
"telegram-data",
|
"telegram-data",
|
||||||
"Library"
|
"Library"
|
||||||
]
|
]
|
||||||
|
|
||||||
for url in items {
|
for url in items {
|
||||||
guard let url = url as? URL else {
|
guard let url = url as? URL else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if let isDirectory = try? url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory, isDirectory {
|
if let isDirectory = try? url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory, isDirectory {
|
||||||
if !allowedDirectories.contains(url.lastPathComponent) {
|
if !allowedDirectories.contains(url.lastPathComponent) {
|
||||||
let _ = try? FileManager.default.removeItem(at: url)
|
let _ = try? FileManager.default.removeItem(at: url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"app": "7.8.1",
|
"app": "7.9",
|
||||||
"bazel": "4.0.0",
|
"bazel": "4.0.0",
|
||||||
"xcode": "12.4"
|
"xcode": "12.4"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user