Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
tor-android-service
Commits
b600cd43
Commit
b600cd43
authored
Apr 11, 2019
by
sisbell
Browse files
Fixes #20: Include User Defined Bridges
parent
39a0f968
Changes
1
Hide whitespace changes
Inline
Side-by-side
service/src/main/java/org/torproject/android/service/CustomTorInstaller.java
View file @
b600cd43
...
...
@@ -3,6 +3,7 @@ package org.torproject.android.service;
import
android.content.Context
;
import
android.util.Log
;
import
com.msopentech.thali.toronionproxy.TorInstaller
;
import
org.torproject.android.service.util.Prefs
;
import
java.io.*
;
import
java.util.concurrent.TimeoutException
;
...
...
@@ -24,7 +25,6 @@ public class CustomTorInstaller extends TorInstaller {
copy
(
context
.
getAssets
().
open
(
"common/geoip"
),
new
File
(
configDir
,
"geoip"
));
copy
(
context
.
getAssets
().
open
(
"common/geoip6"
),
new
File
(
configDir
,
"geoip6"
));
copy
(
context
.
getAssets
().
open
(
"common/torrc"
),
new
File
(
configDir
,
"torrc"
));
copy
(
context
.
getAssets
().
open
(
"common/bridges.txt"
),
new
File
(
configDir
,
"bridges.txt"
));
}
@Override
...
...
@@ -34,7 +34,8 @@ public class CustomTorInstaller extends TorInstaller {
@Override
public
InputStream
openBridgesStream
()
throws
IOException
{
return
context
.
getResources
().
openRawResource
(
R
.
raw
.
bridges
);
ByteArrayInputStream
userDefinedBridges
=
new
ByteArrayInputStream
((
Prefs
.
getBridgesList
()
+
"\r\n"
).
getBytes
());
return
new
SequenceInputStream
(
userDefinedBridges
,
context
.
getResources
().
getAssets
().
open
(
"common/bridges.txt"
));
}
private
static
void
copy
(
InputStream
is
,
File
target
)
throws
IOException
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment