From f6ed8872bde59453f76987c157298d108e70c0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B3=A2=E4=BB=94=E7=B3=95?= Date: Tue, 23 Sep 2025 15:22:34 +0800 Subject: [PATCH] add logic to support android aab package hot update (#17) * add logic to support android aab package hot update * update * udpate --- src/bundle.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bundle.ts b/src/bundle.ts index d529536..750a3b9 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -597,6 +597,7 @@ async function diffFromPPK(origin: string, next: string, output: string) { } const copies = {}; + const copiesv2 = {}; const zipfile = new YazlZipFile(); @@ -668,6 +669,7 @@ async function diffFromPPK(origin: string, next: string, output: string) { addEntry(base); } copies[entry.fileName] = originMap[entry.crc32]; + copiesv2[entry.crc32] = entry.fileName; return; } @@ -700,7 +702,7 @@ async function diffFromPPK(origin: string, next: string, output: string) { //console.log({copies, deletes}); zipfile.addBuffer( - Buffer.from(JSON.stringify({ copies, deletes })), + Buffer.from(JSON.stringify({ copies, copiesv2, deletes })), '__diff.json', ); zipfile.end(); @@ -747,6 +749,7 @@ async function diffFromPackage( } const copies = {}; + const copiesv2 = {}; const zipfile = new YazlZipFile(); @@ -792,6 +795,7 @@ async function diffFromPackage( // If moved from other place if (originMap[entry.crc32]) { copies[entry.fileName] = originMap[entry.crc32]; + copiesv2[entry.crc32] = entry.fileName; return; } @@ -810,7 +814,7 @@ async function diffFromPackage( } }); - zipfile.addBuffer(Buffer.from(JSON.stringify({ copies })), '__diff.json'); + zipfile.addBuffer(Buffer.from(JSON.stringify({ copies, copiesv2 })), '__diff.json'); zipfile.end(); await writePromise; }