pyarmor.cli.core 7.6.1__cp313-none-win32.whl

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.
@@ -0,0 +1,143 @@
1
+ #! /usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ #
4
+ #############################################################
5
+ # #
6
+ # Copyright @ 2023 - Dashingsoft corp. #
7
+ # All rights reserved. #
8
+ # #
9
+ # Pyarmor #
10
+ # #
11
+ # Version: 8.0.1 - #
12
+ # #
13
+ #############################################################
14
+ #
15
+ #
16
+ # @File: pyarmor/core/__init__.py
17
+ #
18
+ # @Author: Jondy Zhao (pyarmor@163.com)
19
+ #
20
+ # @Create Date: Thu Jan 12 17:29:25 CST 2023
21
+ #
22
+
23
+ __VERSION__ = '7.6.1'
24
+
25
+ PLATFORM_NAMES = (
26
+ 'windows.x86_64', 'windows.x86', 'cygwin.x86_64',
27
+ 'darwin.x86_64', 'darwin.arm64',
28
+ 'linux.x86_64', 'linux.x86', 'linux.aarch64', 'linux.armv7',
29
+ 'linux.mips32el', 'linux.mips64el', 'linux.ppc64le', 'linux.riscv64',
30
+ 'alpine.x86_64', 'alpine.aarch64',
31
+ 'alpine.mips32el', 'alpine.mips64el', 'alpine.ppc64le', 'alpine.riscv64',
32
+ 'freebsd.x86_64',
33
+ 'android.x86_64', 'android.x86', 'android.aarch64', 'android.armv7',
34
+ )
35
+
36
+
37
+ def map_platform(platname):
38
+ if platname == 'darwin.aarch64':
39
+ return 'darwin.arm64'
40
+ if platname.startswith('musl.'):
41
+ return '.'.join('alpine', platname[5:])
42
+ return platname
43
+
44
+
45
+ def check_and_install_prebuilt_package():
46
+ import os
47
+ from pyarmor.cli.context import format_platform
48
+ from pyarmor.cli.bootstrap import check_prebuilt_runtime_library
49
+ from platform import system, machine
50
+
51
+ platname = os.getenv(
52
+ 'PYARMOR_PLATFORM',
53
+ format_platform(system().lower(), machine().lower()))
54
+ platname = map_platform(platname)
55
+ if platname not in PLATFORM_NAMES:
56
+ raise RuntimeError('"%s" is still not supported by Pyarmor' % platname)
57
+
58
+ plat, arch = platname.split('.')
59
+ if not os.path.exists(os.path.join(os.path.dirname(__file__), plat, arch)):
60
+ check_prebuilt_runtime_library([platname])
61
+
62
+ return plat, arch
63
+
64
+
65
+ def _import_pytransform3():
66
+ try:
67
+ return __import__(
68
+ 'pytransform3', globals=globals(), locals=locals(),
69
+ fromlist=('__pyarmor__',), level=1
70
+ )
71
+ except ModuleNotFoundError:
72
+ plat, arch = check_and_install_prebuilt_package()
73
+ modname = '.'.join([plat, arch, 'pytransform3'])
74
+ return __import__(
75
+ modname, globals=globals(), locals=locals(),
76
+ fromlist=('__pyarmor__',), level=1
77
+ )
78
+
79
+
80
+ class Pytransform3(object):
81
+
82
+ _pytransform3 = None
83
+
84
+ @staticmethod
85
+ def init(ctx=None):
86
+ if Pytransform3._pytransform3 is None:
87
+ Pytransform3._pytransform3 = m = _import_pytransform3()
88
+ if ctx:
89
+ m.init_ctx(ctx)
90
+ return Pytransform3._pytransform3
91
+
92
+ @staticmethod
93
+ def generate_obfuscated_script(ctx, res):
94
+ m = Pytransform3.init(ctx)
95
+ return m.generate_obfuscated_script(ctx, res)
96
+
97
+ @staticmethod
98
+ def generate_runtime_package(ctx, output, platforms=None):
99
+ m = Pytransform3.init(ctx)
100
+ return m.generate_runtime_package(ctx, output, platforms)
101
+
102
+ @staticmethod
103
+ def generate_runtime_key(ctx, outer=None):
104
+ m = Pytransform3.init(ctx)
105
+ return m.generate_runtime_key(ctx, outer)
106
+
107
+ @staticmethod
108
+ def pre_build(ctx):
109
+ m = Pytransform3.init(ctx)
110
+ return m.pre_build(ctx)
111
+
112
+ @staticmethod
113
+ def post_build(ctx):
114
+ m = Pytransform3.init(ctx)
115
+ return m.post_build(ctx)
116
+
117
+ @staticmethod
118
+ def get_hd_info(hdtype, name=None):
119
+ m = Pytransform3.init()
120
+ return m.get_hd_info(hdtype, name) if name \
121
+ else m.get_hd_info(hdtype)
122
+
123
+ @staticmethod
124
+ def version():
125
+ m = Pytransform3.init()
126
+ return m.revision
127
+
128
+
129
+ #
130
+ # Compatiable for pyarmor.cli < 8.3
131
+ #
132
+
133
+ class PyarmorRuntime(object):
134
+
135
+ @staticmethod
136
+ def get(plat, extra=None):
137
+ from os import scandir, path as os_path
138
+ if not extra:
139
+ prefix = 'pyarmor_runtime'
140
+ for entry in scandir(os_path.dirname(__file__)):
141
+ parts = entry.name.split('.')
142
+ if parts[0] == prefix and parts[-1] in ('so', 'pyd', 'dylib'):
143
+ return entry.name, os_path.abspath(entry.path)
@@ -0,0 +1,47 @@
1
+ #! /usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ #
4
+ #############################################################
5
+ # #
6
+ # Copyright @ 2023 - Dashingsoft corp. #
7
+ # All rights reserved. #
8
+ # #
9
+ # Pyarmor #
10
+ # #
11
+ # Version: 8.2.4 - #
12
+ # #
13
+ #############################################################
14
+ #
15
+ #
16
+ # @File: pyarmor/core/features.py
17
+ #
18
+ # @Author: Jondy Zhao (pyarmor@163.com)
19
+ #
20
+ # @Create Date: Tue Jun 6 07:57:55 CST 2023
21
+ #
22
+
23
+ # Each log
24
+ # revision, age, (new features), (changed features), (removed features)
25
+ __CHANGE_LOGS__ = (
26
+ (1, 0, (), (), ()),
27
+ )
28
+
29
+
30
+ class PyarmorFeature(object):
31
+
32
+ def features(self):
33
+ '''return features list from change logs'''
34
+ result = set()
35
+ [result.update(item[2]) for item in __CHANGE_LOGS__]
36
+ return result
37
+
38
+ def life(self, feature):
39
+ '''return first pyarmor_runtime version and last verstion to support
40
+ this feature.'''
41
+ minor, fin = None
42
+ for item in __CHANGE_LOGS__:
43
+ if feature in item[2] + item[3]:
44
+ minor = item[0]
45
+ if feature in item[-1]:
46
+ fin = item[0]
47
+ return minor, fin
Binary file
Binary file
@@ -0,0 +1,66 @@
1
+ #! /usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ #
4
+ #############################################################
5
+ # #
6
+ # Copyright @ 2023 - Dashingsoft corp. #
7
+ # All rights reserved. #
8
+ # #
9
+ # Pyarmor #
10
+ # #
11
+ # Version: 8.2.4 - #
12
+ # #
13
+ #############################################################
14
+ #
15
+ #
16
+ # @File: pyarmor/core/runtime.py
17
+ #
18
+ # @Author: Jondy Zhao (pyarmor@163.com)
19
+ #
20
+ # @Create Date: Tue Jun 6 07:50:00 CST 2023
21
+ #
22
+
23
+ from . import map_platform
24
+
25
+
26
+ class PyarmorRuntime(object):
27
+
28
+ @staticmethod
29
+ def get(plat, extra=None, native=True):
30
+ from os import scandir, path as os_path
31
+ prefix = 'pyarmor_runtime'
32
+ extlist = 'so', 'pyd', 'dylib', 'dll'
33
+
34
+ # Themida is only available for windows
35
+ if extra == 'themida' and not plat.startswith('windows'):
36
+ extra = None
37
+
38
+ pkgpath = os_path.dirname(__file__)
39
+ if native and not extra:
40
+ path = pkgpath
41
+ for entry in scandir(path):
42
+ parts = entry.name.split('.')
43
+ if parts[0] == prefix and parts[-1] in extlist:
44
+ return entry.name, os_path.abspath(entry.path)
45
+
46
+ platname = map_platform(plat)
47
+ dirnames = platname.split('.')
48
+ path = os_path.join(pkgpath, extra if extra else '', *dirnames)
49
+ if not os_path.exists(path):
50
+ from pyarmor.cli.bootstrap import check_prebuilt_runtime_library
51
+ check_prebuilt_runtime_library([platname], extra)
52
+
53
+ if os_path.exists(path):
54
+ for entry in scandir(path):
55
+ parts = entry.name.split('.')
56
+ if parts[0] == prefix and parts[-1] in extlist:
57
+ return entry.name, os_path.abspath(entry.path)
58
+
59
+ # Fallback to pyarmor.cli.runtime
60
+ try:
61
+ from pyarmor.cli.runtime import PyarmorRuntime, __VERSION__ as ver
62
+ from logging import getLogger
63
+ getLogger('cli').info('fallback to pyarmor.cli.runtime==%s', ver)
64
+ return PyarmorRuntime.get(plat, extra=extra)
65
+ except ModuleNotFoundError:
66
+ pass
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyarmor.cli.core
3
+ Version: 7.6.1
4
+ Summary: Provide extension module pytransform3 for Pyarmor
5
+ Home-page: https://github.com/dashingsoft/pyarmor
6
+ Author: Jondy Zhao
7
+ Author-email: pyarmor@163.com
8
+ License: Free To Use But Restricted
9
+ Keywords: protect obfuscate encrypt obfuscation distribute
10
+ Platform: UNKNOWN
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: Free To Use But Restricted
13
+ Classifier: Operating System :: Android
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Classifier: Topic :: Utilities
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: System :: Software Distribution
22
+
23
+ pyarmo.cli.core
24
+ ===============
25
+
26
+ Pyarmor_ is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
27
+
28
+ This package provides prebuilt `extension module`_ ``pytransform3`` and ``pyarmor_runtime`` required by Pyarmor_
29
+
30
+ It includes prebuilt extensions support the following platforms for Python 3.7+:
31
+
32
+ .. table:: Supported Platforms (1)
33
+ :widths: auto
34
+
35
+ ======== ======== ===== ========= ========= ======= ======= ==========
36
+ Arch x86_64 x86 aarch64 aarch32 armv7 armv6 Remark
37
+ ======== ======== ===== ========= ========= ======= ======= ==========
38
+ Darwin Y No Y No No No [#]_
39
+ Linux Y Y Y (?) (?) (?) [#]_
40
+ Windows Y Y (?) No No No [#]_
41
+ Android Y Y Y No Y No [#]_
42
+ Alpine Y (?) Y (?) (?) (?)
43
+ FreeBSD Y No No No No No
44
+ ======== ======== ===== ========= ========= ======= ======= ==========
45
+
46
+
47
+ .. table:: Supported Platforms (2) [#]_
48
+ :widths: auto
49
+
50
+ ======== ========= ============= ========= ==========
51
+ Arch ppc64le mips32/64el riscv64 Remark
52
+ ======== ========= ============= ========= ==========
53
+ Darwin No No No
54
+ Linux Y Y Y [#]_
55
+ Windows No No No
56
+ Android No No No
57
+ Alpine Y Y Y
58
+ FreeBSD No No No
59
+ ======== ========= ============= ========= ==========
60
+
61
+ * Y: already available
62
+ * No: no support plan
63
+ * (?): not available now, maybe work in future
64
+
65
+ .. [#] Apple Silicon only works for Python 3.9+
66
+ .. [#] This is built with glibc
67
+ .. [#] Themedia protection extensions are introduced in v3.2.3
68
+ .. [#] All below platforms are introduced in v3.2.3
69
+ .. [#] All of these platforms are introduced in v6.5.2
70
+ .. [#] Arch riscv64 only works for Python 3.10+
71
+
72
+ .. _Pyarmor: https://pypi.python.org/pypi/pyarmor/
73
+ .. _Extension Module: https://packaging.python.org/en/latest/glossary/#term-Extension-Module
74
+
75
+
@@ -0,0 +1,9 @@
1
+ pyarmor/cli/core/__init__.py,sha256=-oLEbaB4ujYlBxjjePusy5Beg0d5yzgdL6uT6RsCyA0,4433
2
+ pyarmor/cli/core/features.py,sha256=8hIY19uTyiISWsTf508Za7TVH94MoitW8Z3JBWodhOY,1513
3
+ pyarmor/cli/core/pyarmor_runtime.pyd,sha256=ibWus27U3vYclI8C2BoJe2HFqVkdfhkXmOnFhx5NU84,782862
4
+ pyarmor/cli/core/pytransform3.pyd,sha256=ND_oNHaX_bomSko-xxAfsSHxUp85OTKiV7OlBswx4hM,605184
5
+ pyarmor/cli/core/runtime.py,sha256=tSR2e_rh5LVd9FsPMnEsLP_3JoCjV2lLxk-ytTDftAU,2456
6
+ pyarmor.cli.core-7.6.1.dist-info/METADATA,sha256=8A1NAAiwEBOjtOJKCTG8ZRq4DTVoGxnx8orvbPb_g_s,3016
7
+ pyarmor.cli.core-7.6.1.dist-info/WHEEL,sha256=wJTblfAyVUBEaFwEHVQDyJifhpfyHMjKgZEEYKe2ikE,96
8
+ pyarmor.cli.core-7.6.1.dist-info/top_level.txt,sha256=UE1ovZ_90YzwF_lZ3LV7o8HKLe-RgzUaUUvdH5UTUus,8
9
+ pyarmor.cli.core-7.6.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.34.2)
3
+ Root-Is-Purelib: true
4
+ Tag: cp313-none-win32
5
+
@@ -0,0 +1 @@
1
+ pyarmor