Skip to content

Commit 20ff850

Browse files
Removed .theme import, added plain theme support
1 parent 216ad19 commit 20ff850

File tree

7 files changed

+24
-242
lines changed

7 files changed

+24
-242
lines changed

TrollTools.xcodeproj/project.pbxproj

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
CE2BF83C2902E14E00AD10BE /* Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = CE2BF83B2902E14E00AD10BE /* Dynamic */; };
2525
CE2BF83F2902E18900AD10BE /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE2BF83E2902E18900AD10BE /* CoreServices.framework */; };
2626
CE2BF8452902E21D00AD10BE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE2BF8442902E21D00AD10BE /* Assets.xcassets */; };
27-
CEDE254429030238006078DD /* DebToIPA.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDE254329030238006078DD /* DebToIPA.swift */; };
28-
CEDE25472903025F006078DD /* SWCompression in Frameworks */ = {isa = PBXBuildFile; productRef = CEDE25462903025F006078DD /* SWCompression */; };
29-
CEDE254A29030277006078DD /* Zip in Frameworks */ = {isa = PBXBuildFile; productRef = CEDE254929030277006078DD /* Zip */; };
30-
CEDE254D29030297006078DD /* ArArchiveKit in Frameworks */ = {isa = PBXBuildFile; productRef = CEDE254C29030297006078DD /* ArArchiveKit */; };
3127
/* End PBXBuildFile section */
3228

3329
/* Begin PBXFileReference section */
@@ -51,18 +47,14 @@
5147
CE2BF8392902E13900AD10BE /* TrollTools-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TrollTools-Bridging-Header.h"; sourceTree = "<group>"; };
5248
CE2BF83E2902E18900AD10BE /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
5349
CE2BF8442902E21D00AD10BE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
54-
CEDE254329030238006078DD /* DebToIPA.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebToIPA.swift; sourceTree = "<group>"; };
5550
/* End PBXFileReference section */
5651

5752
/* Begin PBXFrameworksBuildPhase section */
5853
CE2BF7B42902DFF300AD10BE /* Frameworks */ = {
5954
isa = PBXFrameworksBuildPhase;
6055
buildActionMask = 2147483647;
6156
files = (
62-
CEDE25472903025F006078DD /* SWCompression in Frameworks */,
63-
CEDE254D29030297006078DD /* ArArchiveKit in Frameworks */,
6457
CE2BF83F2902E18900AD10BE /* CoreServices.framework in Frameworks */,
65-
CEDE254A29030277006078DD /* Zip in Frameworks */,
6658
CE2BF83C2902E14E00AD10BE /* Dynamic in Frameworks */,
6759
);
6860
runOnlyForDeploymentPostprocessing = 0;
@@ -96,7 +88,6 @@
9688
CE2BF8392902E13900AD10BE /* TrollTools-Bridging-Header.h */,
9789
CE2BF81F2902E07F00AD10BE /* Private APIs */,
9890
CE2BF8182902E07F00AD10BE /* RootView.swift */,
99-
CEDE254329030238006078DD /* DebToIPA.swift */,
10091
CE2BF8192902E07F00AD10BE /* TS */,
10192
CE2BF8102902E07F00AD10BE /* Views */,
10293
CE2BF8172902E07F00AD10BE /* WebClipTemplate.plist */,
@@ -171,9 +162,6 @@
171162
name = TrollTools;
172163
packageProductDependencies = (
173164
CE2BF83B2902E14E00AD10BE /* Dynamic */,
174-
CEDE25462903025F006078DD /* SWCompression */,
175-
CEDE254929030277006078DD /* Zip */,
176-
CEDE254C29030297006078DD /* ArArchiveKit */,
177165
);
178166
productName = TrollTools;
179167
productReference = CE2BF7B72902DFF300AD10BE /* TrollTools.app */;
@@ -206,9 +194,6 @@
206194
mainGroup = CE2BF7AE2902DFF300AD10BE;
207195
packageReferences = (
208196
CE2BF83A2902E14E00AD10BE /* XCRemoteSwiftPackageReference "Dynamic" */,
209-
CEDE25452903025F006078DD /* XCRemoteSwiftPackageReference "SWCompression" */,
210-
CEDE254829030277006078DD /* XCRemoteSwiftPackageReference "Zip" */,
211-
CEDE254B29030296006078DD /* XCRemoteSwiftPackageReference "ArArchiveKit" */,
212197
);
213198
productRefGroup = CE2BF7B82902DFF300AD10BE /* Products */;
214199
projectDirPath = "";
@@ -241,7 +226,6 @@
241226
CE2BF8372902E10900AD10BE /* TrollToolsApp.swift in Sources */,
242227
CE2BF8262902E07F00AD10BE /* ImagePickerView.swift in Sources */,
243228
CE2BF8312902E07F00AD10BE /* BadgeChanger.swift in Sources */,
244-
CEDE254429030238006078DD /* DebToIPA.swift in Sources */,
245229
CE2BF82C2902E07F00AD10BE /* TSUtil.m in Sources */,
246230
CE2BF8252902E07F00AD10BE /* MaterialView.swift in Sources */,
247231
CE2BF8272902E07F00AD10BE /* BadgeChangerView.swift in Sources */,
@@ -377,7 +361,7 @@
377361
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
378362
CLANG_ENABLE_MODULES = YES;
379363
CODE_SIGN_STYLE = Automatic;
380-
CURRENT_PROJECT_VERSION = 2;
364+
CURRENT_PROJECT_VERSION = 1;
381365
DEVELOPMENT_TEAM = 92S6JX27W2;
382366
ENABLE_PREVIEWS = YES;
383367
GENERATE_INFOPLIST_FILE = YES;
@@ -392,7 +376,7 @@
392376
"$(inherited)",
393377
"@executable_path/Frameworks",
394378
);
395-
MARKETING_VERSION = 1.1.1;
379+
MARKETING_VERSION = 1.2;
396380
PRODUCT_BUNDLE_IDENTIFIER = net.sourceloc.TrollTools;
397381
PRODUCT_NAME = "$(TARGET_NAME)";
398382
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -410,7 +394,7 @@
410394
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
411395
CLANG_ENABLE_MODULES = YES;
412396
CODE_SIGN_STYLE = Automatic;
413-
CURRENT_PROJECT_VERSION = 2;
397+
CURRENT_PROJECT_VERSION = 1;
414398
DEVELOPMENT_TEAM = 92S6JX27W2;
415399
ENABLE_PREVIEWS = YES;
416400
GENERATE_INFOPLIST_FILE = YES;
@@ -425,7 +409,7 @@
425409
"$(inherited)",
426410
"@executable_path/Frameworks",
427411
);
428-
MARKETING_VERSION = 1.1.1;
412+
MARKETING_VERSION = 1.2;
429413
PRODUCT_BUNDLE_IDENTIFIER = net.sourceloc.TrollTools;
430414
PRODUCT_NAME = "$(TARGET_NAME)";
431415
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -467,30 +451,6 @@
467451
kind = branch;
468452
};
469453
};
470-
CEDE25452903025F006078DD /* XCRemoteSwiftPackageReference "SWCompression" */ = {
471-
isa = XCRemoteSwiftPackageReference;
472-
repositoryURL = "https://github.com/tsolomko/SWCompression";
473-
requirement = {
474-
branch = develop;
475-
kind = branch;
476-
};
477-
};
478-
CEDE254829030277006078DD /* XCRemoteSwiftPackageReference "Zip" */ = {
479-
isa = XCRemoteSwiftPackageReference;
480-
repositoryURL = "https://github.com/marmelroy/Zip";
481-
requirement = {
482-
branch = master;
483-
kind = branch;
484-
};
485-
};
486-
CEDE254B29030296006078DD /* XCRemoteSwiftPackageReference "ArArchiveKit" */ = {
487-
isa = XCRemoteSwiftPackageReference;
488-
repositoryURL = "https://github.com/LebJe/ArArchiveKit";
489-
requirement = {
490-
kind = upToNextMajorVersion;
491-
minimumVersion = 0.3.0;
492-
};
493-
};
494454
/* End XCRemoteSwiftPackageReference section */
495455

496456
/* Begin XCSwiftPackageProductDependency section */
@@ -499,21 +459,6 @@
499459
package = CE2BF83A2902E14E00AD10BE /* XCRemoteSwiftPackageReference "Dynamic" */;
500460
productName = Dynamic;
501461
};
502-
CEDE25462903025F006078DD /* SWCompression */ = {
503-
isa = XCSwiftPackageProductDependency;
504-
package = CEDE25452903025F006078DD /* XCRemoteSwiftPackageReference "SWCompression" */;
505-
productName = SWCompression;
506-
};
507-
CEDE254929030277006078DD /* Zip */ = {
508-
isa = XCSwiftPackageProductDependency;
509-
package = CEDE254829030277006078DD /* XCRemoteSwiftPackageReference "Zip" */;
510-
productName = Zip;
511-
};
512-
CEDE254C29030297006078DD /* ArArchiveKit */ = {
513-
isa = XCSwiftPackageProductDependency;
514-
package = CEDE254B29030296006078DD /* XCRemoteSwiftPackageReference "ArArchiveKit" */;
515-
productName = ArArchiveKit;
516-
};
517462
/* End XCSwiftPackageProductDependency section */
518463
};
519464
rootObject = CE2BF7AF2902DFF300AD10BE /* Project object */;

TrollTools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TrollTools/DebToIPA.swift

Lines changed: 0 additions & 95 deletions
This file was deleted.

TrollTools/Private APIs/PasscodeKeyFaceManager.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,10 @@ class PasscodeKeyFaceManager {
4444
}
4545
}
4646

47-
4847
static func getFaces() throws -> [UIImage?] {
49-
let fm = FileManager.default
50-
return try (try fm.contentsOfDirectory(at: telephonyUIURL, includingPropertiesForKeys: nil))
51-
.sorted(by: { url1, url2 in
52-
url1.lastPathComponent[3] < url2.lastPathComponent[3]
53-
})
54-
.map { UIImage(data: try Data(contentsOf: $0)) }
48+
return try [0,1,2,3,4,5,6,7,8,9].map { try getFace(for: $0) }
5549
}
50+
5651
static func getFace(for n: Int) throws -> UIImage? {
5752
return UIImage(data: try Data(contentsOf: getURL(for: n)))
5853
}

TrollTools/Private APIs/ThemeManager.swift

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ class ThemeManager {
3030

3131
static func set(theme: Theme) throws {
3232
let iconBundlesURL = theme.url.appendingPathComponent("IconBundles")
33-
if !fm.fileExists(atPath: activeIconsDir.path) {
34-
try fm.createDirectory(at: activeIconsDir, withIntermediateDirectories: true)
35-
}
33+
try? fm.createDirectory(at: activeIconsDir, withIntermediateDirectories: true)
3634

3735
let filesInIconBundles = try fm.contentsOfDirectory(at: iconBundlesURL, includingPropertiesForKeys: nil)
3836

@@ -106,22 +104,15 @@ class ThemeManager {
106104
}
107105

108106
static func importTheme(from importURL: URL) throws -> Theme {
109-
let rawIcons = !fm.fileExists(atPath: importURL.appendingPathExtension("IconBundles").path)
110107
let name = importURL.deletingPathExtension().lastPathComponent
111-
if rawIcons {
112-
let themeURL = themesDir.appendingPathComponent(name)
113-
try fm.createDirectory(at: themeURL, withIntermediateDirectories: true)
114-
try fm.copyItem(at: importURL, to: themeURL.appendingPathComponent("IconBundles"))
115-
} else {
116-
if !fm.fileExists(atPath: themesDir.path) {
117-
try fm.createDirectory(at: themesDir, withIntermediateDirectories: true)
118-
}
119-
120-
try fm.copyItem(at: importURL, to: themesDir.appendingPathComponent(name))
121-
}
108+
try? fm.createDirectory(at: themesDir, withIntermediateDirectories: true)
109+
let themeURL = themesDir.appendingPathComponent(name)
110+
111+
try? fm.removeItem(at: themeURL)
112+
try fm.createDirectory(at: themeURL, withIntermediateDirectories: true)
113+
try fm.copyItem(at: importURL, to: themeURL.appendingPathComponent("IconBundles"))
122114

123-
let targetURL = themesDir.appendingPathComponent(name)
124-
return Theme(name: targetURL.deletingPathExtension().lastPathComponent, iconCount: try fm.contentsOfDirectory(at: targetURL.appendingPathComponent("IconBundles"), includingPropertiesForKeys: nil).count)
115+
return Theme(name: themeURL.deletingPathExtension().lastPathComponent, iconCount: try fm.contentsOfDirectory(at: themeURL.appendingPathComponent("IconBundles"), includingPropertiesForKeys: nil).count)
125116
}
126117

127118
static func removeImportedTheme(theme: Theme) throws {

0 commit comments

Comments
 (0)