2. 概念和定义

2.1. 术语表

工程

工程是用来组织需要加密的脚本和如何加密脚本的选项集合

迷你型脚本

使用 pyarmor 命令生成的一种加密脚本,需要扩展模块 pyarmor_mini 才能正常运行

重构型脚本

使用 pyarmor 命令生成的加密脚本,主要是对脚本中函数,类和方法等名称进行了重命名,不需要任何额外的扩展模块即可运行

pyarmor

实现 Pyarmor 所有功能的命令行工具

pyarmor_mini

Python 扩展模块,由 Pyarmor 开发组预编译,并发布在包 pyarmor.mini

pyarmor.cli

Python 包,用来创建 pyarmor ,由 Pyarmor 开发组发布

pyarmor.mini

Python 包,提供运行加密脚本需要的预编译扩展模块,由 Pyarmor 开发组发布在 PyPI 上面

2.2. 工程

graph Project { node [shape=component] C1 [label="Scripts"] C2 [label="Modules"] C3 [label="Packages"] X1 [label="Options" shape=ellipse] }

2.3. 迷你型加密脚本

from pyarmor_mini import __pyarmor__
__pyarmor__(__name__, b'xxxx')

2.4. 重构型加密脚本

def pyarmor__1(pyarmor__2):
  return pyarmor__2 + 'a'

pyarmor__1('abc')

2.5. pyarmor 命令

graph pyarmor { node [shape=rect] C1 [label="pyarmor init"] C2 [label="pyarmor env"] C3 [label="pyarmor build"] }

子命令

digraph Structure { P1 [label="工程" shape=component] C1 [label="pyarmor init" shape=rect] C2 [label="pyarmor env" shape=rect] C3 [label="pyarmor build" shape=rect] X1 [label="选项"] S1 [label="迷你型脚本" shape=component] S2 [label="重构型脚本" shape=component] X1->C1 C1->P1 [taillabel="创建"] X1->C2 C2->P1 [taillabel="修改"] P1->C3 C3->S1 [label="生成" labelfloat=true] C3->S2 }

功能关系图