Skip to content

Commit

Permalink
Actually just make ChOma a submodule, much better
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Jan 12, 2024
1 parent 9197bd1 commit b700590
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ChOma"]
path = ChOma
url = https://github.com/opa334/ChOma
1 change: 1 addition & 0 deletions ChOma
Submodule ChOma added at b819ac
6 changes: 3 additions & 3 deletions Exploits/fastPathSign/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ TARGET = fastPathSign

CC = clang

CFLAGS = -framework Foundation -framework CoreServices -framework Security -fobjc-arc $(shell pkg-config --cflags libcrypto) -Isrc/external/include
LDFLAGS = $(shell pkg-config --libs libcrypto) -Lsrc/external/lib -lchoma
CFLAGS = -framework Foundation -framework CoreServices -framework Security -fobjc-arc $(shell pkg-config --cflags libcrypto) -I../../ChOma/src
LDFLAGS = $(shell pkg-config --libs libcrypto)

$(TARGET): $(wildcard src/*.m src/*.c)
$(TARGET): $(wildcard src/*.m src/*.c ../../ChOma/src/*.c)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^

clean:
Expand Down
20 changes: 10 additions & 10 deletions Exploits/fastPathSign/src/coretrust_bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <choma/CSBlob.h>
#include <choma/MachOByteOrder.h>
#include <choma/MachO.h>
#include <choma/Host.h>
#include <choma/MemoryStream.h>
#include <choma/FileStream.h>
#include <choma/BufferedStream.h>
#include <choma/SignOSSL.h>
#include <choma/CodeDirectory.h>
#include <choma/Base64.h>
#include "CSBlob.h"
#include "MachOByteOrder.h"
#include "MachO.h"
#include "Host.h"
#include "MemoryStream.h"
#include "FileStream.h"
#include "BufferedStream.h"
#include "SignOSSL.h"
#include "CodeDirectory.h"
#include "Base64.h"
#include "Templates/AppStoreCodeDirectory.h"
#include "Templates/SignatureBlob.h"
#include "Templates/DecryptedSignature.h"
Expand Down
2 changes: 0 additions & 2 deletions Exploits/fastPathSign/src/external/.gitignore

This file was deleted.

8 changes: 4 additions & 4 deletions Exploits/fastPathSign/src/main.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "codesign.h"
#include "coretrust_bug.h"
#include <choma/FAT.h>
#include <choma/MachO.h>
#include <choma/FileStream.h>
#include <choma/Host.h>
#include "FAT.h"
#include "MachO.h"
#include "FileStream.h"
#include "Host.h"
#include <copyfile.h>

char *extract_preferred_slice(const char *fatPath)
Expand Down
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,4 @@ build_installer64e:

endif

update-choma:
rm -rf _build/.choma
mkdir -p _build/.choma
git clone --recursive https://github.com/opa334/ChOma _build/.choma
make -C _build/.choma install TARGET=ios INSTALL_PATH=../../RootHelper/external
rm RootHelper/external/lib/libchoma.dylib
make -C _build/.choma clean
make -C _build/.choma install INSTALL_PATH=../../Exploits/fastPathSign/src/external
rm Exploits/fastPathSign/src/external/lib/libchoma.dylib
rm -rf _build/.choma

.PHONY: $(TOPTARGETS) pre_build assemble_trollstore make_trollhelper_package make_trollhelper_embedded build_installer15 build_installer64e
6 changes: 3 additions & 3 deletions RootHelper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ include $(THEOS)/makefiles/common.mk

TOOL_NAME = trollstorehelper

trollstorehelper_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m) ../Exploits/fastPathSign/src/coretrust_bug.c ../Exploits/fastPathSign/src/codesign.m
trollstorehelper_CFLAGS = -fobjc-arc -I../Shared $(shell pkg-config --cflags libcrypto) -Iexternal/include -I../Exploits/fastPathSign/src
trollstorehelper_LDFLAGS = -Lexternal/lib -lcrypto -lchoma
trollstorehelper_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m) $(wildcard ../ChOma/src/*.c) ../Exploits/fastPathSign/src/coretrust_bug.c ../Exploits/fastPathSign/src/codesign.m
trollstorehelper_CFLAGS = -fobjc-arc -I../Shared $(shell pkg-config --cflags libcrypto) -I../ChOma/src -I../Exploits/fastPathSign/src
trollstorehelper_LDFLAGS = -L../ChOma/external/ios -lcrypto
trollstorehelper_CODESIGN_FLAGS = --entitlements entitlements.plist
trollstorehelper_INSTALL_PATH = /usr/local/bin
trollstorehelper_LIBRARIES = archive
Expand Down
2 changes: 0 additions & 2 deletions RootHelper/external/.gitignore

This file was deleted.

Binary file removed RootHelper/external/lib/libcrypto.a
Binary file not shown.
8 changes: 4 additions & 4 deletions RootHelper/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#ifndef EMBEDDED_ROOT_HELPER
#import "codesign.h"
#import "coretrust_bug.h"
#import <choma/FAT.h>
#import <choma/MachO.h>
#import <choma/FileStream.h>
#import <choma/Host.h>
#import "FAT.h"
#import "MachO.h"
#import "FileStream.h"
#import "Host.h"
#endif

#import <SpringBoardServices/SpringBoardServices.h>
Expand Down

0 comments on commit b700590

Please sign in to comment.