@@ -193,7 +193,10 @@ class WechatService : AccessibilityService() {
193193 private fun monitorChat () {
194194 LogUtils .d(" monitorChat" )
195195 if (! RedEnvelopePreferences .wechatControl.isMonitorChat) return
196- val lists = AccessibilityServiceUtils .getElementsById(RED_ENVELOPE_RECT_TITLE_ID , rootInActiveWindow) ? : return
196+ val lists = AccessibilityServiceUtils .getElementsById(
197+ RED_ENVELOPE_RECT_TITLE_ID ,
198+ rootInActiveWindow
199+ ) ? : return
197200 for (envelope in lists) {
198201 val redEnvelope = envelope.findAccessibilityNodeInfosByViewId(RED_ENVELOPE_TITLE_ID )
199202 if (redEnvelope.isNotEmpty()) {
@@ -213,7 +216,8 @@ class WechatService : AccessibilityService() {
213216 private fun grabRedEnvelope () {
214217 LogUtils .d(" grabRedEnvelope" )
215218
216- val envelopes = AccessibilityServiceUtils .getElementsById(RED_ENVELOPE_ID , rootInActiveWindow) ? : return
219+ val envelopes =
220+ AccessibilityServiceUtils .getElementsById(RED_ENVELOPE_ID , rootInActiveWindow) ? : return
217221
218222 /* 发现红包点击进入领取红包页面 */
219223 for (envelope in envelopes.reversed()) {
@@ -236,7 +240,9 @@ class WechatService : AccessibilityService() {
236240 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) return
237241 if (event.className != WECHAT_LUCKYMONEY_ACTIVITY ) return
238242
239- var envelopes = AccessibilityServiceUtils .getElementsById(RED_ENVELOPE_OPEN_ID , rootInActiveWindow) ? : return
243+ var envelopes =
244+ AccessibilityServiceUtils .getElementsById(RED_ENVELOPE_OPEN_ID , rootInActiveWindow)
245+ ? : return
240246 if (envelopes.isEmpty()) {
241247 envelopes = rootInActiveWindow.findAccessibilityNodeInfosByViewId(RED_ENVELOPE_CLOSE_ID )
242248 /* 进入红包页面点击退出按钮 */
@@ -301,6 +307,11 @@ class WechatService : AccessibilityService() {
301307 path.moveTo(450f , 1250f )
302308 420 -> // 420一加5T
303309 path.moveTo(540f , 1213f )
310+ 400 ->
311+ path.moveTo(550f , 1200f ) // 华为mate9
312+ else ->
313+ path.moveTo(550f , 1200f )
314+
304315 }
305316 val build = GestureDescription .Builder ()
306317 val gestureDescription =
0 commit comments