Skip to content

Commit cb7ddb0

Browse files
committed
v6.0.2
1 parent 719fae9 commit cb7ddb0

File tree

11 files changed

+128
-32
lines changed

11 files changed

+128
-32
lines changed

PureKFD.xcodeproj/project.pbxproj

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@
160160
/* End PBXBuildFile section */
161161

162162
/* Begin PBXContainerItemProxy section */
163-
657BA6AC2C9EDC030002FDAD /* PBXContainerItemProxy */ = {
164-
isa = PBXContainerItemProxy;
165-
containerPortal = 656C14A12C2D32D60017F279 /* Project object */;
166-
proxyType = 1;
167-
remoteGlobalIDString = 65916F392C9532C3005C8462;
168-
remoteInfo = SparseBox;
169-
};
170163
65916F3F2C9540C9005C8462 /* PBXContainerItemProxy */ = {
171164
isa = PBXContainerItemProxy;
172165
containerPortal = 656C14A12C2D32D60017F279 /* Project object */;
@@ -269,20 +262,8 @@
269262
65DA9E152C3100DC007D9AAA /* Popup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Popup.swift; sourceTree = "<group>"; };
270263
/* End PBXFileReference section */
271264

272-
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
273-
6589F2222CB1E93600F742D8 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
274-
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
275-
membershipExceptions = (
276-
Backend/SparseRestore/exploit/__init__.py,
277-
Backend/SparseRestore/exploit/backup.py,
278-
Backend/SparseRestore/exploit/mbdb.py,
279-
);
280-
target = 65486BA92C8571A9002E2F28 /* PureRestore */;
281-
};
282-
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
283-
284265
/* Begin PBXFileSystemSynchronizedRootGroup section */
285-
65486BAB2C8571A9002E2F28 /* PureRestore */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (6589F2222CB1E93600F742D8 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (Backend/SparseRestore/exploit, ); path = PureRestore; sourceTree = "<group>"; };
266+
65486BAB2C8571A9002E2F28 /* PureRestore */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (Backend/SparseRestore/exploit, ); path = PureRestore; sourceTree = "<group>"; };
286267
/* End PBXFileSystemSynchronizedRootGroup section */
287268

288269
/* Begin PBXFrameworksBuildPhase section */
@@ -687,7 +668,6 @@
687668
buildRules = (
688669
);
689670
dependencies = (
690-
657BA6AB2C9EDC030002FDAD /* PBXTargetDependency */,
691671
);
692672
name = "PureKFD noSparse";
693673
packageProductDependencies = (
@@ -927,11 +907,6 @@
927907
/* End PBXSourcesBuildPhase section */
928908

929909
/* Begin PBXTargetDependency section */
930-
657BA6AB2C9EDC030002FDAD /* PBXTargetDependency */ = {
931-
isa = PBXTargetDependency;
932-
target = 65916F392C9532C3005C8462 /* SparseBox */;
933-
targetProxy = 657BA6AC2C9EDC030002FDAD /* PBXContainerItemProxy */;
934-
};
935910
65916F402C9540C9005C8462 /* PBXTargetDependency */ = {
936911
isa = PBXTargetDependency;
937912
target = 65916F392C9532C3005C8462 /* SparseBox */;
@@ -948,6 +923,7 @@
948923
CODE_SIGN_ENTITLEMENTS = PureRestore/PureRestore.entitlements;
949924
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
950925
CODE_SIGN_STYLE = Automatic;
926+
CODE_SIGNING_ALLOWED = NO;
951927
COMBINE_HIDPI_IMAGES = YES;
952928
CURRENT_PROJECT_VERSION = 1;
953929
DEVELOPMENT_ASSET_PATHS = "";
@@ -979,6 +955,7 @@
979955
CODE_SIGN_ENTITLEMENTS = PureRestore/PureRestore.entitlements;
980956
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
981957
CODE_SIGN_STYLE = Automatic;
958+
CODE_SIGNING_ALLOWED = NO;
982959
COMBINE_HIDPI_IMAGES = YES;
983960
CURRENT_PROJECT_VERSION = 1;
984961
DEVELOPMENT_ASSET_PATHS = "";
@@ -1071,6 +1048,7 @@
10711048
ALWAYS_SEARCH_USER_PATHS = NO;
10721049
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
10731050
CLANG_ANALYZER_NONNULL = YES;
1051+
CODE_SIGNING_ALLOWED = NO;
10741052
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
10751053
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
10761054
CLANG_ENABLE_MODULES = YES;
@@ -1127,6 +1105,7 @@
11271105
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11281106
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
11291107
CODE_SIGN_STYLE = Automatic;
1108+
CODE_SIGNING_ALLOWED = NO;
11301109
CURRENT_PROJECT_VERSION = 1;
11311110
DEVELOPMENT_ASSET_PATHS = "";
11321111
DEVELOPMENT_TEAM = 6Q625HQD73;
@@ -1166,6 +1145,7 @@
11661145
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11671146
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
11681147
CODE_SIGN_STYLE = Automatic;
1148+
CODE_SIGNING_ALLOWED = NO;
11691149
CURRENT_PROJECT_VERSION = 1;
11701150
DEVELOPMENT_ASSET_PATHS = "";
11711151
DEVELOPMENT_TEAM = 6Q625HQD73;
@@ -1205,6 +1185,7 @@
12051185
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12061186
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12071187
CODE_SIGN_STYLE = Automatic;
1188+
CODE_SIGNING_ALLOWED = NO;
12081189
CURRENT_PROJECT_VERSION = 1;
12091190
DEVELOPMENT_ASSET_PATHS = "";
12101191
DEVELOPMENT_TEAM = 6Q625HQD73;
@@ -1247,6 +1228,7 @@
12471228
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12481229
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
12491230
CODE_SIGN_STYLE = Automatic;
1231+
CODE_SIGNING_ALLOWED = NO;
12501232
CURRENT_PROJECT_VERSION = 1;
12511233
DEVELOPMENT_ASSET_PATHS = "";
12521234
DEVELOPMENT_TEAM = 6Q625HQD73;
@@ -1287,6 +1269,7 @@
12871269
isa = XCBuildConfiguration;
12881270
buildSettings = {
12891271
CODE_SIGN_STYLE = Automatic;
1272+
CODE_SIGNING_ALLOWED = NO;
12901273
DEBUGGING_SYMBOLS = YES;
12911274
DEBUG_INFORMATION_FORMAT = dwarf;
12921275
DEVELOPMENT_TEAM = 6Q625HQD73;
@@ -1302,6 +1285,7 @@
13021285
isa = XCBuildConfiguration;
13031286
buildSettings = {
13041287
CODE_SIGN_STYLE = Automatic;
1288+
CODE_SIGNING_ALLOWED = NO;
13051289
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
13061290
DEVELOPMENT_TEAM = 6Q625HQD73;
13071291
OTHER_CFLAGS = "";
Binary file not shown.

PureKFD/Backend/RepoHandler.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class RepoHandler: ObservableObject {
2828
URL(string: "https://raw.githubusercontent.com/dora727/doworarepo/master/Essentials/manifest.json")!, // MeowRepo - Built for PureKFD v6
2929
URL(string: "https://raw.githubusercontent.com/Lrdsnow/SnowRepo/refs/heads/main/v6/repo.json")!, // SnowRepo - Built for PureKFD v6
3030
URL(string: "https://raw.githubusercontent.com/jailbreakdotparty/jailbreak.party-repo/refs/heads/main/v6/repo.json")!, // Jailbreak.party - Built for PureKFD v6
31+
URL(string: "https://raw.githubusercontent.com/lunginspector/SparseTweaks/refs/heads/main/v6/repo.json")!, // SparseTweaks - Built for PureKFD v6
3132
URL(string: "https://raw.githubusercontent.com/Dreel0akl/poopypoopermaybeworking/master/Essentials/manifest.json")!, // Poop Repo - Built for PureKFD
3233
URL(string: "https://raw.githubusercontent.com/circularsprojects/circles-repo/main/purekfd.json")!, // Circular's Repo - Built for PureKFD
3334
URL(string: "https://raw.githubusercontent.com/EPOS05/EPOSbox/main/purekfd.json")!, // EPOS Box - Built for PureKFD
@@ -53,13 +54,14 @@ public class RepoHandler: ObservableObject {
5354

5455
func updateRepos(_ appData: AppData) {
5556
for url in repo_urls {
56-
getRepo(url) { repo, error in
57+
getRepo(url, appData) { repo, error in
5758
if var repo = repo {
5859

5960
var new_pkgs: [Package] = []
6061
repo.packages.forEach({ pkg in
6162
var temp_pkg = pkg
6263
temp_pkg.feature = repo.featured?.first(where: { $0.bundleid == pkg.bundleid })
64+
temp_pkg._liveAccent = appData.getLiveAccent(temp_pkg.bundleid, temp_pkg.icon)
6365
new_pkgs.append(temp_pkg)
6466
})
6567
repo.packages = new_pkgs
@@ -97,11 +99,16 @@ public class RepoHandler: ObservableObject {
9799
}
98100
}
99101

100-
func getRepo(_ url: URL, completion: @escaping (Repo?, Error?) -> Void) {
102+
func getRepo(_ url: URL, _ appData: AppData? = nil, completion: @escaping (Repo?, Error?) -> Void) {
101103
AF.request(url).responseJASON { response in
102104
switch response.result {
103105
case .success(let json):
104-
completion(Repo(json, url), nil)
106+
var repo = Repo(json, url)
107+
if appData != nil,
108+
let repoKey = repo.url?.absoluteString {
109+
repo._liveAccent = appData?.getLiveAccent(repoKey, repo.iconURL)
110+
}
111+
completion(repo, nil)
105112
case .failure(let error):
106113
completion(Repo(error, url), error)
107114
}

PureKFD/Backend/Structs/AppData.swift

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,50 @@ public class AppData: ObservableObject {
2222
@AppStorage("FilterPackages") var filterPackages = true
2323
@AppStorage("savedExploitSettings") var savedSettings: [String: String] = [:]
2424

25+
@AppStorage("savedLiveAccents") var savedLiveAccents: [String: String] = [:]
26+
27+
func getLiveAccent(_ key: String, _ iconURL: URL?) -> Color? {
28+
if let saved = savedLiveAccents[key] {
29+
let comp = saved.components(separatedBy: ":")
30+
if let hex = comp.first,
31+
let oldIconURLKey = comp.last {
32+
if let iconURLKey = iconURL?.absoluteString {
33+
if oldIconURLKey != iconURLKey {
34+
return nil
35+
}
36+
}
37+
return Color(hex: hex)
38+
}
39+
}
40+
return nil
41+
}
42+
43+
func setPkgLiveAccent(_ color: Color?, _ bundleId: String, _ iconURL: URL?) {
44+
if let mainPKG = pkgs.firstIndex(where: { $0.bundleid == bundleId }) {
45+
pkgs[mainPKG]._liveAccent = color
46+
}
47+
if let installedPKG = installed_pkgs.firstIndex(where: { $0.bundleid == bundleId }) {
48+
installed_pkgs[installedPKG]._liveAccent = color
49+
}
50+
if let updatePKG = available_updates.firstIndex(where: { $0.bundleid == bundleId }) {
51+
available_updates[updatePKG]._liveAccent = color
52+
}
53+
if let hex = color?.toHex(),
54+
let iconURLKey = iconURL?.absoluteString {
55+
savedLiveAccents[bundleId] = "\(hex):\(iconURLKey)"
56+
}
57+
}
58+
59+
func setRepoLiveAccent(_ color: Color?, _ url: URL?, _ iconURL: URL?) {
60+
if let repo = repos.firstIndex(where: { $0.url == url }) {
61+
repos[repo]._liveAccent = color
62+
}
63+
if let hex = color?.toHex(),
64+
let urlKey = url?.absoluteString,
65+
let iconURLKey = iconURL?.absoluteString {
66+
savedLiveAccents[urlKey] = "\(hex):\(iconURLKey)"
67+
}
68+
}
69+
2570
static let shared = AppData()
2671
}

PureKFD/Backend/Structs/Package.swift

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,42 @@ public struct Package: Codable {
4444
}
4545
var installed: Bool
4646

47+
var _liveAccent: Color? = nil
48+
49+
private enum CodingKeys: String, CodingKey {
50+
// Package Info
51+
case name
52+
case bundleid
53+
case author
54+
case version
55+
case description
56+
case long_description
57+
case icon
58+
case accent
59+
case accentRow
60+
case screenshots
61+
case banner
62+
case category
63+
case depiction
64+
65+
// Install Values
66+
case path
67+
case versions
68+
69+
// Repo Values
70+
case url
71+
case repo
72+
case feature
73+
74+
// Installed Values
75+
case disabled
76+
case hasprefs
77+
case hasRestore
78+
case error
79+
case varonly
80+
case installed
81+
}
82+
4783
// JSON init stuff
4884
init(_ json: [String: Any], _ _repo: Repo?, _ _featured: [Featured]?) {
4985
name = json["name"] as? String ?? "Unknown Tweak"
@@ -63,6 +99,9 @@ public struct Package: Codable {
6399
}
64100
accent = json["accent"] as? String
65101
accentRow = json["accentRow"] as? String ?? _repo?.defaultRowAccent
102+
if let _override_accent = json["FORCE_ACCENT_OVERRIDE"] as? String {
103+
_liveAccent = Color(hex: _override_accent)
104+
}
66105
let _banner = json["banner"] as? String
67106
if let _banner = _banner {
68107
if _banner.hasPrefix("https://") || _banner.hasPrefix("http://") {

PureKFD/Backend/Structs/Repo.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ public struct Repo: Codable, Hashable {
5757
}
5858
}
5959

60+
var _liveAccent: Color? = nil
61+
62+
private enum CodingKeys: String, CodingKey {
63+
case name
64+
case description
65+
case url
66+
case fullURL
67+
case icon
68+
case accent
69+
case featured
70+
case packages
71+
case defaultRowAccent
72+
case error
73+
}
74+
6075
init(_ _error: Error, _ _url: URL?) {
6176
name = "Unknown Repo"
6277
description = _url?.absoluteString ?? _error.localizedDescription

PureKFD/Views/BrowseView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ struct RepoListRowView: View {
157157
if let uiImage = state.imageContainer?.image,
158158
let accentColor = averageColor(from: uiImage) {
159159
accent = Color(accentColor.bright())
160+
appData.setRepoLiveAccent(accent, repo.url, repo.iconURL)
160161
}
161162
}
162163
}
@@ -177,7 +178,9 @@ struct RepoListRowView: View {
177178
Image(systemName: "chevron.right").foregroundColor(accent ?? repo.accentColor ?? .accentColor).font(.footnote)
178179
}
179180
}.padding()
180-
}.background(RoundedRectangle(cornerRadius: 25).foregroundColor((accent ?? repo.accentColor ?? .accentColor).opacity(0.1))).listRowSeparator(.hidden).contextMenu {
181+
}.background(RoundedRectangle(cornerRadius: 25).foregroundColor((accent ?? repo.accentColor ?? .accentColor).opacity(0.1))).listRowSeparator(.hidden).onAppear() {
182+
accent = repo._liveAccent
183+
}.contextMenu {
181184
if let url = repo.prettyURL {
182185
Text(url).font(.footnote).minimumScaleFactor(0.5).lineLimit(1).opacity(0.5)
183186
}

PureKFD/Views/InstalledView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ struct InstalledView: View {
240240

241241
if tweak.hasRestore {
242242
Button(action: {
243-
TweakHandler.applyTweak(pkg: tweak, appData.selectedExploit, .restore, saveEnv)
243+
TweakHandler.applyTweaks(pkgs: [tweak], appData.selectedExploit, .restore, savedSettings, saveEnv)
244244
}, label: {
245245
HStack {
246246
Text("Restore Files")

PureKFD/Views/SubViews/Prefs/purePrefs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct PrefView: View {
5353
} else {
5454
loadingView()
5555
}
56-
}
56+
}.accentColor(selectedTweak?._liveAccent)
5757
}
5858

5959
func loadPreferences(pkgpath: URL) {

PureKFD/Views/SubViews/RepoView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ struct TweakListRowView: View {
140140
let accentColor = averageColor(from: uiImage) {
141141
DispatchQueue.main.async {
142142
accent = Color(accentColor.bright())
143+
appData.setPkgLiveAccent(accent, tweak.bundleid, tweak.icon)
143144
}
144145
}
145146
}
@@ -179,6 +180,7 @@ struct TweakListRowView: View {
179180
}.padding())
180181
)
181182
}.background(RoundedRectangle(cornerRadius: 25).foregroundColor((accent ?? tweak.accentColor ?? tweak.repo?.accentColor ?? .accentColor).opacity(0.1))).onAppear() {
183+
accent = tweak._liveAccent
182184
if search {
183185
Task(priority: .background) {
184186
DispatchQueue.main.asyncAfter(deadline: .now()+2, execute: {

0 commit comments

Comments
 (0)