-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMasterHttpRelayVPN.spec
More file actions
152 lines (140 loc) · 4.01 KB
/
Copy pathMasterHttpRelayVPN.spec
File metadata and controls
152 lines (140 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# -*- mode: python ; coding: utf-8 -*-
"""
MasterHttpRelayVPN.spec — PyInstaller build specification.
Key behaviour for the frozen EXE:
ProxyThread launches the engine by re-running the same EXE with the
``--run-engine`` flag, which is handled in main_gui.py before Qt starts.
This avoids the "second window opens" / "stuck at connecting" bug that
occurs when sys.executable is an EXE and not a Python interpreter.
Usage:
pyinstaller MasterHttpRelayVPN.spec --clean --noconfirm
"""
import sys
from pathlib import Path
block_cipher = None
ROOT = Path(SPECPATH)
# ── Data files to bundle ──────────────────────────────────────────────────────
datas = [
(str(ROOT / "engine"), "engine"),
(str(ROOT / "assets"), "assets"),
]
# Only bundle _vendor/ if it exists
if (ROOT / "_vendor").is_dir():
datas.append((str(ROOT / "_vendor"), "_vendor"))
# ── Hidden imports ────────────────────────────────────────────────────────────
hidden_imports = [
# Engine modules (loaded via spec_from_file_location or direct import)
"proxy.proxy_server",
"proxy.mitm",
"proxy.socks5",
"proxy.proxy_support",
"relay.domain_fronter",
"relay.h2_transport",
"relay.relay_response",
"relay.fronting_support",
"relay.http_reader",
"core.cert_installer",
"core.google_ip_scanner",
"core.logging_utils",
"core.adblock",
"core.codec",
"core.constants",
"core.lan_utils",
# PyQt6
"PyQt6.sip",
"PyQt6.QtSvg",
"PyQt6.QtCore",
"PyQt6.QtGui",
"PyQt6.QtWidgets",
# Cryptography
"cryptography.hazmat.primitives.asymmetric.rsa",
"cryptography.hazmat.primitives.serialization",
"cryptography.x509",
# Networking
"h2",
"hpack",
"hyperframe",
"certifi",
"urllib.request",
"urllib.error",
"ssl",
# Optional / psutil
"psutil",
# Compression (optional engine deps)
"brotli",
"zstandard",
]
a = Analysis(
[str(ROOT / "main_gui.py")],
pathex=[
str(ROOT),
str(ROOT / "engine"),
str(ROOT / "engine" / "src"),
],
binaries=[],
datas=datas,
hiddenimports=hidden_imports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
"tkinter",
"matplotlib",
"numpy",
"pandas",
"scipy",
"IPython",
"jupyter",
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="MasterHttpRelayVPN",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
# IMPORTANT: console=False hides the main window's console.
# The engine subprocess (--run-engine child) writes to a pipe,
# so no console is needed there either.
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=str(ROOT / "assets" / "icon.ico") if sys.platform == "win32" else
str(ROOT / "assets" / "icon.icns") if sys.platform == "darwin" else None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="MasterHttpRelayVPN",
)
if sys.platform == "darwin":
app = BUNDLE(
coll,
name="MasterHttpRelayVPN.app",
icon=str(ROOT / "assets" / "icon.icns"),
bundle_identifier="com.masterhttprelayvpn.gui",
info_plist={
"CFBundleName": "MasterHttpRelayVPN",
"CFBundleDisplayName": "MasterHttpRelayVPN",
"CFBundleVersion": "1.0.0",
"CFBundleShortVersionString": "1.0.0",
"NSHighResolutionCapable": True,
},
)