From 178145f57e00c755a7518c259ecdbe77e2514556 Mon Sep 17 00:00:00 2001
From: Magesh K <47920326+mahee96@users.noreply.github.com>
Date: Thu, 26 Dec 2024 04:26:43 +0530
Subject: [PATCH] [Settings]: added toggle for ExportResignedApps to export
resigned apps to SideStore Documents dir
---
AltStore/Managing Apps/AppManager.swift | 6 +-
AltStore/Settings/Settings.storyboard | 68 ++++++++++++++-----
.../Settings/SettingsViewController.swift | 10 ++-
.../Extensions/UserDefaults+AltStore.swift | 2 +
4 files changed, 68 insertions(+), 18 deletions(-)
diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift
index 90f84774..bea66ab7 100644
--- a/AltStore/Managing Apps/AppManager.swift
+++ b/AltStore/Managing Apps/AppManager.swift
@@ -1762,6 +1762,10 @@ private extension AppManager
private func exportResginedAppsToDocsDir(_ resignedApp: ALTApplication)
{
+ // Check if the user has enabled exporting resigned apps to the Documents directory and continue
+ guard UserDefaults.standard.isResignedAppExportEnabled else {
+ return
+ }
let sourceURL = resignedApp.fileURL
@@ -1777,7 +1781,7 @@ private extension AppManager
return
}
-// let destinationURL = resignedAppsURL.appendingPathComponent(sourceURL.lastPathComponent)
+// let destinationURL = resignedAppsURL.appendingPathComponent(sourceURL.lastPathComponent)
let utis = Bundle(url: resignedApp.fileURL)?.infoDictionary?[Bundle.Info.exportedUTIs] as? [[String: Any]]
let isAltBackup = utis?.first?["UTTypeDescription"] as? String == "AltStore Backup App"
diff --git a/AltStore/Settings/Settings.storyboard b/AltStore/Settings/Settings.storyboard
index 37f292d9..2ddb3435 100644
--- a/AltStore/Settings/Settings.storyboard
+++ b/AltStore/Settings/Settings.storyboard
@@ -21,7 +21,7 @@
-
+