├── .gitignore
├── .swiftpm
└── xcode
│ └── package.xcworkspace
│ └── contents.xcworkspacedata
├── Makefile
├── MinusX.plist
├── Package.swift
├── Sources
├── MinusX
│ └── Tweak.x.swift
└── MinusXC
│ ├── Tweak.m
│ └── include
│ ├── Tweak.h
│ └── module.modulemap
└── control
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /.build
3 | /Packages
4 | /*.xcodeproj
5 | xcuserdata/
6 |
7 | .theos
8 | /packages
9 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | ARCHS = arm64 arm64e
2 | TARGET := iphone:clang:latest:12.2
3 | INSTALL_TARGET_PROCESSES = SpringBoard
4 | THEOS_DEVICE_IP = 192.168.1.102
5 | DEBUG=0
6 |
7 | include $(THEOS)/makefiles/common.mk
8 |
9 | TWEAK_NAME = MinusX
10 |
11 | MinusX_FILES = $(shell find Sources/MinusX -name '*.swift') $(shell find Sources/MinusXC -name '*.m' -o -name '*.c' -o -name '*.mm' -o -name '*.cpp')
12 | MinusX_SWIFTFLAGS = -ISources/MinusXC/include
13 | MinusX_CFLAGS = -fobjc-arc -ISources/MinusXC/include
14 |
15 | include $(THEOS_MAKE_PATH)/tweak.mk
16 |
--------------------------------------------------------------------------------
/MinusX.plist:
--------------------------------------------------------------------------------
1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; }
2 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.6
2 |
3 | import PackageDescription
4 | import Foundation
5 |
6 | let projectDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
7 |
8 | @dynamicMemberLookup struct TheosConfiguration {
9 | private let dict: [String: String]
10 | init(at path: String) {
11 | let configURL = URL(fileURLWithPath: path, relativeTo: projectDir)
12 | guard let infoString = try? String(contentsOf: configURL) else {
13 | fatalError("""
14 | Could not find Theos SPM config. Have you run `make spm` yet?
15 | """)
16 | }
17 | let pairs = infoString.split(separator: "\n").map {
18 | $0.split(
19 | separator: "=", maxSplits: 1,
20 | omittingEmptySubsequences: false
21 | ).map(String.init)
22 | }.map { ($0[0], $0[1]) }
23 | dict = Dictionary(uniqueKeysWithValues: pairs)
24 | }
25 | subscript(
26 | key: String,
27 | or defaultValue: @autoclosure () -> String? = nil
28 | ) -> String {
29 | if let value = dict[key] {
30 | return value
31 | } else if let def = defaultValue() {
32 | return def
33 | } else {
34 | fatalError("""
35 | Could not get value of key '\(key)' from Theos SPM config. \
36 | Try running `make spm` again.
37 | """)
38 | }
39 | }
40 | subscript(dynamicMember key: String) -> String { self[key] }
41 | }
42 | let conf = TheosConfiguration(at: ".theos/spm_config")
43 |
44 | let theosPath = conf.theos
45 | let sdk = conf.sdk
46 | let resourceDir = conf.swiftResourceDir
47 | let deploymentTarget = conf.deploymentTarget
48 | let triple = "arm64-apple-ios\(deploymentTarget)"
49 |
50 | let libFlags: [String] = [
51 | "-F\(theosPath)/vendor/lib", "-F\(theosPath)/lib",
52 | "-I\(theosPath)/vendor/include", "-I\(theosPath)/include"
53 | ]
54 |
55 | let cFlags: [String] = libFlags + [
56 | "-target", triple, "-isysroot", sdk,
57 | "-Wno-unused-command-line-argument", "-Qunused-arguments",
58 | ]
59 |
60 | let cxxFlags: [String] = [
61 | ]
62 |
63 | let swiftFlags: [String] = libFlags + [
64 | "-target", triple, "-sdk", sdk, "-resource-dir", resourceDir,
65 | ]
66 |
67 | let package = Package(
68 | name: "MinusX",
69 | platforms: [.iOS(deploymentTarget)],
70 | products: [
71 | .library(
72 | name: "MinusX",
73 | targets: ["MinusX"]
74 | ),
75 | ],
76 | targets: [
77 | .target(
78 | name: "MinusXC",
79 | cSettings: [.unsafeFlags(cFlags)],
80 | cxxSettings: [.unsafeFlags(cxxFlags)]
81 | ),
82 | .target(
83 | name: "MinusX",
84 | dependencies: ["MinusXC"],
85 | swiftSettings: [.unsafeFlags(swiftFlags)]
86 | ),
87 | ]
88 | )
89 |
--------------------------------------------------------------------------------
/Sources/MinusX/Tweak.x.swift:
--------------------------------------------------------------------------------
1 | import Orion
2 | import MinusXC
3 | import UIKit
4 | import os
5 |
6 | @available(iOS 13.0, *)
7 | class SBMinusCloseBoxViewHook: ClassHook {
8 |
9 | func layoutSubviews() {
10 | orig.layoutSubviews()
11 |
12 | for subview1 in orig.target.subviews {
13 | if subview1.isKind(of: Dynamic.SBHomeScreenMaterialView.class) {
14 | for subview2 in subview1.subviews {
15 | if let imageView = subview2 as? UIImageView {
16 | imageView.image = UIImage(systemName: "xmark", withConfiguration: UIImage.SymbolConfiguration(pointSize: subview1.frame.size.width * 0.4, weight: .bold))
17 | imageView.tintColor = .darkGray
18 |
19 | let size1 = subview1.frame.size
20 | imageView.frame = CGRect(origin: CGPoint(x: size1.width * 0.3, y: size1.height * 0.3), size: CGSize(width: size1.width * 0.4, height: size1.height * 0.4))
21 | }
22 | }
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sources/MinusXC/Tweak.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | __attribute__((constructor)) static void init() {
4 | // Initialize Orion - do not remove this line.
5 | orion_init();
6 | // Custom initialization code goes here.
7 | }
8 |
--------------------------------------------------------------------------------
/Sources/MinusXC/include/Tweak.h:
--------------------------------------------------------------------------------
1 | #import
2 | #include
3 |
4 | @interface SBMinusCloseBoxView : UIButton
5 | @end
6 |
--------------------------------------------------------------------------------
/Sources/MinusXC/include/module.modulemap:
--------------------------------------------------------------------------------
1 | module MinusXC {
2 | umbrella "."
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/control:
--------------------------------------------------------------------------------
1 | Package: ovh.exerhythm.minusx
2 | Name: MinusX
3 | Version: 1.0
4 | Architecture: iphoneos-arm
5 | Description: Brings back the X buttons when deleting apps
6 | Maintainer: ExeRhythm
7 | Author: ExeRhythm
8 | Section: Tweaks
9 | Depends: ${ORION}, firmware (>= 14.0)
10 |
--------------------------------------------------------------------------------