Commit 0d952792 authored by topjohnwu's avatar topjohnwu

Fix su time limits

parent f0e4aec0
......@@ -222,11 +222,11 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
"(key TEXT, value INT, PRIMARY KEY(key))");
}
private void cleanup() {
public void cleanup() {
// Clear outdated policies
mDb.delete(POLICY_TABLE, Utils.fmt("until > 0 AND until < ?", System.currentTimeMillis() / 1000), null);
mDb.delete(POLICY_TABLE, Utils.fmt("until > 0 AND until < %d", System.currentTimeMillis() / 1000), null);
// Clear outdated logs
mDb.delete(LOG_TABLE, Utils.fmt("time < ?", System.currentTimeMillis() - MagiskManager.get().suLogTimeout * 86400000), null);
mDb.delete(LOG_TABLE, Utils.fmt("time < %d", System.currentTimeMillis() - MagiskManager.get().suLogTimeout * 86400000), null);
}
public void deletePolicy(Policy policy) {
......
......@@ -62,6 +62,7 @@ public class RequestActivity extends Activity {
pm = getPackageManager();
mm = Utils.getMagiskManager(this);
mm.suDB.cleanup();
Intent intent = getIntent();
socketPath = intent.getStringExtra("socket");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment