Skip to content

Commit

Permalink
1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Lrdsnow committed Jun 15, 2024
1 parent ba2b0a3 commit 520059f
Show file tree
Hide file tree
Showing 48 changed files with 480 additions and 838 deletions.
22 changes: 5 additions & 17 deletions PurePKG/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UITableView.appearance().separatorStyle = .none
UITableView.appearance().separatorColor = .clear
#endif
appData.jbdata.jbtype = Jailbreak.type(appData)
appData.jbdata.jbarch = Jailbreak.arch(appData)
appData.jbdata.jbroot = Jailbreak.path(appData)
appData.deviceInfo = getDeviceInfo()
appData.installed_pkgs = RepoHandler.getInstalledTweaks(Jailbreak.path(appData)+"/Library/dpkg")
appData.installed_pkgs = RepoHandler.getInstalledTweaks(Jailbreak().path+"/Library/dpkg")
appData.repos = RepoHandler.getCachedRepos()
appData.pkgs = appData.repos.flatMap { $0.tweaks }
if !UserDefaults.standard.bool(forKey: "ignoreInitRefresh") {
Expand Down Expand Up @@ -164,11 +160,7 @@ struct ContentViewWatchOS: View {

private func startup() {
if #available(iOS 14.0, tvOS 14.0, *) {
appData.jbdata.jbtype = Jailbreak.type(appData)
appData.jbdata.jbarch = Jailbreak.arch(appData)
appData.jbdata.jbroot = Jailbreak.path(appData)
appData.deviceInfo = getDeviceInfo()
appData.installed_pkgs = RepoHandler.getInstalledTweaks(Jailbreak.path(appData)+"/Library/dpkg")
appData.installed_pkgs = RepoHandler.getInstalledTweaks(Jailbreak().path+"/Library/dpkg")
appData.repos = RepoHandler.getCachedRepos()
appData.pkgs = appData.repos.flatMap { $0.tweaks }
if !UserDefaults.standard.bool(forKey: "ignoreInitRefresh") {
Expand Down Expand Up @@ -245,12 +237,8 @@ struct ContentView: View {
private func startup() {
if #available(iOS 14.0, tvOS 14.0, *) {
if !preview {
appData.jbdata.jbtype = Jailbreak.type(appData)
appData.jbdata.jbarch = Jailbreak.arch(appData)
appData.jbdata.jbroot = Jailbreak.path(appData)
appData.deviceInfo = getDeviceInfo()
log(appData.deviceInfo)
appData.installed_pkgs = RepoHandler.getInstalledTweaks(Jailbreak.path(appData)+"/Library/dpkg")
log("PurePKG Running on \(Device().modelIdentifier) running iOS \(Device().pretty_version) (\(Device().build_number))")
appData.installed_pkgs = RepoHandler.getInstalledTweaks(Jailbreak().path+"/Library/dpkg")
appData.repos = RepoHandler.getCachedRepos()
appData.pkgs = appData.repos.flatMap { $0.tweaks }
if !UserDefaults.standard.bool(forKey: "ignoreInitRefresh") {
Expand All @@ -269,7 +257,7 @@ struct ContentView: View {
print("Adding Repo: \(repourl)")
RepoHandler.addRepo(repourl)
} else if url.pathExtension == "deb" {
let info = APTWrapper.spawn(command: "\(Jailbreak.path())/\(Jailbreak.type() == .macos ? "" : "usr/")bin/dpkg-deb", args: ["dpkg-deb", "--field", url.path])
let info = APTWrapper.spawn(command: "\(Jailbreak().path)/\(Jailbreak().type == .macos ? "" : "usr/")bin/dpkg-deb", args: ["dpkg-deb", "--field", url.path])
if info.0 == 0 {
let dict = Networking.genDict(info.1)
var tweak = RepoHandler.createPackageStruct(dict)
Expand Down
2 changes: 1 addition & 1 deletion PurePKG/Views/QueueView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct InstallQueuedButton: View {
showLog = false
}
} else {
if Jailbreak.type(appData) == .jailed {
if Jailbreak().type == .jailed {
showPopup("bruh", "PurePKG is in demo mode, you cannot install tweaks")
} else {
installingQueue = true
Expand Down
10 changes: 5 additions & 5 deletions PurePKG/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct SettingsView: View {
HStack {
Text("Device")
Spacer()
Text(appData.deviceInfo.modelIdentifier)
Text(Device().modelIdentifier)
}.listRowBG()
HStack {
#if os(watchOS)
Expand All @@ -53,9 +53,9 @@ struct SettingsView: View {
#endif
Spacer()
#if os(watchOS)
Text("\(appData.deviceInfo.major).\(appData.deviceInfo.minor)\(appData.deviceInfo.patch == 0 ? "" : ".\(appData.deviceInfo.patch)")")
Text("\(Device().pretty_version)")
#else
Text("\(appData.deviceInfo.major).\(appData.deviceInfo.minor)\(appData.deviceInfo.patch == 0 ? "" : ".\(appData.deviceInfo.patch)")\(appData.deviceInfo.build_number == "0" ? "" : " (\(appData.deviceInfo.build_number))")")
Text("\(Device().pretty_version)\(Device().build_number == "0" ? "" : " (\(Device().build_number))")")
#endif
}.listRowBG()
#if !os(macOS)
Expand All @@ -66,7 +66,7 @@ struct SettingsView: View {
Text("Jailbreak Type")
#endif
Spacer()
Text((appData.jbdata.jbtype == .rootful || appData.jbdata.jbtype == .tvOS_rootful) ? "Rootful" : appData.jbdata.jbtype == .rootless ? "Rootless" : appData.jbdata.jbtype == .roothide ? "Roothide" : "Jailed")
Text(Jailbreak().pretty_type)
}.listRowBG()
#endif
HStack {
Expand All @@ -76,7 +76,7 @@ struct SettingsView: View {
Text("Architecture")
#endif
Spacer()
Text("\(appData.jbdata.jbarch)")
Text(Jailbreak().arch)
}.listRowBG()
#if !os(macOS)
if let jb = jb {
Expand Down
Loading

0 comments on commit 520059f

Please sign in to comment.