| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 { | 172 { |
| 173 Log.d(TAG, "Adding filters for '" + s.getId() + "'"); | 173 Log.d(TAG, "Adding filters for '" + s.getId() + "'"); |
| 174 s.clearFilters(); | 174 s.clearFilters(); |
| 175 s.deserializeFilters(this.getFiltersFile(s)); | 175 s.deserializeFilters(this.getFiltersFile(s)); |
| 176 s.getFilters(filters); | 176 s.getFilters(filters); |
| 177 s.clearFilters(); | 177 s.clearFilters(); |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 final BufferedWriter w = new BufferedWriter( | 181 final BufferedWriter w = new BufferedWriter( |
| 182 new OutputStreamWriter(new FileOutputStream(output), "UTF-8")); | 182 new OutputStreamWriter(new FileOutputStream(output), Engine.CHARSET_UTF_
8)); |
| 183 try | 183 try |
| 184 { | 184 { |
| 185 Log.d(TAG, "Writing " + filters.size() + " filters"); | 185 Log.d(TAG, "Writing " + filters.size() + " filters"); |
| 186 Engine.writeFilterHeaders(w); | 186 Engine.writeFilterHeaders(w); |
| 187 for (final String filter : filters) | 187 for (final String filter : filters) |
| 188 { | 188 { |
| 189 w.write(filter); | 189 w.write(filter); |
| 190 w.write('\n'); | 190 w.write('\n'); |
| 191 } | 191 } |
| 192 } | 192 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (sub != null) | 269 if (sub != null) |
| 270 { | 270 { |
| 271 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi
le(sub), | 271 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi
le(sub), |
| 272 this.getFiltersFile(sub))) | 272 this.getFiltersFile(sub))) |
| 273 { | 273 { |
| 274 this.engine.requestUpdateBroadcast(); | 274 this.engine.requestUpdateBroadcast(); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 } | 278 } |
| OLD | NEW |