Problem Signing App With macdeployqt And codesign



  • /Developer/SDKs/QtMultiC/5.8/clang_64/bin/macdeployqt SFA.app -always-overwrite -executable=./SFA.app/Contents/MacOS/License -codesign=‘with my cert’ -dmg -verbose=3

    License is a unix executable helper app in the SFA.app/Contents/MacOS/ folder.

    The -executable License code signing done by macdeployqt works. No errors are displayed when running macdeployqt, yet the SFA app bundle is not signed and neither is the SFA unix executable.

    If I do the following from the command prompt in the SFA.app/Contents/MacOS/ folder, I get the following output..

    PSI$ codesign --verify --verbose License
    License: valid on disk
    License: satisfies its Designated Requirement

    PSI$ codesign --verify --verbose SFA
    SFA: code object is not signed at all
    In architecture: x86_64

    PSI$ cd ..
    Contents PSI$ cd ..
    sfa.app PSI$ cd ..
    SFA Deploy PSI$ codesign --verify --verbose SFA.app
    SFA.app: code object is not signed at all
    In architecture: x86_64

    SFA Deploy PSI$

    The signing certificate is valid and Expires: Thursday, August 16, 2018

    There was never an issue with signing prior to XCode8.2.1 and Sierra 10.12.2. The previous working version I had prior to doing a “forced update” was Xcode5.1.1 and MtLion 10.8.5. Everything worked. No problems with codesign.

    I am not using, and do not ever plan to use, the Mac App Store to distribute the SFA.app. The App deployed via PackageMaker (not via dmg) and is downloaded from my website.

    I suspect that there are issues with the contents of the SFA.app bundle. Documentation on Apple says that a “typical app bundle” will contain..

    MyApp.app/
    Contents/
    Info.plist
    MacOS/
    Resources/
    ..and optionally..
    Frameworks/
    Plugins/
    SharedSupport/

    But is does not specifically say you cannot have other folders within in the bundle.

    My SFA.app bundle looks like this..
    SFA.app/
    Contents/
    Frameworks/
    Info.plist
    MacOS/
    DataBases
    Graphics/
    Help/
    License
    MetaData/
    SFA
    UserRecords/
    PkgInfo
    Plugins/
    Resources/

    Has anyone else run into something similar?? I’d prefer not to mess with the directory structure..that would be a last resort.

    I’m contemplating finding and archived version of codesign and trying it. To verify that the issue IS with codesign.



  • Removed folders from my app bundle one at a time and tried running codesign again.

    Finally got the following error: resource fork, Finder information, or similar detritus not allowed

    Followed the instructions from this link..

    http://stackoverflow.com/questions/39652867/code-sign-error-in-macos-sierra-xcode-8-resource-fork-finder-information-or#39667628

    Specifically the "official Apple fix"

    To see which files are causing this error, run this command in Terminal: xattr -lr <path_to_app_bundle>

    You can also remove all extended attributes from your app bundle with the xattr command: xattr -cr <path_to_app_bundle>

    Solved my issue by:

    Opening Terminal.
    cd <to the folder containing my app bundle>
    xattr -cr . /my.app

    I then ran codesign and my.app is now signed correctly.

    Hope this helps someone.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.