Commit 31bb4a67 by jeffrey

重置太早了

parent b6b87a61
...@@ -81,27 +81,27 @@ public class NewService extends AccessibilityService { ...@@ -81,27 +81,27 @@ public class NewService extends AccessibilityService {
@Override // @Override
public int onStartCommand(Intent intent, int flags, int startId) { // public int onStartCommand(Intent intent, int flags, int startId) {
Log.d("fei", "onStartCommand start");
// NotificationUtils.foreground(getApplicationContext(),this);
// //
// //todo 当多任务过来的时候,没处理 // Log.d("fei", "onStartCommand start");
// if (intent != null && intent.getSerializableExtra(PARAMS_MSG) != null){ //// NotificationUtils.foreground(getApplicationContext(),this);
// //先设置变量 然后唤起微信,微信唤起后会通知onAccessibilityEvent ////
// //然后一步步走流程 //// //todo 当多任务过来的时候,没处理
// ReceiverMsg msg = (ReceiverMsg) intent.getSerializableExtra(PARAMS_MSG); //// if (intent != null && intent.getSerializableExtra(PARAMS_MSG) != null){
// taskMsg = msg; //// //先设置变量 然后唤起微信,微信唤起后会通知onAccessibilityEvent
// delayBean = msg.getTime_config(); //// //然后一步步走流程
// step=0; //// ReceiverMsg msg = (ReceiverMsg) intent.getSerializableExtra(PARAMS_MSG);
//// taskMsg = msg;
//// delayBean = msg.getTime_config();
//// step=0;
////
//// awakeWechat(getApplicationContext());
//// }
// //
// awakeWechat(getApplicationContext()); // //当service因为低内存被杀掉后,等内存足够时可以重启
// } // return START_STICKY;
// }
//当service因为低内存被杀掉后,等内存足够时可以重启
return START_STICKY;
}
@Subscribe @Subscribe
public void receiverMsg(final ReceiverMsg msg) { public void receiverMsg(final ReceiverMsg msg) {
...@@ -188,9 +188,9 @@ public class NewService extends AccessibilityService { ...@@ -188,9 +188,9 @@ public class NewService extends AccessibilityService {
step++; step++;
} }
if (step == 1 ){ // if (step == 1 ){
printAllNode(); // printAllNode();
} // }
// && findNodeByTexts(this,"文件传输助手") // && findNodeByTexts(this,"文件传输助手")
if (step == 1 ){ if (step == 1 ){
...@@ -200,7 +200,7 @@ public class NewService extends AccessibilityService { ...@@ -200,7 +200,7 @@ public class NewService extends AccessibilityService {
@Override @Override
public void delayMethord() { public void delayMethord() {
Log.d(TAG, "文件传输详情页面_填充"); Log.d(TAG, "文件传输详情页面_填充");
printAllNode(); // printAllNode();
if(fill()){ if(fill()){
Log.d(TAG, "文件传输详情页面_填充_完成"); Log.d(TAG, "文件传输详情页面_填充_完成");
...@@ -262,7 +262,7 @@ public class NewService extends AccessibilityService { ...@@ -262,7 +262,7 @@ public class NewService extends AccessibilityService {
if (step == 7 && className.equals(WeChatWebView)){ if (step == 7 && className.equals(WeChatWebView)){
Log.d(TAG, "开始点击确认登录"); Log.d(TAG, "开始点击确认登录");
pressSure(); pressSure();
resetAll(); // resetAll();
} }
// switch (eventType) { // switch (eventType) {
...@@ -531,12 +531,12 @@ public class NewService extends AccessibilityService { ...@@ -531,12 +531,12 @@ public class NewService extends AccessibilityService {
List<AccessibilityNodeInfo> allData = getRootInActiveWindow() List<AccessibilityNodeInfo> allData = getRootInActiveWindow()
.findAccessibilityNodeInfosByText(needBack2); .findAccessibilityNodeInfosByText(needBack2);
if (allData.isEmpty()) { if (allData.isEmpty()) {
Log.d("fei ", String.format("回头了成功 没有确定按钮")); Log.d(TAG, String.format("回头了成功 没有确定按钮"));
turnBack(isSuccess, 2); turnBack(isSuccess, 2);
} else { } else {
for (AccessibilityNodeInfo temp : allData) { for (AccessibilityNodeInfo temp : allData) {
Log.d("fei ", String.format("回头了 有确定按钮 再点击下")); Log.d(TAG, String.format("回头了 有确定按钮 再点击下"));
Rect rect = new Rect(); Rect rect = new Rect();
temp.getBoundsInScreen(rect); temp.getBoundsInScreen(rect);
final float x = rect.left + dip2px(5), y = rect.top + dip2px(5); final float x = rect.left + dip2px(5), y = rect.top + dip2px(5);
...@@ -551,6 +551,7 @@ public class NewService extends AccessibilityService { ...@@ -551,6 +551,7 @@ public class NewService extends AccessibilityService {
}); });
} }
} catch (Exception ignored) { } catch (Exception ignored) {
Log.d(TAG, "异常 " + ignored.getMessage());
} }
} }
...@@ -604,6 +605,7 @@ public class NewService extends AccessibilityService { ...@@ -604,6 +605,7 @@ public class NewService extends AccessibilityService {
WeChatStatus.finishAll(); WeChatStatus.finishAll();
clickDone = false; clickDone = false;
// String uniqueID = taskMsg.getUnique_id();
upResult(code,taskMsg.getUnique_id()); upResult(code,taskMsg.getUnique_id());
resetAll(); resetAll();
} }
...@@ -614,6 +616,7 @@ public class NewService extends AccessibilityService { ...@@ -614,6 +616,7 @@ public class NewService extends AccessibilityService {
* @param code * @param code
*/ */
private void upResult(final int code, final String id) { private void upResult(final int code, final String id) {
Log.d(TAG,"开始上报结果 " + code + " " + id);
HttpClientApi.devicesScan(PushServiceFactory.getCloudPushService().getDeviceId(), HttpClientApi.devicesScan(PushServiceFactory.getCloudPushService().getDeviceId(),
code, code,
id, id,
...@@ -625,6 +628,7 @@ public class NewService extends AccessibilityService { ...@@ -625,6 +628,7 @@ public class NewService extends AccessibilityService {
@Override @Override
public void onNext(String responseBase) { public void onNext(String responseBase) {
Log.d(TAG,"上报结果 " + responseBase);
showToast(getApplicationContext(), String.format("code %d message_id %s 上报结果 %s",code,id,responseBase)); showToast(getApplicationContext(), String.format("code %d message_id %s 上报结果 %s",code,id,responseBase));
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment