All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
We have mentioned the ruling on stealing state property in many Fataawa before. Stealing public or private property is forbidden in Islam, and the person who buys stolen items, knowing that they are stolen, is considered sinful and (is also considered) an aggressor. The thief does not own the stolen item. Hence, he is not entitled to dispose of it in a manner that is accepted by the Sharee'ah, either by selling it, or by offering it as a gift, or whatsoever. The person who managed to recover the stolen property from the thief or the aggressor—by any given means—should return it to the original owner or the concerned authority. If he does not know the original owner of the stolen item or the concerned authority responsible of disposing of it; for example, if it has been deactivated (like in your case), he should donate it to the public utility of the Muslims. Accordingly, what the questioner did, i.e. donating the stolen items that he bought to public utility, conforms to the correct religious ruling in this regard, Allaah willing.
Allaah Knows best.