-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathRose.spec
More file actions
438 lines (404 loc) · 11.9 KB
/
Copy pathRose.spec
File metadata and controls
438 lines (404 loc) · 11.9 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec file for Rose
Builds a standalone executable with Windows UI API support
"""
import sys
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
from pathlib import Path
block_cipher = None
# Collect all data files for packages that need them
datas = []
# Assets folder - verify and add entire directory
import os
if Path('assets').exists() and Path('assets').is_dir():
asset_files = os.listdir('assets')
if asset_files:
# Add entire assets folder (preserves directory structure)
datas += [('assets', 'assets')]
print(f"[OK] Assets directory found with {len(asset_files)} files: {', '.join(asset_files)}")
else:
print("[WARNING] Assets directory is empty")
else:
print("[WARNING] Assets directory not found")
# Icons have been moved to assets folder, no separate icons directory needed
# Injection tools - separate binaries (.exe, .dll) from data files (.bat)
import os
# Binary files (executables and DLLs) - these go in binaries, not datas
# NOTE: cslol-dll.dll is NOT included - users must provide their own due to DMCA
injection_binaries = [
'injection/tools/mod-tools.exe',
]
# Data files (text files, etc.)
injection_data_files = [
'injection/tools/hashes.game.txt',
]
# Verify and add injection binaries
binaries = []
missing_binaries = []
for tool in injection_binaries:
if Path(tool).exists():
binaries.append((tool, 'injection/tools'))
else:
missing_binaries.append(tool)
if missing_binaries:
print(f"[WARNING] Missing injection binaries:")
for tool in missing_binaries:
print(f" - {tool}")
else:
print(f"[OK] All {len(injection_binaries)} injection binaries found")
# Verify and add injection data files
missing_data = []
for tool in injection_data_files:
if Path(tool).exists():
datas += [(tool, 'injection/tools')]
else:
missing_data.append(tool)
if missing_data:
print(f"[WARNING] Missing injection data files:")
for tool in missing_data:
print(f" - {tool}")
else:
print(f"[OK] All {len(injection_data_files)} injection data files found")
# Add mods_map.json
if Path('injection/mods_map.json').exists():
datas += [('injection/mods_map.json', 'injection')]
else:
print("[WARNING] injection/mods_map.json not found")
# Collect Pillow data files (fonts, etc.) to prevent version mismatch issues
try:
pillow_datas = collect_data_files('PIL')
if pillow_datas:
datas += pillow_datas
print(f"[OK] Collected {len(pillow_datas)} Pillow data files")
except Exception as e:
print(f"[WARNING] Could not collect Pillow data files: {e}")
# Include the source-built Pengu Loader runtime used for Rose activation/deactivation
# Runtime-generated files (logs, per-user state) must be excluded so they don't
# leak local test data into the shipped installer.
pengu_loader_dir = Path('Pengu Loader')
PENGU_LOADER_EXCLUDED_ROOT_NAMES = {
'config',
'datastore',
}
def _pengu_path_excluded(rel_path: Path) -> bool:
name = rel_path.name.lower()
if rel_path.parts and rel_path.parts[0].lower() in PENGU_LOADER_EXCLUDED_ROOT_NAMES:
return True
return name.endswith('.log') or name.endswith('.log.old')
if pengu_loader_dir.exists() and pengu_loader_dir.is_dir():
if not (pengu_loader_dir / 'Pengu Loader.exe').exists():
raise RuntimeError("Source-built Pengu Loader.exe is missing. Run scripts/build_pyinstaller.py first.")
bundled_count = 0
skipped = []
for src in pengu_loader_dir.rglob('*'):
if not src.is_file():
continue
rel = src.relative_to(pengu_loader_dir)
if _pengu_path_excluded(rel):
skipped.append(str(rel))
continue
dest_dir = (Path('Pengu Loader') / rel).parent
datas += [(str(src), str(dest_dir))]
bundled_count += 1
print(f"[OK] Pengu Loader directory bundled ({bundled_count} files)")
if skipped:
print(f"[INFO] Skipped runtime/local files: {', '.join(skipped)}")
else:
print("[WARNING] Pengu Loader directory not found – Pengu features will be disabled")
# Hidden imports - modules PyInstaller might not detect
hiddenimports = [
# Main package modules
'main',
'main.setup',
'main.setup.console',
'main.setup.arguments',
'main.setup.initialization',
'main.core',
'main.core.state',
'main.core.lockfile',
'main.core.signals',
'main.core.initialization',
'main.core.threads',
'main.core.lcu_handler',
'main.core.cleanup',
'main.runtime',
'main.runtime.loop',
# Core app modules
'injection',
'injection.core',
'injection.core.injector',
'injection.core.manager',
'injection.game',
'injection.game.game_monitor',
'injection.game.game_detector',
'injection.config',
'injection.config.config_manager',
'injection.config.threshold_manager',
'injection.mods',
'injection.mods.mod_manager',
'injection.mods.zip_resolver',
'injection.overlay',
'injection.overlay.overlay_manager',
'injection.overlay.process_manager',
'injection.tools',
'injection.tools.tools_manager',
'lcu',
'lcu.core',
'lcu.core.client',
'lcu.core.lcu_api',
'lcu.core.lcu_connection',
'lcu.core.lockfile',
'lcu.data',
'lcu.data.skin_scraper',
'lcu.data.skin_cache',
'lcu.data.types',
'lcu.data.utils',
'lcu.features',
'lcu.features.lcu_properties',
'lcu.features.lcu_skin_selection',
'lcu.features.lcu_game_mode',
'lcu.features.lcu_swiftplay',
'pengu',
'pengu.core',
'pengu.core.skin_monitor',
'pengu.core.websocket_server',
'pengu.core.http_handler',
'pengu.communication',
'pengu.communication.message_handler',
'pengu.communication.broadcaster',
'pengu.processing',
'pengu.processing.skin_processor',
'pengu.processing.skin_mapping',
'pengu.processing.flow_controller',
'state',
'state.core',
'state.core.app_status',
'state.core.shared_state',
'threads',
'threads.core',
'threads.core.phase_thread',
'threads.core.websocket_thread',
'threads.core.lcu_monitor_thread',
'threads.handlers',
'threads.handlers.champ_thread',
'threads.handlers.champion_lock_handler',
'threads.handlers.game_mode_detector',
'threads.handlers.injection_trigger',
'threads.handlers.lobby_processor',
'threads.handlers.phase_handler',
'threads.handlers.swiftplay_handler',
'threads.utilities',
'threads.utilities.loadout_ticker',
'threads.utilities.timer_manager',
'threads.utilities.skin_name_resolver',
'threads.websocket',
'threads.websocket.websocket_connection',
'threads.websocket.websocket_event_handler',
'utils',
'utils.core',
'utils.core.logging',
'utils.core.paths',
'utils.core.utilities',
'utils.core.validation',
'utils.core.normalization',
'utils.core.historic',
'utils.system',
'utils.system.admin_utils',
'utils.system.win32_base',
'utils.system.window_utils',
'utils.system.resolution_utils',
'utils.download',
'utils.download.repo_downloader',
'utils.download.skin_downloader',
'utils.download.smart_skin_downloader',
'utils.download.hashes_downloader',
'utils.download.hash_updater',
'utils.integration',
'utils.integration.tray_manager',
'utils.integration.tray_settings',
'utils.integration.pengu_loader',
'utils.threading',
'utils.threading.thread_manager',
'ui',
'ui.core',
'ui.core.user_interface',
'ui.core.lifecycle_manager',
'ui.chroma',
'ui.chroma.panel',
'ui.chroma.preview_manager',
'ui.chroma.selector',
'ui.chroma.ui',
'ui.chroma.selection_handler',
'ui.chroma.special_cases',
'ui.handlers',
'ui.handlers.historic_mode_handler',
'ui.handlers.randomization_handler',
'ui.handlers.skin_display_handler',
# Launcher module
'launcher',
'launcher.core',
'launcher.core.launcher',
'launcher.sequences',
'launcher.sequences.hash_check_sequence',
'launcher.sequences.skin_sync_sequence',
'launcher.ui',
'launcher.ui.update_dialog',
'launcher.update',
'launcher.update.github_client',
'launcher.update.update_downloader',
'launcher.update.update_installer',
'launcher.update.update_sequence',
'launcher.updater',
# Image processing (PIL/Pillow)
'PIL',
'PIL.Image',
'PIL.ImageDraw',
'PIL.ImageFont',
# Pillow compiled extensions (fixes version mismatch issues)
'PIL._imaging',
'PIL._imagingtk',
'PIL._tkinter_finder',
# Networking
'requests',
'urllib3',
'websocket',
'websocket_client',
'websockets',
# Party mode (WebSocket relay)
'party',
'party.core',
'party.core.party_manager',
'party.core.party_state',
'party.network',
'party.network.peer_connection',
'party.network.ws_relay',
'party.protocol',
'party.protocol.message_types',
'party.protocol.token_codec',
'party.discovery',
'party.discovery.lobby_matcher',
'party.discovery.skin_collector',
# System tray
'pystray',
'pystray._win32',
# Native dialogs and settings (already covered by utils.integration and utils.system above)
# Other dependencies
'psutil',
# Top-level modules
'config',
]
# Exclusions - modules we don't need (reduces size and build time)
excludes = [
'matplotlib',
'pytest',
'setuptools',
'pip',
'wheel',
'distutils',
'PySide2',
'PySide6',
# Exclude removed packages
'easyocr',
'torch',
'torchvision',
'cv2',
'numpy',
'scipy',
'mss',
# Exclude heavy data science packages we don't use
'pandas',
'pyarrow',
'statsmodels',
'patsy',
'tables',
'openpyxl',
'xlrd',
'xlwt',
'sqlalchemy',
# Exclude Jupyter/notebook packages
'IPython',
'jupyter',
'notebook',
'nbformat',
'nbconvert',
# Exclude documentation/development tools
'sphinx',
'docutils',
'jinja2',
'pygments',
'black',
'mypy',
# Exclude distributed computing packages
'dask',
'distributed',
'numba',
'llvmlite',
# Exclude plotting packages
'plotly',
'bokeh',
'panel',
'holoviews',
'pyviz_comms',
'markdown',
# Exclude cloud/AWS packages
'botocore',
'boto3',
's3transfer',
# Exclude old P2P/test modules (replaced by WebSocket relay)
'miniupnpc',
'test_party_punch',
'test_party_relay',
'relay_server',
]
# Filter out cslol-dll.dll from binaries (users must provide their own due to DMCA)
def filter_binaries(binaries_list):
return [(name, path, typ) for name, path, typ in binaries_list
if 'cslol-dll' not in name.lower()]
a = Analysis(
['main.py'],
pathex=[str(Path.cwd())], # Add current directory to Python path
binaries=binaries, # Include injection tool executables
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=excludes,
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
# Remove cslol-dll.dll if PyInstaller auto-detected it
a.binaries = filter_binaries(a.binaries)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='Rose',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False, # Don't use UPX (can cause issues)
console=False, # No console window
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='assets/icon.ico',
uac_admin=True, # Request admin rights (required for injection)
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name='Rose',
)