Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
a4d3daaa
Commit
a4d3daaa
authored
12 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Removed a Java 1.6 API call.
parent
e1ec17f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java
+12
-18
12 additions, 18 deletions
briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java
with
12 additions
and
18 deletions
briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java
+
12
−
18
View file @
a4d3daaa
...
@@ -40,7 +40,6 @@ import net.sf.briar.api.plugins.duplex.DuplexTransportConnection;
...
@@ -40,7 +40,6 @@ import net.sf.briar.api.plugins.duplex.DuplexTransportConnection;
import
net.sf.briar.util.StringUtils
;
import
net.sf.briar.util.StringUtils
;
import
socks.Socks5Proxy
;
import
socks.Socks5Proxy
;
import
socks.SocksSocket
;
import
socks.SocksSocket
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.FileObserver
;
import
android.os.FileObserver
;
...
@@ -275,25 +274,20 @@ class TorPlugin implements DuplexPlugin, EventHandler {
...
@@ -275,25 +274,20 @@ class TorPlugin implements DuplexPlugin, EventHandler {
out
.
close
();
out
.
close
();
}
}
@SuppressLint
(
"NewApi"
)
private
boolean
setExecutable
(
File
f
)
{
private
boolean
setExecutable
(
File
f
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
String
[]
command
=
{
"chmod"
,
"700"
,
f
.
getAbsolutePath
()
};
return
f
.
setExecutable
(
true
,
true
);
try
{
}
else
{
return
Runtime
.
getRuntime
().
exec
(
command
).
waitFor
()
==
0
;
String
[]
command
=
{
"chmod"
,
"700"
,
f
.
getAbsolutePath
()
};
}
catch
(
IOException
e
)
{
try
{
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
log
(
WARNING
,
e
.
toString
(),
e
);
return
Runtime
.
getRuntime
().
exec
(
command
).
waitFor
()
==
0
;
}
catch
(
InterruptedException
e
)
{
}
catch
(
IOException
e
)
{
if
(
LOG
.
isLoggable
(
WARNING
))
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
log
(
WARNING
,
e
.
toString
(),
e
);
LOG
.
warning
(
"Interrupted while executing chmod"
);
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
if
(
LOG
.
isLoggable
(
WARNING
))
}
catch
(
SecurityException
e
)
{
LOG
.
warning
(
"Interrupted while executing chmod"
);
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
log
(
WARNING
,
e
.
toString
(),
e
);
Thread
.
currentThread
().
interrupt
();
}
catch
(
SecurityException
e
)
{
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
log
(
WARNING
,
e
.
toString
(),
e
);
}
return
false
;
}
}
return
false
;
}
}
private
void
tryToClose
(
InputStream
in
)
{
private
void
tryToClose
(
InputStream
in
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment