The NYPD does not have to release ​specific information about “Stingrays,” the department’s portable cell phone tracking devices, because the disclosure could help criminals evade detection by law enforcement, a judge ruled Wednesday.

The New York Civil Liberties Union sued the NYPD in 2016 for details of its Stingray program, after a request for the records under the state’s Freedom of Information Law (FOIL) was denied.

During the course of the lawsuit the NYPD turned over some records including purchase agreements, but redacted the model names and prices of the technology.

So lawyers for the New York Civil Liberties Union asked the judge to release un-redacted documents, arguing that the use of the “controversial, military grade technology” has the “potential to implicate the privacy of countless innocent New Yorkers.”

NYCLU also said that other agencies including the federal government and state police routinely publish information about their Stingrays.

But Justice Shlomo Hagler said that the information should remain confidential.

“Here it’s crystal clear that if this court would disclose the names of the Stingray devices that would provide the bad actors with the capabilities of the NYPD’s technology. They could then use that to evade detection,” he said.

The Freedom of Information Law was not designed to “furnish the safe cracker with the combination to the safe,” the judge added.

NYCLU attorney Bobby Hodgson called the ruling bad for transparency and said his organization is considering an appeal.