├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── ansen
│ │ └── accessibility
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── ansen
│ │ │ └── accessibility
│ │ │ ├── MainActivity.kt
│ │ │ ├── MyApp.kt
│ │ │ ├── WXAccessibilityService.kt
│ │ │ └── WXHelpService.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── accessibility_config.xml
│ └── test
│ └── java
│ └── com
│ └── ansen
│ └── accessibility
│ └── ExampleUnitTest.java
├── autojs.apk
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AccessibilityDEV
2 | android无障碍服务开发(微信朋友圈自动点赞,抢红包,自动加好友)
3 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android-extensions'
3 | apply plugin: 'kotlin-android'
4 |
5 | android {
6 | compileSdkVersion 28
7 | defaultConfig {
8 | applicationId "com.ansen.accessibility"
9 | minSdkVersion 25
10 | targetSdkVersion 28
11 | versionCode 1
12 | versionName "1.0"
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 | implementation 'com.android.support:appcompat-v7:28.0.0'
26 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
27 | implementation "com.orhanobut:hawk:2.0.1"
28 | testImplementation 'junit:junit:4.12'
29 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
30 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
32 | }
33 | repositories {
34 | mavenCentral()
35 | }
36 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/ansen/accessibility/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.ansen.accessibility;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.ansen.accessibility", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/ansen/accessibility/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ansen.accessibility
2 |
3 | import android.content.Intent
4 | import android.support.v7.app.AppCompatActivity
5 | import android.os.Bundle
6 | import android.provider.Settings
7 | import android.view.View
8 | import com.orhanobut.hawk.Hawk
9 | import kotlinx.android.synthetic.main.activity_main.*
10 |
11 | class MainActivity : AppCompatActivity() {
12 |
13 | companion object {
14 | val ADD_FRIENDS = "add_friends"
15 | val FRIEND_SQUARE = "auto_zan"
16 | val RED_PACKET = "red_packet"
17 | }
18 |
19 | override fun onCreate(savedInstanceState: Bundle?) {
20 | super.onCreate(savedInstanceState)
21 | setContentView(R.layout.activity_main)
22 |
23 | add_friends.isChecked = Hawk.get(ADD_FRIENDS, true);
24 | auto_zan.isChecked = Hawk.get(FRIEND_SQUARE, true);
25 |
26 | add_friends.setOnCheckedChangeListener { _, isChecked ->
27 | if (isChecked) Hawk.put(ADD_FRIENDS, true) else Hawk.put(ADD_FRIENDS, false)
28 | }
29 | auto_zan.setOnCheckedChangeListener { _, isChecked ->
30 | if (isChecked) Hawk.put(FRIEND_SQUARE, true) else Hawk.put(FRIEND_SQUARE, false)
31 | }
32 |
33 |
34 | }
35 |
36 | fun open(view: View) {
37 | startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS))
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/ansen/accessibility/MyApp.kt:
--------------------------------------------------------------------------------
1 | package com.ansen.accessibility
2 |
3 | import android.app.Application
4 | import com.orhanobut.hawk.Hawk
5 | import kotlin.properties.Delegates
6 |
7 | /**
8 | * 描述:
9 | *
10 | * @author CoderPig on 2018/04/12 11:43.
11 | */
12 | class MyApp : Application() {
13 | companion object {
14 | var instance by Delegates.notNull()
15 | }
16 |
17 | override fun onCreate() {
18 | super.onCreate()
19 | instance = this
20 | Hawk.init(this).build()
21 | }
22 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/ansen/accessibility/WXAccessibilityService.kt:
--------------------------------------------------------------------------------
1 | package com.ansen.accessibility
2 |
3 | import android.accessibilityservice.AccessibilityService
4 | import android.app.KeyguardManager
5 | import android.app.Notification
6 | import android.app.PendingIntent
7 | import android.content.Context
8 | import android.os.PowerManager
9 | import android.util.Log
10 | import android.view.accessibility.AccessibilityEvent
11 | import android.view.accessibility.AccessibilityNodeInfo
12 |
13 |
14 | import java.util.ArrayList
15 |
16 | /**
17 | * Created by Ansen on 2016/5/7 10:31.
18 | *
19 | * @E-mail: tomorrow_p@163.com
20 | * @Blog: http://blog.csdn.net/qq_25804863
21 | * @Github: https://github.com/ansen360
22 | * @PROJECT_NAME: CodeRepository
23 | * @PACKAGE_NAME: com.ansen.service
24 | * @Description: AccessibilityService可以获取当前页面的信息(view的节点), 并且可以模拟点击事件
25 | */
26 | class WXAccessibilityService : AccessibilityService() {
27 | private var mKeyguardManager: KeyguardManager? = null
28 | private var mKeyguardLock: KeyguardManager.KeyguardLock? = null
29 | //唤醒屏幕相关
30 | private var mPowerManager: PowerManager? = null
31 | private var mWakeLock: PowerManager.WakeLock? = null
32 | private var mNodeInfos: MutableList? = null
33 | private var lastCount: Int = 0
34 | private var isChatUI = false
35 | private var isNotifyEnter = false
36 |
37 |
38 | override fun onServiceConnected() {
39 | super.onServiceConnected()
40 | mNodeInfos = ArrayList()
41 | }
42 |
43 | override fun onAccessibilityEvent(event: AccessibilityEvent) {
44 | val eventType = event.eventType
45 | val className = event.className.toString()
46 | when (eventType) {
47 | 2048 //监听视图变化事件
48 | -> {
49 | if (isChatUI && "android.widget.TextView" == className) {
50 | getIncreasePacket()
51 | Log.i(TAG, "来消息")
52 | }
53 |
54 | Log.d("2048", "2048 " + event.className.toString())
55 | }
56 | // 监听有通知栏消息的事件
57 | AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED -> {
58 | val texts = event.text
59 | if (!texts.isEmpty()) {
60 | for (text in texts) {
61 | val content = text.toString()
62 | Log.d(TAG, "content: $content")
63 | if (content.contains("[微信红包]")) {
64 | //打开通知栏消息
65 | if (event.parcelableData != null && event.parcelableData is Notification) {
66 | val notification = event.parcelableData as Notification
67 | val pendingIntent = notification.contentIntent
68 | try {
69 | pendingIntent.send()
70 | isNotifyEnter = true
71 | } catch (e: PendingIntent.CanceledException) {
72 | e.printStackTrace()
73 | }
74 |
75 | }
76 | }
77 | }
78 | }
79 | }
80 |
81 | // 监听窗口发生变化的事件(判断是否进入微信红包消息界面)
82 | AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED -> {
83 | Log.i(TAG, "className: $className")
84 | if ("com.tencent.mm.ui.LauncherUI" == className) { //聊天页面
85 | if (isNotifyEnter) {
86 | getLastPacket()
87 | Log.i(TAG, "通知栏: 开")
88 | }
89 | isNotifyEnter = false
90 | isChatUI = true
91 | } else if ("com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyReceiveUI" == className) { //红包页面
92 | isChatUI = false
93 | //拆红包
94 | executeClick("com.tencent.mm:id/bg7")
95 | // executeClick("com.tencent.mm:id/bga"); //返回
96 | Log.i(TAG, "拆")
97 | } else if ("com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyDetailUI" == className) { //红包已打开页面
98 | isChatUI = false
99 | executeClick("com.tencent.mm:id/ge") //返回
100 | Log.i(TAG, "关")
101 | } else {
102 | isChatUI = false
103 | }
104 | }
105 | }
106 |
107 |
108 | }
109 |
110 | private fun getIncreasePacket() {
111 | val rootNode = rootInActiveWindow
112 | recycle(rootNode)
113 | if (mNodeInfos!!.size > 0) {
114 | if (lastCount < mNodeInfos!!.size) { //有新消息
115 | mNodeInfos!![mNodeInfos!!.size - 1].performAction(AccessibilityNodeInfo.ACTION_CLICK)
116 | Log.i(TAG, "新红包")
117 | }
118 | lastCount = mNodeInfos!!.size
119 | }
120 | mNodeInfos!!.clear()
121 | }
122 |
123 | private fun getLastPacket() {
124 | val rootNode = rootInActiveWindow
125 | recycle(rootNode)
126 | if (mNodeInfos!!.size > 0) {
127 | mNodeInfos!![mNodeInfos!!.size - 1].performAction(AccessibilityNodeInfo.ACTION_CLICK)
128 | lastCount = mNodeInfos!!.size
129 | mNodeInfos!!.clear()
130 | }
131 | }
132 |
133 |
134 | /**
135 | * 打印一个节点的结构
136 | */
137 | fun recycle(info: AccessibilityNodeInfo) {
138 | if (info.childCount == 0) {
139 | if (info.text != null) {
140 | if ("领取红包" == info.text.toString()) {
141 | //找到一个可以点击的View,模拟点击指定事件
142 | info.performAction(AccessibilityNodeInfo.ACTION_CLICK)
143 | var parent: AccessibilityNodeInfo? = info.parent
144 | while (parent != null) {
145 | if (parent.isClickable) {
146 | mNodeInfos!!.add(parent)
147 | break
148 | }
149 | parent = parent.parent
150 | }
151 |
152 | }
153 | }
154 |
155 | } else {
156 | for (i in 0 until info.childCount) {
157 | if (info.getChild(i) != null) {
158 | recycle(info.getChild(i))
159 | }
160 | }
161 | }
162 | }
163 |
164 |
165 | /**
166 | * 查找对应控件,模拟点击事件
167 | */
168 | private fun executeClick(id: String) {
169 | val nodeInfo = rootInActiveWindow
170 | if (nodeInfo != null) {
171 | // 通过节点View的Text内容来查找
172 | // List list = nodeInfo.findAccessibilityNodeInfosByText("开");
173 | // 通过节点View在xml布局中的id名称
174 | val list = nodeInfo.findAccessibilityNodeInfosByViewId(id)
175 | for (n in list) {
176 | n.performAction(AccessibilityNodeInfo.ACTION_CLICK)
177 | }
178 | }
179 |
180 | }
181 |
182 | private fun wakeUp(b: Boolean) {
183 | if (b) {
184 | //获取电源管理器对象
185 | mPowerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
186 |
187 | //获取PowerManager.WakeLock对象,后面的参数|表示同时传入两个值,最后的是调试用的Tag
188 | mWakeLock = mPowerManager!!.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP or PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "bright")
189 |
190 | //点亮屏幕
191 | mWakeLock!!.acquire()
192 |
193 | //得到键盘锁管理器对象
194 | mKeyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
195 | mKeyguardLock = mKeyguardManager!!.newKeyguardLock("unLock")
196 |
197 | //解锁
198 | mKeyguardLock!!.disableKeyguard()
199 | } else {
200 | //锁屏
201 | mKeyguardLock!!.reenableKeyguard()
202 |
203 | //释放wakeLock,关灯
204 | mWakeLock!!.release()
205 | }
206 |
207 | }
208 |
209 | override fun onInterrupt() {
210 |
211 | }
212 |
213 | companion object {
214 |
215 | private val TAG = "ansen"
216 | }
217 | }
218 |
--------------------------------------------------------------------------------
/app/src/main/java/com/ansen/accessibility/WXHelpService.kt:
--------------------------------------------------------------------------------
1 | package com.ansen.accessibility
2 |
3 | import android.accessibilityservice.AccessibilityService
4 | import android.app.Notification
5 | import android.app.PendingIntent
6 | import android.os.Handler
7 | import android.os.SystemClock
8 | import android.util.Log
9 | import android.view.accessibility.AccessibilityEvent
10 | import android.view.accessibility.AccessibilityNodeInfo
11 | import com.orhanobut.hawk.Hawk
12 |
13 | /**
14 | * 微信自动加好友服务类
15 | */
16 |
17 | class WXHelpService : AccessibilityService() {
18 |
19 | private var isAdd = false
20 | private var index = 0
21 | private val handler = Handler()
22 |
23 | override fun onAccessibilityEvent(event: AccessibilityEvent) {
24 | val eventType = event.eventType
25 | val classNameChr = event.className
26 | val className = classNameChr.toString()
27 | Log.d("ansen", event.toString())
28 | when (eventType) {
29 | AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED -> if (event.parcelableData != null && event.parcelableData is Notification) {
30 | // val notification = event.parcelableData as Notification
31 | // val content = notification.tickerText.toString()
32 | // if (content.contains("请求添加你为朋友")) {
33 | // val pendingIntent = notification.contentIntent
34 | // try {
35 | // pendingIntent.send()
36 | // } catch (e: PendingIntent.CanceledException) {
37 | // e.printStackTrace()
38 | // }
39 | //
40 | // }
41 | }
42 | AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED -> {
43 | Log.d(TAG, className)
44 | if (Hawk.get(MainActivity.ADD_FRIENDS, true)) {
45 | when (className) {
46 | "com.tencent.mm.ui.widget.a.c" -> {
47 | Log.d(TAG, "隐私提示: widget.a.c ")
48 | val az_ = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/az_")
49 | if (az_ != null && az_.size > 0) {
50 | az_[0].performAction(AccessibilityNodeInfo.ACTION_CLICK)
51 | SystemClock.sleep(500)
52 | performBackClick()
53 | }
54 | }
55 | "com.tencent.mm.ui.base.p" -> Log.d(TAG, "隐私提示: .ui.base.p")
56 | "com.tencent.mm.chatroom.ui.ChatroomInfoUI" // 聊天信息
57 | , "com.tencent.mm.plugin.chatroom.ui.ChatroomInfoUI" -> {
58 | Log.d(TAG, "聊天信息 页面")
59 |
60 | val nodeInfo = rootInActiveWindow // 获取当前整个活动窗口的根节点 返回值记录View的状态信息
61 | // 查找 查看全部群成员 按鈕
62 | val listNodes = nodeInfo.findAccessibilityNodeInfosByViewId("android:id/title")
63 | if (listNodes != null && listNodes.size == 0) {
64 | Log.d(TAG, "沒找到 查看全部群成员 按鈕")
65 |
66 | val listNodes1 = nodeInfo.findAccessibilityNodeInfosByViewId("android:id/list")
67 | if (listNodes1 != null && listNodes1.size > 0) {
68 |
69 | listNodes1[0].performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)
70 | Log.d(TAG, "滑动后继续查找")
71 | SystemClock.sleep(1000)
72 | // 查找
73 | val listNodes2 = rootInActiveWindow.findAccessibilityNodeInfosByViewId("android:id/title")
74 | if (listNodes2 != null && listNodes2.size > 0) {
75 | listNodes2[0].parent.performAction(AccessibilityNodeInfo.ACTION_CLICK)
76 | Log.d(TAG, "点击: " + listNodes2[0].text)
77 | }
78 | }
79 | } else {
80 | listNodes!![0].parent.performAction(AccessibilityNodeInfo.ACTION_CLICK)
81 | Log.d(TAG, "点击: " + listNodes[0].text)
82 | }
83 | index = 0
84 | SystemClock.sleep(1000)
85 | }
86 | "com.tencent.mm.plugin.chatroom.ui.SeeRoomMemberUI", "com.tencent.mm.chatroom.ui.SeeRoomMemberUI" -> {
87 | Log.d(TAG, "聊天成员")
88 | SystemClock.sleep(3000)
89 | isAdd = false
90 | if (rootInActiveWindow == null) {
91 | return
92 | }
93 | val nodeInfos = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/e4_")
94 | if (nodeInfos != null && nodeInfos.size > 0) {
95 | if (index < nodeInfos[0].childCount) {
96 | nodeInfos[0].getChild(index).performAction(AccessibilityNodeInfo.ACTION_CLICK)
97 | SystemClock.sleep(1000)
98 | index++
99 | } else {
100 | val b = nodeInfos[0].performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)
101 | SystemClock.sleep(2000)
102 | Log.d(TAG, "翻页: $b")
103 | if (b) {
104 | val nodeInfo1 = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/e4_")
105 | if (nodeInfo1 != null && nodeInfo1.size > 0) {
106 | val childCount = nodeInfo1[0].childCount
107 | if (childCount > 0) {
108 | index = 0
109 | }
110 | if (index < childCount) {
111 | nodeInfo1[0].getChild(index).performAction(AccessibilityNodeInfo.ACTION_CLICK)
112 | }
113 | }
114 | }
115 | }
116 | }
117 | }
118 | "com.tencent.mm.plugin.profile.ui.ContactInfoUI" -> {
119 | SystemClock.sleep(500)
120 | if (isAdd) {
121 | performBackClick()
122 | Log.d(TAG, "添加成功")
123 | } else {
124 | Log.d(TAG, "添加联系页面")
125 | val icon = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/iq")
126 | if (icon.size > 0) {
127 | performBackClick()
128 | Log.d(TAG, "已经添加 直接返回")
129 | } else {
130 | val adds = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/cs")
131 | if (adds != null && adds.size > 0) {
132 | adds[0].parent.performAction(AccessibilityNodeInfo.ACTION_CLICK)
133 | Log.d(TAG, "点击添加")
134 | } else {
135 | performBackClick()
136 | }
137 | SystemClock.sleep(1000)
138 | }
139 | }
140 | }
141 | "com.tencent.mm.plugin.profile.ui.SayHiWithSnsPermissionUI" -> {
142 | Log.d(TAG, "验证申请")
143 |
144 | val sends = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/jx")
145 | if (sends != null && sends.size > 0) {
146 | sends[0].performAction(AccessibilityNodeInfo.ACTION_CLICK)
147 | Log.d(TAG, "发送")
148 | }
149 | SystemClock.sleep(800)
150 | isAdd = true
151 | }
152 | }
153 | }
154 | if (Hawk.get(MainActivity.FRIEND_SQUARE, true)) {
155 | when (className) {
156 | "com.tencent.mm.plugin.sns.ui.SnsTimeLineUI" -> {
157 | Log.d(TAG, "自动点赞")
158 | autoZan()
159 | }
160 | }
161 | }
162 |
163 | if (Hawk.get(MainActivity.RED_PACKET, false)) {
164 | when (className) {
165 | "com.tencent.mm.ui.LauncherUI" -> openRedPacket()
166 | "com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyReceiveUI" -> clickRedPacket()
167 | "com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyDetailUI" -> performBackClick()
168 | }
169 | }
170 | }
171 | }
172 | }
173 |
174 | private fun performBackClick() {
175 | handler.postDelayed({ performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK) }, 300L)
176 | }
177 |
178 | //自动点赞
179 | private fun autoZan() {
180 | val nodeInfo = rootInActiveWindow
181 | if (nodeInfo != null) {
182 | while (true) {
183 | val rootNode = rootInActiveWindow
184 | if (rootNode != null) {
185 | val listNodes = rootNode.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/eii") // ListView
186 | if (listNodes != null && listNodes.size > 0) {
187 | val listNode = listNodes[0]
188 | val zanNodes = listNode.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/eho") // 点击ImageView
189 | for (zan in zanNodes) {
190 | zan.performAction(AccessibilityNodeInfo.ACTION_CLICK)
191 | Thread.sleep(300)
192 | val zsNodes = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/eh_") // 对话框容器
193 | Thread.sleep(300)
194 | if (zsNodes != null && zsNodes.size > 0) {
195 | if (zsNodes[0].findAccessibilityNodeInfosByText("赞").size > 0) {
196 | zsNodes[0].performAction(AccessibilityNodeInfo.ACTION_CLICK)
197 | }
198 | }
199 | Thread.sleep(500)
200 | }
201 | listNode.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)
202 | }
203 | } else {
204 | break
205 | }
206 | }
207 | }
208 | }
209 |
210 | // 遍历控件方法
211 | fun recycle(info: AccessibilityNodeInfo) {
212 | if (info.childCount == 0) {
213 | Log.i(TAG, "child widget----------------------------" + info.className.toString())
214 | Log.i(TAG, "showDialog:" + info.canOpenPopup())
215 | Log.i(TAG, "Text:" + info.text)
216 | Log.i(TAG, "windowId:" + info.windowId)
217 | Log.i(TAG, "desc:" + info.contentDescription)
218 | } else {
219 | for (i in 0 until info.childCount) {
220 | if (info.getChild(i) != null) {
221 | recycle(info.getChild(i))
222 | }
223 | }
224 | }
225 | }
226 |
227 | //对话框自动点击
228 | private fun dialogClick() {
229 | val inviteNode = rootInActiveWindow.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/az_")[0]
230 | inviteNode.performAction(AccessibilityNodeInfo.ACTION_CLICK)
231 | }
232 |
233 | //遍历获得未打开红包
234 | private fun openRedPacket() {
235 | val rootNode = rootInActiveWindow
236 | if (rootNode != null) {
237 | val listNode = rootNode.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/cpj")
238 | if (listNode != null && listNode.size > 0) {
239 | val msgNodes = listNode[0].findAccessibilityNodeInfosByViewId("com.tencent.mm:id/azn")
240 | if (msgNodes != null && msgNodes.size > 0) {
241 | for (rpNode in msgNodes) {
242 | val rpStatusNode = rpNode.findAccessibilityNodeInfosByText("领取红包")
243 | if (rpStatusNode != null && rpStatusNode.size > 0) {
244 | rpNode.performAction(AccessibilityNodeInfo.ACTION_CLICK)
245 | break
246 | }
247 | }
248 | }
249 | }
250 |
251 |
252 | }
253 | }
254 |
255 | //打开红包
256 | private fun clickRedPacket() {
257 | val nodeInfo = rootInActiveWindow
258 | val clickNode = nodeInfo.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/cnu")
259 | if (clickNode != null && clickNode.size > 0) {
260 | clickNode[0].performAction(AccessibilityNodeInfo.ACTION_CLICK)
261 | } else {
262 | performBackClick()
263 | }
264 | }
265 |
266 | override fun onInterrupt() {
267 |
268 | }
269 |
270 | companion object {
271 |
272 | private val TAG = "WXHelpService"
273 | }
274 |
275 | }
276 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
24 |
25 |
39 |
40 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 趣创助手
3 | 趣创助手
4 | 开启趣创助手,即可使用微信辅助功能
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/accessibility_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/test/java/com/ansen/accessibility/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.ansen.accessibility;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/autojs.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/autojs.apk
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.21'
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.3.1'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
15 |
16 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ansen360/AccessibilityDEV/997b2623907bddce5c968bff0df36bbd3818a698/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Feb 18 10:30:50 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------