Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Analysis of Sourceforge's adware infested installer.
- ---------------------------------------------------------------------------
- Sourceforge was recently sold to Dice Holdings, which started its DevShare program. FileZilla has been bundling this installer; many others are too. So I decided to analyse it in real depth.
- General information:
- ---------------------------------------------------------------------------
- Filename: SFInstaller_SFFZ_filezilla_8992693_.exe
- SHA256 : 8d29ac224f4bd9a6671c037ffb1ae0265aaa41581e7bb6f168f301517a16e18a
- Entropy : 4.32056
- TrID: 67.3% (.EXE) Win32 Executable MS Visual C++ (generic) (31206/45/13)
- Resource segment:
- ---------------------------------------------------------------------------
- It reveals quite a bit. The full contents have been posted, if anyone else wants to analyse. If you lack time, read the notes at the top of each file's contents.
- List of files:
- ./BITMAP/109.bmp
- ./BITMAP/208.bmp
- ./BITMAP/209.bmp
- ./BITMAP/210.bmp
- ./BKG/ERROR.PNG
- ./BKG/FINISH.PNG
- ./BKG/SATTB.PNG
- ./BKG/TB.PNG
- ./DIALOG/106
- ./DIALOG/108
- ./DIALOG/109
- ./GROUP_ICON/99
- ./HTM/ORCHESTRATOR.HTML
- ./ICON/1.ico
- ./ICON/2.ico
- ./ICON/3.ico
- ./ICON/4.ico
- ./JAVASCRIPT/JSON.JS
- ./JAVASCRIPT/OBJECTMODEL.JS
- ./JAVASCRIPT/RULES.JS
- ./MANIFEST/1
- ./MANIFEST/204
- ./string.txt
- ./TYPELIB/1
- ./VERSION/1
- ./XML/ANALYTICS.XML
- ./XML/UI.XML
- Contents of interesting files are given below:
- string.txt
- ===========================================================================
- 100 AskInstaller
- 104 www.ask.com
- 107 Connecting...
- 110 http://apnpip.ask.com/PIP/partners/{partnerid}/config.xml
- 112 Are you sure you want to cancel installation?
- 113 1
- 114 Unknown command line argument:
- 118 http://www.163.com
- 119 City
- ===========================================================================
- XML/ANALYTICS.XML
- ===========================================================================
- <?xml version="1.0" encoding="utf-8"?>
- <root>
- <GeneralParameters>
- <PreviousX>250</PreviousX>
- <PreviousY>37</PreviousY>
- <NextX>169</NextX>
- <NextY>37</NextY>
- <CancelX>88</CancelX>
- <CancelY>37</CancelY>
- <Height>399</Height>
- <Width>513</Width>
- <bgColor>EFEBDF</bgColor>
- <RegistryKey>HKEY_CURRENT_USER\Software\APN PIP\Analytics\{partnerid}</RegistryKey>
- <ReportSever>anx.apnanalytics.com/200/pip/test.gif?</ReportSever>
- <PIPReportSever>pipoffers.apnpartners.com/PIP/OfferAccept.jhtml</PIPReportSever>
- <HideEula>1</HideEula>
- <GetServer>http://pipoffers.apnpartners.com/PIP/Server.jhtml?partner_id={partnerid}&language={locale}</GetServer>
- <HideTitleBar>1</HideTitleBar>
- <CustomTitleHeight>50</CustomTitleHeight>
- <CustomCloseWidth>70</CustomCloseWidth>
- <CustomCloseHeight>25</CustomCloseHeight>
- <DefaultUiReadyTimeout>30</DefaultUiReadyTimeout>
- <Parameters>
- <pAppID id="pAppID" position="2" report="N" get="Y"/>
- <pProductID id="pProductID" position="3" report="Y" get="Y"/>
- </Parameters>
- </GeneralParameters>
- <stringtable>
- <Language langID="en">
- <string id="STRID_TITLE">FrostWire Setup</string>
- <string id="STRID_TEXT1">Press Page Down to see the rest of the agreement.</string>
- <string id="STRID_EULA">If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to install FrostWire 4.21.3</string>
- <string id="STRID_EULA1">www.FrostWire.com</string>
- <string id="STRID_NEXT">I Agree</string>
- <string id="STRID_CANCEL">Cancel</string>
- <string id="STRID_CANCEL_TEXT">Are you sure you want to cancel installation?</string>
- </Language>
- </stringtable>
- <offereula>
- <offer id = "{cpf1}" title="STRID_TITLE" icUrl="" icParams="" icProceed="" color="" transparency="255" display="true" bkgImage="" imagewidth= "" bgcolor="#EFEBDF" imageheight="" displayname="" switchcontroltype="checkbox">
- <apps>
- </apps>
- <!-- UI button controls-->
- <controls>
- <control id="txt1-of10" type="text" text="" width="420" height="190" x="30" y="80" color="" bgcolor="#ffffff" isBold="false">
- <control id="eula" type="checkbox" text="STRID_EULA" width="400" height="40" x="50" y="90" color="" bgcolor="" checked="false" isBold="true" ctrltype="offer" ctrlvalue="true" subctr=""></control>
- <control id="txt1-of11" type="text" text="Frostwire Demo Starting....." width="400" height="60" x="0" y="0" color="" bgcolor="#FFD793" fontsize="20" isBold="true"></control>
- </control>
- </controls>
- </offer>
- </offereula>
- <apnanalytics>
- </apnanalytics>
- </root>
- ===========================================================================
- XML/UI.XML
- ===========================================================================
- <?xml version="1.0" encoding="UTF-8"?>
- <root>
- <OwnerInformation>
- <owner>
- <name>Vishal Shah</name>
- <organization>APN Toolbar</organization>
- </owner>
- </OwnerInformation>
- <GeneralParameters>
- <Height>560</Height>
- <Width>660</Width>
- <bgcolor>efebdf</bgcolor>
- <dlg_transparency>255</dlg_transparency>
- <defaultLanguage>en</defaultLanguage>
- <ShowOfferScreensOnly>true</ShowOfferScreensOnly>
- <MessageUser>false</MessageUser>
- <BalloonIconPath>http://ak.pipoffers.apnpartners.com/static/partners/{partnerid}/images/install.ico</BalloonIconPath>
- <TrayTipTime>2000</TrayTipTime>
- <PreviousX>0</PreviousX>
- <PreviousY>0</PreviousY>
- <NextX>185</NextX>
- <NextY>32</NextY>
- <CancelX>622</CancelX>
- <CancelY>32</CancelY>
- <CancelDeclinesOffer>true</CancelDeclinesOffer>
- <RetryTimeout>300</RetryTimeout>
- <NumberOfSecOffersToShow>1</NumberOfSecOffersToShow>
- <Orchestrator>http://ak.pipoffers.apnpartners.com/static/resources/ui/html/orchestrator.html?PIPPID=SF1&PTBPartnerID=&STBPartnerID=&tbType=vanilla&version={version}</Orchestrator>
- <CBID>B0E</CBID>
- <TrackID>default</TrackID>
- <Title>SourceForge Installer</Title>
- <HidePrevious>true</HidePrevious>
- <optintextsize>12</optintextsize>
- <ProgressBarCancelClickable>true</ProgressBarCancelClickable>
- <ShowLoadingScreen>false</ShowLoadingScreen>
- <showprogcanceldlg>false</showprogcanceldlg>
- <ShowProgressDlg>false</ShowProgressDlg>
- <BtnBkg_Cancel>http://ak.pipoffers.apnpartners.com/static/partners/SF1/images/decline.png</BtnBkg_Cancel>
- <BtnBkg_Finish>http://ak.pipoffers.apnpartners.com/static/partners/SF1/images/accept.png</BtnBkg_Finish>
- <BtnBkg_Next>http://ak.pipoffers.apnpartners.com/static/partners/SF1/images/accept.png</BtnBkg_Next>
- <CancelHeight>34</CancelHeight>
- <CancelWidth>146</CancelWidth>
- <IsImageButton>true</IsImageButton>
- <NextHeight>34</NextHeight>
- <NextWidth>146</NextWidth>
- </GeneralParameters>
- <LanguageParameters>
- <ExecutingText id="default">STRID_ExeText</ExecutingText>
- <FailureText id="default">STRID_FAILURE</FailureText>
- <CancelContinue id="default">STRID_CContinue</CancelContinue>
- <CancelForce id="default">STRID_CForce</CancelForce>
- <WaitAndTerminate id="default">STRID_WaitAndTerminate</WaitAndTerminate>
- <Previous id="default">STRID_Previous</Previous>
- <Next id="default">STRID_Next</Next>
- <Finish id="default">STRID_Finish</Finish>
- <Cancel id="default">STRID_Cancel</Cancel>
- <CancelText id="default">STRID_Cancel_Text</CancelText>
- <EulaText id="default">STRID_Eula_Text</EulaText>
- <OptinText id="default">STRID_Optin_Text</OptinText>
- <DownloadingText id="default">STRID_Downloading_Text</DownloadingText>
- <NoOfferText id="default">No Offer Text</NoOfferText>
- <DownloadingError id="default">STRID_Downloading_Error</DownloadingError>
- <LoadingText id="default">STRID_Loading_Text</LoadingText>
- <LoadingTitle id="default">STRID_Loading_Title</LoadingTitle>
- <AnalyticsFail id="default">STRID_Access_Analytics_Fail</AnalyticsFail>
- <AccessConfigFail id="default">STRID_Access_Config_Fail</AccessConfigFail>
- <AccessOfferXmlFail id="default">STRID_Access_OfferXml_Fail</AccessOfferXmlFail>
- <OfferXmlMiss id="default">STRID_OfferXml_Miss</OfferXmlMiss>
- <UnexpectedDownLoadFail id="default">STRID_Unexpected_DownLoad_Fail</UnexpectedDownLoadFail>
- <CancelInstalling id="default">STRID_Cancel_Install_text</CancelInstalling>
- <CancelOptContinue id="default">STRID_Cancel_Continue</CancelOptContinue>
- <CancelOptForce id="default">STRID_Cancel_Force</CancelOptForce>
- <CancelOptWait id="default">STRID_Cancel_Wait</CancelOptWait>
- <Executingfile id="default">STRID_Executingfile</Executingfile>
- <BalloonText id="default">STRID_BallonText</BalloonText>
- <BalloonIconTitle id="default">STRID_BALLOONICONTITLE</BalloonIconTitle>
- <MessageBoxTitle id="default">STRID_MessageBoxTitle</MessageBoxTitle>
- <MESSAGE_BOX_ID_YES id="default">STRID_MESSAGE_ID_YES</MESSAGE_BOX_ID_YES>
- <MESSAGE_BOX_ID_NO id="default">STRID_MESSAGE_ID_NO</MESSAGE_BOX_ID_NO>
- </LanguageParameters>
- <stringtable>
- <language langid="en">
- <string id="STRID_CContinue">Continue</string>
- <string id="STRID_CForce">Force Cancel</string>
- <string id="STRID_Previous">Previous</string>
- <string id="STRID_Back">Back</string>
- <string id="STRID_Back_FXTV5">< Back</string>
- <string id="STRID_Next">Next</string>
- <string id="STRID_Accept">Accept</string>
- <string id="STRID_Accept_BCPA">I Accept</string>
- <string id="STRID_Run">Run</string>
- <string id="STRID_Accept_Continue">Accept and Continue</string>
- <string id="STRID_Install_BCPA">Install</string>
- <string id="STRID_Accept_SFT">I Agree</string>
- <string id="STRID_Agree">Agree</string>
- <string id="STRID_Decline">Decline</string>
- <string id="STRID_Next_FXTV5">Next ></string>
- <string id="STRID_Finish">Next</string>
- <string id="STRID_Finish2">Finish</string>
- <string id="STRID_Install">Install</string>
- <string id="STRID_OK">OK</string>
- <string id="STRID_Cancel">Cancel</string>
- <string id="STRID_IAgree">I Agree</string>
- <string id="STRID_Idisagree">I Disagree</string>
- <string id="STRID_Cancel_Text">Are you sure you want to cancel?</string>
- <string id="STRID_FXTV5_Cancel_Text">Setup is not complete. If you exit now, the program will not be installed. You may run Setup again another time to complete the installation. Exit Setup?</string>
- <string id="STRID_Success_Text">The installation has completed successfully.</string>
- <string id="STRID_Eula_Text">If you do not want to share technical information with ASK, please un_check and click Next</string>
- <string id="STRID_Optin_Text">By clicking 'NEXT', I agree to the</string>
- <string id="STRID_Downloading_Text">Downloading file</string>
- <string id="STRID_No_Offer_Text">There is a problem with the installer. Please contact your software provider and inform them of the issue.</string>
- <string id="STRID_Downloading_Error">There was a problem downloading the files. Please check that you have a valid Internet connection and try again.</string>
- <string id="STRID_Decline_TEST2">Cancel</string>
- <string id="STRID_Downloading_Error_Avery">There was a problem downloading the files. Please try the Template Only option on the Avery.com template page.</string>
- <string id="STRID_DIC2V5_Loading_Text">Loading Dictionary.com required files...</string>
- <string id="STRID_DIC2V5_Loading_Title">Dictionary.com Setup</string>
- <string id="STRID_TEST2_Loading_Text">Loading Download.com required files...</string>
- <string id="STRID_TEST2_Loading_Title">Cnet Download.com Setup</string>
- <string id="STRID_DIC3V5_Loading_Text">Loading Dictionary.com required files...</string>
- <string id="STRID_DIC3V5_Loading_Title">Dictionary.com Setup</string>
- <string id="STRID_Loading_Text">Loading required files...</string>
- <string id="STRID_AD5_Loading_Text">Loading Avery Template Installer required files...</string>
- <string id="STRID_AD5_Loading_Title">Avery Template Installer</string>
- <string id="STRID_Loading_Title">Loading</string>
- <string id="STRID_Access_Analytics_Fail">There was a problem accessing the analytics file!</string>
- <string id="STRID_Access_Analytics_Fail_Avery">There was a problem downloading the files. Please try the Template Only option on the Avery.com template page.</string>
- <string id="STRID_Access_Config_Fail">There was a problem accessing the config file!</string>
- <string id="STRID_Access_Config_Fail_Avery">There was a problem downloading the files. Please try the Template Only option on the Avery.com template page.</string>
- <string id="STRID_Access_OfferXml_Fail">There was a problem accessing the offer definition file!</string>
- <string id="STRID_Access_OfferXml_Fail_Avery">There was a problem downloading the files. Please try the Template Only option on the Avery.com template page.</string>
- <string id="STRID_OfferXml_Miss">The installation files have been corrupted. Please re-download the application and try again.</string>
- <string id="STRID_OfferXml_Miss_Avery">There was a problem downloading the files. Please try the Template Only option on the Avery.com template page.</string>
- <string id="STRID_Unexpected_DownLoad_Fail">There was a problem downloading the files. Please check that you have a valid Internet connection and try again.</string>
- <string id="STRID_Unexpected_DownLoad_Fail_Avery">There was a problem downloading the files. Please try the Template Only option on the Avery.com template page.</string>
- <string id="STRID_Cancel_Install_text">Cancelling this process is not advised. You will need to uninstall via Add/Remove programs.</string>
- <string id="STRID_Executingfile">PIP Installing...</string>
- <string id="STRID_MESSAGE_ID_YES">OK</string>
- <string id="STRID_MESSAGE_ID_NO">Cancel</string>
- <string id="STRID_ExeText_CouponFinder">{PERCENT}%</string>
- <string id="STRID_DownloadingText_CouponFinder">{PERCENT}%</string>
- </language>
- </stringtable>
- <primary_offers>
- <offer bkgImage="http://ak.pipoffers.apnpartners.com/static/partners/error.png" cancelX="0" cancelY="0" id="SF_error" imageheight="560" imagewidth="660" isMainOffer="false" nextBkg="http://ak.pipoffers.apnpartners.com/static/partners/SF1/images/finish.png" nextHeight="34" nextWidth="146" nextX="185" nextY="32" offerType="Static" optout="true" transparency="255">
- <apps>
- </apps>
- <controls>
- </controls>
- </offer>
- </primary_offers>
- </root>
- ===========================================================================
- HTM/ORCHESTRATOR.HTML (The code was lifted perhaps from somewhere else. So much comments?)
- ===========================================================================
- <HTML>
- <HEAD>
- <script type="text/javascript">
- var JSON;
- if (!JSON) {
- JSON = {};
- }
- (function () {
- "use strict";
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
- if (typeof Date.prototype.toJSON !== 'function') {
- Date.prototype.toJSON = function (key) {
- return isFinite(this.valueOf()) ?
- this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z' : null;
- };
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
- function quote(string) {
- // If the string contains no control characters, no quote characters, and no
- // backslash characters, then we can safely slap some quotes around it.
- // Otherwise we must also replace the offending characters with safe escape
- // sequences.
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string' ? c :
- '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
- function str(key, holder) {
- // Produce a string from holder[key].
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
- // If the value has a toJSON method, call it to obtain a replacement value.
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
- // If we were called with a replacer function, then call the replacer to
- // obtain a replacement value.
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
- // What happens next depends on the value's type.
- switch (typeof value) {
- case 'string':
- return quote(value);
- case 'number':
- // JSON numbers must be finite. Encode non-finite numbers as null.
- return isFinite(value) ? String(value) : 'null';
- case 'boolean':
- case 'null':
- // If the value is a boolean or null, convert it to a string. Note:
- // typeof null does not produce 'null'. The case is included here in
- // the remote chance that this gets fixed someday.
- return String(value);
- // If the type is 'object', we might be dealing with an object or an array or
- // null.
- case 'object':
- // Due to a specification blunder in ECMAScript, typeof null is 'object',
- // so watch out for that case.
- if (!value) {
- return 'null';
- }
- // Make an array to hold the partial results of stringifying this object value.
- gap += indent;
- partial = [];
- // Is the value an array?
- if (Object.prototype.toString.apply(value) === '[object Array]') {
- // The value is an array. Stringify every element. Use null as a placeholder
- // for non-JSON values.
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
- // Join all of the elements together, separated with commas, and wrap them in
- // brackets.
- v = partial.length === 0 ? '[]' : gap ?
- '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
- '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
- // If the replacer is an array, use it to select the members to be stringified.
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
- // Otherwise, iterate through all of the keys in the object.
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
- // Join all of the member texts together, separated with commas,
- // and wrap them in braces.
- v = partial.length === 0 ? '{}' : gap ?
- '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
- '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
- // If the JSON object does not yet have a stringify method, give it one.
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
- // The stringify method takes a value and an optional replacer, and an optional
- // space parameter, and returns a JSON text. The replacer can be a function
- // that can replace values, or an array of strings that will select the keys.
- // A default replacer method can be provided. Use of the space parameter can
- // produce text that is more easily readable.
- var i;
- gap = '';
- indent = '';
- // If the space parameter is a number, make an indent string containing that
- // many spaces.
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
- // If the space parameter is a string, it will be used as the indent string.
- } else if (typeof space === 'string') {
- indent = space;
- }
- // If there is a replacer, it must be a function or an array.
- // Otherwise, throw an error.
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
- // Make a fake root object containing our value under the key of ''.
- // Return the result of stringifying the value.
- return str('', {'': value});
- };
- }
- // If the JSON object does not yet have a parse method, give it one.
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
- // The parse method takes a text and an optional reviver function, and returns
- // a JavaScript value if the text is a valid JSON text.
- var j;
- function walk(holder, key) {
- // The walk method is used to recursively walk the resulting structure so
- // that modifications can be made.
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
- // Parsing happens in four stages. In the first stage, we replace certain
- // Unicode characters with escape sequences. JavaScript handles many characters
- // incorrectly, either silently deleting them, or treating them as line endings.
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
- // In the second stage, we run the text against regular expressions that look
- // for non-JSON patterns. We are especially concerned with '()' and 'new'
- // because they can cause invocation, and '=' because it can cause mutation.
- // But just to be safe, we want to reject all unexpected forms.
- // We split the second stage into 4 regexp operations in order to work around
- // crippling inefficiencies in IE's and Safari's regexp engines. First we
- // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
- // replace all simple value tokens with ']' characters. Third, we delete all
- // open brackets that follow a colon or comma or that begin the text. Finally,
- // we look to see that the remaining characters are only whitespace or ']' or
- // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
- if (/^[\],:{}\s]*$/
- .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
- // In the third stage we use the eval function to compile the text into a
- // JavaScript structure. The '{' operator is subject to a syntactic ambiguity
- // in JavaScript: it can begin a block or an object literal. We wrap the text
- // in parens to eliminate the ambiguity.
- j = eval('(' + text + ')');
- // In the optional fourth stage, we recursively walk the new structure, passing
- // each name/value pair to a reviver function for possible transformation.
- return typeof reviver === 'function' ?
- walk({'': j}, '') : j;
- }
- // If the text is not JSON parseable, then a SyntaxError is thrown.
- throw new SyntaxError('JSON.parse');
- };
- }
- }());
- </script>
- <script type="text/javascript" src="./objectModel.js"></script>
- <script type="text/javascript" src="./rules.js"></script>
- <script type="text/javascript">
- var primaryTlbrID = getURLParameters("PTBPartnerID");
- var satTlbrID = getURLParameters("STBPartnerID");
- var pipPartnerID = getURLParameters("PIPPID");
- var tbType=getURLParameters("tbType");
- var version=getURLParameters("version");
- var hidePtnrSecondaryOffer=getURLParameters("hideSecondary");
- var paramName;
- function getURLParameters(paramName)
- {
- var sURL = window.document.URL.toString();
- if (sURL.indexOf("?") > 0)
- {
- var arrParams = sURL.split("?");
- var arrURLParams = arrParams[1].split("&");
- var arrParamNames = new Array(arrURLParams.length);
- var arrParamValues = new Array(arrURLParams.length);
- var i = 0;
- for (i=0;i<arrURLParams.length;i++)
- {
- var sParam = arrURLParams[i].split("=");
- arrParamNames[i] = sParam[0];
- if (sParam[1] != "")
- arrParamValues[i] = unescape(sParam[1]);
- else
- arrParamValues[i] = "No Value";
- }
- for (i=0;i<arrURLParams.length;i++)
- {
- if(arrParamNames[i] == paramName){
- return arrParamValues[i];
- }
- }
- return "No Parameters Found";
- }
- return "";
- }
- </script>
- <SCRIPT type="text/javascript">
- init();
- function load() {
- try{
- piprule.setRuleCallback(
- function(ruleName){
- try{
- logger.log("\r\n ****** pirule setRule callBackFired : function called is " + "Rule name: " + ruleName + "Number: " + arguments.length);
- var params = Array.prototype.slice.call(arguments, 1);
- return window[ruleName].apply(this, params);
- }
- catch(e)
- {
- logger.log("\r\n ****** inside load " + e.message + " Rule name: " + ruleName);
- }
- }
- );
- } catch(e) {
- logger.log("\r\n ****** Load Function Error " + e.message);
- }
- }
- </SCRIPT>
- </HEAD>
- <BODY onload="load()">
- </BODY>
- </HTML>
- JAVASCRIPT/JSON.HTML
- (They forgot to minify! Of course, I can excuse them, since top programmers hardly make adware.)
- ===========================================================================
- /*
- http://www.JSON.org/json2.js
- 2011-02-23
- Public Domain.
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
- See http://www.JSON.org/js.html
- This code should be minified before deployment.
- See http://javascript.crockford.com/jsmin.html
- USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
- NOT CONTROL.
- This file creates a global JSON object containing two methods: stringify
- and parse.
- JSON.stringify(value, replacer, space)
- value any JavaScript value, usually an object or array.
- replacer an optional parameter that determines how object
- values are stringified for objects. It can be a
- function or an array of strings.
- space an optional parameter that specifies the indentation
- of nested structures. If it is omitted, the text will
- be packed without extra whitespace. If it is a number,
- it will specify the number of spaces to indent at each
- level. If it is a string (such as '\t' or ' '),
- it contains the characters used to indent at each level.
- This method produces a JSON text from a JavaScript value.
- When an object value is found, if the object contains a toJSON
- method, its toJSON method will be called and the result will be
- stringified. A toJSON method does not serialize: it returns the
- value represented by the name/value pair that should be serialized,
- or undefined if nothing should be serialized. The toJSON method
- will be passed the key associated with the value, and this will be
- bound to the value
- For example, this would serialize Dates as ISO strings.
- Date.prototype.toJSON = function (key) {
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
- You can provide an optional replacer method. It will be passed the
- key and value of each member, with this bound to the containing
- object. The value that is returned from your method will be
- serialized. If your method returns undefined, then the member will
- be excluded from the serialization.
- If the replacer parameter is an array of strings, then it will be
- used to select the members to be serialized. It filters the results
- such that only members with keys listed in the replacer array are
- stringified.
- Values that do not have JSON representations, such as undefined or
- functions, will not be serialized. Such values in objects will be
- dropped; in arrays they will be replaced with null. You can use
- a replacer function to replace those with JSON values.
- JSON.stringify(undefined) returns undefined.
- The optional space parameter produces a stringification of the
- value that is filled with line breaks and indentation to make it
- easier to read.
- If the space parameter is a non-empty string, then that string will
- be used for indentation. If the space parameter is a number, then
- the indentation will be that many spaces.
- Example:
- text = JSON.stringify(['e', {pluribus: 'unum'}]);
- // text is '["e",{"pluribus":"unum"}]'
- text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
- // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
- text = JSON.stringify([new Date()], function (key, value) {
- return this[key] instanceof Date ?
- 'Date(' + this[key] + ')' : value;
- });
- // text is '["Date(---current time---)"]'
- JSON.parse(text, reviver)
- This method parses a JSON text to produce an object or array.
- It can throw a SyntaxError exception.
- The optional reviver parameter is a function that can filter and
- transform the results. It receives each of the keys and values,
- and its return value is used instead of the original value.
- If it returns what it received, then the structure is not modified.
- If it returns undefined then the member is deleted.
- Example:
- // Parse the text. Values that look like ISO date strings will
- // be converted to Date objects.
- myData = JSON.parse(text, function (key, value) {
- var a;
- if (typeof value === 'string') {
- a =
- /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
- return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
- +a[5], +a[6]));
- }
- }
- return value;
- });
- myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
- var d;
- if (typeof value === 'string' &&
- value.slice(0, 5) === 'Date(' &&
- value.slice(-1) === ')') {
- d = new Date(value.slice(5, -1));
- if (d) {
- return d;
- }
- }
- return value;
- });
- This is a reference implementation. You are free to copy, modify, or
- redistribute.
- */
- /*jslint evil: true, strict: false, regexp: false */
- /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
- call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
- getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
- lastIndex, length, parse, prototype, push, replace, slice, stringify,
- test, toJSON, toString, valueOf
- */
- // Create a JSON object only if one does not already exist. We create the
- // methods in a closure to avoid creating global variables.
- var JSON;
- if (!JSON) {
- JSON = {};
- }
- (function () {
- "use strict";
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
- if (typeof Date.prototype.toJSON !== 'function') {
- Date.prototype.toJSON = function (key) {
- return isFinite(this.valueOf()) ?
- this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z' : null;
- };
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
- function quote(string) {
- // If the string contains no control characters, no quote characters, and no
- // backslash characters, then we can safely slap some quotes around it.
- // Otherwise we must also replace the offending characters with safe escape
- // sequences.
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string' ? c :
- '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
- function str(key, holder) {
- // Produce a string from holder[key].
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
- // If the value has a toJSON method, call it to obtain a replacement value.
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
- // If we were called with a replacer function, then call the replacer to
- // obtain a replacement value.
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
- // What happens next depends on the value's type.
- switch (typeof value) {
- case 'string':
- return quote(value);
- case 'number':
- // JSON numbers must be finite. Encode non-finite numbers as null.
- return isFinite(value) ? String(value) : 'null';
- case 'boolean':
- case 'null':
- // If the value is a boolean or null, convert it to a string. Note:
- // typeof null does not produce 'null'. The case is included here in
- // the remote chance that this gets fixed someday.
- return String(value);
- // If the type is 'object', we might be dealing with an object or an array or
- // null.
- case 'object':
- // Due to a specification blunder in ECMAScript, typeof null is 'object',
- // so watch out for that case.
- if (!value) {
- return 'null';
- }
- // Make an array to hold the partial results of stringifying this object value.
- gap += indent;
- partial = [];
- // Is the value an array?
- if (Object.prototype.toString.apply(value) === '[object Array]') {
- // The value is an array. Stringify every element. Use null as a placeholder
- // for non-JSON values.
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
- // Join all of the elements together, separated with commas, and wrap them in
- // brackets.
- v = partial.length === 0 ? '[]' : gap ?
- '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
- '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
- // If the replacer is an array, use it to select the members to be stringified.
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
- // Otherwise, iterate through all of the keys in the object.
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
- // Join all of the member texts together, separated with commas,
- // and wrap them in braces.
- v = partial.length === 0 ? '{}' : gap ?
- '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
- '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
- // If the JSON object does not yet have a stringify method, give it one.
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
- // The stringify method takes a value and an optional replacer, and an optional
- // space parameter, and returns a JSON text. The replacer can be a function
- // that can replace values, or an array of strings that will select the keys.
- // A default replacer method can be provided. Use of the space parameter can
- // produce text that is more easily readable.
- var i;
- gap = '';
- indent = '';
- // If the space parameter is a number, make an indent string containing that
- // many spaces.
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
- // If the space parameter is a string, it will be used as the indent string.
- } else if (typeof space === 'string') {
- indent = space;
- }
- // If there is a replacer, it must be a function or an array.
- // Otherwise, throw an error.
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
- // Make a fake root object containing our value under the key of ''.
- // Return the result of stringifying the value.
- return str('', {'': value});
- };
- }
- // If the JSON object does not yet have a parse method, give it one.
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
- // The parse method takes a text and an optional reviver function, and returns
- // a JavaScript value if the text is a valid JSON text.
- var j;
- function walk(holder, key) {
- // The walk method is used to recursively walk the resulting structure so
- // that modifications can be made.
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
- // Parsing happens in four stages. In the first stage, we replace certain
- // Unicode characters with escape sequences. JavaScript handles many characters
- // incorrectly, either silently deleting them, or treating them as line endings.
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
- // In the second stage, we run the text against regular expressions that look
- // for non-JSON patterns. We are especially concerned with '()' and 'new'
- // because they can cause invocation, and '=' because it can cause mutation.
- // But just to be safe, we want to reject all unexpected forms.
- // We split the second stage into 4 regexp operations in order to work around
- // crippling inefficiencies in IE's and Safari's regexp engines. First we
- // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
- // replace all simple value tokens with ']' characters. Third, we delete all
- // open brackets that follow a colon or comma or that begin the text. Finally,
- // we look to see that the remaining characters are only whitespace or ']' or
- // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
- if (/^[\],:{}\s]*$/
- .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
- // In the third stage we use the eval function to compile the text into a
- // JavaScript structure. The '{' operator is subject to a syntactic ambiguity
- // in JavaScript: it can begin a block or an object literal. We wrap the text
- // in parens to eliminate the ambiguity.
- j = eval('(' + text + ')');
- // In the optional fourth stage, we recursively walk the new structure, passing
- // each name/value pair to a reviver function for possible transformation.
- return typeof reviver === 'function' ?
- walk({'': j}, '') : j;
- }
- // If the text is not JSON parseable, then a SyntaxError is thrown.
- throw new SyntaxError('JSON.parse');
- };
- }
- }());
- ===========================================================================
- JAVASCRIPT/OBJECTMODEL.JS
- ===========================================================================
- var objectModel = {};
- objectModel.initialized = false;
- function init() {
- if (objectModel.initialized === false && typeof window !== "undefined" &&
- typeof window.external !== "undefined") {
- logger = {};
- _logger = window.external.GetObject("logger");
- try {
- logger.log = function(var1) {
- return _logger.log(var1);
- };
- logger.error = function(var1) {
- return _logger.error(var1);
- };
- logger.debug = function(var1) {
- return _logger.debug(var1);
- };
- logger.info = function(var1) {
- return _logger.info(var1);
- };
- logger.warn = function(var1) {
- return _logger.warn(var1);
- };
- logger.group = function(var1) {
- return _logger.group(var1);
- };
- logger.dir = function(var1) {
- return _logger.dir(var1);
- };
- } catch (x) {
- logger.error(x);
- }
- browser = window.external.GetObject("browserinfo");
- system = window.external.GetObject("system");
- piprule = window.external.GetObject("piprule");
- pipclient = window.external.GetObject("pipclient");
- }
- };
- ===========================================================================
- JAVASCRIPT/RULES.JS
- (Hardcoded list of offers, and even maximum limits as to how many toolbars can be installed. Also, it collects data about what is installed.)
- ===========================================================================
- var regsistryPathx64 = "HKEY_LOCAL_MACHINE\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\";
- var registryPathx86 = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\";
- var checkObj;
- var n;
- var registryPath;
- var regValue="";
- var partnerID;
- var v5toolbarOffered = false;
- var v6SaturationToolbarOfferFlag = false;
- var overinstallFlag=false;
- var reasonString="";
- var showSecondaryOffer=true;
- var defBrowser="";
- var FIREFOX="firefox";
- var IE="Internet Explorer";
- var CHROME="Google Chrome";
- var offerAviraV6NewInstall = false;
- var primaryToolbarOfferFlag=false;
- var v5ToolbarInstalled = "1:Offer cannot be installed as offer already exists";
- var V6OfferAlreadyPresentWithSamePartnerID = "1:V6 Offer already present with same partnerID";
- var unsupportedBrowser = "2:Unsupported default browser";
- var IneligibleChrome = "3:Ineligible Chrome";
- var v6SatInstalled = "4:Prior toolbar typet (Shopping)";
- var PriorToolbarType_Vanilla_SecureVanilla = "4:Prior toolbar type(Vanilla)/Secure Vanilla ";
- var blocklistedPartner = "5:Block V6 ? New toolbar listed in the block list";
- var BlockListV6IncumbentToolbarIsListedInLockList = "6:Block list v6 - incumbent toolbar is listed as block list ";
- var v5Offerpresented = "7:Saturation offer was not made because primary offer was made";
- var SideBySideLimitExceeded = "8:Side by side limit exceeded";
- var secondaryOfferRejected = "9:Secondary offer rejected as Primary or Saturation offer was made";
- var precheckSecondary = "10:Secondary offer rejected as Manycam Saturation offer was made";
- var secondaryOfferInstalled = "11:Secondary Offer was not made as offer already exists";
- var UnsupportedOSXP64bit = "11:Unsupported OS XP 64 bit";
- var XPServicePackNotCompatible = "13:XP Service Pack not compatible ";
- var CPUSpeedLessThan1000MHZ = "14:CPU speed less than 1000 MHZ ";;
- var MachineDiskFreeSpaceLessThan2000MB = "15:64 bit machine Disk free space less than 2000MB ";
- var MachineDiskFreeSpaceLessThan850MB = "16:32 bit machine Disk free space less than 850MB ";
- var SystemPhysicalMemoryIsVeryLow = "17:System Physical Memory is very low";
- var NortonSafeSearchToolbarInstalled = "17:Norton Safe search Toolbar installed";
- var AnchorFreeUnsupportedOS = "18: AnchorFree unsupported OS XP or Vista 64bit ";
- var AviraToolbarPresentAskSecureOfferRejected = "19: Avira Toolbar present, Ask secure offer rejected";
- var AskSecureToolbarPresentAviraOfferRejected = "20:Ask Secure toolbar present, Avira offer rejected";
- var AudialsOfferNotEligibleUnsupportedOSXP32orVista64bit = "20: Audials offer not eligible as unsupported OS XP 32 or Vista 64 bit";
- var AviraV6InstallOfferPresentedAviraV6UpgradeRejected = "21:Avira V6 new Install offer presented, Avira V6 Upgrade rejected";
- var AviraV6InstallOfferRejectedAviraV6UpgradeOfferPresented = "22:Avira V6 new Install offer rejected, Avira V6 Upgrade Offer/Ask Secure Offer presented";
- var PrimaryToolbarOfferPresentedDefaultPrimaryOfferRejected = "23:Primary Toolbar Offer presented, The default primary offer rejected";
- var OldClientAskSecureOfferNotSupported = "24:Old Client AskSecure offer not supported";
- var maxNumberOfPartnersExceeded = "25:Maximum Number of Unique Partners Already Exists";
- var tbtypeOfBlockPIDNotEqual = "26:A Toolbar Type is of type block, PIDs are NOT equal";
- var inputBrowserTypeNotSupported = "27:Input Browser Type is NOT Supported";
- var inputIEBrowserVersionNotSupported = "28:IE Browser Version Is NOT Supported";
- var inputCRBrowserVersionNotSupported = "29:CR Browser Version Is NOT Supported";
- var inputFFBrowserVersionNotSupported = "30:FF Browser Version Is NOT Supported";
- var PIDsAreSameOnSameBrowser = "31:PIDs Are the Same, On the Same Browser";
- var toolbarTypeCollision = "32:On the Same Browser, Toolbar Types Collide";
- var PIDIsOnBlockedList = "33:PID is on Block List"
- var AlreadyAtMaxNumberOfPartnersPerBrowser = "34:Already At Maximum Number of Partners Per Browser";
- var uniquePIDTbType = "35:Toolbar Type is already owned by PID";
- var jsonString={
- "blocklistedPartners": ["FTB","FTB4","OVO2","WCL2","WCL3"],
- "makeofferdisabled": [
- "WCL2","ACDS","ADS","AF3-SRS","AGH","ALSV5-DL","AM2","AM3","AMG","APLV5","APL1V5","APL2V5","ATR","ATU","ATU-DL","ATU-ASK","ATU-QBD","ATU-SRS","AXBX","BBY","BBY-SRS","BBY2","BBY2-SRS","BCC","BCPAP","BUD","BLP-DL","BGM","BOO","BOO2","BS","BT-SRS-T3","BT-T1","BT-T2","BT-T3","BT-ASK-T4","BUD","BW","C2P","CCS","CDS","CDS2","CDS3","CDS4","CEBV5","CFTPV5","CFTP2V5","CIE","CLA","CLM-DL","CNB","CNET","CNET2","CNET3","CPUID-DL","CPUID-ST","CS","CS-ST","CS2","CS3","CWN","DAT","DDI","DDIS","DDIS2","DGY","DIG-A","DIG-N","DIG-OFF","DIG-ON","DIG-P","DIG-S","DNA","DNA2","DPO","DVDX","DVDX2","EAC","F-CT","F-ET","FAC","FF2-DL","FJS","FKR","FLV","FM","FTB","FTB2","FTB3","FW-ASK","FW-QBD","FW-SRS","FWT","FW2V5","FXTV5-DL","GAM4","GAM-ASK-T4","GAM-SRS","GAM-SRS-T3","GAM-QBD","GAM-T1","GAM-T2","GAM-T3","GET-SRS","GET2-SRS","GET3-SRS","GGSV5","GGSV5-DL","GOM","GYG","HIY-SRS","HULU","ICM-SRS","IEAK9","IMB","IMB-DL","IMT","JDR","JMYV5","KG-ASK","KYT","LMW","LMW2","LMW3","LMW4","LMW-BETA","LMW-BETA2","LOL","LPLV5","LUC","MDG","MEB","MGN","MGX","MMB","MMG","MOV","MOV-DL","MP3","MP3DS","MP3FB","MP3P2","MP3R-ASK","MP3R-DL","MP3R-QBD","MP3R-SRS","MP3R4","MP3R5","MP3R6","MP3SF","MP3SW","MP3TR","MP3SD","MPC","MPC2","MROV5","MYC","MYC-ASK","MYC-DL","MYC-SRS","MYC-QBD","NG1V5","NG2V5","NG3V5","NG4V5","NSC-S","NSC-O","NSC-E","NSC-P","NSC-A","NSC-N","NSC-NS","NR1V5","NRV5","NXZ","ORJ-SAT","ORJ2","ORJ2-SAT","OSUB","OTV5","OVO","PCH","PDF","PDF2","PDO","PFN","PLF3","PLF4","PLTV5","PLTV5-DL","PLTV5-DL2","POS","POS2","PTF","PTJ","PTV2","PTV2-DL","PTV5","QSYS","RAD","S99","SBES","SCV5","SDT","SE","SF","SKR","SNAPT","SNP-ST","SP","SP2","SPC","SPT","SRFV5","SS2V5","SS3V5","STC2","STC4","STC-SRS","STC2-SRS","STC3-SRS","STC4-SRS","STK","STK2","STK3","STK4","TEMU","THE","TKR","TM","TMN2","TTB","TTR","TVTYV5","UKT","UNI","URS","VDJ","VRS","VD","VD-DL","VZ3","WBG-DL","WBG-ST","WBM2","WBV5-DL","WCL","WCLV5","WCL2V5","WCR","WCV5","WME","WSV5","WZP","YLC","ZMR","ZTV","ZTV-DL","FBK","FB-BETA","FB-PRO","FB-APP","FB-ASK","FB-OD","FB-SEM","MDF","MDF-BETA","NRO","NRO2","NRO3","UTR","UTR2","WID","WID-BETA"]}
- function cmpVersions (a, b) {
- var i, l, d;
- a = a.split('.');
- b = b.split('.');
- l = Math.min(a.length, b.length);
- for (i=0; i<l; i++) {
- d = parseInt(a[i], 10) - parseInt(b[i], 10);
- if (d !== 0) {
- return d;
- }
- }
- return a.length - b.length;
- }
- function isLatestClient(clientversion) {
- try{
- var versionresult=cmpVersions(clientversion,"2.6.8.0");
- if(versionresult >= 0){
- return true;
- }
- }catch(e){
- }
- return false;
- }
- function is64Bit(){
- if(window.navigator.userAgent.indexOf('WOW64')>-1 || window.navigator.platform=='Win64')
- return true;
- else
- return false;
- }
- function isSupportedOS() {
- try {
- if (window.navigator.appVersion.indexOf("Windows NT 5.1") != -1 || window.navigator.appVersion.indexOf("Windows NT 5.2") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.0") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.1") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.2") != -1 ) {
- return true
- }
- } catch(e)
- {
- }
- return false;
- }
- function makeoffer(partnerID) {
- try {
- for (var i=0; i < jsonString.makeofferdisabled.length; i++) {
- if(partnerID == jsonString.makeofferdisabled[i]){
- unsupportedBrowser = IneligibleChrome;
- return false;
- }
- }
- } catch(e)
- {
- }
- return true;
- }
- function isEmpty (checkObj) {
- var key;
- if (checkObj === "" || checkObj === 0 || checkObj === "0" || checkObj === null || checkObj === false || typeof checkObj === 'undefined') {
- return true;
- }
- if (typeof checkObj == 'object') {
- for (key in checkObj) {
- return false;
- }
- return true;
- }
- return false;
- }
- function getIncumbentPartners() {
- var incumbentPartners;
- var incumbentPartnerIDs="";
- try {
- if(is64Bit()){
- incumbentPartners = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\AskPartnerNetwork\\Toolbar\\shared\\","tbsinstalled",0);
- }else{
- incumbentPartners = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\AskPartnerNetwork\\Toolbar\\shared\\","tbsinstalled",0);
- }
- if(isEmpty(incumbentPartners)){
- return incumbentPartnerIDs;
- }
- incumbentPartnerIDs = incumbentPartners.split(",");
- }catch (e)
- {
- }
- return incumbentPartnerIDs;
- }
- function isBlockListed(tlbrID) {
- try {
- for(var j=0; j<jsonString.blocklistedPartners.length;j++){
- if(tlbrID == jsonString.blocklistedPartners[j]) {
- return true;
- }
- }
- } catch (e)
- {
- }
- return false;
- }
- function getReasonCode(reasonDescription) {
- if(isLatestClient(version)) return reasonDescription;
- return false;
- }
- function v6eligibleChecklist(partnerID,incPartners){
- try{
- var incumbentTbType;
- var incumbentPartnerRegPath;
- if(incPartners.length < 1 || incPartners.length >= 4) {
- reasonString = SideBySideLimitExceeded;
- return false;
- }
- for(var k=0; k<incPartners.length;k++){
- incumbentPartnerRegPath= getIncbumbentRegPath(incPartners[k]);
- incumbentTbType = pipgetRegValue(incumbentPartnerRegPath,"tb-type",0);
- if(partnerID == incPartners[k]){
- reasonString = V6OfferAlreadyPresentWithSamePartnerID;
- return false;
- }
- if(incumbentTbType.toLowerCase().startsWith("vanilla") && tbType.toLowerCase().startsWith("vanilla")){
- reasonString = PriorToolbarType_Vanilla_SecureVanilla + incPartners[k];
- return false
- }
- if(isBlockListed(incPartners[k])) {
- reasonString = BlockListV6IncumbentToolbarIsListedInLockList + incPartners[k];
- return false;
- }
- }
- } catch(e)
- {
- }
- return true;
- }
- function isV5ToolbarOffered(){
- try{
- v5toolbarOffered=true;
- return true;
- }catch(e)
- {
- }
- }
- function checkPrimaryToolbarOffered(){
- try{
- if(v5toolbarOffered){
- return false;
- }
- return true;
- }catch(e){
- }
- }
- function getProductVersion(productCode){
- try{
- var productVersion =system.getProductVersion(productCode);
- return productVersion;
- }catch(e)
- {
- }
- }
- function pipgetRegValue(registryPath,regValue,n){
- try {
- var registryValue=system.getRegValue(registryPath,regValue,n);
- return registryValue;
- } catch (e)
- {
- }
- }
- function defaultBrowser()
- {
- var defaultbrowserAppPath;
- var defaultbrowserPath;
- var default_browser;
- if (window.navigator.appVersion.indexOf("Windows NT 6.0") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.1") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.2") != -1 )
- {
- defaultbrowserAppPath = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.htm\\UserChoice","Progid",0);
- if(!isEmpty(defaultbrowserAppPath))
- {
- defaultbrowserPath = "HKEY_CLASSES_ROOT\\"+defaultbrowserAppPath+"\\shell\\open\\command\\";
- default_browser = pipgetRegValue(defaultbrowserPath,"",0);
- }
- else
- {
- default_browser = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Clients\\StartMenuInternet\\","",0);
- if(isEmpty(default_browser))
- {
- default_browser = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Clients\\StartMenuInternet\\","",0)
- }
- }
- }
- else
- {
- default_browser = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Classes\\http\\shell\\open\\command\\","",0);
- if(isEmpty(default_browser))
- {
- default_browser = pipgetRegValue("HKEY_CLASSES_ROOT\\http\\shell\\open\\command\\","",0);
- }
- if(isEmpty(default_browser))
- {
- default_browser = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Clients\\StartMenuInternet\\","",0);
- if(isEmpty(default_browser))
- {
- default_browser = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Clients\\StartMenuInternet\\","",0)
- }
- }
- }
- return default_browser;
- } // defaultBrowser
- function isSupportedBrowser(partnerID) {
- try {
- var defaultbrowserPath;
- var defaultbrowserAppPath;
- var defaultBrowser;
- var n=0;
- if (window.navigator.appVersion.indexOf("Windows NT 6.0") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.1") != -1 || window.navigator.appVersion.indexOf("Windows NT 6.2") != -1 ) {
- defaultbrowserAppPath=pipgetRegValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.htm\\UserChoice","Progid",0);
- if(!isEmpty(defaultbrowserAppPath)) {
- defaultbrowserPath="HKEY_CLASSES_ROOT\\"+defaultbrowserAppPath+"\\shell\\open\\command\\";
- defaultBrowser=pipgetRegValue(defaultbrowserPath,"",0);
- }else
- {
- defaultBrowser = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Clients\\StartMenuInternet\\","",0);
- if(isEmpty(defaultBrowser)){
- defaultBrowser = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Clients\\StartMenuInternet\\","",0)
- }
- }
- } else {
- defaultBrowser=pipgetRegValue("HKEY_CURRENT_USER\\Software\\Classes\\http\\shell\\open\\command\\","",0);
- if(isEmpty(defaultBrowser)) {
- defaultBrowser=pipgetRegValue("HKEY_CLASSES_ROOT\\http\\shell\\open\\command\\","",0);
- }
- if(isEmpty(defaultBrowser))
- {
- defaultBrowser = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Clients\\StartMenuInternet\\","",0);
- if(isEmpty(defaultBrowser)){
- defaultBrowser = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Clients\\StartMenuInternet\\","",0)
- }
- }
- }
- if(!isEmpty(defaultBrowser)){
- if(defaultBrowser.toLowerCase().indexOf("firefox.exe") > -1){
- defBrowser =FIREFOX;
- return true;
- }
- if(defaultBrowser.toLowerCase().indexOf("iexplore.exe") > -1 ){
- defBrowser =IE;
- return true;
- }
- if(defaultBrowser.toLowerCase().indexOf("chrome") > -1 && makeoffer(partnerID)) {
- defBrowser =CHROME;
- return true;
- }
- n=defaultBrowser.lastIndexOf("\\");
- if(n==-1) n=0;
- defBrowser=defaultBrowser.substring(n,defaultBrowser.length-1);
- defBrowser=defBrowser.replace(/[^\w\s]/gi, '');
- unsupportedBrowser=unsupportedBrowser+defBrowser;
- }
- } catch (e)
- {
- }
- return false;
- }
- function isV5TlbrEligible(){
- try{
- var checkV5Installed = getProductVersion("{86D4B82A-ABED-442A-BE86-96357B70F4FE}");
- if(isEmpty(checkV5Installed)) return true;
- if(checkOverinstall()) {
- v6SaturationToolbarOfferFlag = true;
- return true;
- }
- }catch(e)
- {
- }
- return false;
- }
- function isV6TlbrEligible() {
- try{
- var incumbentPartnerList = getIncumbentPartners();
- if(isEmpty(incumbentPartnerList)) return true;
- if(v6eligibleChecklist(primaryTlbrID,incumbentPartnerList)){
- v6SaturationToolbarOfferFlag = true;
- return true;
- }
- }catch(e)
- {
- }
- return false;
- }
- function isSaturationInstalled(partnerid) {
- try{
- var incumbentTlbrList;
- incumbentTlbrList = getIncumbentPartners();
- if(!isEmpty(incumbentTlbrList)){
- for(var i=0; i<incumbentTlbrList.length;i++){
- if((incumbentTlbrList[i].indexOf("-SAT") > -1 && satTlbrID.indexOf("-SAT")> -1)) {
- partnerid.value=incumbentTlbrList[i];
- return true;
- }
- }
- }
- }catch(e){
- }
- return false;
- }
- function checkV5ToolbarInstalled(){
- try{
- var v5TlbrID;
- showSecondaryOffer=true;
- if (!isSupportedOS()) return false;
- if(!isSupportedBrowser(primaryTlbrID)){
- v6SaturationToolbarOfferFlag = false;
- return getReasonCode(unsupportedBrowser);
- }
- if(!isV5TlbrEligible()){
- v6SaturationToolbarOfferFlag = false;
- if(is64Bit()){
- v5TlbrID = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\AskToolbar\\Macro","tb",0);
- } else {
- v5TlbrID = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\AskToolbar\\Macro","tb",0);
- }
- if(v5TlbrID == primaryTlbrID) v5ToolbarInstalled=v5ToolbarInstalled+"Same Partner ID "+v5TlbrID+"";
- v5ToolbarInstalled = v5ToolbarInstalled +" "+v5TlbrID;
- return getReasonCode(v5ToolbarInstalled);
- }
- }catch(e)
- {
- }
- v6SaturationToolbarOfferFlag = true;
- showSecondaryOffer=false;
- return true;
- }
- function v6installChecker() {
- try{
- showSecondaryOffer=true;
- if (!isSupportedOS()) return false;
- if(!isSupportedBrowser(primaryTlbrID))
- {
- v6SaturationToolbarOfferFlag = false;
- return getReasonCode(unsupportedBrowser);
- }
- if(isBlockListed(primaryTlbrID))
- {
- blocklistedPartner=blocklistedPartner+" "+primaryTlbrID;
- return getReasonCode(blocklistedPartner);
- }
- if(!isV6TlbrEligible()){
- v6SaturationToolbarOfferFlag = false;
- return getReasonCode(reasonString);
- }
- }catch(e)
- {
- }
- v6SaturationToolbarOfferFlag = true;
- showSecondaryOffer=false;
- return true;
- }
- function partneridfunc(){
- this.value="";
- }
- function offerV6SaturationToolbar(){
- try{
- var partnerid =new partneridfunc();
- if(v6SaturationToolbarOfferFlag) {
- return getReasonCode(v5Offerpresented);
- }
- showSecondaryOffer=true;
- if (!isSupportedOS()) return false;
- if(!isSupportedBrowser(satTlbrID))
- {
- return getReasonCode(unsupportedBrowser);
- }
- if (isBlockListed(satTlbrID))
- {
- return getReasonCode(blocklistedPartner);
- }
- if (isSaturationInstalled(partnerid))
- {
- v6SatInstalled=v6SatInstalled +" "+ partnerid.value;
- return getReasonCode(v6SatInstalled);
- }
- showSecondaryOffer = false;
- return true;
- }catch(e)
- {
- }
- return false;
- }
- function checkOverinstall() {
- try{
- var getIEversion ="";
- var isIE9extnenabled="";
- var toolbarDisableFlag="";
- var getIEversion=browser.ieVersion;
- if(parseInt(getIEversion) > 8){
- parseInt(isIE9extnenabled,2)=system.getRegValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Approved Extensions","{D4027C7F-154A-4066-A1AD-4243D8127440}",0);
- }
- toolbarDisableFlag = system.getRegValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Ext\\Settings\\{D4027C7F-154A-4066-A1AD-4243D8127440}","Flags",0);
- if ( parseInt(toolbarDisableFlag) == 64 || parseInt(toolbarDisableFlag) == 1){
- return true;
- }
- }catch(e){
- if(parseInt(getIEversion) > 8){
- if(e.message =="CSystemUtil::getRegValue Failed : UnSupported Variant Type of 3"){
- return false;
- }
- if(e.message =="CSystemUtil::getRegValue Failed : UnSupported Variant Type of 0"){
- return true;
- }
- }
- if(e.message =="CSystemUtil::getRegValue Failed : UnSupported Variant Type of 0"){
- return false;
- }
- return true;
- }
- return false;
- }
- function secondaryOfferCheck(){
- try{
- if(!showSecondaryOffer && (hidePtnrSecondaryOffer=="true")){
- return getReasonCode(secondaryOfferRejected);
- }
- }catch(e){
- }
- return true;
- }
- function isProntoEligibleOffer() {
- try{
- if(defBrowser.toLowerCase() == FIREFOX) return true;
- }catch(e)
- {
- }
- return false;
- }
- function isProntoEligibleOfferForIE(){
- try{
- if(defBrowser == IE) return true;
- }catch(e)
- {
- }
- return false;
- }
- function isAnchorFreeEligibleOffer() {
- try{
- var AFRegistryPath;
- if(window.navigator.appVersion.indexOf("Windows NT 5.1") != -1 || window.navigator.appVersion.indexOf("Windows NT 5.2") != -1 ||(window.navigator.appVersion.indexOf("Windows NT 6.0") != -1 && is64Bit())){
- return AnchorFreeUnsupportedOS;
- }
- if(is64Bit()){
- AFRegistryPath = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\HotspotShield","Publisher",0);
- }else{
- AFRegistryPath = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\HotspotShield","Publisher",0);
- }
- if(!isEmpty(AFRegistryPath)){
- return getReasonCode(secondaryOfferInstalled);
- }
- } catch(e)
- {
- }
- return true;
- }
- function isAudialsEligibleOffer(){
- try{
- if(window.navigator.appVersion.indexOf("Windows NT 5.1") != -1 || (window.navigator.appVersion.indexOf("Windows NT 6.0") != -1 && is64Bit())){
- return AudialsOfferNotEligibleUnsupportedOSXP32orVista64bit;
- }
- }catch(e)
- {
- }
- return true;
- }
- function isDealPlyEligibleOffer() {
- try{
- var DPRegistryPath = pipgetRegValue("HKEY_CURRENT_USER\\Software\\DealPly","InstallStatus",0);
- if(!isEmpty(DPRegistryPath) && DPRegistryPath.toLowerCase() =="ok"){
- return getReasonCode(secondaryOfferInstalled);
- }
- }catch(e)
- {
- }
- return true;
- }
- function isUniBlueEligibleOffer() {
- try{
- var UBRegistryPath = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Uniblue\\SpeedUpMyPC","InstalledLocation",0);
- if(!isEmpty(UBRegistryPath)){
- return getReasonCode(secondaryOfferInstalled);
- }
- }catch(e)
- {
- }
- return true;
- }
- function isPalTalkEligibleOffer() {
- try{
- var PTRegistryPath = pipgetRegValue("HKEY_CURRENT_USER\\Software\\Paltalk","InstallerAppDir",0);
- if(!isEmpty(PTRegistryPath)){
- return getReasonCode(secondaryOfferInstalled);
- }
- }catch(e)
- {
- }
- return true;
- }
- function isSuperFishEligibleOffer() {
- try{
- var SFRegistryPath = pipgetRegValue("HKEY_CURRENT_USER\\Software\\AppDataLow\\Software\\superfish","InstallStatus",0);
- if(!isEmpty(SFRegistryPath) && SFRegistryPath.toLowerCase() =="ok"){
- return getReasonCode(secondaryOfferInstalled);
- }
- }catch(e)
- {
- }
- return true;
- }
- function preCheckSecondaryOffer() {
- try{
- if(!v6SaturationToolbarOfferFlag &&!showSecondaryOffer &&(primaryTlbrID.toLowerCase().indexOf("myc") > -1 || satTlbrID.toLowerCase().indexOf("myc-sat") > -1)){
- return getReasonCode(precheckSecondary);
- }
- }catch (e)
- {
- }
- return true;
- }
- function isSpeedCheckerInstalled() {
- try{
- var SCRegistryPath = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Speedchecker Limited\\PC Speed Up","Uninstaller",0);
- if(!isEmpty(SCRegistryPath)){
- return getReasonCode(secondaryOfferInstalled);
- }
- }catch(e)
- {
- }
- return true;
- }
- function isOSServicePackCompatible() {
- try{
- var winServicePackRegValue;
- if(window.navigator.appVersion.indexOf("Windows NT 5.1") != -1){
- winServicePackRegValue=pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","CSDVersion",0);
- if(!isEmpty(winServicePackRegValue)){
- if(winServicePackRegValue == "Service Pack 2" || winServicePackRegValue == "Service Pack 2")
- {
- reasonString= XPServicePackNotCompatible + winServicePackRegValue;
- return false;
- }
- }
- }
- if(window.navigator.appVersion.indexOf("Windows NT 5.2") != -1) {
- reasonString = UnsupportedOSXP64bit;
- return false;
- }
- }catch(e)
- {
- }
- return true;
- }
- function isCPUSpeedComp() {
- try{
- var cpuSpeed;
- var physicalMemory;
- cpuSpeed = system.getRegValue("HKLM\\Hardware\\Description\\System\\Centralprocessor\\0","~MHZ",0);
- if (cpuSpeed<1000){
- reasonString= CPUSpeedLessThan1000MHZ + cpuSpeed;
- return false;
- }
- physicalMemory=(system.getTotalPhysicalMemory());
- if(physicalMemory < 512){
- reasonString= SystemPhysicalMemoryIsVeryLow + physicalMemory;
- return false;
- }
- } catch(e)
- {
- }
- return true
- }
- function isDiskSpaceComp(){
- try{
- var diskFreeSize;
- diskFreeSize = system.getDiskFreeSize();
- if(is64Bit()){
- if(diskFreeSize <2000){
- reasonString = MachineDiskFreeSpaceLessThan2000MB + diskFreeSize;
- return false;
- }
- } else {
- if(diskFreeSize <850){
- reasonString = MachineDiskFreeSpaceLessThan850MB + diskFreeSize;
- return false;
- }
- }
- } catch(e)
- {
- }
- return true;
- }
- function nortonToolbarCheck() {
- try{
- var nortonToolbarKey;
- if(is64Bit()){
- nortonToolbarKey = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\Toolbar","{A13C2648-91D4-4bf3-BC6D-0079707C4389}",0);
- if(isEmpty(nortonToolbarKey)){
- nortonToolbarKey = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\Toolbar","{7FEBEFE3-6B19-4349-98D2-FFB09D4B49CA}",0);
- }
- }else {
- nortonToolbarKey = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Toolbar","{A13C2648-91D4-4bf3-BC6D-0079707C4389}",0);
- if(isEmpty(nortonToolbarKey)){
- nortonToolbarKey = pipgetRegValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\Toolbar","{7FEBEFE3-6B19-4349-98D2-FFB09D4B49CA}",0);
- }
- }
- if(!isEmpty(nortonToolbarKey)){
- logger.log("\r\n******************Norton Toolbar Installed****************");
- reasonString = NortonSafeSearchToolbarInstalled;
- return false;
- }
- } catch(e)
- {
- }
- return true;
- }
- function getIncbumbentRegPath(partnersID){
- try{
- var partnerRegPath="";
- if(is64Bit()){
- partnerRegPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\AskPartnerNetwork\\Toolbar\\";
- } else {
- partnerRegPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\AskPartnerNetwork\\Toolbar\\";
- }
- partnerRegPath+=partnersID+"\\Macro\\";
- }catch(e)
- {
- }
- return partnerRegPath;
- }
- function v6incumbentPartnerCheck(partner){
- try{
- var installedPartners = getIncumbentPartners();
- if(isEmpty(installedPartners)) return true;
- for(var i=0; i<installedPartners.length;i++){
- if(installedPartners[i].startsWith(partner)){
- return false;
- }
- }
- }catch(e){
- }
- return true;
- }
- function v5incumbentPartnerCheck(partnerids){
- try{
- var toolbarID;
- if(is64Bit()){
- toolbarID = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\AskToolbar\\Macro","tb",0);
- } else {
- toolbarID = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\AskToolbar\\Macro","tb",0);
- }
- if(toolbarID.startsWith(partnerids)){
- return false;
- }
- }catch(e){
- }
- return true;
- }
- function askSecureToolbarCheck(){
- try{
- var toolbarRegPath;
- var installedToolbars = getIncumbentPartners();
- if(isEmpty(installedToolbars)) return true;
- for(var i=0; i<installedToolbars.length;i++){
- toolbarRegPath=getIncbumbentRegPath(installedToolbars[i]);
- toolbarTbType = pipgetRegValue(toolbarRegPath,"tb-type",0);
- if(toolbarTbType == "vanilla-sec") return false;
- }
- }catch(e)
- {
- }
- return true;
- }
- String.prototype.startsWith = function(prefix) {
- return this.indexOf(prefix) === 0;
- }
- function isAviraV5UpgTlbrOffered(){
- try{
- showSecondaryOffer=true;
- if(!askSecureToolbarCheck()){
- return getReasonCode(AskSecureToolbarPresentAviraOfferRejected);
- }
- if(v5incumbentPartnerCheck("AVR-")){
- offerAviraV6NewInstall=true;
- return getReasonCode(AviraV6InstallOfferPresentedAviraV6UpgradeRejected);
- }
- }catch(e)
- {
- }
- v6SaturationToolbarOfferFlag = true;
- showSecondaryOffer=false;
- return true;
- }
- function aviraToolbarInstallCheck(){
- try{
- showSecondaryOffer=true;
- if(!offerAviraV6NewInstall){
- return getReasonCode(AviraV6InstallOfferRejectedAviraV6UpgradeOfferPresented);
- }
- }catch(e)
- {
- }
- v6SaturationToolbarOfferFlag = true;
- showSecondaryOffer=false;
- return true;
- }
- function checkPrimaryTlbrOffered() {
- try{
- showSecondaryOffer=true;
- if(primaryToolbarOfferFlag){
- return getReasonCode(PrimaryToolbarOfferPresentedDefaultPrimaryOfferRejected);
- }
- } catch(e)
- {
- }
- v6SaturationToolbarOfferFlag = true;
- showSecondaryOffer=false;
- return true;
- }
- function clientSupported() {
- try{
- var versionValue=cmpVersions(version,"2.6.12.1");
- if(versionValue >= 0){
- return true;
- }
- } catch(e)
- {
- }
- return false;
- }
- function isAskSecureOfferEligible () {
- try{
- showSecondaryOffer=true;
- if (!isSupportedOS()) return false;
- if (!isOSServicePackCompatible()) {
- return getReasonCode(reasonString);
- }
- if(!clientSupported()){
- return getReasonCode(OldClientAskSecureOfferNotSupported);
- }
- if(!isCPUSpeedComp()){
- return getReasonCode(reasonString);
- }
- if(!isDiskSpaceComp()){
- return getReasonCode(reasonString);
- }
- if(!nortonToolbarCheck()){
- return getReasonCode(reasonString);
- }
- if(!v6incumbentPartnerCheck("AVIRA-") || !v5incumbentPartnerCheck("AVR-")){
- return getReasonCode(AviraToolbarPresentAskSecureOfferRejected);
- }
- }catch(e)
- {
- }
- primaryToolbarOfferFlag=true;
- v6SaturationToolbarOfferFlag = true;
- showSecondaryOffer=false;
- return true;
- }
- var offers_gen_params;
- var all_browsers;
- var installed_toolbars;
- var toolbar_to_be_installed;
- var CUTOVER_DATE = new Date(2013, 05, 26);
- //var CUTOVER_DATE = new Date(2010, 06, 01);
- var primary_toolbar_ok_to_present = 1;
- var show_logger = true;
- //
- // Keeps a cache of offers, by offer id. This will be useful if for previous/next.
- // If we come back to the same page, the offer, as presented before, will be
- // presented, and ALL subsequent offers will be deleted.
- //
- var Offers = {};
- Offers.Check = function (offer_id)
- {
- offers_gen_params = offers_gen_params || JSON.parse(pipclient.getOffers());
- //
- // If cache
- //
- if (!this.cache)
- {
- this.cache = [];
- for (var i = 0; i < offers_gen_params.offers.length; ++i)
- {
- var ttt = offers_gen_params.offers[i].id;
- var t_obj = {id : offers_gen_params.offers[i].id};
- this.cache.push(t_obj);
- }
- return false;
- }
- for (var i = 0; i < this.cache.length; ++i)
- {
- if (this.cache[i].id === offer_id)
- {
- if (this.cache[i].result)
- return true;
- }
- }
- return false;
- } // Offers.Check
- Offers.RetrieveResult = function (offer_id)
- {
- for (var i = 0; i < this.cache.length; ++i)
- {
- if (this.cache[i].id === offer_id)
- {
- if (this.cache[i].result)
- return this.cache[i].result;
- }
- }
- return {};
- } // Offers.RetrieveResult
- Offers.OfferedToolbars = function (installed_toolbars, offer_id)
- {
- for (var i = 0; i < this.cache.length; ++i)
- {
- if (this.cache[i].id === offer_id)
- return;
- if (this.cache[i].tb_info && this.cache[i].tb_info.PID)
- installed_toolbars.push(this.cache[i].tb_info);
- }
- } // Offers.OfferedToolbars
- Offers.StoreResult = function (offer_id, result, toolbar_to_be_installed)
- {
- for (var i = 0; i < this.cache.length; ++i)
- {
- if (this.cache[i].id === offer_id)
- {
- this.cache[i].result = result;
- this.cache[i].tb_info = toolbar_to_be_installed;
- break;
- }
- }
- for (++i; i < this.cache.length; ++i)
- {
- delete this.cache[i].result;
- }
- } // Offers.StoreResult
- function InstallCheck(param)
- {
- if (show_logger) logger.log(" --- Enter InstallCheck with param of : " + JSON.stringify(param));
- var is_saturation_offer = false;
- var return_JSON;
- var offer_id = GetOfferID(param);
- var current_time = new Date();
- if (current_time > CUTOVER_DATE)
- {
- var v7_result = v7installChecker(param);
- return v7_result;
- }
- if (!isSupportedOS() || !isOSServicePackCompatible())
- {
- return_JSON = new Result("", all_browsers, false);
- return_JSON.result = parseInt(reasonString, 10);
- return_JSON.errorDescription = reasonString;
- return JSON.stringify(return_JSON);
- }
- offers_gen_params = offers_gen_params || JSON.parse(pipclient.getOffers());
- toolbar_to_be_installed = GetToolbarInfo(offer_id);
- toolbar_to_be_installed.PID = primaryTlbrID;
- if (Offers.Check(offer_id))
- return JSON.stringify(Offers.RetrieveResult(offer_id));
- installed_toolbars = installed_toolbars || GetInstalledToolbars();
- Offers.OfferedToolbars(installed_toolbars, offer_id);
- var result;
- if (isSaturationOffer(offer_id))
- result = offerV6SaturationToolbar();
- else
- result = v6installChecker(param);
- all_browsers = all_browsers || JSON.parse(browser.allBrowsers);
- if (result === true)
- return_JSON = new Result("ALL", all_browsers, true , toolbar_to_be_installed);
- else
- return_JSON = new Result("", all_browsers, false);
- if (result === true)
- return_JSON.result = 0;
- else
- {
- if (result === false)
- return_JSON.result = 1;
- else
- return_JSON.result = parseInt(result, 10);
- }
- return_JSON.errorDescription = result;
- return_JSON.lookupTable.fileid = "v6ic";
- return_JSON.lookupTable.stubversion = "6.6.0";
- Offers.StoreResult(offer_id, return_JSON, toolbar_to_be_installed);
- if (show_logger) logger.log("RETURN RESULT FOR V6 CALL : " + JSON.stringify(return_JSON));
- return JSON.stringify(return_JSON);
- } // InstallCheck
- function isObjEmpty(obj)
- {
- var name;
- for (name in obj)
- return false;
- return true;
- } // isObjEmpty
- function GetOfferID(param)
- {
- if (!param)
- return "";
- var p_param = param.split("|");
- return p_param[0];
- } // GetOfferID
- function isSaturationOffer(offer_id)
- {
- if (!offer_id)
- return false;
- for (var i = 0; i < offers_gen_params.offers.length; ++i)
- {
- if (offers_gen_params.offers[i].id === offer_id)
- {
- var toolbar_id = offers_gen_params.offers[i].ToolbarID || "";
- if (toolbar_id.indexOf("-SAT") > 0)
- return true;
- break;
- }
- }
- return false;
- } // isSaturationOffer
- function GetToolbarInfo(p_offer_id)
- {
- var toolbar_type = "";
- var toolbar_id = "";
- for (var i = 0; i < offers_gen_params.offers.length; ++i)
- {
- if (offers_gen_params.offers[i].id === p_offer_id)
- {
- toolbar_type = offers_gen_params.offers[i].tbType || "";
- toolbar_id = offers_gen_params.offers[i].ToolbarID || "";
- break;
- }
- }
- var reg_exp = /-?(V5|V6|V7)$/i;
- var r1 = toolbar_id.match(reg_exp);
- var r2;
- var current_time = new Date();
- if (current_time > CUTOVER_DATE)
- {
- if (r1)
- {
- r2 = toolbar_id.slice(0, -r1[0].length);
- if (r1[0].length === 3)
- r2 += "-V7";
- else
- r2 += "V7";
- }
- else
- {
- r2 = toolbar_id + "-V7"
- }
- toolbar_id = r2;
- }
- var obj = {
- PID : toolbar_id,
- tb_type : toolbar_type
- };
- return obj;
- } // GetToolbarInfo
- function v7installChecker(param)
- {
- var MAX_NUMBER_OF_TOOLBARS_ON_BROWSER = 3;
- var MAX_NUMBER_OF_TOOLBARS_ON_MACHINE = 3;
- var is_saturation_offer = false;
- var offer_id = GetOfferID(param);
- var offertype_is_toolbar = false;
- if (!isSupportedOS() || !isOSServicePackCompatible())
- {
- return_JSON = new Result("", all_browsers, false);
- return_JSON.result = parseInt(reasonString, 10);
- return_JSON.errorDescription = reasonString;
- return JSON.stringify(return_JSON);
- }
- offers_gen_params = offers_gen_params || JSON.parse(pipclient.getOffers());
- toolbar_to_be_installed = GetToolbarInfo(offer_id);
- if (Offers.Check(offer_id))
- return Offers.RetrieveResult(offer_id);
- var ps_check = PrimarySaturationCheck (offer_id);
- if (!isObjEmpty(ps_check))
- return JSON.stringify(ps_check);
- try
- {
- var return_JSON;
- var target_browser = "";
- installed_toolbars = installed_toolbars || GetInstalledToolbars();
- Offers.OfferedToolbars(installed_toolbars, offer_id);
- all_browsers = all_browsers || JSON.parse(browser.allBrowsers);
- if (!all_browsers.dfBr)
- {
- all_browsers.dfBr = defaultBrowser();
- }
- if (show_logger) logger.log("\r\n All browsers values: " + JSON.stringify(all_browsers) + " : ");
- offers_gen_params = offers_gen_params || JSON.parse(pipclient.getOffers());
- if (show_logger) logger.log("Actual Param " + param + " *******Returned offers " + JSON.stringify(offers_gen_params) + "\n");
- if (show_logger) logger.log("Installed Toolbars : " + JSON.stringify(installed_toolbars) + "\n");
- if (show_logger) logger.log("Toolbar To Be Installed : " + JSON.stringify(toolbar_to_be_installed) + "\n");
- target_browser = target_browser || CanBeInstalled(CommandLineBrowser(), false);
- target_browser = target_browser || CanBeInstalled(OriginBrowser(), false);
- target_browser = target_browser || CanBeInstalled(DefaultBrowser(), false);
- target_browser = target_browser || CanBeInstalled("cr", true);
- //target_browser = CanBeInstalled(target_browser);
- if (target_browser)
- {
- return_JSON = new Result(target_browser, all_browsers, true, toolbar_to_be_installed);
- return_JSON.errorDescription = "";
- }
- else
- {
- return_JSON = new Result(target_browser, all_browsers, false);
- return_JSON.result = parseInt(reasonString, 10);
- return_JSON.errorDescription = reasonString;
- if (offertype_is_toolbar)
- --primary_toolbar_ok_to_present;
- }
- if (show_logger) logger.log("\r\n********** V7 Stringified JSON " + JSON.stringify(return_JSON));
- if (return_JSON.result !== 0)
- {
- if (primary_toolbar_ok_to_present === 1)
- primary_toolbar_ok_to_present = 0;
- }
- toolbar_to_be_installed.browser = target_browser;
- Offers.StoreResult(offer_id, return_JSON, toolbar_to_be_installed);
- return JSON.stringify(return_JSON);
- }
- catch(e)
- {
- if (show_logger) logger.log("\r\n******Error*****" + e.message);
- return false;
- }
- return false;
- function PrimarySaturationCheck(offer_id)
- {
- var return_JSON = {};
- if (offer_id)
- {
- for (var i = 0; i < offers_gen_params.offers.length; ++i)
- {
- if (offers_gen_params.offers[i].id === offer_id)
- {
- //var toolbar_id = offers_gen_params.offers[i].ToolbarID || "";
- var offer_type = offers_gen_params.offers[i].offerType || "";
- offer_type = offer_type.toLowerCase();
- if (offer_type.indexOf("saturation") >= 0)
- is_saturation_offer = true;
- else if (offer_type.indexOf("toolbar") >= 0)
- {
- offertype_is_toolbar = true;
- ++primary_toolbar_ok_to_present;
- }
- break;
- }
- }
- }
- if (primary_toolbar_ok_to_present && is_saturation_offer)
- {
- return_JSON = new Result("", all_browsers, false);
- return_JSON.result = parseInt(secondaryOfferRejected, 10);
- return_JSON.errorDescription = secondaryOfferRejected;
- }
- return return_JSON;
- }
- function OriginBrowser()
- {
- var tb = "" || (all_browsers && all_browsers.orBr);
- return tb.slice(0, 2);
- }
- function DefaultBrowser()
- {
- var tb = "" || (all_browsers && all_browsers.dfBr);
- return tb.slice(0, 2);
- }
- function CommandLineBrowser()
- {
- var tb = "" || (all_browsers && all_browsers.cmdBr);
- return tb.slice(0, 2);
- }
- function CanBeInstalled(p_browser, run_cycle) // ==> string
- {
- if (show_logger) logger.log("\nCanBeInstalled :<" + p_browser + ">\n");
- if (!p_browser)
- return "";
- if (show_logger) logger.log(" Installed Toolbars : " + JSON.stringify(installed_toolbars) + "\n");
- var pids = {};
- for (var i = 0, N = installed_toolbars.length; i < N; ++i)
- {
- var pid_name = installed_toolbars[i].PID;
- pids[pid_name] = 1;
- }
- var name;
- var pid_str = "";
- i = 0;
- for (name in pids)
- {
- if (i > 0) pid_str += ",";
- pid_str += name;
- if (name === toolbar_to_be_installed.PID)
- break;
- ++i;
- }
- if (i >= MAX_NUMBER_OF_TOOLBARS_ON_MACHINE)
- {
- reasonString = maxNumberOfPartnersExceeded + " [" + pid_str + "]";
- return "";
- }
- if (!UniquePIDTbType())
- {
- return "";
- }
- if (CheckForBlockedPID(reasonString))
- {
- return "";
- }
- var to_be_installed = [];
- to_be_installed.push(toolbar_to_be_installed);
- if (toolbarsHaveTypeBlock(to_be_installed) || toolbarsHaveTypeBlock(installed_toolbars) )
- {
- if (installed_toolbars.length && isUniquePIDOnMachine(installed_toolbars, toolbar_to_be_installed.PID))
- {
- reasonString = tbtypeOfBlockPIDNotEqual + " PIDS " + installed_toolbars[0].PID + " and " + toolbar_to_be_installed.PID;
- return ""
- }
- }
- if (incumbantAVIRACheck(installed_toolbars, toolbar_to_be_installed))
- return "";
- var cascade_count = 0;
- var potential_browser;
- do
- {
- potential_browser = CascadeThroughBrowsers(p_browser, cascade_count);
- potential_browser = CheckVersion(potential_browser);
- potential_browser = ValidBrowser(potential_browser);
- ++cascade_count;
- } while (MoreToCascade(cascade_count, potential_browser, run_cycle));
- return potential_browser;
- function CheckForBlockedPID()
- {
- var PID_to_be_installed = [];
- var PIDs_on_Machine = [];
- PID_to_be_installed.push(toolbar_to_be_installed.PID);
- for (var i = 0, N = installed_toolbars.length; i < N; ++i)
- {
- PIDs_on_Machine.push(installed_toolbars[i].PID);
- }
- if (PIDOnBlockedList(PIDs_on_Machine) || PIDOnBlockedList(PID_to_be_installed) )
- {
- if (show_logger) logger.log(" PID on Blocked List: " + JSON.stringify(PIDs_on_Machine) + " and " + JSON.stringify(toolbar_to_be_installed) + "\n");
- reasonString = PIDIsOnBlockedList + " " + toolbar_to_be_installed.PID;
- return true;
- }
- return false;
- function PIDOnBlockedList(p_toolbartypes) // ==> bool
- {
- if (jsonString.blocklistedPartners.length === 0)
- return false;
- for (var i = 0; i < p_toolbartypes.length; ++i)
- {
- for (var j = 0; j < jsonString.blocklistedPartners.length; ++j)
- {
- if (jsonString.blocklistedPartners[j] === p_toolbartypes[i])
- return true;
- }
- }
- return false;
- } // PIDOnBlockedList
- } // CheckForBlockedPID
- function UniquePIDTbType()
- {
- for (var i = 0; i < installed_toolbars.length; ++i)
- {
- if (TbTypesIntersect(installed_toolbars[i].tb_type, toolbar_to_be_installed.tb_type))
- {
- if (installed_toolbars[i].PID != toolbar_to_be_installed.PID)
- {
- reasonString = uniquePIDTbType;
- reasonString += " Installed PID/tbType " + installed_toolbars[i].PID + "/" + installed_toolbars[i].tb_type;
- reasonString += " New PID/tbType " + toolbar_to_be_installed.PID + "/" + toolbar_to_be_installed.tb_type;
- return false;
- }
- }
- }
- return true;
- } // UniquePIDTbType
- //
- // Checks to see if AVIRA is already installed on the machine; if so,
- // check to see if trying to install another AVIRA === OK, or vanilla === OK,
- // secure === NOT OK. Assumes PIDTb collision has already been run.
- //
- function incumbantAVIRACheck(p_installed_toolbars, p_toolbar_to_be_installed)
- {
- var incumbant_AVIRA = false;
- var PID_to_be_installed = [];
- for (var i = 0; i < p_installed_toolbars.length; ++i)
- {
- if ((p_installed_toolbars[i].PID.substring(0, 4) === "AVR-") ||
- (p_installed_toolbars[i].PID.substring(0, 6) === "AVIRA-") )
- {
- incumbant_AVIRA = true;
- break;
- }
- }
- if (incumbant_AVIRA)
- {
- if (p_toolbar_to_be_installed.PID.substring(0, 6) === "AVIRA-")
- return false;
- if (p_toolbar_to_be_installed.tb_type.toLowerCase() === "secure")
- {
- reasonString = AviraToolbarPresentAskSecureOfferRejected;
- return true;
- }
- return false;
- }
- return false;
- } // incumbantAVIRACheck
- function TbTypesIntersect (tb_type_1, tb_type_2)
- {
- var list_1 = tb_type_1.split(",");
- var list_2 = tb_type_2.split(",");
- for (var i = 0; i < list_1.length; ++i)
- {
- for (var j = 0; j < list_2.length; ++j)
- {
- if (list_1[i].toLowerCase() == list_2[j].toLowerCase())
- return true;
- }
- }
- return false;
- } // TbTypesIntersect
- function toolbarsHaveTypeBlock(toolbars)
- {
- for (var i = 0; i < toolbars.length; ++i)
- {
- if (toolbars[i].tb_type === "blocked")
- return true;
- }
- return false;
- } // toolbarsHaveTypeBlock
- function isUniquePIDOnMachine(installed_toolbars, to_be_pid)
- {
- for (var i = 0; i < installed_toolbars.length; ++i)
- {
- if (installed_toolbars[i].PID == toolbar_to_be_installed.PID)
- return false;
- }
- return true;
- } // isUniquePIDOnMachine
- function CascadeThroughBrowsers(p_browser, cascade_count) // ==> string
- {
- var lu_table = [["cr", "ie", "ff"], ["ie", "cr", "ff"], ["ff", "cr", "ie"]];
- if (!p_browser)
- return p_browser;
- if (cascade_count <= 0)
- return p_browser;
- if (cascade_count >=3)
- return "";
- for (var i = 0; i < lu_table.length; ++i)
- {
- if (lu_table[i][0] === p_browser)
- {
- return lu_table[i][cascade_count];
- }
- }
- return "";
- } // CascadeThroughBrowsers(p_browser, cascade_count)
- function MoreToCascade(cascade_count, potential_browser, run_cycle) // ==> bool
- {
- if (!run_cycle)
- return false;
- if (cascade_count >= 3)
- return false;
- if (potential_browser)
- return false;
- return true;
- } // MoreToCascade
- function CheckVersion(p_browser) // ==> string
- {
- if (show_logger) logger.log("CheckVersion :<" + p_browser + ">");
- if (!p_browser)
- return p_browser;
- p_browser = p_browser.toLowerCase();
- if (p_browser != "ie" && p_browser != "ff" && p_browser != "cr")
- {
- reasonString = inputBrowserTypeNotSupported + " [" + p_browser + "]";
- return "";
- }
- if (p_browser == "ie")
- {
- if (all_browsers && all_browsers.ie)
- {
- var version = parseInt(all_browsers.ie, 10);
- if (version > 6)
- return "ie";
- }
- reasonString = inputIEBrowserVersionNotSupported + " [" + all_browsers.ie + "]";
- return "";
- }
- if (p_browser == "cr")
- {
- if (show_logger) logger.log(" CheckVersion of Chrome");
- if (all_browsers && all_browsers.cr)
- {
- var version = parseInt(all_browsers.cr, 10);
- if (show_logger) logger.log(" CheckVersion of Chrome, version : " + version);
- if (version > 0)
- return "cr";
- }
- reasonString = inputCRBrowserVersionNotSupported + " [" + all_browsers.cr + "]";
- return "";
- }
- if (p_browser == "ff")
- {
- if (all_browsers && all_browsers.ff)
- {
- var version = parseInt(all_browsers.ff, 10);
- if (version > 2)
- return "ff";
- }
- reasonString = inputFFBrowserVersionNotSupported + " [" + all_browsers.ff + "]";
- return "";
- }
- } // CheckVersion
- function ValidBrowser(p_browser) // ==> string
- {
- var toolbars_on_browser = [];
- for (var i = 0, N = installed_toolbars.length; i < N; ++i)
- {
- if (installed_toolbars[i].browser == p_browser)
- toolbars_on_browser.push(installed_toolbars[i]);
- }
- if (toolbars_on_browser.length == 0)
- {
- if (show_logger) logger.log(" Toolbars on Browser == 0 return " + p_browser + "\n");
- return p_browser;
- }
- if (toolbars_on_browser[0].PID == toolbar_to_be_installed.PID)
- {
- if (show_logger) logger.log(" PID === PID : " + toolbars_on_browser[0].PID + " : " + toolbar_to_be_installed.PID + "\n");
- reasonString = PIDsAreSameOnSameBrowser + ", Browser " + p_browser + " PIDS [" + toolbar_to_be_installed.PID + "]";
- return "";
- }
- if (toolbars_on_browser.length >= MAX_NUMBER_OF_TOOLBARS_ON_BROWSER)
- {
- if (show_logger) logger.log(" >= MAX_NUMBER_OF_TOOLBARS_ON_BROWSER \n");
- reasonString = AlreadyAtMaxNumberOfPartnersPerBrowser + " [" + pid_str + "]";
- return "";
- }
- return p_browser;
- } // ValidBrowser(p_browser)
- } // CanBeInstalled
- function ToolbarInfo(p_PID, p_tb_type, p_browser)
- {
- this.PID = p_PID;
- this.tb_type = p_tb_type;
- this.browser = p_browser;
- } // ToolbarInfo
- } // v7installChecker
- function GetInstalledToolbars()
- {
- var result = [];
- //
- // V5
- //
- var checkV5Installed = getProductVersion("{86D4B82A-ABED-442A-BE86-96357B70F4FE}");
- if(!isEmpty(checkV5Installed) )
- {
- if(is64Bit())
- {
- v5TlbrID = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\AskToolbar\\Macro","tb",0) || "";
- }
- else
- {
- v5TlbrID = pipgetRegValue("HKEY_LOCAL_MACHINE\\Software\\AskToolbar\\Macro","tb",0) || "";
- }
- result.push({PID: v5TlbrID, tb_type : "ALL", browser : "ie"});
- result.push({PID: v5TlbrID, tb_type : "ALL", browser : "ff"});
- result.push({PID: v5TlbrID, tb_type : "ALL", browser : "cr"});
- }
- //
- // V6
- //
- var partners = getIncumbentPartners();
- var incumbentPartnerRegPath;
- if (!isEmpty(partners))
- {
- if(is64Bit())
- incumbentPartnerRegPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\AskPartnerNetwork\\Toolbar\\";
- else
- incumbentPartnerRegPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\AskPartnerNetwork\\Toolbar\\";
- for (i = 0; i < partners.length; ++i)
- {
- // Check if V7 toolbar, if so go to next;
- var partner_path = incumbentPartnerRegPath + partners[i] + "\\Info\\";
- var browsers = pipgetRegValue (partner_path, "Browsers", 0) || "";
- if (browsers)
- continue;
- var partner_path = incumbentPartnerRegPath + partners[i] + "\\Macro\\";
- var tb_type = pipgetRegValue (partner_path, "tb-type", 0) || "";
- result.push({PID: partners[i], tb_type : tb_type, browser : "ie"});
- result.push({PID: partners[i], tb_type : tb_type, browser : "ff"});
- result.push({PID: partners[i], tb_type : tb_type, browser : "cr"});
- }
- }
- //
- // V7
- //
- if (!isEmpty(partners))
- {
- if(is64Bit())
- incumbentPartnerRegPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\AskPartnerNetwork\\Toolbar\\";
- else
- incumbentPartnerRegPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\AskPartnerNetwork\\Toolbar\\";
- var tb_incumbent_path = "HKEY_LOCAL_MACHINE\\SOFTWARE\\AskPartnerNetwork\\Toolbar\\";
- for (i = 0; i < partners.length; ++i)
- {
- var partner_path = incumbentPartnerRegPath + partners[i] + "\\Info\\";
- var tb_path = tb_incumbent_path + partners[i] + "\\Macro\\"
- var browsers = pipgetRegValue (partner_path, "Browsers", 0) || "";
- var tb_type = pipgetRegValue (tb_path, "tb-type", 0) || "";
- if (browsers.search("_IE") > 0)
- {
- result.push({PID: partners[i], tb_type : tb_type, browser : "ie"});
- }
- if (browsers.search("_CR") > 0)
- {
- result.push({PID: partners[i], tb_type : tb_type, browser : "cr"});
- }
- if (browsers.search("_FF") > 0)
- {
- result.push({PID: partners[i], tb_type : tb_type, browser : "ff"});
- }
- }
- }
- return result;
- } // GetInstalledToolbars
- var toolbars_on_ie;
- var toolbars_on_cr;
- var toolbars_on_ff;
- function Result(target_browser, all_browsers, t_f)
- {
- this.result = 0;
- this.errorDescription = "";
- this.display = t_f === true ? 1 : 0;
- this.reporting = new Reporting();
- this.lookupTable = t_f === true ? new LookupTable(arguments[3]) : {};
- //this.tb_info = toolbar_to_be_installed;
- function Reporting()
- {
- this.trgb = target_browser.toUpperCase();
- this.orgb = all_browsers.orBr.toUpperCase();
- this.apn_dbr = all_browsers.dfBr.toUpperCase();
- this.cmdb = all_browsers.cmdBr;
- this.IEVersionInstalled = all_browsers.ie;
- this.FFVersionInstalled = all_browsers.ff;
- this.ChromeVersionInstalled = all_browsers.cr;
- this.TrackID = "";
- if (offers_gen_params && offers_gen_params.GeneralParameters && offers_gen_params.GeneralParameters.TrackID)
- this.TrackID = offers_gen_params.GeneralParameters.TrackID;
- toolbars_on_ie = toolbars_on_ie || GetToolbarsOnBrowser("ie");
- toolbars_on_cr = toolbars_on_cr || GetToolbarsOnBrowser("cr");
- toolbars_on_ff = toolbars_on_ff || GetToolbarsOnBrowser("ff");
- this.IETB = toolbars_on_ie;
- this.FFTB = toolbars_on_ff;
- this.ChromeTB = toolbars_on_cr;
- this.TBPartnerid = toolbar_to_be_installed.PID
- function GetToolbarsOnBrowser(p_browser) // ==> string
- {
- var toolbars_on_browser = "";
- if (!p_browser)
- return toolbars_on_browser;
- for (var i = 0, N = installed_toolbars.length; i < N; ++i)
- {
- if (installed_toolbars[i].browser == p_browser)
- {
- if (toolbars_on_browser) toolbars_on_browser += ";"
- toolbars_on_browser += installed_toolbars[i].PID + ":" + installed_toolbars[i].tb_type;
- }
- }
- return toolbars_on_browser;
- } // GetToolbarsOnBrowser
- }
- function LookupTable(tb_info)
- {
- this.BROWSER_TEXT = "Browser_" + target_browser.toUpperCase() + "_TXT";
- this.targetBrowser = target_browser.toUpperCase();
- this.fileid = "QRST_ABCD";
- this.orgb = all_browsers.orBr.toUpperCase();
- this.stubversion = "7.0.0";
- if (tb_info)
- {
- this.tbType = tb_info?tb_info.tb_type:"";
- this.tbID = tb_info.PID;
- }
- }
- } // Result
- //
- // param is in the form: CurrentID|PreviousID-(checkboxID:(true|false)|)*
- //
- function UIRule(param)
- {
- var return_obj = {};
- return_obj.result = 1;
- return_obj.errorDescription = "Value Was False";
- return_obj.display = 0;
- try
- {
- var result = 1;
- if (show_logger) logger.log("\r\n ****** Frog UI. Parameter " + param);
- if (show_logger) logger.log ("type of param is " + typeof param);
- var offer_ids = param.split('-');
- if (show_logger) logger.log("offer_ids after split");
- if (show_logger) logger.log("offer_ids " + offer_ids);
- var offer_ids = param.split('-')[0].split('|');
- if (show_logger) logger.log(" --- offer_ids -- " + offer_ids[0] + " : " + offer_ids[1]);
- var checkness;
- checkness = param.split('-');
- if (show_logger) logger.log(" --- checkyness " + JSON.stringify(checkness));
- checkness = checkness[checkness.length-1];
- if (show_logger) logger.log(" --- checkyness " + JSON.stringify(checkness));
- checkness = checkness.split('|');
- if (show_logger) logger.log(" --- checkyness " + JSON.stringify(checkness));
- for (var i = 0; i < checkness.length; ++i)
- {
- if (checkness[i].search("oi") >= 0)
- {
- if (show_logger) logger.log(" --- checkyness " + JSON.stringify(checkness[i]));
- var checkness_parts = checkness[i].split(':');
- if (checkness_parts[1] == "true")
- {
- if (show_logger) logger.log(" --- checkyness is true ");
- return_obj.errorDescription = "";
- return_obj.display = 1;
- return_obj.result = 0;
- }
- }
- }
- if (show_logger) logger.log (JSON.stringify(return_obj));
- }
- catch(e)
- {
- return_obj.result = 1;
- return_obj.errorDescription = "Error Executing Rule";
- return_obj.display = 0;
- }
- return JSON.stringify(return_obj);
- }
- function summaryRule(param) {
- try
- {
- if (show_logger) logger.log("\r\n ****** UI rule. Parameter " + param);
- return "0:Not eligible for display";
- }
- catch(e)
- {
- return false;
- }
- return true;
- }
- ===========================================================================
- BITMAP/*
- ===========================================================================
- 109.bmp - unknown
- 20{8,10}.bmp - radio buttons?
- ===========================================================================
- BKG/*
- ===========================================================================
- ERROR.PNG - "internet connection required" dialog
- FINISH.PNG - Finish button
- SATTB.PNG, TB.PNG - Ask toolbar offer image
- ===========================================================================
- Fiddler log:
- ---------------------------------------------------------------------------
- # Result Protocol Host URL Body Caching Content-Type Process Comments Custom
- 1 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFFZ/APNAnalytics.xml 2,626 max-age=86400 application/xml sfinstaller_sffz_filezilla_8992693_:1580
- 2 200 HTTP pipoffers.apnpartners.com /PIP/Server.jhtml?partner_id=SFFZ&language=en&pAppID=filezilla&pProductID=8992693 20,580 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/xml;charset=UTF-8 sfinstaller_sffz_filezilla_8992693_:1580
- 3 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFSH3D/images/accept.png 1,290 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 4 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFSH3D/images/decline.png 1,064 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 5 200 HTTP ak.pipoffers.apnpartners.com /static/resources/ui/html/orchestrator1.html?PIPPID=SFFZ&PTBPartnerID=&STBPartnerID=&tbType=vanilla&version=2.8.0.2 4,265 max-age=86400 text/html sfinstaller_sffz_filezilla_8992693_:1580
- 6 200 HTTP ak.pipoffers.apnpartners.com /static/resources/ui/js/pipcore-min.js?vers=9799 52,598 max-age=86400 application/javascript sfinstaller_sffz_filezilla_8992693_:1580
- 7 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFSH3D/images/sf_bg.png 7,057 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 8 200 HTTP c.fsdn.com /allura/p/filezilla/icon 3,340 max-age=86400; Expires: Wed, 27 Nov 2013 04:48:55 GMT image/png sfinstaller_sffz_filezilla_8992693_:1580
- 9 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFSH3D/images/shield.png 1,647 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 10 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFSH3D/images/next.png 1,212 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 11 200 HTTP ak.pipoffers.apnpartners.com /static/partners/RegistryOptimizer/images/RegistryOptimizer_en_DLA.png 24,915 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 12 200 HTTP ak.pipoffers.apnpartners.com /static/partners/Winzip/images/WinzipEN_DLA_NEW.png 17,104 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 13 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SFSH3D/images/progress.png 312 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 14 200 HTTP ak.pipoffers.apnpartners.com /static/partners/SF1/images/cancel.png 840 max-age=86400 image/png sfinstaller_sffz_filezilla_8992693_:1580
- 15 302 HTTP downloads.sourceforge.net /project/filezilla/FileZilla_Client/3.7.3/FileZilla_3.7.3_win32-setup.exe?secret=fdcca4c49ed101c2ad098582d4152bd5b8f475cb3a04bc04d3a708ff03be9cf6&r=&ts=1385442145 0 text/html sandboxiebits:868
- 16 200 HTTP jaist.dl.sourceforge.net /project/filezilla/FileZilla_Client/3.7.3/FileZilla_3.7.3_win32-setup.exe 0 application/octet-stream sandboxiebits:868
- 17 302 HTTP downloads.sourceforge.net /project/filezilla/FileZilla_Client/3.7.3/FileZilla_3.7.3_win32-setup.exe?secret=fdcca4c49ed101c2ad098582d4152bd5b8f475cb3a04bc04d3a708ff03be9cf6&r=&ts=1385442145 0 text/html sandboxiebits:868
- 18 200 HTTP jaist.dl.sourceforge.net /project/filezilla/FileZilla_Client/3.7.3/FileZilla_3.7.3_win32-setup.exe 4,812,567 application/octet-stream sandboxiebits:868
- 19 200 HTTP ak.pipoffers.apnpartners.com /static/partners/RegistryOptimizer/winziprosetup.exe 0 max-age=86400 application/x-msdownload sandboxiebits:868
- 20 200 HTTP ak.pipoffers.apnpartners.com /static/partners/RegistryOptimizer/winziprosetup.exe 3,735,008 max-age=86400 application/x-msdownload sandboxiebits:868
- 21 404 HTTP ak.pipoffers.apnpartners.com /static/partners/SFFZ/images/install.ico 237 max-age=86400 text/html; charset=iso-8859-1 sfinstaller_sffz_filezilla_8992693_:1580
- 22 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 23 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 24 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 25 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 26 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 27 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 28 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:1580
- 29 200 HTTP pipoffers.apnpartners.com /PIP/OfferAccept.jhtml 0 no-cache; Expires: Thu, 01 Jan 1970 00:00:00 GMT text/plain sfinstaller_sffz_filezilla_8992693_:472
- All connections made by sfinstaller_sffz_filezilla_8992693_.exe have IE's user agent, while sandboxiebits.exe(Microsoft BITS) uses "Microsoft BITS/6.7" as user agent.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement