Open genhack opened 2 months ago
Thanks for solving the issue
The current script is using awk to parse values from a binary .plist file, resulting in the following error:
awk: towc: multibyte conversion failure on: '?! '
input record number 1, file /Applications/Spotify.app/Contents/Info.plist
source line number 1
This happens because the Info.plist file format is binary, and awk expects text input. The binary format contains characters that are not correctly interpreted by the tool, causing multibyte conversion errors.
I fixed it by replacing this line in install.sh:
CLIENT_VERSION=$(awk '/CFBundleShortVersionString/{getline; print}' "${INSTALL_PATH}/Contents/Info.plist" | cut -d\> -f2-$
with this:
CLIENT_VERSION=$(plutil -extract CFBundleShortVersionString xml1 -o - "${INSTALL_PATH}/Contents/Info.plist" | sed -n 's/.*<string>\(.*\)<\/string>.*/\1/p')
I'd prefer this solution: https://github.com/Nuzair46/BlockTheSpot-Mac/pull/85
defaults read "/Applications/Spotify.app/Contents/Info.plist" CFBundleVersion
gives you back the installed Spotify version without bash hackery 😉
Hello, installing spotify with brew and show this problem with awk.
`awk: towc: multibyte conversion failure on: '?! '
input record number 1, file /Applications/Spotify.app/Contents/Info.plist source line number 1
BlockTheSpot-Mac by @Nuzair46
Spotify version: BlockTheSpot-Mac version: 1.2.32.985.g3be2709c`
Instead with plutil retrieve the correct value as expected: ./install.sh
Spotify client version: 1.2.45.454
BlockTheSpot-Mac by @Nuzair46
Spotify version: 1.2.45.454 BlockTheSpot-Mac version: 1.2.32.985.g3be2709c
Creating backup... Extracting xpui... Applying BlockTheSpot patches... Removing ad-related content... Patching Binary... Removing premium-only features... Removing logging... Adding credits... Signing Spotify... BlockTheSpot finished patching!