Skip to content

Commit 5c11cc6

Browse files
committed
Disable jailbreak button on unsupported device / version combinations
1 parent b4b16c6 commit 5c11cc6

File tree

4 files changed

+55
-32
lines changed

4 files changed

+55
-32
lines changed

Dopamine/Dopamine/UI/Views/JailbreakView.swift

+40-32
Original file line numberDiff line numberDiff line change
@@ -289,56 +289,64 @@ struct JailbreakView: View {
289289
}
290290
} label: {
291291
Label(title: {
292-
if !requiresEnvironmentUpdate {
293-
if isJailbroken() {
294-
Text("Status_Title_Jailbroken")
295-
} else {
296-
switch jailbreakingProgress {
297-
case .idle:
298-
Text("Button_Jailbreak_Title")
299-
case .jailbreaking:
300-
Text("Status_Title_Jailbreaking")
301-
case .selectingPackageManager:
302-
Text("Status_Title_Select_Package_Managers")
303-
case .finished:
304-
if jailbreakingError == nil {
305-
Text("Status_Title_Jailbroken")
306-
} else {
307-
Text("Status_Title_Unsuccessful")
292+
if Fugu15.supportsThisDeviceBool() {
293+
if !requiresEnvironmentUpdate {
294+
if isJailbroken() {
295+
Text("Status_Title_Jailbroken")
296+
} else {
297+
switch jailbreakingProgress {
298+
case .idle:
299+
Text("Button_Jailbreak_Title")
300+
case .jailbreaking:
301+
Text("Status_Title_Jailbreaking")
302+
case .selectingPackageManager:
303+
Text("Status_Title_Select_Package_Managers")
304+
case .finished:
305+
if jailbreakingError == nil {
306+
Text("Status_Title_Jailbroken")
307+
} else {
308+
Text("Status_Title_Unsuccessful")
309+
}
308310
}
309311
}
312+
} else {
313+
Text("Button_Update_Environment")
310314
}
311315
} else {
312-
Text("Button_Update_Environment")
316+
Text("Unsupported")
313317
}
314318

315319
}, icon: {
316-
if !requiresEnvironmentUpdate {
317-
ZStack {
318-
switch jailbreakingProgress {
319-
case .jailbreaking:
320-
LoadingIndicator(animation: .doubleHelix, color: .white, size: .small)
321-
case .selectingPackageManager:
322-
Image(systemName: "shippingbox")
323-
case .finished:
324-
if jailbreakingError == nil {
320+
if Fugu15.supportsThisDeviceBool() {
321+
if !requiresEnvironmentUpdate {
322+
ZStack {
323+
switch jailbreakingProgress {
324+
case .jailbreaking:
325+
LoadingIndicator(animation: .doubleHelix, color: .white, size: .small)
326+
case .selectingPackageManager:
327+
Image(systemName: "shippingbox")
328+
case .finished:
329+
if jailbreakingError == nil {
330+
Image(systemName: "lock.open")
331+
} else {
332+
Image(systemName: "lock.slash")
333+
}
334+
case .idle:
325335
Image(systemName: "lock.open")
326-
} else {
327-
Image(systemName: "lock.slash")
328336
}
329-
case .idle:
330-
Image(systemName: "lock.open")
331337
}
338+
} else {
339+
Image(systemName: "doc.badge.arrow.up")
332340
}
333341
} else {
334-
Image(systemName: "doc.badge.arrow.up")
342+
Image(systemName: "lock.slash")
335343
}
336344
})
337345
.foregroundColor(whatCouldThisVariablePossiblyEvenMean ? .black : .white)
338346
.padding()
339347
.frame(maxWidth: isJailbreaking ? .infinity : 280)
340348
}
341-
.disabled((isJailbroken() || isJailbreaking) && !requiresEnvironmentUpdate)
349+
.disabled((isJailbroken() || isJailbreaking || !Fugu15.supportsThisDeviceBool()) && !requiresEnvironmentUpdate)
342350
.drawingGroup()
343351

344352
if jailbreakingProgress == .finished || jailbreakingProgress == .jailbreaking {

Dopamine/de.lproj/Localizable.strings

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120

121121
"Title_Supported_iOS_Versions" = "iOS 15.0 - 15.4.1 | A12 - A15, M1";
122122

123+
"Unsupported" = "Nicht unterstützt";
124+
123125
"Update_Log_Hint_Scrollable" = "Die Protokollansicht ist durchscrollbar";
124126

125127
"Update_Status_Downloading" = "Lade Aktualisierung herunter...";

Dopamine/en.lproj/Localizable.strings

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120

121121
"Title_Supported_iOS_Versions" = "iOS 15.0 - 15.4.1 | A12 - A15, M1";
122122

123+
"Unsupported" = "Unsupported";
124+
123125
"Update_Log_Hint_Scrollable" = "Log view can be scrolled";
124126

125127
"Update_Status_Downloading" = "Downloading update...";

Packages/Fugu15KernelExploit/Sources/Fugu15KernelExploit/Fugu15.swift

+11
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ public struct Fugu15 {
106106
return .yes
107107
}
108108

109+
public static func supportsThisDeviceBool() -> Bool {
110+
return false
111+
switch supportsThisDevice() {
112+
case .yes:
113+
return true
114+
115+
case .no:
116+
return false
117+
}
118+
}
119+
109120
public static func querySysctlBool(name: String) -> Bool {
110121
var size = 8
111122
let ptr = UnsafeMutablePointer<UInt8>.allocate(capacity: size)

0 commit comments

Comments
 (0)