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

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


package com.tencent.mobileqq.troop.jsp;

import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import android.widget.RelativeLayout;
import com.tencent.biz.pubaccount.PublicAccountBrowser;
import com.tencent.biz.troop.TroopMemberApiClient;
import com.tencent.common.app.AppInterface;
import com.tencent.mobileqq.activity.ChatSettingForTroop;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.activity.QQBrowserDelegationActivity;
import com.tencent.mobileqq.activity.SplashActivity;
import com.tencent.mobileqq.activity.TIMTroopMemberCardActivity;
import com.tencent.mobileqq.activity.aio.AIOUtils;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.filemanager.data.FMConstants;
import com.tencent.mobileqq.filemanager.data.ForwardFileInfo;
import com.tencent.mobileqq.filemanager.fileviewer.TroopFileDetailBrowserActivity;
import com.tencent.mobileqq.openapi.sdk.ApiConstants;
import com.tencent.mobileqq.structmsg.StructMsgConstants;
import com.tencent.mobileqq.troop.activity.TroopAssistantFeedsActivity;
import com.tencent.mobileqq.troop.logic.VideoPlayLogic;
import com.tencent.mobileqq.troop.utils.TroopUtils;
import com.tencent.mobileqq.webview.swift.JsBridgeListener;
import com.tencent.mobileqq.webview.swift.WebViewPlugin;
import com.tencent.qphone.base.util.QLog;
import cooperation.qzone.QZoneHelper;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONObject;
public class TroopAssistantFeedsJsHandler extends WebViewPlugin {
    public static final byte f93958a = 101;
    public static final String f32286a = "TroopAssistantFeedsJsHandler";
    public static final String f93959b = "http://qqweb.qq.com/m/qunfeeds/index.html?_wv=1031&_bid=200";
    public static final String f93960c = "troopAssistantFeeds";
    protected static final String d = "openGroupCard";
    protected static final String e = "openGroupMemCard";
    protected static final String f = "openGroupAIO";
    protected static final String g = "openGroupFileDetail";
    protected static final String h = "openGroupPhotoDetail";
    protected static final String i = "openVideo";
    protected static final String j = "openGroupFeedsDetail";
    protected RelativeLayout f32287a;
    protected TroopMemberApiClient f32288a;
    protected VideoPlayLogic f32289a;
    protected AtomicBoolean f32290a = new AtomicBoolean(false);

    public TroopAssistantFeedsJsHandler() {
        this.mPluginNameSpace = f93960c;
    }

    @Override
    public boolean handleJsRequest(JsBridgeListener jsBridgeListener, String str, String str2, String str3, String... strArr) {
        if (f93960c.equals(str2)) {
            if (d.equals(str3) && strArr.length > 0) {
                d(strArr[0]);
                return true;
            } else if (e.equals(str3) && strArr.length > 0) {
                e(strArr[0]);
                return true;
            } else if (f.equals(str3) && strArr.length > 0) {
                f(strArr[0]);
                return true;
            } else if (g.equals(str3) && strArr.length > 0) {
                g(strArr[0]);
                return true;
            } else if (h.equals(str3) && strArr.length > 0) {
                h(strArr[0]);
                return true;
            } else if (i.equals(str3) && strArr.length > 0) {
                b(strArr[0]);
                return true;
            } else if (j.equals(str3) && strArr.length > 0) {
                a(strArr[0]);
                return true;
            }
        }
        return false;
    }

    protected void a(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopFeeds:" + str);
            }
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString("url");
            String string2 = jSONObject.getString("title");
            if (!TextUtils.isEmpty(string)) {
                Activity a2 = this.mRuntime.a();
                Intent intent = new Intent(a2, TroopAssistantFeedsActivity.class);
                intent.putExtra("url", string);
                intent.putExtra("webStyle", "noBottomBar");
                intent.putExtra("hide_more_button", true);
                intent.putExtra(PublicAccountBrowser.h, true);
                intent.putExtra(QQBrowserActivity.W, false);
                intent.putExtra("title", string2);
                a2.startActivity(intent);
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopFeeds:" + e2.toString());
            }
        }
    }

    protected void b(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openVideo:" + str);
            }
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString("guin");
            String string2 = jSONObject.getString("gcode");
            String string3 = jSONObject.getString("videourl");
            if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2) && !TextUtils.isEmpty(string3)) {
                if (this.f32290a.compareAndSet(false, true)) {
                    this.f32288a = TroopMemberApiClient.a();
                    this.f32288a.m1748a();
                }
                this.f32288a.a(string3, new vak(this, string3, string2));
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openVideo:" + e2.toString());
            }
        }
    }

    public void c(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openVideoInBrowserActivity:" + str);
            }
            Activity a2 = this.mRuntime.a();
            String trim = str.trim();
            String currentAccountUin = this.mRuntime.m9632a().getCurrentAccountUin();
            Intent intent = new Intent(a2, QQBrowserDelegationActivity.class);
            StringBuilder append = new StringBuilder(trim).append(trim.indexOf("?") > 0 ? "" : "?").append("&from=androidqq");
            intent.putExtra(QQBrowserDelegationActivity.f10669a, true);
            intent.putExtra("injectrecommend", false);
            intent.putExtra("key_isReadModeEnabled", true);
            intent.putExtra("url", append.toString().trim());
            intent.putExtra("uin", currentAccountUin);
            intent.putExtra("friendUin", "");
            a2.startActivity(intent);
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openVideoInBrowserActivity:" + e2.toString());
            }
        }
    }

    public void a(String str, String str2) {
        Activity a2;
        if (QLog.isColorLevel()) {
            QLog.d(f32286a, 2, "openVideoInner:" + str + ", " + str2);
        }
        if (this.mRuntime != null && (a2 = this.mRuntime.a()) != null && a2 != null && (a2 instanceof TroopAssistantFeedsActivity)) {
            ((TroopAssistantFeedsActivity) a2).a(str, str2, this.mRuntime.m9632a().getCurrentAccountUin());
        }
    }

    protected void d(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopCard:" + str);
            }
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString("guin");
            String string2 = jSONObject.getString("gcode");
            if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2)) {
                Activity a2 = this.mRuntime.a();
                Intent intent = new Intent(a2, ChatSettingForTroop.class);
                intent.putExtra("troop_code", string);
                intent.putExtra("troop_uin", string2);
                intent.putExtra(AppConstants.Key.dk, 6);
                intent.putExtra(TroopUtils.f32690a, 2);
                a2.startActivity(intent);
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopCard:" + e2.toString());
            }
        }
    }

    protected void e(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopMemberCard:" + str);
            }
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString("guin");
            String string2 = jSONObject.getString("gcode");
            String string3 = jSONObject.getString("muin");
            String currentAccountUin = this.mRuntime.m9632a().getCurrentAccountUin();
            if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2) && !TextUtils.isEmpty(string3) && !TextUtils.isEmpty(currentAccountUin)) {
                Activity a2 = this.mRuntime.a();
                Intent intent = new Intent(a2, TIMTroopMemberCardActivity.class);
                intent.putExtra("troopUin", string2);
                intent.putExtra("troopCode", string);
                intent.putExtra("memberUin", string3);
                intent.putExtra("fromFlag", 3);
                a2.startActivity(intent);
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopMemberCard:" + e2.toString());
            }
        }
    }

    protected void f(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopAIO:" + str);
            }
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString("guin");
            String string2 = jSONObject.getString("gcode");
            String string3 = jSONObject.getString("gname");
            if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2)) {
                Activity a2 = this.mRuntime.a();
                Intent a3 = AIOUtils.a(new Intent(a2, SplashActivity.class), (int[]) null);
                a3.putExtra("uin", string2);
                a3.putExtra("troop_uin", string);
                a3.putExtra("uintype", 1);
                a3.putExtra(AppConstants.Key.h, string3);
                a2.startActivity(a3);
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openTroopAIO:" + e2.toString());
            }
        }
    }

    protected void g(String str) {
        long j2;
        long j3;
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openFile:" + str);
            }
            JSONObject jSONObject = new JSONObject(str);
            String string = jSONObject.getString(StructMsgConstants.cl);
            try {
                j2 = jSONObject.getLong("fileSize");
                j3 = jSONObject.getLong("gcode");
            } catch (Exception e2) {
                if (QLog.isColorLevel()) {
                    QLog.d(f32286a, 2, "openFile:" + e2.toString());
                }
                j2 = 0;
                j3 = 0;
            }
            String string2 = jSONObject.getString(xvz.ai);
            String string3 = jSONObject.getString("url");
            int i2 = jSONObject.getInt("bisID");
            String optString = jSONObject.optString(ApiConstants.Provider.o);
            long optLong = jSONObject.optLong("lastTime");
            Activity a2 = this.mRuntime.a();
            Intent intent = new Intent(a2, TroopFileDetailBrowserActivity.class);
            intent.putExtra(TroopFileDetailBrowserActivity.f23808d, true);
            intent.putExtra(TroopFileDetailBrowserActivity.f23807c, i2);
            intent.putExtra(TroopFileDetailBrowserActivity.f23809e, optString);
            intent.putExtra(TroopFileDetailBrowserActivity.f23810f, optLong);
            ForwardFileInfo forwardFileInfo = new ForwardFileInfo();
            forwardFileInfo.d(4);
            forwardFileInfo.b(10006);
            forwardFileInfo.d(string2);
            forwardFileInfo.d(j2);
            forwardFileInfo.a(j3);
            forwardFileInfo.b(string);
            forwardFileInfo.e(string3);
            intent.putExtra(FMConstants.f23516k, forwardFileInfo);
            a2.startActivity(intent);
        } catch (Exception e3) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openFile:" + e3.toString());
            }
        }
    }

    protected void h(String str) {
        try {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openQZoneAlbumDetail:" + str);
            }
            String string = new JSONObject(str).getString("url");
            if (!TextUtils.isEmpty(string)) {
                AppInterface m9632a = this.mRuntime.m9632a();
                Activity a2 = this.mRuntime.a();
                QZoneHelper.UserInfo a3 = QZoneHelper.UserInfo.a();
                a3.f70173a = m9632a.getCurrentAccountUin();
                a3.f98380b = "";
                QZoneHelper.c(a2, a3, string, QZoneHelper.QZoneAppConstants.y, -1);
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f32286a, 2, "openQZoneAlbumDetail:" + e2.toString());
            }
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        try {
            if (this.f32288a != null) {
                this.f32288a.b();
            }
        } catch (Exception e2) {
        } finally {
            this.f32290a.set(false);
        }
    }
}