| 1 | // For license of this file, see <project-root-folder>/LICENSE.cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockmanager.cpp`/md. |
| 2 | |
| 3 | #include "network-web/adblock/adblockmanager.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockmanager.h`/ |
| 4 | |
| 5 | #include "3rd-party/boolinq/boolinq.h"cxx . . $ `<file>/src/librssguard/3rd-party/boolinq/boolinq.h`/ |
| 6 | #include "exceptions/applicationexception.h"cxx . . $ `<file>/src/librssguard/exceptions/applicationexception.h`/ |
| 7 | #include "exceptions/networkexception.h"cxx . . $ `<file>/src/librssguard/exceptions/networkexception.h`/ |
| 8 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 9 | #include "miscellaneous/settings.h"cxx . . $ `<file>/src/librssguard/miscellaneous/settings.h`/ |
| 10 | #include "network-web/adblock/adblockdialog.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockdialog.h`/ |
| 11 | #include "network-web/adblock/adblockicon.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockicon.h`/ |
| 12 | #include "network-web/adblock/adblockrequestinfo.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockrequestinfo.h`/ |
| 13 | #include "network-web/networkfactory.h"cxx . . $ `<file>/src/librssguard/network-web/networkfactory.h`/ |
| 14 | #include "network-web/webfactory.h"cxx . . $ `<file>/src/librssguard/network-web/webfactory.h`/ |
| 15 | |
| 16 | #if defined(NO_LITEcxx . . $ `<built-in>:500:9`!) |
| 17 | #include "network-web/adblock/adblockurlinterceptor.h"cxx . . $ `<file>/src/librssguard/network-web/adblock/adblockurlinterceptor.h`/ |
| 18 | #include "network-web/webengine/networkurlinterceptor.h"cxx . . $ `<file>/src/librssguard/network-web/webengine/networkurlinterceptor.h`/ |
| 19 | #endif |
| 20 | |
| 21 | #include <QDateTime> |
| 22 | #include <QDir> |
| 23 | #include <QJsonDocument> |
| 24 | #include <QJsonObject> |
| 25 | #include <QMessageBox> |
| 26 | #include <QTimer> |
| 27 | #include <QUrlQuery> |
| 28 | |
| 29 | AdBlockManagercxx . . $ AdBlockManager#::AdBlockManagercxx . . $ AdBlockManager#AdBlockManager(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent) |
| 30 | : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent), m_loadedcxx . . $ AdBlockManager#m_loaded.(false), m_enabledcxx . . $ AdBlockManager#m_enabled.(false), m_installingcxx . . $ AdBlockManager#m_installing.(false), |
| 31 | #if defined(NO_LITEcxx . . $ `<built-in>:500:9`!) |
| 32 | m_interceptorcxx . . $ AdBlockManager#m_interceptor.(new AdBlockUrlInterceptorcxx . . $ AdBlockUrlInterceptor#AdBlockUrlInterceptor(2daae1e9b68044d).(this)), |
| 33 | #endif |
| 34 | m_serverProcesscxx . . $ AdBlockManager#m_serverProcess.(nullptr), m_cacheBlockscxx . . $ AdBlockManager#m_cacheBlocks.({cxx . . $ std/initializer_list#initializer_list(ced63f7c635d850d).}) { |
| 35 | m_adblockIconcxx . . $ AdBlockManager#m_adblockIcon. = new AdBlockIconcxx . . $ AdBlockIcon#AdBlockIcon(2daae1e9b68044d).(this); |
| 36 | m_adblockIconcxx . . $ AdBlockManager#m_adblockIcon.->setObjectNamecxx . . $ QObject#setObjectName(3520e46b33348bf6).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("m_adblockIconAction")); |
| 37 | m_unifiedFiltersFilecxx . . $ AdBlockManager#m_unifiedFiltersFile. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->userDataFoldercxx . . $ Application#userDataFolder(4365c3963150523e).() +cxx . . $ operator+(adfbdceb504720ce). QDircxx . . $ QDir#::separatorcxx . . $ QDir#separator(44eb9225326fcbf5).() +cxx . . $ operator+(adfbdceb504720ce). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("adblock-unified-filters.txt"); |
| 38 | |
| 39 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->nodejscxx . . $ Application#nodejs(37aaef0f1b724263).(), &NodeJscxx . . $ NodeJs#::packageInstalledUpdatedcxx . . $ NodeJs#packageInstalledUpdated(34ac6af3085f0564)., this, &AdBlockManagercxx . . $ AdBlockManager#::onPackageReadycxx . . $ AdBlockManager#onPackageReady(34ac6af3085f0564).); |
| 40 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->nodejscxx . . $ Application#nodejs(37aaef0f1b724263).(), &NodeJscxx . . $ NodeJs#::packageErrorcxx . . $ NodeJs#packageError(c66daf909bbebbbc)., this, &AdBlockManagercxx . . $ AdBlockManager#::onPackageErrorcxx . . $ AdBlockManager#onPackageError(c66daf909bbebbbc).); |
| 41 | } |
| 42 | |
| 43 | AdBlockManagercxx . . $ AdBlockManager#::~cxx . . $ AdBlockManager#`~AdBlockManager`(ced63f7c635d850d).AdBlockManagercxx . . $ AdBlockManager#() { |
| 44 | killServercxx . . $ AdBlockManager#killServer(49f6e7a06ebc5aa8).(); |
| 45 | } |
| 46 | |
| 47 | BlockingResultcxx . . $ BlockingResult# AdBlockManagercxx . . $ AdBlockManager#::blockcxx . . $ AdBlockManager#block(b0689f1a9ed52a60).(const AdblockRequestInfocxx . . $ AdblockRequestInfo#& request) { |
| 48 | if (!isEnabledcxx . . $ AdBlockManager#isEnabled(50ce9a9e25b4a850).()) { |
| 49 | return {cxx . . $ BlockingResult#BlockingResult(64b12fddccd2c229).false}; |
| 50 | } |
| 51 | |
| 52 | const QStringcxx . . $ QString# url_string = requestcxx . . $ QString#QString(45672f3c6961a244)..requestUrlcxx . . $ AdblockRequestInfo#requestUrl(36d9834fe7321282).().toEncodedcxx . . $ QUrl#toEncoded(7c604b7f5c0e832f).().toLowercxx . . $ QByteArray#toLower(7c2073558a834e49).(); |
| 53 | const QStringcxx . . $ QString# firstparty_url_string = requestcxx . . $ QString#QString(45672f3c6961a244)..firstPartyUrlcxx . . $ AdblockRequestInfo#firstPartyUrl(36d9834fe7321282).().toEncodedcxx . . $ QUrl#toEncoded(7c604b7f5c0e832f).().toLowercxx . . $ QByteArray#toLower(7c2073558a834e49).(); |
| 54 | const QStringcxx . . $ QString# url_scheme = request.requestUrlcxx . . $ AdblockRequestInfo#requestUrl(36d9834fe7321282).().schemecxx . . $ QUrl#scheme(6ef7b6c27b00b43d).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).(); |
| 55 | const QPaircxx . . $ QPair#<QStringcxx . . $ QString#, QStringcxx . . $ QString#> url_pair = {cxx . . $ std/pair#pair(13c11f7bd0e7e3d2).firstparty_url_string, url_string}; |
| 56 | const QStringcxx . . $ QString# url_type = request.resourceTypecxx . . $ AdblockRequestInfo#resourceType(6ef7b6c27b00b43d).(); |
| 57 | |
| 58 | if (!canRunOnSchemecxx . . $ AdBlockManager#canRunOnScheme(f3b39adf77d9c36c).(url_scheme)) { |
| 59 | return {cxx . . $ BlockingResult#BlockingResult(64b12fddccd2c229).false}; |
| 60 | } |
| 61 | else { |
| 62 | if (m_cacheBlockscxx . . $ AdBlockManager#m_cacheBlocks..containscxx . . $ QHash#contains(5247d2cea5ab73ba).(url_pair)) { |
| 63 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Found blocking data in cache, URL:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(url_pair); |
| 64 | |
| 65 | return m_cacheBlockscxx . . $ AdBlockManager#m_cacheBlocks..valuecxx . . $ QHash#value(5f65a9ee2c9899ff).(url_pair); |
| 66 | } |
| 67 | |
| 68 | if (m_serverProcesscxx . . $ AdBlockManager#m_serverProcess. != nullptr && m_serverProcesscxx . . $ AdBlockManager#m_serverProcess.->statecxx . . $ QProcess#state(12547b18370478e0).() == QProcesscxx . . $ QProcess#::ProcessStatecxx . . $ QProcess#ProcessState#::Runningcxx . . $ QProcess#Running.) { |
| 69 | try { |
| 70 | auto result = askServerIfBlockedcxx . . $ AdBlockManager#askServerIfBlocked(b85fa49265dbe04f).(firstparty_url_string, url_string, url_type); |
| 71 | |
| 72 | m_cacheBlockscxx . . $ AdBlockManager#m_cacheBlocks..insertcxx . . $ QHash#insert(d77b19c31d2eb147).(url_pair, result); |
| 73 | |
| 74 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Inserted blocking data to cache for:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(url_pair); |
| 75 | |
| 76 | return result; |
| 77 | } |
| 78 | catch (const ApplicationExceptioncxx . . $ ApplicationException#& ex) { |
| 79 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! |
| 80 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "HTTP error when calling server for blocking rules:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(ex.message()); |
| 81 | return {cxx . . $ BlockingResult#BlockingResult(64b12fddccd2c229).false}; |
| 82 | } |
| 83 | } |
| 84 | else { |
| 85 | return {cxx . . $ BlockingResult#BlockingResult(64b12fddccd2c229).false}; |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void AdBlockManagercxx . . $ AdBlockManager#::setEnabledcxx . . $ AdBlockManager#setEnabled(b45ddcbc8423892c).(bool enabled) { |
| 91 | if (enabled == m_enabledcxx . . $ AdBlockManager#m_enabled.) { |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | if (!m_loadedcxx . . $ AdBlockManager#m_loaded.) { |
| 96 | #if defined(NO_LITEcxx . . $ `<built-in>:500:9`!) |
| 97 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->webcxx . . $ Application#web(ad68e16c93841931).()->urlIinterceptorcxx . . $ WebFactory#urlIinterceptor(f6291ca875afd988).()->installUrlInterceptorcxx . . $ NetworkUrlInterceptor#installUrlInterceptor(449ab0fa279ef918).(m_interceptorcxx . . $ AdBlockManager#m_interceptor.); |
| 98 | #endif |
| 99 | m_loadedcxx . . $ AdBlockManager#m_loaded. = true; |
| 100 | } |
| 101 | |
| 102 | m_enabledcxx . . $ AdBlockManager#m_enabled. = enabled; |
| 103 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! enabledChangedcxx . . $ AdBlockManager#enabledChanged(64b12fddccd2c229).(m_enabledcxx . . $ AdBlockManager#m_enabled.); |
| 104 | |
| 105 | if (m_enabledcxx . . $ AdBlockManager#m_enabled.) { |
| 106 | if (!m_installingcxx . . $ AdBlockManager#m_installing.) { |
| 107 | m_installingcxx . . $ AdBlockManager#m_installing. = true; |
| 108 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->nodejscxx . . $ Application#nodejs(37aaef0f1b724263).()->installUpdatePackagescxx . . $ NodeJs#installUpdatePackages(b5245139ef44c0df).(this, {cxx . . $ QList#QList(b6da5b9a9f304025).{QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(CLIQZ_ADBLOCKED_PACKAGEcxx . . $ `src/librssguard/network-web/adblock/adblockmanager.h:12:9`!), QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(CLIQZ_ADBLOCKED_VERSIONcxx . . $ `src/librssguard/network-web/adblock/adblockmanager.h:13:9`!)}}); |
| 109 | } |
| 110 | } |
| 111 | else { |
| 112 | killServercxx . . $ AdBlockManager#killServer(49f6e7a06ebc5aa8).(); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | bool AdBlockManagercxx . . $ AdBlockManager#::isEnabledcxx . . $ AdBlockManager#isEnabled(50ce9a9e25b4a850).() const { |
| 117 | return m_enabledcxx . . $ AdBlockManager#m_enabled.; |
| 118 | } |
| 119 | |
| 120 | bool AdBlockManagercxx . . $ AdBlockManager#::canRunOnSchemecxx . . $ AdBlockManager#canRunOnScheme(f3b39adf77d9c36c).(const QStringcxx . . $ QString#& scheme) const { |
| 121 | return !(scheme ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("file") || scheme ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("qrc") || scheme ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("data") || scheme ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("abp")); |
| 122 | } |
| 123 | |
| 124 | QStringcxx . . $ QString# AdBlockManagercxx . . $ AdBlockManager#::elementHidingRulesForDomaincxx . . $ AdBlockManager#elementHidingRulesForDomain(24eb2a72c77c93bc).(const QUrlcxx . . $ QUrl#& url) const { |
| 125 | if (m_serverProcesscxx . . $ AdBlockManager#m_serverProcess. != nullptr && m_serverProcesscxx . . $ AdBlockManager#m_serverProcess.->statecxx . . $ QProcess#state(12547b18370478e0).() == QProcesscxx . . $ QProcess#::ProcessStatecxx . . $ QProcess#ProcessState#::Runningcxx . . $ QProcess#Running.) { |
| 126 | try { |
| 127 | auto result = askServerForCosmeticRulescxx . . $ AdBlockManager#askServerForCosmeticRules(5555d9024dcf93fb).(url.toStringcxx . . $ QUrl#toString(632475ebea3355f1).()); |
| 128 | |
| 129 | return resultcxx . . $ QString#QString(28715ad661ad3cec).; |
| 130 | } |
| 131 | catch (const ApplicationExceptioncxx . . $ ApplicationException#& ex) { |
| 132 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! |
| 133 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "HTTP error when calling server for cosmetic rules:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(ex.message()); |
| 134 | return {cxx . . $ QString#QString(ced63f7c635d850d).}; |
| 135 | } |
| 136 | } |
| 137 | else { |
| 138 | return {cxx . . $ QString#QString(ced63f7c635d850d).}; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | QStringListcxx . . $ QStringList# AdBlockManagercxx . . $ AdBlockManager#::filterListscxx . . $ AdBlockManager#filterLists(2b25566bdf736d18).() const { |
| 143 | return qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->valuecxx . . $ Settings#value(8f1f29a69568d71a).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(AdBlock), SETTINGcxx . . $ `src/librssguard/miscellaneous/settings.h:30:9`!(AdBlock::FilterLists)).toStringListcxx . . $ QVariant#toStringList(2b25566bdf736d18).(); |
| 144 | } |
| 145 | |
| 146 | void AdBlockManagercxx . . $ AdBlockManager#::setFilterListscxx . . $ AdBlockManager#setFilterLists(4c9f0945b8b27034).(const QStringListcxx . . $ QStringList#& filter_lists) { |
| 147 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->setValuecxx . . $ Settings#setValue(365356ede4ebaabb).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(AdBlock), AdBlockcxx . . $ AdBlock/::FilterListscxx . . $ AdBlock/FilterLists., filter_listscxx . . $ QVariant#QVariant(cdcda21a1866b6fa).); |
| 148 | } |
| 149 | |
| 150 | QStringListcxx . . $ QStringList# AdBlockManagercxx . . $ AdBlockManager#::customFilterscxx . . $ AdBlockManager#customFilters(2b25566bdf736d18).() const { |
| 151 | return qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->valuecxx . . $ Settings#value(8f1f29a69568d71a).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(AdBlock), SETTINGcxx . . $ `src/librssguard/miscellaneous/settings.h:30:9`!(AdBlock::CustomFilters)).toStringListcxx . . $ QVariant#toStringList(2b25566bdf736d18).(); |
| 152 | } |
| 153 | |
| 154 | void AdBlockManagercxx . . $ AdBlockManager#::setCustomFilterscxx . . $ AdBlockManager#setCustomFilters(4c9f0945b8b27034).(const QStringListcxx . . $ QStringList#& custom_filters) { |
| 155 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->settingscxx . . $ Application#settings(951936487a2d9252).()->setValuecxx . . $ Settings#setValue(365356ede4ebaabb).(GROUPcxx . . $ `src/librssguard/miscellaneous/settings.h:32:9`!(AdBlock), AdBlockcxx . . $ AdBlock/::CustomFilterscxx . . $ AdBlock/CustomFilters., custom_filterscxx . . $ QVariant#QVariant(cdcda21a1866b6fa).); |
| 156 | } |
| 157 | |
| 158 | QStringcxx . . $ QString# AdBlockManagercxx . . $ AdBlockManager#::generateJsForElementHidingcxx . . $ AdBlockManager#generateJsForElementHiding(fd988a2ab94d906b).(const QStringcxx . . $ QString#& css) { |
| 159 | QStringcxx . . $ QString# source = QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("(function() {" |
| 160 | "var head = document.getElementsByTagName('head')[0];" |
| 161 | "if (!head) return;" |
| 162 | "var css = document.createElement('style');" |
| 163 | "css.setAttribute('type', 'text/css');" |
| 164 | "css.appendChild(document.createTextNode('%1'));" |
| 165 | "head.appendChild(css);" |
| 166 | "})()"); |
| 167 | QStringcxx . . $ QString# style = csscxx . . $ QString#QString(132dd6869045752b).; |
| 168 | |
| 169 | style.replacecxx . . $ QString#replace(bf3f4488886b9fb7).(QL1Scxx . . $ `src/librssguard/definitions/definitions.h:449:9`!("'"), QL1Scxx . . $ `src/librssguard/definitions/definitions.h:449:9`!("\\'")); |
| 170 | style.replacecxx . . $ QString#replace(bf3f4488886b9fb7).(QL1Scxx . . $ `src/librssguard/definitions/definitions.h:449:9`!("\n"), QL1Scxx . . $ `src/librssguard/definitions/definitions.h:449:9`!("\\n")); |
| 171 | |
| 172 | return source.argcxx . . $ QString#arg(ad0bca07273edcc2).(style); |
| 173 | } |
| 174 | |
| 175 | void AdBlockManagercxx . . $ AdBlockManager#::showDialogcxx . . $ AdBlockManager#showDialog(49f6e7a06ebc5aa8).() { |
| 176 | AdBlockDialogcxx . . $ AdBlockDialog#(qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->mainFormWidgetcxx . . $ Application#mainFormWidget(9b769eeb00a33a04).()).execcxx . . $ QDialog#exec(b126dc7c1de90089).(); |
| 177 | } |
| 178 | |
| 179 | void AdBlockManagercxx . . $ AdBlockManager#::onPackageReadycxx . . $ AdBlockManager#onPackageReady(34ac6af3085f0564).(const QObjectcxx . . $ QObject#* sndr, |
| 180 | const QListcxx . . $ QList#<NodeJscxx . . $ NodeJs#::PackageMetadatacxx . . $ NodeJs#PackageMetadata#>& pkgs, |
| 181 | bool already_up_to_date) { |
| 182 | Q_UNUSEDcxx . . $ `<external>/17563275351362271547/qtpreprocessorsupport.h:20:9`!(already_up_to_date) |
| 183 | |
| 184 | bool concerns_adblock = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(pkgs).anycxx . . $ boolinq/Linq#any(992a0234366b9b4f).([cxx . . $ std/function#function(bdc3712e480e4d04).](const NodeJscxx . . $ NodeJs#::PackageMetadatacxx . . $ NodeJs#PackageMetadata#& pkg) { |
| 185 | return pkg.m_namecxx . . $ NodeJs#PackageMetadata#m_name. ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(CLIQZ_ADBLOCKED_PACKAGEcxx . . $ `src/librssguard/network-web/adblock/adblockmanager.h:12:9`!); |
| 186 | }); |
| 187 | |
| 188 | if (concerns_adblock) { |
| 189 | m_installingcxx . . $ AdBlockManager#m_installing. = false; |
| 190 | |
| 191 | if (m_enabledcxx . . $ AdBlockManager#m_enabled.) { |
| 192 | try { |
| 193 | updateUnifiedFiltersFileAndStartServercxx . . $ AdBlockManager#updateUnifiedFiltersFileAndStartServer(49f6e7a06ebc5aa8).(); |
| 194 | } |
| 195 | catch (const ApplicationExceptioncxx . . $ ApplicationException#& ex) { |
| 196 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to setup filters and start server:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(ex.message()); |
| 197 | |
| 198 | m_enabledcxx . . $ AdBlockManager#m_enabled. = false; |
| 199 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! enabledChangedcxx . . $ AdBlockManager#enabledChanged(64b12fddccd2c229).(m_enabledcxx . . $ AdBlockManager#m_enabled., trcxx . . $ AdBlockManager#tr(75d9f1c324b4579d).("Failed to setup filters and start server: %1.").argcxx . . $ QString#arg(ad0bca07273edcc2).(ex.messagecxx . . $ ApplicationException#message(6ef7b6c27b00b43d).())); |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | void AdBlockManagercxx . . $ AdBlockManager#::onPackageErrorcxx . . $ AdBlockManager#onPackageError(c66daf909bbebbbc).(const QObjectcxx . . $ QObject#* sndr, |
| 206 | const QListcxx . . $ QList#<NodeJscxx . . $ NodeJs#::PackageMetadatacxx . . $ NodeJs#PackageMetadata#>& pkgs, |
| 207 | const QStringcxx . . $ QString#& error) { |
| 208 | Q_UNUSEDcxx . . $ `<external>/17563275351362271547/qtpreprocessorsupport.h:20:9`!(sndr) |
| 209 | |
| 210 | bool concerns_adblock = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(pkgs).anycxx . . $ boolinq/Linq#any(992a0234366b9b4f).([cxx . . $ std/function#function(bdc3712e480e4d04).](const NodeJscxx . . $ NodeJs#::PackageMetadatacxx . . $ NodeJs#PackageMetadata#& pkg) { |
| 211 | return pkg.m_namecxx . . $ NodeJs#PackageMetadata#m_name. ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(CLIQZ_ADBLOCKED_PACKAGEcxx . . $ `src/librssguard/network-web/adblock/adblockmanager.h:12:9`!); |
| 212 | }); |
| 213 | |
| 214 | if (concerns_adblock) { |
| 215 | m_installingcxx . . $ AdBlockManager#m_installing. = false; |
| 216 | m_enabledcxx . . $ AdBlockManager#m_enabled. = false; |
| 217 | |
| 218 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Needed Node.js packages were not installed:" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(error); |
| 219 | |
| 220 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! processTerminatedcxx . . $ AdBlockManager#processTerminated(49f6e7a06ebc5aa8).(); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | void AdBlockManagercxx . . $ AdBlockManager#::onServerProcessFinishedcxx . . $ AdBlockManager#onServerProcessFinished(15c350e1a5203cbf).(int exit_code, QProcesscxx . . $ QProcess#::ExitStatuscxx . . $ QProcess#ExitStatus# exit_status) { |
| 225 | Q_UNUSEDcxx . . $ `<external>/17563275351362271547/qtpreprocessorsupport.h:20:9`!(exit_status) |
| 226 | killServercxx . . $ AdBlockManager#killServer(49f6e7a06ebc5aa8).(); |
| 227 | |
| 228 | qCriticalNNcxx . . $ `src/librssguard/definitions/definitions.h:421:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Process exited with exit code" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACEcxx . . $ `src/librssguard/definitions/definitions.h:432:9`!(exit_code) |
| 229 | <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "so check application log for more details."; |
| 230 | |
| 231 | m_enabledcxx . . $ AdBlockManager#m_enabled. = false; |
| 232 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! processTerminatedcxx . . $ AdBlockManager#processTerminated(49f6e7a06ebc5aa8).(); |
| 233 | } |
| 234 | |
| 235 | BlockingResultcxx . . $ BlockingResult# AdBlockManagercxx . . $ AdBlockManager#::askServerIfBlockedcxx . . $ AdBlockManager#askServerIfBlocked(b85fa49265dbe04f).(const QStringcxx . . $ QString#& fp_url, |
| 236 | const QStringcxx . . $ QString#& url, |
| 237 | const QStringcxx . . $ QString#& url_type) const { |
| 238 | QJsonObjectcxx . . $ QJsonObject# req_objcxx . . $ QJsonObject#QJsonObject(49f6e7a06ebc5aa8).; |
| 239 | QByteArraycxx . . $ QByteArray# outcxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 240 | QElapsedTimercxx . . $ QElapsedTimer# tmrcxx . . $ QElapsedTimer#QElapsedTimer(ced63f7c635d850d).; |
| 241 | |
| 242 | req_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("fp_url")] =cxx . . $ QJsonValueRef#`operator=`(e1c7b4c20ea84dfe). fp_urlcxx . . $ QJsonValue#QJsonValue(3520e46b33348bf6).; |
| 243 | req_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("url")] =cxx . . $ QJsonValueRef#`operator=`(e1c7b4c20ea84dfe). urlcxx . . $ QJsonValue#QJsonValue(3520e46b33348bf6).; |
| 244 | req_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("url_type")] =cxx . . $ QJsonValueRef#`operator=`(e1c7b4c20ea84dfe). url_typecxx . . $ QJsonValue#QJsonValue(3520e46b33348bf6)., req_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("filter")] =cxx . . $ QJsonValueRef#`operator=`(e1c7b4c20ea84dfe). truecxx . . $ QJsonValue#QJsonValue(b45ddcbc8423892c).; |
| 245 | |
| 246 | tmr.startcxx . . $ QElapsedTimer#start(ced63f7c635d850d).(); |
| 247 | |
| 248 | auto network_res = |
| 249 | NetworkFactorycxx . . $ NetworkFactory#::performNetworkOperationcxx . . $ NetworkFactory#performNetworkOperation(98c2fa0f32201561).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("http://%1:%2") |
| 250 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(QHostAddresscxx . . $ QHostAddress#QHostAddress(87181e547927ba53).(QHostAddresscxx . . $ QHostAddress#::SpecialAddresscxx . . $ QHostAddress#SpecialAddress#::LocalHostcxx . . $ QHostAddress#LocalHost.).toStringcxx . . $ QHostAddress#toString(6ef7b6c27b00b43d).(), |
| 251 | QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(ADBLOCK_SERVER_PORTcxx . . $ `src/librssguard/definitions/definitions.h:20:9`!)), |
| 252 | 500, |
| 253 | QJsonDocumentcxx . . $ QJsonDocument#QJsonDocument(6b379e5d051a9fe4).(req_obj).toJsoncxx . . $ QJsonDocument#toJson(6b49539da79a45f0).(), |
| 254 | out, |
| 255 | QNetworkAccessManagercxx . . $ QNetworkAccessManager#::Operationcxx . . $ QNetworkAccessManager#Operation#::PostOperationcxx . . $ QNetworkAccessManager#PostOperation., |
| 256 | {cxx . . $ QList#QList(b6da5b9a9f304025).{QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(HTTP_HEADERS_CONTENT_TYPEcxx . . $ `src/librssguard/definitions/definitions.h:162:9`!).toLocal8Bitcxx . . $ QString#toLocal8Bit(7c2073558a834e49).(), |
| 257 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("application/json").toLocal8Bitcxx . . $ QString#toLocal8Bit(7c2073558a834e49).()}}); |
| 258 | |
| 259 | if (network_res.m_networkErrorcxx . . $ NetworkResult#m_networkError. == QNetworkReplycxx . . $ QNetworkReply#::NetworkErrorcxx . . $ QNetworkReply#NetworkError#::NoErrorcxx . . $ QNetworkReply#NoError.) { |
| 260 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Query for blocking info to server took " <<cxx . . $ QDebug#`operator<<`(f416a4561cb9723d). tmr.elapsedcxx . . $ QElapsedTimer#elapsed(6b0412d51016192f).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). " ms."; |
| 261 | |
| 262 | QJsonObjectcxx . . $ QJsonObject# out_obj = QJsonDocumentcxx . . $ QJsonDocument#::fromJsoncxx . . $ QJsonDocument#fromJson(731a4d2b2d08d93c).(out).objectcxx . . $ QJsonDocument#object(ac8af9874357714b).(); |
| 263 | bool blocking = out_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("filter")].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("match")].toBoolcxx . . $ QJsonValueRef#toBool(962fae8be55e1d9).(); |
| 264 | |
| 265 | return {cxx . . $ BlockingResult#BlockingResult(64b12fddccd2c229).blocking, |
| 266 | blocking ? out_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("filter")].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("filter")].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("filter")].toStringcxx . . $ QJsonValueRef#toString(5555d9024dcf93fb).() |
| 267 | : QStringcxx . . $ QString#QString(ced63f7c635d850d).()}; |
| 268 | } |
| 269 | else { |
| 270 | throw NetworkExceptioncxx . . $ NetworkException#(network_res.m_networkErrorcxx . . $ NetworkResult#m_networkError.); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | QStringcxx . . $ QString# AdBlockManagercxx . . $ AdBlockManager#::askServerForCosmeticRulescxx . . $ AdBlockManager#askServerForCosmeticRules(5555d9024dcf93fb).(const QStringcxx . . $ QString#& url) const { |
| 275 | QJsonObjectcxx . . $ QJsonObject# req_objcxx . . $ QJsonObject#QJsonObject(49f6e7a06ebc5aa8).; |
| 276 | QByteArraycxx . . $ QByteArray# outcxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 277 | QElapsedTimercxx . . $ QElapsedTimer# tmrcxx . . $ QElapsedTimer#QElapsedTimer(ced63f7c635d850d).; |
| 278 | |
| 279 | req_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("url")] =cxx . . $ QJsonValueRef#`operator=`(e1c7b4c20ea84dfe). urlcxx . . $ QJsonValue#QJsonValue(3520e46b33348bf6).; |
| 280 | req_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("cosmetic")] =cxx . . $ QJsonValueRef#`operator=`(e1c7b4c20ea84dfe). truecxx . . $ QJsonValue#QJsonValue(b45ddcbc8423892c).; |
| 281 | |
| 282 | tmr.startcxx . . $ QElapsedTimer#start(ced63f7c635d850d).(); |
| 283 | |
| 284 | auto network_res = |
| 285 | NetworkFactorycxx . . $ NetworkFactory#::performNetworkOperationcxx . . $ NetworkFactory#performNetworkOperation(98c2fa0f32201561).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("http://%1:%2") |
| 286 | .argcxx . . $ QString#arg(89b093bd48b6d6c0).(QHostAddresscxx . . $ QHostAddress#QHostAddress(87181e547927ba53).(QHostAddresscxx . . $ QHostAddress#::SpecialAddresscxx . . $ QHostAddress#SpecialAddress#::LocalHostcxx . . $ QHostAddress#LocalHost.).toStringcxx . . $ QHostAddress#toString(6ef7b6c27b00b43d).(), |
| 287 | QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(ADBLOCK_SERVER_PORTcxx . . $ `src/librssguard/definitions/definitions.h:20:9`!)), |
| 288 | 500, |
| 289 | QJsonDocumentcxx . . $ QJsonDocument#QJsonDocument(6b379e5d051a9fe4).(req_obj).toJsoncxx . . $ QJsonDocument#toJson(6b49539da79a45f0).(), |
| 290 | out, |
| 291 | QNetworkAccessManagercxx . . $ QNetworkAccessManager#::Operationcxx . . $ QNetworkAccessManager#Operation#::PostOperationcxx . . $ QNetworkAccessManager#PostOperation., |
| 292 | {cxx . . $ QList#QList(b6da5b9a9f304025).{QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(HTTP_HEADERS_CONTENT_TYPEcxx . . $ `src/librssguard/definitions/definitions.h:162:9`!).toLocal8Bitcxx . . $ QString#toLocal8Bit(7c2073558a834e49).(), |
| 293 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("application/json").toLocal8Bitcxx . . $ QString#toLocal8Bit(7c2073558a834e49).()}}); |
| 294 | |
| 295 | if (network_res.m_networkErrorcxx . . $ NetworkResult#m_networkError. == QNetworkReplycxx . . $ QNetworkReply#::NetworkErrorcxx . . $ QNetworkReply#NetworkError#::NoErrorcxx . . $ QNetworkReply#NoError.) { |
| 296 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Query for cosmetic rules to server took " <<cxx . . $ QDebug#`operator<<`(f416a4561cb9723d). tmr.elapsedcxx . . $ QElapsedTimer#elapsed(6b0412d51016192f).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). " ms."; |
| 297 | |
| 298 | QJsonObjectcxx . . $ QJsonObject# out_obj = QJsonDocumentcxx . . $ QJsonDocument#::fromJsoncxx . . $ QJsonDocument#fromJson(731a4d2b2d08d93c).(out).objectcxx . . $ QJsonDocument#object(ac8af9874357714b).(); |
| 299 | |
| 300 | return out_obj[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("cosmetic")].toObjectcxx . . $ QJsonValueRef#toObject(ac8af9874357714b).()[cxx . . $ QJsonObject#`operator[]`(6d95a036fce085b4).QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("styles")].toStringcxx . . $ QJsonValueRef#toString(5555d9024dcf93fb).(); |
| 301 | } |
| 302 | else { |
| 303 | throw NetworkExceptioncxx . . $ NetworkException#(network_res.m_networkErrorcxx . . $ NetworkResult#m_networkError.); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | QProcesscxx . . $ QProcess#* AdBlockManagercxx . . $ AdBlockManager#::startServercxx . . $ AdBlockManager#startServer(441b0ec0e9d37395).(int port) { |
| 308 | QStringcxx . . $ QString# temp_server = |
| 309 | QDircxx . . $ QDir#::toNativeSeparatorscxx . . $ QDir#toNativeSeparators(fd988a2ab94d906b).(IOFactorycxx . . $ IOFactory#::getSystemFoldercxx . . $ IOFactory#getSystemFolder(7d8b34fbb6a9c1bf).(QStandardPathscxx . . $ QStandardPaths#::StandardLocationcxx . . $ QStandardPaths#StandardLocation#::TempLocationcxx . . $ QStandardPaths#TempLocation.)) +cxx . . $ operator+(adfbdceb504720ce). |
| 310 | QDircxx . . $ QDir#::separatorcxx . . $ QDir#separator(44eb9225326fcbf5).() +cxx . . $ operator+(adfbdceb504720ce). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(ADBLOCK_SERVER_FILEcxx . . $ `src/librssguard/definitions/definitions.h:19:9`!); |
| 311 | |
| 312 | if (!IOFactorycxx . . $ IOFactory#::copyFilecxx . . $ IOFactory#copyFile(edf9e4f73813982f).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(":/scripts/adblock/") +cxx . . $ operator+(adfbdceb504720ce). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(ADBLOCK_SERVER_FILEcxx . . $ `src/librssguard/definitions/definitions.h:19:9`!), temp_server)) { |
| 313 | qWarningNNcxx . . $ `src/librssguard/definitions/definitions.h:417:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Failed to copy server file to TEMP."; |
| 314 | } |
| 315 | |
| 316 | QProcesscxx . . $ QProcess#* proc = new QProcesscxx . . $ QProcess#QProcess(749de1b6ae65bddd).(this); |
| 317 | |
| 318 | proc->setProcessChannelModecxx . . $ QProcess#setProcessChannelMode(325e95cd0c77e646).(QProcesscxx . . $ QProcess#::ProcessChannelModecxx . . $ QProcess#ProcessChannelMode#::ForwardedErrorChannelcxx . . $ QProcess#ForwardedErrorChannel.); |
| 319 | |
| 320 | connectcxx . . $ QObject#connect(dad3a9587f3dce3c).(proc, |
| 321 | QOverloadcxx . . $ QOverload#<int, QProcess::ExitStatus>::ofcxx . . $ QOverload#of(8e142c06a530e2ab).(&QProcesscxx . . $ QProcess#::finishedcxx . . $ QProcess#finished(15c350e1a5203cbf).), |
| 322 | this, |
| 323 | &AdBlockManagercxx . . $ AdBlockManager#::onServerProcessFinishedcxx . . $ AdBlockManager#onServerProcessFinished(15c350e1a5203cbf).); |
| 324 | |
| 325 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->nodejscxx . . $ Application#nodejs(37aaef0f1b724263).()->runScriptcxx . . $ NodeJs#runScript(b32167958b67e3d).(proc, |
| 326 | QDircxx . . $ QDir#::toNativeSeparatorscxx . . $ QDir#toNativeSeparators(fd988a2ab94d906b).(temp_server), |
| 327 | {cxx . . $ QList#QList(b6da5b9a9f304025).QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(port), QDircxx . . $ QDir#::toNativeSeparatorscxx . . $ QDir#toNativeSeparators(fd988a2ab94d906b).(m_unifiedFiltersFilecxx . . $ AdBlockManager#m_unifiedFiltersFile.)}); |
| 328 | |
| 329 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Attempting to start AdBlock server."; |
| 330 | return proc; |
| 331 | } |
| 332 | |
| 333 | void AdBlockManagercxx . . $ AdBlockManager#::killServercxx . . $ AdBlockManager#killServer(49f6e7a06ebc5aa8).() { |
| 334 | m_cacheBlockscxx . . $ AdBlockManager#m_cacheBlocks..clearcxx . . $ QHash#clear(7d74265ff1b37f0c).(); |
| 335 | |
| 336 | if (m_serverProcesscxx . . $ AdBlockManager#m_serverProcess. != nullptr) { |
| 337 | disconnectcxx . . $ QObject#disconnect(bacd0f9184cd8ee1).(m_serverProcesscxx . . $ AdBlockManager#m_serverProcess., |
| 338 | QOverloadcxx . . $ QOverload#<int, QProcess::ExitStatus>::ofcxx . . $ QOverload#of(8e142c06a530e2ab).(&QProcesscxx . . $ QProcess#::finishedcxx . . $ QProcess#finished(15c350e1a5203cbf).), |
| 339 | this, |
| 340 | &AdBlockManagercxx . . $ AdBlockManager#::onServerProcessFinishedcxx . . $ AdBlockManager#onServerProcessFinished(15c350e1a5203cbf).); |
| 341 | |
| 342 | if (m_serverProcesscxx . . $ AdBlockManager#m_serverProcess.->statecxx . . $ QProcess#state(12547b18370478e0).() == QProcesscxx . . $ QProcess#::ProcessStatecxx . . $ QProcess#ProcessState#::Runningcxx . . $ QProcess#Running.) { |
| 343 | m_serverProcesscxx . . $ AdBlockManager#m_serverProcess.->killcxx . . $ QProcess#kill(49f6e7a06ebc5aa8).(); |
| 344 | } |
| 345 | |
| 346 | m_serverProcesscxx . . $ AdBlockManager#m_serverProcess.->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 347 | m_serverProcesscxx . . $ AdBlockManager#m_serverProcess. = nullptr; |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | void AdBlockManagercxx . . $ AdBlockManager#::updateUnifiedFilterscxx . . $ AdBlockManager#updateUnifiedFilters(49f6e7a06ebc5aa8).() { |
| 352 | if (QFilecxx . . $ QFile#::existscxx . . $ QFile#exists(e1defb592416720d).(m_unifiedFiltersFilecxx . . $ AdBlockManager#m_unifiedFiltersFile.)) { |
| 353 | QFilecxx . . $ QFile#::removecxx . . $ QFile#remove(e1defb592416720d).(m_unifiedFiltersFilecxx . . $ AdBlockManager#m_unifiedFiltersFile.); |
| 354 | } |
| 355 | |
| 356 | QStringcxx . . $ QString# unified_contentscxx . . $ QString#QString(ced63f7c635d850d).; |
| 357 | auto filter_lists = filterListscxx . . $ AdBlockManager#filterLists(2b25566bdf736d18).(); |
| 358 | |
| 359 | // Download filters one by one and append. |
| 360 | for (const QStringcxx . . $ QString#& filter_list_url : stdcxx . . $ std/::as_constcxx . . $ std/as_const(1dc117cbefefc300).(filter_lists)) { |
| 361 | if (filter_list_url.simplifiedcxx . . $ QString#simplified(dca2c5857e9adf82).().isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 362 | continue; |
| 363 | } |
| 364 | |
| 365 | QByteArraycxx . . $ QByteArray# outcxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 366 | auto res = NetworkFactorycxx . . $ NetworkFactory#::performNetworkOperationcxx . . $ NetworkFactory#performNetworkOperation(98c2fa0f32201561).(filter_list_url, |
| 367 | 4000, |
| 368 | {cxx . . $ QByteArray#QByteArray(ced63f7c635d850d).}, |
| 369 | out, |
| 370 | QNetworkAccessManagercxx . . $ QNetworkAccessManager#::Operationcxx . . $ QNetworkAccessManager#Operation#::GetOperationcxx . . $ QNetworkAccessManager#GetOperation.); |
| 371 | |
| 372 | if (res.m_networkErrorcxx . . $ NetworkResult#m_networkError. == QNetworkReplycxx . . $ QNetworkReply#::NetworkErrorcxx . . $ QNetworkReply#NetworkError#::NoErrorcxx . . $ QNetworkReply#NoError.) { |
| 373 | unified_contents =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). unified_contents.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::fromUtf8cxx . . $ QString#fromUtf8(4e15edac36d215be).(out)); |
| 374 | unified_contents =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). unified_contents.appendcxx . . $ QString#append(3a2ffbdf8ecc25e2).('\n'cxx . . $ QChar#QChar(93d577a3e9528307).); |
| 375 | |
| 376 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_ADBLOCKcxx . . $ `src/librssguard/definitions/definitions.h:169:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Downloaded filter list from" <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). QUOTE_W_SPACE_DOTcxx . . $ `src/librssguard/definitions/definitions.h:430:9`!(filter_list_url); |
| 377 | } |
| 378 | else { |
| 379 | throw NetworkExceptioncxx . . $ NetworkException#NetworkException(81288aee8e04c44a).(res.m_networkErrorcxx . . $ NetworkResult#m_networkError., trcxx . . $ AdBlockManager#tr(75d9f1c324b4579d).("failed to download filter list '%1'").argcxx . . $ QString#arg(ad0bca07273edcc2).(filter_list_url)); |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | unified_contents =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). unified_contents.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(customFilterscxx . . $ AdBlockManager#customFilters(2b25566bdf736d18).().joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("\n"))); |
| 384 | |
| 385 | // Save. |
| 386 | m_unifiedFiltersFilecxx . . $ AdBlockManager#m_unifiedFiltersFile. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). IOFactorycxx . . $ IOFactory#::getSystemFoldercxx . . $ IOFactory#getSystemFolder(7d8b34fbb6a9c1bf).(QStandardPathscxx . . $ QStandardPaths#::StandardLocationcxx . . $ QStandardPaths#StandardLocation#::TempLocationcxx . . $ QStandardPaths#TempLocation.) +cxx . . $ operator+(adfbdceb504720ce). |
| 387 | QDircxx . . $ QDir#::separatorcxx . . $ QDir#separator(44eb9225326fcbf5).() +cxx . . $ operator+(adfbdceb504720ce). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("adblock.filters"); |
| 388 | |
| 389 | IOFactorycxx . . $ IOFactory#::writeFilecxx . . $ IOFactory#writeFile(88f4c41ca0e941aa).(m_unifiedFiltersFilecxx . . $ AdBlockManager#m_unifiedFiltersFile., unified_contents.toUtf8cxx . . $ QString#toUtf8(ef52b713090bc85a).()); |
| 390 | } |
| 391 | |
| 392 | void AdBlockManagercxx . . $ AdBlockManager#::updateUnifiedFiltersFileAndStartServercxx . . $ AdBlockManager#updateUnifiedFiltersFileAndStartServer(49f6e7a06ebc5aa8).() { |
| 393 | killServercxx . . $ AdBlockManager#killServer(49f6e7a06ebc5aa8).(); |
| 394 | updateUnifiedFilterscxx . . $ AdBlockManager#updateUnifiedFilters(49f6e7a06ebc5aa8).(); |
| 395 | |
| 396 | if (m_enabledcxx . . $ AdBlockManager#m_enabled.) { |
| 397 | auto custom_port = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->customAdblockPortcxx . . $ Application#customAdblockPort(455f465bc33b4cdf).(); |
| 398 | |
| 399 | m_serverProcesscxx . . $ AdBlockManager#m_serverProcess. = startServercxx . . $ AdBlockManager#startServer(441b0ec0e9d37395).(custom_port > 0 ? custom_port : ADBLOCK_SERVER_PORTcxx . . $ `src/librssguard/definitions/definitions.h:20:9`!); |
| 400 | } |
| 401 | } |