Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

App crashing after signing QtWebEngine



  • Hi,
    For the last 4 days I've been trying to publish my app in the apple store (which I've never done before). In it I use qt 5.12.1 with qtwebengine. But I really got stuck with sandboxing webengine because after sandboxing app won't even start. I followed this https://mediaarea.net/blog/2018/02/14/QtWebEngine-MacAppStore initially without recompiling and changing webengine but afterwards doing this as well (Unsuccessfully though 'cause they used qt 5.9). I tried as well suggestions from this thread https://forum.qt.io/topic/102212/qtwebengine-signing-issues/4 and today https://forum.qt.io/topic/49250/solved-qtwebengineprocess-not-working-in-sandboxed-application but had no luck. So I thought maybe you guys could give me some tips on how could I do this. Prior to that I posted same question on stackoverflow there is all relevant information https://stackoverflow.com/questions/58053883/sandboxing-qtwebengine-for-apple-store
    (Hope it's ok to attach link on stackoverflow)
    I've changed script little bit since then. So here how it looks right now. Plist and entitlement are the same.

    echo SIGN PACKAGE
    # special case for QtWebEngineCore
    
    find dist/MyApp.app -name Info.plist -exec plutil -replace CFBundleIdentifier -string "com.MyApp.desktop" {} \;
    
    find dist/MyApp.app -name _CodeSignature -exec rm -fr {} \;
    find dist/MyApp.app -name "*.dSYM" -exec rm -fr {} \;
    
    #codesign -force -s "3rd Party Mac Developer Application: MyApp (*)" -i "org.qt-project.Qt.QtWebEngineWidgets"
    
    #codesign --force --verify --verbose --sign "3rd Party Mac Developer Application: MyApp (*)" --identifier "" --entitlements app/webengine.entitlements  dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app
    codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/Frameworks/QtWebEngine.framework/
    
    codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.QtWebEngineProcess" --entitlements app/MyApp.entitlements  dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app
    
    codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "org.qt-project.Qt.QtWebEngineCore" dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/
    
    for f in $(find dist/MyApp.app/Contents/Frameworks -name '*.framework' -type d)
    do
        if [ $f == "dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework" ] || [ $f == "dist/MyApp.app/Contents/Frameworks/QtWebEngine.framework" ]; then
        continue
        else
            codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" $f
        fi
    done
    
    for f in $(find dist/MyApp.app/Contents -name '*.dylib' -type f)
    do
    codesign --force --verbose -s "3rd Party Mac Developer Application: MyApp (*)" $f
    done
    
    codesign --entitlements app/MyApp.entitlements -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/MacOS/crashpad_handler
    codesign --entitlements app/MyApp.entitlements -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/MacOS/MyApp
    codesign --entitlements app/MyApp.entitlements -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/MacOS/MyAppUpdater
    
    codesign --force  --verbose -s "3rd Party Mac Developer Application: MyApp (*)" --entitlements app/MyApp.entitlements dist/MyApp.app
    

    After following codesigning app crash with the following message

    LSOpenURLsWithRole() failed with error -10810 for the file /Users/edwin/third_party/publish/desktop_qt/dist/MyApp.app
    

    To open it I use standard

    open dist/amo.app
    

    Any suggestions are appreciated because I've already wasted too much time on this and i miss normal coding.

    Edit
    If needed I can attach crash log that apple have sent me. I sent non working app to them. It just didn't have any issues in application loader so i thought it was fine. Then discovered that it is actually crashes because of webengine signature.


Log in to reply