• macos 签名+公证app生成dmg后,安装使用过程中崩溃


    关于如何命令行macos 打包+签名+公证+生成dmg的过程,参考我的另一篇博客:https://www.cnblogs.com/zndxall/p/12072353.html

    mac 生成dmg是今年年初才要求必须公证后才能使用,公证前必须要签名才可以,前期我使用简单的codesign -f -s "$cert_file" -v LBCast.app --deep,然后签名后公证生成dmg就可以正常使用。

    可是,某一天发现,安装后打开使用就崩溃,看崩溃信息,是在获取麦克风权限失败了,但是偏好设置中麦克风已经对软件LBCast.app 开启了权限但是我使用xcode完成整个编译-签名-公证过程,生成dmg,安装就不会有问题,单纯的xcodebuild编译的app也可以正常使用,然后对脚本过程逐级检查验证:验证签名后app是否还能使用,验证公证后app是否还能正常使用,验证生成dmg前的最后一步app是否还能使用,最后发现是签名codesign出问题了。 (可能是apple审核安全机制升高导致,不确定)

    (重新安装前必须使用tccutil reset All  bundleid 清除所有权限)

    分析:公证前要求必须打开强制运行时,并且必须带时间戳,xcode已经打开了强化运行时,xcodebuild编译的app也可以正常使用,但是命令行codesign签名还是不能用,是不是命令行需要带上强化运行时对于的权限配置文件,这样分析后,在查看xcodebuild命令行我们发现了如下关键信息:

     

     方框里的   -o runtime --entitlements LBCast.app.xcent   就是突破口  -o runtime 表示打开强化运行时 , --entitlements LBCast.app.xcent  就是相关的配置,打开LBCast.app.xcent 文件内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>com.apple.security.automation.apple-events</key>
        <true/>
        <key>com.apple.security.cs.disable-executable-page-protection</key>
        <true/>
        <key>com.apple.security.cs.disable-library-validation</key>
        <true/>
        <key>com.apple.security.device.audio-input</key>
        <true/>
    </dict>
    </plist>

    和LBCast.entitlements内容是一样的

    解决:正确的命令如下:

    cert_file=EA321xxxxxxx
    entitlements_file=LBCast.entitlements
    cast_audio_dir=LBCast.app/Contents/Resources/HPOfficeCastResources.bundle/Contents/Resources/HP_Video_Device_driver
    codesign -f --deep --timestamp -o runtime -v -s "$cert_file" $cast_audio_dir/"Cast Audio.driver/Contents/MacOS/Cast Audio"
    codesign -f --deep --timestamp -o runtime -v --entitlements $entitlements_file -s "$cert_file" LBCast.app

      

  • 相关阅读:
    fstest
    iozone
    fio
    vdbench
    饼状图点击凸出,适合颜色选择
    个人常用的win7快捷键
    form表单提交数据
    jquery允许跨越获取cookie
    设置滚动条样式与监听滚动到底部
    设置滚动条样式与监听滚动到底部
  • 原文地址:https://www.cnblogs.com/zndxall/p/12964641.html
Copyright © 2020-2023  润新知