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
186bd114
Commit
186bd114
authored
Oct 12, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reconnect until we got content length
parent
a0490d66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
ProcessRepoZip.java
...main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java
+12
-4
No files found.
app/src/main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java
View file @
186bd114
...
@@ -35,7 +35,7 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
...
@@ -35,7 +35,7 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
private
boolean
mInstall
;
private
boolean
mInstall
;
private
String
mLink
;
private
String
mLink
;
private
File
mFile
;
private
File
mFile
;
private
int
progress
=
0
,
total
;
private
int
progress
=
0
,
total
=
-
1
;
private
static
final
int
UPDATE_DL_PROG
=
0
;
private
static
final
int
UPDATE_DL_PROG
=
0
;
private
static
final
int
SHOW_PROCESSING
=
1
;
private
static
final
int
SHOW_PROCESSING
=
1
;
...
@@ -105,9 +105,17 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
...
@@ -105,9 +105,17 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
try
{
try
{
// Request zip from Internet
// Request zip from Internet
HttpURLConnection
conn
=
WebService
.
request
(
mLink
,
null
);
HttpURLConnection
conn
;
if
(
conn
==
null
)
return
false
;
do
{
total
=
conn
.
getContentLength
();
conn
=
WebService
.
request
(
mLink
,
null
);
if
(
conn
==
null
)
return
null
;
total
=
conn
.
getContentLength
();
if
(
total
<
0
)
conn
.
disconnect
();
else
break
;
}
while
(
true
);
InputStream
in
=
new
ProgressUpdateInputStream
(
conn
.
getInputStream
());
InputStream
in
=
new
ProgressUpdateInputStream
(
conn
.
getInputStream
());
// Temp files
// Temp files
...
...
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