diff --git a/companion-app/scripts/ios-teilen-einrichten.mjs b/companion-app/scripts/ios-teilen-einrichten.mjs index 9a118ed..4ae2c02 100644 --- a/companion-app/scripts/ios-teilen-einrichten.mjs +++ b/companion-app/scripts/ios-teilen-einrichten.mjs @@ -52,6 +52,9 @@ const APP = dirname(HIER) const ZIEL_NAME = "DataMetric360Share" const BUNDLE_ID = "app.datametric360.teilen" const GRUPPE = "group.app.datametric360" + +/** pbxproj-Wert ohne die optionalen Anfuehrungszeichen. */ +const entquotet = (wert) => String(wert ?? "").replace(/^"|"$/g, "") const SCHEMA = "datametric360" const iosApp = join(APP, "ios", "App") @@ -159,7 +162,16 @@ try { const eintrag = konfigs[schluessel] if (!eintrag || typeof eintrag !== "object" || !eintrag.buildSettings) continue const s = eintrag.buildSettings - if (s.PRODUCT_BUNDLE_IDENTIFIER === `"${BUNDLE_ID}"` || s.PRODUCT_NAME === `"${ZIEL_NAME}"`) { + // Ohne Anfuehrungszeichen vergleichen: die pbxproj fuehrt Werte mal mit, + // mal ohne. Was `addTarget` schreibt, ist gequotet ("app.datametric360. + // teilen"), was Capacitor fuer die App erzeugt, steht nackt da + // (app.datametric360). Der Vergleich auf die gequotete Form traf deshalb + // die App nie - sie wurde ohne App-Gruppe signiert, waehrend die + // Erweiterung sie hatte. Ergebnis waere ein stiller Ausfall gewesen: + // teilen meldet Erfolg, die App findet nichts (2026-09-02 an der + // fertigen .ipa gemessen - Entitlements der App ohne + // application-groups). + if (entquotet(s.PRODUCT_BUNDLE_IDENTIFIER) === BUNDLE_ID || entquotet(s.PRODUCT_NAME) === ZIEL_NAME) { s.INFOPLIST_FILE = `"${ZIEL_NAME}/Info.plist"` s.CODE_SIGN_ENTITLEMENTS = `"${ZIEL_NAME}/${ZIEL_NAME}.entitlements"` s.IPHONEOS_DEPLOYMENT_TARGET = "14.0" @@ -168,7 +180,7 @@ try { s.SKIP_INSTALL = "YES" } // Die App selbst braucht ihre neue Entitlements-Datei. - if (s.PRODUCT_BUNDLE_IDENTIFIER === `"app.datametric360"`) { + if (entquotet(s.PRODUCT_BUNDLE_IDENTIFIER) === "app.datametric360") { s.CODE_SIGN_ENTITLEMENTS = `"App/App.entitlements"` } }