[Global] Initial commit
This commit is contained in:
commit
ea525c3d56
9 changed files with 134 additions and 0 deletions
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
.DS_Store
|
||||||
|
/.build
|
||||||
|
/Packages
|
||||||
|
/*.xcodeproj
|
||||||
|
xcuserdata/
|
||||||
|
|
||||||
|
.theos
|
||||||
|
/packages
|
||||||
|
.theos/
|
||||||
|
packages/
|
||||||
|
.DS_Store
|
||||||
12
Makefile
Normal file
12
Makefile
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
TARGET := iphone:clang:latest:12.2
|
||||||
|
|
||||||
|
|
||||||
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
TWEAK_NAME = VendettaTweak
|
||||||
|
|
||||||
|
VendettaTweak_FILES = $(shell find Sources/VendettaTweak -name '*.swift') $(shell find Sources/VendettaTweakC -name '*.m' -o -name '*.c' -o -name '*.mm' -o -name '*.cpp')
|
||||||
|
VendettaTweak_SWIFTFLAGS = -ISources/VendettaTweakC/include
|
||||||
|
VendettaTweak_CFLAGS = -fobjc-arc -ISources/VendettaTweakC/include
|
||||||
|
|
||||||
|
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||||
88
Package.swift
Normal file
88
Package.swift
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
// swift-tools-version:5.2
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
let projectDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
|
||||||
|
|
||||||
|
@dynamicMemberLookup struct TheosConfiguration {
|
||||||
|
private let dict: [String: String]
|
||||||
|
init(at path: String) {
|
||||||
|
let configURL = URL(fileURLWithPath: path, relativeTo: projectDir)
|
||||||
|
guard let infoString = try? String(contentsOf: configURL) else {
|
||||||
|
fatalError("""
|
||||||
|
Could not find Theos SPM config. Have you run `make spm` yet?
|
||||||
|
""")
|
||||||
|
}
|
||||||
|
let pairs = infoString.split(separator: "\n").map {
|
||||||
|
$0.split(
|
||||||
|
separator: "=", maxSplits: 1,
|
||||||
|
omittingEmptySubsequences: false
|
||||||
|
).map(String.init)
|
||||||
|
}.map { ($0[0], $0[1]) }
|
||||||
|
dict = Dictionary(uniqueKeysWithValues: pairs)
|
||||||
|
}
|
||||||
|
subscript(
|
||||||
|
key: String,
|
||||||
|
or defaultValue: @autoclosure () -> String? = nil
|
||||||
|
) -> String {
|
||||||
|
if let value = dict[key] {
|
||||||
|
return value
|
||||||
|
} else if let def = defaultValue() {
|
||||||
|
return def
|
||||||
|
} else {
|
||||||
|
fatalError("""
|
||||||
|
Could not get value of key '\(key)' from Theos SPM config. \
|
||||||
|
Try running `make spm` again.
|
||||||
|
""")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
subscript(dynamicMember key: String) -> String { self[key] }
|
||||||
|
}
|
||||||
|
let conf = TheosConfiguration(at: ".theos/spm_config")
|
||||||
|
|
||||||
|
let theosPath = conf.theos
|
||||||
|
let sdk = conf.sdk
|
||||||
|
let resourceDir = conf.swiftResourceDir
|
||||||
|
let deploymentTarget = conf.deploymentTarget
|
||||||
|
let triple = "arm64-apple-ios\(deploymentTarget)"
|
||||||
|
|
||||||
|
let libFlags: [String] = [
|
||||||
|
"-F\(theosPath)/vendor/lib", "-F\(theosPath)/lib",
|
||||||
|
"-I\(theosPath)/vendor/include", "-I\(theosPath)/include"
|
||||||
|
]
|
||||||
|
|
||||||
|
let cFlags: [String] = libFlags + [
|
||||||
|
"-target", triple, "-isysroot", sdk,
|
||||||
|
"-Wno-unused-command-line-argument", "-Qunused-arguments",
|
||||||
|
]
|
||||||
|
|
||||||
|
let cxxFlags: [String] = [
|
||||||
|
]
|
||||||
|
|
||||||
|
let swiftFlags: [String] = libFlags + [
|
||||||
|
"-target", triple, "-sdk", sdk, "-resource-dir", resourceDir,
|
||||||
|
]
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "VendettaTweak",
|
||||||
|
platforms: [.iOS(deploymentTarget)],
|
||||||
|
products: [
|
||||||
|
.library(
|
||||||
|
name: "VendettaTweak",
|
||||||
|
targets: ["VendettaTweak"]
|
||||||
|
),
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
.target(
|
||||||
|
name: "VendettaTweakC",
|
||||||
|
cSettings: [.unsafeFlags(cFlags)],
|
||||||
|
cxxSettings: [.unsafeFlags(cxxFlags)]
|
||||||
|
),
|
||||||
|
.target(
|
||||||
|
name: "VendettaTweak",
|
||||||
|
dependencies: ["VendettaTweakC"],
|
||||||
|
swiftSettings: [.unsafeFlags(swiftFlags)]
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
2
Sources/VendettaTweak/Tweak.x.swift
Normal file
2
Sources/VendettaTweak/Tweak.x.swift
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import Orion
|
||||||
|
import VendettaTweakC
|
||||||
7
Sources/VendettaTweakC/Tweak.m
Normal file
7
Sources/VendettaTweakC/Tweak.m
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#import <Orion/Orion.h>
|
||||||
|
|
||||||
|
__attribute__((constructor)) static void init() {
|
||||||
|
// Initialize Orion - do not remove this line.
|
||||||
|
orion_init();
|
||||||
|
// Custom initialization code goes here.
|
||||||
|
}
|
||||||
0
Sources/VendettaTweakC/include/Tweak.h
Normal file
0
Sources/VendettaTweakC/include/Tweak.h
Normal file
4
Sources/VendettaTweakC/include/module.modulemap
Normal file
4
Sources/VendettaTweakC/include/module.modulemap
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
module VendettaTweakC {
|
||||||
|
umbrella "."
|
||||||
|
export *
|
||||||
|
}
|
||||||
1
VendettaTweak.plist
Normal file
1
VendettaTweak.plist
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{ Filter = { Bundles = ( "com.hammerandchisel.discord" ); }; }
|
||||||
9
control
Normal file
9
control
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
Package: dev.beefers.vendetta
|
||||||
|
Name: VendettaTweak
|
||||||
|
Version: 0.0.1
|
||||||
|
Architecture: iphoneos-arm
|
||||||
|
Description: An awesome Orion tweak!
|
||||||
|
Maintainer: FieryFlames
|
||||||
|
Author: FieryFlames
|
||||||
|
Section: Tweaks
|
||||||
|
Depends: ${ORION}, firmware (>= 12.2)
|
||||||
Loading…
Add table
Reference in a new issue