Android之利用AccessibilityService实现抢红包

   本来想动手实现一下iOS版抢红包(参考这里),考虑到需要修改ipa及重新打包,微信可以轻易甄别出非正式发布包而当作弊封号处理,因此就不折腾了。相对而言,Android版不用篡改官方客户端,被发现封号的几率会低很多。   


 先来看看怎样入手,打开 “设置”--“高级设置”--“辅助功能”,我们看到以下界面:




其实我们可以利用系统提供的AccessibilityService类实现微信抢红包功能。


先来看看AccessibilityService官方的介绍:

Accessibility services are intended to assist users with disabilities in using Android devices and apps. They run in the background and receive callbacks by the system whenAccessibilityEvents are fired. Such events denote some state transition in the user interface, for example, the focus has changed, a button has been clicked, etc. Such a service can optionally request the capability for querying the content of the active window. Development of an accessibility service requires extending this class and implementing its abstract methods.

辅助服务目的是为了协助残疾人士更好的使用Android 设备和程序,辅助服务在系统后台运行,当AccessibilityEvents事件被触发,它们将执行相应的回调函数,在用户界面的某些事件状态转换,例如:焦点改变、按钮被点击,等等……这样的服务可以选择性请求查询活动窗口的内容。如果要开发辅助服务,你需要继承accessibility service 类并实现它的抽象方法。


Talk is cheap,show me the code!

直接上代码吧,有兴趣的朋友可以了解一下。别忘了升级微信到最新的6.6.1版本,其他版本不会自动抢。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值