Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Shared/Data/UserDefaults/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ enum Preferences {

@Storage(key: "Feather.fuckOffPpqcheckDetection", defaultValue: true)
static var isFuckingPPqcheckDetectionOff: Bool

@Storage(key: "Feather.autoInstallAfterSign", defaultValue: false)
static var autoInstallAfterSign: Bool

@Storage(key: "Feather.CertificateTitleAppIDtoTeamID", defaultValue: false)
static var certificateTitleAppIDtoTeamID: Bool
Expand Down
12 changes: 8 additions & 4 deletions iOS/Views/Apps/LibraryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ extension LibraryViewController {
popupVC = PopupViewController()
popupVC.modalPresentationStyle = .pageSheet

let button1 = PopupViewControllerButton(title: "Sign \((source!.value(forKey: "name") as? String ?? ""))", color: .tintColor.withAlphaComponent(0.9))
let button1 = PopupViewControllerButton(
title: Preferences.autoInstallAfterSign
? "Sign & Install \((source!.value(forKey: "name") as? String ?? ""))"
: "Sign \((source!.value(forKey: "name") as? String ?? ""))",
color: .tintColor.withAlphaComponent(0.9))
button1.onTap = { [weak self] in
guard let self = self else { return }
self.popupVC.dismiss(animated: true)
self.startSigning(meow: source!)
self.startSigning(meow: source!, filePath: filePath?.path ?? "")
}

let button2 = PopupViewControllerButton(title: "Install \((source!.value(forKey: "name") as? String ?? ""))", color: .quaternarySystemFill, titleColor: .tintColor)
Expand Down Expand Up @@ -243,9 +247,9 @@ extension LibraryViewController {
tableView.deselectRow(at: indexPath, animated: true)
}

@objc func startSigning(meow: NSManagedObject) {
@objc func startSigning(meow: NSManagedObject, filePath: String) {
if FileManager.default.fileExists(atPath: CoreDataManager.shared.getFilesForDownloadedApps(for:(meow as! DownloadedApps)).path) {
let ap = AppSigningViewController(app: meow, appsViewController: self)
let ap = AppSigningViewController(app: meow, filePath: filePath, appsViewController: self)
let navigationController = UINavigationController(rootViewController: ap)
navigationController.modalPresentationStyle = .fullScreen
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
Expand Down
7 changes: 6 additions & 1 deletion iOS/Views/Apps/Signing/AppSigningViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AppSigningViewController: UITableViewController, UINavigationControllerDel
var removeInjectPaths: [String] = []

var app: NSManagedObject!
var filePath: String = ""
var name: String = "Unknown"
var bundleId: String = "unknown"
var version: String = "unknown"
Expand Down Expand Up @@ -55,9 +56,10 @@ class AppSigningViewController: UITableViewController, UINavigationControllerDel

var certs: Certificate?

init(app: NSManagedObject, appsViewController: LibraryViewController) {
init(app: NSManagedObject, filePath: String, appsViewController: LibraryViewController) {
self.appsViewController = appsViewController
self.app = app
self.filePath = filePath
super.init(style: .insetGrouped)

if let hasGotCert = CoreDataManager.shared.getCurrentCertificate() {
Expand Down Expand Up @@ -176,6 +178,9 @@ class AppSigningViewController: UITableViewController, UINavigationControllerDel
if success {
self.appsViewController.fetchSources()
self.appsViewController.tableView.reloadData()
if Preferences.autoInstallAfterSign {
self.appsViewController.startInstallProcess(meow: self.app, filePath: self.filePath)
}
}
self.dismiss(animated: true)
}
Expand Down
13 changes: 12 additions & 1 deletion iOS/Views/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SettingsViewController: UITableViewController {
[String.localized("SETTINGS_VIEW_CONTROLLER_CELL_DISPLAY"), String.localized("SETTINGS_VIEW_CONTROLLER_CELL_APP_ICON")],
["Current Certificate", String.localized("SETTINGS_VIEW_CONTROLLER_CELL_ADD_CERTIFICATES")],
// ["Signing Configuration"],
["Fuck PPQCheck", "PPQCheckMitigationString", "PPQCheckMitigationExport"],
["Auto Install", "Fuck PPQCheck", "PPQCheckMitigationString", "PPQCheckMitigationExport"],
["Use Server", String.localized("SETTINGS_VIEW_CONTROLLER_CELL_USE_CUSTOM_SERVER")],
[String.localized("SETTINGS_VIEW_CONTROLLER_CELL_UPDATE_LOCAL_CERTIFICATE")],
[
Expand Down Expand Up @@ -142,6 +142,13 @@ extension SettingsViewController {
cell.textLabel?.textColor = .secondaryLabel
cell.selectionStyle = .none
}
case "Auto Install":
let autoInstall = SwitchViewCell()
autoInstall.textLabel?.text = "Install after signing"
autoInstall.switchControl.addTarget(self, action: #selector(autoInstallAfterSignToggled(_:)), for: .valueChanged)
autoInstall.switchControl.isOn = Preferences.autoInstallAfterSign
autoInstall.selectionStyle = .none
return autoInstall
case "Fuck PPQCheck":
let fuckPPq = SwitchViewCell()
fuckPPq.textLabel?.text = String.localized("SETTINGS_VIEW_CONTROLLER_PPQ_ALERT_TITLE")
Expand Down Expand Up @@ -237,6 +244,10 @@ extension SettingsViewController {
@objc func fuckPpqcheckToggled(_ sender: UISwitch) {
Preferences.isFuckingPPqcheckDetectionOff = sender.isOn
}

@objc func autoInstallAfterSignToggled(_ sender: UISwitch) {
Preferences.autoInstallAfterSign = sender.isOn
}

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let itemTapped = tableData[indexPath.section][indexPath.row]
Expand Down