xuyisheng / accessibilityutil Goto Github PK
View Code? Open in Web Editor NEWAccessibilityService Utils
AccessibilityService Utils
AblSteps.STEP_1 -> {
AblViewUtil.findById("com.ss.android.ugc.aweme:id/aem", 0, object : AniCallBack {
override fun succ(info: AccessibilityNodeInfo?) {
//找到控件
// 在这里可以根据 坐标点击吗?
val click = info!!.performAction(AccessibilityNodeInfo.ACTION_CLICK)
info.refresh()
LogUtils.eTag("控件点击", click);
stepTimeOutCount = 0;
if(contents.isEmpty()){
AblStepHandler.sendMsg(AblSteps.STEP_6)
}else{
AblStepHandler.sendMsg(AblSteps.STEP_2)
}
}
上下滑的功能无效,请问作者有demo测试么
这是我实测的:
AutoReplyAccessibilityService当中,把case TYPE_WINDOW_STATE_CHANGED改成这样:
case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED: // 1.添加一个事件才能连贯完成发送操作
if (!hasAction) break;
itemNodeinfo = null;
String className = event.getClassName().toString();
if (className.contains(MM_PNAME)) { // 2.注意这里最好模糊判断包名
if (fill()) {
send();
hasAction = false; // 置false放到这来,保证send成功之后
}
}
break;
同时,修改配置文件reply.xml为:
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFeedbackType="feedbackAllMask"
android:accessibilityFlags="flagDefault"
android:canRetrieveWindowContent="true"
android:notificationTimeout="100"
android:packageNames="com.tencent.mm,com.android.systemui" />
最主要的是notificationTimeout不能太长,我用1000就不行,改成100就行了,具体自己尝试看看有没有通用性。
想问一下我手机root,怎么才能启动Accessibility服务吗,adb命令可以吗,还是说只能用代码跳转到设置页面,让用户开启?
为什么要在 performAction 之前 sleep(500)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.