Browse Source

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

alpha-bug
Dan Ballard 1 year ago
parent
commit
8ade3dcd72
3 changed files with 17 additions and 1 deletions
  1. +1
    -1
      README.md
  2. BIN
      linux/tor
  3. +16
    -0
      main.go

+ 1
- 1
README.md View File

@@ -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 View File


+ 16
- 0
main.go View File

@@ -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)


Loading…
Cancel
Save