fix: engines.execScriptFile() missing executePath config

This commit is contained in:
hyb1996
2018-02-23 22:42:53 +08:00
parent 622bb4c277
commit 198a694064
6 changed files with 12 additions and 7 deletions

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.stardust.scriptdroid" applicationId "com.stardust.scriptdroid"
minSdkVersion 17 minSdkVersion 17
targetSdkVersion 23 targetSdkVersion 23
versionCode 252 versionCode 253
versionName "3.1.0 Alpha2" versionName "3.1.0 Alpha3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
ndk { ndk {

View File

@@ -342,5 +342,5 @@
<string name="text_no_phone_state_permission">获取权限失败 :-(</string> <string name="text_no_phone_state_permission">获取权限失败 :-(</string>
<string name="text_request_permission">重新授予</string> <string name="text_request_permission">重新授予</string>
<string name="info_no_phone_state_permission">软件需要显示启动页广告来维持服务器和软件的开发和维护,因此需要\"读取手机状态\"的权限。\n如果您不喜欢广告可以在设置中设定广告每天只显示一次。</string> <string name="info_no_phone_state_permission">软件需要显示启动页广告来维持服务器和软件的开发和维护,因此需要\"读取手机状态\"的权限。\n如果您不喜欢广告可以在设置中设定广告每天只显示一次。</string>
<string name="dex_crcs">2399694286\n1797533891\n0</string> <string name="dex_crcs">1805165984\n1603032210\no7Za8UoEvAoTVZPxJAqmQA==V8tiED7XGmzTkAGKbFPjLw==</string>
</resources> </resources>

View File

@@ -26,11 +26,14 @@ module.exports = function(__runtime__, scope){
function fillConfig(c){ function fillConfig(c){
var config = new com.stardust.autojs.execution.ExecutionConfig(); var config = new com.stardust.autojs.execution.ExecutionConfig();
c = c || {}; c = c || {};
c.path = c.path || files.cwd();
if(c.path){ if(c.path){
if(typeof(c.path) == "string"){ if(typeof(c.path) == "string"){
config.path([c.path]); config.requirePath([c.path]);
config.executePath(c.path);
}else{ }else{
config.path(c.path); config.requirePath(c.path);
config.executePath(c.path[0]);
} }
} }
c.delay = c.delay || 0; c.delay = c.delay || 0;

View File

@@ -47,6 +47,8 @@ public class Engines {
public void setCurrentEngine(ScriptEngine<JavaScriptSource> engine) { public void setCurrentEngine(ScriptEngine<JavaScriptSource> engine) {
if (mScriptEngine != null)
throw new IllegalStateException();
mScriptEngine = engine; mScriptEngine = engine;
} }

View File

@@ -143,7 +143,7 @@ public class DeveloperUtils {
} }
ZipEntry dexEntry = zipFile.getEntry(dexFile); ZipEntry dexEntry = zipFile.getEntry(dexFile);
long dexEntryCrc = dexEntry.getCrc(); long dexEntryCrc = dexEntry.getCrc();
Log.d(LOG_TAG, String.valueOf(dexEntryCrc)); //Log.d(LOG_TAG, String.valueOf(dexEntryCrc));
if (dexEntryCrc != crc[i]) { if (dexEntryCrc != crc[i]) {
return false; return false;
} }