Skip to content

Commit

Permalink
Updated version to 2.1.1, fixed utf characters in FF add-on description
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed Dec 24, 2015
1 parent 5097b52 commit 1788ac4
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 63 deletions.
2 changes: 1 addition & 1 deletion Compiler/build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mvn package;

cd deploy;

version="2.1.0"
version="2.1.1"

if [ "$env" = release ]; then

Expand Down
2 changes: 1 addition & 1 deletion Compiler/src/main/java/com/adguard/compiler/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,6 @@ private static void processHtmlFile(File file, Browser browser) throws Exception
IOUtils.closeQuietly(out);
}

FileUtils.writeStringToFile(file, result);
FileUtils.writeStringToFile(file, result, "utf-8");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static Set<String> getScriptRules(File source) throws IOException {
File filtersDir = new File(source, "filters");
for (int filterId = 1; filterId <= 10; filterId++) {
File filterFile = new File(filtersDir, "filter_" + filterId + ".txt");
List<String> lines = FileUtils.readLines(filterFile);
List<String> lines = FileUtils.readLines(filterFile, "utf-8");
for (String line : lines) {
if (line.contains("#%#")) {
scriptRules.add(line.trim());
Expand Down
6 changes: 3 additions & 3 deletions Compiler/src/main/java/com/adguard/compiler/LocaleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static void updateExtensionNameForChromeLocales(File dest, String extensi
IOUtils.closeQuietly(reader);
}

FileUtils.writeStringToFile(chromeLocaleFile, sb.toString());
FileUtils.writeStringToFile(chromeLocaleFile, sb.toString(), "utf-8");
}
}

Expand Down Expand Up @@ -168,7 +168,7 @@ public static void writeLocalesToFirefoxInstallRdf(File dest, String extensionNa
StringBuilder sb = new StringBuilder();
for (SupportedLocales locale : SupportedLocales.values()) {
File localeFile = new File(dest, "locale/" + locale.code.replace("_", "-") + ".properties");
String[] messages = StringUtils.split(FileUtils.readFileToString(localeFile), System.lineSeparator());
String[] messages = StringUtils.split(FileUtils.readFileToString(localeFile, "utf-8"), System.lineSeparator());
String name = findMessage(messages, "name") + extensionNamePostfix;
String description = findMessage(messages, "description");
sb.append("<em:localized>").append(System.lineSeparator());
Expand All @@ -180,7 +180,7 @@ public static void writeLocalesToFirefoxInstallRdf(File dest, String extensionNa
sb.append("</em:localized>").append(System.lineSeparator());
}

String content = FileUtils.readFileToString(installManifest);
String content = FileUtils.readFileToString(installManifest, "utf-8");
content = StringUtils.replace(content, "${localised}", sb.toString());
FileUtils.writeStringToFile(installManifest, content, "utf-8");
}
Expand Down
14 changes: 7 additions & 7 deletions Compiler/src/main/java/com/adguard/compiler/SettingUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ public class SettingUtils {
public static void writeLocalScriptRulesToFile(File dest, Set<String> scriptRules) throws IOException {
String scriptRulesText = getScriptRulesText(scriptRules);
String settings = String.format(LOCAL_SCRIPT_RULES_FILE_TEMPLATE, scriptRulesText);
FileUtils.writeStringToFile(getLocalScriptRulesFile(dest), settings);
FileUtils.writeStringToFile(getLocalScriptRulesFile(dest), settings, "utf-8");
}

public static void writeMessageIdsToFile(File dest, List<String> messageIds) throws IOException {
String i18nMessages = String.format(MESSAGE_IDS_FILE_TEMPLATE, StringUtils.join(messageIds, ",\r\n"));
FileUtils.writeStringToFile(getMessageIdsFile(dest), i18nMessages);
FileUtils.writeStringToFile(getMessageIdsFile(dest), i18nMessages, "utf-8");
}

public static void updateManifestFile(File dest, Browser browser, String version, String extensionId, String updateUrl, String extensionNamePostfix) throws IOException {
Expand All @@ -101,7 +101,7 @@ public static void updateManifestFile(File dest, Browser browser, String version
content = content + "\t\"update_url\": \"" + updateUrl + "\"\r\n}";
}
content = StringUtils.replace(content, "${version}", version);
FileUtils.writeStringToFile(manifestFile, content);
FileUtils.writeStringToFile(manifestFile, content, "utf-8");
break;
case SAFARI:
File infoPlistFile = new File(dest, "Info.plist");
Expand All @@ -112,7 +112,7 @@ public static void updateManifestFile(File dest, Browser browser, String version
String updateFromGallery = StringUtils.contains(extensionId, "beta") ? "false" : "true";
contentInfoPlist = StringUtils.replace(contentInfoPlist, "${updateFromGallery}", updateFromGallery);
contentInfoPlist = StringUtils.replace(contentInfoPlist, "${extensionNamePostfix}", extensionNamePostfix);
FileUtils.writeStringToFile(infoPlistFile, contentInfoPlist);
FileUtils.writeStringToFile(infoPlistFile, contentInfoPlist, "utf-8");
break;
case FIREFOX:
case FIREFOX_LEGACY:
Expand All @@ -127,14 +127,14 @@ public static void updateManifestFile(File dest, Browser browser, String version
contentRdf = StringUtils.replace(contentRdf, "${updateUrl}", updateUrl);
contentRdf = StringUtils.replace(contentRdf, "${version}", version);
contentRdf = StringUtils.replace(contentRdf, "${extensionId}", extensionId);
FileUtils.writeStringToFile(installRdf, contentRdf);
FileUtils.writeStringToFile(installRdf, contentRdf, "utf-8");
//write version
File packageJson = new File(dest, "package.json");
String contentPackageJson = FileUtils.readFileToString(packageJson);
String contentPackageJson = FileUtils.readFileToString(packageJson, "utf-8");
contentPackageJson = StringUtils.replace(contentPackageJson, "${version}", version);
contentPackageJson = StringUtils.replace(contentPackageJson, "${extensionId}", extensionId);
contentPackageJson = StringUtils.replace(contentPackageJson, "${extensionNamePostfix}", extensionNamePostfix);
FileUtils.writeStringToFile(packageJson, contentPackageJson);
FileUtils.writeStringToFile(packageJson, contentPackageJson, "utf-8");
break;
}
}
Expand Down
10 changes: 7 additions & 3 deletions Extension/filters/filter_1.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
! Title: Russian filter
! Version: 1.0.29.50
! Version: 1.0.29.51
! Name: Russian filter
! Description: Filter that enables removing of the ads from websites in Russian.
! NameEn: Russian filter
! DescriptionEn: Filter that enables blocking of ads on websites in Russian.
! TimeUpdated: 2015-12-23T19:50:26.025+03:00
! TimeUpdated: 2015-12-24T16:02:06.428+03:00
! Title: Adguard Russian Filter
!
! Filter that enables removing of the ads from websites with Russian content.
Expand Down Expand Up @@ -2994,7 +2994,7 @@ http://v.*.space/vv?$third-party
http://v.*.space/x?$third-party
http://v.*.com/*&bid=$third-party
http://v.*.space/*&bid=$third-party
.space/xx?qq&bid=$script,third-party
.space/xx?*&bid=$script,third-party
! TeaserNet ads
! Example: http://www.traht.org/
/static/bc.js?$third-party
Expand Down Expand Up @@ -6182,6 +6182,10 @@ polezno-2012.info^
!
! Правила специфичные для конкретных сайтов.
!
||online.anidub.com/uploads/fotos/240x400*.html$subdocument
lady.mail.ru##.pc-branding__top
lady.mail.ru##.rb-slot
lady.mail.ru##.branding-poly-bottom
||pslan.com/banera/
films-torrent.ru##a[href^="http://go.ad2up.com/"]
films-torrent.ru##.dwntorrent_tblc
Expand Down
7 changes: 5 additions & 2 deletions Extension/filters/filter_3.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
! Title: Spyware filter
! Version: 1.0.4.26
! Version: 1.0.4.27
! Name: Spyware filter
! Description: The most comprehensive list of various online counters and web analytics tools. If you do not want your actions on the Internet be tracked, use this filter.
! NameEn: Spyware filter
! DescriptionEn: The most comprehensive list of various online counters and web analytics tools. If you do not want your actions on the Internet to be tracked, use this filter.
! TimeUpdated: 2015-12-23T19:19:14.778+03:00
! TimeUpdated: 2015-12-24T16:02:29.263+03:00
! Title: Adguard Spyware Filter
!
! The most comprehensive list of various online counters and web analytics tools.
Expand Down Expand Up @@ -73,6 +73,8 @@ popmech.ru#%#AG_onLoad(function() { window.POPMECH.increaseCounters = function()
!-------------------------------------------------------------------------------!
!-------------- Tracking servers list -----------------------------------------!
!-------------------------------------------------------------------------------!
||tracker-api.my.com^$third-party
||api.vigo.ru^$third-party
||uc-file.at.ua/stat/$third-party
||syslab.ru/cnt/$third-party
||nuggad.net^$third-party
Expand Down Expand Up @@ -2628,6 +2630,7 @@ http://r.i.ua/s?
!-------------------------------------------------------------------------------!
!-------------- Specific web sites ---------------------------------------------!
!-------------------------------------------------------------------------------!
||m.vk.com/counters.php
||megashara.org/uploads/button/online.png
||rem-track.bild.de^
||bild.de/code/webtrekk-core*.bild.js
Expand Down
12 changes: 8 additions & 4 deletions Extension/filters/filter_mobile_1.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
! Title: Russian filter
! Version: 1.0.29.50
! Version: 1.0.29.51
! Name: Russian filter
! Description: Filter that enables removing of the ads from websites in Russian.
! NameEn: Russian filter
! DescriptionEn: Filter that enables blocking of ads on websites in Russian.
! TimeUpdated: 2015-12-23T19:50:26.025+03:00
! TimeUpdated: 2015-12-24T16:02:06.428+03:00
#%#window.AG_onLoad = function(func) { if (window.addEventListener) { window.addEventListener('DOMContentLoaded', func); } };
#%#window.AG_removeElementById = function(id) { var element = document.getElementById(id); if (element && element.parentNode) { element.parentNode.removeChild(element); }};
#%#window.AG_removeElementBySelector = function(selector) { if (!document.querySelectorAll) { return; } var nodes = document.querySelectorAll(selector); if (nodes) { for (var i = 0; i < nodes.length; i++) { if (nodes[i] && nodes[i].parentNode) { nodes[i].parentNode.removeChild(nodes[i]); } } } };
Expand Down Expand Up @@ -1399,7 +1399,7 @@ http://v.*.space/vv?$third-party
http://v.*.space/x?$third-party
http://v.*.com/*&bid=$third-party
http://v.*.space/*&bid=$third-party
.space/xx?qq&bid=$script,third-party
.space/xx?*&bid=$script,third-party
/static/bc.js?$third-party
||torrent.rus.ec/a-detector/
@@||happy-hack.ru^$elemhide
Expand Down Expand Up @@ -2423,7 +2423,7 @@ all-episodes.com#$#div[id="ad2"] { height: 30px; }
e1.ru#$#.brand-skin {padding-top: 0px!important;}
news.sportbox.ru#$#body { background: #415b14 !important; }
news.sportbox.ru#$#.sb_t_secs_main {margin-top: 0px!important; }
pics-money.ru,picspay.ru,free-torrents.org,free-torrent.org$$script[tag-content="visitweb_script"][max-length="700"]
jpgstore.ru,pics-money.ru,picspay.ru,free-torrents.org,free-torrent.org$$script[tag-content="visitweb_script"][max-length="700"]
4pda.ru$$article[class="post"][tag-content="tr.gerkon.eu"][max-length="2500"]
geektimes.ru,habrahabr.ru,megamozg.ru$$script[tag-content="adriver"]
webdesignmagazine.ru$$script[tag-content="mc.yandex.ru/metrika/"][max-length="1000"]
Expand Down Expand Up @@ -3126,6 +3126,10 @@ ucoz.ru/informer/
||seemore.ru/js/$third-party
||sv-pr.ru^$third-party
||target.smi2.net^$third-party
||online.anidub.com/uploads/fotos/240x400*.html$subdocument
lady.mail.ru##.pc-branding__top
lady.mail.ru##.rb-slot
lady.mail.ru##.branding-poly-bottom
||pslan.com/banera/
films-torrent.ru##a[href^="http://go.ad2up.com/"]
films-torrent.ru##.dwntorrent_tblc
Expand Down
8 changes: 5 additions & 3 deletions Extension/filters/filter_mobile_3.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
! Title: Spyware filter
! Version: 1.0.4.26
! Version: 1.0.4.27
! Name: Spyware filter
! Description: The most comprehensive list of various online counters and web analytics tools. If you do not want your actions on the Internet be tracked, use this filter.
! NameEn: Spyware filter
! DescriptionEn: The most comprehensive list of various online counters and web analytics tools. If you do not want your actions on the Internet to be tracked, use this filter.
! TimeUpdated: 2015-12-23T19:19:14.778+03:00
! TimeUpdated: 2015-12-24T16:02:29.263+03:00
#%#window.AG_onLoad = function(func) { if (window.addEventListener) { window.addEventListener('DOMContentLoaded', func); } };
#%#window.AG_removeElementById = function(id) { var element = document.getElementById(id); if (element && element.parentNode) { element.parentNode.removeChild(element); }};
#%#window.AG_removeElementBySelector = function(selector) { if (!document.querySelectorAll) { return; } var nodes = document.querySelectorAll(selector); if (nodes) { for (var i = 0; i < nodes.length; i++) { if (nodes[i] && nodes[i].parentNode) { nodes[i].parentNode.removeChild(nodes[i]); } } } };
Expand Down Expand Up @@ -32,6 +32,8 @@ echo.msk.ru$$script[tag-content="s=screen;"][max-length="200"]
~yandex.by,~yandex.com,~yandex.kz,~yandex.ru,~yandex.ua##a[href^="https://metrika.yandex.ru/stat/"]
##img[src*="counter.yadro.ru"]
~mozhor.ru,~onliner.by,~yandex.by,~yandex.com,~yandex.com.tr,~yandex.ru,~yandex.ua##img[width="88"][height="31"]
||tracker-api.my.com^$third-party
||api.vigo.ru^$third-party
||uc-file.at.ua/stat/$third-party
||syslab.ru/cnt/$third-party
||nuggad.net^$third-party
Expand Down Expand Up @@ -1621,6 +1623,7 @@ http://r.i.ua/s?
/xtcore.js
/zanox.js
://top.*/count/cnt.php?
||m.vk.com/counters.php
||megashara.org/uploads/button/online.png
||rem-track.bild.de^
||bild.de/code/webtrekk-core*.bild.js
Expand Down Expand Up @@ -1765,7 +1768,6 @@ washingtonpost.com##.social-tools-wrapper-bottom
@@||disqus.com/api/3.0/posts/$document
@@||top.list.ru/jump?from=$domain=pvo.guns.ru
guzei.com#@#img[width="88"][height="31"]
3101010.ru$@$script[tag-content="Ya.Metrika"][max-length="1500"]
@@||mc.yandex.ru/metrika/watch.js$domain=3101010.ru
crimea-kurort.com#@#img[width="88"][height="31"]
@@||top.list.ru/counter?id=$domain=crimea-kurort.com
Expand Down
Loading

0 comments on commit 1788ac4

Please sign in to comment.