Release Healer Man 0.1.32
This commit is contained in:
1 parent
d3d6aaebdb
commit
6dcb1034e5
102 files changed
+10772
-788
No files matched your search
@@ -7,6 +7,10 @@ import json
|
||||
from pathlib import Path
|
||||
from zipfile import ZIP_STORED, ZipFile
|
||||
|
||||
CONTENT_POLICY = json.loads(
|
||||
(Path(__file__).resolve().parents[2] / "shared" / "content-policy.json").read_text(encoding="utf-8")
|
||||
)
|
||||
|
||||
|
||||
def verify_package(apk: Path) -> dict:
|
||||
with ZipFile(apk) as archive:
|
||||
@@ -35,13 +39,20 @@ def verify_package(apk: Path) -> dict:
|
||||
if actual_objects != expected_objects:
|
||||
raise ValueError("APK includes missing or unreferenced bundled objects.")
|
||||
manastorms = sum(pack["id"].startswith("manastorm:") and pack["bundledOnAndroid"] for pack in manifest["packs"])
|
||||
if dungeons != 84 or manastorms != 0:
|
||||
raise ValueError(f"Unexpected bundled content: {dungeons} dungeons, {manastorms} Manastorm packs")
|
||||
arenas = sum(pack["id"] == "core:arenas" for pack in manifest["packs"])
|
||||
pack_ids = sorted(pack["id"] for pack in manifest["packs"])
|
||||
expected_pack_ids = sorted(CONTENT_POLICY["bootstrapPackIds"])
|
||||
if pack_ids != expected_pack_ids or dungeons != 1 or manastorms != 0 or arenas != 0:
|
||||
raise ValueError(
|
||||
f"Unexpected bundled content: {dungeons} dungeons, {manastorms} Manastorm packs, {arenas} arena packs"
|
||||
)
|
||||
if object_bytes > CONTENT_POLICY["maxBootstrapStoredBytes"]:
|
||||
raise ValueError("APK bootstrap content exceeds the stored-byte budget.")
|
||||
return {
|
||||
"apk": str(apk.resolve()), "apkBytes": apk.stat().st_size,
|
||||
"manifestVersion": manifest["version"], "logicalFiles": len(manifest["files"]),
|
||||
"verifiedUniqueObjects": len(checked), "storedObjectBytes": object_bytes,
|
||||
"bundledDungeons": dungeons, "bundledManastormPacks": manastorms,
|
||||
"bundledDungeons": dungeons, "bundledManastormPacks": manastorms, "bundledArenaPacks": arenas,
|
||||
"allOriginalHashesMatch": True,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user