diff --git a/AltStore/Resources/en.lproj/Localizable.strings b/AltStore/Resources/en.lproj/Localizable.strings index 94b6c8e5..7e362543 100644 --- a/AltStore/Resources/en.lproj/Localizable.strings +++ b/AltStore/Resources/en.lproj/Localizable.strings @@ -59,7 +59,6 @@ "SettingsView.addToSiri" = "Add to Siri..."; "SettingsView.refreshingApps" = "Refreshing Apps"; "SettingsView.switchToUIKit" = "Switch to UIKit"; -"SettingsView.resetImageCache" = "Reset Image Cache"; "SettingsView.debug" = "Debug"; "SettingsView.swiftUIRedesign" = "SwiftUI Redesign"; "SettingsView.credits" = "Credits"; @@ -198,6 +197,7 @@ You should only enable Developer Mode if you meet one of the following requireme "DevModeView.General.header" = "General"; "DevModeView.General.console" = "Console"; "DevModeView.General.unstableFeaturesNightlyOnly" = "Unstable Features are only available on nightly builds, PR builds and debug builds."; +"DevModeView.General.resetImageCache" = "Reset Image Cache"; "DevModeView.General.disableDevMode" = "Disable Developer Mode"; "DevModeView.Files.header" = "Files"; "DevModeView.Files.dataExplorer" = "Data File Explorer"; diff --git a/AltStore/SwiftUI/Generated/Localizations.swift b/AltStore/SwiftUI/Generated/Localizations.swift index c8b3d27b..8af42f41 100644 --- a/AltStore/SwiftUI/Generated/Localizations.swift +++ b/AltStore/SwiftUI/Generated/Localizations.swift @@ -292,6 +292,8 @@ internal enum L10n { internal static let disableDevMode = L10n.tr("Localizable", "DevModeView.General.disableDevMode", fallback: "Disable Developer Mode") /// General internal static let header = L10n.tr("Localizable", "DevModeView.General.header", fallback: "General") + /// Reset Image Cache + internal static let resetImageCache = L10n.tr("Localizable", "DevModeView.General.resetImageCache", fallback: "Reset Image Cache") /// Unstable Features are only available on nightly builds, PR builds and debug builds. internal static let unstableFeaturesNightlyOnly = L10n.tr("Localizable", "DevModeView.General.unstableFeaturesNightlyOnly", fallback: "Unstable Features are only available on nightly builds, PR builds and debug builds.") } @@ -438,8 +440,6 @@ internal enum L10n { internal static let refreshingAppsFooter = L10n.tr("Localizable", "SettingsView.refreshingAppsFooter", fallback: "Enable Background Refresh to automatically refresh apps in the background when connected to WiFi and with Wireguard active.") /// Reset adi.pb internal static let resetAdiPb = L10n.tr("Localizable", "SettingsView.resetAdiPb", fallback: "Reset adi.pb") - /// Reset Image Cache - internal static let resetImageCache = L10n.tr("Localizable", "SettingsView.resetImageCache", fallback: "Reset Image Cache") /// Reset Pairing File internal static let resetPairingFile = L10n.tr("Localizable", "SettingsView.resetPairingFile", fallback: "Reset Pairing File") /// Show Error Log diff --git a/AltStore/SwiftUI/Views/Settings/DevModeView.swift b/AltStore/SwiftUI/Views/Settings/DevModeView.swift index 0c804c9d..88fa6358 100644 --- a/AltStore/SwiftUI/Views/Settings/DevModeView.swift +++ b/AltStore/SwiftUI/Views/Settings/DevModeView.swift @@ -159,6 +159,9 @@ struct DevModeMenu: View { .onTapGesture { isUnstableAlertShowing = true } #endif + SwiftUI.Button(L10n.DevModeView.General.resetImageCache, action: self.resetImageCache) + .foregroundColor(.red) + SwiftUI.Button(action: { isDevModeEnabled = false }, label: { Text(L10n.DevModeView.General.disableDevMode) }).foregroundColor(.red) @@ -252,6 +255,19 @@ struct DevModeMenu: View { .navigationTitle(L10n.DevModeView.title) .enableInjection() } + + func resetImageCache() { + do { + let url = try FileManager.default.url( + for: .cachesDirectory, + in: .userDomainMask, + appropriateFor: nil, + create: true) + try FileManager.default.removeItem(at: url.appendingPathComponent("com.zeu.cache", isDirectory: true)) + } catch let error { + fatalError("\(error)") + } + } } struct DevModeView_Previews: PreviewProvider { diff --git a/AltStore/SwiftUI/Views/Settings/SettingsView.swift b/AltStore/SwiftUI/Views/Settings/SettingsView.swift index 73cd9290..d7ab9dae 100644 --- a/AltStore/SwiftUI/Views/Settings/SettingsView.swift +++ b/AltStore/SwiftUI/Views/Settings/SettingsView.swift @@ -199,9 +199,6 @@ struct SettingsView: View { } } - SwiftUI.Button(L10n.SettingsView.resetImageCache, action: self.resetImageCache) - .foregroundColor(.red) - SwiftUI.Button(L10n.SettingsView.resetPairingFile) { self.isShowingResetPairingFileConfirmation = true } @@ -303,19 +300,6 @@ struct SettingsView: View { } } } - - func resetImageCache() { - do { - let url = try FileManager.default.url( - for: .cachesDirectory, - in: .userDomainMask, - appropriateFor: nil, - create: true) - try FileManager.default.removeItem(at: url.appendingPathComponent("com.zeu.cache", isDirectory: true)) - } catch let error { - fatalError("\(error)") - } - } func resetPairingFile() { let filename = "ALTPairingFile.mobiledevicepairing"