抢红包应该是AccessibilityService火起来的最大因素。网上借助AccessibilityService来实现的抢红包插件也是数不胜数,又是一个看上去很牛逼的功能。 『绿色守护』App的最基本无Root功能,通过在应用管理界面『结束进程』的方式来停止一个后台运行的App。AccessibilityService也可以用在自动化测试中。
360 Android Accessibility 安全性研究报告- /articles/terminal/114045.html
Android防自动抢红包外挂原理解析- /jiangwei0910410003/article/details/54879836
深入了解AccessibilityService- /dd864140130/article/details/51794318
Android Accessibility(辅助功能) --实现Android应用自动安装、卸载- /androidsecurity/article/details/41890369
微信抢红包插件项目- /hejjunlin/article/details/52116904
AccessibilityService从入门到出轨 - /eclipsexys/article/details/53560013
Android AccessibilityService理解为——『按键精灵』--/xuyisheng/AccessibilityUtil
-- 调用系统安装Intent:
public void autoInstall(View view) {
String apkPath = Environment.getExternalStorageDirectory() + "/test.apk";
Uri uri = Uri.fromFile(new File(apkPath));
Intent localIntent = new Intent(Intent.ACTION_VIEW);
localIntent.setDataAndType(uri, "application/vnd.android.package-archive");
startActivity(localIntent);
}
监控安装界面,并根据逻辑处理点击:
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
super.onAccessibilityEvent(event);
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED &&
event.getPackageName().equals("com.android.packageinstaller")) {
AccessibilityNodeInfo nodeInfo = findViewByText("安装", true);
if (nodeInfo != null) {
performViewClick(nodeInfo);
}
}
}