Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
e171362e
Commit
e171362e
authored
Nov 06, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve snet.apk downloading
parent
3e0bf2ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
CheckSafetyNet.java
...main/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java
+8
-7
No files found.
app/src/main/java/com/topjohnwu/magisk/asyncs/CheckSafetyNet.java
View file @
e171362e
...
...
@@ -2,15 +2,17 @@ package com.topjohnwu.magisk.asyncs;
import
android.app.Activity
;
import
com.topjohnwu.crypto.ByteArrayStream
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.utils.Const
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.WebService
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.lang.reflect.Proxy
;
import
java.net.HttpURLConnection
;
...
...
@@ -42,14 +44,13 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
try
{
if
(!
dexPath
.
exists
())
{
HttpURLConnection
conn
=
WebService
.
request
(
Const
.
Url
.
SNET_URL
,
null
);
ByteArrayStream
bas
=
new
ByteArrayStream
();
bas
.
readFrom
(
conn
.
getInputStream
());
conn
.
disconnect
();
dexPath
.
getParentFile
().
mkdir
();
try
(
OutputStream
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
dexPath
)))
{
bas
.
writeTo
(
out
);
out
.
flush
();
try
(
OutputStream
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
dexPath
));
InputStream
in
=
new
BufferedInputStream
(
conn
.
getInputStream
()))
{
Utils
.
inToOut
(
in
,
out
);
}
conn
.
disconnect
();
}
loader
=
new
DexClassLoader
(
dexPath
.
toString
(),
dexPath
.
getParent
(),
null
,
ClassLoader
.
getSystemClassLoader
());
...
...
Write
Preview
Markdown
is supported
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