Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

fix(runner): treat an unsigned loader as not hardened

raymondchins284704dd3243
diff --git a/app/Sources/NotProtonApp/Model/RunnerPatcher.swift b/app/Sources/NotProtonApp/Model/RunnerPatcher.swift
index e1c4a88..7f933a8 100644
--- a/app/Sources/NotProtonApp/Model/RunnerPatcher.swift
+++ b/app/Sources/NotProtonApp/Model/RunnerPatcher.swift
@@ -248,8 +248,11 @@ enum RunnerPatcher {
static func isHardened(_ loader: URL) -> Bool {
guard let result = try? Shell.run(
"/usr/bin/codesign", ["-dv", signingTarget(for: loader).path(percentEncoded: false)]
- ), result.status == 0 else { return true }
+ ) else { return true }
let described = result.stderr + result.stdout
+ // An unsigned loader (WineCX ships one) has no hardened runtime, so dyld already
+ // honours DYLD_* and there is nothing to extend.
+ if result.status != 0 { return !described.contains("not signed at all") }
return described.split(separator: "\n").contains {
$0.hasPrefix("CodeDirectory") && $0.contains("runtime")
}