SpotX-Official / SpotX-Bash

SpotX Mac and Linux adblocker for the Spotify desktop client, in Bash
MIT License
2.28k stars 76 forks source link

Ran spotx-bash and got this error(CODESIGN) #31

Closed insomnia-creator closed 8 months ago

insomnia-creator commented 9 months ago

🧐 Have you fully read the README and viewed similar issues?

Сountry of your account

India

What is your Spotify Plan?

Free

Do you have Spicetify installed?

No

ℹ Computer information

- Spotify version: 1.2.31.1205.g4d59ad7c for macOS(Apple Silicon)
- OS: 14.1 (23B2073)
- Shell: zsh

📝 Description

  1. Run script
  2. Open spotify
  3. Error comes ...

🖥️ Terminal Input/Output

Running install script works all fine

📸 Screenshots

CleanShot 2024-02-15 at 15 36 02@2x

jetfir3 commented 9 months ago

showing the exact input command used + script output is always helpful (and is requested in the Issues template).

delete spotify app from applications directory. re-run spotx-bash with --installmac flag (plus any additional flags you may be using) to have spotx-bash reinstall and patch spotify. If issue still happens.. share the input command + script output via screenshot.

then we can begin resolving the issue.

insomnia-creator commented 9 months ago

CleanShot 2024-02-16 at 06 23 58@2x

CleanShot 2024-02-16 at 06 24 23@2x

it runs fine but gives the error once i open

jetfir3 commented 9 months ago

Thanks. And.. strange. Can you run the following commands and screenshot input/output?

1.

command -v codesign
  1. codesign -dv /Applications/Spotify.app
  2. codesign -f --deep -s - /Applications/Spotify.app

Command # 1 just checks that the command the script is using to confirm codesign is installed actually works on your system... it should print the location of codesign.

Command # 2 would confirm if the app has an ad hoc signature or not (if it doesn't then the app was not re-signed by SpotX-Bash which explains the codesign error).

Command # 3 attempts to codesign the Spotify.app bundle.

If command # 1 works without error but # 3 fails then it's possible the issue is due to a macOS "security setting". You would need to to add your terminal app which you are using to the list in System Settings > Privacy & Security > App Management for codesign to be "allowed" to re-sign apps. If not using the default Terminal app or you are using the default Terminal app but it is not listed in the App Management allowances, this could explain why the script was unable to codesign the app.

Once the Spotify.app is re-codesigned using command # 3, the app should no longer crash on run.

insomnia-creator commented 9 months ago

I have codesign binary: CleanShot 2024-02-16 at 15 01 18@2x Command 2: CleanShot 2024-02-16 at 15 01 30@2x Command 3: CleanShot 2024-02-16 at 15 02 06@2x i've tried all of these commands before with no result, CleanShot 2024-02-16 at 15 02 28@2x

Quick edit: I believe this is your 'app management right?' i've given alacritty permissions CleanShot 2024-02-16 at 15 07 03@2x

SOLUTION: RUN INSTALL SCRIPT WITH TERMINAL(macos)

Maybe can we at least change script to prompt user if using terminal emulator?

jetfir3 commented 9 months ago

i've tried all of these commands before with no result,

SOLUTION: RUN INSTALL SCRIPT WITH TERMINAL(macos)

Maybe can we at least change script to prompt user if using terminal emulator?

and this is why it's always best to share all input/output when dealing with cli issues. your output from command # 3 seems to explain exactly what's going on.

It appears that due to how alacritty is treated by macOS (and how alacritty works with the system), some extended attributes are being attached to the Spotify app while SpotX-Bash is working with it. This causes issues when attempting to re-codesign and the codesign never succeeds and you run into issues such as those being reported on this page.

I've updated the repo which should hopefully fix this (inb4 copycat Spotify repos steal this too...).

  1. Please delete /Applications/Spotify.app and reattempt the following in Alacritty:

    bash <(curl -sSL https://spotx-official.github.io/run.sh) --installmac
  2. I would be surprised if Spotify crashes now -- but if it STILL crashes, supply the input/output of:

    xattr -lr /Applications/Spotify.app
  3. Your PR is working around the issue but not solving the actual problem -- this will be closed and not accepted.

  4. Even if all is now working for you, please report back.

insomnia-creator commented 8 months ago

It works all well, I've tried it with alacritty right now and it's working fine. Thanks for your help.