Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -485,15 +485,9 @@ private boolean skipAdByKeywords(AccessibilityNodeInfo node) {
clickedWidgets.add(nodeDesc);

ShowToastInIntentService("正在根据关键字跳过广告...");
boolean clicked = node.performAction(AccessibilityNodeInfo.ACTION_CLICK);
if (BuildConfig.DEBUG) {
Log.d(TAG, "self clicked = " + clicked);
}
if (!clicked) {
Rect rect = new Rect();
node.getBoundsInScreen(rect);
click(rect.centerX(), rect.centerY(), 0, 20);
}
Rect rect = new Rect();
node.getBoundsInScreen(rect);
click(rect.centerX(), rect.centerY(), 0, 20);

// is it possible that there are more nodes to click and this node does not work?
return true;
Expand Down Expand Up @@ -533,15 +527,8 @@ private boolean skipAdByTargetedWidget(AccessibilityNodeInfo node, Set<PackageWi
clickedWidgets.add(nodeDesc);

ShowToastInIntentService("正在根据控件跳过广告...");
if (e.onlyClick) {
click(temRect.centerX(), temRect.centerY(), 0, 20);
} else {
if (!node.performAction(AccessibilityNodeInfo.ACTION_CLICK)) {
if (!node.getParent().performAction(AccessibilityNodeInfo.ACTION_CLICK)) {
click(temRect.centerX(), temRect.centerY(), 0, 20);
}
}
}
click(temRect.centerX(), temRect.centerY(), 0, 20);

// clear setWidgets, stop trying
if (setTargetedWidgets == set) setTargetedWidgets = null;
return true;
Expand Down