2

Is there any API/code to check if Android phone's bootloader is unlocked?

Darpan
  • 5,623
  • 3
  • 48
  • 80
Richtea
  • 141
  • 1
  • 7
  • 2
    This question should be reopened because it is a genuine question asking for an Android API to check whether bootloader is unlocked. – Darpan Feb 11 '19 at 12:23

1 Answers1

5

If there was such an API you couldn't trust it because a non-standard ROM could implement it to say whatever it wanted.

antlersoft
  • 14,636
  • 4
  • 35
  • 55
  • Google's Attestation API now provides this functionality. The check uses cryptographic keys and must be performed on a server you control; this works around the weakness I noted above. – antlersoft Aug 09 '22 at 06:42