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 dd24d822c..53aa5a10b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java +++ b/app/src/main/java/com/topjohnwu/magisk/container/BaseModule.java @@ -1,6 +1,7 @@ package com.topjohnwu.magisk.container; +import android.content.ContentValues; import android.database.Cursor; import android.support.annotation.NonNull; @@ -25,7 +26,19 @@ public abstract class BaseModule implements Comparable { templateVersion = c.getInt(c.getColumnIndex("template")); } - protected void parseProps(List props) throws CacheModException { parseProps(props.toArray(new String[props.size()])); } + public ContentValues getContentValues() { + ContentValues values = new ContentValues(); + values.put("id", mId); + values.put("name", mName); + values.put("version", mVersion); + values.put("versionCode", mVersionCode); + values.put("author", mAuthor); + values.put("description", mDescription); + values.put("template", templateVersion); + return values; + } + + protected void parseProps(List props) throws CacheModException { parseProps(props.toArray(new String[0])); } protected void parseProps(String[] props) throws CacheModException { for (String line : props) { 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 eb501a348..2db9f6b3c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/container/Repo.java +++ b/app/src/main/java/com/topjohnwu/magisk/container/Repo.java @@ -45,16 +45,9 @@ public class Repo extends BaseModule { } public ContentValues getContentValues() { - ContentValues values = new ContentValues(); - values.put("id", getId()); - values.put("name", getName()); - values.put("version", getVersion()); - values.put("versionCode", getVersionCode()); - values.put("author", getAuthor()); - values.put("description", getDescription()); + ContentValues values = super.getContentValues(); values.put("repo_name", repoName); values.put("last_update", mLastUpdate.getTime()); - values.put("template", getTemplateVersion()); return values; }