mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 09:17:50 +00:00
Remove unnecessary empty lines
This commit is contained in:
parent
c91f809eba
commit
9c63e31da6
@ -93,12 +93,10 @@ public class MagiskDB {
|
|||||||
rawSQL("DELETE FROM %s WHERE package_name=\"%s\"", POLICY_TABLE, pkg);
|
rawSQL("DELETE FROM %s WHERE package_name=\"%s\"", POLICY_TABLE, pkg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void deletePolicy(int uid) {
|
public void deletePolicy(int uid) {
|
||||||
rawSQL("DELETE FROM %s WHERE uid=%d", POLICY_TABLE, uid);
|
rawSQL("DELETE FROM %s WHERE uid=%d", POLICY_TABLE, uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Policy getPolicy(int uid) {
|
public Policy getPolicy(int uid) {
|
||||||
List<ContentValues> res =
|
List<ContentValues> res =
|
||||||
SQL("SELECT * FROM %s WHERE uid=%d", POLICY_TABLE, uid);
|
SQL("SELECT * FROM %s WHERE uid=%d", POLICY_TABLE, uid);
|
||||||
@ -112,12 +110,10 @@ public class MagiskDB {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updatePolicy(Policy policy) {
|
public void updatePolicy(Policy policy) {
|
||||||
rawSQL("REPLACE INTO %s %s", POLICY_TABLE, toSQL(policy.getContentValues()));
|
rawSQL("REPLACE INTO %s %s", POLICY_TABLE, toSQL(policy.getContentValues()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Policy> getPolicyList() {
|
public List<Policy> getPolicyList() {
|
||||||
List<Policy> list = new ArrayList<>();
|
List<Policy> list = new ArrayList<>();
|
||||||
for (ContentValues values : SQL("SELECT * FROM %s WHERE uid/100000=%d", POLICY_TABLE, Const.USER_ID)) {
|
for (ContentValues values : SQL("SELECT * FROM %s WHERE uid/100000=%d", POLICY_TABLE, Const.USER_ID)) {
|
||||||
@ -131,7 +127,6 @@ public class MagiskDB {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<List<SuLogEntry>> getLogs() {
|
public List<List<SuLogEntry>> getLogs() {
|
||||||
List<List<SuLogEntry>> ret = new ArrayList<>();
|
List<List<SuLogEntry>> ret = new ArrayList<>();
|
||||||
List<SuLogEntry> list = null;
|
List<SuLogEntry> list = null;
|
||||||
@ -149,17 +144,14 @@ public class MagiskDB {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addLog(SuLogEntry log) {
|
public void addLog(SuLogEntry log) {
|
||||||
rawSQL("INSERT INTO %s %s", LOG_TABLE, toSQL(log.getContentValues()));
|
rawSQL("INSERT INTO %s %s", LOG_TABLE, toSQL(log.getContentValues()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void clearLogs() {
|
public void clearLogs() {
|
||||||
rawSQL("DELETE FROM %s", LOG_TABLE);
|
rawSQL("DELETE FROM %s", LOG_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSettings(String key, int value) {
|
public void setSettings(String key, int value) {
|
||||||
ContentValues data = new ContentValues();
|
ContentValues data = new ContentValues();
|
||||||
data.put("key", key);
|
data.put("key", key);
|
||||||
@ -167,7 +159,6 @@ public class MagiskDB {
|
|||||||
rawSQL("REPLACE INTO %s %s", SETTINGS_TABLE, toSQL(data));
|
rawSQL("REPLACE INTO %s %s", SETTINGS_TABLE, toSQL(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getSettings(String key, int defaultValue) {
|
public int getSettings(String key, int defaultValue) {
|
||||||
List<ContentValues> res = SQL("SELECT value FROM %s WHERE key=\"%s\"", SETTINGS_TABLE, key);
|
List<ContentValues> res = SQL("SELECT value FROM %s WHERE key=\"%s\"", SETTINGS_TABLE, key);
|
||||||
if (res.isEmpty())
|
if (res.isEmpty())
|
||||||
@ -175,7 +166,6 @@ public class MagiskDB {
|
|||||||
return res.get(0).getAsInteger("value");
|
return res.get(0).getAsInteger("value");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setStrings(String key, String value) {
|
public void setStrings(String key, String value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
rawSQL("DELETE FROM %s WHERE key=\"%s\"", STRINGS_TABLE, key);
|
rawSQL("DELETE FROM %s WHERE key=\"%s\"", STRINGS_TABLE, key);
|
||||||
@ -187,7 +177,6 @@ public class MagiskDB {
|
|||||||
rawSQL("REPLACE INTO %s %s", STRINGS_TABLE, toSQL(data));
|
rawSQL("REPLACE INTO %s %s", STRINGS_TABLE, toSQL(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getStrings(String key, String defaultValue) {
|
public String getStrings(String key, String defaultValue) {
|
||||||
List<ContentValues> res = SQL("SELECT value FROM %s WHERE key=\"%s\"", STRINGS_TABLE, key);
|
List<ContentValues> res = SQL("SELECT value FROM %s WHERE key=\"%s\"", STRINGS_TABLE, key);
|
||||||
if (res.isEmpty())
|
if (res.isEmpty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user