Commit 0900069b authored by Kathleen Brade's avatar Kathleen Brade Committed by Mike Perry
Browse files

Bug #13047: Updater should not send Kernel/GTK version

Removed the %OS_VERSION% component from the update URL and replaced the
  /update/ component of the URL with /update_2/.
Added support for minSupportedOSVersion, an attribute of the <update> element
  that may be used to trigger Firefox's "unsupported platform" behavior.
  Older versions of TB will ignore this (unknown to them) attribiute.
parent 99d8f129
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ pref("app.update.silent", false);
pref("app.update.staging.enabled", true);

// Update service URL:
pref("app.update.url", "https://www.torproject.org/dist/torbrowser/update/%CHANNEL%/%BUILD_TARGET%/%OS_VERSION%/%VERSION%/%LOCALE%");
pref("app.update.url", "https://www.torproject.org/dist/torbrowser/update_2/%CHANNEL%/%BUILD_TARGET%/%VERSION%/%LOCALE%");
// app.update.url.manual is in branding section
// app.update.url.details is in branding section

+12 −4
Original line number Diff line number Diff line
@@ -1685,7 +1685,17 @@ function Update(update) {
    this._patches.push(patch);
  }

  if (this._patches.length == 0 && !update.hasAttribute("unsupported"))
  if (update.hasAttribute("unsupported"))
    this.unsupported = ("true" == update.getAttribute("unsupported"));
  else if (update.hasAttribute("minSupportedOSVersion")) {
    let minOSVersion = update.getAttribute("minSupportedOSVersion");
    try {
      let osVersion = Services.sysinfo.getProperty("version");
      this.unsupported = (Services.vc.compare(osVersion, minOSVersion) < 0);
    } catch (e) {}
  }

  if (this._patches.length == 0 && !this.unsupported)
    throw Cr.NS_ERROR_ILLEGAL_VALUE;

  // Fallback to the behavior prior to bug 530872 if the update does not have an
@@ -1730,15 +1740,13 @@ function Update(update) {
      if(!isNaN(attr.value))
        this.promptWaitTime = parseInt(attr.value);
    }
    else if (attr.name == "unsupported")
      this.unsupported = attr.value == "true";
    else if (attr.name == "version") {
      // Prevent version from replacing displayVersion if displayVersion is
      // present in the update xml.
      if (!this.displayVersion)
        this.displayVersion = attr.value;
    }
    else {
    else if (attr.name != "unsupported") {
      this[attr.name] = attr.value;

      switch (attr.name) {