Created
February 3, 2015 09:04
-
-
Save janjongboom/88cb698cdd475d2591dd to your computer and use it in GitHub Desktop.
Remove pin on FFOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pin = '0000'; | |
var icc = navigator.mozIccManager.getIccById(navigator.mozIccManager.iccIds[0]); | |
if (icc.cardState === 'pinRequired') { | |
var req = icc.unlockCardLock({ lockType: 'pin', pin: pin }); | |
req.onsuccess = function() { | |
console.log('pin unlocked'); | |
var r2 = icc.setCardLock({ lockType: 'pin', pin: pin, enabled: false }); | |
r2.onsuccess = function() { | |
console.log('removed pin'); | |
} | |
r2.onerror = function(err) { | |
console.error('remove pin failed', err); | |
} | |
} | |
req.onerror = function(err) { | |
console.error('Could not unlock SIM', err); | |
}; | |
} | |
else { | |
console.error('cardState is not pinRequired'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment