Skip to content

Commit 578036b

Browse files
committed
1.1.1 RC
1 parent 429a6d7 commit 578036b

File tree

6 files changed

+82
-1
lines changed

6 files changed

+82
-1
lines changed

Geranium/Cleaner/CleanerView.swift

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ struct CleanerView: View {
6262
if safari || appCaches || otaCaches || leftoverCaches || custompathselect {
6363
Button("Clean !", action: {
6464
UIApplication.shared.confirmAlert(title: "Selected options", body: "Safari Caches: \(truelyEnabled(safari))\nGeneral Caches: \(truelyEnabled(appCaches))\nOTA Update Caches: \(truelyEnabled(otaCaches))\nApps Leftover Caches: \(truelyEnabled(leftoverCaches))\(customTest(isEnabled: custompathselect))\n Are you sure you want to permanently delete those files ? \(draftWarning(isEnabled: leftoverCaches))", onOK: {
65+
66+
if ProcessInfo().operatingSystemVersion.majorVersion == 15, appSettings.firstCleanerTime {
67+
appSettings.firstCleanerTime = false
68+
UIApplication.shared.yesoubiennon(title: "⚠️ You are on iOS 15 ⚠️", body: "Cleaning on iOS 15 might break notifications, and some app permissions. Do you want to enable measures that will keep your phone safe ? You might not get everything completly cleaned up. Pressing yes on iOS 15 will keep your device safe.", onOK: {
69+
appSettings.tmpClean = false
70+
}, noCancel: false, onCancel: {
71+
appSettings.tmpClean = true
72+
}, yes: true)
73+
}
6574
print("")
6675
withAnimation {
6776
var sizetotal = (safariCacheSize + GlobalCacheSize + OTACacheSize + leftOverCacheSize) / (1024 * 1024)

Geranium/Cleaner/FileCleaner.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Foundation
99

1010
func cleanProcess(lowSize: Bool = false, safari: Bool, appCaches: Bool, otaCaches: Bool, leftOverCaches: Bool, custompathselect: Bool, progressHandler: @escaping (Double) -> Void) {
1111
print("in the func")
12+
var appSettings = AppSettings()
1213
var safariCleanedUp = false
1314
var appCleanedUp = false
1415
var otaCleanedUp = false
@@ -48,7 +49,7 @@ func cleanProcess(lowSize: Bool = false, safari: Bool, appCaches: Bool, otaCache
4849

4950
if appCaches, !appCleanedUp {
5051
print("appcaches")
51-
let paths = [
52+
var paths = [
5253
logCachesPath,
5354
logmobileCachesPath,
5455
tmpCachesPath,
@@ -61,6 +62,9 @@ func cleanProcess(lowSize: Bool = false, safari: Bool, appCaches: Bool, otaCache
6162
deletedPhotos,
6263
photoOther
6364
]
65+
if !appSettings.tmpClean {
66+
paths.append(tmpCachesPath)
67+
}
6468

6569
for path in paths {
6670
RHResult = deleteContentsOfDirectory(atPath: path)

Geranium/GeraniumApp.swift

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class AppSettings: ObservableObject {
6464
@AppStorage("usrUUID") var usrUUID: String = UIDevice.current.identifierForVendor?.uuidString ?? "unknown"
6565
@AppStorage("languageCode") var languageCode: String = ""
6666
@AppStorage("defaultTab") var defaultTab: Int = 1
67+
@AppStorage("firstCleanerTime") var firstCleanerTime: Bool = false
68+
@AppStorage("tmpClean") var tmpClean: Bool = true
6769
}
6870

6971
var langaugee: String = {

Geranium/Libs/Addon.swift

+23
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,29 @@ extension UIApplication {
163163
}
164164
}
165165

166+
func yesoubiennon(title: String = "Error", body: String, onOK: @escaping () -> (), noCancel: Bool, onCancel: (() -> ())? = nil, yes: Bool) {
167+
DispatchQueue.main.async {
168+
currentUIAlertController = UIAlertController(title: title, message: body, preferredStyle: .alert)
169+
if !noCancel {
170+
currentUIAlertController?.addAction(.init(title: "No", style: .cancel, handler: { _ in
171+
onCancel?()
172+
}))
173+
}
174+
if !yes {
175+
currentUIAlertController?.addAction(.init(title: "OK", style: noCancel ? .cancel : .default, handler: { _ in
176+
onOK()
177+
}))
178+
}
179+
if yes {
180+
currentUIAlertController?.addAction(.init(title: "Yes", style: noCancel ? .cancel : .default, handler: { _ in
181+
onOK()
182+
}))
183+
}
184+
self.present(alert: currentUIAlertController!)
185+
}
186+
}
187+
188+
166189
func TextFieldAlert(title: String, textFieldPlaceHolder: String, completion: @escaping (String?) -> Void) {
167190
let alertController = UIAlertController(title: title, message: nil, preferredStyle: .alert)
168191
alertController.addTextField { (textField) in

Geranium/LocSim/LocSimView.swift

+28
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ struct LocSimView: View {
1717
@State private var long: Double = 0.0
1818
@State private var tappedCoordinate: EquatableCoordinate? = nil
1919
@State private var bookmarkSheetTggle: Bool = false
20+
@State private var appliedCust: Bool = false
21+
@State private var latTemp = ""
22+
@State private var longTemp = ""
2023
var body: some View {
2124
if #available(iOS 16.0, *) {
2225
NavigationStack {
@@ -58,6 +61,16 @@ struct LocSimView: View {
5861
.font(.title2)
5962
.bold()
6063
}
64+
ToolbarItem(placement: .navigationBarTrailing) {
65+
Button(action: {
66+
appliedCust.toggle()
67+
}) {
68+
Image(systemName: "mappin")
69+
.resizable()
70+
.aspectRatio(contentMode: .fit)
71+
.frame(width: 24, height: 24)
72+
}
73+
}
6174
ToolbarItem(placement: .navigationBarTrailing) {
6275
Button(action: {
6376
if appSettings.locSimMultipleAttempts {
@@ -96,8 +109,23 @@ struct LocSimView: View {
96109
}
97110
}
98111
}
112+
.alert("Enter your coordinates", isPresented: $appliedCust) {
113+
TextField("Latitude", text: $latTemp)
114+
TextField("Longitude", text: $longTemp)
115+
Button("OK", action: submit)
116+
} message: {
117+
Text("The location will be simulated on device\nPro tip: Press wherever on the map to move there.")
118+
}
99119
.sheet(isPresented: $bookmarkSheetTggle) {
100120
BookMarkSlider(lat: $lat, long: $long)
101121
}
102122
}
123+
func submit() {
124+
if !latTemp.isEmpty, !longTemp.isEmpty {
125+
LocSimManager.startLocSim(location: .init(latitude: Double(latTemp) ?? 0.0, longitude: Double(longTemp) ?? 0.0))
126+
}
127+
else {
128+
UIApplication.shared.alert(body: "Those are empty coordinates mate !")
129+
}
130+
}
103131
}

Geranium/Translations/Localizable.xcstrings

+15
Original file line numberDiff line numberDiff line change
@@ -3265,6 +3265,9 @@
32653265
},
32663266
"Enter path name" : {
32673267

3268+
},
3269+
"Enter your coordinates" : {
3270+
32683271
},
32693272
"Error !" : {
32703273
"localizations" : {
@@ -4326,6 +4329,9 @@
43264329
},
43274330
"Language set to : %@" : {
43284331

4332+
},
4333+
"Latitude" : {
4334+
43294335
},
43304336
"Latitude: %lf Longitude: %lf" : {
43314337
"localizations" : {
@@ -4664,6 +4670,9 @@
46644670
}
46654671
}
46664672
}
4673+
},
4674+
"Longitude" : {
4675+
46674676
},
46684677
"made by c22dev" : {
46694678
"localizations" : {
@@ -5067,6 +5076,9 @@
50675076
}
50685077
}
50695078
}
5079+
},
5080+
"OK" : {
5081+
50705082
},
50715083
"OTA Update Caches" : {
50725084
"localizations" : {
@@ -6646,6 +6658,9 @@
66466658
}
66476659
}
66486660
}
6661+
},
6662+
"The location will be simulated on device\nPro tip: Press wherever on the map to move there." : {
6663+
66496664
},
66506665
"This is a list of all the currently disabled daemons. Don't change things you didn't changed. The toggled ones are the disabled ones." : {
66516666
"extractionState" : "stale",

0 commit comments

Comments
 (0)