Skip to content

Commit a62a448

Browse files
author
leminlimez
committed
opening .passthm files externally
1 parent 1a57ec6 commit a62a448

File tree

13 files changed

+64
-80
lines changed

13 files changed

+64
-80
lines changed

.DS_Store

2 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

TrollTools/.DS_Store

0 Bytes
Binary file not shown.
6 KB
Binary file not shown.
0 Bytes
Binary file not shown.

TrollTools/Info.plist

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<dict>
2626
<key>UTTypeConformsTo</key>
2727
<array>
28-
<string>com.apple.package</string>
28+
<string>public.data</string>
29+
<string>public.archive</string>
2930
</array>
3031
<key>UTTypeDescription</key>
3132
<string>Passcode Theme File</string>
@@ -38,6 +39,7 @@
3839
<key>public.filename-extension</key>
3940
<array>
4041
<string>passthm</string>
42+
<string>PASSTHM</string>
4143
</array>
4244
</dict>
4345
</dict>
@@ -47,7 +49,8 @@
4749
<dict>
4850
<key>UTTypeConformsTo</key>
4951
<array>
50-
<string>public.directory</string>
52+
<string>public.data</string>
53+
<string>public.archive</string>
5154
</array>
5255
<key>UTTypeDescription</key>
5356
<string>Passcode Theme File</string>
@@ -60,6 +63,7 @@
6063
<key>public.filename-extension</key>
6164
<array>
6265
<string>passthm</string>
66+
<string>PASSTHM</string>
6367
</array>
6468
</dict>
6569
</dict>

TrollTools/Other/TrollToolsApp.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ struct TrollToolsApp: App {
2929
}
3030
try? RootHelper.loadMCM()
3131
}
32+
.onOpenURL(perform: { url in
33+
// for opening passthm files
34+
if url.pathExtension.lowercased() == "passthm" {
35+
let defaultKeySize = PasscodeKeyFaceManager.getDefaultFaceSize()
36+
do {
37+
// try appying the themes
38+
try PasscodeKeyFaceManager.setFacesFromTheme(url, keySize: CGFloat(defaultKeySize), customX: CGFloat(150), customY: CGFloat(150))
39+
// show the passcode screen
40+
//PasscodeEditorView()
41+
ToolsView().activateView(viewName: "PasscodeEditorView", isActive: true)
42+
} catch { UIApplication.shared.alert(body: error.localizedDescription) }
43+
}
44+
})
3245
}
3346
}
3447
}

0 commit comments

Comments
 (0)