mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:33:30 +02:00
Implement account removal.
This commit is contained in:
@@ -490,6 +490,21 @@ module.exports = syrup.serial()
|
||||
})
|
||||
}
|
||||
|
||||
plugin.removeAccount = function() {
|
||||
return runServiceCommand(
|
||||
apk.wire.MessageType.REMOVE_ACCOUNT
|
||||
, new apk.wire.RemoveAccountRequest()
|
||||
)
|
||||
.timeout(15000)
|
||||
.then(function(data) {
|
||||
var response = apk.wire.RemoveAccountResponse.decode(data)
|
||||
if (response.success) {
|
||||
return true
|
||||
}
|
||||
throw new Error('Unable to remove account')
|
||||
})
|
||||
}
|
||||
|
||||
function runServiceCommand(type, cmd) {
|
||||
var resolver = Promise.defer()
|
||||
var id = Math.floor(Math.random() * 0xFFFFFF)
|
||||
|
||||
Reference in New Issue
Block a user