fix: RootAutomatorEngine.forceStop not working
This commit is contained in:
Binary file not shown.
@@ -2,7 +2,7 @@ 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"];
|
||||
"swipe", "press", "longPress", "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__);
|
||||
|
||||
@@ -5,18 +5,19 @@ module.exports = function(__runtime__, scope){
|
||||
var engines = {};
|
||||
|
||||
engines.execScript = function(name, script, config){
|
||||
config = fillConfig(config);
|
||||
return rtEngines.execScript(name, script, config);
|
||||
return rtEngines.execScript(name, script, fillConfig(config));
|
||||
}
|
||||
|
||||
engines.execScriptFile = function(path, config){
|
||||
config = fillConfig(config);
|
||||
return rtEngines.execScriptFile(path, config);
|
||||
return rtEngines.execScriptFile(path, fillConfig(config));
|
||||
}
|
||||
|
||||
engines.execAutoFile = function(path, config){
|
||||
config = fillConfig(config);
|
||||
return rtEngines.execAutoFile(path, config);
|
||||
return rtEngines.execAutoFile(path, fillConfig(config));
|
||||
}
|
||||
|
||||
engines.myEngine = function(){
|
||||
return scope.__engine__;
|
||||
}
|
||||
|
||||
engines.stopAll = rtEngines.stopAll.bind(rtEngines);
|
||||
|
||||
@@ -45,17 +45,17 @@ module.exports = function(__runtime__, scope){
|
||||
return __runtime__.info.getLatestActivity();
|
||||
}
|
||||
|
||||
scope.waitForActivity = function(activity, delay){
|
||||
delay = delay || 200;
|
||||
scope.waitForActivity = function(activity, period){
|
||||
period = period || 200;
|
||||
while(scope.currentActivity() != activity){
|
||||
sleep(delay);
|
||||
sleep(period);
|
||||
}
|
||||
}
|
||||
|
||||
scope.waitForPackage = function(packageName, delay){
|
||||
delay = delay || 200;
|
||||
scope.waitForPackage = function(packageName, period){
|
||||
period = period || 200;
|
||||
while(scope.currentPackage() != packageName){
|
||||
sleep(delay);
|
||||
sleep(period);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user