forked from khanhduytran0/LiveContainer
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
9,603 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
TARGET := iphone:clang:latest:7.0 | ||
ARCHS := arm64 | ||
include $(THEOS)/makefiles/common.mk | ||
|
||
LIBRARY_NAME = ZSign | ||
|
||
ZSign_FILES = $(shell find . -name '*.cpp') $(shell find . -name '*.mm') zsigner.m | ||
ZSign_CFLAGS = -fobjc-arc -Wno-deprecated -Wno-unused-variable -Wno-unused-but-set-variable -Wno-module-import-in-extern-c | ||
ZSign_CCFLAGS = -std=c++11 | ||
ZSign_FRAMEWORKS = OpenSSL | ||
ZSign_INSTALL_PATH = /Applications/LiveContainer.app/Frameworks | ||
|
||
include $(THEOS_MAKE_PATH)/library.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Utils.hpp | ||
// feather | ||
// | ||
// Created by samara on 30.09.2024. | ||
// | ||
|
||
#ifndef Utils_hpp | ||
#define Utils_hpp | ||
|
||
#include <stdio.h> | ||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
const char* getDocumentsDirectory(); | ||
void writeToNSLog(const char* msg); | ||
void refreshFile(const char* path); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* zsign_hpp */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Utils.cpp | ||
// feather | ||
// | ||
// Created by samara on 30.09.2024. | ||
// | ||
|
||
#include "Utils.hpp" | ||
#import <Foundation/Foundation.h> | ||
|
||
extern "C" { | ||
|
||
const char* getDocumentsDirectory() { | ||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | ||
NSString *documentsDirectory = [paths firstObject]; | ||
const char *documentsPath = [documentsDirectory UTF8String]; | ||
return documentsPath; | ||
} | ||
|
||
void writeToNSLog(const char* msg) { | ||
NSLog(@"[LC] singner msg: %s", msg); | ||
} | ||
|
||
// copy, remove and rename back the file to prevent crash due to kernel signature cache | ||
// see https://developer.apple.com/documentation/security/updating-mac-software | ||
void refreshFile(const char* path) { | ||
NSString* objcPath = @(path); | ||
if(![NSFileManager.defaultManager fileExistsAtPath:objcPath]) { | ||
return; | ||
} | ||
NSString* newPath = [NSString stringWithFormat:@"%s.tmp", path]; | ||
NSError* error; | ||
[NSFileManager.defaultManager copyItemAtPath:objcPath toPath:newPath error:&error]; | ||
[NSFileManager.defaultManager removeItemAtPath:objcPath error:&error]; | ||
[NSFileManager.defaultManager moveItemAtPath:newPath toPath:objcPath error:&error]; | ||
} | ||
|
||
} |
Oops, something went wrong.