Commit fa44097
feat(diff): emit copiesCrc so clients can match copied resources by content
When the uploaded baseline is an APK but the app is installed from an AAB
(Play split APKs), res/ drawable paths are shortened on device, so the
path recorded in `copies` (e.g. res/drawable-xhdpi-v4/x.webp) does not
exist verbatim and images (webp) fail to copy during a from-package patch.
diffFromPackage already finds unchanged/moved files by CRC32 internally but
only hands the client a path. This adds an optional `copiesCrc` map to
__diff.json ({ to: crc32 }) for "moved" entries (the res/ resources at
risk of path divergence), letting the client locate them by content when
the path is missing. CRC32 is over the uncompressed content, so it is
stable across APK/AAB packaging.
- Only moved entries get a crc (same-path assets stay path-stable) → minimal
manifest growth.
- Keyed by `to` (unique) to avoid same-content collisions.
- Fully backward compatible: old clients ignore the field; new clients
treat its absence as today's path-based behavior.
Consumed by react-native-update (Android BundledResourceCopier).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 78cc077 commit fa44097
2 files changed
Lines changed: 71 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
226 | 233 | | |
227 | 234 | | |
228 | 235 | | |
| |||
281 | 288 | | |
282 | 289 | | |
283 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
284 | 295 | | |
285 | 296 | | |
286 | 297 | | |
| |||
313 | 324 | | |
314 | 325 | | |
315 | 326 | | |
316 | | - | |
| 327 | + | |
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
404 | 463 | | |
405 | 464 | | |
406 | 465 | | |
| |||
0 commit comments