1

I am using Android DevicePolicyManager to disable a range of features including USB and ADB connections to the device (client requirement).

When the policies are enforced, a default PIN code is set along with a reset token.

What I'm stuck on is; how do I use the token to reset/clear the PIN code? I wouldn't be able to unlock the phone to use an 'Unlock app', and I wouldn't be able to connect via ADB to do any terminal commands.

6
  • 1
    I am kind of confused by the question, you want to use this to clear the password? From the docs you linked: for Password, null or empty clears the password. So, provided you have access to the resetToken, you should be able to disable the password. This can be done by a background service , polling an external server, awaiting the reset command. You should not be able to do it locally. Isn't that kind of the point?
    – Matt Clark
    Jul 16, 2018 at 0:02
  • Hi Matt, sorry I should have been clearer. I am unsure how it will be possible to call this function when the phone cannot be unlocked (user forgets PIN for example), and ADB is disabled
    – HyperionX
    Jul 16, 2018 at 0:02
  • 1
    Isn't the point that if a user forgets their password, the device is locked? A stranger could just as easily pick it up, and access the reset function. Instead, you might want to rely on an external server which the user will need to access to issue the reset.
    – Matt Clark
    Jul 16, 2018 at 0:03
  • 1
    If the reset token is on the device, it is as good as being unsecured.
    – Matt Clark
    Jul 16, 2018 at 0:04
  • Thanks for the insight, a background service seems to be the best bet. Do you know of a native Android class that facilitates this functionality (polling and waiting for reset command)? You're correct, the token won't be stored on the device.
    – HyperionX
    Jul 16, 2018 at 0:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.