fix(automator): RootAutomator (x, y) not correct on some devices

This commit is contained in:
hyb1996
2018-09-16 01:49:33 +08:00
parent 91d5eab872
commit c5c9aaa8e1
7 changed files with 18 additions and 16 deletions

Binary file not shown.

View File

@@ -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 {

View File

@@ -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();

View File

@@ -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.*;
@@ -281,7 +282,8 @@ 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) {
Log.d(LOG_TAG, "notify ready");

View File

@@ -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;

View File

@@ -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"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":415},"path":"commonRelease-4.0.2 Alpha10.apk","properties":{"packageId":"org.autojs.autojs","split":"","minSdkVersion":"17"}}]