Skip to content

[bugfix] Fix resource table corruption when resources.arsc changes - #65

Draft
HITlittlefox wants to merge 1 commit into
tencentmusic:mainfrom
HITlittlefox:bugfix/arsc-full-rebuild
Draft

HITlittlefox wants to merge 1 commit into
tencentmusic:mainfrom
HITlittlefox:bugfix/arsc-full-rebuild

Conversation

@HITlittlefox

Copy link
Copy Markdown
Contributor

Summary

Fix a deploy-state consistency hazard in Jugg incremental deploy: ResourceApkGenerator patched resources.arsc incrementally as single entries, but arsc is the whole resource table; a partial overlay left the generated resource apk inconsistent with the full resource set, risking the same class of resource-state corruption seen as unrelated pages crashing after hot deploy. Change sets containing resources.arsc now fall back to a full rebuild.

Linked issue

N/A

Task plan

Task plan

Type

  • [bugfix] existing behavior is wrong

Verification

./gradlew :main:test --tests "com.sickworm.intellij.jugg.deploy.data.ResourceApkGeneratorTest"
  • ResourceApkGeneratorTest#testResourceApkFallsBackToFullRebuildWhenResourceTableChanged: after a baseline exists, a change set containing resources.arsc must rebuild fully instead of patching entries. Class result: 2/2 pass.
  • Not verified on a real device for actual arsc-change deploy behavior; unit tests cover the rebuild-branch decision as substitute evidence.

Documentation

  • No user-facing or architecture change

Checklist

  • The pull request is focused: one problem, one fix, one verification story
  • The linked task plan is committed in this PR and reflects the final change
  • No secrets, local IDE files, build/ outputs, or unrelated formatting
  • Commit titles follow [prefix][module] subject

…anges

Incremental resource.ap_ generation patched resources.arsc as single
entries, but arsc is the whole resource table: a partial overlay left
the generated apk inconsistent with the full resource set. Fall back
to a full rebuild when the change set contains resources.arsc.

Also add the task plan doc with unit test evidence for this fix.
@HITlittlefox
HITlittlefox marked this pull request as draft October 11, 2026 14:35
@sickworm

Copy link
Copy Markdown
Collaborator

这个隐患目前未证实存在,原因:

  1. 增量更新场景,保证 resource.ap_ 一致性是通过外围的 DeployDataGenerator 和 DeployHelper 保证的,机制和默认通道 (不使用 compat deploy,而是使用 apply changes 不生成 resource.ap_)是一致的,这个能力已经比较稳定;
  2. 每次资源编译都一定会生成 resrouce.arsc,所以这个改动等价于每次都重新生成 resource.ap

PR 看起来是隐患预防,非实际遇到的问题;如果有明确的可复现步骤/日志,可以提供我看看

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants