Skip to content

Commit

Permalink
Keep OLD_Instakill also tho
Browse files Browse the repository at this point in the history
  • Loading branch information
NoWisDev committed Apr 13, 2024
1 parent f1abe91 commit 3d4a782
Show file tree
Hide file tree
Showing 14 changed files with 826 additions and 1 deletion.
1 change: 0 additions & 1 deletion OLD_Instakill
Submodule OLD_Instakill deleted from 1c64cb
11 changes: 11 additions & 0 deletions OLD_Instakill/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/

.theos
/packages
.theos/
packages/
.DS_Store
Binary file added OLD_Instakill/Instakill+Orion.dylib.zip
Binary file not shown.
Binary file added OLD_Instakill/Instakill.dylib
Binary file not shown.
1 change: 1 addition & 0 deletions OLD_Instakill/Instakill.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.MobileSMS" ); }; }
674 changes: 674 additions & 0 deletions OLD_Instakill/LICENSE

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions OLD_Instakill/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TARGET := iphone:clang:15.6:15.6


include $(THEOS)/makefiles/common.mk

TWEAK_NAME = Instakill

Instakill_FILES = $(shell find Sources/Instakill -name '*.swift') $(shell find Sources/InstakillC -name '*.m' -o -name '*.c' -o -name '*.mm' -o -name '*.cpp')
Instakill_SWIFTFLAGS = -ISources/InstakillC/include
Instakill_CFLAGS = -fobjc-arc -ISources/InstakillC/include

include $(THEOS_MAKE_PATH)/tweak.mk
88 changes: 88 additions & 0 deletions OLD_Instakill/Package.swift
Original file line number Diff line number Diff line change
@@ -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: "Instakill",
platforms: [.iOS(deploymentTarget)],
products: [
.library(
name: "Instakill",
targets: ["Instakill"]
),
],
targets: [
.target(
name: "InstakillC",
cSettings: [.unsafeFlags(cFlags)],
cxxSettings: [.unsafeFlags(cxxFlags)]
),
.target(
name: "Instakill",
dependencies: ["InstakillC"],
swiftSettings: [.unsafeFlags(swiftFlags)]
),
]
)
4 changes: 4 additions & 0 deletions OLD_Instakill/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Instakill
A tweak and dylib to instantly kill apps when they enter the background!

Useful for when a specific app is taking up too much memory in the background. Just inject the latest Instakill.dylib along with the Orion framework from the zip file in releases into your app of choice via Sideloadly or ESign, and you should be good to go!
15 changes: 15 additions & 0 deletions OLD_Instakill/Sources/Instakill/Tweak.x.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Orion
import InstakillC
import UIKit
import Combine

var cancellables = Set<AnyCancellable>()
final class Instakill: Tweak {
init() {
NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification, object: nil)
.sink { notification in
exit(0)
}
.store(in: &cancellables)
}
}
7 changes: 7 additions & 0 deletions OLD_Instakill/Sources/InstakillC/Tweak.m
Original file line number Diff line number Diff line change
@@ -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.
}
Empty file.
4 changes: 4 additions & 0 deletions OLD_Instakill/Sources/InstakillC/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module InstakillC {
umbrella "."
export *
}
10 changes: 10 additions & 0 deletions OLD_Instakill/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: com.now.instakill
Name: Instakill
Version: 0.0.1
Architecture: iphoneos-arm
Description: An awesome Orion tweak!
Maintainer: NoW
Author: NoW
Section: Tweaks
Depends: firmware (>= 12.2)
#Depends: ${ORION}, firmware (>= 12.2)

0 comments on commit 3d4a782

Please sign in to comment.