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
d22c7de7
Commit
d22c7de7
authored
Mar 29, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't care minMagiskVersion
It will be sanitized by magiskbot anyways
parent
3eae9494
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
26 deletions
+5
-26
BaseModule.java
.../main/java/com/topjohnwu/magisk/container/BaseModule.java
+1
-12
Repo.java
app/src/main/java/com/topjohnwu/magisk/container/Repo.java
+0
-4
RepoDatabaseHelper.java
...ava/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
+3
-9
build.gradle
build.gradle
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java
View file @
d22c7de7
...
...
@@ -12,7 +12,7 @@ import java.util.List;
public
abstract
class
BaseModule
implements
Comparable
<
BaseModule
>,
Parcelable
{
private
String
mId
,
mName
,
mVersion
,
mAuthor
,
mDescription
;
private
int
mVersionCode
=
-
1
,
minMagiskVersion
=
-
1
;
private
int
mVersionCode
=
-
1
;
protected
BaseModule
()
{
mId
=
mName
=
mVersion
=
mAuthor
=
mDescription
=
""
;
...
...
@@ -25,7 +25,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
mVersionCode
=
c
.
getInt
(
c
.
getColumnIndex
(
"versionCode"
));
mAuthor
=
nonNull
(
c
.
getString
(
c
.
getColumnIndex
(
"author"
)));
mDescription
=
nonNull
(
c
.
getString
(
c
.
getColumnIndex
(
"description"
)));
minMagiskVersion
=
c
.
getInt
(
c
.
getColumnIndex
(
"minMagisk"
));
}
protected
BaseModule
(
Parcel
p
)
{
...
...
@@ -35,7 +34,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
mAuthor
=
p
.
readString
();
mDescription
=
p
.
readString
();
mVersionCode
=
p
.
readInt
();
minMagiskVersion
=
p
.
readInt
();
}
@Override
...
...
@@ -56,7 +54,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
dest
.
writeString
(
mAuthor
);
dest
.
writeString
(
mDescription
);
dest
.
writeInt
(
mVersionCode
);
dest
.
writeInt
(
minMagiskVersion
);
}
private
String
nonNull
(
String
s
)
{
...
...
@@ -71,7 +68,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
values
.
put
(
"versionCode"
,
mVersionCode
);
values
.
put
(
"author"
,
mAuthor
);
values
.
put
(
"description"
,
mDescription
);
values
.
put
(
"minMagisk"
,
minMagiskVersion
);
return
values
;
}
...
...
@@ -107,10 +103,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
case
"description"
:
mDescription
=
value
;
break
;
case
"minMagisk"
:
case
"template"
:
minMagiskVersion
=
Integer
.
parseInt
(
value
);
break
;
default
:
break
;
}
...
...
@@ -149,7 +141,4 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
return
mVersionCode
;
}
public
int
getMinMagiskVersion
()
{
return
minMagiskVersion
;
}
}
app/src/main/java/com/topjohnwu/magisk/container/Repo.java
View file @
d22c7de7
...
...
@@ -6,7 +6,6 @@ import android.os.Parcel;
import
android.os.Parcelable
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.net.Request
;
...
...
@@ -62,9 +61,6 @@ public class Repo extends BaseModule {
if
(
getVersionCode
()
<
0
)
{
throw
new
IllegalRepoException
(
"Repo ["
+
getId
()
+
"] does not contain versionCode"
);
}
if
(
getMinMagiskVersion
()
<
Const
.
MIN_MODULE_VER
)
{
Logger
.
debug
(
"Repo ["
+
getId
()
+
"] is outdated"
);
}
}
public
void
update
(
Date
lastUpdate
)
throws
IllegalRepoException
{
...
...
app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
View file @
d22c7de7
...
...
@@ -6,7 +6,6 @@ import android.database.sqlite.SQLiteDatabase;
import
android.database.sqlite.SQLiteOpenHelper
;
import
com.topjohnwu.magisk.Config
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.container.Repo
;
import
java.util.HashSet
;
...
...
@@ -14,7 +13,7 @@ import java.util.Set;
public
class
RepoDatabaseHelper
extends
SQLiteOpenHelper
{
private
static
final
int
DATABASE_VER
=
4
;
private
static
final
int
DATABASE_VER
=
5
;
private
static
final
String
TABLE_NAME
=
"repos"
;
private
SQLiteDatabase
mDb
;
...
...
@@ -22,9 +21,6 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
public
RepoDatabaseHelper
(
Context
context
)
{
super
(
context
,
"repo.db"
,
null
,
DATABASE_VER
);
mDb
=
getWritableDatabase
();
// Remove outdated repos
mDb
.
delete
(
TABLE_NAME
,
"minMagisk<?"
,
new
String
[]
{
String
.
valueOf
(
Const
.
MIN_MODULE_VER
)
});
}
@Override
...
...
@@ -39,7 +35,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
db
.
execSQL
(
"DROP TABLE IF EXISTS "
+
TABLE_NAME
);
db
.
execSQL
(
"CREATE TABLE IF NOT EXISTS "
+
TABLE_NAME
+
" "
+
"(id TEXT, name TEXT, version TEXT, versionCode INT,
minMagisk INT,
"
+
"(id TEXT, name TEXT, version TEXT, versionCode INT, "
+
"author TEXT, description TEXT, last_update INT, PRIMARY KEY(id))"
);
Config
.
remove
(
Config
.
Key
.
ETAG_KEY
);
}
...
...
@@ -96,9 +92,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
case
Config
.
Value
.
ORDER_DATE
:
orderBy
=
"last_update DESC"
;
}
return
mDb
.
query
(
TABLE_NAME
,
null
,
"minMagisk<=? AND minMagisk>=?"
,
new
String
[]
{
String
.
valueOf
(
Config
.
magiskVersionCode
),
String
.
valueOf
(
Const
.
MIN_MODULE_VER
)
},
null
,
null
,
orderBy
);
return
mDb
.
query
(
TABLE_NAME
,
null
,
null
,
null
,
null
,
null
,
orderBy
);
}
public
Set
<
String
>
getRepoIDSet
()
{
...
...
build.gradle
View file @
d22c7de7
...
...
@@ -17,7 +17,7 @@ buildscript {
}
dependencies
{
classpath
'com.android.tools:r8:1.4.72'
classpath
'com.android.tools.build:gradle:3.5.0-alpha0
8
'
classpath
'com.android.tools.build:gradle:3.5.0-alpha0
9
'
// NOTE: Do not place your application dependencies here; they belong
...
...
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