print

Mag2Pol

The bundle

<https://www.ill.eu/users/instruments/instruments-list/d3/software/>
<https://apps.apple.com/app/mag2pol/id1539961593>

Mag2Pol.app is a C++ application developped with the cross-platform IDE "Qt creator".
The mac OS bundle created Qt/Make is ready neither for Notarization nor for a Mac App Store submission. Both requires some efforts as described in these pages:

   <https://doc.qt.io/qt-5/macos-deployment.html>
   <https://www.ics.com/blog/your-guide-deploying-qt-applications-macos>

The bundle contains .frameworks and .dylib files
    QtOpenGL, QtPrintSupport, QtWidgets, QtGui, QtCore
with dependencies  ($ otool -L Mag2Pol.app/Contents/MacOS/mag2pol)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL
    /usr/lib/libc++.1.dylib
    /usr/lib/libSystem.B.dylib

Transporter.app identifies the following binaries that must be signed in addition to mag2pol itself:
    QtCore.framework, QtGui.framework, QtOpenGL.framework, QtPrintSupport.framework, QtWidgets.framework
    libqdds.dylib, libqgif.dylib, libqicns.dylib, libqico.dylib, libqjpeg.dylib, libqtga.dylib, libqtiff.dylib, libqwbmp.dylib, libqwebp.dylib, libqcocoa.dylib, libcocoaprintersupport.dylib

Changes made to comply Apple's rules

The "info.plist" file generated my Qt/Make mises some keys:
    <key>NOTE</key>
      <string>This file was generated by Qt/QMake and modified by A. Filhol</string>
  <key>ForAppStore</key>
    <string>yes</string>
    <key>LSMinimumSystemVersion</key>
      <string>10.12</string>
    <key>CFBundleIdentifier</key>
      <string>eu.ill.diff.Mag2Pol</string>
    <key>CFBundleShortVersionString</key>
      <string>3.2.6</string>
    <key>CFBundleVersion</key>
      <string>17</string>
             <-- must be larger that the short version
    <key>NSHumanReadableCopyright</key>

      <string>Copyright (C) 2007-2020 by Navid Qureshi (+A.Filhol), ILL, Grenoble, France. License LGPLv3, see: fsf.org.</string&gt;


    <key>LSApplicationCategoryType</key>
      <string>public.app-category.education</string>
    <key>NSHighResolutionCapable</key>
      <string>True</string>

A minimum OS versions must be set for each binary and for the bundle (see info.plist).

All binaries must be hardened (see Signing)

The "Open" dialogue of Mag2Pol is blocked by the sandboxing. Thus a specific entitlement (see below) was added to solve that issue.

The error below comes from the fact that the default app behaviour is to auto-generate a PDF file within the /MacOS folder at runtime. This is forbidden.
    Sandbox: Mag2Pol(3232) deny(1) file-write-create /Applications/Mag2Pol.app/Contents/MacOS/Mag2Pol_manual.pdf
The problem was solved when Navid added the following to the .pro file of the Qt project:

info.plist

The info.plist file automatically generated by Qt/Make miss some keys or keys values must be modified. E.g. :

   <key>LSMinimumSystemVersion</key>
       <string>10.12</string>
   <key>CFBundleIdentifier</key>
       <string>eu.ill.diff.Mag2Pol</string>
   <key>LSApplicationCategoryType</key>
       <string>public.app-category.education</string>

Signing

It is very confusing that Apple sometimes names certificates by their type and sometimes by their name, while never giving the correspondance.
This can be found here:
http://jay0lu.github.io/2017/10/17/Apple-Mac-Certificate.html
or in my page "Code signing"

Entitlements for the App Store
<?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.app-sandbox</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.cs.disable-library-validation</key>
    <true/>
</dict>
</plist>

App Preview

iTunes Connect accepts 3 videos (30s maxi each) with a poster preview.

Problem: never ending upload of the App Preview.
If performed through the "View All Sizes in Media Manager", a persistent message is shown:
     "This file has been uploaded and is processing"
If the page is reloaded, the message turns to:
    "One or more of your app previews contain unsupported or corrupted audio

Solution
1- a sound track is compulsory
2- the upload from the iTunes Connect page is quite fast but the video is not accepted immediately. It may take hours before the "App Preview and Screenshots" section shows the videos. Delay due to a human validation ?
3- setting the "Poster Frame" is possible only once the above is completed

Settings
Go to "View All Sizes in Media Manager"
    App Preview 1: 0:10 (SNP just before the transition to 4-circle)
    App Preview 2: 0:09 (3rd sample structure)