add: module RootAutomator

docs: RootAutomator
This commit is contained in:
hyb1996
2017-08-13 13:11:19 +08:00
parent 9c5f876a8f
commit 8c50bfdcaf
5 changed files with 95 additions and 49 deletions

View File

@@ -0,0 +1,13 @@
module.exports = function(__runtime__, scope){
function RootAutomator(){
this.__ra__ = Object.create(new com.stardust.autojs.runtime.api.RootAutomator(scope.context));
var methods = ["sendEvent", "touch", "setScreenMetrics", "touchX", "touchY", "sendSync", "sendMtSync", "tap",
"swipe","touchDown", "touchUp", "touchMove", "getDefaultId", "setDefaultId", "exit"];
for(var i = 0; i < methods.length; i++){
var method = methods[i];
this[method] = this.__ra__[method].bind(this.__ra__);
}
}
var p = RootAutomator.prototype;
return RootAutomator;
}