Skip to content

Commit 6d61df0

Browse files
committed
bump version
Signed-off-by: 82Flex <[email protected]>
1 parent ebcf1c2 commit 6d61df0

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

TrollFools.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@
421421
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
422422
CLANG_ENABLE_MODULES = YES;
423423
CODE_SIGN_STYLE = Automatic;
424-
CURRENT_PROJECT_VERSION = 5;
424+
CURRENT_PROJECT_VERSION = 6;
425425
DEVELOPMENT_ASSET_PATHS = "\"TrollFools/Preview Content\"";
426426
DEVELOPMENT_TEAM = GXZ23M5TP2;
427427
ENABLE_PREVIEWS = YES;
@@ -442,7 +442,7 @@
442442
"$(inherited)",
443443
"$(PROJECT_DIR)/TrollFools",
444444
);
445-
MARKETING_VERSION = 1.1;
445+
MARKETING_VERSION = 1.2;
446446
PRODUCT_BUNDLE_IDENTIFIER = wiki.qaq.TrollFools;
447447
PRODUCT_NAME = "$(TARGET_NAME)";
448448
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -464,7 +464,7 @@
464464
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
465465
CLANG_ENABLE_MODULES = YES;
466466
CODE_SIGN_STYLE = Automatic;
467-
CURRENT_PROJECT_VERSION = 5;
467+
CURRENT_PROJECT_VERSION = 6;
468468
DEVELOPMENT_ASSET_PATHS = "\"TrollFools/Preview Content\"";
469469
DEVELOPMENT_TEAM = GXZ23M5TP2;
470470
ENABLE_PREVIEWS = YES;
@@ -485,7 +485,7 @@
485485
"$(inherited)",
486486
"$(PROJECT_DIR)/TrollFools",
487487
);
488-
MARKETING_VERSION = 1.1;
488+
MARKETING_VERSION = 1.2;
489489
PRODUCT_BUNDLE_IDENTIFIER = wiki.qaq.TrollFools;
490490
PRODUCT_NAME = "$(TARGET_NAME)";
491491
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

TrollFools/Injector.swift

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Injector {
6363
lazy var substrateFwkURL: URL = tempURL.appendingPathComponent("CydiaSubstrate.framework")
6464
lazy var substrateMainMachOURL: URL = substrateFwkURL.appendingPathComponent("CydiaSubstrate")
6565
lazy var targetSubstrateFwkURL: URL = frameworksURL.appendingPathComponent("CydiaSubstrate.framework")
66+
lazy var targetSubstrateMainMachOURL: URL = targetSubstrateFwkURL.appendingPathComponent("CydiaSubstrate")
6667

6768
func isMachOURL(_ url: URL) -> Bool {
6869
guard let fileHandle = try? FileHandle(forReadingFrom: url) else {
@@ -282,6 +283,18 @@ class Injector {
282283
}
283284
}
284285

286+
func _applyChange(_ target: URL, from src: String, to dst: String) throws {
287+
let retCode = Execute.spawn(binary: installNameToolBinaryURL.path, arguments: [
288+
"-change", src, dst, target.path,
289+
], shouldWait: true)
290+
guard retCode == 0 else {
291+
throw NSError(domain: kTrollFoolsErrorDomain, code: 1, userInfo: [
292+
NSLocalizedDescriptionKey: String(format: NSLocalizedString("llvm-install-name-tool exited with code %d", comment: ""), retCode ?? -1),
293+
])
294+
}
295+
print("llvm-install-name-tool \(target.lastPathComponent) done")
296+
}
297+
285298
func applySubstrateFixes(_ target: URL) throws {
286299
guard let dylibs = try? loadedDylibs(target) else {
287300
throw NSError(domain: kTrollFoolsErrorDomain, code: 2, userInfo: [
@@ -292,15 +305,7 @@ class Injector {
292305
guard dylib.hasSuffix("/CydiaSubstrate") else {
293306
continue
294307
}
295-
let retCode = Execute.spawn(binary: installNameToolBinaryURL.path, arguments: [
296-
"-change", dylib, "@executable_path/Frameworks/CydiaSubstrate.framework/CydiaSubstrate", target.path,
297-
], shouldWait: true)
298-
guard retCode == 0 else {
299-
throw NSError(domain: kTrollFoolsErrorDomain, code: 1, userInfo: [
300-
NSLocalizedDescriptionKey: String(format: NSLocalizedString("llvm-install-name-tool exited with code %d", comment: ""), retCode ?? -1),
301-
])
302-
}
303-
print("llvm-install-name-tool \(target.lastPathComponent) done")
308+
try _applyChange(target, from: dylib, to: "@executable_path/Frameworks/CydiaSubstrate.framework/CydiaSubstrate")
304309
}
305310
}
306311

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

0 commit comments

Comments
 (0)