()
| 373 | |
| 374 | |
| 375 | def install_tor_support() -> Tuple[bool, str]: |
| 376 | if is_termux() and which("pkg") and not tor_binary(): |
| 377 | _run(["pkg", "update", "-y"]) |
| 378 | if not _run(["pkg", "install", "-y", "tor"]): |
| 379 | return False, "Could not install tor with pkg." |
| 380 | if not tor_binary(): |
| 381 | return False, "Tor binary not found. In Termux run: pkg install tor" |
| 382 | if not pysocks_available(): |
| 383 | if not _run([sys.executable, "-m", "pip", "install", "--upgrade", "pysocks"]): |
| 384 | return False, "Could not install PySocks. Run: pip install pysocks" |
| 385 | return True, "Tor support ready." |
| 386 | |
| 387 | |
| 388 | def start_tor() -> Tuple[bool, str]: |
no test coverage detected