Commit 890866d9 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Don't export whitelist rules

parent 91e42340
......@@ -84,9 +84,15 @@ interface DnsRuleDao {
@Query("SELECT * FROM DnsRule WHERE importedFrom IS NULL ORDER BY host")
fun getAllUserRules():List<DnsRule>
@Query("SELECT * FROM DnsRule WHERE importedFrom IS NULL AND target != '' ORDER BY host")
fun getAllUserRulesWithoutWhitelist():List<DnsRule>
@Query("SELECT * FROM DnsRule WHERE importedFrom IS NOT NULL ORDER BY host LIMIT :limit OFFSET :offset")
fun getAllNonUserRules(offset:Int, limit:Int):List<DnsRule>
@Query("SELECT * FROM DnsRule WHERE importedFrom IS NOT NULL AND target != '' ORDER BY host LIMIT :limit OFFSET :offset")
fun getAllNonUserRulesWithoutWhitelist(offset:Int, limit:Int):List<DnsRule>
@Delete
fun remove(rule:DnsRule)
......
......@@ -151,7 +151,7 @@ class RuleExportService : IntentService("RuleExportService") {
})
updateNotification(0, ruleCount)
if (params.exportUserRules && !isAborted) {
getDatabase().dnsRuleDao().getAllUserRules().forEach {
getDatabase().dnsRuleDao().getAllUserRulesWithoutWhitelist().forEach {
if (!isAborted) {
writtenCount++
writeRule(stream, it)
......@@ -167,7 +167,7 @@ class RuleExportService : IntentService("RuleExportService") {
val limit = 2000
var offset = 0
while (!isAborted && offset < nonUserRuleCount!!) {
getDatabase().dnsRuleDao().getAllNonUserRules(offset, limit).forEach {
getDatabase().dnsRuleDao().getAllNonUserRulesWithoutWhitelist(offset, limit).forEach {
if (!isAborted) {
writtenCount++
writeRule(stream, it)
......
Supports Markdown
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