-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
826 additions
and
1 deletion.
There are no files selected for viewing
Submodule OLD_Instakill
deleted from
1c64cb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ Filter = { Bundles = ( "com.apple.MobileSMS" ); }; } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)] | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module InstakillC { | ||
umbrella "." | ||
export * | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |