forkattu lähteestä cwtch.im/ui
1
0
Fork 0

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

This commit is contained in:
Dan Ballard 2019-02-14 10:57:44 -08:00
vanhempi 24de8c1c93
commit 8ade3dcd72
3 muutettua tiedostoa jossa 17 lisäystä ja 1 poistoa

Näytä tiedosto

@ -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
Näytä tiedosto

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