TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c

以下内容为反编译后的 ContactSearchModelTool.java 源代码,内容仅作参考


package com.tencent.mobileqq.search.model;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import com.dataline.activities.LiteActivity;
import com.tencent.biz.pubaccount.readinjoy.activity.ReadInJoyActivityHelper;
import com.tencent.biz.pubaccount.serviceAccountFolder.ServiceAccountFolderActivity;
import com.tencent.biz.pubaccount.serviceAccountFolder.ServiceAccountFolderManager;
import com.tencent.biz.pubaccount.subscript.SubscriptRecommendController;
import com.tencent.biz.pubaccount.troopbarassit.TroopBarAssistantManager;
import com.tencent.biz.pubaccount.util.PublicAccountConfigUtil;
import com.tencent.biz.pubaccount.util.PublicAccountUtil;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.activity.TroopAssistantActivity;
import com.tencent.mobileqq.activity.contact.newfriend.NewFriendActivity;
import com.tencent.mobileqq.activity.contact.troop.TroopActivity;
import com.tencent.mobileqq.activity.recent.RecentFaceDecoder;
import com.tencent.mobileqq.activity.recent.RecentUtil;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.FriendsManager;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.RecommendTroopManagerImp;
import com.tencent.mobileqq.app.SearchHistoryManager;
import com.tencent.mobileqq.data.Friends;
import com.tencent.mobileqq.filemanager.data.FMConstants;
import com.tencent.mobileqq.search.IContactSearchable;
import com.tencent.mobileqq.search.util.SearchUtils;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.subaccount.SubAccountAssistantForward;
import com.tencent.mobileqq.systemmsg.GroupSystemMsgController;
import com.tencent.mobileqq.unifiedebug.UnifiedTraceRouter;
import com.tencent.mobileqq.utils.ChnToSpell;
import com.tencent.mobileqq.utils.ContactUtils;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import cooperation.readinjoy.ReadInJoyHelper;
import java.util.List;
public class ContactSearchModelTool extends IContactSearchModel {
    private int f92018a;
    private long f27634a;
    private String f27635a;
    private long f92019b;
    private String f27636b;
    private String f92020c;
    private String d;
    private String e;

    public ContactSearchModelTool(QQAppInterface qQAppInterface, int i, String str, int i2) {
        super(qQAppInterface, i);
        this.f27634a = IContactSearchable.H;
        this.f27635a = str;
        this.f92018a = i2;
        a();
    }

    private void a() {
        Friends friends;
        String str;
        switch (this.f92018a) {
            case 1001:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f63875name_res_0x7f0a1562);
                break;
            case 1008:
                if (TextUtils.equals(this.f27635a, AppConstants.ax)) {
                    this.f92020c = PublicAccountConfigUtil.b(this.f27676a, BaseApplicationImpl.getContext());
                    break;
                }
                break;
            case 4000:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f63429name_res_0x7f0a13a4);
                break;
            case 5000:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f64333name_res_0x7f0a172c);
                break;
            case 6000:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f58684name_res_0x7f0a0116);
                break;
            case 6004:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f67069name_res_0x7f0a21e1);
                break;
            case 7000:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f65106name_res_0x7f0a1a36);
                if (!AppConstants.aA.equals(this.f27635a)) {
                    FriendsManager friendsManager = (FriendsManager) this.f27676a.getManager(50);
                    if (friendsManager == null) {
                        friends = null;
                    } else {
                        friends = friendsManager.m4355c(this.f27635a);
                    }
                    if (friends != null && friends.name != null) {
                        str = friends.name;
                    } else {
                        str = this.f27635a;
                    }
                    if (TextUtils.isEmpty(str) || str.equals(this.f27635a)) {
                        String c2 = ContactUtils.c(this.f27676a, this.f27635a, true);
                        if (!TextUtils.isEmpty(c2)) {
                            str = c2;
                        }
                    }
                    if (TextUtils.isEmpty(str)) {
                        str = this.f27635a;
                    }
                    this.f92020c += UnifiedTraceRouter.e + str + UnifiedTraceRouter.f;
                    break;
                }
                break;
            case AppConstants.VALUE.ac:
                this.f92020c = PublicAccountConfigUtil.a(this.f27676a, (Context) BaseApplicationImpl.getContext());
                break;
            case AppConstants.VALUE.ae:
                this.f92020c = PublicAccountConfigUtil.c(this.f27676a, BaseApplicationImpl.getContext());
                break;
            case AppConstants.VALUE.af:
                this.f92020c = ServiceAccountFolderManager.a(this.f27676a);
                break;
            case AppConstants.VALUE.ak:
                this.f92020c = BaseApplicationImpl.f6970a.getString(R.string.f63410name_res_0x7f0a1391);
                break;
        }
        if (!TextUtils.isEmpty(this.f92020c)) {
            this.d = ChnToSpell.m9099a(this.f92020c, 1).toLowerCase();
            this.e = ChnToSpell.m9099a(this.f92020c, 2).toLowerCase();
        }
    }

    @Override
    public Object mo7650a() {
        return "tool:" + this.f27635a;
    }

    @Override
    public long a() {
        return this.f92019b;
    }

    @Override
    public int a() {
        return ((Integer) RecentFaceDecoder.a(this.f27676a, this.f92018a, this.f27635a).first).intValue();
    }

    @Override
    public String mo7652a() {
        return this.f27635a;
    }

    @Override
    public int mo7654b() {
        return this.f92018a;
    }

    @Override
    public long a(String str) {
        this.f27636b = str;
        this.f92019b = Long.MIN_VALUE;
        long b2 = SearchUtils.b(str, this.f92020c, IContactSearchable.j);
        if (b2 > this.f92019b) {
            this.f92019b = b2;
        }
        if (this.f92018a == 7220 || (this.f92018a == 1008 && TextUtils.equals(this.f27635a, AppConstants.ax))) {
            long b3 = SearchUtils.b(str, "看点", IContactSearchable.j);
            if (b3 > this.f92019b) {
                this.f92019b = b3;
            }
        }
        if (ReadInJoyHelper.m11170a(this.f27676a) && this.f92018a == 7220) {
            long b4 = SearchUtils.b(str, String.format(BaseApplicationImpl.f6970a.getString(R.string.f63559name_res_0x7f0a1426), PublicAccountConfigUtil.a(this.f27676a, this.f27676a.getApplication().getApplicationContext()), PublicAccountConfigUtil.c(this.f27676a, this.f27676a.getApplication().getApplicationContext()), PublicAccountConfigUtil.c(this.f27676a, this.f27676a.getApplication().getApplicationContext())), IContactSearchable.n);
            if (b4 > this.f92019b) {
                this.f92019b = b4;
            }
        }
        return this.f92019b;
    }

    @Override
    public String c() {
        return this.f92020c;
    }

    @Override
    public String d() {
        return null;
    }

    @Override
    public CharSequence c() {
        switch (this.f92018a) {
            case AppConstants.VALUE.ae:
                return SearchUtils.a(String.format(BaseApplicationImpl.f6970a.getString(R.string.f63559name_res_0x7f0a1426), PublicAccountConfigUtil.a(this.f27676a, this.f27676a.getApplication().getApplicationContext()), PublicAccountConfigUtil.c(this.f27676a, this.f27676a.getApplication().getApplicationContext()), PublicAccountConfigUtil.c(this.f27676a, this.f27676a.getApplication().getApplicationContext())), this.f27636b, 255);
            default:
                return null;
        }
    }

    @Override
    public void a(View view) {
        Intent a2;
        if (SearchUtils.m7681a(this.f92049b)) {
            switch (this.f92018a) {
                case 1008:
                    if (TextUtils.equals(this.f27635a, AppConstants.ax)) {
                        ReportController.b(null, "dc01331", "", "", "0X800671A", "0X800671A", 0, 0, "", "", "", "");
                        ReadInJoyActivityHelper.a(view.getContext(), (List) null, -1L, 1);
                        PublicAccountUtil.a(this.f27676a, true);
                        SearchUtils.a(this.f27676a, a().toString(), this.f27635a, "", this.f92018a);
                        break;
                    }
                    break;
                case 4000:
                    Intent intent = new Intent(view.getContext(), NewFriendActivity.class);
                    intent.setFlags(67108864);
                    view.getContext().startActivity(intent);
                    break;
                case 5000:
                    Intent intent2 = new Intent(view.getContext(), TroopAssistantActivity.class);
                    intent2.setFlags(67108864);
                    view.getContext().startActivity(intent2);
                    break;
                case 6000:
                    Intent intent3 = new Intent(view.getContext(), LiteActivity.class);
                    intent3.putExtra(FMConstants.f23336N, AppConstants.aD);
                    RecentUtil.f15389a = true;
                    RecentUtil.a(intent3);
                    view.getContext().startActivity(intent3);
                    break;
                case 6004:
                    Intent intent4 = new Intent(view.getContext(), QQBrowserActivity.class);
                    intent4.putExtra("url", "https://docs.qq.com/components/Notifications.html?_wv=3");
                    intent4.putExtra("hide_more_button", true);
                    intent4.putExtra("webStyle", "noBottomBar");
                    intent4.putExtra("isScreenOrientationPortrait", true);
                    intent4.putExtra("title", this.f27676a.getApp().getString(R.string.f67069name_res_0x7f0a21e1));
                    intent4.addFlags(603979776);
                    view.getContext().startActivity(intent4);
                    break;
                case 7000:
                    SubAccountAssistantForward.a(this.f27676a, view.getContext(), this.f27635a);
                    this.f27676a.m4635a().m5081c(this.f27635a, this.f92018a);
                    break;
                case AppConstants.VALUE.ac:
                    TroopBarAssistantManager a3 = TroopBarAssistantManager.a();
                    a3.e(this.f27676a, false);
                    a3.d(this.f27676a, false);
                    if (ReadInJoyHelper.m11170a(this.f27676a)) {
                        a2 = ReadInJoyActivityHelper.a(view.getContext(), 0, 1);
                    } else {
                        a2 = ReadInJoyActivityHelper.a(view.getContext(), -1, 1);
                    }
                    a2.putExtra(SubscriptRecommendController.f5057b, 1);
                    a2.setFlags(67108864);
                    view.getContext().startActivity(a2);
                    break;
                case AppConstants.VALUE.ae:
                    ReadInJoyActivityHelper.a(this.f27676a, view.getContext(), 1, 0);
                    ReportController.b(null, "dc01331", "", "", "0X800671A", "0X800671A", 0, 0, "", "", "", "");
                    PublicAccountUtil.a(this.f27676a, true);
                    SearchUtils.a(this.f27676a, a().toString(), this.f27635a, "", this.f92018a);
                    break;
                case AppConstants.VALUE.af:
                    Intent intent5 = new Intent(view.getContext(), ServiceAccountFolderActivity.class);
                    intent5.putExtra(ServiceAccountFolderActivity.f4853a, "from_search");
                    intent5.setFlags(67108864);
                    view.getContext().startActivity(intent5);
                    if (QLog.isColorLevel()) {
                        QLog.d("ContactSearchModelTool", 2, "enterServiceAccountFolderActivityFromSearch");
                        break;
                    }
                    break;
                case AppConstants.VALUE.ak:
                    Intent intent6 = new Intent();
                    intent6.putExtra(TroopActivity.f14098h, 2);
                    intent6.setClass(view.getContext(), TroopActivity.class);
                    int a4 = GroupSystemMsgController.a().a(this.f27676a);
                    if (a4 <= 0) {
                        a4 = RecommendTroopManagerImp.b(this.f27676a);
                    }
                    this.f27676a.m4632a().c(AppConstants.aW, AppConstants.VALUE.ak, -a4);
                    view.getContext().startActivity(intent6);
                    break;
            }
            SearchHistoryManager.a(this.f27676a, this.f27636b);
            long j = 0;
            try {
                j = Long.parseLong(this.f27635a);
            } catch (NumberFormatException e) {
                e.printStackTrace();
            }
            SearchUtils.a(this.f27636b, 20, (int) j, view);
            return;
        }
        SearchUtils.a(view, this);
    }

    @Override
    public String mo7651b() {
        return this.f27636b;
    }

    @Override
    public boolean mo6380a() {
        return false;
    }

    @Override
    public CharSequence d() {
        return null;
    }
}