cli icon indicating copy to clipboard operation
cli copied to clipboard

[V3][macOS] Generated Spicetify.app has an invalid code signature after Info.plist modification

Open ragtimelab opened this issue 2 months ago • 1 comments

Summary

On macOS, Spicetify v3 creates ~/Applications/Spicetify.app as the handler for spicetify://, but the generated bundle fails code-signature verification immediately after spicetify apply:

invalid Info.plist (plist or signature have been modified)
In architecture: x86_64

osacompile creates an ad-hoc-signed applet, then Spicetify modifies its Info.plist to add the bundle identifier and URL scheme without re-signing the bundle.

Environment

  • macOS 15.8 (24H23)
  • Intel (x86_64)
  • Spicetify 3.0.0-beta.17
  • Spotify 1.3.0.277

This was reproduced with the latest prerelease available on 2026-09-15.

Steps to reproduce

  1. Install Spicetify 3.0.0-beta.17 on macOS.

  2. Run:

    spicetify apply
    
  3. Verify the generated protocol-handler bundle:

    codesign --verify --deep --strict --verbose=4 \
      "$HOME/Applications/Spicetify.app"
    

Actual behavior

/Users/<user>/Applications/Spicetify.app: invalid Info.plist (plist or signature have been modified)
In architecture: x86_64

The signature metadata also retains the pre-modification identity:

Identifier=Spicetify
Signature=adhoc
Info.plist=not bound

while the current plist contains:

CFBundleIdentifier = app.spicetify.protocol
CFBundleURLSchemes = [spicetify]

Expected behavior

The generated local protocol-handler bundle should remain internally consistent and pass codesign --verify after Spicetify finishes adding its URL-scheme metadata.

Root cause

In install_protocol_handler, the current order is:

  1. Create the applet with osacompile.
  2. Modify Contents/Info.plist in declare_url_scheme.
  3. Register the modified bundle with lsregister.

There is no signing step after the plist modification:

https://github.com/spicetify/cli/blob/v3.0.0-beta.17/rust/crates/spicetify/src/platform/macos.rs#L113-L135

The individual plist mutations are here:

https://github.com/spicetify/cli/blob/v3.0.0-beta.17/rust/crates/spicetify/src/platform/macos.rs#L157-L172

The current v3-beta branch had the same order when checked:

https://github.com/spicetify/cli/blob/v3-beta/rust/crates/spicetify/src/platform/macos.rs#L113-L133

Validated minimal fix

I copied the generated app to a temporary directory and re-signed only the copy after the plist had already been modified:

codesign --force --sign - /tmp/.../Spicetify.app
codesign --verify --deep --strict --verbose=4 /tmp/.../Spicetify.app

The verification then passed:

Spicetify.app: valid on disk
Spicetify.app: satisfies its Designated Requirement

This suggests adding an ad-hoc re-sign step after declare_url_scheme(...) and before lsregister -f.

Scope

  • Spotify itself still passes codesign --verify --deep --strict.
  • Spotify UI, playback, the v3 Module Store, and persistence across a Spotify relaunch all worked normally in this installation.
  • The invalid bundle is the separate helper that owns the external spicetify:// URL scheme.
  • I have only reproduced this on Intel macOS. The source sequence appears architecture-independent, but I have not verified it on Apple Silicon.

This report is about preserving the integrity of the locally generated ad-hoc signature after modifying Info.plist. It is not a request for Developer ID signing or notarization; an ad-hoc re-sign fixes codesign --verify but does not make the helper notarized.

ragtimelab avatar Sep 15 '26 04:09 ragtimelab

Thanks for the detailed reproduction. I have also been able to reproduce the invalid signature on Apple Silicon, so this is not limited to Intel. The helper needs to be re-signed after its Info.plist changes, before registration. This concerns the separate Spicetify.app protocol handler, not Spotify’s signature, and should not require Developer ID signing or notarization.

afonsojramos avatar Sep 15 '26 14:09 afonsojramos