Skip to content

Commit f6ed887

Browse files
authored
add logic to support android aab package hot update (#17)
* add logic to support android aab package hot update * update * udpate
1 parent fd46baf commit f6ed887

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bundle.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ async function diffFromPPK(origin: string, next: string, output: string) {
597597
}
598598

599599
const copies = {};
600+
const copiesv2 = {};
600601

601602
const zipfile = new YazlZipFile();
602603

@@ -668,6 +669,7 @@ async function diffFromPPK(origin: string, next: string, output: string) {
668669
addEntry(base);
669670
}
670671
copies[entry.fileName] = originMap[entry.crc32];
672+
copiesv2[entry.crc32] = entry.fileName;
671673
return;
672674
}
673675

@@ -700,7 +702,7 @@ async function diffFromPPK(origin: string, next: string, output: string) {
700702

701703
//console.log({copies, deletes});
702704
zipfile.addBuffer(
703-
Buffer.from(JSON.stringify({ copies, deletes })),
705+
Buffer.from(JSON.stringify({ copies, copiesv2, deletes })),
704706
'__diff.json',
705707
);
706708
zipfile.end();
@@ -747,6 +749,7 @@ async function diffFromPackage(
747749
}
748750

749751
const copies = {};
752+
const copiesv2 = {};
750753

751754
const zipfile = new YazlZipFile();
752755

@@ -792,6 +795,7 @@ async function diffFromPackage(
792795
// If moved from other place
793796
if (originMap[entry.crc32]) {
794797
copies[entry.fileName] = originMap[entry.crc32];
798+
copiesv2[entry.crc32] = entry.fileName;
795799
return;
796800
}
797801

@@ -810,7 +814,7 @@ async function diffFromPackage(
810814
}
811815
});
812816

813-
zipfile.addBuffer(Buffer.from(JSON.stringify({ copies })), '__diff.json');
817+
zipfile.addBuffer(Buffer.from(JSON.stringify({ copies, copiesv2 })), '__diff.json');
814818
zipfile.end();
815819
await writePromise;
816820
}

0 commit comments

Comments
 (0)