贴吧助手web版

 找回密码
 
搜索
查看: 2015|回复: 1

4·百度贴吧安卓客户端接口分析 c/s/logtogether

[复制链接]
     紫钻仅向指定用户开放  
  • TA的每日心情
    不屑
    昨天 17:30
  • 签到天数: 1104 天

    [LV.10]以坛为家III

    685

    主题

    1507

    帖子

    1530

    积分

    管理员

    Rank: 15Rank: 15Rank: 15Rank: 15

    金币
    3565

    接口达人工具作者土豪之星

    发表于 2016-3-17 09:42:29 | 显示全部楼层 |阅读模式
    [mw_shl_code=java,true]package com.baidu.tbadk.distribute;

    import android.content.Context;
    import android.os.Build;
    import android.os.Handler;
    import android.os.Looper;
    import android.text.TextUtils;
    import com.baidu.adp.framework.MessageManager;
    import com.baidu.adp.framework.listener.CustomMessageListener;
    import com.baidu.adp.framework.message.NetMessage;
    import com.baidu.adp.framework.task.HttpMessageTask;
    import com.baidu.adp.framework.task.SocketMessageTask;
    import com.baidu.adp.lib.util.i;
    import com.baidu.adp.lib.util.k;
    import com.baidu.tbadk.TbConfig;
    import com.baidu.tbadk.core.TbadkCoreApplication;
    import com.baidu.tbadk.core.data.c.a;
    import com.baidu.tbadk.core.util.TiebaStatic;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import tbclient.LogTogether.AdReq;

    public class a
    {
      public static String asm = null;
      private static a asn = new a();
      private boolean aso = i.iZ();
      private ArrayList<AdReq> asp = new ArrayList();
      private long asq = 60000L;
      private int asr = 10;
      private com.baidu.adp.framework.listener.a ass = new c(this, 1003000, 303101);
      private CustomMessageListener ast = new d(this, 2000994);
      private ArrayList<com.baidu.tbadk.core.data.c> asu = new ArrayList();
      private ArrayList<com.baidu.tbadk.core.data.c> asv = new ArrayList();
      private HashMap<String, com.baidu.tbadk.core.data.c> asw = new HashMap();
      private HashMap<String, com.baidu.tbadk.core.data.c> asx = new HashMap();
      private final CustomMessageListener downloadListener = new e(this, 2001122);
      private Handler handler = new b(this, Looper.getMainLooper());
      private boolean isUpload = true;
      
      public static a Cl()
      {
        return asn;
      }
      
      private void Cm()
      {
        this.handler.removeMessages(1);
      }
      
      private void Cn()
      {
        this.handler.removeMessages(1);
        this.handler.sendEmptyMessageDelayed(1, this.asq);
      }
      
      private HttpMessageTask Co()
      {
        HttpMessageTask localHttpMessageTask = new HttpMessageTask(1003000, TbConfig.SERVER_ADDRESS + "c/s/logtogether" + "?cmd=" + 303101);
        localHttpMessageTask.setResponsedClass(DistributeHttpResponse.class);
        return localHttpMessageTask;
      }
      
      private boolean Cp()
      {
        return this.handler.hasMessages(1);
      }
      
      private SocketMessageTask Cq()
      {
        SocketMessageTask localSocketMessageTask = new SocketMessageTask(303101);
        localSocketMessageTask.i(true);
        localSocketMessageTask.setResponsedClass(DistributeSocketResponse.class);
        return localSocketMessageTask;
      }
      
      private void a(Context paramContext, ArrayList<com.baidu.tbadk.core.data.c> paramArrayList, String paramString1, String paramString2, long paramLong)
      {
        if ((paramArrayList == null) || (paramArrayList.size() <= 0)) {}
        StringBuilder localStringBuilder7;
        StringBuilder localStringBuilder8;
        StringBuilder localStringBuilder11;
        StringBuilder localStringBuilder3;
        StringBuilder localStringBuilder6;
        StringBuilder localStringBuilder9;
        StringBuilder localStringBuilder4;
        StringBuilder localStringBuilder5;
        StringBuilder localStringBuilder2;
        StringBuilder localStringBuilder10;
        StringBuilder localStringBuilder1;
        int j;
        int i;
        for (;;)
        {
          return;
          localStringBuilder7 = new StringBuilder();
          localStringBuilder8 = new StringBuilder();
          localStringBuilder11 = new StringBuilder();
          localStringBuilder3 = new StringBuilder();
          localStringBuilder6 = new StringBuilder();
          localStringBuilder9 = new StringBuilder();
          localStringBuilder4 = new StringBuilder();
          localStringBuilder5 = new StringBuilder();
          localStringBuilder2 = new StringBuilder();
          localStringBuilder10 = new StringBuilder();
          localStringBuilder1 = new StringBuilder();
          j = paramArrayList.size();
          i = 0;
          if (i < j) {
            break;
          }
          localObject = new StringBuilder(15);
          ((StringBuilder)localObject).append(String.valueOf(k.K(paramContext)));
          ((StringBuilder)localObject).append(",");
          ((StringBuilder)localObject).append(String.valueOf(k.L(paramContext)));
          TiebaStatic.eventStat(paramContext, "ad_distribute", null, 1, new Object[] { "da_task", "tbda", "da_page", paramString1, "da_locate", localStringBuilder8, "da_type", "show", "da_obj_id", localStringBuilder11, "fid", paramString2, "tid", Long.valueOf(paramLong), "da_good_id", localStringBuilder3, "da_ext_info", localStringBuilder6, "da_price", localStringBuilder9, "da_verify", localStringBuilder7, "cuid", TbadkCoreApplication.getInst().getCuid(), "uid", TbadkCoreApplication.getCurrentAccount(), "baiduid", TbadkCoreApplication.getCurrentBduss(), "da_obj_name", localStringBuilder4, "da_first_name", localStringBuilder5, "da_second_name", localStringBuilder2, "da_cpid", localStringBuilder10, "da_abtest", localStringBuilder1, "da_stime", Long.valueOf(System.currentTimeMillis()), "phone_screen", ((StringBuilder)localObject).toString(), "model", Build.MODEL });
          paramArrayList.clear();
        }
        Object localObject = (com.baidu.tbadk.core.data.c)paramArrayList.get(i);
        if (localObject == null) {}
        for (;;)
        {
          i++;
          break;
          if (i == j - 1)
          {
            localStringBuilder7.append(((com.baidu.tbadk.core.data.c)localObject).UF);
            localStringBuilder8.append(((com.baidu.tbadk.core.data.c)localObject).Uz);
            localStringBuilder11.append(((com.baidu.tbadk.core.data.c)localObject).Ut);
            localStringBuilder3.append(((com.baidu.tbadk.core.data.c)localObject).UI.UO);
            localStringBuilder6.append(((com.baidu.tbadk.core.data.c)localObject).UG);
            localStringBuilder9.append(((com.baidu.tbadk.core.data.c)localObject).price);
            localStringBuilder4.append(((com.baidu.tbadk.core.data.c)localObject).Uu);
            localStringBuilder5.append(((com.baidu.tbadk.core.data.c)localObject).UB);
            localStringBuilder2.append(((com.baidu.tbadk.core.data.c)localObject).UC);
            localStringBuilder10.append(((com.baidu.tbadk.core.data.c)localObject).UD);
            localStringBuilder1.append(((com.baidu.tbadk.core.data.c)localObject).abtest);
          }
          else
          {
            localStringBuilder7.append(((com.baidu.tbadk.core.data.c)localObject).UF).append("|");
            localStringBuilder8.append(((com.baidu.tbadk.core.data.c)localObject).Uz).append("|");
            localStringBuilder11.append(((com.baidu.tbadk.core.data.c)localObject).Ut).append("|");
            localStringBuilder3.append(((com.baidu.tbadk.core.data.c)localObject).UI.UO).append("|");
            localStringBuilder6.append(((com.baidu.tbadk.core.data.c)localObject).UG).append("|");
            localStringBuilder9.append(((com.baidu.tbadk.core.data.c)localObject).price).append("|");
            localStringBuilder4.append(((com.baidu.tbadk.core.data.c)localObject).Uu).append("|");
            localStringBuilder5.append(((com.baidu.tbadk.core.data.c)localObject).UB).append("|");
            localStringBuilder2.append(((com.baidu.tbadk.core.data.c)localObject).UC).append("|");
            localStringBuilder10.append(((com.baidu.tbadk.core.data.c)localObject).UD).append("|");
            localStringBuilder1.append(((com.baidu.tbadk.core.data.c)localObject).abtest).append("|");
          }
        }
      }
      
      private void a(AdReq paramAdReq)
      {
        try
        {
          if ((this.asp != null) && (this.asp.size() < 20)) {
            this.asp.add(paramAdReq);
          }
          return;
        }
        finally
        {
          paramAdReq = finally;
          throw paramAdReq;
        }
      }
      
      private void bg(boolean paramBoolean)
      {
        if (this.aso == paramBoolean) {}
        for (;;)
        {
          return;
          this.aso = paramBoolean;
          if (paramBoolean) {
            bj(true);
          } else {
            Cm();
          }
        }
      }
      
      private void bj(boolean paramBoolean)
      {
        Object localObject;
        if ((this.aso) && (this.isUpload))
        {
          localObject = bk(paramBoolean);
          if ((paramBoolean) || (!Cp())) {
            Cn();
          }
          if ((localObject != null) && (((List)localObject).size() != 0)) {
            break label49;
          }
        }
        for (;;)
        {
          return;
          label49:
          if (!paramBoolean) {
            Cn();
          }
          localObject = new DistributeRequest((List)localObject);
          MessageManager.getInstance().sendMessage((NetMessage)localObject);
        }
      }
      
      /* Error */
      private List<AdReq> bk(boolean paramBoolean)
      {
        // Byte code:
        //   0: aconst_null
        //   1: astore 4
        //   3: aload_0
        //   4: monitorenter
        //   5: iload_1
        //   6: ifne +26 -> 32
        //   9: aload_0
        //   10: getfield 91        com/baidu/tbadk/distribute/a:asp        Ljava/util/ArrayList;
        //   13: invokevirtual 193        java/util/ArrayList:size        ()I
        //   16: istore_2
        //   17: aload_0
        //   18: getfield 103        com/baidu/tbadk/distribute/a:asr        I
        //   21: istore_3
        //   22: iload_2
        //   23: iload_3
        //   24: if_icmpge +8 -> 32
        //   27: aload_0
        //   28: monitorexit
        //   29: aload 4
        //   31: areturn
        //   32: aload_0
        //   33: getfield 91        com/baidu/tbadk/distribute/a:asp        Ljava/util/ArrayList;
        //   36: invokevirtual 193        java/util/ArrayList:size        ()I
        //   39: ifle -12 -> 27
        //   42: new 88        java/util/ArrayList
        //   45: astore 4
        //   47: aload 4
        //   49: invokespecial 89        java/util/ArrayList:<init>        ()V
        //   52: aload 4
        //   54: aload_0
        //   55: getfield 91        com/baidu/tbadk/distribute/a:asp        Ljava/util/ArrayList;
        //   58: invokevirtual 406        java/util/ArrayList:addAll        (Ljava/util/Collection;)Z
        //   61: pop
        //   62: aload_0
        //   63: getfield 91        com/baidu/tbadk/distribute/a:asp        Ljava/util/ArrayList;
        //   66: invokevirtual 299        java/util/ArrayList:clear        ()V
        //   69: goto -42 -> 27
        //   72: astore 4
        //   74: aload_0
        //   75: monitorexit
        //   76: aload 4
        //   78: athrow
        // Local variable table:
        //   start        length        slot        name        signature
        //   0        79        0        this        a
        //   0        79        1        paramBoolean        boolean
        //   16        9        2        i        int
        //   21        4        3        j        int
        //   1        52        4        localObject1        Object
        //   72        5        4        localObject2        Object
        // Exception table:
        //   from        to        target        type
        //   9        22        72        finally
        //   32        69        72        finally
      }
      
      private void eU(String paramString)
      {
        com.baidu.tbadk.core.data.c localc = (com.baidu.tbadk.core.data.c)this.asw.remove(paramString);
        if (localc == null) {}
        for (;;)
        {
          return;
          this.asx.put(paramString, localc);
          paramString = com.baidu.tieba.recapp.report.e.a(localc, "download_status", 0);
          paramString.bj("dl", "start");
          com.baidu.tieba.recapp.report.b.aEK().a(paramString);
        }
      }
      
      private void r(List<AdReq> paramList)
      {
        try
        {
          if (this.asp != null) {
            this.asp.addAll(paramList);
          }
          return;
        }
        finally
        {
          paramList = finally;
          throw paramList;
        }
      }
      
      private void v(String paramString, int paramInt)
      {
        Object localObject = (com.baidu.tbadk.core.data.c)this.asx.remove(paramString);
        if (localObject == null) {
          return;
        }
        if (paramInt == 0) {
          paramString = "success";
        }
        for (;;)
        {
          localObject = com.baidu.tieba.recapp.report.e.a((com.baidu.tbadk.core.data.c)localObject, "download_status", 0);
          ((com.baidu.tieba.recapp.report.a)localObject).bj("dl", paramString);
          com.baidu.tieba.recapp.report.b.aEK().a((com.baidu.tieba.recapp.report.a)localObject);
          break;
          if (paramInt == 2)
          {
            paramString = "fail";
          }
          else
          {
            if (paramInt != 4) {
              break;
            }
            paramString = "cancel";
          }
        }
      }
      
      public void a(Context paramContext, com.baidu.tbadk.core.data.c paramc, String paramString1, String paramString2, String paramString3, long paramLong)
      {
        if (paramc == null) {}
        for (;;)
        {
          return;
          if (TextUtils.equals(paramString1, "show"))
          {
            if (TextUtils.equals(paramString2, "frs")) {
              this.asu.add(paramc);
            } else if (TextUtils.equals(paramString2, "pb")) {
              this.asv.add(paramc);
            }
          }
          else if ((TextUtils.equals(paramString1, "btn_click")) || (TextUtils.equals(paramString1, "btn_download")) || (TextUtils.equals(paramString1, "area_click")) || (TextUtils.equals(paramString1, "area_download")))
          {
            StringBuilder localStringBuilder = new StringBuilder(15);
            localStringBuilder.append(String.valueOf(k.K(paramContext)));
            localStringBuilder.append(",");
            localStringBuilder.append(String.valueOf(k.L(paramContext)));
            TiebaStatic.eventStat(paramContext, "ad_distribute", null, 1, new Object[] { "da_task", "tbda", "da_page", paramString2, "da_locate", paramc.Uz, "da_type", paramString1, "da_obj_id", paramc.Ut, "fid", paramString3, "tid", Long.valueOf(paramLong), "da_good_id", Integer.valueOf(paramc.UI.UO), "da_ext_info", paramc.UG, "da_price", paramc.price, "da_verify", paramc.UF, "cuid", TbadkCoreApplication.getInst().getCuid(), "uid", TbadkCoreApplication.getCurrentAccount(), "baiduid", TbadkCoreApplication.getCurrentBduss(), "da_obj_name", paramc.Uu, "da_first_name", paramc.UB, "da_second_name", paramc.UC, "da_cpid", Integer.valueOf(paramc.UD), "da_abtest", paramc.abtest, "da_stime", Long.valueOf(System.currentTimeMillis()), "phone_screen", localStringBuilder.toString(), "model", Build.MODEL });
          }
        }
      }
      
      public void a(com.baidu.tbadk.core.data.c paramc)
      {
        this.asw.put(paramc.Uy, paramc);
      }
      
      public void a(com.baidu.tbadk.core.data.c paramc, String paramString1, long paramLong, String paramString2, String paramString3, int paramInt)
      {
        if (paramc == null) {
          return;
        }
        paramc = paramc.a(paramString1, paramLong, paramString2, paramString3, paramInt);
        if (TextUtils.equals(paramString3, "show")) {
          a(paramc);
        }
        if ((TextUtils.equals(paramString3, "click")) || (TextUtils.equals(paramString3, "download")))
        {
          if (!this.aso) {
            break label87;
          }
          paramc = new DistributeRequest(paramc);
          MessageManager.getInstance().sendMessage(paramc);
        }
        for (;;)
        {
          bj(false);
          break;
          label87:
          a(paramc);
        }
      }
      
      public void b(Context paramContext, String paramString1, String paramString2, long paramLong)
      {
        if (TextUtils.equals(paramString1, "frs")) {
          a(paramContext, this.asu, paramString1, paramString2, paramLong);
        }
        for (;;)
        {
          return;
          if (TextUtils.equals(paramString1, "pb")) {
            a(paramContext, this.asv, paramString1, paramString2, paramLong);
          }
        }
      }
      
      public void bh(boolean paramBoolean)
      {
        MessageManager localMessageManager = MessageManager.getInstance();
        if (paramBoolean) {
          localMessageManager.registerTask(Cq());
        }
        localMessageManager.registerTask(Co());
        localMessageManager.registerListener(this.ass);
        localMessageManager.registerListener(this.ast);
        localMessageManager.registerListener(this.downloadListener);
      }
      
      public void bi(boolean paramBoolean)
      {
        this.isUpload = paramBoolean;
      }
      
      public void eq(int paramInt)
      {
        if (paramInt > 3600) {
          this.asq = 300000L;
        }
        for (;;)
        {
          return;
          if (paramInt <= 0) {
            this.asq = 60000L;
          } else {
            this.asq = (paramInt * 1000L);
          }
        }
      }
      
      public void er(int paramInt)
      {
        if (paramInt > 20) {
          this.asr = 10;
        }
        for (;;)
        {
          return;
          if (paramInt <= 0) {
            this.asr = 5;
          } else {
            this.asr = paramInt;
          }
        }
      }
    }
    [/mw_shl_code]
    游客,如果您要查看本帖隐藏内容请回复




    上一篇:百度贴吧发蓝字,繁体字代码详细教程
    下一篇:2016年3月19日签到记录贴
    喵星人贴吧助手你值得拥有
    回复

    使用道具 举报

            
  • TA的每日心情
    疑惑
    2016-10-11 16:00
  • 签到天数: 1 天

    [LV.1]初来乍到

    0

    主题

    10

    帖子

    10

    积分

    按个爪印

    Rank: 1

    金币
    15
    发表于 2016-10-11 16:04:22 | 显示全部楼层
    正需要,支持楼主大人了!
    该会员没有填写今日想说内容.
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 |

    本版积分规则

    快速回复 返回顶部 返回列表