While operating illegally in Portland in 2014, Uber used software to flag and deny rides to city code enforcers trying to catch it in the act, The New York Times reported Friday.

The ride-hailing company used a tool called Greyball to identify users it believed were using Uber in violation of its terms of service. That, according to a statement from the company, included "opponents who collude with officials on secret 'stings' meant to entrap drivers."

When it identified an official, it blocked that person from hailing a ride, and it displayed a version of the app with fake Ubers, making it more difficult to catch real ones.

The tool is still in use today, according to The Times, but predominantly outside the U.S.

Jon Isaacs, an Uber spokesman, told The Oregonian/OregonLive that Greyball has not been used in Portland since 2015, when the city legalized its business model.

A video from The Oregonian/OregonLive figures prominently in the report. The 2014 video shows a code enforcement officers trying and failing to hail an Uber after the company launched its service in violation of city code. It planned to hit the company and its drivers with four-digit fines for operating unlicensed taxis.

It's not clear how Uber pegged the enforcement officers as such. The Times report suggests it might have been based on repeated hails for rides, their location near a government facility, or the payment information officials used when making the requests.

Uber later halted its service while the Portland City Council organized a pilot program, later made permanent, that would allow it to operate lawfully.

Even today, Portland officials still summon Uber drivers through its app to conduct code enforcement, which includes ensuring the drivers are properly permitted, insured and qualified to drive for hire. The city's transportation bureau employs eight full-time and two part-time employees to enforce its regulations of the ride-for-hire industry.

"We take any effort to undermine our efforts to protect the public very seriously," bureau spokesman Dylan Rivera said. "We will closely examine the evidence presented in this investigation to see if it warrants changes in our approach to consumer protection."

He said the bureau inspected 1,400 vehicles working for Uber, Lyft and similar companies in 2016, and expects to grow that number to 2,000 in 2017.

Uber has in recent months suffered a series of public relations disasters tied to its corporate culture and business practices.

Two weeks ago, a female former software engineer published accusations of sexual harassment and sexism at Uber, prompting the company to launch an investigation.

Earlier this week, video emerged of chief executive Travis Kalanick arguing with an Uber driver over the company's falling fares. Kalanick later apologized and said he needs "leadership help."

And in January, Uber turned off surge pricing as New York City taxi drivers protested President Donald Trump's immigration policies. It was seen as an act of collaboration with the new administration, with which Kalanick had served on an economic advisory council.

He left the position after a #DeleteUber campaign went viral, reportedly prompting more than 200,000 customers to delete their accounts.

Uber, meanwhile, is pushing for a bill in the Oregon Legislature to legalize its business model statewide.

-- Elliot Njus

enjus@oregonian.com

503-294-5034

@enjus