我昨天安装了 Mac OS Big Sur,从那以后我无法运行一些旧的应用程序。这是我得到的消息:
"You do not have permission to open the application"
Run Code Online (Sandbox Code Playgroud)
我认为这个应用程序来自一个未知的开发者。我尝试了在 Catalina 中使用的不同方法,例如:
spctl --master-disable
Run Code Online (Sandbox Code Playgroud)
或者我也尝试禁用 SIP 和 AMFI。
我也试过
sudo xattr -rd com.apple.quarantine /Applications/my_app.app
Run Code Online (Sandbox Code Playgroud)
如果我从终端运行应用程序,这是我得到的错误的文本版本:
The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826 "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2508, NSUnderlyingError=0x7fcb24c13ec0 {Error Domain=RBSRequestErrorDomain Code=5 "Launched process exited during launch." UserInfo={NSLocalizedFailureReason=Launched process exited during launch.}}}
Run Code Online (Sandbox Code Playgroud)
还尝试禁用加密并运行:
csrutil authenticated-root disable
Run Code Online (Sandbox Code Playgroud)
我想实现一个返回一个或一个允许的动作列表定义为枚举的方法.
例如,我的方法应该是这样的:
public enum getAllowedActions() {
return // (( 'something like' Actions.ACTION1 & Actions.ACTION2 ));
}
Run Code Online (Sandbox Code Playgroud)
然后在另一个位置读取结果,如:
if (getAllowedActions() == Actions.ACTION1) {
// do something...
}
Run Code Online (Sandbox Code Playgroud)
有:
public class enum {
ACTION1, ACTION2;
}
Run Code Online (Sandbox Code Playgroud)
谢谢.斯特凡诺.