Skip to content

Instantly share code, notes, and snippets.

@daleharvey
Created March 4, 2014 10:56
Show Gist options
  • Save daleharvey/9344294 to your computer and use it in GitHub Desktop.
Save daleharvey/9344294 to your computer and use it in GitHub Desktop.
client.executeScript(function(path) {
var script = document.createElement("script");
var callback = function() {
console.log('>>> APPARENTLY LOADED? \n');
};
script.type = "text/javascript";
script.src = path;
script.addEventListener('load', callback);
console.log('>>> LOADING: ' + path + '\n');
document.head.appendChild(script);
}, ['system/unit/mock_simslot.js']);
client.helper.wait(5000);
client.executeScript(function() {
// var MockSIMSlot = function(conn, index) {
// this.conn = conn;
// this.index = index;
// this.simCard = {
// cardState: null
// };
// this.update = function() {};
// this.isAbsent = function() {};
// this.isLocked = function() { return false; };
// // Inject method
// ['sendStkResponse', 'sendStkMenuSelection',
// 'sendStkTimerExpiration', 'sendStkEventDownload'].forEach(function(name) {
// this[name] = function() {};
// }, this);
// // Inject dom request
// ['getCardLock', 'unlockCardLock', 'setCardLock',
// 'getCardLockRetryCount', 'readContacts',
// 'updateContact', 'iccOpenChannel', 'iccExchangeAPDU',
// 'iccCloseChannel'].forEach(function(name) {
// this[name] = function() {
// return {};
// };
// }, this);
// };
var slot = new MockSIMSlot(null, 0);
slot.simCard.cardState = 'pinRequired';
window.wrappedJSObject.SimPinDialog.show(slot);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment