Browse Source

use bundled tor code for desktop, updated bundled tor to 0.3.5.7. update android readme

pull/94/head
Dan Ballard 3 years ago
parent
commit
8ade3dcd72
  1. 2
      README.md
  2. BIN
      linux/tor
  3. 16
      main.go

2
README.md

@ -20,7 +20,7 @@ The -local and -debug flags are helpful when developing.
## Android
A arm-pie version of tor like [tor-0.3.5.7-armeabi-v7a](https://git.openprivacy.ca/openprivacy/buildfiles/src/master/tor/tor-0.3.5.7-armeabi-v7a.so) is required to be placed in `android/libs/armeabi-v7a` with the name `libtor.so`
We supply an arm-pie version of tor in `android/libs/armeabi-v7a` with the name `libtor.so`
qtdeploy -docker build android
adb install deploy/android/build-debug.apk

BIN
linux/tor

Binary file not shown.

16
main.go

@ -19,6 +19,7 @@ import (
"os/user"
"path"
"runtime"
"path/filepath"
)
func init() {
@ -72,6 +73,21 @@ func main() {
torpath := "tor"
if runtime.GOOS == "android" {
torpath = "/data/data/org.qtproject.example.go/lib/libtor.so"
} else {
dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
if _, err := os.Stat(path.Join(dir, "tor")); os.IsNotExist(err) {
if _, err := os.Stat(path.Join(dir, "deploy", "linux", "tor")); os.IsNotExist(err) {
if _, err := os.Stat(path.Join(dir, "deploy", "windows", "tor")); os.IsNotExist(err) {
log.Warnln("Cannot find bundled Tor")
} else {
torpath = path.Join(dir, "deploy", "windows", "tor")
}
} else {
torpath = path.Join(dir, "deploy", "linux", "tor")
}
} else {
torpath = path.Join(dir, "tor")
}
}
acn, err := connectivity.StartTor(the.CwtchDir, torpath)