appium-webdriveragent 16.2.0 → 16.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [16.2.1](https://github.com/appium/WebDriverAgent/compare/v16.2.0...v16.2.1) (2026-08-17)
2
+
3
+ ### Bug Fixes
4
+
5
+ * sign the runner by certificate hash instead of display name ([#1211](https://github.com/appium/WebDriverAgent/issues/1211)) ([59e95a7](https://github.com/appium/WebDriverAgent/commit/59e95a73986a91c90c951608d7744a032997810b))
6
+
1
7
  ## [16.2.0](https://github.com/appium/WebDriverAgent/compare/v16.1.7...v16.2.0) (2026-08-13)
2
8
 
3
9
  ### Features
@@ -36,12 +36,32 @@ if [ ${#ICONS[@]} -eq 0 ]; then
36
36
  exit 0
37
37
  fi
38
38
 
39
- cp -f "${ICONS[@]}" "$RUNNER_APP/"
39
+ PLIST="$RUNNER_APP/Info.plist"
40
+
41
+ # Everything below mutates a bundle Xcode already signed, so keep enough state
42
+ # to undo it: a failed re-sign must not leave an uninstallable runner behind.
43
+ PLIST_BACKUP=$(mktemp)
44
+ CERT_DIR=$(mktemp -d)
45
+ trap 'rm -rf "$PLIST_BACKUP" "$CERT_DIR"' EXIT
46
+ cp "$PLIST" "$PLIST_BACKUP"
47
+ ADDED_FILES=()
48
+
49
+ restore_bundle() {
50
+ cp -f "$PLIST_BACKUP" "$PLIST"
51
+ if [ ${#ADDED_FILES[@]} -gt 0 ]; then
52
+ rm -f "${ADDED_FILES[@]}"
53
+ fi
54
+ }
55
+
56
+ for icon in "${ICONS[@]}"; do
57
+ dest="$RUNNER_APP/$(basename "$icon")"
58
+ [ -e "$dest" ] || ADDED_FILES+=("$dest")
59
+ cp -f "$icon" "$dest"
60
+ done
40
61
  if [ -f "$XCTEST/Assets.car" ]; then
62
+ [ -e "$RUNNER_APP/Assets.car" ] || ADDED_FILES+=("$RUNNER_APP/Assets.car")
41
63
  cp -f "$XCTEST/Assets.car" "$RUNNER_APP/"
42
64
  fi
43
-
44
- PLIST="$RUNNER_APP/Info.plist"
45
65
  /usr/libexec/PlistBuddy -c "Delete :CFBundleIcons" "$PLIST" 2>/dev/null || true
46
66
  /usr/libexec/PlistBuddy -c "Delete :CFBundleIcons~ipad" "$PLIST" 2>/dev/null || true
47
67
 
@@ -58,29 +78,40 @@ PLIST="$RUNNER_APP/Info.plist"
58
78
  /usr/libexec/PlistBuddy -c "Add :CFBundleIcons~ipad:CFBundlePrimaryIcon:CFBundleIconFiles:0 string AppIcon60x60" "$PLIST"
59
79
  /usr/libexec/PlistBuddy -c "Add :CFBundleIcons~ipad:CFBundlePrimaryIcon:CFBundleIconFiles:1 string AppIcon76x76" "$PLIST"
60
80
 
61
- # Re-codesign since we modified the bundle after Xcode signed it.
62
- # In a scheme post-action context Xcode's CODE_SIGN_* env vars are not exposed,
63
- # so discover the existing signing identity from the already-signed bundle.
81
+ # Re-codesign since we modified the bundle after Xcode signed it. Scheme
82
+ # post-actions never receive EXPANDED_CODE_SIGN_IDENTITY, so the signer has to
83
+ # be recovered from the already-signed bundle.
64
84
  if [ -d "$RUNNER_APP/_CodeSignature" ]; then
65
85
  # Capture the signature info once. Piping codesign straight into
66
86
  # `awk ... exit` makes awk close the pipe early, killing codesign with
67
87
  # SIGPIPE -- which `set -o pipefail` turns into a fatal error. That trips
68
88
  # only when an Authority line exists, i.e. on every real-device build.
69
89
  SIGN_INFO=$(codesign -dvv "$RUNNER_APP" 2>&1 || true)
70
- EXISTING_IDENT="${EXPANDED_CODE_SIGN_IDENTITY:-}"
71
- if [ -z "$EXISTING_IDENT" ]; then
72
- EXISTING_IDENT=$(awk -F'=' '/^Authority/ {print $2; exit}' <<< "$SIGN_INFO")
73
- fi
74
- # Simulator builds are ad-hoc signed: there is no Authority line, but the
75
- # bundle can still be re-signed ad-hoc with an identity of "-".
76
- if [ -z "$EXISTING_IDENT" ] && grep -q '^Signature=adhoc' <<< "$SIGN_INFO"; then
90
+
91
+ if grep -q '^Signature=adhoc' <<< "$SIGN_INFO"; then
92
+ # Simulator builds are ad-hoc signed; re-sign them ad-hoc.
77
93
  EXISTING_IDENT="-"
78
- fi
79
- if [ -n "$EXISTING_IDENT" ]; then
80
- codesign --force --sign "$EXISTING_IDENT" \
81
- --preserve-metadata=identifier,entitlements "$RUNNER_APP"
82
94
  else
83
- echo "warning: bundle is signed but no identity discovered; signature will be invalid"
95
+ # Identify the signer by leaf-certificate SHA-1, never by Authority
96
+ # display name: duplicate identities can share a name, and codesign
97
+ # then rejects the name as ambiguous (Apple TN3161).
98
+ EXISTING_IDENT=""
99
+ if codesign -d --extract-certificates="$CERT_DIR/leaf" "$RUNNER_APP" 2>/dev/null \
100
+ && [ -f "$CERT_DIR/leaf0" ]; then
101
+ EXISTING_IDENT=$(shasum -a 1 "$CERT_DIR/leaf0" | awk '{print toupper($1)}')
102
+ fi
103
+ if [ -z "$EXISTING_IDENT" ]; then
104
+ EXISTING_IDENT=$(awk -F'=' '/^Authority/ {print $2; exit}' <<< "$SIGN_INFO")
105
+ fi
106
+ fi
107
+
108
+ if [ -z "$EXISTING_IDENT" ] || ! codesign --force --sign "$EXISTING_IDENT" \
109
+ --preserve-metadata=identifier,entitlements "$RUNNER_APP"; then
110
+ # A modified-but-stale-signed bundle fails to install, which would break
111
+ # the session over a cosmetic icon. Undo instead.
112
+ restore_bundle
113
+ echo "warning: could not re-sign $RUNNER_APP; skipped icon embed"
114
+ exit 0
84
115
  fi
85
116
  fi
86
117
 
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>16.2.0</string>
18
+ <string>16.2.1</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>16.2.0</string>
22
+ <string>16.2.1</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "16.2.0",
3
+ "version": "16.2.1",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "keywords": [
6
6
  "Appium",