diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index c8bc7e01..db0c40bc 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index c0a6ac79..0d7b5a16 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "org.autojs.autojs" minSdkVersion 17 targetSdkVersion 23 - versionCode 414 - versionName "4.0.2 Alpha9" + versionCode 416 + versionName "4.0.2 Alpha11" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true ndk { diff --git a/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.java b/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.java index 55ad7c49..f22218f7 100644 --- a/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.java +++ b/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.java @@ -192,7 +192,7 @@ public class CodeEditText extends AppCompatEditText { return; } JavaScriptHighlighter.HighlightTokens highlightTokens = mHighlightTokens; - Log.d(LOG_TAG, "drawText: tokens = " + highlightTokens); + //Log.d(LOG_TAG, "drawText: tokens = " + highlightTokens); Layout layout = getLayout(); int lineCount = getLineCount(); int textLength = highlightTokens == null ? 0 : highlightTokens.getText().length(); diff --git a/autojs/src/main/assets/binary/root_automator b/autojs/src/main/assets/binary/root_automator index 4e296d14..b84731d3 100644 Binary files a/autojs/src/main/assets/binary/root_automator and b/autojs/src/main/assets/binary/root_automator differ diff --git a/autojs/src/main/java/com/stardust/autojs/core/inputevent/RootAutomator.java b/autojs/src/main/java/com/stardust/autojs/core/inputevent/RootAutomator.java index b63dd277..b11a1ed0 100644 --- a/autojs/src/main/java/com/stardust/autojs/core/inputevent/RootAutomator.java +++ b/autojs/src/main/java/com/stardust/autojs/core/inputevent/RootAutomator.java @@ -13,6 +13,7 @@ import com.stardust.autojs.runtime.exception.ScriptInterruptedException; import com.stardust.util.ScreenMetrics; import java.io.IOException; +import java.util.Locale; import java.util.concurrent.atomic.AtomicInteger; import static com.stardust.autojs.core.inputevent.InputEventCodes.*; @@ -45,7 +46,7 @@ public class RootAutomator implements Shell.Callback { mContext = context; mShell = new Shell(true); mShell.setCallback(this); - if(waitForReady){ + if (waitForReady) { waitForReady(); } } @@ -61,11 +62,11 @@ public class RootAutomator implements Shell.Callback { } private void waitForReady() throws IOException { - if(mReady){ + if (mReady) { return; } - synchronized (mReadyLock){ - if(mReady){ + synchronized (mReadyLock) { + if (mReady) { return; } try { @@ -168,7 +169,7 @@ public class RootAutomator implements Shell.Callback { } public void touchDown(int x, int y, int id) throws IOException { - if(mSlotIdMap.size() == 0){ + if (mSlotIdMap.size() == 0) { touchDown0(x, y, id); return; } @@ -199,17 +200,17 @@ public class RootAutomator implements Shell.Callback { } public void touchUp(int id) throws IOException { - int slotId ; + int slotId; int i = mSlotIdMap.indexOfKey(id); - if( i < 0){ + if (i < 0) { slotId = 0; - }else { + } else { slotId = mSlotIdMap.valueAt(i); mSlotIdMap.removeAt(i); } sendEvent(EV_ABS, ABS_MT_SLOT, slotId); sendEvent(EV_ABS, ABS_MT_TRACKING_ID, 0xffffffff); - if(mSlotIdMap.size() == 0){ + if (mSlotIdMap.size() == 0) { sendEvent(EV_KEY, BTN_TOUCH, 0x00000000); sendEvent(EV_KEY, BTN_TOOL_FINGER, 0x00000000); } @@ -281,9 +282,10 @@ public class RootAutomator implements Shell.Callback { String deviceNameOrPath = RootAutomatorEngine.getDeviceNameOrPath(mContext, InputDevices.getTouchDeviceName()); Log.d(LOG_TAG, "deviceNameOrPath: " + deviceNameOrPath); mShell.exec("chmod 777 " + path); - String command = path + " -d " + deviceNameOrPath; + String command = String.format(Locale.getDefault(), "%s -d %s -sw %d -sh %d", path, deviceNameOrPath, + ScreenMetrics.getDeviceScreenWidth(), ScreenMetrics.getDeviceScreenHeight()); mShell.exec(command); - synchronized (mReadyLock){ + synchronized (mReadyLock) { Log.d(LOG_TAG, "notify ready"); mReady = true; mReadyLock.notifyAll(); diff --git a/autojs/src/main/java/com/stardust/autojs/core/util/Shell.java b/autojs/src/main/java/com/stardust/autojs/core/util/Shell.java index 7df46d77..406bf33f 100644 --- a/autojs/src/main/java/com/stardust/autojs/core/util/Shell.java +++ b/autojs/src/main/java/com/stardust/autojs/core/util/Shell.java @@ -62,7 +62,7 @@ public class Shell extends AbstractShell { } } - private static final boolean DEBUG = false; + private static final boolean DEBUG = true; private static final String TAG = "Shell"; private volatile TermSession mTermSession; diff --git a/common/release/output.json b/common/release/output.json index e93cf595..81df78ee 100644 --- a/common/release/output.json +++ b/common/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":414},"path":"commonRelease-4.0.2 Alpha9.apk","properties":{"packageId":"org.autojs.autojs","split":"","minSdkVersion":"17"}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":415},"path":"commonRelease-4.0.2 Alpha10.apk","properties":{"packageId":"org.autojs.autojs","split":"","minSdkVersion":"17"}}] \ No newline at end of file