Skip to content

Commit

Permalink
feat: allow injection of introspection libraries (fix some apps) (Pla…
Browse files Browse the repository at this point in the history
  • Loading branch information
ohaiibuzzle committed Mar 7, 2023
1 parent 6d0b873 commit b6a60c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PlayCover/Model/AppSettings.swift
Expand Up @@ -27,6 +27,7 @@ struct AppSettingsData: Codable {
var inverseScreenValues = false
var metalHUD = false
var windowFixMethod = 0
var injectIntrospection = false

init() {}

Expand All @@ -52,6 +53,7 @@ struct AppSettingsData: Codable {
inverseScreenValues = try container.decodeIfPresent(Bool.self, forKey: .inverseScreenValues) ?? false
metalHUD = try container.decodeIfPresent(Bool.self, forKey: .metalHUD) ?? false
windowFixMethod = try container.decodeIfPresent(Int.self, forKey: .windowFixMethod) ?? 0
injectIntrospection = try container.decodeIfPresent(Bool.self, forKey: .injectIntrospection) ?? false
}
}

Expand Down
4 changes: 4 additions & 0 deletions PlayCover/Model/PlayApp.swift
Expand Up @@ -64,6 +64,10 @@ class PlayApp: BaseApp {
config.environment = ["MTL_HUD_ENABLED": "0"]
}

if settings.settings.injectIntrospection {
config.environment["DYLD_LIBRARY_PATH"] = "/usr/lib/system/introspection"
}

NSWorkspace.shared.openApplication(
at: url,
configuration: config,
Expand Down
6 changes: 6 additions & 0 deletions PlayCover/Views/AppSettingsView.swift
Expand Up @@ -422,6 +422,12 @@ struct BypassesView: View {
.help("settings.toggle.jbBypass.help")
Spacer()
}
Spacer()
HStack {
Toggle("settings.toggle.introspection", isOn: $settings.settings.injectIntrospection)
.help("settings.toggle.introspection.help")
Spacer()
}
}
.padding()
}
Expand Down
2 changes: 2 additions & 0 deletions PlayCover/en.lproj/Localizable.strings
Expand Up @@ -184,6 +184,8 @@
"settings.playChain.enable" = "Enable PlayChain (Experimental)";
"settings.playChain.help" = "Enable PlayChain support for this application, allowing it to (partially) use Apple Keychain Services";
"settings.playChain.debugging" = "PlayChain debugging";
"settings.toggle.introspection" = "Insert Introspection libraries";
"settings.toggle.introspection.help" = "Add the system introspection libraries to the app. Known to fix issues with some apps not starting correctly";

"settings.removePlayTools" = "Remove PlayTools";
"settings.addToLaunchpad" = "Add to Launchpad";
Expand Down

0 comments on commit b6a60c8

Please sign in to comment.