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
ab7fd979
Commit
ab7fd979
authored
Sep 30, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove cache module exception
parent
f6bcc842
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
37 deletions
+21
-37
LoadModules.java
...rc/main/java/com/topjohnwu/magisk/asyncs/LoadModules.java
+2
-4
UpdateRepos.java
...rc/main/java/com/topjohnwu/magisk/asyncs/UpdateRepos.java
+13
-15
BaseModule.java
.../main/java/com/topjohnwu/magisk/container/BaseModule.java
+2
-11
Module.java
app/src/main/java/com/topjohnwu/magisk/container/Module.java
+1
-3
Repo.java
app/src/main/java/com/topjohnwu/magisk/container/Repo.java
+3
-4
No files found.
app/src/main/java/com/topjohnwu/magisk/asyncs/LoadModules.java
View file @
ab7fd979
...
...
@@ -25,10 +25,8 @@ public class LoadModules extends ParallelTask<Void, Void, Void> {
for
(
String
path
:
Utils
.
getModList
(
getShell
(),
MagiskManager
.
MAGISK_PATH
))
{
Logger
.
dev
(
"LoadModules: Adding modules from "
+
path
);
try
{
Module
module
=
new
Module
(
getShell
(),
path
);
mm
.
moduleMap
.
put
(
module
.
getId
(),
module
);
}
catch
(
BaseModule
.
CacheModException
ignored
)
{}
}
Logger
.
dev
(
"LoadModules: Data load done"
);
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/UpdateRepos.java
View file @
ab7fd979
...
...
@@ -68,7 +68,6 @@ public class UpdateRepos extends ParallelTask<Void, Void, Void> {
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss'Z'"
,
Locale
.
US
);
Date
updatedDate
=
format
.
parse
(
lastUpdate
);
Repo
repo
=
repoDB
.
getRepo
(
id
);
try
{
Boolean
updated
;
if
(
repo
==
null
)
{
repo
=
new
Repo
(
name
,
updatedDate
);
...
...
@@ -82,7 +81,6 @@ public class UpdateRepos extends ParallelTask<Void, Void, Void> {
repoDB
.
addRepo
(
repo
);
publishProgress
();
}
}
catch
(
BaseModule
.
CacheModException
ignored
)
{}
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java
View file @
ab7fd979
...
...
@@ -38,9 +38,9 @@ public abstract class BaseModule implements Comparable<BaseModule> {
return
values
;
}
protected
void
parseProps
(
List
<
String
>
props
)
throws
CacheModException
{
parseProps
(
props
.
toArray
(
new
String
[
0
]));
}
protected
void
parseProps
(
List
<
String
>
props
)
{
parseProps
(
props
.
toArray
(
new
String
[
0
]));
}
protected
void
parseProps
(
String
[]
props
)
throws
CacheModException
{
protected
void
parseProps
(
String
[]
props
)
{
for
(
String
line
:
props
)
{
String
[]
prop
=
line
.
split
(
"="
,
2
);
if
(
prop
.
length
!=
2
)
...
...
@@ -75,9 +75,6 @@ public abstract class BaseModule implements Comparable<BaseModule> {
try
{
templateVersion
=
Integer
.
parseInt
(
prop
[
1
]);
}
catch
(
NumberFormatException
ignored
)
{}
case
"cacheModule"
:
if
(
Boolean
.
parseBoolean
(
prop
[
1
]))
throw
new
CacheModException
(
mId
);
break
;
default
:
break
;
...
...
@@ -121,12 +118,6 @@ public abstract class BaseModule implements Comparable<BaseModule> {
return
templateVersion
;
}
public
static
class
CacheModException
extends
Exception
{
public
CacheModException
(
String
id
)
{
Logger
.
error
(
"Cache mods are no longer supported! id: "
+
id
);
}
}
@Override
public
int
compareTo
(
@NonNull
BaseModule
module
)
{
return
this
.
getName
().
toLowerCase
().
compareTo
(
module
.
getName
().
toLowerCase
());
...
...
app/src/main/java/com/topjohnwu/magisk/container/Module.java
View file @
ab7fd979
...
...
@@ -9,7 +9,7 @@ public class Module extends BaseModule {
private
String
mRemoveFile
,
mDisableFile
,
mUpdateFile
;
private
boolean
mEnable
,
mRemove
,
mUpdated
;
public
Module
(
Shell
shell
,
String
path
)
throws
CacheModException
{
public
Module
(
Shell
shell
,
String
path
)
{
parseProps
(
Utils
.
readFile
(
shell
,
path
+
"/module.prop"
));
...
...
@@ -26,8 +26,6 @@ public class Module extends BaseModule {
setName
(
getId
());
}
Logger
.
dev
(
"Creating Module, id: "
+
getId
());
mEnable
=
!
Utils
.
itemExist
(
shell
,
mDisableFile
);
mRemove
=
Utils
.
itemExist
(
shell
,
mRemoveFile
);
mUpdated
=
Utils
.
itemExist
(
shell
,
mUpdateFile
);
...
...
app/src/main/java/com/topjohnwu/magisk/container/Repo.java
View file @
ab7fd979
...
...
@@ -16,7 +16,7 @@ public class Repo extends BaseModule {
private
String
repoName
;
private
Date
mLastUpdate
;
public
Repo
(
String
name
,
Date
lastUpdate
)
throws
CacheModException
{
public
Repo
(
String
name
,
Date
lastUpdate
)
{
mLastUpdate
=
lastUpdate
;
repoName
=
name
;
update
();
...
...
@@ -28,14 +28,13 @@ public class Repo extends BaseModule {
mLastUpdate
=
new
Date
(
c
.
getLong
(
c
.
getColumnIndex
(
"last_update"
)));
}
public
void
update
()
throws
CacheModException
{
public
void
update
()
{
String
props
=
WebService
.
getString
(
getManifestUrl
());
String
lines
[]
=
props
.
split
(
"\\n"
);
parseProps
(
lines
);
Logger
.
dev
(
"Repo: Fetching prop: "
+
getId
());
}
public
boolean
update
(
Date
lastUpdate
)
throws
CacheModException
{
public
boolean
update
(
Date
lastUpdate
)
{
if
(
lastUpdate
.
after
(
mLastUpdate
))
{
mLastUpdate
=
lastUpdate
;
update
();
...
...
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