fix: properly convert CString to String

This commit is contained in:
alexia 2023-04-24 01:36:25 +02:00
parent 8835f91cb6
commit bc4a0fe7df
No known key found for this signature in database
GPG key ID: A00680AA35225FBE
3 changed files with 6 additions and 4 deletions

View file

@ -5,10 +5,12 @@ import os
let vendettaLog = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "vendetta")
let source = URL(string: "vendetta")!
let install_prefix = String(cString: get_install_prefix())
let vendettaPatchesBundlePath =
FileManager.default.fileExists(
atPath: "\(install_prefix())/Library/Application Support/VendettaTweak/VendettaPatches.bundle")
? "\(install_prefix())/Library/Application Support/VendettaTweak/VendettaPatches.bundle"
atPath: "\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle")
? "\(install_prefix)/Library/Application Support/VendettaTweak/VendettaPatches.bundle"
: "\(Bundle.main.bundleURL.path)/VendettaPatches.bundle"
class LoadHook: ClassHook<RCTCxxBridge> {

View file

@ -1,6 +1,6 @@
#import <Orion/Orion.h>
const char * const _Nonnull install_prefix(void) {
const char * const _Nonnull get_install_prefix(void) {
return THEOS_PACKAGE_INSTALL_PREFIX;
}

View file

@ -1,3 +1,3 @@
#import "RCTCxxBridge.h"
const char * const _Nonnull install_prefix(void);
const char * const _Nonnull get_install_prefix(void);