pyarmor 8.5.8__zip → 8.5.10__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. {pyarmor-8.5.8 → pyarmor-8.5.10}/PKG-INFO +1 -1
  2. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/__init__.py +1 -1
  3. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/bug.py +14 -3
  4. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/context.py +35 -7
  5. pyarmor-8.5.10/pyarmor/cli/core.data.1 +0 -0
  6. pyarmor-8.5.10/pyarmor/cli/core.data.3 +0 -0
  7. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/default.cfg +9 -9
  8. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/docker.py +4 -2
  9. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/generate.py +15 -0
  10. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/hdinfo.py +17 -1
  11. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/plugin.py +5 -4
  12. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/register.py +3 -1
  13. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/repack.py +6 -5
  14. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/resource.py +1 -1
  15. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/config.py +1 -1
  16. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/packer.py +4 -2
  17. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor.egg-info/PKG-INFO +1 -1
  18. pyarmor-8.5.10/pyarmor.egg-info/requires.txt +1 -0
  19. {pyarmor-8.5.8 → pyarmor-8.5.10}/setup.py +1 -1
  20. pyarmor-8.5.8/pyarmor/cli/core.data.1 +0 -0
  21. pyarmor-8.5.8/pyarmor/cli/core.data.3 +0 -0
  22. pyarmor-8.5.8/pyarmor.egg-info/requires.txt +0 -1
  23. {pyarmor-8.5.8 → pyarmor-8.5.10}/MANIFEST.in +0 -0
  24. {pyarmor-8.5.8 → pyarmor-8.5.10}/README.md +0 -0
  25. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/README.rst +0 -0
  26. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/__init__.py +0 -0
  27. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/benchmark.py +0 -0
  28. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/build_meta.py +0 -0
  29. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/__main__.py +0 -0
  30. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/bootstrap.py +0 -0
  31. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/config.py +0 -0
  32. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/core.data.2 +0 -0
  33. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/merge.py +0 -0
  34. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/mixer.py +0 -0
  35. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/public_capsule.zip +0 -0
  36. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cli/shell.py +0 -0
  37. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/cobuilder.py +0 -0
  38. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/README-ZH.md +0 -0
  39. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/README.md +0 -0
  40. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/build-for-exe.bat +0 -0
  41. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/build-for-freeze.bat +0 -0
  42. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/build-with-project.bat +0 -0
  43. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/build-with-project.sh +0 -0
  44. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/cx_Freeze/hello.py +0 -0
  45. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/cx_Freeze/queens.py +0 -0
  46. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/cx_Freeze/setup.py +0 -0
  47. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/helloworld/foo.py +0 -0
  48. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/obfuscate-app.bat +0 -0
  49. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/obfuscate-app.sh +0 -0
  50. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/obfuscate-pkg.bat +0 -0
  51. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/obfuscate-pkg.sh +0 -0
  52. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pack-obfuscated-scripts.bat +0 -0
  53. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pack-obfuscated-scripts.sh +0 -0
  54. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/py2exe/hello.py +0 -0
  55. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/py2exe/queens.py +0 -0
  56. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/py2exe/setup.py +0 -0
  57. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Arithmetic.py +0 -0
  58. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Calls.py +0 -0
  59. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/CommandLine.py +0 -0
  60. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Constructs.py +0 -0
  61. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Dict.py +0 -0
  62. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Exceptions.py +0 -0
  63. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Imports.py +0 -0
  64. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Instances.py +0 -0
  65. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Lists.py +0 -0
  66. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Lookups.py +0 -0
  67. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/NewInstances.py +0 -0
  68. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Numbers.py +0 -0
  69. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Setup.py +0 -0
  70. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Strings.py +0 -0
  71. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/Tuples.py +0 -0
  72. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/With.py +0 -0
  73. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/clockres.py +0 -0
  74. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/package/__init__.py +0 -0
  75. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/package/submodule.py +0 -0
  76. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/pybench.py +0 -0
  77. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/pybench/systimes.py +0 -0
  78. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/simple/queens.py +0 -0
  79. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/testmod/hello.py +0 -0
  80. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/testmod/queens.py +0 -0
  81. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/testpkg/main.py +0 -0
  82. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/testpkg/mypkg/__init__.py +0 -0
  83. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/examples/testpkg/mypkg/foo.py +0 -0
  84. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/__init__.py +0 -0
  85. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/build_data_module.py +0 -0
  86. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/buildext.py +0 -0
  87. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/get_bind_key.py +0 -0
  88. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/get_license_info.py +0 -0
  89. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/get_platform_name.py +0 -0
  90. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/merge.py +0 -0
  91. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/repack.py +0 -0
  92. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/helper/superuntime.py +0 -0
  93. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/license.tri +0 -0
  94. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/platforms/darwin/x86_64/_pytransform.dylib +0 -0
  95. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/platforms/linux/x86/_pytransform.so +0 -0
  96. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/platforms/linux/x86_64/_pytransform.so +0 -0
  97. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/platforms/windows/x86/_pytransform.dll +0 -0
  98. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/platforms/windows/x86_64/_pytransform.dll +0 -0
  99. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/plugins/README.md +0 -0
  100. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/plugins/check_ntp_time.py +0 -0
  101. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/polyfills/__init__.py +0 -0
  102. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/polyfills/argparse.py +0 -0
  103. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/product.key +0 -0
  104. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/project.py +0 -0
  105. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/protect_code.pt +0 -0
  106. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/protect_code2.pt +0 -0
  107. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/public.key +0 -0
  108. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/public_capsule.zip +0 -0
  109. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pyarmor-deprecated.py +0 -0
  110. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pyarmor-webui.py +0 -0
  111. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pyarmor.py +0 -0
  112. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pyimcore.py +0 -0
  113. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pyshield.key +0 -0
  114. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pyshield.lic +0 -0
  115. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/pytransform.py +0 -0
  116. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/reform.py +0 -0
  117. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/register.py +0 -0
  118. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/sppmode.py +0 -0
  119. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor/utils.py +0 -0
  120. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor.egg-info/SOURCES.txt +0 -0
  121. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor.egg-info/dependency_links.txt +0 -0
  122. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor.egg-info/entry_points.txt +0 -0
  123. {pyarmor-8.5.8 → pyarmor-8.5.10}/pyarmor.egg-info/top_level.txt +0 -0
  124. {pyarmor-8.5.8 → pyarmor-8.5.10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: pyarmor
3
- Version: 8.5.8
3
+ Version: 8.5.10
4
4
  Summary: A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
5
5
  Home-page: https://github.com/dashingsoft/pyarmor
6
6
  Author: Jondy Zhao
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
 
3
- __VERSION__ = '8.5.8'
3
+ __VERSION__ = '8.5.10'
4
4
 
5
5
  logger = logging.getLogger('cli')
6
6
 
@@ -36,7 +36,7 @@ $tracelog
36
36
  $tb
37
37
  ''')
38
38
 
39
- ENABLE_DEBUG_HINTS = '''something is wrong
39
+ UNUSED_ENABLE_DEBUG_HINTS = '''something is wrong
40
40
  *=============================================================*
41
41
  * Please enable debug option `-d` to run it again *
42
42
  * pyarmor -d gen options ... *
@@ -45,11 +45,10 @@ ENABLE_DEBUG_HINTS = '''something is wrong
45
45
  * *
46
46
  * Please also check *
47
47
  * https://pyarmor.readthedocs.io/en/latest/questions.html *
48
- * or run `pyarmor man` to find solutions quickly *
49
48
  *=============================================================*
50
49
  '''
51
50
 
52
- SOLUTION_HINTS = Template('''something is wrong
51
+ UNUSED_SOLUTION_HINTS = Template('''something is wrong
53
52
  *=============================================================*
54
53
  * Please check *
55
54
  * https://pyarmor.readthedocs.io/en/latest/questions.html *
@@ -61,6 +60,17 @@ SOLUTION_HINTS = Template('''something is wrong
61
60
  *=============================================================*
62
61
  ''')
63
62
 
63
+ ENABLE_DEBUG_HINTS = 'please enable debug option `-d` to run it again'
64
+
65
+ SOLUTION_HINTS = Template('''something is wrong
66
+ *=============================================================*
67
+ * Please check console log to find out what's wrong *
68
+ * *
69
+ * If still not solved, please find solutions by *
70
+ * https://pyarmor.readthedocs.io/en/latest/questions.html *
71
+ *=============================================================*
72
+ ''')
73
+
64
74
 
65
75
  def generate_bug_report(e, logfile=LOG_FILE, output=BUG_FILE):
66
76
  'Generate file `pyarmor.report.bug` in current path'
@@ -111,6 +121,7 @@ def find_solutions(e):
111
121
  logger.error(ENABLE_DEBUG_HINTS)
112
122
  return
113
123
 
124
+ logger.info('generate bug file "%s"', BUG_FILE)
114
125
  generate_bug_report(e)
115
126
  logger.error(SOLUTION_HINTS.substitute(bugfile=BUG_FILE))
116
127
 
@@ -64,7 +64,11 @@ def __pyarmor__():
64
64
  ('armv6', ('armv6l',)),
65
65
  ('armv7', ('armv7l',)),
66
66
  ('aarch32', ('aarch32',)),
67
- ('aarch64', ('aarch64', 'arm64'))
67
+ ('aarch64', ('aarch64', 'arm64')),
68
+ ('ppc64le', ('ppc64le',)),
69
+ ('mips32el', ('mipsel', 'mips32el')),
70
+ ('mips64el', ('mips64el',)),
71
+ ('riscv64', ('riscv64',)),
68
72
  )
69
73
  for alias, archlist in arch_table:
70
74
  if mach in archlist:
@@ -92,12 +96,21 @@ __pyarmor__ = ExtensionFileLoader(
92
96
  '''
93
97
 
94
98
 
95
- def format_platform(plat, arch):
99
+ def format_platform(plat=None, arch=None):
96
100
  from struct import calcsize
97
101
  from fnmatch import fnmatchcase
98
102
 
103
+ # Fix pyarmor.cli.core 6.5.2 issue, may be removed in 6.5.3
104
+ if plat is None and arch is None:
105
+ if os.getenv('PYARMOR_PLATFORM'):
106
+ plat, arch = os.getenv('PYARMOR_PLATFORM').split('.')
107
+ else:
108
+ from platform import system, machine
109
+ plat, arch = system().lower(), machine().lower()
110
+
99
111
  plat_table = (
100
- ('windows', ('windows', 'cygwin*')),
112
+ ('windows', ('windows',)),
113
+ ('cygwin', ('cygwin*',)),
101
114
  ('darwin', ('darwin',)),
102
115
  ('linux', ('linux*',)),
103
116
  ('freebsd', ('freebsd*', 'openbsd*', 'isilon onefs')),
@@ -110,7 +123,11 @@ def format_platform(plat, arch):
110
123
  ('armv6', ('armv6l',)),
111
124
  ('armv7', ('armv7l',)),
112
125
  ('aarch32', ('aarch32',)),
113
- ('aarch64', ('aarch64', 'arm64'))
126
+ ('aarch64', ('aarch64', 'arm64')),
127
+ ('ppc64le', ('ppc64le',)),
128
+ ('mips32el', ('mipsel', 'mips32el')),
129
+ ('mips64el', ('mips64el',)),
130
+ ('riscv64', ('riscv64',)),
114
131
  )
115
132
 
116
133
  for alias, platlist in plat_table:
@@ -197,9 +214,10 @@ class Context(object):
197
214
  return self._read_config(flist, encoding=encoding)
198
215
 
199
216
  def read_token(self):
200
- if os.path.exists(self.license_token):
201
- with open(self.license_token, 'rb') as f:
202
- return f.read()
217
+ for filename in (self.license_token, self.license_group_token):
218
+ if os.path.exists(filename):
219
+ with open(filename, 'rb') as f:
220
+ return f.read()
203
221
 
204
222
  def save_token(self, data):
205
223
  with open(self.license_token, 'wb') as f:
@@ -207,6 +225,12 @@ class Context(object):
207
225
  raise RuntimeError('got invalid token %r' % data)
208
226
  f.write(data)
209
227
 
228
+ def save_group_token(self, data):
229
+ with open(self.license_group_token, 'wb') as f:
230
+ if not data.endswith(b'=='):
231
+ raise RuntimeError('got invalid token %r' % data)
232
+ f.write(data)
233
+
210
234
  def clear_token(self):
211
235
  if os.path.exists(self.license_token):
212
236
  with open(self.license_token, 'wb') as f:
@@ -330,6 +354,10 @@ class Context(object):
330
354
  def license_token(self):
331
355
  return os.path.join(self.reg_path, '.license.token')
332
356
 
357
+ @property
358
+ def license_group_token(self):
359
+ return os.path.join(self.reg_path, '.license.group.token')
360
+
333
361
  @property
334
362
  def license_info(self):
335
363
  from .register import parse_token
Binary file
Binary file
@@ -3,10 +3,10 @@
3
3
  ;; Pyarmor version
4
4
  major = 8
5
5
  minor = 5
6
- patch = 8
6
+ patch = 10
7
7
 
8
8
  ;; Compatible core version
9
- cli.core = 6.5.1
9
+ cli.core = 6.5.3
10
10
 
11
11
  ;; Deprecated since Pyarmor 8.2.5
12
12
  ; cli.runtime = 3.2.5
@@ -93,6 +93,7 @@ rft_enables = builtin import function class method global local
93
93
  rft_auto_exclude = 1
94
94
 
95
95
  ;; Export all the names in module attribute __all__
96
+ ;; It means leave all the names in the __all__ as they're
96
97
  rft_auto_export = 1
97
98
 
98
99
  ;; Enable dev mode for rft
@@ -192,6 +193,9 @@ clear_frame_locals = 0
192
193
  ;; Whether encrypt name in statement import
193
194
  rft_mix_import_name = 0
194
195
 
196
+ ;; Strip leading name package
197
+ strip_package_name = 1
198
+
195
199
  ;;
196
200
  ;; Compatiable options
197
201
  ;;
@@ -255,18 +259,14 @@ on_error = 0
255
259
  ;; 3600s
256
260
  ;; 60m
257
261
  ;; 1h
258
- ;; 1
262
+ ;; 1 = 1h
259
263
  ; period = 1
260
264
 
261
- ;; Expired runtime key. Check local time if there is leading '.',
262
- ;; otherwise check ntp time
265
+ ;; Expired runtime key, support 2 forms:
263
266
  ;;
264
- ;; 30
267
+ ;; 30: expired in 30 days
265
268
  ;; 2025-12-31
266
269
  ;;
267
- ;; .30
268
- ;; .2025-12-30
269
- ;;
270
270
  ; expired =
271
271
 
272
272
  ;; Check network time by those servers
@@ -32,6 +32,7 @@ from .register import Register, MACHFLAGS
32
32
 
33
33
 
34
34
  CONFIG = {
35
+ 'host': '0.0.0.0',
35
36
  'port': 29092,
36
37
  'home': os.path.expanduser(os.path.join('~', '.pyarmor', 'docker')),
37
38
  'machid': None,
@@ -110,6 +111,7 @@ def main_entry():
110
111
  parser = argparse.ArgumentParser()
111
112
  parser.add_argument('-d', '--debug', action='store_true',
112
113
  help='Enable debug mode')
114
+ parser.add_argument('--host', type=str, default=CONFIG['host'])
113
115
  parser.add_argument('-p', '--port', type=int, default=CONFIG['port'],
114
116
  help=argparse.SUPPRESS)
115
117
  parser.add_argument('-s', '--sock', default='/var/run/docker.sock',
@@ -135,9 +137,9 @@ def main_entry():
135
137
  CONFIG['machid'] = [Pytransform3.get_hd_info(x) for x in MACHFLAGS]
136
138
  logging.debug('machine id: %s', CONFIG['machid'])
137
139
 
138
- host, port = '0.0.0.0', args.port
140
+ host, port = args.host, args.port
139
141
  with socketserver.TCPServer((host, port), DockerAuthHandler) as server:
140
- logging.info('listen container auth request on %s:%s', host, args.port)
142
+ logging.info('listen container auth request on %s:%s', host, port)
141
143
  server.serve_forever()
142
144
 
143
145
 
@@ -99,6 +99,21 @@ class Builder(object):
99
99
  self.ctx.runtime_key = self.generate_runtime_key()
100
100
  Pytransform3.generate_runtime_package(self.ctx, output)
101
101
 
102
+ def _generate_obfuscated_script(self, res):
103
+ try:
104
+ return Pytransform3.generate_obfuscated_script(self.ctx, res)
105
+ except RuntimeError as e:
106
+ if str(e) != 'out of license':
107
+ raise
108
+
109
+ def _copy_script(self, path, res):
110
+ logger.warning('%s is not obfuscated because out of license', res)
111
+ fullpath = os.path.join(path, res.output_filename)
112
+ output = os.path.dirname(fullpath)
113
+ os.makedirs(output, exist_ok=True)
114
+ logger.info('write %s (not obfuscated)', fullpath)
115
+ shutil.copy2(res.fullpath, output)
116
+
102
117
  def _obfuscate_scripts(self):
103
118
  rev = self.ctx.version_info()
104
119
  template = self.ctx.bootstrap_template
@@ -36,6 +36,22 @@ def get_hd_info(hdtype, name=None):
36
36
  return str(e)
37
37
 
38
38
 
39
+ def get_all_ifmac():
40
+ try:
41
+ buf = Pytransform3.get_hd_info(HT_IFMAC, name='*')
42
+ i = 0
43
+ n = len(buf)
44
+ rlist = []
45
+ while i < n and buf[i]:
46
+ j = i + 1 + buf[i]
47
+ rlist.append(':'.join(['%02x' % x for x in buf[i+1:j]]))
48
+ i = j
49
+ except Exception as e:
50
+ return str(e)
51
+
52
+ return '<%s>' % ','.join(set(rlist))
53
+
54
+
39
55
  def main(argv):
40
56
  parser = argparse.ArgumentParser()
41
57
  parser.add_argument('devname', nargs='*', help=(
@@ -49,7 +65,7 @@ def main(argv):
49
65
  print('Default Harddisk Serial Number: %s' % get_hd_info(HT_HARDDISK))
50
66
  print('Default Mac address: %s' % get_hd_info(HT_IFMAC))
51
67
  print('Default IPv4 address: %s' % get_hd_info(HT_IPV4))
52
- print('Multiple Mac addresses: %s' % get_hd_info(HT_IFMAC, name='*'))
68
+ print('Multiple Mac addresses: %s' % get_all_ifmac())
53
69
  print('Domain: %s' % get_hd_info(HT_DOMAIN))
54
70
 
55
71
  for name in args.devname:
@@ -236,10 +236,11 @@ def find_runtime_package(ctx, output):
236
236
  return os.path.join(output, rtname)
237
237
  if isinstance(prefix, str):
238
238
  return os.path.join(output, prefix.replace('.', os.path.sep), rtname)
239
- for entry in os.scandir(output):
240
- if entry.is_dir():
241
- if rtname in os.listdir(entry.path):
242
- return os.path.join(entry.path, rtname)
239
+ with os.scandir(output) as iterator:
240
+ for entry in iterator:
241
+ if entry.is_dir():
242
+ if rtname in os.listdir(entry.path):
243
+ return os.path.join(entry.path, rtname)
243
244
 
244
245
 
245
246
  class DarwinUniversalPlugin:
@@ -199,7 +199,7 @@ class Register(object):
199
199
  raise CliError('this group device license is not for '
200
200
  'this docker host')
201
201
  logger.debug('extracting %s', name)
202
- self.ctx.save_token(f.read(name))
202
+ self.ctx.save_group_token(f.read(name))
203
203
  return
204
204
  if 'group.info' in namelist:
205
205
  logger.info('refer to http://pyarmor.readthedocs.io/en/stable/how-to/register.html'
@@ -217,6 +217,8 @@ class Register(object):
217
217
  rlist = []
218
218
  with socket(AF_INET, SOCK_STREAM) as s:
219
219
  s.connect((host, port))
220
+ logger.info('socket addr: %s', str(s.getsockname()))
221
+ logger.info('remote addr: %s', str(s.getpeername()))
220
222
  s.sendall(b'PADH' + b'x' * 60)
221
223
  while True:
222
224
  flag = s.recv(1)
@@ -2,14 +2,14 @@ import logging
2
2
  import marshal
3
3
  import os
4
4
  import shutil
5
- import struct
6
5
  import sys
7
- import tempfile
8
6
 
9
7
  from fnmatch import fnmatch
10
8
  from subprocess import check_call, DEVNULL
11
9
 
12
10
  # Only used by BundleRepacker, they could be removed with deprecated routines
11
+ import struct
12
+ import tempfile
13
13
  from importlib._bootstrap_external import _code_to_timestamp_pyc
14
14
  from PyInstaller.archive.writers import ZlibArchiveWriter, CArchiveWriter
15
15
  from PyInstaller.archive.readers import CArchiveReader
@@ -41,7 +41,7 @@ def autoclean_output(output, autoclean=True):
41
41
  shutil.rmtree(output)
42
42
 
43
43
 
44
- # This patch is used to modify the specfile generate by PyInstaller
44
+ # This patch is used to modify the specfile generated by PyInstaller
45
45
  #
46
46
  # It mainly does:
47
47
  #
@@ -554,7 +554,7 @@ def repack_pyzarchive(pyzpath, pyztoc, obfpath, rtname, cipher=None):
554
554
  fullpath = fullpath + 'c'
555
555
  if os.path.exists(fullpath):
556
556
  logger.info('replace item "%s"', name)
557
- with open(fullpath, 'r') as f:
557
+ with open(fullpath, 'r', encoding='utf-8') as f:
558
558
  co = compile(f.read(), '<frozen %s>' % name, 'exec')
559
559
  code_dict[name] = co
560
560
  else:
@@ -711,7 +711,8 @@ class BundleRepacker:
711
711
  logger.debug('one file mode is %s', bool(self.one_file_mode))
712
712
 
713
713
  def build(self):
714
- self.repack(self.output, self.ctx.runtime_package_name)
714
+ obfpath = os.path.normpath(self.ctx.pack_obfpath)
715
+ self.repack(obfpath, self.ctx.runtime_package_name)
715
716
 
716
717
  def repack(self, obfpath, rtname, entry=None):
717
718
  buildpath = self.buildpath
@@ -200,7 +200,7 @@ class PycResource(FileResource):
200
200
  class PathResource(Resource):
201
201
 
202
202
  def __init__(self, path, name=None, parent=None):
203
- super().__init__(path, name=name, parent=parent)
203
+ super().__init__(path, name=os.path.basename(path), parent=parent)
204
204
  self.respaths = []
205
205
  self.resfiles = []
206
206
 
@@ -1,6 +1,6 @@
1
1
  from sys import platform
2
2
 
3
- version = '8.5.8'
3
+ version = '8.5.10'
4
4
 
5
5
  # The corresponding version of pytransform.so
6
6
  core_version = 'r52.6'
@@ -294,6 +294,8 @@ def _patch_specfile(obfdist, src, specfile, hookpath=None, encoding=None,
294
294
  end_lines = ("# Patch end.", "", "",)
295
295
 
296
296
  main_lines = (
297
+ "from PyInstaller.config import CONF",
298
+ "_code_cache = getattr(a.pure, '_code_cache', CONF['code_cache'].get(id(a.pure)))",
297
299
  "_src = %s" % repr(os.path.abspath(src)),
298
300
  "_obf = 0",
299
301
  "for i in range(len(a.scripts)):",
@@ -308,9 +310,9 @@ def _patch_specfile(obfdist, src, specfile, hookpath=None, encoding=None,
308
310
  " if a.pure[i][1].startswith(_src):",
309
311
  " x = a.pure[i][1].replace(_src, r'%s')" % p,
310
312
  " if os.path.exists(x):",
311
- " if hasattr(a.pure, '_code_cache'):",
313
+ " if _code_cache:",
312
314
  " with open(x) as f:",
313
- " a.pure._code_cache[a.pure[i][0]] = compile(f.read(), a.pure[i][1], 'exec')",
315
+ " _code_cache[a.pure[i][0]] = compile(f.read(), a.pure[i][1], 'exec')",
314
316
  " a.pure[i] = a.pure[i][0], x, a.pure[i][2]",
315
317
  )
316
318
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: pyarmor
3
- Version: 8.5.8
3
+ Version: 8.5.10
4
4
  Summary: A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
5
5
  Home-page: https://github.com/dashingsoft/pyarmor
6
6
  Author: Jondy Zhao
@@ -0,0 +1 @@
1
+ pyarmor.cli.core~=6.5.3
@@ -113,7 +113,7 @@ setup(
113
113
  },
114
114
 
115
115
  install_requires=[
116
- 'pyarmor.cli.core~=6.5.1'
116
+ 'pyarmor.cli.core~=6.5.3'
117
117
  ],
118
118
 
119
119
  entry_points={
Binary file
Binary file
@@ -1 +0,0 @@
1
- pyarmor.cli.core~=6.5.1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes