maipulse: 脱敏存档

- Python 后端 + 单页前端 + Android(Chaquopy) 壳
- 曲库 1343 首 / 称号 2800 个
- 机台身份与店铺信息已抹除,字段留空
- 打包脚本含 16KB 页对齐与自动脱敏
This commit is contained in:
shouko committed 2026-10-28 22:27:46 +08:00
commit 8421898626
161 files changed
+50297

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
"""dump_master.py —— 从游戏 StreamingAssets 的 Sort.xml 提取各分类 id + 名称。"""
import json
import os
import sys
import xml.etree.ElementTree as ET
BASE = r"D:\bs\Package\Sinmai_Data\StreamingAssets\A000"
OUT = r"D:\DSH\maimai\maipulse\data\master.json"
CATS = {
"ticket": ("ticket", 12),
"partner": ("partner", 10),
"title": ("title", 2),
"icon": ("icon", 3),
"frame": ("frame", 11),
"plate": ("plate", 1),
"music": ("music", 5),
}
result = {}
for key, (folder, kind) in CATS.items():
path = os.path.join(BASE, folder, folder.capitalize() + "Sort.xml")
if not os.path.exists(path):
cands = [f for f in os.listdir(os.path.join(BASE, folder)) if f.endswith(".xml")]
if not cands:
print("skip", key)
continue
path = os.path.join(BASE, folder, cands[0])
tree = ET.parse(path)
rows = []
for node in tree.iter("StringID"):
i = node.findtext("id")
s = node.findtext("str")
if i is None:
continue
try:
iid = int(i)
except ValueError:
continue
rows.append({"id": iid, "name": s or ""})
rows.sort(key=lambda x: x["id"])
result[key] = {"kind": kind, "count": len(rows), "items": rows}
print("%-8s kind=%-3s %5d 条 例: %s" % (key, kind, len(rows), rows[0] if rows else "-"))
os.makedirs(os.path.dirname(OUT), exist_ok=True)
with open(OUT, "w", encoding="utf-8") as f:
json.dump(result, f, ensure_ascii=False)
print("\n已写出", OUT, os.path.getsize(OUT), "字节")