From ef2c1d47cc6429893c4edd930904337d91ed23b7 Mon Sep 17 00:00:00 2001 From: isaac <> Date: Sun, 31 May 2026 17:58:30 +0200 Subject: [PATCH] Revert "Update tgwatch signing" Revert the universal/dynamic watch bundle id change (commit 1120b9084e) back to the static 0682 shape, for install testing. This reverts the PRODUCT_BUNDLE_IDENTIFIER override + $(...:base) companion-id derivation; the watch app again bakes the hardcoded ph.telegra.Telegraph.watchkitapp and literal WKCompanionAppBundleIdentifier=ph.telegra.Telegraph. Co-Authored-By: Claude Opus 4.8 (1M context) --- Telegram/BUILD | 8 -------- Telegram/WatchApp/tgwatch Watch App/Info.plist | 2 +- Telegram/prebuilt_watchos.bzl | 6 ------ Telegram/prebuilt_watchos_build.sh | 11 +---------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/Telegram/BUILD b/Telegram/BUILD index ef5fa5dbdf..0ed745668f 100644 --- a/Telegram/BUILD +++ b/Telegram/BUILD @@ -1746,14 +1746,6 @@ xcode_provisioning_profile( apple_prebuilt_watchos_application( name = "TelegramWatchApp", - # Watch bundle id tracks the host config (".watchkitapp"). The rule passes it - # to xcodebuild as PRODUCT_BUNDLE_IDENTIFIER (baked + signed); the watch Info.plist - # derives WKCompanionAppBundleIdentifier from it via $(PRODUCT_BUNDLE_IDENTIFIER:base), - # so the embedded watch app is correct for any host (ph.telegra.Telegraph, - # org.telegram.TelegramInternal, ...) with no post-build plist patching. - bundle_id = "{telegram_bundle_id}.watchkitapp".format( - telegram_bundle_id = telegram_bundle_id, - ), tags = ["manual"], ) diff --git a/Telegram/WatchApp/tgwatch Watch App/Info.plist b/Telegram/WatchApp/tgwatch Watch App/Info.plist index ca62526111..1d426f5632 100644 --- a/Telegram/WatchApp/tgwatch Watch App/Info.plist +++ b/Telegram/WatchApp/tgwatch Watch App/Info.plist @@ -38,7 +38,7 @@ WKApplication WKCompanionAppBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER:base) + ph.telegra.Telegraph WKRunsIndependentlyOfCompanionApp diff --git a/Telegram/prebuilt_watchos.bzl b/Telegram/prebuilt_watchos.bzl index 3002c45892..f4ce9d66ad 100644 --- a/Telegram/prebuilt_watchos.bzl +++ b/Telegram/prebuilt_watchos.bzl @@ -70,12 +70,6 @@ def _apple_prebuilt_watchos_application_impl(ctx): infoplist.path, ctx.file.versions_json.path, build_number, - # Watch app bundle id (".watchkitapp"). xcodebuild bakes it as - # PRODUCT_BUNDLE_IDENTIFIER so the signed CFBundleIdentifier matches the host - # config; the Info.plist derives WKCompanionAppBundleIdentifier from it via - # $(PRODUCT_BUNDLE_IDENTIFIER:base). Keeps the build dynamic across hosts with - # no post-build plist mutation (xcodebuild bakes, the worker signs once). - ctx.attr.bundle_id, ], inputs = inputs, outputs = [archive, infoplist], diff --git a/Telegram/prebuilt_watchos_build.sh b/Telegram/prebuilt_watchos_build.sh index 9acc2fd93e..1e1a4d537b 100755 --- a/Telegram/prebuilt_watchos_build.sh +++ b/Telegram/prebuilt_watchos_build.sh @@ -17,17 +17,9 @@ # $4 api_hash TG_API_HASH build setting # $5 identity Codesigning identity (SHA1 hash); empty => derived from $6's cert # $6 profile Path to the watchkitapp .mobileprovision; empty => unsigned build -# $7 infoplist Path (declared by Bazel) to copy the built Info.plist to -# $8 versions_json versions.json (key 'app' => CFBundleShortVersionString) -# $9 build_number CFBundleVersion -# $10 watch_bundle_id PRODUCT_BUNDLE_IDENTIFIER for xcodebuild (the watch app id, -# ".watchkitapp"); empty => keep the project default. xcodebuild -# bakes it into CFBundleIdentifier (and signs with it); the Info.plist -# derives WKCompanionAppBundleIdentifier from it via -# $(PRODUCT_BUNDLE_IDENTIFIER:base), so no post-build plist patching. set -euo pipefail -SRC="$1"; OUT_ZIP="$2"; API_ID="$3"; API_HASH="$4"; IDENTITY="${5:-}"; PROFILE="${6:-}"; INFOPLIST_OUT="${7:-}"; VERSIONS_JSON="${8:-}"; BUILD_NUMBER="${9:-1}"; WATCH_BUNDLE_ID="${10:-}" +SRC="$1"; OUT_ZIP="$2"; API_ID="$3"; API_HASH="$4"; IDENTITY="${5:-}"; PROFILE="${6:-}"; INFOPLIST_OUT="${7:-}"; VERSIONS_JSON="${8:-}"; BUILD_NUMBER="${9:-1}" if [ ! -e "$SRC/tgwatch.xcodeproj" ]; then echo "error: no tgwatch.xcodeproj at $SRC (re-sync the Telegram/WatchApp snapshot via tgwatch/tools/export-sources.sh)" >&2 @@ -61,7 +53,6 @@ xcodebuild \ CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" \ TG_API_ID="$API_ID" TG_API_HASH="$API_HASH" \ MARKETING_VERSION="$MARKETING_VERSION" CURRENT_PROJECT_VERSION="$BUILD_NUMBER" \ - ${WATCH_BUNDLE_ID:+PRODUCT_BUNDLE_IDENTIFIER="$WATCH_BUNDLE_ID"} \ build 1>&2 APP="$(find "$DD/Build/Products" -maxdepth 2 -name 'tgwatch Watch App.app' -type d | head -1)"