Skip to content

Commit bca9a39

Browse files
authored
Merge pull request #262 from hxhlb/main
Fix MobileGestalt duplicate section and unsafe VFS fallback
2 parents e32fc54 + 758fa7e commit bca9a39

2 files changed

Lines changed: 11 additions & 52 deletions

File tree

lara/classes/laramgr.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ final class laramgr: ObservableObject {
351351
}
352352

353353
@discardableResult
354-
func lara_overwritefile(target: String, source: String) -> (ok: Bool, message: String) {
354+
func lara_overwritefile(target: String, source: String, fallback_vfs: Bool = true) -> (ok: Bool, message: String) {
355355
guard FileManager.default.fileExists(atPath: source) else {
356356
return (false, "source file not found: \(source)")
357357
}
@@ -371,6 +371,10 @@ final class laramgr: ObservableObject {
371371
if result.ok {
372372
return result
373373
}
374+
375+
guard fallback_vfs else {
376+
return result
377+
}
374378

375379
guard vfsready else {
376380
return (false, result.message + " | vfs not ready")
@@ -381,11 +385,15 @@ final class laramgr: ObservableObject {
381385
}
382386

383387
@discardableResult
384-
func lara_overwritefile(target: String, data: Data) -> (ok: Bool, message: String) {
388+
func lara_overwritefile(target: String, data: Data, fallback_vfs: Bool = true) -> (ok: Bool, message: String) {
385389
let result = sbxready ? sbxoverwrite(path: target, data: data) : (false, "sbx not ready")
386390
if result.0 {
387391
return result
388392
}
393+
394+
guard fallback_vfs else {
395+
return result
396+
}
389397

390398
guard vfsready else {
391399
return (false, result.1 + ", vfs not ready")

lara/views/tweaks/mobilegestalt/GestaltView.swift

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -287,56 +287,7 @@ struct GestaltView: View {
287287
} header: {
288288
HeaderLabel(text: "SpringBoard", icon: "gear")
289289
}
290-
291-
Section {
292-
PlainToggle(
293-
text: "Disable Lock After Respring",
294-
icon: "lock.open",
295-
isOn: nuggetbinding(
296-
"SBDontLockAfterCrash",
297-
path: fileloc.springboard.rawValue
298-
)
299-
)
300-
301-
PlainToggle(
302-
text: "Disable Low Battery Alerts",
303-
icon: "battery.25",
304-
isOn: nuggetbinding(
305-
"SBHideLowPowerAlerts",
306-
path: fileloc.springboard.rawValue
307-
)
308-
)
309-
310-
PlainToggle(
311-
text: "Show Dynamic Island in Screenshots",
312-
icon: "camera",
313-
isOn: nuggetbinding(
314-
"SBAlwaysShowSystemApertureInSnapshots",
315-
path: fileloc.springboard.rawValue
316-
)
317-
)
318-
319-
PlainToggle(
320-
text: "Play Sound on Paste",
321-
icon: "speaker.wave.2",
322-
isOn: nuggetbinding(
323-
"PlaySoundOnPaste",
324-
path: fileloc.pasteboard.rawValue
325-
)
326-
)
327290

328-
PlainToggle(
329-
text: "System Paste Notifications",
330-
icon: "doc.on.clipboard",
331-
isOn: nuggetbinding(
332-
"AnnounceAllPastes",
333-
path: fileloc.pasteboard.rawValue
334-
)
335-
)
336-
} header: {
337-
HeaderLabel(text: "Internal", icon: "ant")
338-
}
339-
340291
Section {
341292
PlainToggle(
342293
text: "Metal HUD Debug",
@@ -482,7 +433,7 @@ struct GestaltView: View {
482433

483434
// bro please dont bootloop
484435
let mgData = try verifyPlist(mgCurrentDict, targetPath: mgCurrentPath)
485-
let result = mgr.lara_overwritefile(target: mgCurrentPath, data: mgData)
436+
let result = mgr.lara_overwritefile(target: mgCurrentPath, data: mgData, fallback_vfs: false)
486437

487438
if result.ok {
488439
Alertinator.shared.alert(title: "Successfully applied MobileGestalt!", body: "Respring to see any changes", actionLabel: "Respring", action: { mgr.respring() })

0 commit comments

Comments
 (0)