运行于Termux上的问题 problems when running on Termux #1371
Replies: 14 comments 7 replies
-
权限问题,动态库存放在 |
Beta Was this translation helpful? Give feedback.
-
使用 |
Beta Was this translation helpful? Give feedback.
-
What's the output of |
Beta Was this translation helpful? Give feedback.
-
需要重新编译一下 pyarmor_runtime.so |
Beta Was this translation helpful? Give feedback.
-
平台:安装于Android的Termux,使用pyarmor版本:Version: 8.3.1,使用pyarmor -d gen test.py,
在PC上进行生成,在放到安装于Android的Termux,仍报错
|
Beta Was this translation helpful? Give feedback.
-
加密脚本的时候使用的 Python 版本是 3.11 吗? |
Beta Was this translation helpful? Give feedback.
-
是的,Windows和termux上均为3.11.4
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年8月14日(周一) 晚上9:03
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [dashingsoft/pyarmor] 运行于Termux上的问题 problems when running on Termux (Discussion #1371)
加密脚本的时候使用的 Python 版本是 3.11 吗?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
那么
如果没有的话,必须重新编译 termux 的 Python, 允许输出这些函数。 扩展模块 |
Beta Was this translation helpful? Give feedback.
-
另外可以测试一下是否需要设置
|
Beta Was this translation helpful? Give feedback.
-
运行结果:
Python 3.11.4 (main, Jul 2 2023, 11:17:00) [Clang 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> sys.setdlopenflags(os.RTLD_GLOBAL)
>>> import pyarmor.cli.core.pytransform3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyarmor.cli.core.pytransform3'
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年8月15日(周二) 中午12:27
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [dashingsoft/pyarmor] 运行于Termux上的问题 problems when running on Termux (Discussion #1371)
另外可以测试一下是否需要设置 sys.setdlopenflags(os.RTLD_GLOBAL),在 termux 下面运行
python3.11 >>> import os, sys >>> sys.setdlopenflags(os.RTLD_GLOBAL) >>> import pyarmor.cli.core.pytransform3
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
两条均进行运行后,在很长一段时间后均未结束
1:
$ objdump -t /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0 & grep PyFloat_Type
[1] 11681
/data/data/com.termux/files/usr/lib/libpython3.11.so.1.0: file format elf64-littleaarch64
SYMBOL TABLE:
[1] + 11681 done objdump -t /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0
(未结束)
2:
$ objdump -t /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0 & grep PyBytes_AsStringAndSize
[1] 10212
/data/data/com.termux/files/usr/lib/libpython3.11.so.1.0: file format elf64-littleaarch64
SYMBOL TABLE:
[1] + 10212 done objdump -t /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0
(未结束)
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年8月15日(周二) 中午12:10
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [dashingsoft/pyarmor] 运行于Termux上的问题 problems when running on Termux (Discussion #1371)
那么 /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0 是否包含这些未定义的函数呢?
objdump -t /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0 | grep PyFloat_Type objdump -t /data/data/com.termux/files/usr/lib/libpython3.11.so.1.0 | grep PyBytes_AsStringAndSize
如果没有的话,必须重新编译 termux 的 Python, 允许输出这些函数。
扩展模块 pyarmor_runtime.so 和 pytransform3.so 需要 Python 动态库提供这些函数。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
那么这个呢
|
Beta Was this translation helpful? Give feedback.
-
>>> import os, sys
>>> sys.setdlopenflags(os.RTLD_GLOBAL)
>>> import pyarmor.cli.core.android.aarch64.pytransform3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen failed: cannot locate symbol "PyFloat_Type" referenced by "/data/data/com.termux/files/usr/lib/python3.11/site-packages/pyarmor/cli/core/android/aarch64/pytransform3.so"...
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年8月15日(周二) 下午4:48
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [dashingsoft/pyarmor] 运行于Termux上的问题 problems when running on Termux (Discussion #1371)
那么这个呢
>>> import os, sys >>> sys.setdlopenflags(os.RTLD_GLOBAL) >>> import pyarmor.cli.core.android.aarch64.pytransform3
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I don't know why in termux |
Beta Was this translation helpful? Give feedback.
-
Termux安装于HarmonyOS。Python版本1均在311
1.使用
pyarmor -d gen test.py
返回:
test.py在Windows_x86_64下正常加密
2.打开在Windows_x86_64下加密,欲运用于Termux:
发现要指定andriod_aarch64而非linux_aarch64;
指定andriod_aarch64后,使用
python test.py
后返回:如何解决呢?或者还应询问Termux开发者
Beta Was this translation helpful? Give feedback.
All reactions