forked from Zhh9126/linuxcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.spec
More file actions
72 lines (66 loc) · 2.02 KB
/
Copy pathmain.spec
File metadata and controls
72 lines (66 loc) · 2.02 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
# -*- mode: python ; coding: utf-8 -*-
import secrets
block_cipher = None
# 生成加密密钥
ENCRYPT_KEY = secrets.token_bytes(16)
# Paramiko 及其依赖的隐藏导入(简化版)
paramiko_hiddenimports = [
'paramiko',
'paramiko.transport',
'paramiko.client',
'paramiko.ssh_exception',
'paramiko.auth_handler',
'paramiko.channel',
'paramiko.message',
'paramiko.pkey',
'paramiko.rsakey',
'paramiko.dsskey',
'paramiko.ecdsakey',
'paramiko.ed25519key',
'paramiko.sftp',
'paramiko.sftp_client',
'paramiko.agent',
# cryptography 相关依赖
'_cffi_backend',
'cryptography',
'cryptography.hazmat.backends.openssl',
'cryptography.hazmat.primitives.ciphers',
'cryptography.hazmat.primitives.asymmetric',
'cryptography.hazmat.primitives.serialization',
'cryptography.hazmat.primitives.hashes',
'cryptography.hazmat.bindings.openssl',
# bcrypt 和 pynacl
'bcrypt',
'nacl',
]
a = Analysis(['main.py'],
pathex=['.'],
binaries=[],
datas=[],
hiddenimports=paramiko_hiddenimports,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=None,
key=ENCRYPT_KEY)
exe = EXE(pyz,
a.scripts,
a.binaries, # 添加二进制文件
a.zipfiles, # 添加zip文件
a.datas, # 添加数据文件
name='OSCHECK.BIN', # 输出文件名
debug=False,
strip=False,
upx=True, # 使用UPX压缩,文件更小
console=True, # 控制台程序
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
# onefile 模式配置
onefile=True) # 关键:设置为True生成单个文件