mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-16 13:01:25 +00:00
Don't care minMagiskVersion
It will be sanitized by magiskbot anyways
This commit is contained in:
parent
3eae9494ce
commit
d22c7de79a
@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||||
|
|
||||||
private String mId, mName, mVersion, mAuthor, mDescription;
|
private String mId, mName, mVersion, mAuthor, mDescription;
|
||||||
private int mVersionCode = -1, minMagiskVersion = -1;
|
private int mVersionCode = -1;
|
||||||
|
|
||||||
protected BaseModule() {
|
protected BaseModule() {
|
||||||
mId = mName = mVersion = mAuthor = mDescription = "";
|
mId = mName = mVersion = mAuthor = mDescription = "";
|
||||||
@ -25,7 +25,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
|||||||
mVersionCode = c.getInt(c.getColumnIndex("versionCode"));
|
mVersionCode = c.getInt(c.getColumnIndex("versionCode"));
|
||||||
mAuthor = nonNull(c.getString(c.getColumnIndex("author")));
|
mAuthor = nonNull(c.getString(c.getColumnIndex("author")));
|
||||||
mDescription = nonNull(c.getString(c.getColumnIndex("description")));
|
mDescription = nonNull(c.getString(c.getColumnIndex("description")));
|
||||||
minMagiskVersion = c.getInt(c.getColumnIndex("minMagisk"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BaseModule(Parcel p) {
|
protected BaseModule(Parcel p) {
|
||||||
@ -35,7 +34,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
|||||||
mAuthor = p.readString();
|
mAuthor = p.readString();
|
||||||
mDescription = p.readString();
|
mDescription = p.readString();
|
||||||
mVersionCode = p.readInt();
|
mVersionCode = p.readInt();
|
||||||
minMagiskVersion = p.readInt();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -56,7 +54,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
|||||||
dest.writeString(mAuthor);
|
dest.writeString(mAuthor);
|
||||||
dest.writeString(mDescription);
|
dest.writeString(mDescription);
|
||||||
dest.writeInt(mVersionCode);
|
dest.writeInt(mVersionCode);
|
||||||
dest.writeInt(minMagiskVersion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String nonNull(String s) {
|
private String nonNull(String s) {
|
||||||
@ -71,7 +68,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
|||||||
values.put("versionCode", mVersionCode);
|
values.put("versionCode", mVersionCode);
|
||||||
values.put("author", mAuthor);
|
values.put("author", mAuthor);
|
||||||
values.put("description", mDescription);
|
values.put("description", mDescription);
|
||||||
values.put("minMagisk", minMagiskVersion);
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,10 +103,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
|||||||
case "description":
|
case "description":
|
||||||
mDescription = value;
|
mDescription = value;
|
||||||
break;
|
break;
|
||||||
case "minMagisk":
|
|
||||||
case "template":
|
|
||||||
minMagiskVersion = Integer.parseInt(value);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -149,7 +141,4 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
|||||||
return mVersionCode;
|
return mVersionCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMinMagiskVersion() {
|
|
||||||
return minMagiskVersion;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import android.os.Parcel;
|
|||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.Const;
|
import com.topjohnwu.magisk.Const;
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
import com.topjohnwu.net.Networking;
|
import com.topjohnwu.net.Networking;
|
||||||
import com.topjohnwu.net.Request;
|
import com.topjohnwu.net.Request;
|
||||||
@ -62,9 +61,6 @@ public class Repo extends BaseModule {
|
|||||||
if (getVersionCode() < 0) {
|
if (getVersionCode() < 0) {
|
||||||
throw new IllegalRepoException("Repo [" + getId() + "] does not contain versionCode");
|
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 {
|
public void update(Date lastUpdate) throws IllegalRepoException {
|
||||||
|
@ -6,7 +6,6 @@ import android.database.sqlite.SQLiteDatabase;
|
|||||||
import android.database.sqlite.SQLiteOpenHelper;
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.Config;
|
import com.topjohnwu.magisk.Config;
|
||||||
import com.topjohnwu.magisk.Const;
|
|
||||||
import com.topjohnwu.magisk.container.Repo;
|
import com.topjohnwu.magisk.container.Repo;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -14,7 +13,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
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 static final String TABLE_NAME = "repos";
|
||||||
|
|
||||||
private SQLiteDatabase mDb;
|
private SQLiteDatabase mDb;
|
||||||
@ -22,9 +21,6 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
public RepoDatabaseHelper(Context context) {
|
public RepoDatabaseHelper(Context context) {
|
||||||
super(context, "repo.db", null, DATABASE_VER);
|
super(context, "repo.db", null, DATABASE_VER);
|
||||||
mDb = getWritableDatabase();
|
mDb = getWritableDatabase();
|
||||||
|
|
||||||
// Remove outdated repos
|
|
||||||
mDb.delete(TABLE_NAME, "minMagisk<?", new String[] { String.valueOf(Const.MIN_MODULE_VER) });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -39,7 +35,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
|
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
|
||||||
db.execSQL(
|
db.execSQL(
|
||||||
"CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " " +
|
"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))");
|
"author TEXT, description TEXT, last_update INT, PRIMARY KEY(id))");
|
||||||
Config.remove(Config.Key.ETAG_KEY);
|
Config.remove(Config.Key.ETAG_KEY);
|
||||||
}
|
}
|
||||||
@ -96,9 +92,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
case Config.Value.ORDER_DATE:
|
case Config.Value.ORDER_DATE:
|
||||||
orderBy = "last_update DESC";
|
orderBy = "last_update DESC";
|
||||||
}
|
}
|
||||||
return mDb.query(TABLE_NAME, null, "minMagisk<=? AND minMagisk>=?",
|
return mDb.query(TABLE_NAME, null, null, null, null, null, orderBy);
|
||||||
new String[] { String.valueOf(Config.magiskVersionCode), String.valueOf(Const.MIN_MODULE_VER) },
|
|
||||||
null, null, orderBy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getRepoIDSet() {
|
public Set<String> getRepoIDSet() {
|
||||||
|
@ -17,7 +17,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools:r8:1.4.72'
|
classpath 'com.android.tools:r8:1.4.72'
|
||||||
classpath 'com.android.tools.build:gradle:3.5.0-alpha08'
|
classpath 'com.android.tools.build:gradle:3.5.0-alpha09'
|
||||||
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
Loading…
x
Reference in New Issue
Block a user