Skip to content

Commit

Permalink
implement signature fix
Browse files Browse the repository at this point in the history
  • Loading branch information
italomandara committed May 18, 2024
1 parent b6451e0 commit ceba6ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Crossover patcher/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let SKIP_VENTURA_CHECK = false
let ENABLE_CLEAR_D3DMETAL_CACHE = true
let ENABLE_CLEAR_STEAM_CACHE = true
let D3DM_CACHE_FOLDER = "d3dm"
let ENABLE_FIX_CX_CODESIGN = false // /usr/bin/codesign --force --deep --sign - (app)
let ENABLE_FIX_CX_CODESIGN = true
enum UIGlobals: CGFloat {
case radius = 10.00
}
Expand Down
10 changes: 7 additions & 3 deletions Crossover patcher/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ func restoreAndPatch(url: URL, opts: inout Opts, onPatch: () -> Void = {}) {
}
validateAndPatch(url: url, opts: &opts, onPatch: onPatch)
if(ENABLE_FIX_CX_CODESIGN) {
//TO DO: implement codesign fix
do {
print("patching \(url.path)")
try safeShell("/usr/bin/xattr -cr \(url.path) && /usr/bin/codesign --force --deep --sign - \(url.path)")
} catch {
print("xattr or codesign failed")
}
}
opts.busy = false
}
Expand Down Expand Up @@ -569,6 +574,7 @@ func removeGlobals(url: URL) {
enable(dest: url.path + SHARED_SUPPORT_PATH + BOTTLE_PATH_OVERRIDE)
}

@discardableResult
func safeShell(_ command: String) throws -> String {
let task = Process()
let pipe = Pipe()
Expand Down Expand Up @@ -596,8 +602,6 @@ func darwinUserCacheDir() -> URL? {

func removeD3DMetalCaches() -> DeleteStatus {
do {
// let darwinUserCacheDir: String = try safeShell("echo $(getconf DARWIN_USER_CACHE_DIR)")
// let d3dmPath = darwinUserCacheDir.replacingOccurrences(of: "\n", with: "") + D3DM_CACHE_FOLDER
let d3dmPath = darwinUserCacheDir()!.appendingPathComponent(D3DM_CACHE_FOLDER, isDirectory: true).path

let _items = try f.contentsOfDirectory(atPath: d3dmPath)
Expand Down

0 comments on commit ceba6ed

Please sign in to comment.