Movatterモバイル変換


[0]ホーム

URL:


MacRumors ForumsMacRumors Forums
SidebarSidebar
Become aMacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

App "breaking itself" periodically (security?)

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use analternative browser.
Nermal

Nermal

Moderator
Original poster
Staff member
Dec 7, 2002
21,593
5,567
New Zealand
Hi,

I downloaded vkQuake the other day: it's an open-source engine for running the classic game Quake. Unfortunately, it's a bit stupid: by default it looks for the game resources in the same directory as the app itself. This means that I need to put Quake's "ID1" folder in my Applications folder, which feels like clutter to me.

There's a command-line argument you can pass in that makes it look elsewhere. As far as I can tell, there's no simple way to tell MacOS to launch an app with arguments, so I ended up going a little bit hacky with a solution from Stack Overflow:

I put a script in the app bundle's MacOS folder called launch.sh which runs the vkquake executable with the right argument. I did a chmod +x on it, then updated the app's Info.plist to run launch.sh instead of vkquake.

So far, so good. I can double-click on the vkQuake icon and all is well.

Except... some time later (and I haven't yet determined how long it is, although less than two days) if I double-click on vkQuake it'll immediately crash. I'm not in front of my Mac right now but the crash log says something like "SIGKILL: Invalid code signature". I wondered what had triggered this (after all, the binary code itself is unchanged) but I deleted and reinstalled vkQuake again, reapplied launch.sh, and once again all was well. Then a couple of days later I tried to run it and it crashed again.

What is going on here? It would seem that some sort of security feature is getting in the way, but I don't understand why it works for a while in the first place.

I tried re-signing the app ("codesign --force --deep --sign - /Applications/vkQuake.app") but it reported something like "certificate not in keychain". Although just now while writing this I stumbled upon something saying I should do "codesign --remove-signature" first, so I'll need to try that.

This has got a bit long and rambly, but I suppose my question is "What is the 'best' way to pass arguments to an application, without it breaking?".
 
I tried re-signing the app ("codesign --force --deep --sign - /Applications/vkQuake.app") but it reported something like "certificate not in keychain".
An update to this bit specifically: I had missed the lone hyphen when trying it earlier. After doing that, the game now launches without giving the "invalid signature" error.

Now it crashes with "vkCreateGraphicsPipelines failed" but that looks to be beyond the scope of this thread. (Edit: I replaced it with a fresh version and re-signed it without --deep, which might help. Need to wait a day or two and see whether it fails again.)
 
Edit: I replaced it with a fresh version and re-signed it without --deep, which might help. Need to wait a day or two and see whether it fails again.
It failed again.

Gatekeeper will verify again the signature every few days, and so it will prevent it from running.
I've disabled Gatekeeper (sudo spctl --master-disable) and it's still blocking it. The specific messages are "Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid))" and "Termination Reason: CODESIGNING 1 Taskgated Invalid Signature".

Maybe Gatekeeper needs to be disabled before it fails (i.e. if it's already been "gatekept" as bad, does it continue to be flagged as bad?) so I'll go around the whole circle again...

Remove the quarantine attribute
Code:
xattr -rd com.apple.quarantine /Applications/vkQuake.app
That didn't help.

I guess ultimately the best solution would be to compile a new binary that doesn't need all this hackery in the first place. I also noticed that it's plonking a zero-byte "history.txt" file into Applications on launch, so it's cluttering up the directory even when the game files itself aren't in there!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.
  • Forums
  • Macs
  • macOS
  • macOS Sequoia (15)
  • TopBottom
    Back

    [8]ページ先頭

    ©2009-2025 Movatter.jp