使用QPython在Android上切换到新的Tor身份

时间:2017-12-21 20:52:53

标签: tor qpython stem orbot

在我的Android设备上成功安装QPython和Orbot之后,我已经pip安装了一个着名的 stem 库,并试图通过向控制端口发送NEWNYM信号来改变Tor身份。 在PC上,此代码

from stem.control import Controller
from stem import Signal

with Controller.from_port(port=9051) as ctrl:
    ctrl.authenticate()
    ctrl.signal(Signal.NEWNYM)

完美无缺。 但是,在Android设备上,QPython会返回错误:TypeError: decode() argument 1 must be string, not None。身份验证失败。

我怎么能克服这个问题?也许,我应该期待AnroidFacade SL4A API与Tor进行交互?

我在诺基亚3上运行Android 7.1。通过在Orbot设置中使用Torrc自定义配置,ControlPort设置为9051。

更新这是一个追溯堆栈:

/data/user/0/org.qpython.qpy/files/bin/qpython-android5.sh "/storage/emulated/0/qpython/scripts/new.py" && exit
d/0/qpython/scripts/new.py" && exit     <
Traceback (most recent call last):
  File "/storage/emulated/0/qpython/scripts/new.py", line 6, in <module>
    ctrl.authenticate()
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/stem-1.6.0-py2.7.egg/stem/control.py", line 1092, in authenticate
    stem.connection.authenticate(self, *args, **kwargs)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/stem-1.6.0-py2.7.egg/stem/connection.py", line 530, in authenticate
    protocolinfo_response = get_protocolinfo(controller)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/stem-1.6.0-py2.7.egg/stem/connection.py", line 1022, in get_protocolinfo
    stem.response.convert('PROTOCOLINFO', protocolinfo_response)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/stem-1.6.0-py2.7.egg/stem/response/__init__.py", line 124, in convert
    message._parse_message(**kwargs)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/stem-1.6.0-py2.7.egg/stem/response/protocolinfo.py", line 110, in _parse_message
    self.cookie_path = line.pop_mapping(True, True, get_bytes = True)[1].decode(sys.getfilesystemencoding())
TypeError: decode() argument 1 must be string, not None
1|NE1:/ $

0 个答案:

没有答案