Files
werk/scripts/source_check.py
T
waoziandClaude Opus 5.5 4ecabd56d2 Rename Werkzeug to Werk
The app, its window and launcher, packages, release files, website,
store listing, wordmarks and source now say Werk; the GitHub repository
is waozixyz/werk and the itch.io page waozi.itch.io/werk. Daochi keeps the
registered app id and record domains under the former name, and Android
keeps the package xyz.waozi.pass, so devices stay linked and installs
update in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:07:10 -03:00

29 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Reject handwritten application implementations outside Ziran."""
from pathlib import Path
import subprocess
root = Path(__file__).resolve().parents[1]
tracked = subprocess.check_output(["git", "ls-files", "--cached", "--others", "--exclude-standard", "-z"], cwd=root).decode().split("\0")
bad = []
for name in tracked:
if not name or not (root / name).is_file():
continue
path = Path(name)
if path.suffix in {".c", ".h", ".cc", ".cpp", ".cxx", ".hpp", ".kry", ".java", ".kt", ".go", ".rs", ".swift", ".m", ".mm", ".zig"}:
bad.append(name)
if name.startswith("web/site/app/") and path.suffix == ".js":
bad.append(name)
if bad:
raise SystemExit("Non-Ziran app implementation:\n" + "\n".join(bad))
manifest = (root / "droid/app/src/main/AndroidManifest.xml").read_text()
assert 'android:hasCode="false"' in manifest
assert 'android:name="android.app.NativeActivity"' in manifest
# Fingerprint unlock for the saved master password, and the network only for
# sync, which stays off until the owner sets up an account.
import re
permissions = set(re.findall(r'uses-permission android:name="([^"]+)"', manifest))
assert permissions <= {"android.permission.USE_BIOMETRIC", "android.permission.USE_FINGERPRINT",
"android.permission.INTERNET"}, permissions
print("All maintained Werk application implementations are Ziran")