diff --git a/.DS_Store b/.DS_Store
index ec20be8..4692b27 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper b/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper
index 954e7f4..7aa8090 100755
Binary files a/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper and b/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper differ
diff --git a/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper.dSYM/Contents/Resources/DWARF/trolltoolsroothelper b/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper.dSYM/Contents/Resources/DWARF/trolltoolsroothelper
index e4b6cae..9006bce 100644
Binary files a/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper.dSYM/Contents/Resources/DWARF/trolltoolsroothelper and b/RootHelper/.theos/obj/debug/arm64/trolltoolsroothelper.dSYM/Contents/Resources/DWARF/trolltoolsroothelper differ
diff --git a/RootHelper/.theos/obj/debug/trolltoolsroothelper b/RootHelper/.theos/obj/debug/trolltoolsroothelper
index 04f711a..45433ec 100755
Binary files a/RootHelper/.theos/obj/debug/trolltoolsroothelper and b/RootHelper/.theos/obj/debug/trolltoolsroothelper differ
diff --git a/TrollTools.xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate b/TrollTools.xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate
index 6625acb..8798984 100644
Binary files a/TrollTools.xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate and b/TrollTools.xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/TrollTools/.DS_Store b/TrollTools/.DS_Store
index 2592265..f95abb6 100644
Binary files a/TrollTools/.DS_Store and b/TrollTools/.DS_Store differ
diff --git a/TrollTools/Assets.xcassets/.DS_Store b/TrollTools/Assets.xcassets/.DS_Store
index 8927f0d..d82e620 100644
Binary files a/TrollTools/Assets.xcassets/.DS_Store and b/TrollTools/Assets.xcassets/.DS_Store differ
diff --git a/TrollTools/Assets.xcassets/screens/.DS_Store b/TrollTools/Assets.xcassets/screens/.DS_Store
index 0af8a42..7695375 100644
Binary files a/TrollTools/Assets.xcassets/screens/.DS_Store and b/TrollTools/Assets.xcassets/screens/.DS_Store differ
diff --git a/TrollTools/Info.plist b/TrollTools/Info.plist
index 3cb21e0..6997cbf 100644
--- a/TrollTools/Info.plist
+++ b/TrollTools/Info.plist
@@ -25,7 +25,8 @@
UTTypeConformsTo
- com.apple.package
+ public.data
+ public.archive
UTTypeDescription
Passcode Theme File
@@ -38,6 +39,7 @@
public.filename-extension
passthm
+ PASSTHM
@@ -47,7 +49,8 @@
UTTypeConformsTo
- public.directory
+ public.data
+ public.archive
UTTypeDescription
Passcode Theme File
@@ -60,6 +63,7 @@
public.filename-extension
passthm
+ PASSTHM
diff --git a/TrollTools/Other/TrollToolsApp.swift b/TrollTools/Other/TrollToolsApp.swift
index 666e287..6ee4bbc 100644
--- a/TrollTools/Other/TrollToolsApp.swift
+++ b/TrollTools/Other/TrollToolsApp.swift
@@ -29,6 +29,19 @@ struct TrollToolsApp: App {
}
try? RootHelper.loadMCM()
}
+ .onOpenURL(perform: { url in
+ // for opening passthm files
+ if url.pathExtension.lowercased() == "passthm" {
+ let defaultKeySize = PasscodeKeyFaceManager.getDefaultFaceSize()
+ do {
+ // try appying the themes
+ try PasscodeKeyFaceManager.setFacesFromTheme(url, keySize: CGFloat(defaultKeySize), customX: CGFloat(150), customY: CGFloat(150))
+ // show the passcode screen
+ //PasscodeEditorView()
+ ToolsView().activateView(viewName: "PasscodeEditorView", isActive: true)
+ } catch { UIApplication.shared.alert(body: error.localizedDescription) }
+ }
+ })
}
}
}
diff --git a/TrollTools/Views/.DS_Store b/TrollTools/Views/.DS_Store
index 5008ddf..3beae43 100644
Binary files a/TrollTools/Views/.DS_Store and b/TrollTools/Views/.DS_Store differ
diff --git a/TrollTools/Views/Tools/PasscodeEditorView.swift b/TrollTools/Views/Tools/PasscodeEditorView.swift
index d695cbb..6df0e09 100644
--- a/TrollTools/Views/Tools/PasscodeEditorView.swift
+++ b/TrollTools/Views/Tools/PasscodeEditorView.swift
@@ -81,7 +81,7 @@ struct PasscodeEditorView: View {
// export key
Button(action: {
do {
- var archiveURL: URL? = try PasscodeKeyFaceManager.exportFaceTheme()
+ let archiveURL: URL? = try PasscodeKeyFaceManager.exportFaceTheme()
// show share menu
let avc = UIActivityViewController(activityItems: [archiveURL!], applicationActivities: nil)
let view: UIView = UIApplication.shared.windows.first!.rootViewController!.view
@@ -174,7 +174,7 @@ struct PasscodeEditorView: View {
let customAction = UIAlertAction(title: "Custom", style: .default) { (action) in
// ask the user for a custom size
- var sizeAlert = UIAlertController(title: "Enter Key Dimensions", message: "Min: "+String(sizeLimit[0])+", Max: "+String(sizeLimit[1]), preferredStyle: .alert)
+ let sizeAlert = UIAlertController(title: "Enter Key Dimensions", message: "Min: "+String(sizeLimit[0])+", Max: "+String(sizeLimit[1]), preferredStyle: .alert)
// bring up the text prompts
sizeAlert.addTextField { (textField) in
// text field for width
@@ -357,7 +357,7 @@ struct PasscodeKeyView: View {
ZStack {
Circle()
.fill(Color(UIColor(red: 1, green: 1, blue: 1, alpha: 0.12)))
- .frame(width: 70, height: 70) // background circle
+ .frame(width: 78, height: 78) // background circle
Circle()
.fill(Color(UIColor(red: 1, green: 1, blue: 1, alpha: 0))) // hidden circle for image
if face == nil {
diff --git a/TrollTools/Views/Tools/ToolsView.swift b/TrollTools/Views/Tools/ToolsView.swift
index b9065bf..db1315c 100644
--- a/TrollTools/Views/Tools/ToolsView.swift
+++ b/TrollTools/Views/Tools/ToolsView.swift
@@ -16,6 +16,15 @@ struct ToolsView: View {
var imageName: String
}
+ struct GeneralOption: Identifiable {
+ var key: String
+ var id = UUID()
+ var view: AnyView
+ var title: String
+ var imageName: String
+ var active: Bool = false
+ }
+
@State var springboardOptions: [SpringboardOption] = [
.init(value: false, key: "SBShowRSSI", title: "Numeric Wi-Fi Strength", imageName: "wifi"),
@@ -29,85 +38,31 @@ struct ToolsView: View {
.init(value: false, key: "SBControlCenterDemo", title: "CC AirPlay Radar", imageName: "wifi.circle"),
]
+ @State var generalOptions: [GeneralOption] = [
+ .init(key: "GesturesView", view: AnyView(GesturesView()), title: "iPhone X Gestures", imageName: "iphone"),
+ .init(key: "BadgeChangerView", view: AnyView(BadgeChangerView()), title: "Custom Badges", imageName: "app.badge"),
+ .init(key: "PasscodeEditorView", view: AnyView(PasscodeEditorView()), title: "Passcode faces", imageName: "ellipsis.rectangle"),
+ .init(key: "CarrierNameChangerView", view: AnyView(CarrierNameChangerView()), title: "Custom Carrier Name", imageName: "chart.bar"),
+ .init(key: "LockscreenRespringView", view: AnyView(LockscreenRespringView()), title: "Locking after Respring", imageName: "lock"),
+ .init(key: "CalculatorErrorView", view: AnyView(CalculatorErrorView()), title: "Calculator Error Message", imageName: "function"),
+ .init(key: "LSFootnoteChangerView", view: AnyView(LSFootnoteChangerView()), title: "Lock Screen Footnote", imageName: "platter.filled.bottom.and.arrow.down.iphone"),
+ ]
+
var body: some View {
NavigationView {
List {
Section {
- NavigationLink(destination: GesturesView()) {
- HStack {
- Image(systemName: "iphone")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("iPhone X Gestures")
- .padding(.horizontal, 10)
- }
- }
- NavigationLink(destination: BadgeChangerView()) {
- HStack {
- Image(systemName: "app.badge")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("Custom Badges")
- .padding(.horizontal, 8)
- }
- }
- NavigationLink(destination: PasscodeEditorView()) {
- HStack {
- Image(systemName: "ellipsis.rectangle")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("Passcode faces")
- .padding(.horizontal, 8)
- }
- }
- NavigationLink(destination: CarrierNameChangerView()) {
- HStack {
- Image(systemName: "chart.bar")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("Custom Carrier Name")
- .padding(.horizontal, 8)
- }
- }
- NavigationLink(destination: LockscreenRespringView()) {
- HStack {
- Image(systemName: "lock")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("Locking after Respring")
- .padding(.horizontal, 8)
- }
- }
- NavigationLink(destination: CalculatorErrorView()) {
- HStack {
- Image(systemName: "function")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("Calculator Error Message")
- .padding(.horizontal, 8)
- }
- }
- NavigationLink(destination: LSFootnoteChangerView()) {
- HStack {
- Image(systemName: "platter.filled.bottom.and.arrow.down.iphone")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(width: 24, height: 24)
- .foregroundColor(.blue)
- Text("Lock Screen Footnote")
- .padding(.horizontal, 8)
+ ForEach($generalOptions) { option in
+ NavigationLink(destination: option.view.wrappedValue, isActive: option.active) {
+ HStack {
+ Image(systemName: option.imageName.wrappedValue)
+ .resizable()
+ .aspectRatio(contentMode: .fit)
+ .frame(width: 24, height: 24)
+ .foregroundColor(.blue)
+ Text(option.title.wrappedValue)
+ .padding(.horizontal, 8)
+ }
}
}
} header: {
@@ -178,6 +133,18 @@ struct ToolsView: View {
// write to file
try RootHelper.writeStr(String(decoding: plistData, as: UTF8.self), to: url)
}
+
+ func activateView(viewName: String, isActive: Bool) {
+ for (i, option) in generalOptions.enumerated() {
+ if option.key == viewName {
+ var option = generalOptions[i]
+ option.active = isActive
+ generalOptions[i] = option
+ print("Activity: " + String(generalOptions[i].active) )
+ return
+ }
+ }
+ }
}
struct ToolsView_Previews: PreviewProvider {