Mac application signing failed after uploading on remote server
<p>Hi I'm working on an application that uses Qt.</p>

<p>We were on Qt 5.4 for months and we decided to move on the latest version (5.6). Before that, we had no problem with the Mac application signature, we ran <code>macdeployqt</code> binary to deploy the application then ran a script to sign the whole package and add it to a .dmg.</p>

<p>Since we move to Qt 5.6, the signature process throws no error and when I try the package on other computers with an USB key, the signature is ok and the application can be launch with no problem.</p>

<p>But when I upload the app on Internet (Dropbox, Slack or personnal remote server), the signature is broken and it displays <a href="http://i.stack.imgur.com/MOW6G.png" rel="nofollow">this message</a>.</p>

<p>When I run <code>codesign --deep --verify --verbose=4 -d</code> and <code>spctl --verbose=4 --assess --type execute</code> before and after the upload/download it has the same output !</p>

<pre><code>MyApp.app: accepted
source=Developer ID

Executable=/Users/digitalessence/Desktop/HeavyM.app/Contents/MacOS/HeavyM
Identifier=fr.digitalessence.heavym
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20200 size=31704 flags=0x0(none) hashes=985+3 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha1=052009496d7193aed38e60269a59c6bcd386f799
CandidateCDHash sha256=bc721c8b50f4e231a724f524083ca8689108b14a
Hash choices=sha1,sha256
CDHash=bc721c8b50f4e231a724f524083ca8689108b14a
Signature size=8918
Authority=Developer ID Application: Digital Essence (NZ8539HN33)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=24 May 2016 15:36:07
Info.plist entries=9
TeamIdentifier=NZ8539HN33
Sealed Resources version=2 rules=12 files=33
Nested=Frameworks/QtOpenGL.framework
Nested=Frameworks/QtNetwork.framework
Nested=PlugIns/audio/libqtaudio_coreaudio.dylib
Nested=PlugIns/mediaservice/libqavfmediaplayer.dylib
Nested=Frameworks/QtDBus.framework
Nested=PlugIns/mediaservice/libqavfcamera.dylib
Nested=PlugIns/imageformats/libqicns.dylib
Nested=PlugIns/imageformats/libqtiff.dylib
Nested=PlugIns/imageformats/libqtga.dylib
Nested=PlugIns/imageformats/libqdds.dylib
Nested=PlugIns/mediaservice/libqtmedia_audioengine.dylib
Nested=Frameworks/QtCore.framework
Nested=PlugIns/imageformats/libqjpeg.dylib
Nested=Frameworks/QtMultimediaWidgets.framework
Nested=Frameworks/Syphon.framework
Nested=Frameworks/QtGui.framework
Nested=Frameworks/QtMultimedia.framework
Nested=PlugIns/imageformats/libqgif.dylib
Nested=PlugIns/imageformats/libqwbmp.dylib
Nested=PlugIns/imageformats/libqico.dylib
Nested=Frameworks/fftreal.framework
Nested=PlugIns/printsupport/libcocoaprintersupport.dylib
Nested=Frameworks/QtXml.framework
Nested=PlugIns/bearer/libqgenericbearer.dylib
Nested=Frameworks/QtPrintSupport.framework
Nested=PlugIns/bearer/libqcorewlanbearer.dylib
Nested=Frameworks/QtWidgets.framework
Nested=PlugIns/imageformats/libqwebp.dylib
Nested=PlugIns/platforms/libqcocoa.dylib
</code></pre>

<p>Here is the script I use to sign the package :</p>

<pre><code>echo ------------------------------------------------------------
echo "Macdeployqt et copie de Syphon"
echo ------------------------------------------------------------
${QT_BIN_PATH}/macdeployqt ${PATH_BIN} -verbose=3
cp -Rf /Users/digitalessence/Downloads/Syphon\ SDK\ Public\ Beta\ 2/Syphon.framework  ${PATH_FRAMEWORK}/.

echo ------------------------------------------------------------
echo "Modification of Qt path"
echo ------------------------------------------------------------
install_name_tool -change @rpath/QtXml.framework/Versions/5/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/5/QtXml ${PATH_BIN}/Contents/Frameworks/QtXml.framework/Versions/5/QtXml
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtXml.framework/Versions/5/QtXml
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ${PATH_BIN}/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
install_name_tool -change @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport @executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport ${PATH_BIN}/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ${PATH_BIN}/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport
install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL @executable_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL ${PATH_BIN}/Contents/Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ${PATH_BIN}/Contents/Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL
install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ${PATH_BIN}/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork
install_name_tool -change @rpath/QtMultimedia.framework/Versions/5/QtMultimedia @executable_path/../Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia ${PATH_BIN}/Contents/Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia
install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ${PATH_BIN}/Contents/Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia
install_name_tool -change @rpath/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets @executable_path/../Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets ${PATH_BIN}/Contents/Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL @executable_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL ${PATH_BIN}/Contents/Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ${PATH_BIN}/Contents/Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ${PATH_BIN}/Contents/Frameworks/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/Frameworks/QtGui.framework/Versions/5/QtGui
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtGui.framework/Versions/5/QtGui
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
echo ------------------------------------------------------------
echo "Modification of HeavyM libs path "
echo ------------------------------------------------------------
install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL @executable_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL ${PATH_BIN}/Contents/MacOS/HeavyM
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ${PATH_BIN}/Contents/MacOS/HeavyM
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ${PATH_BIN}/Contents/MacOS/HeavyM
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ${PATH_BIN}/Contents/MacOS/HeavyM
install_name_tool -change @rpath/QtMultimedia.framework/Versions/5/QtMultimedia @executable_path/../Frameworks/QtMultimedia.framework/Versions/5/QtMultimedia ${PATH_BIN}/Contents/MacOS/HeavyM
install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork ${PATH_BIN}/Contents/MacOS/HeavyM
install_name_tool -change @rpath/QtXml.framework/Versions/5/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/5/QtXml ${PATH_BIN}/Contents/MacOS/HeavyM
echo ------------------------------------------------------------
echo "Signature of app"
echo ------------------------------------------------------------
codesign --no-strict --deep --force --verify --verbose=4 --sign "Developer ID Application: Digital Essence" ${PATH_BIN}/Contents/Frameworks/fftreal.framework/fftreal
codesign --no-strict --deep --force --verify --verbose=4 --sign "Developer ID Application: Digital Essence" ${PATH_BIN}/Contents/Frameworks/Qt*.framework/Qt*
codesign --no-strict --deep --force --verify --verbose=4 --sign "Developer ID Application: Digital Essence" ${PATH_BIN}/Contents/Frameworks/Syphon.framework/Syphon
codesign --no-strict --deep --force --verify --verbose=4 --sign "Developer ID Application: Digital Essence" ${PATH_BIN}/Contents/PlugIns/*/*
codesign --no-strict --deep --force --verify --verbose=4 --sign "Developer ID Application: Digital Essence" ${PATH_BIN}/Contents/MacOS/*
codesign --no-strict --sign "Developer ID Application: Digital Essence" --deep --verbose=4  ${PATH_BIN}
echo ------------------------------------------------------------
echo "Verify application signing"
echo ------------------------------------------------------------
codesign --deep --verify --verbose=4 -d ${PATH_BIN}
spctl --verbose=4 --assess --type execute ${PATH_BIN} &amp;&amp; dropdmg --config-name=heavym ${PATH_BIN}
echo -------------------------FINISHED-------------------------------
</code></pre>

<p>Anyone as an idea about what can cause this problem or anyone is facing the same problem ? Thanks in advance.</p>