From d22c7de79a4280097cae4093ad5fe80debf1b592 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 29 Mar 2019 10:25:07 -0400 Subject: [PATCH] Don't care minMagiskVersion It will be sanitized by magiskbot anyways --- .../com/topjohnwu/magisk/container/BaseModule.java | 13 +------------ .../java/com/topjohnwu/magisk/container/Repo.java | 4 ---- .../magisk/database/RepoDatabaseHelper.java | 12 +++--------- build.gradle | 2 +- 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java b/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java index eeb536625..259d1a985 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java +++ b/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java @@ -12,7 +12,7 @@ import java.util.List; public abstract class BaseModule implements Comparable, 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, 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, Parcelable { mAuthor = p.readString(); mDescription = p.readString(); mVersionCode = p.readInt(); - minMagiskVersion = p.readInt(); } @Override @@ -56,7 +54,6 @@ public abstract class BaseModule implements Comparable, 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, 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, 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, Parcelable { return mVersionCode; } - public int getMinMagiskVersion() { - return minMagiskVersion; - } } diff --git a/app/src/main/java/com/topjohnwu/magisk/container/Repo.java b/app/src/main/java/com/topjohnwu/magisk/container/Repo.java index 0f3745b9a..63ffe197a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/Repo.java +++ b/app/src/main/java/com/topjohnwu/magisk/container/Repo.java @@ -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 { diff --git a/app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java b/app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java index 194374f6a..852a2e887 100644 --- a/app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java +++ b/app/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java @@ -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(Config.magiskVersionCode), String.valueOf(Const.MIN_MODULE_VER) }, - null, null, orderBy); + return mDb.query(TABLE_NAME, null, null, null, null, null, orderBy); } public Set getRepoIDSet() { diff --git a/build.gradle b/build.gradle index 435a37a79..d468be969 100644 --- a/build.gradle +++ b/build.gradle @@ -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