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
240d1477
Commit
240d1477
authored
Jul 19, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup in check updates
parent
3550d1e6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
20 deletions
+11
-20
MagiskManager.java
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
+1
-1
LoadRepos.java
app/src/main/java/com/topjohnwu/magisk/asyncs/LoadRepos.java
+1
-1
ProcessRepoZip.java
...main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java
+4
-4
UpdateCheckService.java
...ava/com/topjohnwu/magisk/services/UpdateCheckService.java
+5
-14
No files found.
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
View file @
240d1477
...
@@ -117,7 +117,6 @@ public class MagiskManager extends Application {
...
@@ -117,7 +117,6 @@ public class MagiskManager extends Application {
shellLogging
=
false
;
shellLogging
=
false
;
}
}
magiskHide
=
prefs
.
getBoolean
(
"magiskhide"
,
true
);
magiskHide
=
prefs
.
getBoolean
(
"magiskhide"
,
true
);
updateNotification
=
prefs
.
getBoolean
(
"notification"
,
true
);
initSU
();
initSU
();
updateMagiskInfo
();
updateMagiskInfo
();
updateBlockInfo
();
updateBlockInfo
();
...
@@ -183,6 +182,7 @@ public class MagiskManager extends Application {
...
@@ -183,6 +182,7 @@ public class MagiskManager extends Application {
}
}
public
void
updateMagiskInfo
()
{
public
void
updateMagiskInfo
()
{
updateNotification
=
prefs
.
getBoolean
(
"notification"
,
true
);
List
<
String
>
ret
;
List
<
String
>
ret
;
ret
=
shell
.
sh
(
"magisk -v"
);
ret
=
shell
.
sh
(
"magisk -v"
);
if
(!
Utils
.
isValidShellResponse
(
ret
))
{
if
(!
Utils
.
isValidShellResponse
(
ret
))
{
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/LoadRepos.java
View file @
240d1477
...
@@ -54,7 +54,7 @@ public class LoadRepos extends ParallelTask<Void, Void, Void> {
...
@@ -54,7 +54,7 @@ public class LoadRepos extends ParallelTask<Void, Void, Void> {
repoDB
.
clearRepo
();
repoDB
.
clearRepo
();
}
}
etags
=
new
ArrayList
<>(
etags
=
new
ArrayList
<>(
Arrays
.
asList
(
magiskManager
.
prefs
.
getString
(
ETAG_KEY
,
""
).
split
(
","
)));
Arrays
.
asList
(
prefs
.
getString
(
ETAG_KEY
,
""
).
split
(
","
)));
}
}
private
void
loadJSON
(
String
jsonString
)
throws
Exception
{
private
void
loadJSON
(
String
jsonString
)
throws
Exception
{
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java
View file @
240d1477
...
@@ -42,9 +42,9 @@ public class ProcessRepoZip extends ParallelTask<Void, Void, Boolean> {
...
@@ -42,9 +42,9 @@ public class ProcessRepoZip extends ParallelTask<Void, Void, Boolean> {
try
{
try
{
// Create temp file
// Create temp file
File
temp1
=
new
File
(
magiskManager
.
getCacheDir
(),
"1.zip"
);
File
temp1
=
new
File
(
activity
.
getCacheDir
(),
"1.zip"
);
File
temp2
=
new
File
(
magiskManager
.
getCacheDir
(),
"2.zip"
);
File
temp2
=
new
File
(
activity
.
getCacheDir
(),
"2.zip"
);
magiskManager
.
getCacheDir
().
mkdirs
();
activity
.
getCacheDir
().
mkdirs
();
temp1
.
createNewFile
();
temp1
.
createNewFile
();
temp2
.
createNewFile
();
temp2
.
createNewFile
();
...
@@ -87,7 +87,7 @@ public class ProcessRepoZip extends ParallelTask<Void, Void, Boolean> {
...
@@ -87,7 +87,7 @@ public class ProcessRepoZip extends ParallelTask<Void, Void, Boolean> {
progressDialog
.
dismiss
();
progressDialog
.
dismiss
();
if
(
result
)
{
if
(
result
)
{
if
(
Shell
.
rootAccess
()
&&
mInstall
)
{
if
(
Shell
.
rootAccess
()
&&
mInstall
)
{
magiskManager
.
startActivity
(
new
Intent
(
magiskManager
,
FlashActivity
.
class
).
setData
(
mUri
));
activity
.
startActivity
(
new
Intent
(
activity
,
FlashActivity
.
class
).
setData
(
mUri
));
}
else
{
}
else
{
Utils
.
showUriSnack
(
activity
,
mUri
);
Utils
.
showUriSnack
(
activity
,
mUri
);
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/services/UpdateCheckService.java
View file @
240d1477
...
@@ -4,24 +4,15 @@ import android.app.job.JobParameters;
...
@@ -4,24 +4,15 @@ import android.app.job.JobParameters;
import
android.app.job.JobService
;
import
android.app.job.JobService
;
import
com.topjohnwu.magisk.asyncs.CheckUpdates
;
import
com.topjohnwu.magisk.asyncs.CheckUpdates
;
import
com.topjohnwu.magisk.utils.Utils
;
public
class
UpdateCheckService
extends
JobService
{
public
class
UpdateCheckService
extends
JobService
{
@Override
@Override
public
boolean
onStartJob
(
JobParameters
params
)
{
public
boolean
onStartJob
(
JobParameters
params
)
{
new
CheckUpdates
(
this
,
true
){
Utils
.
getMagiskManager
(
this
).
updateMagiskInfo
();
@Override
new
CheckUpdates
(
this
,
true
)
protected
Void
doInBackground
(
Void
...
voids
)
{
.
setCallBack
(()
->
jobFinished
(
params
,
false
)).
exec
();
magiskManager
.
updateMagiskInfo
();
magiskManager
.
updateNotification
=
magiskManager
.
prefs
.
getBoolean
(
"notification"
,
true
);
return
super
.
doInBackground
(
voids
);
}
@Override
protected
void
onPostExecute
(
Void
v
)
{
jobFinished
(
params
,
false
);
super
.
onPostExecute
(
v
);
}
}.
exec
();
return
true
;
return
true
;
}
}
...
...
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