From 2d17a45ebb6fa1a853881d6083ad84ebe0863a77 Mon Sep 17 00:00:00 2001 From: June Date: Thu, 26 Dec 2024 15:33:48 +0900 Subject: [PATCH] smh --- AltStore.xcodeproj/project.pbxproj | 4 ++++ AltStore/AppDelegate.swift | 7 +++++++ AltStoreCore/AltStoreCore.h | 1 + 3 files changed, 12 insertions(+) diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index 060580d0..351e50bd 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -590,6 +590,8 @@ B3C3960F284F53E900DA9E2F /* AltBackup.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AltBackup.xcconfig; sourceTree = ""; }; B3EE16B52925E27D00B3B1F5 /* AnisetteManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnisetteManager.swift; sourceTree = ""; }; BD4513AA2C6FA98C0052BCC0 /* AppExtensionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppExtensionView.swift; sourceTree = ""; }; + BD7FFE492D1D2B7F00A9623D /* ptrace.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ptrace.m; sourceTree = ""; }; + BD7FFE4A2D1D2B8F00A9623D /* ptrace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ptrace.h; sourceTree = ""; }; BF02419522F2199300129732 /* RefreshAttemptsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RefreshAttemptsViewController.swift; sourceTree = ""; }; BF08858222DE795100DE9F1E /* MyAppsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyAppsViewController.swift; sourceTree = ""; }; BF08858422DE7EC800DE9F1E /* UpdateCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateCollectionViewCell.swift; sourceTree = ""; }; @@ -1307,6 +1309,7 @@ BF66EE7F2501AE50007EE018 /* AltStoreCore */ = { isa = PBXGroup; children = ( + BD7FFE492D1D2B7F00A9623D /* ptrace.m */, BF66EE802501AE50007EE018 /* AltStoreCore.h */, BF66EE8A2501AEB1007EE018 /* Components */, BF66EEE32501AED0007EE018 /* Extensions */, @@ -1317,6 +1320,7 @@ BF66EE8D2501AEBC007EE018 /* Types */, BF66EE812501AE50007EE018 /* Info.plist */, BFCB9205250AB1FF0057B44E /* Resources */, + BD7FFE4A2D1D2B8F00A9623D /* ptrace.h */, ); path = AltStoreCore; sourceTree = ""; diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index eeaabaf1..97e08c02 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -233,6 +233,13 @@ private extension AppDelegate return true + case "jit": + let queryItems = components.queryItems?.reduce(into: [String: String]()) { $0[$1.name.lowercased()] = $1.value } ?? [:] + guard let pidstr = queryItems["pid"], let pid = Int32(pidstr) else { return false } + + return ptrace(14, pid, nil, 0) == 0 + + default: return false } } diff --git a/AltStoreCore/AltStoreCore.h b/AltStoreCore/AltStoreCore.h index 02ddf3b1..b2c82fad 100644 --- a/AltStoreCore/AltStoreCore.h +++ b/AltStoreCore/AltStoreCore.h @@ -26,3 +26,4 @@ FOUNDATION_EXPORT const unsigned char AltStoreCoreVersionString[]; #import #import #import +#import "ptrace.h"