Ticket #4234: updateService.patch

File updateService.patch, 3.9 KB (added by gk, 7 years ago)
  • toolkit/mozapps/update/nsUpdateService.js

    diff -r 381310995e75 toolkit/mozapps/update/nsUpdateService.js
    a b UpdateService.prototype = { 
    15631563    // Choose the newest of the available minor and major updates.
    15641564    var majorUpdate = null;
    15651565    var minorUpdate = null;
    15661566    var vc = Services.vc;
    15671567
    15681568    updates.forEach(function(aUpdate) {
    15691569      // Ignore updates for older versions of the application and updates for
    15701570      // the same version of the application with the same build ID.
    1571       if (vc.compare(aUpdate.appVersion, Services.appinfo.version) < 0 ||
     1571      if (vc.compare(aUpdate.appVersion, getPref("getCharPref",
     1572          "extensions.jondofox.browser_version")) < 0 ||
    15721573          vc.compare(aUpdate.appVersion, Services.appinfo.version) == 0 &&
    15731574          aUpdate.buildID == Services.appinfo.appBuildID) {
    15741575        LOG("UpdateService:selectUpdate - skipping update because the " +
    15751576            "update's application version is less than the current " +
    15761577            "application version");
    15771578        return;
    15781579      }
    15791580
    UpdateService.prototype = { 
    19141915    if (!update)
    19151916      throw Cr.NS_ERROR_NULL_POINTER;
    19161917
    19171918    // Don't download the update if the update's version is less than the
    19181919    // current application's version or the update's version is the same as the
    19191920    // application's version and the build ID is the same as the application's
    19201921    // build ID.
    19211922    if (update.appVersion &&
    1922         (Services.vc.compare(update.appVersion, Services.appinfo.version) < 0 ||
     1923        (Services.vc.compare(update.appVersion, getPref("getCharPref",
     1924          "extensions.jondofox.browser_version")) < 0 ||
    19231925         update.buildID && update.buildID == Services.appinfo.appBuildID &&
    19241926         update.appVersion == Services.appinfo.version)) {
    19251927      LOG("UpdateService:downloadUpdate - canceling download of update since " +
    19261928          "it is for an earlier or same application version and build ID.\n" +
    19271929          "current application version: " + Services.appinfo.version + "\n" +
    19281930          "update application version : " + update.appVersion + "\n" +
    19291931          "current build ID: " + Services.appinfo.appBuildID + "\n" +
    19301932          "update build ID : " + update.buildID);
    UpdateService.prototype = { 
    19381940          background == this._downloader.background) {
    19391941        LOG("UpdateService:downloadUpdate - no support for downloading more " +
    19401942            "than one update at a time");
    19411943        return readStatusFile(getUpdatesDir());
    19421944      }
    19431945      this._downloader.cancel();
    19441946    }
    19451947    // Set the previous application version prior to downloading the update.
    1946     update.previousAppVersion = Services.appinfo.version;
     1948    update.previousAppVersion = getPref("getCharPref",
     1949          "extensions.jondofox.browser_version");
    19471950    this._downloader = new Downloader(background);
    19481951    return this._downloader.downloadUpdate(update);
    19491952  },
    19501953
    19511954  /**
    19521955   * See nsIUpdateService.idl
    19531956   */
    19541957  pauseDownload: function AUS_pauseDownload() {
    Checker.prototype = { 
    24042407   * @param   event
    24052408   *          The nsIDOMEvent for the load
    24062409   */
    24072410  onLoad: function UC_onLoad(event) {
    24082411    LOG("Checker:onLoad - request completed downloading document");
    24092412
    24102413    var prefs = Services.prefs;
    24112414    var certs = null;
    2412     if (!prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE) &&
    2413         getPref("getBoolPref", PREF_APP_UPDATE_CERT_CHECKATTRS, true)) {
     2415    if (getPref("getBoolPref", PREF_APP_UPDATE_CERT_CHECKATTRS, true)) {
    24142416      certs = gCertUtils.readCertPrefs(PREF_APP_UPDATE_CERTS_BRANCH);
    24152417    }
    24162418
    24172419    try {
    24182420      // Analyze the resulting DOM and determine the set of updates.
    24192421      var updates = this._updates;
    24202422      LOG("Checker:onLoad - number of updates available: " + updates.length);
    24212423      var allowNonBuiltIn = !getPref("getBoolPref",