Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
Signed-off-by: 82Flex <[email protected]>
  • Loading branch information
Lessica committed Jul 20, 2024
1 parent ebcf1c2 commit 6d61df0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
8 changes: 4 additions & 4 deletions TrollFools.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_ASSET_PATHS = "\"TrollFools/Preview Content\"";
DEVELOPMENT_TEAM = GXZ23M5TP2;
ENABLE_PREVIEWS = YES;
Expand All @@ -442,7 +442,7 @@
"$(inherited)",
"$(PROJECT_DIR)/TrollFools",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = wiki.qaq.TrollFools;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand All @@ -464,7 +464,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_ASSET_PATHS = "\"TrollFools/Preview Content\"";
DEVELOPMENT_TEAM = GXZ23M5TP2;
ENABLE_PREVIEWS = YES;
Expand All @@ -485,7 +485,7 @@
"$(inherited)",
"$(PROJECT_DIR)/TrollFools",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = wiki.qaq.TrollFools;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
33 changes: 15 additions & 18 deletions TrollFools/Injector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Injector {
lazy var substrateFwkURL: URL = tempURL.appendingPathComponent("CydiaSubstrate.framework")
lazy var substrateMainMachOURL: URL = substrateFwkURL.appendingPathComponent("CydiaSubstrate")
lazy var targetSubstrateFwkURL: URL = frameworksURL.appendingPathComponent("CydiaSubstrate.framework")
lazy var targetSubstrateMainMachOURL: URL = targetSubstrateFwkURL.appendingPathComponent("CydiaSubstrate")

func isMachOURL(_ url: URL) -> Bool {
guard let fileHandle = try? FileHandle(forReadingFrom: url) else {
Expand Down Expand Up @@ -282,6 +283,18 @@ class Injector {
}
}

func _applyChange(_ target: URL, from src: String, to dst: String) throws {
let retCode = Execute.spawn(binary: installNameToolBinaryURL.path, arguments: [
"-change", src, dst, target.path,
], shouldWait: true)
guard retCode == 0 else {
throw NSError(domain: kTrollFoolsErrorDomain, code: 1, userInfo: [
NSLocalizedDescriptionKey: String(format: NSLocalizedString("llvm-install-name-tool exited with code %d", comment: ""), retCode ?? -1),
])
}
print("llvm-install-name-tool \(target.lastPathComponent) done")
}

func applySubstrateFixes(_ target: URL) throws {
guard let dylibs = try? loadedDylibs(target) else {
throw NSError(domain: kTrollFoolsErrorDomain, code: 2, userInfo: [
Expand All @@ -292,15 +305,7 @@ class Injector {
guard dylib.hasSuffix("/CydiaSubstrate") else {
continue
}
let retCode = Execute.spawn(binary: installNameToolBinaryURL.path, arguments: [
"-change", dylib, "@executable_path/Frameworks/CydiaSubstrate.framework/CydiaSubstrate", target.path,
], shouldWait: true)
guard retCode == 0 else {
throw NSError(domain: kTrollFoolsErrorDomain, code: 1, userInfo: [
NSLocalizedDescriptionKey: String(format: NSLocalizedString("llvm-install-name-tool exited with code %d", comment: ""), retCode ?? -1),
])
}
print("llvm-install-name-tool \(target.lastPathComponent) done")
try _applyChange(target, from: dylib, to: "@executable_path/Frameworks/CydiaSubstrate.framework/CydiaSubstrate")
}
}

Expand All @@ -314,15 +319,7 @@ class Injector {
guard dylib.hasSuffix("/" + name) else {
continue
}
let retCode = Execute.spawn(binary: installNameToolBinaryURL.path, arguments: [
"-change", dylib, "@rpath/" + name, target.path,
], shouldWait: true)
guard retCode == 0 else {
throw NSError(domain: kTrollFoolsErrorDomain, code: 1, userInfo: [
NSLocalizedDescriptionKey: String(format: NSLocalizedString("llvm-install-name-tool exited with code %d", comment: ""), retCode ?? -1),
])
}
print("llvm-install-name-tool \(target.lastPathComponent) done")
try _applyChange(target, from: dylib, to: "@rpath/" + name)
}
}

Expand Down

0 comments on commit 6d61df0

Please sign in to comment.