SMJobBless 有一个对话框提示,告诉用户它正在安装帮助工具并输入密码以继续。我想更改文本。
以下代码没有更改文本,而是将我的自定义文本放在开头并仍显示默认文本。我错过了什么或做错了什么?
// Creating auth item to bless helper tool and install framework
AuthorizationItem authItem = {kSMRightBlessPrivilegedHelper, 0, NULL, 0};
// Creating a set of authorization rights
AuthorizationRights authRights = {1, &authItem};
NSString *promptText = @"Customized Text. Privilege?\n\n";
AuthorizationItem dialogConfiguration[1] = { kAuthorizationEnvironmentPrompt, [promptText length], (char *) [promptText UTF8String], 0 };
AuthorizationEnvironment authorizationEnvironment = { 0 };
authorizationEnvironment.items = dialogConfiguration;
authorizationEnvironment.count = 1;
// Specifying authorization options for authorization
AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights;
// Open dialog and prompt user for password
OSStatus status = AuthorizationCreate(&authRights, &authorizationEnvironment, flags, authRef);`