Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Constantin Clerc committed Jan 15, 2024
1 parent f4ecbe8 commit b7758ab
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Geranium.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = live.cclerc.geranium;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -911,7 +911,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = live.cclerc.geranium;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
9 changes: 7 additions & 2 deletions Geranium/ByeTime/ByeTimeHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let STString = "/var/mobile/Library/Preferences/com.apple.ScreenTimeAgent.plist"

let STBckPath = "/var/mobile/Library/Preferences/com.apple.ScreenTimeAgent.gerackup"

func DisableScreenTime(screentimeagentd: Bool, usagetrackingd: Bool, homed: Bool)->String {
func DisableScreenTime(screentimeagentd: Bool, usagetrackingd: Bool, homed: Bool, familycircled: Bool){
var result = ""
// Backuping ScreenTime preferences if they exists.
if !FileManager.default.fileExists(atPath: STBckPath) {
Expand Down Expand Up @@ -48,6 +48,9 @@ func DisableScreenTime(screentimeagentd: Bool, usagetrackingd: Bool, homed: Bool
if usagetrackingd {
killall("UsageTrackingAgent")
}
if familycircled {
killall("familycircled")
}

// Remove ScreenTime preferences if STA respawned it (STA= ScreenTimeAgent)
if !FileManager.default.fileExists(atPath: STBckPath) {
Expand All @@ -73,9 +76,11 @@ func DisableScreenTime(screentimeagentd: Bool, usagetrackingd: Bool, homed: Bool
if usagetrackingd {
daemonManagement(key: "com.apple.UsageTrackingAgent", value: true, plistPath: "/var/db/com.apple.xpc.launchd/disabled.plist")
}
if familycircled {
daemonManagement(key: "com.apple.familycircled", value: true, plistPath: "/var/db/com.apple.xpc.launchd/disabled.plist")
}
// UserSpace Reboot
successVibrate()
sleep(3)
rebootUSR()
return "done"
}
8 changes: 7 additions & 1 deletion Geranium/ByeTime/ByeTimeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct ByeTimeView: View {
@State var ScreenTimeAgent: Bool = true
@State var usagetrackingd: Bool = true
@State var homed: Bool = false
@State var familycircled: Bool = false
var body: some View {
VStack {
List {
Expand All @@ -31,11 +32,16 @@ struct ByeTimeView: View {
Text("Disable Homed")
}
}
// Section(header: Label("Familycircled", systemImage: "figure.and.child.holdinghands"), footer: Text("Familycircled is in charge of iCloud Family system. This includes subscriptions, so if you disable this you won't be able to use them. However, this can help preventing ScreenTime from working.")) {
// Toggle(isOn: $familycircled) {
// Text("Disable Familycircled")
// }
// }
}
Button("Bye ScreenTime !", action : {
UIApplication.shared.confirmAlert(title: "You are about to disable those daemons.", body: "This will delete Screen Time Preferences files and prevent the following daemoms from starting up with iOS. Are you sure you want to continue ?", onOK: {
UIApplication.shared.alert(title: "Removing Screen Time...", body: "Your device will reboot.", animated: false, withButton: false)
DisableScreenTime(screentimeagentd: ScreenTimeAgent, usagetrackingd: usagetrackingd, homed: homed)
DisableScreenTime(screentimeagentd: ScreenTimeAgent, usagetrackingd: usagetrackingd, homed: homed, familycircled: familycircled)
}, noCancel: false, yes: true)
})
.padding(10)
Expand Down
35 changes: 15 additions & 20 deletions Geranium/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,32 @@ struct SettingsView: View {
@State var localisation: String = {
if let languages = UserDefaults.standard.array(forKey: "AppleLanguages") as? [String],
let firstLanguage = languages.first {
return firstLanguage
} else {
return Locale.current.languageCode ?? "en"
} else {
return "en"
}
}()
@StateObject private var appSettings = AppSettings()

let languageMapping: [String: String] = [
// i made catgpt work for me on this one
"ca": "Catalan",
"cs": "Czech",
"de": "German",
"el": "Greek",
"zh-Hans": "Chinese (Simplified)", //
"zh-Hant": "Chinese (Traditional)", //
"en": "English",
"es": "Spanish",
"es-419": "Spanish (Latin America)",
"fi": "Finnish",
"fr": "French",
"it": "Italian",
"ja": "Japanese",
"ko": "Korean",
"ru": "Russian",
"sk": "Slovak",
"sr": "Serbian",
"sv": "Swedish",
"es": "Spanish", //
"es-419": "Spanish (Latin America)", //
"fr": "French", //
"it": "Italian", //
"ja": "Japanese", //
"ko": "Korean", //
"ru": "Russian", //
"sk": "Slovak", //
"sv": "Swedish", //
"vi": "Vietnamese",
"zh-Hans": "Chinese (Simplified)",
"zh-Hant": "Chinese (Traditional)",
"Default": "Default"//
]
var sortedLocalisalist: [String] {
Bundle.main.localizations.sorted()
languageMapping.keys.sorted()
}
var body: some View {
NavigationView {
Expand Down

0 comments on commit b7758ab

Please sign in to comment.