Android实现微信自动抢红包的程序

简单实现了微信自动抢红包的服务,原理就是根据关键字找到相应的View, 然后自动点击。主要是用到AccessibilityService这个辅助服务,基本可以满足自动抢红包的功能,但是有些逻辑需要优化,比如,拆完一个红包后,必须手动点击返回键,才能进行下一次自动抢红包。

AndroidManifest.xml

[html]  view plain   copy
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     package="com.jackie.webchatenvelope" >  
  4.   
  5.     <application  
  6.         android:allowBackup="true"  
  7.         android:icon="@mipmap/ic_launcher"  
  8.         android:label="@string/app_name"  
  9.         android:theme="@style/AppTheme" >  
  10.         <activity  
  11.             android:name=".MainActivity"  
  12.             android:label="@string/app_name" >  
  13.             <intent-filter>  
  14.                 <action android:name="android.intent.action.MAIN" />  
  15.   
  16.                 <category android:name="android.intent.category.LAUNCHER" />  
  17.             </intent-filter>  
  18.         </activity>  
  19.   
  20.         <service  
  21.             android:enabled="true"  
  22.             android:exported="true"  
  23.             android:label="@string/app_name"  
  24.             android:name=".EnvelopeService"  
  25.             android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">  
  26.             <intent-filter>  
  27.                 <action android:name="android.accessibilityservice.AccessibilityService"/>  
  28.             </intent-filter>  
  29.             <meta-data  
  30.                 android:name="android.accessibilityservice"  
  31.                 android:resource="@xml/envelope_service_config"/>  
  32.         </service>  
  33.     </application>  
  34.   
  35. </manifest>  
envelope_service_config.xml

[html]  view plain   copy
  1. <?xml version="1.0"
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值