代码库初始化
This commit is contained in:
1 parent
07786ab323
commit
4334694551
851 files changed
+42626
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import zipfile, re
|
||||
|
||||
base = r'e:\MCStudioDownload\work\3027246179@qq.com\Cpp\AddOn\309c2d420bc84ee986db9cdd070ff02a\_sa_hanhua_out'
|
||||
jars = {
|
||||
'essentials': base + r'\sa_essentials-forge-1.20.1-1.0.0.jar',
|
||||
'lib': base + r'\sa_lib-forge-1.20.1-1.0.1.jar',
|
||||
'decor': base + r'\sa_decor-forge-1.20.1-1.0.3.jar',
|
||||
}
|
||||
|
||||
pat = re.compile(r"Survivors?\s+Arsenal", re.IGNORECASE)
|
||||
for name, jar in jars.items():
|
||||
hits = []
|
||||
with zipfile.ZipFile(jar) as z:
|
||||
for n in z.namelist():
|
||||
if n.endswith('/') or n.endswith('.png'):
|
||||
continue
|
||||
if n.endswith('.class'):
|
||||
try:
|
||||
b = z.read(n)
|
||||
# class 文件只查 ASCII 字符串
|
||||
s = ''.join(chr(c) for c in b if 32 <= c < 127 or c in (9, 10, 13))
|
||||
except Exception:
|
||||
continue
|
||||
else:
|
||||
try:
|
||||
s = z.read(n).decode('utf-8', errors='ignore')
|
||||
except Exception:
|
||||
continue
|
||||
if pat.search(s):
|
||||
hits.append(n)
|
||||
print(f'[{name}] 英文 mod 名残留(除 lang 文件): {len(hits)} 个')
|
||||
for h in hits:
|
||||
if not ('/lang/' in h):
|
||||
print(' ', h)
|
||||
Reference in new issue
Block a user