Ecks1337 / RyuSAK

GNU General Public License v3.0
1.21k stars 77 forks source link

Mac binaries are reported as "damaged" #37

Open nonoche2 opened 1 year ago

nonoche2 commented 1 year ago

both Mac binaries for Ryusak 1.6 bring up an error alert when launched saying that the apps are damaged and can't be opened. (By the way I believe any Mac app is a "portable" app so you shouldn't need two different versions)

To Reproduce Steps to reproduce the behavior:

  1. download either Mac binaries on a Mac
  2. launch them
  3. see error
Diadriu commented 1 year ago

It's not a RyuSAK issue, the application is simply not signed. You need to disable gatekeeper, I posted a fix.

nonoche2 commented 1 year ago

that's the thing, unsigned apps don't give this "damaged" error but an "unsigned" error (which allows to launch them either by right-clicking their icon and selecting "open" the first time, or allowing their launch the first time in the system settings). Disabling Gatekeeper altogether is neither recommanded nor easily done on the latest version of macOS.

The "damaged" error means that the app has been tampered with, that's a different issue

ningvw520 commented 1 year ago

encounter same error, showed the app was damaged instead of unsigned. mac os 13.0.1, m1 max.

Diadriu commented 1 year ago

that's

I believe it's a gatekeeper error, I posted a fix how to disable gatekeeper for the app. Edit: Misread your comment, for monterey it was really easy - did you try the command lines?

nonoche2 commented 1 year ago

yes, you are correct, this error is reported by GateKeeper, however, this isn't the usual alert Gatekeeper throws for merely unsigned apps, and one does not need to disable gatekeeper altogether to launch them. When a regularly unsigned app is blocked by Gatekeeper, this is the alert it throws :

package01

In that case, you only have to allow the application once in system settings, or right click the app and select "open", then you get this alert once : package02

When we get the "damaged" alert, it means gatekeeper thinks the binary has been tampered with, and the only way to launch it is to disable gatekeeper altogether. This isn't necessary to launch an unsigned app and I believe there's something wrong in the app complilation setting, I'll look into it and will let you know

nonoche2 commented 1 year ago

Did you get the application notarized with Apple? It is now mandatory, but you only need a free Apple developer account to do so

https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution

Diadriu commented 1 year ago

Thanks for the clarification. Hope there is a way for you to disable gatekeeper for this application on the newest macos.

nonoche2 commented 1 year ago

I'm not sure I have been clear enough yet ^^ There shouldn't be any need to disable gatekeeper to launch an unsigned application. Anyone can perfectly launch an unsigned application with gatekeeper enabled. But we can't do so with Ryusak because it's reported as hacked by gatekeeper, not just unsigned. There's something wrong with the way you built the app

TomKowalczuk commented 1 year ago

Andrew Tsai found a way to fix it just type this in the terminal xattr -cr "RyuSAK.app location"

M0REKZ commented 1 year ago

yeah, this command would allow you to run the app, but wont really fix it (write xattr -h on terminal and you will see what it does)

Metal-Snake commented 1 year ago

Andrew Tsai found a way to fix it just type this in the terminal xattr -cr "RyuSAK.app location"

the correct command is xattr -cr "RyuSAK.app"

therobertbula commented 1 year ago

I'm still getting the broken message, and the command doesn't do anything Do I have to have the app somewhere in specific?

TomKowalczuk commented 1 year ago

Make sure to put xattr -cr /Applications/RyuSAK.app (if that's where you put it)

Diadriu commented 1 year ago

You can try this line first sudo spctl --master-disable

Then enter this line (change path to app if needed): xattr -cr /Applications/RyuSAK.app

Ecks1337 commented 1 year ago

(By the way I believe any Mac app is a "portable" app so you shouldn't need two different versions)

@nonoche2 The portable version is different because it stores all its files within its folder rather than in the applications data directory

nonoche2 commented 1 year ago

oh I see, thanks for the clarification. I was under the impression that "portable" meant "can be used on any computer from a USB key without an installer", but if that implies keeping the settings in one place it makes sense. I can't say I have seen this kind of setup for any other app on macOS though.

Ecks1337 commented 1 year ago

After looking into it a bit, it seems that I'd need to use xcode in order to sign and notarise the app. I don't own a Mac so i see no way to resolve this other than to accept #34 as the official solution. If you have any ideas please let me know.

nonoche2 commented 1 year ago

could this help?

https://github.com/zkmkarlsruhe/mac-dist-helper

https://github.com/zkmkarlsruhe/mac-dist-helper-examples

xycainoff commented 1 year ago

i get same error. “RyuSAK” is damaged and can’t be opened. You should move it to the Bin.

BigEmperor26 commented 1 year ago

xattr -cr /Applications/RyuSAK.app

after you do that right click and then open the app

OrigamingWasTaken commented 10 months ago

Hello, I tried doing xattr -cr /Applications/RyuSAK.app, however, it says that the -r option is invalid.


❯ xattr -cr /Applications/RyuSAK.app

option -r not recognized

usage: xattr [-slz] file [file ...]
       xattr -p [-slz] attr_name file [file ...]
       xattr -w [-sz] attr_name attr_value file [file ...]
       xattr -d [-s] attr_name file [file ...]
       xattr -c [-s] file [file ...]

The first form lists the names of all xattrs on the given file(s).
The second form (-p) prints the value of the xattr attr_name.
The third form (-w) sets the value of the xattr attr_name to attr_value.
The fourth form (-d) deletes the xattr attr_name.
The fifth form (-c) deletes (clears) all xattrs.

options:
  -h: print this help
  -s: act on symbolic links themselves rather than their targets
  -l: print long format (attr_name: attr_value)
  -z: compress or decompress (if compressed) attribute value in zip format```
OrigamingWasTaken commented 10 months ago

Sorry for bothering! For anyone with the same problem, do: pip uninstall xattr The original xattr installed with pip was overwriting Apple's implementation of it. So the -r option was gone.