Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
khcrysalis committed Jan 20, 2024
1 parent 705a34e commit fd75a7d
Show file tree
Hide file tree
Showing 25 changed files with 54 additions and 185 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81122992B15E7BB00AD077B"
BuildableName = "usprebooter.app"
BuildableName = "Serotonin.app"
BlueprintName = "usprebooter"
ReferencedContainer = "container:Serotonin.xcodeproj">
</BuildableReference>
Expand Down Expand Up @@ -45,7 +45,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81122992B15E7BB00AD077B"
BuildableName = "usprebooter.app"
BuildableName = "Serotonin.app"
BlueprintName = "usprebooter"
ReferencedContainer = "container:Serotonin.xcodeproj">
</BuildableReference>
Expand All @@ -62,7 +62,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81122992B15E7BB00AD077B"
BuildableName = "usprebooter.app"
BuildableName = "Serotonin.app"
BlueprintName = "usprebooter"
ReferencedContainer = "container:Serotonin.xcodeproj">
</BuildableReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.404",
"green" : "0.255",
"red" : "0.776"
}
"platform" : "universal",
"reference" : "systemPinkColor"
},
"idiom" : "universal"
}
Expand Down
20 changes: 0 additions & 20 deletions usprebooter/Assets.xcassets/accent.colorset/Contents.json

This file was deleted.

12 changes: 0 additions & 12 deletions usprebooter/Assets.xcassets/alfienick.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions usprebooter/Assets.xcassets/bedtime.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions usprebooter/Assets.xcassets/duy.imageset/Contents.json

This file was deleted.

Binary file removed usprebooter/Assets.xcassets/duy.imageset/duy.jpg
Binary file not shown.
12 changes: 0 additions & 12 deletions usprebooter/Assets.xcassets/fish.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions usprebooter/Assets.xcassets/haxi0.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions usprebooter/Assets.xcassets/htrowii.imageset/Contents.json

This file was deleted.

Binary file not shown.
21 changes: 0 additions & 21 deletions usprebooter/Assets.xcassets/mineek.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

51 changes: 20 additions & 31 deletions usprebooter/UI/Tabs/JailbreakViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,9 @@ class JailbreakViewController: UIViewController, UITableViewDelegate, UITableVie

func didAddNewLog() {
DispatchQueue.main.async {
UIView.transition(with: self.tableView,
duration: 0.3,
options: .transitionCrossDissolve,
animations: {
self.tableView.reloadData()
let indexPath = IndexPath(row: Logger.shared.data.count - 1, section: 0)
self.tableView.scrollToRow(at: indexPath, at: .bottom, animated: false)
}, completion: nil)
self.tableView.reloadData()
let indexPath = IndexPath(row: Logger.shared.data.count - 1, section: 0)
self.tableView.scrollToRow(at: indexPath, at: .bottom, animated: false)
}
}

Expand All @@ -85,31 +80,25 @@ class JailbreakViewController: UIViewController, UITableViewDelegate, UITableVie

extension JailbreakViewController: JBButtonDelegate {
func jbButtonDidFinishAction(_ button: jbButton) {
do_kopen(UInt64(settingsManager.puafPages), UInt64(settingsManager.puafMethod), UInt64(settingsManager.kreadMethod), UInt64(settingsManager.kwriteMethod), settingsManager.staticHeadroom, settingsManager.useMemoryHogger)
go(settingsManager.isBetaIos, "reinstall")

button.updateButtonState(.jailbreaking)
Logger.shared.log(logType: .warning, subTitle: "meow")
DispatchQueue.global().async {
let randomNumber = Int.random(in: 0...1)
Logger.shared.log(logType: .warning, subTitle: "meo1w")
Logger.shared.log(logType: .warning, subTitle: "meow3")
Logger.shared.log(logType: .standard, subTitle: "meow33")
Logger.shared.log(logType: .success, subTitle: "meow32")

DispatchQueue.main.async {
if randomNumber == 0 {
Logger.shared.log(logType: .success, subTitle: "Done!1")
button.updateButtonState(.done)
} else {
Logger.shared.log(logType: .error, subTitle: "Error with code: meow")
self.simulateError()
button.updateButtonState(.error)
}

DispatchQueue.global().async { [self] in
Logger.shared.log(logType: .standard, subTitle: "run 1")

do_kopen(UInt64(settingsManager.puafPages), UInt64(settingsManager.puafMethod), UInt64(settingsManager.kreadMethod), UInt64(settingsManager.kwriteMethod), settingsManager.staticHeadroom, settingsManager.useMemoryHogger)

Logger.shared.log(logType: .standard, subTitle: "run 1")

go(settingsManager.isBetaIos, "reinstall")
Logger.shared.log(logType: .standard, subTitle: "run 2")

do_kclose()
Logger.shared.log(logType: .standard, subTitle: "run 3")

DispatchQueue.main.asyncAfter(deadline: .now() + 0.75) {
button.updateButtonState(.done)
}
}
}

private func simulateError() {
print("Button finished action with an error")
}
}
17 changes: 10 additions & 7 deletions usprebooter/UI/Tabs/OptionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@ class OptionsViewController: UIViewController, UITableViewDelegate, UITableViewD
func numberOfSections(in tableView: UITableView) -> Int { return sectionTitles.count }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return tableData[section].count }
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { return sectionTitles[section] }


func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
let sectionTitle = sectionTitles[section]
if sectionTitle.isEmpty { return 20 }
return 40
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return sectionTitles[section].isEmpty ? 20 : 40 }

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let title = sectionTitles[section]
Expand Down Expand Up @@ -254,6 +248,15 @@ class OptionsViewController: UIViewController, UITableViewDelegate, UITableViewD
}
}
}

func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
switch section {
case 2:
return "You can leave these settings as default if you don't know what they do."
default:
return nil
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion usprebooter/UI/Tabs/ToolbarButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class jbButton: UIButton {

switch currentState {
case .done:
delegate?.jbButtonDidFinishAction(self)
userspaceReboot()
case .jailbreak:
Logger.shared.log(logType: .standard, subTitle: "Starting jailbreak process")
delegate?.jbButtonDidFinishAction(self)
Expand Down
18 changes: 18 additions & 0 deletions usprebooter/usprebooterApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

if !FileManager.default.fileExists(atPath: "/var/mobile/Serotonin.jp2") {
if let bootlogo = Bundle.main.url(forResource: "Serotonin", withExtension: "jp2") {
try? FileManager.default.copyItem(at: bootlogo, to: URL(fileURLWithPath: "/var/mobile/Serotonin.jp2"))
}
}

if !FileManager.default.fileExists(atPath: "/var/mobile/boot-happy.jp2") {
if let bootlogo = Bundle.main.url(forResource: "boot-happy", withExtension: "jp2") {
try? FileManager.default.copyItem(at: bootlogo, to: URL(fileURLWithPath: "/var/mobile/boot-happy.jp2"))
}
}

if !FileManager.default.fileExists(atPath: "/var/mobile/boot-sad.jp2") {
if let bootlogo = Bundle.main.url(forResource: "boot-sad", withExtension: "jp2") {
try? FileManager.default.copyItem(at: bootlogo, to: URL(fileURLWithPath: "/var/mobile/boot-sad.jp2"))
}
}

let viewController = MainTabBarController()
let navController = UINavigationController(rootViewController: viewController)
window = UIWindow(frame: UIScreen.main.bounds)
Expand Down

0 comments on commit fd75a7d

Please sign in to comment.