diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index dd4a6e98..1acd3b6e 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -79,17 +79,17 @@ 1FB96FEC292C171D007E68D1 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB96FEB292C171D007E68D1 /* NotificationManager.swift */; }; 1FB96FF3292D0539007E68D1 /* PillButtonProgressViewStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB96FF2292D0539007E68D1 /* PillButtonProgressViewStyle.swift */; }; 1FFA56C2299994390011B6F5 /* OutputCapturer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FFA56C1299994390011B6F5 /* OutputCapturer.swift */; }; - 1FFA56C52999978C0011B6F5 /* LocalConsole in Frameworks */ = {isa = PBXBuildFile; productRef = 1FFA56C42999978C0011B6F5 /* LocalConsole */; }; 1FFEF104298552DB0098374C /* AppVersionHistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FFEF103298552DB0098374C /* AppVersionHistoryView.swift */; }; 4879A95F2861046500FC1BBD /* AltSign in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A95E2861046500FC1BBD /* AltSign */; }; 4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A9612861049C00FC1BBD /* OpenSSL */; }; + 992C896029A6A56500FB3501 /* LocalConsole in Frameworks */ = {isa = PBXBuildFile; productRef = 992C895F29A6A56500FB3501 /* LocalConsole */; }; 99BCB7DF29A2AC050041D1A7 /* AdvancedSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99BCB7DE29A2AC050041D1A7 /* AdvancedSettingsView.swift */; }; 99C4EF4D2979132100CB538D /* SemanticVersion in Frameworks */ = {isa = PBXBuildFile; productRef = 99C4EF4C2979132100CB538D /* SemanticVersion */; }; 99D87A60299F1B1100ED09A9 /* DevModeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99D87A5F299F1B1100ED09A9 /* DevModeView.swift */; }; 99D87A62299F3EC300ED09A9 /* FileExplorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99D87A61299F3EC300ED09A9 /* FileExplorer.swift */; }; 99D87A6529A04D5E00ED09A9 /* Inject in Frameworks */ = {isa = PBXBuildFile; productRef = 99D87A6429A04D5E00ED09A9 /* Inject */; }; 99DE640129A1271100B920BF /* AsyncFallibleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99DE640029A1271100B920BF /* AsyncFallibleButton.swift */; }; - 99DE640329A1624500B920BF /* View+SideStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99DE640229A1624500B920BF /* View+SideStore.swift */; }; + 99DE640329A1624500B920BF /* View+Hidden.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99DE640229A1624500B920BF /* View+Hidden.swift */; }; 99DE640629A1753800B920BF /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 99DE640529A1753800B920BF /* ZIPFoundation */; }; 99E59E1D299BFE5D00FAF33D /* AppIconsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99E59E1C299BFE5D00FAF33D /* AppIconsView.swift */; }; B3146ED2284F581E00BBC3FD /* Roxas.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3146ECD284F580500BBC3FD /* Roxas.framework */; }; @@ -645,7 +645,7 @@ 99D87A5F299F1B1100ED09A9 /* DevModeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevModeView.swift; sourceTree = ""; }; 99D87A61299F3EC300ED09A9 /* FileExplorer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorer.swift; sourceTree = ""; }; 99DE640029A1271100B920BF /* AsyncFallibleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncFallibleButton.swift; sourceTree = ""; }; - 99DE640229A1624500B920BF /* View+SideStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+SideStore.swift"; sourceTree = ""; }; + 99DE640229A1624500B920BF /* View+Hidden.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Hidden.swift"; sourceTree = ""; }; 99E59E1C299BFE5D00FAF33D /* AppIconsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIconsView.swift; sourceTree = ""; }; B3146EC6284F580500BBC3FD /* Roxas.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Roxas.xcodeproj; path = Dependencies/Roxas/Roxas.xcodeproj; sourceTree = ""; }; B33FFBA9295F8F78002259E6 /* preboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = preboard.c; path = src/preboard.c; sourceTree = ""; }; @@ -1067,8 +1067,8 @@ BF1614F1250822F100767AEA /* Roxas.framework in Frameworks */, B3C395F7284F362400DA9E2F /* AppCenterAnalytics in Frameworks */, 1F07F5672955D16A00F7BE95 /* SFSafeSymbols in Frameworks */, - 1FFA56C52999978C0011B6F5 /* LocalConsole in Frameworks */, BF66EE852501AE50007EE018 /* AltStoreCore.framework in Frameworks */, + 992C896029A6A56500FB3501 /* LocalConsole in Frameworks */, 99DE640629A1753800B920BF /* ZIPFoundation in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1970,7 +1970,7 @@ 1F66F5BD2938F06100A910CA /* StoreApp+Filterable.swift */, 1F180F91298E7A1B00D1C98B /* StoreApp+Trusted.swift */, 1F180F93298E7A2500D1C98B /* Source+Trusted.swift */, - 99DE640229A1624500B920BF /* View+SideStore.swift */, + 99DE640229A1624500B920BF /* View+Hidden.swift */, ); path = Extensions; sourceTree = ""; @@ -2330,9 +2330,9 @@ 1F74FF1D295263510047C051 /* AsyncImage */, 1F07F5662955D16A00F7BE95 /* SFSafeSymbols */, 1F1295802989B51F0048FCB9 /* ExpandableText */, - 1FFA56C42999978C0011B6F5 /* LocalConsole */, 99D87A6429A04D5E00ED09A9 /* Inject */, 99DE640529A1753800B920BF /* ZIPFoundation */, + 992C895F29A6A56500FB3501 /* LocalConsole */, ); productName = AltStore; productReference = BFD2476A2284B9A500981D42 /* SideStore.app */; @@ -2408,9 +2408,9 @@ 1F74FF1C295263510047C051 /* XCRemoteSwiftPackageReference "AsyncImage" */, 1F07F5652955D16A00F7BE95 /* XCRemoteSwiftPackageReference "SFSafeSymbols" */, 1F12957F2989B51F0048FCB9 /* XCRemoteSwiftPackageReference "ExpandableText" */, - 1FFA56C32999978C0011B6F5 /* XCRemoteSwiftPackageReference "LocalConsole" */, 99D87A6329A04D5E00ED09A9 /* XCRemoteSwiftPackageReference "Inject" */, 99DE640429A1753800B920BF /* XCRemoteSwiftPackageReference "ZIPFoundation" */, + 992C895E29A6A56500FB3501 /* XCRemoteSwiftPackageReference "LocalConsole" */, ); productRefGroup = BFD2476B2284B9A500981D42 /* Products */; projectDirPath = ""; @@ -2898,7 +2898,7 @@ BFF00D322501BDA100746320 /* BackgroundRefreshAppsOperation.swift in Sources */, 1F1D669E29A234CE0095BFCD /* WriteAppReviewView.swift in Sources */, 1F66F5BC2938F03700A910CA /* Modifiers.swift in Sources */, - 99DE640329A1624500B920BF /* View+SideStore.swift in Sources */, + 99DE640329A1624500B920BF /* View+Hidden.swift in Sources */, 1FA5A6CA298E8B2F007BA946 /* RefreshAttemptsView.swift in Sources */, 1F5DF9D82974426300DDAA47 /* AppScreenshot.swift in Sources */, 1F66F5BA2938CA5700A910CA /* VisualEffectView.swift in Sources */, @@ -3796,14 +3796,6 @@ kind = branch; }; }; - 1FFA56C32999978C0011B6F5 /* XCRemoteSwiftPackageReference "LocalConsole" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/duraidabdul/LocalConsole.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 1.0.0; - }; - }; 4879A95D2861046500FC1BBD /* XCRemoteSwiftPackageReference "AltSign" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SideStore/AltSign"; @@ -3820,6 +3812,14 @@ minimumVersion = 1.1.180; }; }; + 992C895E29A6A56500FB3501 /* XCRemoteSwiftPackageReference "LocalConsole" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/naturecodevoid/LocalConsole.git"; + requirement = { + branch = main; + kind = branch; + }; + }; 99C4EF472978D52400CB538D /* XCRemoteSwiftPackageReference "SemanticVersion" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SwiftPackageIndex/SemanticVersion.git"; @@ -3925,11 +3925,6 @@ package = 1F74FF1C295263510047C051 /* XCRemoteSwiftPackageReference "AsyncImage" */; productName = AsyncImage; }; - 1FFA56C42999978C0011B6F5 /* LocalConsole */ = { - isa = XCSwiftPackageProductDependency; - package = 1FFA56C32999978C0011B6F5 /* XCRemoteSwiftPackageReference "LocalConsole" */; - productName = LocalConsole; - }; 4879A95E2861046500FC1BBD /* AltSign */ = { isa = XCSwiftPackageProductDependency; package = 4879A95D2861046500FC1BBD /* XCRemoteSwiftPackageReference "AltSign" */; @@ -3940,6 +3935,11 @@ package = 4879A9602861049C00FC1BBD /* XCRemoteSwiftPackageReference "OpenSSL" */; productName = OpenSSL; }; + 992C895F29A6A56500FB3501 /* LocalConsole */ = { + isa = XCSwiftPackageProductDependency; + package = 992C895E29A6A56500FB3501 /* XCRemoteSwiftPackageReference "LocalConsole" */; + productName = LocalConsole; + }; 99C4EF4C2979132100CB538D /* SemanticVersion */ = { isa = XCSwiftPackageProductDependency; package = 99C4EF472978D52400CB538D /* XCRemoteSwiftPackageReference "SemanticVersion" */; diff --git a/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a4ebbd6f..9bce58ec 100644 --- a/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/AltStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -66,10 +66,10 @@ { "identity" : "localconsole", "kind" : "remoteSourceControl", - "location" : "https://github.com/duraidabdul/LocalConsole.git", + "location" : "https://github.com/naturecodevoid/LocalConsole.git", "state" : { - "revision" : "2c5d5e018acd4963fe6dfe858f6d6fecef7cbf2f", - "version" : "1.12.1" + "branch" : "main", + "revision" : "4ead9c3e565190172caac62b5179347e02999365" } }, { diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index ce1db769..89b32d0f 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -66,6 +66,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate { UserDefaults.registerDefaults() LCManager.shared.isVisible = UserDefaults.standard.isConsoleEnabled + LCManager.shared.isCharacterLimitDisabled = false // we want all logs exported DatabaseManager.shared.start { (error) in if let error = error diff --git a/AltStore/Generated/Localizations.swift b/AltStore/Generated/Localizations.swift index 612fad9e..7a481eb0 100644 --- a/AltStore/Generated/Localizations.swift +++ b/AltStore/Generated/Localizations.swift @@ -345,6 +345,8 @@ internal enum L10n { internal static let credits = L10n.tr("Localizable", "SettingsView.credits", fallback: "Credits") /// Debug internal static let debug = L10n.tr("Localizable", "SettingsView.debug", fallback: "Debug") + /// Export Logs + internal static let exportLogs = L10n.tr("Localizable", "SettingsView.exportLogs", fallback: "Export Logs") /// Refreshing Apps internal static let refreshingApps = L10n.tr("Localizable", "SettingsView.refreshingApps", fallback: "Refreshing Apps") /// Enable Background Refresh to automatically refresh apps in the background when connected to WiFi and with Wireguard active. diff --git a/AltStore/Resources/en.lproj/Localizable.strings b/AltStore/Resources/en.lproj/Localizable.strings index fb7b39e4..ee820eb6 100644 --- a/AltStore/Resources/en.lproj/Localizable.strings +++ b/AltStore/Resources/en.lproj/Localizable.strings @@ -61,6 +61,7 @@ "SettingsView.credits" = "Credits"; "SettingsView.title" = "Settings"; "SettingsView.refreshingAppsFooter" = "Enable Background Refresh to automatically refresh apps in the background when connected to WiFi and with Wireguard active."; +"SettingsView.exportLogs" = "Export Logs"; /* ConnectAppleIDView */ "ConnectAppleIDView.startWithSignIn" = "Sign in with your Apple ID to get started."; diff --git a/AltStore/Views/Settings/SettingsView.swift b/AltStore/Views/Settings/SettingsView.swift index e42a11c1..160ebc9d 100644 --- a/AltStore/Views/Settings/SettingsView.swift +++ b/AltStore/Views/Settings/SettingsView.swift @@ -36,6 +36,7 @@ struct SettingsView: View { @State var isShowingDevModeMenu = false @State var externalURLToShow: URL? + @State var quickLookURL: URL? let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown Version" @@ -165,6 +166,8 @@ struct SettingsView: View { NavigationLink(L10n.AdvancedSettingsView.title) { AdvancedSettingsView() } + + AsyncFallibleButton(action: self.exportLogs, label: { execute in Text(L10n.SettingsView.exportLogs) }) if MailComposeView.canSendMail { ModalNavigationLink("Send Feedback") { @@ -236,6 +239,7 @@ struct SettingsView: View { .sheet(item: $externalURLToShow) { url in SafariView(url: url) } + .quickLookPreview($quickLookURL) .enableInjection() } @@ -319,6 +323,31 @@ struct SettingsView: View { exit(0) } } + + func exportLogs() throws { + guard let path = FileManager.default.altstoreSharedDirectory?.appendingPathComponent("logs.txt") else { throw NSError(domain: "Failed to get path.", code: 1) } + var text = LCManager.shared.currentText + + // TODO: add more potentially sensitive info to this array like UDID + var remove = [String]() + if let connectedAppleID = connectedTeams.first { + remove.append(connectedAppleID.name) + remove.append(connectedAppleID.account.appleID) + remove.append(connectedAppleID.account.firstName) + remove.append(connectedAppleID.account.lastName) + remove.append(connectedAppleID.account.localizedName) + remove.append(connectedAppleID.account.identifier) + remove.append(connectedAppleID.identifier) + } + + for toRemove in remove { + text = text.replacingOccurrences(of: toRemove, with: "[removed]") + } + + guard let data = text.data(using: .utf8) else { throw NSError(domain: "Failed to get data.", code: 2) } + try data.write(to: path) + quickLookURL = path + } } struct SettingsView_Previews: PreviewProvider {