hydraveil-gui/gui/v2/actions/resume_data.py
2026-11-05 07:27:18 -05:00

15 lines
597 B
Python
Executable file

import os
def system_profile_image(btn_path: str, protocol: str, location: str) -> str:
"""Use prepared Singbox location artwork without generic substitutes while preserving other protocols' fallbacks."""
image_path = os.path.join(btn_path, f"{protocol}_{location}.png")
if protocol in ("hysteria2", "vless"):
return image_path
candidates = (
image_path,
os.path.join(btn_path, f"icon_{location}.png"),
os.path.join(btn_path, "system_wide_global.png"),
)
return next((path for path in candidates if os.path.exists(path)), candidates[-1])