Add nativecode to database

This commit is contained in:
Daniel Martí 2013-08-27 18:05:31 +02:00
parent cb83f6991d
commit d4a7247629
2 changed files with 12 additions and 5 deletions

View File

@ -253,7 +253,8 @@ public class DB {
+ "vercode int not null," + "apkName text not null, "
+ "size int not null," + "sig string," + "srcname string,"
+ "minSdkVersion integer," + "permissions string,"
+ "features string," + "hashType string," + "added string,"
+ "features string," + "nativecode string,"
+ "hashType string," + "added string,"
+ "compatible int not null," + "primary key(id,vercode));";
public static class Apk {
@ -282,6 +283,8 @@ public class DB {
// unknown
public CommaSeparatedList features; // null if empty or unknown
public CommaSeparatedList nativecode; // null if empty or unknown
// ID (md5 sum of public key) of signature. Might be null, in the
// transition to this field existing.
public String sig;
@ -387,7 +390,7 @@ public class DB {
public String lastetag; // last etag we updated from, null forces update
}
private final int DBVersion = 22;
private final int DBVersion = 23;
private static void createAppApk(SQLiteDatabase db) {
db.execSQL(CREATE_TABLE_APP);
@ -775,7 +778,7 @@ public class DB {
+ (System.currentTimeMillis() - startTime) + " ms)");
cols = new String[] { "id", "version", "vercode", "sig", "srcname",
"apkName", "minSdkVersion", "added", "features",
"apkName", "minSdkVersion", "added", "features", "nativecode",
"compatible", "repo" };
c = db.query(TABLE_APK, cols, null, null, null, null,
"vercode desc");
@ -793,8 +796,9 @@ public class DB {
apk.added = (sApkAdded == null || sApkAdded.length() == 0) ? null
: mDateFormat.parse(sApkAdded);
apk.features = CommaSeparatedList.make(c.getString(8));
apk.compatible = c.getInt(9) == 1;
apk.repo = c.getInt(10);
apk.nativecode = CommaSeparatedList.make(c.getString(9));
apk.compatible = c.getInt(10) == 1;
apk.repo = c.getInt(11);
apps.get(apk.id).apks.add(apk);
c.moveToNext();
}
@ -1251,6 +1255,7 @@ public class DB {
values.put("permissions",
CommaSeparatedList.str(upapk.detail_permissions));
values.put("features", CommaSeparatedList.str(upapk.features));
values.put("nativecode", CommaSeparatedList.str(upapk.nativecode));
values.put("compatible", upapk.compatible ? 1 : 0);
if (oldapk != null) {
db.update(TABLE_APK, values,

View File

@ -178,6 +178,8 @@ public class RepoXMLHandler extends DefaultHandler {
curapk.detail_permissions = DB.CommaSeparatedList.make(str);
} else if (curel.equals("features")) {
curapk.features = DB.CommaSeparatedList.make(str);
} else if (curel.equals("nativecode")) {
curapk.nativecode = DB.CommaSeparatedList.make(str);
}
} else if (curapp != null && str != null) {
if (curel.equals("id")) {