JesusMcCloud / netlayer

Tor Bindings for Kotlin/Java
European Union Public License 1.1
27 stars 24 forks source link

Linux x64 binaries are unresolved + demo failing #9

Closed elect86 closed 6 years ago

elect86 commented 6 years ago

Hi Jesus,

so, I cloned your repo for a potential Android implementation, but at first I got this:

Exception in thread "main" org.berndpruenster.netlayer.tor.TorCtlException
    at org.berndpruenster.netlayer.tor.Tor.<init>(Tor.kt:145)
    at org.berndpruenster.netlayer.tor.NativeTor.<init>(NativeTor.kt:55)
    at org.berndpruenster.netlayer.tor.demo.DemoKt.main(Demo.kt:30)
Caused by: java.io.IOException: Could not load native/linux/x64/tor.tar.xz
    at org.berndpruenster.netlayer.tor.NativeContext.getAssetOrResourceByName(NativeTor.kt:97)
    at org.berndpruenster.netlayer.tor.NativeContext.installFiles(NativeTor.kt:106)
    at org.berndpruenster.netlayer.tor.TorContext.installAndConfigureFiles(TorContext.kt:329)
    at org.berndpruenster.netlayer.tor.TorContext.installAndStartTorOp$tor(TorContext.kt:236)
    at org.berndpruenster.netlayer.tor.Tor.bootstrap(Tor.kt:170)
    at org.berndpruenster.netlayer.tor.Tor.bootstrap$default(Tor.kt:166)
    at org.berndpruenster.netlayer.tor.Tor.<init>(Tor.kt:143)
    ... 2 more

Process finished with exit code 1

Then, I cloned your repo, few modification + Gradle and I didn't get that anymore, but now I get this here:

Exception in thread "main" tor.TorCtlException
    at tor.Tor.<init>(Tor.kt:143)
    at tor.NativeTor.<init>(NativeTor.kt:56)
    at tor.DemoKt.main(Demo.kt:26)
Caused by: java.io.IOException: Could not load geoip
    at tor.NativeContext.getAssetOrResourceByName(NativeTor.kt:93)
    at tor.TorContext.installFiles(TorContext.kt:131)
    at tor.NativeContext.installFiles(NativeTor.kt:98)
    at tor.TorContext.installAndConfigureFiles(TorContext.kt:265)
    at tor.TorContext.installAndStartTorOp$tor(TorContext.kt:186)
    at tor.Tor.bootstrap(Tor.kt:167)
    at tor.Tor.bootstrap$default(Tor.kt:163)
    at tor.Tor.<init>(Tor.kt:141)
    ... 2 more

What am I supposed to have in my tor-demo directory?

JesusMcCloud commented 6 years ago

TL;DR: You will need to mvn install everything at least once

First of all, It is currently not possible to use it on Android. To do so, you would need to provide native Android Tor binaries and perform some additional changes (see https://github.com/ManfredKarrer/jtorproxy for inspiration).

About your issue: You are missing the actual tor binaries (you first error) or at least the platform-independent resources like geoip (your second output). Since I don't know how your gradle build file looks, this is hard to debug for me. These resources are part of external dependencies, you will need to mvn install everything at least once, as IDEs typically do not invoke maven to run code.

You are not supposed to put anything into the tor-demo directory. This should happen automagically.

(Yes, a Hacking.md would indeed be nice!)

JesusMcCloud commented 6 years ago

Closing, see also #10