Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch aims to implement proper persistence on Darwin (macOS) by reapplying the injector when an update finishes. It also forcibly signs the bundle to ensure that it has a stable Designated Requirement, which is important for e.g. screen sharing and keybinds to work consistently.
Currently, it's hardcoded to use a code signing identity named
Moonlight
. This should be made configurable at some point.This doesn't work at the moment because it introduces some kind of race against the app becoming ready:
The code signing process succeeds, but by the time
registerSchemesAsPrivileged
runs (a function in Discord's ASAR) the app is already ready for some reason.As I was repeatedly re-running this I managed to get past the error and get this one:
According to Squirrel, the update bundle needs to match the DR of the target bundle, so we might need to actually sign Discord in moonlight's installer. Doing it from within core seems a bit precarious because macOS might not recognize the designated requirement changing on the fly like that.