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
ce2e6b7d
Commit
ce2e6b7d
authored
Apr 07, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent outdated modules to be shown
parent
684c5d22
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
7 deletions
+11
-7
MagiskManager.java
src/main/java/com/topjohnwu/magisk/MagiskManager.java
+2
-3
SplashActivity.java
src/main/java/com/topjohnwu/magisk/SplashActivity.java
+2
-0
Repo.java
src/main/java/com/topjohnwu/magisk/container/Repo.java
+1
-1
RepoDatabaseHelper.java
...ava/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
+2
-2
Const.java
src/main/java/com/topjohnwu/magisk/utils/Const.java
+4
-1
No files found.
src/main/java/com/topjohnwu/magisk/MagiskManager.java
View file @
ce2e6b7d
...
@@ -106,9 +106,9 @@ public class MagiskManager extends Shell.ContainerApp {
...
@@ -106,9 +106,9 @@ public class MagiskManager extends Shell.ContainerApp {
@Override
@Override
public
void
onRootShellInit
(
@NonNull
Shell
shell
)
{
public
void
onRootShellInit
(
@NonNull
Shell
shell
)
{
try
(
InputStream
utils
=
getAssets
().
open
(
Const
.
UTIL_FUNCTIONS
);
try
(
InputStream
utils
=
getAssets
().
open
(
Const
.
UTIL_FUNCTIONS
);
InputStream
sudb
=
getResources
().
openRawResource
(
R
.
raw
.
magiskdb
))
{
InputStream
magiskDB
=
getResources
().
openRawResource
(
R
.
raw
.
magiskdb
))
{
shell
.
loadInputStream
(
null
,
null
,
utils
);
shell
.
loadInputStream
(
null
,
null
,
utils
);
shell
.
loadInputStream
(
null
,
null
,
sudb
);
shell
.
loadInputStream
(
null
,
null
,
magiskDB
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -140,7 +140,6 @@ public class MagiskManager extends Shell.ContainerApp {
...
@@ -140,7 +140,6 @@ public class MagiskManager extends Shell.ContainerApp {
mDB
=
MagiskDatabaseHelper
.
getInstance
(
this
);
mDB
=
MagiskDatabaseHelper
.
getInstance
(
this
);
}
}
repoDB
=
new
RepoDatabaseHelper
(
this
);
defaultLocale
=
Locale
.
getDefault
();
defaultLocale
=
Locale
.
getDefault
();
setLocale
();
setLocale
();
loadConfig
();
loadConfig
();
...
...
src/main/java/com/topjohnwu/magisk/SplashActivity.java
View file @
ce2e6b7d
...
@@ -11,6 +11,7 @@ import com.topjohnwu.magisk.asyncs.LoadModules;
...
@@ -11,6 +11,7 @@ import com.topjohnwu.magisk.asyncs.LoadModules;
import
com.topjohnwu.magisk.asyncs.ParallelTask
;
import
com.topjohnwu.magisk.asyncs.ParallelTask
;
import
com.topjohnwu.magisk.asyncs.UpdateRepos
;
import
com.topjohnwu.magisk.asyncs.UpdateRepos
;
import
com.topjohnwu.magisk.components.Activity
;
import
com.topjohnwu.magisk.components.Activity
;
import
com.topjohnwu.magisk.database.RepoDatabaseHelper
;
import
com.topjohnwu.magisk.receivers.ShortcutReceiver
;
import
com.topjohnwu.magisk.receivers.ShortcutReceiver
;
import
com.topjohnwu.magisk.utils.Const
;
import
com.topjohnwu.magisk.utils.Const
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
...
@@ -24,6 +25,7 @@ public class SplashActivity extends Activity {
...
@@ -24,6 +25,7 @@ public class SplashActivity extends Activity {
MagiskManager
mm
=
getMagiskManager
();
MagiskManager
mm
=
getMagiskManager
();
mm
.
repoDB
=
new
RepoDatabaseHelper
(
this
);
mm
.
loadMagiskInfo
();
mm
.
loadMagiskInfo
();
mm
.
getDefaultInstallFlags
();
mm
.
getDefaultInstallFlags
();
Utils
.
loadPrefs
();
Utils
.
loadPrefs
();
...
...
src/main/java/com/topjohnwu/magisk/container/Repo.java
View file @
ce2e6b7d
...
@@ -42,7 +42,7 @@ public class Repo extends BaseModule {
...
@@ -42,7 +42,7 @@ public class Repo extends BaseModule {
if
(
getVersionCode
()
<
0
)
{
if
(
getVersionCode
()
<
0
)
{
throw
new
IllegalRepoException
(
"Repo ["
+
repoName
+
"] does not contain versionCode"
);
throw
new
IllegalRepoException
(
"Repo ["
+
repoName
+
"] does not contain versionCode"
);
}
}
if
(
getMinMagiskVersion
()
<
Const
.
MIN_MODULE_VER
)
{
if
(
getMinMagiskVersion
()
<
Const
.
MIN_MODULE_VER
()
)
{
throw
new
IllegalRepoException
(
"Repo ["
+
repoName
+
"] is outdated"
);
throw
new
IllegalRepoException
(
"Repo ["
+
repoName
+
"] is outdated"
);
}
}
}
}
...
...
src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
View file @
ce2e6b7d
...
@@ -26,9 +26,9 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
...
@@ -26,9 +26,9 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
mm
=
Utils
.
getMagiskManager
(
context
);
mm
=
Utils
.
getMagiskManager
(
context
);
mDb
=
getWritableDatabase
();
mDb
=
getWritableDatabase
();
//
Clear ba
d repos
//
Remove outdate
d repos
mDb
.
delete
(
TABLE_NAME
,
"minMagisk<?"
,
mDb
.
delete
(
TABLE_NAME
,
"minMagisk<?"
,
new
String
[]
{
String
.
valueOf
(
Const
.
MIN_MODULE_VER
)
});
new
String
[]
{
String
.
valueOf
(
Const
.
MIN_MODULE_VER
()
)
});
}
}
@Override
@Override
...
...
src/main/java/com/topjohnwu/magisk/utils/Const.java
View file @
ce2e6b7d
...
@@ -36,7 +36,10 @@ public class Const {
...
@@ -36,7 +36,10 @@ public class Const {
// Versions
// Versions
public
static
final
int
UPDATE_SERVICE_VER
=
1
;
public
static
final
int
UPDATE_SERVICE_VER
=
1
;
public
static
final
int
SNET_VER
=
7
;
public
static
final
int
SNET_VER
=
7
;
public
static
final
int
MIN_MODULE_VER
=
1400
;
public
static
int
MIN_MODULE_VER
()
{
return
MagiskManager
.
get
().
magiskVersionCode
>=
1630
?
1500
:
1400
;
}
public
synchronized
static
SuFile
MAGISK_PATH
()
{
public
synchronized
static
SuFile
MAGISK_PATH
()
{
SuFile
file
;
SuFile
file
;
...
...
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