​It’s a battle for Uber on two fronts: On one, Uber has been wielding a secret weapon to thwart authorities who have been trying to curtail or shut down its ride-hailing service in cities around the world. On the other, it’s feuding with drivers.

Here’s a look:

  • Uber’s secret weapon vs. regulators

Uber has been wielding a secret weapon to thwart authorities who have been trying to curtail or shut down its ride-hailing service in cities around the world. 

The program included a feature nicknamed “Greyball” internally that identified regulators who were posing as riders while trying to collect evidence that Uber’s service was breaking local laws governing taxis.

To stymie those efforts, Uber served up a fake version of its app to make it appear the undercover regulators were summoning a car, only to have the ride canceled. The San Francisco company mined the data that it collects through its real app to pinpoint the undercover agents.

The New York Times revealed Greyball’s existence in a story published Friday based on information provided by four current and former Uber employees who were not named.

Uber acknowledged it has used Greyball to counter regulators working with the company’s opponents to entrap its drivers.

Greyball is part of a broader program called VTOS, shorthand for “violations of terms of service,” that Uber says it developed to protect its service.

“This program denies ride requests to fraudulent users who are violating our terms of service — whether that’s people aiming to physically harm drivers, competitors looking to disrupt our operations, or opponents who collude with officials on secret ‘stings’ meant to entrap drivers,” Uber said.

Although Uber is becoming more widely accepted than in its early years, the company says it still uses Greyball as a tool in some cities that it declined to identify.

The Times reported that Uber has targeted regulators in Boston, Paris and Las Vegas, among other cities, as well as a litany of countries that include Australia, China, Italy and South Korea.

The cat-and-mouse game with regulators is the latest example of the aggressive tactics that Uber has adopted while upending the heavily regulated taxi industry. In doing so, Uber has built a rapidly growing company valued at more than $60 billion by its investors that is frequently accused of bending the rules.

Among other things, the company has faced lawsuits for classifying its drivers as independent contractors to save money and allegedly stealing the technology for a fleet of autonomous cars that it is currently testing. In the past two weeks, a former female engineer alleged Uber routinely ignores claims of sexual harassment and a video surfaced of CEO Travis Kalanick profanely berating a driver who confronted him about steep cuts in its rates for a premium version of its service.

Uber’s rise also has raised tensions in cities that have sometimes gone to extreme measures to crack down on a service that they contended was operating without the proper permits. In Las Vegas, local taxi regulators confronted an Uber driver while wearing ski masks . And in Florida, Hillsborough regulators coordinated with taxi and limousine companies on an undercover operation that lured out Uber drivers so they could be assessed $700 fines.

  • Drivers rebel against Uber’s price-cutting quest for growth

Meanwhile, on the other front …

The recent face-off between Uber CEO Travis Kalanick and driver Fawzi Kamel illustrated a conflict between Uber, with its effort to grow by cutting prices to beat competitors, and drivers who have seen their pay reduced.

The video of the argument — caught on dashcam and now viewed more than 3 million times on YouTube — includes yelling and profanity, and ends with a combative Kalanick dismissing an agitated Fawzi’s claims that sharp reductions in fares forced the driver into bankruptcy.

[VIDEO: Watch the YouTube video at https://www.youtube.com/watch?v=KkrjOnZeWG8 }

Harry Campbell, who drives for Uber in California, says driver pay has gone down while Uber’s corporate valuation has grown to over $60 billion. “I think a lot of drivers feel that Uber always looked out for themselves first and foremost and relegated drivers to a second tier,” he says.

“What we’re looking at in that video is 21st-century mobility technology and 19th-century labor relations,” said Harley Shaiken, a labor expert and professor at the University of California, Berkeley.

The video exchange comes after a month of trouble for the ride-hailing behemoth including sexual harassment allegations from a female engineer, a lawsuit alleging technology theft, and a social media campaign encouraging riders to delete Uber’s app over claims that the company tried to capitalize when New York taxi drivers protested against President Trump’s immigration order.

Uber’s rivals claim that drivers have been defecting since Uber’s problems started piling up. Business experts expect more defections among Uber’s 400,000 drivers, and even some riders, after the Kalanick video, despite his public apology. Some rivals boast of better pay for drivers, and some allow tips through their apps, unlike Uber. Still, drivers say they get more business with Uber because of its greater size and reach.

In the dashcam video obtained by Bloomberg News, Kalanick and Kamel are seen discussing Uber’s business model. The driver for Uber’s luxury service, Uber Black, argues that Kalanick is lowering fares, costing him money.

Kalanick denied that Black fares had been cut, but conceded that prices were reduced for Uber’s general service, UberX, due to competition. “Otherwise you go out of business,” he says.

The 40-year-old CEO begins shouting as Kamel claims again the Uber Black prices were reduced. Kamel claims to have lost $97,000. “I’m bankrupt because of you.”

“Bull—-!” Kalanick shouted. “Some people don’t like to take responsibility for their own s—. They blame everything in their life on somebody else. Good luck,” he says, slamming the door.

Campbell, the California driver, says most drivers aren’t surprised by Kalanick’s behavior. “We always knew that the CEO was pretty ruthless when it comes to drivers.”

Campbell, like a number of drivers, works for both Uber and its biggest rival, Lyft. He won’t stop driving for Uber, but may shift more business to Lyft.

Lyft said its ridership and driver applications have grown significantly since the first of the year, while Fasten, a smaller ride-hailing competitor in Boston and Austin, Texas, said its business has boomed since the “Delete Uber” campaign started in late January. Fasten said its ridership rose 25 percent in Boston the first week of the campaign. New riders are up 10 percent.