Will President Donald Trump still be able to fire off 3 a.m. tweets from a smart phone?

That may come down to a political decision by his staff. But as a security matter, he could do it — just not with an unmodified, off-the-shelf phone, says a former senior National Security Agency official who retrofit President Obama’s first Blackberry handheld.

“There are things an adversary can to do a cellphone — turn on the mic, for example — that make it really dangerous for a guy in his position to carry an unmodified device,” the former official told NBC News.

When President Obama took office in 2009, he was a Blackberry user, and he was allowed to keep one specially-modified by the NSA — but only to email a small circle of family members and colleagues.

NSA experts beefed up the device’s security, according to the former NSA official.