From cc037906fd0a030691bb7e59c49e38993109951a Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Fri, 10 Nov 2023 16:41:40 -0500 Subject: [PATCH] Removing old documents directory cleanup --- Sources/Brave/Migration/Migration.swift | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Sources/Brave/Migration/Migration.swift b/Sources/Brave/Migration/Migration.swift index 435018a62b9..b86b2dd7e8c 100644 --- a/Sources/Brave/Migration/Migration.swift +++ b/Sources/Brave/Migration/Migration.swift @@ -24,11 +24,6 @@ public class Migration { Preferences.migratePreferences(keyPrefix: keyPrefix) Preferences.migrateWalletPreferences() Preferences.migrateAdAndTrackingProtection() - - if !Preferences.Migration.documentsDirectoryCleanupCompleted.value { - documentsDirectoryCleanup() - Preferences.Migration.documentsDirectoryCleanupCompleted.value = true - } if Preferences.General.isFirstLaunch.value { if UIDevice.current.userInterfaceIdiom == .phone { @@ -57,18 +52,6 @@ public class Migration { braveCore.syncAPI.enableSyncTypes(syncProfileService: braveCore.syncProfileService) } - - /// Adblock files don't have to be moved, they now have a new directory and will be downloaded there. - /// Downloads folder was nefer used before, it's a leftover from FF. - private func documentsDirectoryCleanup() { - FileManager.default.removeFolder(withName: "abp-data", location: .documentDirectory) - FileManager.default.removeFolder(withName: "https-everywhere-data", location: .documentDirectory) - - FileManager.default.moveFile( - sourceName: "CookiesData.json", sourceLocation: .documentDirectory, - destinationName: "CookiesData.json", - destinationLocation: .applicationSupportDirectory) - } // Migrate from TabMO to SessionTab and SessionWindow public static func migrateTabStateToWebkitState(diskImageStore: DiskImageStore?) { @@ -212,11 +195,6 @@ fileprivate extension Preferences { /// Migration preferences final class Migration { static let completed = Option(key: "migration.completed", default: false) - /// Old app versions were using documents directory to store app files, database, adblock files. - /// These files are now moved to 'Application Support' folder, and documents directory is left - /// for user downloaded files. - static let documentsDirectoryCleanupCompleted = - Option(key: "migration.documents-dir-completed", default: false) // This is new preference introduced in iOS 1.32.3, tracks whether we should perform database migration. // It should be called only for users who have not completed the migration beforehand. // The reason for second migration flag is to first do file system migrations like moving database files,