美文网首页
对企业微信的一次简单的逆向过程

对企业微信的一次简单的逆向过程

作者: 兔子吃过窝边草 | 来源:发表于2018-12-28 15:24 被阅读50次

    目的 学习一下反编译 就企业微信2.7.0做实验对象 如有侵犯之处 及时通知 好删掉相关资料

    image.png
    image.png
    jar合并包口令:jar -cvf name.jar .
    查看当前activity windows上adb 命令 adb shell dumpsys activity | findstr  "mFocus"
    
    聊天界面是:
    com.tencent.wework.msg.controller.MessageListActivity
    

    整个最外层 RelativeLayout
    name 16进制
    ab 0x7f110024
    右边红包部分 层数从最外层开始
    cn0 0x7f1111fc
    cn2 0x7f1111fe

    b2q.png

    "开" 图片资源为b2q

    打开红包界面为:
    com.tencent.wework.enterprise.redenvelopes.controller.RedEnvelopeCollectorActivity
    

    方法为:

    //查询
       public static void a(RedEnvelopesQueryDetailResult redEnvelopesQueryDetailResult, long j, long j2) {
            if (redEnvelopesQueryDetailResult == null || redEnvelopesQueryDetailResult.getInfo() == null) {
                bmc.d("RedEnvelopeCollectorActivity", new Object[]{"openRedEnvelope invalid result"});
                return;
            }
            dpc.a(redEnvelopesQueryDetailResult);
            Intent intent = new Intent(cuk.cgk, RedEnvelopeCollectorActivity.class);
            intent.putExtra("popupAnimation", true);
            intent.putExtra("extra_key_open_result_red_envelope", redEnvelopesQueryDetailResult.getInfo().hongbaoid);
            intent.putExtra("extra_key_red_envelope_conversation_id", j);
            intent.putExtra("extra_key_red_envlope_msg_id", j2);
            intent.putExtra("extra_key_red_open_type", 3);
            intent.addFlags(268435456);
            cuk.ap(intent);
        }
    //抢
    public static void a(RedEnvelopesGrabHongBaoResult redEnvelopesGrabHongBaoResult, long j, long j2, int i) {
            if (redEnvelopesGrabHongBaoResult == null || redEnvelopesGrabHongBaoResult.getInfo() == null) {
                bmc.d("RedEnvelopeCollectorActivity", new Object[]{"grabRedEnvelope invalid result"});
                return;
            }
            dpc.a(redEnvelopesGrabHongBaoResult);
            Intent intent = new Intent(cuk.cgk, RedEnvelopeCollectorActivity.class);
            intent.putExtra("popupAnimation", true);
            intent.putExtra("extra_key_open_result_red_envelope", redEnvelopesGrabHongBaoResult.getInfo().hongbaoid);
            intent.putExtra("extra_key_red_envelope_conversation_id", j);
            intent.putExtra("extra_key_red_envlope_msg_id", j2);
            intent.putExtra("extra_key_red_open_type", 2);
            intent.putExtra("extra_key_red_envelope_vid_ticket", i);
            intent.addFlags(268435456);
            cuk.ap(intent);
        }
    
    boE() 方法
    

    "开"
    d8r 0x7f111520 2131825952

     文件在com.tencent.wework.enterprise.redenvelopes.view.RedEnvelopeCollector
    

    fXT

    点击事件:
     case 2131825952:
                    if (this.fXN != null) {
                        bqU();
                        this.fXN.onAnimationStart();
                        this.fXT.setClickable(false);
                        return;
                    }
                    return;
    
     public void bqU() {
            this.fXN.boH();//setCollectorEventListener
            cpo = ObjectAnimator.ofFloat(this.fXT, "alpha", new float[]{1.0f, 0.0f});
            cpo.setDuration(400).start();
            new Handler().post(new Runnable() {
                public void run() {
                    RedEnvelopeCollector.this.bqV();
                }
            });
            this.fYm.postDelayed(this.fYn, 100000);
        }
    
    RedEnvelopeCollectorActivity  fXN.boh调用
    

    方法找到 在RedEnvelopeCollectorActivity 调用boB 方法 RedEnvelopesService

    protected void boB() {
            this.fSW.removeCallbacks(this.fSX);
            RedEnvelopesService.getService().unWrapHongBao(this.fSw, this.fSx, this.fSV, this);
        }
    
    参数
        protected void cZ(Context context) {
            this.mContext = context;
            this.fSv = new ctq(this.mContext);
            this.fSv.C(new int[]{2131296550});
            this.bTJ = getIntent().getLongExtra("extra_key_red_envelope_conversation_id", 0);
            long longExtra = getIntent().getLongExtra("extra_key_red_envlope_msg_id", 0);
            this.fSV = getIntent().getIntExtra("extra_key_red_envelope_vid_ticket", 0);
            this.duY = getIntent().getIntExtra("extra_key_red_open_type", 2);
            this.fSw = getIntent().getStringExtra("extra_key_open_result_red_envelope");
            this.bSA = MessageManager.cpc().X(this.bTJ, longExtra);
        }
    
    

    注释

    
    public static void a(Context paramContext, int paramInt, RedEnvelopesQueryDetailResult paramRedEnvelopesQueryDetailResult)
      {
        if (paramInt == -1900014) 
        {
          dpc.da(paramContext); // RedEnvelopeDataHelper classdex4里面
          return;
        }
        if ((paramInt == -1900015) && (paramRedEnvelopesQueryDetailResult != null) && (paramRedEnvelopesQueryDetailResult.getInfo() != null) && (!cts.dG(cts.ct(paramRedEnvelopesQueryDetailResult.getInfo().errmsg))))
        {
          dpc.aq(paramContext, cts.ct(paramRedEnvelopesQueryDetailResult.getInfo().errmsg));
          return;
        }
        if (paramInt == -1900005)
        {
          dpc.ap(paramContext, cuk.getString(2131369595)); //微信授权信息已经过期,无法领取红包,请进行“微信登录”后再试
          return;
        }
        if (paramInt == -1900001)
        {
          dpc.ap(paramContext, cuk.getString(2131367707));//拆红包前需要在企业微信中绑定你的微信帐号
          return;
        }
        if (paramInt == -1900018)
        {
    //你的微信帐号已被限制使用,请在帐号解封后,重新通过“微信登录”进入企业微信,即可使用红包功能
          crz.a(paramContext, cuk.getString(2131367803), null, cuk.getString(2131363788), null, new DialogInterface.OnClickListener()//
          {
            public void onClick(DialogInterface paramDialogInterface, int paramInt)
            {
              switch (paramInt)
              {
              case -2:
              case -1:
              }
            }
          });
          return;
        }
        if (paramInt == -1900036)
        {
    //根据央行监管要求,你需要在“微信->我->钱包->银行卡”中通过添加银行卡进行实名认证,才能领取红包
          crz.a(paramContext, cuk.getString(2131367804), null, cuk.getString(2131363788), null, new DialogInterface.OnClickListener()
          {
            public void onClick(DialogInterface paramDialogInterface, int paramInt)
            {
              switch (paramInt)
              {
              case -2:
              case -1:
              }
            }
          });
          return;
        }
        cty.cV(2131367824, 0);//获取红包详情失败,请稍后再试
      }
    

    进入红包界面 绑定参数

    protected void cZ(Context paramContext)
      {
        this.mContext = paramContext;
        this.fSv = new ctq(this.mContext);
        this.fSv.C(new int[] { 2131296550 });
        this.bTJ = getIntent().getLongExtra("extra_key_red_envelope_conversation_id", 0L);
        long l = getIntent().getLongExtra("extra_key_red_envlope_msg_id", 0L);
        this.fSV = getIntent().getIntExtra("extra_key_red_envelope_vid_ticket", 0);
        this.duY = getIntent().getIntExtra("extra_key_red_open_type", 2);
        this.fSw = getIntent().getStringExtra("extra_key_open_result_red_envelope");
        this.bSA = MessageManager.cpc().X(this.bTJ, l);
      }
    
    
    com.tencent.wework.msg.views.MessageListRedEnvelopeAckItemView
    红包view item
    private void cwe()
      {
        ees localees = getMessageItem();
        if ((localees == null) || (localees.cnA() == null))
        {
          bmc.d("MessageListBaseItemView", new Object[] { "handleOpenRedEnvlopeDetail, get messageItem error" });
          return;
        }
        on(true);
        String str1 = localees.cnA().hongbaoid;
        String str2 = cts.ct(localees.cnA().hbticket);
        Object[] arrayOfObject = new Object[4];
        arrayOfObject[0] = "open redEnvelopeDetail ";
        arrayOfObject[1] = str1;
        arrayOfObject[2] = Integer.valueOf(localees.cnA().hongbaotype);
        arrayOfObject[3] = str2;
        bmc.d("MessageListBaseItemView", arrayOfObject);
        RedEnvelopesService.getService().queryHongBaoDetail(str1, str2, new IRedEnvelopesQueryDetailCallBack(localees, str2)
        {
          public void onResult(boolean paramBoolean, int paramInt, RedEnvelopesQueryDetailResult paramRedEnvelopesQueryDetailResult)
          {
            Object[] arrayOfObject = new Object[3];
            arrayOfObject[0] = "open HongBao result";
            arrayOfObject[1] = Boolean.valueOf(paramBoolean);
            arrayOfObject[2] = Integer.valueOf(paramInt);
            bmc.d("MessageListBaseItemView", arrayOfObject);
            MessageListRedEnvelopeAckItemView.a(MessageListRedEnvelopeAckItemView.this, false);
            if (paramRedEnvelopesQueryDetailResult.getReceiveInfoList() != null)
              for (int i = 0; i < paramRedEnvelopesQueryDetailResult.getReceiveInfoList().length; i++)
              {
                long l = paramRedEnvelopesQueryDetailResult.getReceiveInfoList()[i].getInfo().vid;
                if ((MessageListRedEnvelopeAckItemView.a(MessageListRedEnvelopeAckItemView.this)) || (l != dwq.getVid()))
                  continue;
                MessageListRedEnvelopeAckItemView.b(MessageListRedEnvelopeAckItemView.this, true);
              }
            if ((paramBoolean) && (paramRedEnvelopesQueryDetailResult.getInfo() != null))
            {
              if (paramRedEnvelopesQueryDetailResult.getInfo().subhongbaotype == 7)
              {
                LishiDetailActivity.a(paramRedEnvelopesQueryDetailResult, this.etw.clL(), this.iaU, MessageListRedEnvelopeAckItemView.a(MessageListRedEnvelopeAckItemView.this), eco.cex().ix(MessageListRedEnvelopeAckItemView.this.bTJ), new UserSceneType(11, 0L));
                return;
              }
              RedEnvelopeDetailActivity.a(paramRedEnvelopesQueryDetailResult, this.etw.clL(), this.iaU, MessageListRedEnvelopeAckItemView.a(MessageListRedEnvelopeAckItemView.this), eco.cex().ix(MessageListRedEnvelopeAckItemView.this.bTJ), new UserSceneType(MessageListRedEnvelopeAckItemView.this.bTJ));
              return;
            }
            if (paramInt == -1900014)
            {
              dpc.da(MessageListRedEnvelopeAckItemView.this.getContext());
              return;
            }
            if ((paramInt == -1900015) && (paramRedEnvelopesQueryDetailResult != null) && (paramRedEnvelopesQueryDetailResult.getInfo() != null) && (!cts.dG(cts.ct(paramRedEnvelopesQueryDetailResult.getInfo().errmsg))))
            {
              dpc.aq(MessageListRedEnvelopeAckItemView.this.getContext(), cts.ct(paramRedEnvelopesQueryDetailResult.getInfo().errmsg));
              return;
            }
            if (paramInt == -1900005)
            {
              crz.a(MessageListRedEnvelopeAckItemView.this.getContext(), cuk.getString(2131367766), null, cuk.getString(2131367793), cuk.getString(2131363518), new DialogInterface.OnClickListener()
              {
                public void onClick(DialogInterface paramDialogInterface, int paramInt)
                {
                  switch (paramInt)
                  {
                  case -2:
                  default:
                    return;
                  case -1:
                  }
                  MessageListRedEnvelopeAckItemView.b(MessageListRedEnvelopeAckItemView.this);
                }
              });
              return;
            }
            if (paramInt == -1900018)
            {
              crz.a(MessageListRedEnvelopeAckItemView.this.getContext(), cuk.getString(2131367803), null, cuk.getString(2131363788), null, new DialogInterface.OnClickListener()
              {
                public void onClick(DialogInterface paramDialogInterface, int paramInt)
                {
                  switch (paramInt)
                  {
                  case -2:
                  case -1:
                  }
                }
              });
              return;
            }
            cty.cV(2131367824, 0);
          }
        });
      }
    
     private boolean h(Intent paramIntent, String paramString)
      {
        bmc.d("MessageListBaseItemView", new Object[] { "handleIntentSpan ", paramIntent, paramString });
        if (paramIntent == null);
        do
          return false;
        while 
    ((!paramIntent.getComponent().getClassName().equalsIgnoreCase(RedEnvelopeDetailActivity.class.getName())) || ((!cuk.getString(2131367706).equalsIgnoreCase(paramString)) && (!cuk.getString(2131367894).equalsIgnoreCase(paramString))));
        cwe();
        return true;
      }
    //cuk.getString(2131367706) :红包 
    //!cuk.getString(2131367894) :红包 
    
    • 最后你问我企业微信抢红包外挂 实现了吗?
    • 抱歉不能透露太多
    • 有基于无障碍辅助的助手在github上有

    相关文章

      网友评论

          本文标题:对企业微信的一次简单的逆向过程

          本文链接:https://www.haomeiwen.com/subject/eqiklqtx.html