-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from leminlimez/main
LS Footnote, improved passcode stuff, and other fixes
- Loading branch information
Showing
16 changed files
with
272 additions
and
71 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file modified
BIN
-201 Bytes
(100%)
...s/obj/debug/arm64/trolltoolsroothelper.dSYM/Contents/Resources/DWARF/trolltoolsroothelper
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
TrollTools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "dynamic", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mhdhejazi/Dynamic", | ||
"state" : { | ||
"branch" : "master", | ||
"revision" : "772883073d044bc754d401cabb6574624eb3778f" | ||
} | ||
}, | ||
{ | ||
"identity" : "map", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/pauljohanneskraft/Map", | ||
"state" : { | ||
"revision" : "a99a9083aac4c5eba1cd83291eb2e222df287f31", | ||
"version" : "0.1.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "santanderwrappers", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/SerenaKit/SantanderWrappers", | ||
"state" : { | ||
"branch" : "main", | ||
"revision" : "78c19b2eeba612b0fb7b13df7ab304062ee22622" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-argument-parser", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-argument-parser.git", | ||
"state" : { | ||
"revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", | ||
"version" : "1.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swiftyxmlparser", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/yahoojapan/SwiftyXMLParser", | ||
"state" : { | ||
"revision" : "d7a1d23f04c86c1cd2e8f19247dd15d74e0ea8be", | ||
"version" : "5.6.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "zipfoundation", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/weichsel/ZIPFoundation", | ||
"state" : { | ||
"branch" : "development", | ||
"revision" : "642436f3684009ca7a5e3d6b30f2ecea26f8f772" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
Binary file modified
BIN
+11.1 KB
(130%)
...xcodeproj/project.xcworkspace/xcuserdata/lemin.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// | ||
// LSFootnoteChangerView.swift | ||
// TrollTools | ||
// | ||
// Created by LeminLimez on 12/15/22. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct LSFootnoteChangerView: View { | ||
@State var footnoteText = "" | ||
@State var footnoteOffset: CGFloat = .zero | ||
@State var footnoteSize: [CGFloat] = [.zero, .zero] | ||
|
||
var sharedDeviceConfigPath = "/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles" | ||
|
||
var body: some View { | ||
ZStack { | ||
VStack { | ||
Spacer() | ||
ZStack(alignment: .center) { | ||
Image("lockscreen") | ||
.resizable() | ||
.aspectRatio(contentMode: .fit) | ||
.frame(maxWidth: .infinity) | ||
.padding(.bottom) | ||
.background(GeometryReader { (geometry) -> Color in | ||
DispatchQueue.main.async { | ||
// set the footnote textbox size | ||
footnoteSize[0] = geometry.size.width/3 | ||
footnoteSize[1] = geometry.size.height/25 | ||
|
||
// set the footnote textbox offset | ||
footnoteOffset = -geometry.size.height/2 + (870/990) * geometry.size.height + footnoteSize[1]/2 | ||
} | ||
return .clear | ||
}) | ||
TextField("Footnote", text: $footnoteText) | ||
.foregroundColor(.white) | ||
.offset(x: 0, y: footnoteOffset) | ||
.frame(width: footnoteSize[0], height: footnoteSize[1], alignment: .center) | ||
.multilineTextAlignment(.center) | ||
} | ||
} | ||
} | ||
//.ignoresSafeArea(.keyboard, edges: .bottom) | ||
.toolbar { | ||
ToolbarItem(placement: .navigationBarTrailing) { | ||
Button(action: { | ||
do { | ||
let url = URL(fileURLWithPath: sharedDeviceConfigPath + "/SharedDeviceConfiguration.plist") | ||
|
||
var plistData: Data | ||
if !FileManager.default.fileExists(atPath: url.path) { | ||
plistData = try PropertyListSerialization.data(fromPropertyList: ["LockScreenFootnote": footnoteText], format: .xml, options: 0) | ||
} else { | ||
guard let data = try? Data(contentsOf: url), var plist = try PropertyListSerialization.propertyList(from: data, format: nil) as? [String:Any] else { throw "Couldn't read SharedDeviceConfiguration.plist" } | ||
plist["LockScreenFootnote"] = footnoteText | ||
|
||
// Save plist | ||
plistData = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0) | ||
UserDefaults.standard.set(footnoteText, forKey: "LSFootnoteText") | ||
} | ||
|
||
// write to file | ||
try RootHelper.writeStr(String(decoding: plistData, as: UTF8.self), to: url) | ||
} catch { | ||
UIApplication.shared.alert(body: "\(error)") | ||
} | ||
}) { | ||
Image(systemName: "checkmark") | ||
} | ||
} | ||
} | ||
.onAppear { | ||
footnoteText = UserDefaults.standard.string(forKey: "LSFootnoteText") ?? "" | ||
} | ||
.navigationTitle("Lock Screen Footnote Changer") | ||
} | ||
} | ||
|
||
struct LSFootnoteChangerView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
LSFootnoteChangerView() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.