Uber CEO Travis Kalanick has a reputation of playing fast and loose with rules, but it appears that a maneuver his company performed on iPhones took his ride-hailing outfit to the brink of ruin a couple of years ago.

When Apple discovered Uber was planting code on iPhones that persisted on the devices even after the ride-hailing app was removed, Apple CEO Tim Cook warned Kalanick in a face-to-face meeting to stop the practice or the Uber app would be kicked out of Apple’s App store, The New York Times reported Sunday.

Uber cooked up the code in 2014 to fight fraud, according to the Times. Some drivers were buying black market iPhones, creating multiple email addresses on them, and using the addresses to establish Uber accounts. The drivers then hailed rides to themselves from the bogus accounts in order to collect incentives Uber was handing out to drivers who were taking on more riders.

The code added to the iPhone helped Uber “fingerprint” the mobile device and foil the multiple account scammers. The only problem was the practice violated an Apple rule requiring that nothing belonging to a previous owner should be left on an iPhone after an app was wiped.

Kalanick knew the rules, so he devised a way to hide the app’s fingerprinting feature from Apple’s engineers — a ruse that was eventually discovered by Apple, the NYT reported.

Not Tracking Individuals

The article has raised concerns that Uber may have tracked people’s movements, unbeknownst to them.

“We absolutely do not track individual users or their location if they’ve deleted the app,” Uber said in a statement provided to the E-Commerce Times by spokesperson MoMo Zhou.

The fingerprinting technique used by the company is a typical way to prevent fraudsters from loading Uber onto a stolen phone, putting in a stolen credit card, taking an expensive ride and then wiping the phone — over and over again, according to the company.

Similar techniques are used for detecting and blocking suspicious logins to protect Uber users’ accounts, the Uber noted.

“Being able to recognize known bad actors when they try to get back onto our network is an important security measure for both Uber and our users,” the…