Some versioning fixes

This commit is contained in:
topjohnwu 2017-09-06 22:32:40 +08:00
parent 2592cb6019
commit df21539311
3 changed files with 8 additions and 4 deletions

View File

@ -15,8 +15,8 @@ import java.io.InputStream;
public class DownloadBusybox extends ParallelTask<Void, Void, Void> { public class DownloadBusybox extends ParallelTask<Void, Void, Void> {
private static final String BUSYBOX_ARM = "https://github.com/topjohnwu/ndk-busybox/releases/download/1.27.1/busybox-arm"; private static final String BUSYBOX_ARM = "https://github.com/topjohnwu/ndk-busybox/releases/download/1.27.2/busybox-arm";
private static final String BUSYBOX_X86 = "https://github.com/topjohnwu/ndk-busybox/releases/download/1.27.1/busybox-x86"; private static final String BUSYBOX_X86 = "https://github.com/topjohnwu/ndk-busybox/releases/download/1.27.2/busybox-x86";
private File busybox; private File busybox;

View File

@ -5,8 +5,10 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteOpenHelper;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.module.Repo; import com.topjohnwu.magisk.module.Repo;
import com.topjohnwu.magisk.utils.Logger; import com.topjohnwu.magisk.utils.Logger;
import com.topjohnwu.magisk.utils.Utils;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -18,10 +20,12 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
private static final int MIN_TEMPLATE_VER = 3; private static final int MIN_TEMPLATE_VER = 3;
private SQLiteDatabase mDb; private SQLiteDatabase mDb;
private MagiskManager mm;
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();
mm = Utils.getMagiskManager(context);
} }
@Override @Override
@ -70,7 +74,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
} }
public Cursor getRepoCursor() { public Cursor getRepoCursor() {
return mDb.query(TABLE_NAME, null, "template>=?", new String[] { String.valueOf(MIN_TEMPLATE_VER) }, null, null, "name COLLATE NOCASE"); return mDb.query(TABLE_NAME, null, "template>=? AND template<=?", new String[] { String.valueOf(MIN_TEMPLATE_VER), String.valueOf(mm.magiskVersionCode) }, null, null, "name COLLATE NOCASE");
} }
public List<String> getRepoIDList() { public List<String> getRepoIDList() {

View File

@ -350,7 +350,7 @@ public class Utils {
DownloadReceiver receiver = null; DownloadReceiver receiver = null;
switch (idx) { switch (idx) {
case 1: case 1:
if (mm.remoteMagiskVersionCode < 1370) { if (mm.remoteMagiskVersionCode < 1400) {
mm.toast(R.string.no_boot_file_patch_support, Toast.LENGTH_LONG); mm.toast(R.string.no_boot_file_patch_support, Toast.LENGTH_LONG);
return; return;
} }