ethangreen-dev / lovely-injector

A runtime lua injector for games built with LÖVE
MIT License
78 stars 11 forks source link

MacOS: Library load disallowed by system policy #81

Closed zachinglis closed 1 month ago

zachinglis commented 1 month ago

Following the instructions I get...

➜ /Users/pie/Library/Application\ Support/Steam/steamapps/common/Balatro/run_lovely.sh 
dyld[9133]: terminating because inserted dylib 'liblovely.dylib' could not be loaded: tried: 'liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OSliblovely.dylib' (no such file), 'liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy), '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' (no such file), '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy)
dyld[9133]: tried: 'liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OSliblovely.dylib' (no such file), 'liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy), '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' (no such file), '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' (code signature in <C444527A-7752-61BB-B9FE-C32A10C71456> '/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib' not valid for use in process: library load disallowed by system policy)
/Users/pie/Library/Application Support/Steam/steamapps/common/Balatro/run_lovely.sh: line 8:  9133 Abort trap: 6           ./Balatro.app/Contents/MacOS/love "$@"

~ took 4s 
➜ 
randallbruder commented 1 month ago

That's because macOS's Gatekeeper is quarantining the file. You can remove the quarantine flag, and get modded Balatro to run by running this in terminal:

sudo xattr -rd com.apple.quarantine "~/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib"

(if your liblovely.dylib file is in a different location, you should update that file path in the above command.)

simoncozens commented 1 month ago

xattr doesn't support the -r flag on Sonoma, and the ~ should go outside the shell quotes; this works:

$ sudo xattr -d com.apple.quarantine ~"/Library/Application Support/Steam/steamapps/common/Balatro/liblovely.dylib"
zachinglis commented 1 month ago

Thank you all.