2022-10-12 04:57:08 +08:00
|
|
|
@import Foundation;
|
|
|
|
#import "CoreServices.h"
|
|
|
|
|
2022-10-30 06:45:30 +08:00
|
|
|
#define TrollStoreErrorDomain @"TrollStoreErrorDomain"
|
|
|
|
|
2022-10-12 04:57:08 +08:00
|
|
|
extern void chineseWifiFixup(void);
|
2023-11-27 22:49:54 +08:00
|
|
|
extern NSString *getExecutablePath(void);
|
2022-10-12 04:57:08 +08:00
|
|
|
extern NSString* rootHelperPath(void);
|
|
|
|
extern NSString* getNSStringFromFile(int fd);
|
|
|
|
extern void printMultilineNSString(NSString* stringToPrint);
|
|
|
|
extern int spawnRoot(NSString* path, NSArray* args, NSString** stdOut, NSString** stdErr);
|
2022-11-20 22:33:54 +08:00
|
|
|
extern void killall(NSString* processName, BOOL softly);
|
2022-10-12 04:57:08 +08:00
|
|
|
extern void respring(void);
|
|
|
|
extern void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion));
|
2023-11-28 08:04:40 +08:00
|
|
|
extern void fetchLatestLdidVersion(void (^completionHandler)(NSString* latestVersion));
|
2022-10-12 04:57:08 +08:00
|
|
|
|
|
|
|
extern NSArray* trollStoreInstalledAppBundlePaths();
|
|
|
|
extern NSArray* trollStoreInstalledAppContainerPaths();
|
|
|
|
extern NSString* trollStorePath();
|
|
|
|
extern NSString* trollStoreAppPath();
|
|
|
|
|
2022-11-30 06:46:01 +08:00
|
|
|
extern BOOL isRemovableSystemApp(NSString* appId);
|
|
|
|
|
2022-10-30 06:45:30 +08:00
|
|
|
#import <UIKit/UIAlertController.h>
|
|
|
|
|
|
|
|
@interface UIAlertController (Private)
|
|
|
|
@property (setter=_setAttributedTitle:,getter=_attributedTitle,nonatomic,copy) NSAttributedString* attributedTitle;
|
|
|
|
@property (setter=_setAttributedMessage:,getter=_attributedMessage,nonatomic,copy) NSAttributedString* attributedMessage;
|
|
|
|
@property (nonatomic,retain) UIImage* image;
|
|
|
|
@end
|
|
|
|
|
2022-10-12 04:57:08 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
PERSISTENCE_HELPER_TYPE_USER = 1 << 0,
|
|
|
|
PERSISTENCE_HELPER_TYPE_SYSTEM = 1 << 1,
|
|
|
|
PERSISTENCE_HELPER_TYPE_ALL = PERSISTENCE_HELPER_TYPE_USER | PERSISTENCE_HELPER_TYPE_SYSTEM
|
|
|
|
} PERSISTENCE_HELPER_TYPE;
|
|
|
|
|
2023-11-29 05:44:12 +08:00
|
|
|
// EXPLOIT_TYPE is defined as a bitmask as some devices are vulnerable to multiple exploits
|
|
|
|
//
|
|
|
|
// An app that has had one of these exploits applied ahead of time can declare which exploit
|
|
|
|
// was used via the TSPreAppliedExploitType Info.plist key. The corresponding value should be
|
|
|
|
// (number of bits to left-shift + 1).
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
// CVE-2022-26766
|
|
|
|
// TSPreAppliedExploitType = 1
|
|
|
|
EXPLOIT_TYPE_CUSTOM_ROOT_CERTIFICATE_V1 = 1 << 0,
|
|
|
|
|
|
|
|
// CVE-2023-41991
|
|
|
|
// TSPreAppliedExploitType = 2
|
|
|
|
EXPLOIT_TYPE_CMS_SIGNERINFO_V1 = 1 << 1
|
|
|
|
} EXPLOIT_TYPE;
|
|
|
|
|
2022-10-30 06:45:30 +08:00
|
|
|
extern LSApplicationProxy* findPersistenceHelperApp(PERSISTENCE_HELPER_TYPE allowedTypes);
|
|
|
|
|
|
|
|
typedef struct __SecCode const *SecStaticCodeRef;
|
|
|
|
|
|
|
|
typedef CF_OPTIONS(uint32_t, SecCSFlags) {
|
|
|
|
kSecCSDefaultFlags = 0
|
|
|
|
};
|
|
|
|
#define kSecCSRequirementInformation 1 << 2
|
|
|
|
#define kSecCSSigningInformation 1 << 1
|
|
|
|
|
|
|
|
OSStatus SecStaticCodeCreateWithPathAndAttributes(CFURLRef path, SecCSFlags flags, CFDictionaryRef attributes, SecStaticCodeRef *staticCode);
|
|
|
|
OSStatus SecCodeCopySigningInformation(SecStaticCodeRef code, SecCSFlags flags, CFDictionaryRef *information);
|
|
|
|
CFDataRef SecCertificateCopyExtensionValue(SecCertificateRef certificate, CFTypeRef extensionOID, bool *isCritical);
|
|
|
|
void SecPolicySetOptionsValue(SecPolicyRef policy, CFStringRef key, CFTypeRef value);
|
|
|
|
|
|
|
|
extern CFStringRef kSecCodeInfoEntitlementsDict;
|
|
|
|
extern CFStringRef kSecCodeInfoCertificates;
|
|
|
|
extern CFStringRef kSecPolicyAppleiPhoneApplicationSigning;
|
|
|
|
extern CFStringRef kSecPolicyAppleiPhoneProfileApplicationSigning;
|
|
|
|
extern CFStringRef kSecPolicyLeafMarkerOid;
|
|
|
|
|
|
|
|
extern SecStaticCodeRef getStaticCodeRef(NSString *binaryPath);
|
|
|
|
extern NSDictionary* dumpEntitlements(SecStaticCodeRef codeRef);
|
|
|
|
extern NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString *binaryPath);
|
2023-11-29 05:44:12 +08:00
|
|
|
extern NSDictionary* dumpEntitlementsFromBinaryData(NSData* binaryData);
|
|
|
|
|
|
|
|
extern EXPLOIT_TYPE getDeclaredExploitTypeFromInfoDictionary(NSDictionary *infoDict);
|
|
|
|
extern bool isPlatformVulnerableToExploitType(EXPLOIT_TYPE exploitType);
|