加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长资讯 > 评论 > 正文

分析黑客 | 实用技巧之“抢火车票、红包技术”,防止上当受骗

发布时间:2019-01-27 06:56:08 所属栏目:评论 来源:Jayson
导读:副标题#e# 一、抢火车票 1、抢火车票软件的技术原理 目前主流的抢票软件是安装在浏览器上的插件,像猎豹、360浏览器等,用于在12306网站上抢票。 常规情况下,使用12306网站订票时,如果刷新页面就需要再次填写个人信息,这就耽误了不少时间。这一耽误,可

检测监听事件的节点信息

  1. private void checkNodeInfo() { 
  2.  L.d("checkNodeInfo!"); 
  3.  if (this.rootNodeInfo == null) return; 
  4.  /* 聊天会话窗口,遍历节点匹配“领取红包”和"查看红包" */ 
  5.  List<AccessibilityNodeInfo> nodes1 = this.findAccessibilityNodeInfosByTexts(this.rootNodeInfo, new String[]{ 
  6.  GET_RED_PACKET, CHECK_RED_PACKET}); 
  7.  if (!nodes1.isEmpty()) { 
  8.  L.d("!nodes1.isEmpty()"); 
  9.  AccessibilityNodeInfo targetNode = nodes1.get(nodes1.size() - 1); 
  10.  if ("android.widget.LinearLayout".equals(targetNode.getParent().getClassName()))//避免被文字干扰导致外挂失效 
  11.  { 
  12.  if (this.signature.generateSignature(targetNode)) { 
  13.  mLuckyMoneyReceived = true; 
  14.  mReceiveNode = targetNode; 
  15.  L.d("signature:" + this.signature.toString()); 
  16.  } 
  17.  } else { 
  18.  L.d("this is text"); 
  19.  } 
  20.  return; 
  21.  } 
  22.   
  23.  List<AccessibilityNodeInfo> nodes2 = this.findAccessibilityNodeInfosByTexts(this.rootNodeInfo, new String[]{ 
  24.  "拆红包"}); 
  25.  if (!nodes2.isEmpty()) { 
  26.  L.d("node2 != null"); 
  27.  for (AccessibilityNodeInfo nodeInfo : nodes2) { 
  28.  if (nodeInfo.getClassName().equals("android.widget.Button")) 
  29.  nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK); 
  30.  } 
  31.  } else { 
  32.  /* 戳开红包,红包还没抢完,遍历节点匹配“拆红包” */ 
  33.  AccessibilityNodeInfo node2 = (this.rootNodeInfo.getChildCount() > 3) ? this.rootNodeInfo.getChild(3) : null; 
  34.  if (node2 != null && node2.getClassName().equals("android.widget.Button")) { 
  35.  mUnpackNode = node2; 
  36.  mNeedUnpack = true; 
  37.  isToGetMoney = true; 
  38.  L.d("find red packet!"); 
  39.  return; 
  40.  } 
  41.  } 
  42.  /* 戳开红包,红包已被抢完,遍历节点匹配“已存入零钱”和“手慢了” */ 
  43.  if (mLuckyMoneyPicked) { 
  44.  List<AccessibilityNodeInfo> nodes3 = this.findAccessibilityNodeInfosByTexts(this.rootNodeInfo, new String[]{ 
  45.  RED_PACKET_PICKED, RED_PACKET_SAVE, RED_PACKET_PICKED2, RED_PACKET_PICKED_DETAIL}); 
  46.  if (!nodes3.isEmpty()) { 
  47.  L.d("!nodes3.isEmpty()");  
  48.  if (rootNodeInfo.getChildCount() > 1) { 
  49.  L.d("RED_PACKET_PICKED!"); 
  50.  } else { 
  51.  L.d("nodes3.get(0).toString(): " + nodes3.get(0).getText().toString()); 
  52.  if (!nodes3.get(0).getText().toString().equals(RED_PACKET_PICKED_DETAIL)) { 
  53.  AccessibilityNodeInfo targetNode = nodes3.get(nodes3.size() - 1); 
  54.  hongbaoInfo.getInfo(targetNode); 
  55.  if (isToGetMoney) { 
  56.  isGetMoney = true; 
  57.  isToGetMoney = false; 
  58.  gotMoney = hongbaoInfo.getMoney(); 
  59.  L.d("gotMoney: " + gotMoney); 
  60.  } 
  61.  L.d("RED_PACKET_SAVE!"); 
  62.  L.d("hongbaoInfo: " + hongbaoInfo.toString()); 
  63.  } else { 
  64.  L.d("this packet is myself!"); 
  65.  } 
  66.   
  67.  } 
  68.  mNeedBack = true; 
  69.  mLuckyMoneyPicked = false; 
  70.  } 
  71.  } 
  72.  } 

主要通过检测“领取红包”等关键文字信息来判断是否有新红包

检测收到红包时判断是否"android.widget.LinearLayout",屏蔽聊天信息中的文字干扰

拆红包时,由于微信版本可能不同,同时进行两种判断,以兼容部分版本

拆完红包需自动返回,有以下几种情况:抢到了,手慢了,以及该红包是自己发出的红包

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读