Commit d22c7de7 authored by topjohnwu's avatar topjohnwu

Don't care minMagiskVersion

It will be sanitized by magiskbot anyways
parent 3eae9494
......@@ -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;
}
}
......@@ -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 {
......
......@@ -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() {
......
......@@ -17,7 +17,7 @@ buildscript {
}
dependencies {
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment