mirror of https://github.com/opa334/TrollStore.git
Revamp build process to produce new embdded binaries in build folder
This commit is contained in:
parent
1368357c87
commit
e0a580c44b
14
Makefile
14
Makefile
|
@ -1,6 +1,6 @@
|
||||||
TOPTARGETS := all clean
|
TOPTARGETS := all clean
|
||||||
|
|
||||||
$(TOPTARGETS): pre_build make_fastPathSign make_roothelper make_trollstore make_trollhelper make_trollhelper_package assemble_trollstore make_trollhelper_embedded build_installer15 build_installer64e
|
$(TOPTARGETS): pre_build make_fastPathSign make_roothelper make_trollstore make_trollhelper_embedded make_trollhelper_package assemble_trollstore build_installer15 build_installer64e
|
||||||
|
|
||||||
pre_build:
|
pre_build:
|
||||||
@rm -rf ./_build 2>/dev/null || true
|
@rm -rf ./_build 2>/dev/null || true
|
||||||
|
@ -17,9 +17,6 @@ make_roothelper:
|
||||||
make_trollstore:
|
make_trollstore:
|
||||||
@$(MAKE) -C ./TrollStore FINALPACKAGE=1 $(MAKECMDGOALS)
|
@$(MAKE) -C ./TrollStore FINALPACKAGE=1 $(MAKECMDGOALS)
|
||||||
|
|
||||||
make_trollhelper:
|
|
||||||
@$(MAKE) -C ./TrollStore FINALPACKAGE=1 $(MAKECMDGOALS)
|
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
|
||||||
make_trollhelper_package:
|
make_trollhelper_package:
|
||||||
|
@ -31,6 +28,11 @@ make_trollhelper_package:
|
||||||
make_trollhelper_embedded:
|
make_trollhelper_embedded:
|
||||||
@$(MAKE) clean -C ./TrollHelper
|
@$(MAKE) clean -C ./TrollHelper
|
||||||
@$(MAKE) -C ./TrollHelper FINALPACKAGE=1 EMBEDDED_ROOT_HELPER=1 $(MAKECMDGOALS)
|
@$(MAKE) -C ./TrollHelper FINALPACKAGE=1 EMBEDDED_ROOT_HELPER=1 $(MAKECMDGOALS)
|
||||||
|
@cp ./TrollHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper ./_build/PersistenceHelper_Embedded
|
||||||
|
@$(MAKE) clean -C ./TrollHelper
|
||||||
|
@$(MAKE) -C ./TrollHelper FINALPACKAGE=1 EMBEDDED_ROOT_HELPER=1 LEGACY_CT_BUG=1 $(MAKECMDGOALS)
|
||||||
|
@cp ./TrollHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper ./_build/PersistenceHelper_Embedded_Legacy
|
||||||
|
@$(MAKE) clean -C ./TrollHelper
|
||||||
|
|
||||||
assemble_trollstore:
|
assemble_trollstore:
|
||||||
@cp ./RootHelper/.theos/obj/trollstorehelper ./TrollStore/.theos/obj/TrollStore.app/trollstorehelper
|
@cp ./RootHelper/.theos/obj/trollstorehelper ./TrollStore/.theos/obj/TrollStore.app/trollstorehelper
|
||||||
|
@ -41,7 +43,7 @@ assemble_trollstore:
|
||||||
build_installer15:
|
build_installer15:
|
||||||
@mkdir -p ./_build/tmp15
|
@mkdir -p ./_build/tmp15
|
||||||
@unzip ./Victim/InstallerVictim.ipa -d ./_build/tmp15
|
@unzip ./Victim/InstallerVictim.ipa -d ./_build/tmp15
|
||||||
@cp ./TrollHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper ./_build/TrollStorePersistenceHelperToInject
|
@cp ./_build/PersistenceHelper_Embedded_Legacy ./_build/TrollStorePersistenceHelperToInject
|
||||||
@pwnify set-cpusubtype ./_build/TrollStorePersistenceHelperToInject 1
|
@pwnify set-cpusubtype ./_build/TrollStorePersistenceHelperToInject 1
|
||||||
@ldid -s -K./Victim/victim.p12 ./_build/TrollStorePersistenceHelperToInject
|
@ldid -s -K./Victim/victim.p12 ./_build/TrollStorePersistenceHelperToInject
|
||||||
APP_PATH=$$(find ./_build/tmp15/Payload -name "*" -depth 1) ; \
|
APP_PATH=$$(find ./_build/tmp15/Payload -name "*" -depth 1) ; \
|
||||||
|
@ -62,7 +64,7 @@ build_installer64e:
|
||||||
APP_NAME=$$(basename $$APP_PATH) ; \
|
APP_NAME=$$(basename $$APP_PATH) ; \
|
||||||
BINARY_NAME=$$(echo "$$APP_NAME" | cut -f 1 -d '.') ; \
|
BINARY_NAME=$$(echo "$$APP_NAME" | cut -f 1 -d '.') ; \
|
||||||
echo $$BINARY_NAME ; \
|
echo $$BINARY_NAME ; \
|
||||||
pwnify pwn64e ./_build/tmp64e/Payload/$$APP_NAME/$$BINARY_NAME ./TrollHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper
|
pwnify pwn64e ./_build/tmp64e/Payload/$$APP_NAME/$$BINARY_NAME ./_build/PersistenceHelper_Embedded_Legacy
|
||||||
@pushd ./_build/tmp64e ; \
|
@pushd ./_build/tmp64e ; \
|
||||||
zip -vrD ../../_build/TrollHelper_arm64e.ipa * ; \
|
zip -vrD ../../_build/TrollHelper_arm64e.ipa * ; \
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@interface TSListControllerShared : PSListController
|
@interface TSListControllerShared : PSListController
|
||||||
- (BOOL)isTrollStore;
|
- (BOOL)isTrollStore;
|
||||||
- (NSString*)getTrollStoreVersion;
|
- (NSString*)getTrollStoreVersion;
|
||||||
- (void)downloadTrollStoreAndDo:(void (^)(NSString* localTrollStoreTarPath))doHandler;
|
- (void)downloadTrollStoreAndRun:(void (^)(NSString* localTrollStoreTarPath))doHandler;
|
||||||
- (void)installTrollStorePressed;
|
- (void)installTrollStorePressed;
|
||||||
- (void)updateTrollStorePressed;
|
- (void)updateTrollStorePressed;
|
||||||
- (void)rebuildIconCachePressed;
|
- (void)rebuildIconCachePressed;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)downloadTrollStoreAndDo:(void (^)(NSString* localTrollStoreTarPath))doHandler
|
- (void)downloadTrollStoreAndRun:(void (^)(NSString* localTrollStoreTarPath))doHandler
|
||||||
{
|
{
|
||||||
NSURL* trollStoreURL = [NSURL URLWithString:@"https://github.com/opa334/TrollStore/releases/latest/download/TrollStore.tar"];
|
NSURL* trollStoreURL = [NSURL URLWithString:@"https://github.com/opa334/TrollStore/releases/latest/download/TrollStore.tar"];
|
||||||
NSURLRequest* trollStoreRequest = [NSURLRequest requestWithURL:trollStoreURL];
|
NSURLRequest* trollStoreRequest = [NSURLRequest requestWithURL:trollStoreURL];
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
[downloadTask resume];
|
[downloadTask resume];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_updateOrInstallTrollStore:(BOOL)update
|
- (void)_installTrollStoreComingFromUpdateFlow:(BOOL)update
|
||||||
{
|
{
|
||||||
if(update)
|
if(update)
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
[TSPresentationDelegate startActivity:@"Installing TrollStore"];
|
[TSPresentationDelegate startActivity:@"Installing TrollStore"];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self downloadTrollStoreAndDo:^(NSString* tmpTarPath)
|
[self downloadTrollStoreAndRun:^(NSString* tmpTarPath)
|
||||||
{
|
{
|
||||||
int ret = spawnRoot(rootHelperPath(), @[@"install-trollstore", tmpTarPath], nil, nil);
|
int ret = spawnRoot(rootHelperPath(), @[@"install-trollstore", tmpTarPath], nil, nil);
|
||||||
[[NSFileManager defaultManager] removeItemAtPath:tmpTarPath error:nil];
|
[[NSFileManager defaultManager] removeItemAtPath:tmpTarPath error:nil];
|
||||||
|
@ -112,12 +112,12 @@
|
||||||
|
|
||||||
- (void)installTrollStorePressed
|
- (void)installTrollStorePressed
|
||||||
{
|
{
|
||||||
[self _updateOrInstallTrollStore:NO];
|
[self _installTrollStoreComingFromUpdateFlow:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateTrollStorePressed
|
- (void)updateTrollStorePressed
|
||||||
{
|
{
|
||||||
[self _updateOrInstallTrollStore:YES];
|
[self _installTrollStoreComingFromUpdateFlow:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)rebuildIconCachePressed
|
- (void)rebuildIconCachePressed
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#define TrollStoreErrorDomain @"TrollStoreErrorDomain"
|
#define TrollStoreErrorDomain @"TrollStoreErrorDomain"
|
||||||
|
|
||||||
extern void chineseWifiFixup(void);
|
extern void chineseWifiFixup(void);
|
||||||
extern NSString* safe_getExecutablePath();
|
extern NSString *getExecutablePath(void);
|
||||||
extern NSString* rootHelperPath(void);
|
extern NSString* rootHelperPath(void);
|
||||||
extern NSString* getNSStringFromFile(int fd);
|
extern NSString* getNSStringFromFile(int fd);
|
||||||
extern void printMultilineNSString(NSString* stringToPrint);
|
extern void printMultilineNSString(NSString* stringToPrint);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <spawn.h>
|
#import <spawn.h>
|
||||||
#import <sys/sysctl.h>
|
#import <sys/sysctl.h>
|
||||||
|
#import <mach-o/dyld.h>
|
||||||
|
|
||||||
@interface PSAppDataUsagePolicyCache : NSObject
|
@interface PSAppDataUsagePolicyCache : NSObject
|
||||||
+ (instancetype)sharedInstance;
|
+ (instancetype)sharedInstance;
|
||||||
|
@ -26,17 +27,18 @@ void chineseWifiFixup(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern char*** _NSGetArgv();
|
NSString *getExecutablePath(void)
|
||||||
NSString* safe_getExecutablePath()
|
|
||||||
{
|
{
|
||||||
char* executablePathC = **_NSGetArgv();
|
uint32_t len = PATH_MAX;
|
||||||
return [NSString stringWithUTF8String:executablePathC];
|
char selfPath[len];
|
||||||
|
_NSGetExecutablePath(selfPath, &len);
|
||||||
|
return [NSString stringWithUTF8String:selfPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EMBEDDED_ROOT_HELPER
|
#ifdef EMBEDDED_ROOT_HELPER
|
||||||
NSString* rootHelperPath(void)
|
NSString* rootHelperPath(void)
|
||||||
{
|
{
|
||||||
return safe_getExecutablePath();
|
return getExecutablePath();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
NSString* rootHelperPath(void)
|
NSString* rootHelperPath(void)
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
export EMBEDDED_ROOT_HELPER ?= 0
|
export EMBEDDED_ROOT_HELPER ?= 0
|
||||||
|
export LEGACY_CT_BUG ?= 0
|
||||||
|
|
||||||
TARGET := iphone:clang:16.4:14.0
|
TARGET := iphone:clang:16.4:14.0
|
||||||
INSTALL_TARGET_PROCESSES = TrollStorePersistenceHelper
|
INSTALL_TARGET_PROCESSES = TrollStorePersistenceHelper
|
||||||
ARCHS = arm64
|
ARCHS = arm64
|
||||||
|
|
||||||
|
ifneq ($(LEGACY_CT_BUG),1)
|
||||||
TARGET_CODESIGN = ../Exploits/fastPathSign/fastPathSign
|
TARGET_CODESIGN = ../Exploits/fastPathSign/fastPathSign
|
||||||
|
endif
|
||||||
|
|
||||||
include $(THEOS)/makefiles/common.mk
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
@ -14,7 +17,12 @@ TrollStorePersistenceHelper_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m)
|
||||||
TrollStorePersistenceHelper_FRAMEWORKS = UIKit CoreGraphics CoreServices
|
TrollStorePersistenceHelper_FRAMEWORKS = UIKit CoreGraphics CoreServices
|
||||||
TrollStorePersistenceHelper_PRIVATE_FRAMEWORKS = Preferences MobileContainerManager
|
TrollStorePersistenceHelper_PRIVATE_FRAMEWORKS = Preferences MobileContainerManager
|
||||||
TrollStorePersistenceHelper_CFLAGS = -fobjc-arc -I../Shared
|
TrollStorePersistenceHelper_CFLAGS = -fobjc-arc -I../Shared
|
||||||
|
|
||||||
|
ifeq ($(LEGACY_CT_BUG),1)
|
||||||
|
TrollStorePersistenceHelper_CODESIGN_FLAGS = -Sentitlements.plist -K../legacy.p12
|
||||||
|
else
|
||||||
TrollStorePersistenceHelper_CODESIGN_FLAGS = --entitlements entitlements.plist
|
TrollStorePersistenceHelper_CODESIGN_FLAGS = --entitlements entitlements.plist
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(EMBEDDED_ROOT_HELPER),1)
|
ifeq ($(EMBEDDED_ROOT_HELPER),1)
|
||||||
TrollStorePersistenceHelper_CFLAGS += -DEMBEDDED_ROOT_HELPER=1
|
TrollStorePersistenceHelper_CFLAGS += -DEMBEDDED_ROOT_HELPER=1
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
[_specifiers addObject:installTrollStoreSpecifier];
|
[_specifiers addObject:installTrollStoreSpecifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString* backupPath = [safe_getExecutablePath() stringByAppendingString:@"_TROLLSTORE_BACKUP"];
|
NSString* backupPath = [getExecutablePath() stringByAppendingString:@"_TROLLSTORE_BACKUP"];
|
||||||
if([[NSFileManager defaultManager] fileExistsAtPath:backupPath])
|
if([[NSFileManager defaultManager] fileExistsAtPath:backupPath])
|
||||||
{
|
{
|
||||||
PSSpecifier* uninstallHelperGroupSpecifier = [PSSpecifier emptyGroupSpecifier];
|
PSSpecifier* uninstallHelperGroupSpecifier = [PSSpecifier emptyGroupSpecifier];
|
||||||
|
|
Loading…
Reference in New Issue