version:1.2.7

fix:
update:优化sim卡联系人
This commit is contained in:
2024-09-30 10:27:31 +08:00
parent f03f8df38d
commit 196b93424a
20 changed files with 345 additions and 198 deletions

View File

@@ -163,7 +163,7 @@ public class WeAccessibilityService extends AccessibilityService {
step(Property.TEXT, mName, Step.CLICK_INFO);
break;
case CLICK_INFO://进入个人信息页面
step(Property.TEXT, DIALER_TEXT, Step.CLICK_CALL);
stepCallDialog(Property.TEXT, DIALER_TEXT, Step.CLICK_CALL);
break;
case CLICK_CALL://打视频或者电话
if (mCallType == TYPE_VIDEO) {
@@ -219,6 +219,26 @@ public class WeAccessibilityService extends AccessibilityService {
}
}
private boolean stepCallDialog(Property type, String text, Step nextStep) {
AccessibilityNodeInfo node = findNode(getRootInActiveWindow(), type, text);
if (node != null) {
Log.e(TAG, "stepCallDialog: isVisibleToUser: " + node.isVisibleToUser());
if (node.isVisibleToUser()) {
clickNode(node);
Log.e(TAG, "stepCallDialog: mCurrentStep: " + mCurrentStep + " done");
mCurrentStep = nextStep;
Log.e(TAG, "stepCallDialog: next: " + mCurrentStep);
return true;
} else {
scrolDown();
return false;
}
} else {
scrolDown();
return false;
}
}
private boolean stepHome(Property type, String text) {
AccessibilityNodeInfo node = findNode(getRootInActiveWindow(), type, text);
if (node != null) {
@@ -298,8 +318,28 @@ public class WeAccessibilityService extends AccessibilityService {
}
private void clickNode(AccessibilityNodeInfo node) {
try {
Log.e(TAG, "clickNode: getText = " + node.getText());
} catch (Exception e) {
Log.e(TAG, "clickNode: e = " + e.getMessage());
}
Log.e(TAG, "clickNode: isClickable = " + node.isClickable());
if (node.isClickable()) {
node.performAction(AccessibilityNodeInfo.ACTION_CLICK);
boolean performAction = node.performAction(AccessibilityNodeInfo.ACTION_CLICK);
Log.e(TAG, "clickNode: performAction = " + performAction);
if (!performAction) {
Rect rect = new Rect();
node.getBoundsInScreen(rect);
int x = rect.left;
int y = rect.top;
Log.e(TAG, "clickNode: x = " + x);
Log.e(TAG, "clickNode: y = " + y);
int width = rect.width();
int height = rect.height();
Log.e(TAG, "clickNode: width = " + width);
Log.e(TAG, "clickNode: height = " + height);
Log.e(TAG, "clickNode: clickByNode = " + clickByNode(x + width / 2, y + height / 2));
}
node.recycle();
} else {
AccessibilityNodeInfo parent = node.getParent();