pyarmor.cli.core 7.6.4__tar.gz

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.

Potentially problematic release.


This version of pyarmor.cli.core might be problematic. Click here for more details.

@@ -0,0 +1,73 @@
1
+ Metadata-Version: 1.1
2
+ Name: pyarmor.cli.core
3
+ Version: 7.6.4
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
+ Description: pyarmo.cli.core
10
+ ===============
11
+
12
+ Pyarmor_ is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
13
+
14
+ This package provides prebuilt `extension module`_ ``pytransform3`` and ``pyarmor_runtime`` required by Pyarmor_
15
+
16
+ It includes prebuilt extensions support the following platforms for Python 3.7+:
17
+
18
+ .. table:: Supported Platforms (1)
19
+ :widths: auto
20
+
21
+ ======== ======== ===== ========= ========= ======= ======= ==========
22
+ Arch x86_64 x86 aarch64 aarch32 armv7 armv6 Remark
23
+ ======== ======== ===== ========= ========= ======= ======= ==========
24
+ Darwin Y No Y No No No [#]_
25
+ Linux Y Y Y (?) (?) (?) [#]_
26
+ Windows Y Y (?) No No No [#]_
27
+ Android Y Y Y No Y No [#]_
28
+ Alpine Y (?) Y (?) (?) (?)
29
+ FreeBSD Y No No No No No
30
+ ======== ======== ===== ========= ========= ======= ======= ==========
31
+
32
+
33
+ .. table:: Supported Platforms (2) [#]_
34
+ :widths: auto
35
+
36
+ ======== ========= ============= ========= ==========
37
+ Arch ppc64le mips32/64el riscv64 Remark
38
+ ======== ========= ============= ========= ==========
39
+ Darwin No No No
40
+ Linux Y Y Y [#]_
41
+ Windows No No No
42
+ Android No No No
43
+ Alpine Y Y Y
44
+ FreeBSD No No No
45
+ ======== ========= ============= ========= ==========
46
+
47
+ * Y: already available
48
+ * No: no support plan
49
+ * (?): not available now, maybe work in future
50
+
51
+ .. [#] Apple Silicon only works for Python 3.9+
52
+ .. [#] This is built with glibc
53
+ .. [#] Themedia protection extensions are introduced in v3.2.3
54
+ .. [#] All below platforms are introduced in v3.2.3
55
+ .. [#] All of these platforms are introduced in v6.5.2
56
+ .. [#] Arch riscv64 only works for Python 3.10+
57
+
58
+ .. _Pyarmor: https://pypi.python.org/pypi/pyarmor/
59
+ .. _Extension Module: https://packaging.python.org/en/latest/glossary/#term-Extension-Module
60
+
61
+ Keywords: protect obfuscate encrypt obfuscation distribute
62
+ Platform: UNKNOWN
63
+ Classifier: Programming Language :: Python :: 3
64
+ Classifier: License :: Free To Use But Restricted
65
+ Classifier: Operating System :: Android
66
+ Classifier: Operating System :: MacOS
67
+ Classifier: Operating System :: Microsoft :: Windows
68
+ Classifier: Operating System :: POSIX
69
+ Classifier: Intended Audience :: Developers
70
+ Classifier: Topic :: Software Development :: Build Tools
71
+ Classifier: Topic :: Utilities
72
+ Classifier: Topic :: Security
73
+ Classifier: Topic :: System :: Software Distribution
@@ -0,0 +1,51 @@
1
+ pyarmo.cli.core
2
+ ===============
3
+
4
+ Pyarmor_ is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
5
+
6
+ This package provides prebuilt `extension module`_ ``pytransform3`` and ``pyarmor_runtime`` required by Pyarmor_
7
+
8
+ It includes prebuilt extensions support the following platforms for Python 3.7+:
9
+
10
+ .. table:: Supported Platforms (1)
11
+ :widths: auto
12
+
13
+ ======== ======== ===== ========= ========= ======= ======= ==========
14
+ Arch x86_64 x86 aarch64 aarch32 armv7 armv6 Remark
15
+ ======== ======== ===== ========= ========= ======= ======= ==========
16
+ Darwin Y No Y No No No [#]_
17
+ Linux Y Y Y (?) (?) (?) [#]_
18
+ Windows Y Y (?) No No No [#]_
19
+ Android Y Y Y No Y No [#]_
20
+ Alpine Y (?) Y (?) (?) (?)
21
+ FreeBSD Y No No No No No
22
+ ======== ======== ===== ========= ========= ======= ======= ==========
23
+
24
+
25
+ .. table:: Supported Platforms (2) [#]_
26
+ :widths: auto
27
+
28
+ ======== ========= ============= ========= ==========
29
+ Arch ppc64le mips32/64el riscv64 Remark
30
+ ======== ========= ============= ========= ==========
31
+ Darwin No No No
32
+ Linux Y Y Y [#]_
33
+ Windows No No No
34
+ Android No No No
35
+ Alpine Y Y Y
36
+ FreeBSD No No No
37
+ ======== ========= ============= ========= ==========
38
+
39
+ * Y: already available
40
+ * No: no support plan
41
+ * (?): not available now, maybe work in future
42
+
43
+ .. [#] Apple Silicon only works for Python 3.9+
44
+ .. [#] This is built with glibc
45
+ .. [#] Themedia protection extensions are introduced in v3.2.3
46
+ .. [#] All below platforms are introduced in v3.2.3
47
+ .. [#] All of these platforms are introduced in v6.5.2
48
+ .. [#] Arch riscv64 only works for Python 3.10+
49
+
50
+ .. _Pyarmor: https://pypi.python.org/pypi/pyarmor/
51
+ .. _Extension Module: https://packaging.python.org/en/latest/glossary/#term-Extension-Module
@@ -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.4'
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
@@ -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,73 @@
1
+ Metadata-Version: 1.1
2
+ Name: pyarmor.cli.core
3
+ Version: 7.6.4
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
+ Description: pyarmo.cli.core
10
+ ===============
11
+
12
+ Pyarmor_ is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
13
+
14
+ This package provides prebuilt `extension module`_ ``pytransform3`` and ``pyarmor_runtime`` required by Pyarmor_
15
+
16
+ It includes prebuilt extensions support the following platforms for Python 3.7+:
17
+
18
+ .. table:: Supported Platforms (1)
19
+ :widths: auto
20
+
21
+ ======== ======== ===== ========= ========= ======= ======= ==========
22
+ Arch x86_64 x86 aarch64 aarch32 armv7 armv6 Remark
23
+ ======== ======== ===== ========= ========= ======= ======= ==========
24
+ Darwin Y No Y No No No [#]_
25
+ Linux Y Y Y (?) (?) (?) [#]_
26
+ Windows Y Y (?) No No No [#]_
27
+ Android Y Y Y No Y No [#]_
28
+ Alpine Y (?) Y (?) (?) (?)
29
+ FreeBSD Y No No No No No
30
+ ======== ======== ===== ========= ========= ======= ======= ==========
31
+
32
+
33
+ .. table:: Supported Platforms (2) [#]_
34
+ :widths: auto
35
+
36
+ ======== ========= ============= ========= ==========
37
+ Arch ppc64le mips32/64el riscv64 Remark
38
+ ======== ========= ============= ========= ==========
39
+ Darwin No No No
40
+ Linux Y Y Y [#]_
41
+ Windows No No No
42
+ Android No No No
43
+ Alpine Y Y Y
44
+ FreeBSD No No No
45
+ ======== ========= ============= ========= ==========
46
+
47
+ * Y: already available
48
+ * No: no support plan
49
+ * (?): not available now, maybe work in future
50
+
51
+ .. [#] Apple Silicon only works for Python 3.9+
52
+ .. [#] This is built with glibc
53
+ .. [#] Themedia protection extensions are introduced in v3.2.3
54
+ .. [#] All below platforms are introduced in v3.2.3
55
+ .. [#] All of these platforms are introduced in v6.5.2
56
+ .. [#] Arch riscv64 only works for Python 3.10+
57
+
58
+ .. _Pyarmor: https://pypi.python.org/pypi/pyarmor/
59
+ .. _Extension Module: https://packaging.python.org/en/latest/glossary/#term-Extension-Module
60
+
61
+ Keywords: protect obfuscate encrypt obfuscation distribute
62
+ Platform: UNKNOWN
63
+ Classifier: Programming Language :: Python :: 3
64
+ Classifier: License :: Free To Use But Restricted
65
+ Classifier: Operating System :: Android
66
+ Classifier: Operating System :: MacOS
67
+ Classifier: Operating System :: Microsoft :: Windows
68
+ Classifier: Operating System :: POSIX
69
+ Classifier: Intended Audience :: Developers
70
+ Classifier: Topic :: Software Development :: Build Tools
71
+ Classifier: Topic :: Utilities
72
+ Classifier: Topic :: Security
73
+ Classifier: Topic :: System :: Software Distribution
@@ -0,0 +1,9 @@
1
+ README.rst
2
+ setup.py
3
+ pyarmor.cli.core.egg-info/PKG-INFO
4
+ pyarmor.cli.core.egg-info/SOURCES.txt
5
+ pyarmor.cli.core.egg-info/dependency_links.txt
6
+ pyarmor.cli.core.egg-info/top_level.txt
7
+ pyarmor/cli/core/__init__.py
8
+ pyarmor/cli/core/features.py
9
+ pyarmor/cli/core/runtime.py
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,62 @@
1
+ import sys
2
+ from setuptools import setup
3
+
4
+ __VERSION__ = '7.6.4'
5
+
6
+ with open('README.rst') as f:
7
+ long_description = f.read()
8
+
9
+ is_android = hasattr(sys, 'getandroidapilevel')
10
+ is_freebsd = sys.platform.startswith(('freebsd', 'openbsd', 'isilon onefs'))
11
+
12
+ setup(
13
+ name="pyarmor.cli.core",
14
+
15
+ # Versions should comply with PEP 440:
16
+ # https://www.python.org/dev/peps/pep-0440/
17
+ version=__VERSION__,
18
+ description="Provide extension module pytransform3 for Pyarmor",
19
+ long_description=long_description,
20
+
21
+ license='Free To Use But Restricted',
22
+
23
+ url="https://github.com/dashingsoft/pyarmor",
24
+ author="Jondy Zhao",
25
+ author_email="pyarmor@163.com",
26
+
27
+ # For a list of valid classifiers, see
28
+ # https://pypi.python.org/pypi?%3Aaction=list_classifiers
29
+ classifiers=[
30
+ "Programming Language :: Python :: 3",
31
+ # Pick your license as you wish
32
+ "License :: Free To Use But Restricted",
33
+
34
+ # Support platforms
35
+ "Operating System :: Android",
36
+ "Operating System :: MacOS",
37
+ "Operating System :: Microsoft :: Windows",
38
+ "Operating System :: POSIX",
39
+
40
+ # Indicate who your project is intended for
41
+ "Intended Audience :: Developers",
42
+ "Topic :: Software Development :: Build Tools",
43
+ "Topic :: Utilities",
44
+ "Topic :: Security",
45
+ "Topic :: System :: Software Distribution",
46
+ ],
47
+
48
+ # This field adds keywords for your project which will appear on the
49
+ # project page. What does your project relate to?
50
+ #
51
+ # Note that this is a string of words separated by whitespace, not a list.
52
+ keywords="protect obfuscate encrypt obfuscation distribute",
53
+
54
+ packages=["pyarmor.cli.core"],
55
+ package_dir={"pyarmor.cli.core": "pyarmor/cli/core"},
56
+ package_data={"pyarmor.cli.core": ["pytransform3*", "pyarmor_runtime*"]},
57
+ install_requires=(
58
+ ['pyarmor.cli.core.android==%s' % __VERSION__] if is_android else
59
+ ['pyarmor.cli.core.freebsd==%s' % __VERSION__] if is_freebsd else
60
+ []
61
+ )
62
+ )