柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b

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


package net.duohuo.magappx.common.web;

import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindColor;
import butterknife.BindView;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jianpuzhaitong.forum.R;
import com.uc.crashsdk.export.LogType;
import com.umeng.socialize.common.SocializeConstants;
import net.duohuo.core.annotation.Extra;
import net.duohuo.core.build.UrlSchemeProxy;
import net.duohuo.core.eventbus.Event;
import net.duohuo.core.eventbus.EventBus;
import net.duohuo.core.eventbus.OnEventListener;
import net.duohuo.core.fresco.FrescoImageView;
import net.duohuo.core.ioc.Ioc;
import net.duohuo.core.net.Net;
import net.duohuo.core.net.Result;
import net.duohuo.core.net.Task;
import net.duohuo.core.util.LogUtil;
import net.duohuo.core.util.SafeJsonUtil;
import net.duohuo.magapp.onlinevoice.CreateVoiceUtil;
import net.duohuo.magappx.API;
import net.duohuo.magappx.SiteConfig;
import net.duohuo.magappx.UrlScheme;
import net.duohuo.magappx.chat.util.OnClickUtil;
import net.duohuo.magappx.circle.show.service.VoicePlaybackHelp;
import net.duohuo.magappx.circle.show.suspension.VoieSuspensionView;
import net.duohuo.magappx.common.comp.share.Collect;
import net.duohuo.magappx.common.comp.share.ManageComp;
import net.duohuo.magappx.common.comp.share.ReportComp;
import net.duohuo.magappx.common.comp.share.Share;
import net.duohuo.magappx.common.comp.share.ShareConfig;
import net.duohuo.magappx.common.comp.share.ShareDynamicPopWindow;
import net.duohuo.magappx.common.comp.share.bean.ReportType;
import net.duohuo.magappx.common.model.MAG_SHARE;
import net.duohuo.magappx.common.util.Constants;
import net.duohuo.magappx.common.util.PermissionChecker;
import net.duohuo.magappx.common.util.timerewad.AccumulationTimeRewardHelper;
import net.duohuo.magappx.common.view.CommentRedPacketPopupWindow;
import net.duohuo.magappx.common.view.ScollerTopCallback;
import net.duohuo.magappx.common.web.WebObj;
import net.duohuo.magappx.main.login.UserApi;
import net.duohuo.magappx.main.login.model.UserPreference;

public class CommonWebActivity extends BaseWebActivity {
    public static final int map_Pick_code = 1011;
    public static final int phone_bind_code = 1004;

    @Extra
    String accountType;
    TextView attentionV;
    EventBus bus;
    FrescoImageView headV;

    @BindView(R.id.icon_navi_back)
    ImageView iconNaviBack;

    @BindView(R.id.icons)
    FrescoImageView icons;
    JSONObject jo;
    TextView name;

    @BindView(R.id.navi_action_second)
    View naviActionV;

    @BindView(R.id.navi_close_text)
    View naviCloseText;

    @BindView(R.id.navi_title)
    TextView naviTitle;

    @BindColor(R.color.navigator_bg)
    int navigatorBg;
    UserPreference preference;

    @BindView(R.id.swipe_refresh)
    SwipeRefreshLayout swipeRefreshLayout;

    @BindView(R.id.attention)
    TextView textAttention;

    @BindView(R.id.navi_back_text)
    TextView textBack;

    @Extra(def = "http://gf.magapp-x.magcloud.cc/admin/magjstest.html")
    String url;
    private VoicePlaybackHelp voicePlaybackHelp;
    private CreateVoiceUtil voiceUtil;
    private VoieSuspensionView voieSuspensionView;

    @BindColor(R.color.white)
    int white;
    boolean isOnCreateVoiceSuccess = false;
    AccumulationTimeRewardHelper helper = new AccumulationTimeRewardHelper(Constants.TYPE_READ_CONTENT);
    View.OnClickListener listener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            CommonWebActivity commonWebActivity = CommonWebActivity.this;
            commonWebActivity.name = (TextView) commonWebActivity.findViewById(R.id.navi_title);
            if (CommonWebActivity.this.jo == null || "详情".equals(CommonWebActivity.this.name.getText())) {
                return;
            }
            UrlSchemeProxy.userHome(CommonWebActivity.this.getActivity()).userId(CommonWebActivity.this.jo.getString("userid")).go();
        }
    };

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.webview_activity);
        EventBus eventBus = (EventBus) Ioc.get(EventBus.class);
        this.bus = eventBus;
        eventBus.registerListener(API.Event.finish, getClass().getSimpleName(), new OnEventListener() {
            @Override
            public boolean doInUI(Event event) {
                CommonWebActivity.this.finish();
                return super.doInUI(event);
            }
        });
        loadMoreMessage(false);
        addWebObj(new WebObj(this, this, this, this));
        loadUrl(this.url);
        getNavigator().setSecondAction(R.drawable.navi_icon_more, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Share share = CommonWebActivity.this.webobj.getShare();
                if (share != null) {
                    CommonWebActivity.this.showWindow(share, true);
                    return;
                }
                CommonWebActivity.this.webobj.shareDataCallback = new WebObj.JsShareDataCallback() {
                    @Override
                    public void onComplete(Share share2) {
                        CommonWebActivity.this.showWindow(share2, true);
                    }
                };
                CommonWebActivity.this.webView.loadUrl("javascript:window.MagAndroidClient.onSharePage(document.body.innerHTML);");
            }
        });
        getNavigator().setAction(R.drawable.navi_icon_broadcast_n, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (OnClickUtil.isFastDoubleClick(1000L) || CommonWebActivity.this.webobj.getConfigJo() == null || CommonWebActivity.this.voiceUtil == null) {
                    return;
                }
                int integer = SafeJsonUtil.getInteger(CommonWebActivity.this.webobj.getConfigJo(), "type");
                if (integer == 1 || integer == 101 || integer == 102 || integer == 201) {
                    String string = SafeJsonUtil.getString(CommonWebActivity.this.webobj.getConfigJo(), "voiceText");
                    if (CommonWebActivity.this.voiceUtil == null || TextUtils.isEmpty(string)) {
                        return;
                    }
                    if (CommonWebActivity.this.isOnCreateVoiceSuccess) {
                        if (CommonWebActivity.this.voicePlaybackHelp != null) {
                            CommonWebActivity.this.voicePlaybackHelp.onPlayOrPause();
                        }
                    } else {
                        CommonWebActivity.this.getNavigator().hideAction();
                        CommonWebActivity.this.getNavigator().showProgressBarV();
                        ((EventBus) Ioc.get(EventBus.class)).fireEvent(API.Event.CLOSEFloatViewService, new Object[0]);
                        ((EventBus) Ioc.get(EventBus.class)).fireEvent(API.Event.CLOSEAudioService, new Object[0]);
                        CommonWebActivity.this.voiceUtil.init(string);
                    }
                }
            }
        });
        findViewById(R.id.navi_action_box).setVisibility(8);
        this.naviCloseText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                CommonWebActivity.this.closeWin();
            }
        });
        getNavigator().setScollerToTopCallback(new ScollerTopCallback() {
            @Override
            public void scollToTop() {
                CommonWebActivity.this.webView.rewriteScrollTo(0, 0);
            }
        });
        if (TextUtils.isEmpty(this.url)) {
            return;
        }
        if (this.url.contains(Constants.MAG_NAVI_TRANSPARENT)) {
            updateNavigationStyle(SafeJsonUtil.parseJSONObject("{\"navi_transparent\":1,\"navi_transparency\":0,\"navi_style\":1}"));
        }
        if (this.url.contains(Constants.MAG_HIDE_MORE)) {
            this.naviActionV.setVisibility(8);
        }
    }

    public void loadMoreMessage(boolean z) {
        if (this.swipeRefreshLayout == null || this.webView == null || TextUtils.isEmpty(this.url)) {
            return;
        }
        this.swipeRefreshLayout.setEnabled(false);
        if (this.url.contains("mag_need_refresh=1") || this.url.contains(Constants.THREAD_VIEW_PAGE) || z || this.url.contains(Constants.THREAD_ARTICLE)) {
            this.swipeRefreshLayout.setEnabled(true);
            this.swipeRefreshLayout.setColorSchemeResources(R.color.link, R.color.blue, R.color.yellow, R.color.red);
            this.swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
                @Override
                public void onRefresh() {
                    new Handler().postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            if (!TextUtils.isEmpty(CommonWebActivity.this.webView.getUrl()) && !CommonWebActivity.this.webView.getUrl().contains(Constants.MAG_HIDE_PROGRESS)) {
                                CommonWebActivity.this.onShowProgress();
                            }
                            CommonWebActivity.this.onShowLoading();
                            CommonWebActivity.this.webView.reload();
                            CommonWebActivity.this.swipeRefreshLayout.setRefreshing(false);
                        }
                    }, 600L);
                }
            });
        }
    }

    @Override
    public void onWebPageLoadFinished() {
        super.onWebPageLoadFinished();
        this.webView.loadUrl("javascript:window.MagAndroidClient.checkRightByinnerHTML(document.body.innerHTML);");
        this.naviCloseText.setVisibility(this.webView.canGoBack() ? 0 : 8);
    }

    public void initVoice() {
        if (this.webobj.getConfigJo() != null) {
            int integer = SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type");
            if ((integer == 1 || integer == 101 || integer == 102 || integer == 201) && !TextUtils.isEmpty(getResources().getString(R.string.xunfei)) && "1".equals(((SiteConfig) Ioc.get(SiteConfig.class)).globalVoiceBroadcastOpen)) {
                findViewById(R.id.navi_action_box).setVisibility(0);
                this.voieSuspensionView = new VoieSuspensionView(getActivity());
                if (this.voiceUtil == null) {
                    this.voiceUtil = new CreateVoiceUtil(getActivity());
                    if (this.voicePlaybackHelp == null) {
                        this.voicePlaybackHelp = new VoicePlaybackHelp(getActivity(), this.voieSuspensionView, getNavigator().getNaviActionV());
                    }
                    this.voiceUtil.setOnCreateVoiceListener(new CreateVoiceUtil.OnCreateVoiceListener() {
                        @Override
                        public void onSuccess(String str, int i) {
                            CommonWebActivity.this.getNavigator().hideProgressBarV();
                            CommonWebActivity.this.getNavigator().showAction();
                            CommonWebActivity.this.isOnCreateVoiceSuccess = true;
                            if (CommonWebActivity.this.voieSuspensionView != null) {
                                CommonWebActivity.this.voieSuspensionView.add(CommonWebActivity.this.voieSuspensionView.getActivityRoot(CommonWebActivity.this.getActivity()));
                            }
                            if (CommonWebActivity.this.voicePlaybackHelp != null) {
                                CommonWebActivity.this.voicePlaybackHelp.startVoicePlay(str, i);
                            }
                        }

                        @Override
                        public void onFail() {
                            if (CommonWebActivity.this.voicePlaybackHelp == null || CommonWebActivity.this.voicePlaybackHelp.getVoicePart() != 1) {
                                return;
                            }
                            CommonWebActivity.this.getNavigator().setActionImage(R.drawable.navi_icon_broadcast_n);
                        }

                        @Override
                        public void allComplete(JSONArray jSONArray) {
                            if (CommonWebActivity.this.voicePlaybackHelp != null) {
                                CommonWebActivity.this.voicePlaybackHelp.setArray(jSONArray);
                            }
                        }
                    });
                    return;
                }
                return;
            }
            findViewById(R.id.navi_action_box).setVisibility(8);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        this.helper.timeStart();
        this.webobj.onResume();
    }

    @Override
    public void onStop() {
        int integer;
        super.onStop();
        if (this.webobj.getConfigJo() != null && ((integer = SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type")) == 1 || integer == 101 || integer == 102 || integer == 201)) {
            this.helper.timeEnd();
        }
        this.webobj.onStop();
    }

    public void showWindow(Share share, final boolean z) {
        String str;
        boolean z2;
        boolean z3;
        boolean z4;
        boolean z5;
        int i;
        boolean z6;
        boolean z7;
        int i2;
        boolean z8;
        boolean z9;
        int i3;
        ShareDynamicPopWindow shareDynamicPopWindow;
        JSONArray jSONArray;
        share.toChatUrl = this.webView.getUrl();
        boolean z10 = (this.webobj.getConfigJo() == null || !"1".equals(this.webobj.getConfigJo().getString("shouldmanage")) || this.webobj.getConfigJo().getJSONObject("managedata") == null) ? false : true;
        boolean z11 = this.preference.userId == SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "userid");
        SafeJsonUtil.getBoolean(this.webobj.getConfigJo(), "red_packet.has_red_packet");
        boolean z12 = SafeJsonUtil.getBoolean(this.webobj.getConfigJo(), "is_open_extend");
        String string = SafeJsonUtil.getString(this.webobj.getConfigJo(), "pay_extend_url");
        if (this.webobj.getConfigJo() != null && (jSONArray = this.webobj.getConfigJo().getJSONArray("actionlist")) != null && jSONArray.size() > 0) {
            for (int i4 = 0; i4 < jSONArray.size(); i4++) {
                JSONObject jSONObject = jSONArray.getJSONObject(i4);
                if ("threadmanage".equals(jSONObject.getString("identifier"))) {
                    str = jSONObject.getString("link");
                    break;
                }
            }
        }
        str = null;
        boolean z13 = (TextUtils.isEmpty(SafeJsonUtil.getString(this.webobj.getConfigJo(), "contentId")) || TextUtils.isEmpty(SafeJsonUtil.getString(this.webobj.getConfigJo(), "circleId"))) ? false : true;
        LogUtil.i("xsx", "type: " + SafeJsonUtil.getString(this.webobj.getConfigJo(), "type"));
        int integer = SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type");
        int integer2 = SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type");
        int i5 = integer2 == 1 ? 2 : integer2 == 101 ? 3 : (integer2 == 102 || integer2 == 2 || integer2 == 201) ? 1 : 0;
        final String str2 = str;
        boolean z14 = SafeJsonUtil.getBoolean(this.webobj.getConfigJo(), "can_edit");
        if (i5 == 3) {
            z2 = z14;
            if (SafeJsonUtil.getBoolean(this.webobj.getConfigJo(), "is_open_red_packet")) {
                z3 = true;
                boolean z15 = i5 != 1;
                z4 = (!z11 || ((UserPreference) Ioc.get(UserPreference.class)).isAllowAddRedpacket()) && (z15 || z13 || z3);
                if ((!z11 || ((UserPreference) Ioc.get(UserPreference.class)).isAllowAddThemeReplyRedpack()) && z13) {
                    z5 = z10;
                    i = 1;
                    z6 = true;
                } else {
                    z5 = z10;
                    i = 1;
                    z6 = false;
                }
                boolean z16 = i5 != i || 2 == i5 || 3 == i5;
                if (UserApi.checkLogin() || z11 || !(z15 || z13)) {
                    z7 = z4;
                    i2 = 201;
                    z8 = false;
                } else {
                    z7 = z4;
                    i2 = 201;
                    z8 = true;
                }
                String str3 = integer != i2 ? Constants.LINK_SHOW : z13 ? Constants.LINK_FORUM : Constants.LINK_COMMON;
                ShareConfig.Builder share2 = ShareConfig.newBuilder(getActivity()).setShare(share);
                if (z13) {
                    if (i5 == 1) {
                        z9 = z13;
                        if (SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type") == 102) {
                            i3 = 3;
                        }
                    } else {
                        z9 = z13;
                    }
                    i3 = i5;
                } else {
                    z9 = z13;
                    i3 = 2;
                }
                ShareConfig.Builder blackId = share2.setType(i3).isSelf(z11).setShareLinkTag(str3).setShareType((i5 == 1 || SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type") != 102) ? i5 : 4).setTypeValue(SafeJsonUtil.getString(this.webobj.getConfigJo(), "contentId")).setCircleId(SafeJsonUtil.getString(this.webobj.getConfigJo(), "circleId")).setCircleTitle(SafeJsonUtil.getString(this.webobj.getConfigJo(), "cateName")).setRedPacket(SafeJsonUtil.getJSONObject(this.webobj.getConfigJo(), "red_packet")).setOnopenCallback(new CommentRedPacketPopupWindow.OnopenCallback() {
                    @Override
                    public void onOpen() {
                        CommonWebActivity.this.webView.reload();
                    }
                }).setPayExtendUrl(string).setBlackId(SafeJsonUtil.getString(this.webobj.getConfigJo(), "userid"));
                MAG_SHARE[] mag_shareArr = new MAG_SHARE[1];
                mag_shareArr[0] = !z16 ? MAG_SHARE.CONTENT : null;
                shareDynamicPopWindow = new ShareDynamicPopWindow(getActivity(), blackId.appendPlatItems(mag_shareArr).appendPlatItem(integer != 201 ? MAG_SHARE.REPOST : null).appendPlatItem(!((UserPreference) Ioc.get(UserPreference.class)).isOpenLink() ? MAG_SHARE.SHARE_URL : null).appendPlatItems(ShareConfig.plats).appendOtherItem(!SafeJsonUtil.getBoolean(this.webobj.getCommentConfigJo(), "open_user_set") ? MAG_SHARE.COMMENT_MANAGE : null).appendOtherItem(MAG_SHARE.COLLECT).appendOtherItem(!z8 ? MAG_SHARE.BLACKLIST : null).appendOtherItem(!"1".equals(((SiteConfig) Ioc.get(SiteConfig.class)).ksw_app_key) ? MAG_SHARE.WORD_OF_COMMAND : null).appendOtherItem((z11 || !z9 || !z12 || TextUtils.isEmpty(string)) ? null : MAG_SHARE.PAY_TOP).appendOtherItem((UserApi.checkLogin() || !(z6 || z7)) ? null : MAG_SHARE.ADD_REDPACKET).appendOtherItem(!z5 ? MAG_SHARE.MANAGE : null).appendOtherItem(TextUtils.isEmpty(str2) ? MAG_SHARE.FORUM_MANAGE : null).appendOtherItem((z2 || integer != 201) ? null : MAG_SHARE.EDIT).appendOtherItem(MAG_SHARE.REFRESH).appendOtherItem(MAG_SHARE.REPORT).build());
                shareDynamicPopWindow.setChatShareUrl(this.webView.getUrl());
                if (this.webobj.getConfigJo() == null && !TextUtils.isEmpty(this.webobj.getConfigJo().getString("key"))) {
                    Collect collect = new Collect();
                    JSONObject jSONObject2 = this.webobj.getConfigJo().getJSONObject("shareData");
                    collect.setTitle(jSONObject2.getString("title"));
                    collect.setLink(this.webView.getUrl());
                    collect.setCatName(this.webobj.getConfigJo().getString("cateName"));
                    collect.setKey(this.webobj.getConfigJo().getString("key"));
                    collect.setPic(jSONObject2.getString("picurl"));
                    collect.setUserId(this.webobj.getConfigJo().getString(Constants.TO_USER_ID));
                    shareDynamicPopWindow.setCollect(collect);
                } else {
                    Collect collect2 = new Collect();
                    collect2.setTitle(share.title);
                    collect2.setLink(this.webView.getUrl());
                    collect2.setCatName("网页");
                    collect2.setKey(this.webView.getUrl());
                    collect2.setPic(share.pic);
                    shareDynamicPopWindow.setCollect(collect2);
                }
                shareDynamicPopWindow.setManageCallBack(new ShareDynamicPopWindow.ManageCallBack() {
                    @Override
                    public void onManage() {
                        ManageComp.manageWap(CommonWebActivity.this.getActivity(), CommonWebActivity.this.webobj.getConfigJo().getJSONObject("managedata"));
                    }
                });
                shareDynamicPopWindow.setEditCallBack(new ShareDynamicPopWindow.EditCallBack() {
                    @Override
                    public void onEdit() {
                        UrlSchemeProxy.longContentEditCover(CommonWebActivity.this.getActivity()).contentId(SafeJsonUtil.getString(CommonWebActivity.this.webobj.getConfigJo(), "contentId")).go();
                    }
                });
                shareDynamicPopWindow.setForumManageCallBack(new ShareDynamicPopWindow.ForumManageCallBack() {
                    @Override
                    public void onForumManageCallBack() {
                        UrlScheme.toUrl(CommonWebActivity.this.getActivity(), str2);
                    }
                });
                shareDynamicPopWindow.setOnAddRedPacketListener(new ShareDynamicPopWindow.OnGiveRedPacketListener() {
                    @Override
                    public void onAddRedPacket() {
                        if (!TextUtils.isEmpty(CommonWebActivity.this.url) && !CommonWebActivity.this.url.contains(Constants.MAG_HIDE_PROGRESS)) {
                            CommonWebActivity.this.onShowProgress();
                        }
                        CommonWebActivity.this.onShowLoading();
                        CommonWebActivity commonWebActivity = CommonWebActivity.this;
                        commonWebActivity.loadUrl(commonWebActivity.webView.getUrl());
                    }
                });
                shareDynamicPopWindow.setCallBack(new ShareDynamicPopWindow.CallBack() {
                    @Override
                    public void onCard() {
                    }

                    @Override
                    public void onShareSuccess(String str4) {
                        if (z) {
                            CommonWebActivity.this.webobj.jsCallBack("pageShareSuccess", str4);
                        } else {
                            CommonWebActivity.this.webobj.jsCallBack("shareSuccess", str4);
                        }
                    }

                    @Override
                    public void onRefresh() {
                        if (!TextUtils.isEmpty(CommonWebActivity.this.webView.getUrl()) && !CommonWebActivity.this.webView.getUrl().contains(Constants.MAG_HIDE_PROGRESS)) {
                            CommonWebActivity.this.onShowProgress();
                        }
                        CommonWebActivity.this.onShowLoading();
                        CommonWebActivity commonWebActivity = CommonWebActivity.this;
                        commonWebActivity.loadUrl(commonWebActivity.webView.getUrl());
                    }

                    @Override
                    public void onShareCancle(String str4) {
                        if (z) {
                            CommonWebActivity.this.webobj.jsCallBack("pageShareFailed", str4);
                        } else {
                            CommonWebActivity.this.webobj.jsCallBack("shareFailed", str4);
                        }
                    }

                    @Override
                    public void onReport() {
                        UserApi.afterLogin(CommonWebActivity.this.getActivity(), new UserApi.LoginCallBack() {
                            @Override
                            public void onLogin() {
                                JSONObject configJo = CommonWebActivity.this.webobj.getConfigJo();
                                String webReportType = ReportType.getWebReportType(SafeJsonUtil.getInteger((configJo == null || TextUtils.isEmpty(configJo.getString("type"))) ? "3" : configJo.getString("type"), 3));
                                if ("1".equals(webReportType)) {
                                    new ReportComp(CommonWebActivity.this.getActivity(), configJo.getString(Constants.TO_USER_ID)).reportThreadDetail(configJo.getString("circleId"), configJo.getString("contentId"));
                                } else if ("2".equals(webReportType)) {
                                    new ReportComp(CommonWebActivity.this.getActivity(), SafeJsonUtil.getString(configJo, Constants.TO_USER_ID)).reportWshare(SafeJsonUtil.getString(configJo, "contentId"));
                                } else {
                                    new ReportComp(CommonWebActivity.this.getActivity(), SafeJsonUtil.getString(configJo, Constants.TO_USER_ID)).reportWeb(CommonWebActivity.this.url, webReportType, null);
                                }
                            }
                        });
                    }
                });
                if (i5 != 1 || 2 == i5 || 3 == i5) {
                    shareDynamicPopWindow.showContentShareTips();
                }
                shareDynamicPopWindow.show(getActivity());
            }
        } else {
            z2 = z14;
        }
        z3 = false;
        if (i5 != 1) {
        }
        if (z11) {
        }
        if (z11) {
        }
        z5 = z10;
        i = 1;
        z6 = true;
        if (i5 != i) {
        }
        if (UserApi.checkLogin()) {
        }
        z7 = z4;
        i2 = 201;
        z8 = false;
        if (integer != i2) {
        }
        ShareConfig.Builder share22 = ShareConfig.newBuilder(getActivity()).setShare(share);
        if (z13) {
        }
        ShareConfig.Builder blackId2 = share22.setType(i3).isSelf(z11).setShareLinkTag(str3).setShareType((i5 == 1 || SafeJsonUtil.getInteger(this.webobj.getConfigJo(), "type") != 102) ? i5 : 4).setTypeValue(SafeJsonUtil.getString(this.webobj.getConfigJo(), "contentId")).setCircleId(SafeJsonUtil.getString(this.webobj.getConfigJo(), "circleId")).setCircleTitle(SafeJsonUtil.getString(this.webobj.getConfigJo(), "cateName")).setRedPacket(SafeJsonUtil.getJSONObject(this.webobj.getConfigJo(), "red_packet")).setOnopenCallback(new CommentRedPacketPopupWindow.OnopenCallback() {
            @Override
            public void onOpen() {
                CommonWebActivity.this.webView.reload();
            }
        }).setPayExtendUrl(string).setBlackId(SafeJsonUtil.getString(this.webobj.getConfigJo(), "userid"));
        MAG_SHARE[] mag_shareArr2 = new MAG_SHARE[1];
        mag_shareArr2[0] = !z16 ? MAG_SHARE.CONTENT : null;
        shareDynamicPopWindow = new ShareDynamicPopWindow(getActivity(), blackId2.appendPlatItems(mag_shareArr2).appendPlatItem(integer != 201 ? MAG_SHARE.REPOST : null).appendPlatItem(!((UserPreference) Ioc.get(UserPreference.class)).isOpenLink() ? MAG_SHARE.SHARE_URL : null).appendPlatItems(ShareConfig.plats).appendOtherItem(!SafeJsonUtil.getBoolean(this.webobj.getCommentConfigJo(), "open_user_set") ? MAG_SHARE.COMMENT_MANAGE : null).appendOtherItem(MAG_SHARE.COLLECT).appendOtherItem(!z8 ? MAG_SHARE.BLACKLIST : null).appendOtherItem(!"1".equals(((SiteConfig) Ioc.get(SiteConfig.class)).ksw_app_key) ? MAG_SHARE.WORD_OF_COMMAND : null).appendOtherItem((z11 || !z9 || !z12 || TextUtils.isEmpty(string)) ? null : MAG_SHARE.PAY_TOP).appendOtherItem((UserApi.checkLogin() || !(z6 || z7)) ? null : MAG_SHARE.ADD_REDPACKET).appendOtherItem(!z5 ? MAG_SHARE.MANAGE : null).appendOtherItem(TextUtils.isEmpty(str2) ? MAG_SHARE.FORUM_MANAGE : null).appendOtherItem((z2 || integer != 201) ? null : MAG_SHARE.EDIT).appendOtherItem(MAG_SHARE.REFRESH).appendOtherItem(MAG_SHARE.REPORT).build());
        shareDynamicPopWindow.setChatShareUrl(this.webView.getUrl());
        if (this.webobj.getConfigJo() == null) {
        }
        Collect collect22 = new Collect();
        collect22.setTitle(share.title);
        collect22.setLink(this.webView.getUrl());
        collect22.setCatName("网页");
        collect22.setKey(this.webView.getUrl());
        collect22.setPic(share.pic);
        shareDynamicPopWindow.setCollect(collect22);
        shareDynamicPopWindow.setManageCallBack(new ShareDynamicPopWindow.ManageCallBack() {
            @Override
            public void onManage() {
                ManageComp.manageWap(CommonWebActivity.this.getActivity(), CommonWebActivity.this.webobj.getConfigJo().getJSONObject("managedata"));
            }
        });
        shareDynamicPopWindow.setEditCallBack(new ShareDynamicPopWindow.EditCallBack() {
            @Override
            public void onEdit() {
                UrlSchemeProxy.longContentEditCover(CommonWebActivity.this.getActivity()).contentId(SafeJsonUtil.getString(CommonWebActivity.this.webobj.getConfigJo(), "contentId")).go();
            }
        });
        shareDynamicPopWindow.setForumManageCallBack(new ShareDynamicPopWindow.ForumManageCallBack() {
            @Override
            public void onForumManageCallBack() {
                UrlScheme.toUrl(CommonWebActivity.this.getActivity(), str2);
            }
        });
        shareDynamicPopWindow.setOnAddRedPacketListener(new ShareDynamicPopWindow.OnGiveRedPacketListener() {
            @Override
            public void onAddRedPacket() {
                if (!TextUtils.isEmpty(CommonWebActivity.this.url) && !CommonWebActivity.this.url.contains(Constants.MAG_HIDE_PROGRESS)) {
                    CommonWebActivity.this.onShowProgress();
                }
                CommonWebActivity.this.onShowLoading();
                CommonWebActivity commonWebActivity = CommonWebActivity.this;
                commonWebActivity.loadUrl(commonWebActivity.webView.getUrl());
            }
        });
        shareDynamicPopWindow.setCallBack(new ShareDynamicPopWindow.CallBack() {
            @Override
            public void onCard() {
            }

            @Override
            public void onShareSuccess(String str4) {
                if (z) {
                    CommonWebActivity.this.webobj.jsCallBack("pageShareSuccess", str4);
                } else {
                    CommonWebActivity.this.webobj.jsCallBack("shareSuccess", str4);
                }
            }

            @Override
            public void onRefresh() {
                if (!TextUtils.isEmpty(CommonWebActivity.this.webView.getUrl()) && !CommonWebActivity.this.webView.getUrl().contains(Constants.MAG_HIDE_PROGRESS)) {
                    CommonWebActivity.this.onShowProgress();
                }
                CommonWebActivity.this.onShowLoading();
                CommonWebActivity commonWebActivity = CommonWebActivity.this;
                commonWebActivity.loadUrl(commonWebActivity.webView.getUrl());
            }

            @Override
            public void onShareCancle(String str4) {
                if (z) {
                    CommonWebActivity.this.webobj.jsCallBack("pageShareFailed", str4);
                } else {
                    CommonWebActivity.this.webobj.jsCallBack("shareFailed", str4);
                }
            }

            @Override
            public void onReport() {
                UserApi.afterLogin(CommonWebActivity.this.getActivity(), new UserApi.LoginCallBack() {
                    @Override
                    public void onLogin() {
                        JSONObject configJo = CommonWebActivity.this.webobj.getConfigJo();
                        String webReportType = ReportType.getWebReportType(SafeJsonUtil.getInteger((configJo == null || TextUtils.isEmpty(configJo.getString("type"))) ? "3" : configJo.getString("type"), 3));
                        if ("1".equals(webReportType)) {
                            new ReportComp(CommonWebActivity.this.getActivity(), configJo.getString(Constants.TO_USER_ID)).reportThreadDetail(configJo.getString("circleId"), configJo.getString("contentId"));
                        } else if ("2".equals(webReportType)) {
                            new ReportComp(CommonWebActivity.this.getActivity(), SafeJsonUtil.getString(configJo, Constants.TO_USER_ID)).reportWshare(SafeJsonUtil.getString(configJo, "contentId"));
                        } else {
                            new ReportComp(CommonWebActivity.this.getActivity(), SafeJsonUtil.getString(configJo, Constants.TO_USER_ID)).reportWeb(CommonWebActivity.this.url, webReportType, null);
                        }
                    }
                });
            }
        });
        if (i5 != 1) {
        }
        shareDynamicPopWindow.showContentShareTips();
        shareDynamicPopWindow.show(getActivity());
    }

    private void deleteFromLink(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        Net.url(str).post(new Task<Result>() {
            @Override
            public void onResult(Result result) {
                if (result.success()) {
                    CommonWebActivity.this.showToast("删除成功");
                    CommonWebActivity.this.finish();
                }
            }
        });
    }

    @Override
    public void showNaviAuthor() {
        try {
            int userId = ((UserPreference) Ioc.get(UserPreference.class)).getUserId();
            this.name = (TextView) findViewById(R.id.navi_title);
            this.attentionV = (TextView) findViewById(R.id.attention);
            FrescoImageView frescoImageView = (FrescoImageView) findViewById(R.id.icons);
            this.headV = frescoImageView;
            if (frescoImageView.getVisibility() == 0) {
                return;
            }
            JSONObject configJo = this.webobj.getConfigJo();
            this.jo = configJo;
            this.name.setText(configJo.getString("username"));
            this.name.setTextSize(2, 14.0f);
            this.name.setTextColor(SafeJsonUtil.getBoolean(this.jo, "is_vip") ? SafeJsonUtil.parseColor(SafeJsonUtil.getString(this.jo, "vip_name_color")) : ContextCompat.getColor(getActivity(), R.color.navigator_title));
            this.name.setTypeface(Typeface.defaultFromStyle(1));
            this.name.setVisibility(0);
            this.attentionV.setVisibility(0);
            if (userId == this.jo.getInteger("userid").intValue()) {
                this.attentionV.setVisibility(8);
            }
            this.headV.setVisibility(0);
            this.headV.loadView(this.jo.getString("userhead"), R.color.image_def, (Boolean) true);
            boolean booleanValue = this.jo.getBoolean("is_fans").booleanValue();
            this.attentionV.setText(booleanValue ? "已关注" : "关注");
            this.headV.setOnClickListener(this.listener);
            this.name.setOnClickListener(this.listener);
            this.attentionV.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    UserApi.afterLogin(CommonWebActivity.this.getActivity(), new UserApi.LoginCallBack() {
                        @Override
                        public void onLogin() {
                            boolean booleanValue2 = CommonWebActivity.this.webobj.getConfigJo().getBoolean("is_fans").booleanValue();
                            CommonWebActivity.this.webobj.jsCallBack("followAuthorFromNative", Integer.valueOf(!booleanValue2 ? 1 : 0));
                            CommonWebActivity.this.setAttention(!booleanValue2 ? 1 : 0);
                            if (!booleanValue2) {
                                CommonWebActivity.this.attentionToNet(API.User.fansAdd, false, -1);
                            } else {
                                CommonWebActivity.this.attentionToNet(API.User.fansRemove, true, 0);
                            }
                        }
                    });
                }
            });
            if ("FFFFFF".equals(getResources().getString(R.string.navigator_bg))) {
                this.attentionV.setTextColor(booleanValue ? getResources().getColor(R.color.black_n) : this.white);
                this.attentionV.setBackgroundResource(booleanValue ? R.drawable.bg_round_link_frame_n : R.drawable.bg_round_link_frame_l);
            } else if (getResources().getColor(R.color.navigator_action) == -1) {
                this.attentionV.setTextColor(this.white);
                this.attentionV.setBackgroundResource(R.drawable.bg_round_link_frame);
            } else {
                this.attentionV.setTextColor(getResources().getColor(R.color.navigator_action));
                this.attentionV.setBackgroundResource(R.drawable.bg_round_link_frame_extra);
            }
        } catch (Exception unused) {
        }
    }

    public void attentionToNet(String str, boolean z, int i) {
        Net url = Net.url(str);
        if (z) {
            url.param("remove_his", Integer.valueOf(i));
        }
        url.param(SocializeConstants.TENCENT_UID, this.jo.getString("userid"));
        url.get(new Task<Result>() {
            @Override
            public void onResult(Result result) {
                result.success();
            }
        });
    }

    public void setAttention(int i) {
        TextView textView = (TextView) findViewById(R.id.attention);
        this.attentionV = textView;
        if (textView == null) {
            return;
        }
        this.webobj.getConfigJo().put("is_fans", (Object) Boolean.valueOf(i == 1));
        this.attentionV.setText(i == 1 ? "已关注" : "关注");
        if ("FFFFFF".equals(getResources().getString(R.string.navigator_bg))) {
            this.attentionV.setTextColor(i == 1 ? getResources().getColor(R.color.black_n) : this.white);
            this.attentionV.setBackgroundResource(i == 1 ? R.drawable.bg_round_link_frame_n : R.drawable.bg_round_link_frame_l);
        } else if (getResources().getColor(R.color.navigator_action) == -1) {
            this.attentionV.setTextColor(this.white);
            this.attentionV.setBackgroundResource(R.drawable.bg_round_link_frame);
        } else {
            this.attentionV.setTextColor(getResources().getColor(R.color.navigator_action));
            this.attentionV.setBackgroundResource(R.drawable.bg_round_link_frame_extra);
        }
    }

    @Override
    public void hideNaviAuthor() {
        try {
            this.name = (TextView) findViewById(R.id.navi_title);
            this.attentionV = (TextView) findViewById(R.id.attention);
            FrescoImageView frescoImageView = (FrescoImageView) findViewById(R.id.icons);
            this.headV = frescoImageView;
            if (frescoImageView.getVisibility() == 8) {
                return;
            }
            this.name.setText(getResources().getString(R.string.title_default));
            this.name.setTextSize(2, 18.0f);
            this.name.setTextColor(ContextCompat.getColor(getActivity(), R.color.navigator_title));
            this.attentionV.setVisibility(8);
            this.headV.setVisibility(8);
        } catch (Exception unused) {
        }
    }

    @Override
    public void followAuthorFromWeb(int i) {
        setAttention(i);
    }

    @Override
    public void setRefreshAble(boolean z) {
        loadMoreMessage(z);
    }

    @Override
    public void webViewGoback() {
        super.webViewGoback();
        hideNaviAuthor();
    }

    @Override
    public void getLocation() {
        super.getLocation();
        if (new PermissionChecker(getActivity()).hasLocationPermission(4000)) {
            this.webobj.setLocation(true);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        ((EventBus) Ioc.get(EventBus.class)).fireEvent(API.Event.common_web_destory, new Object[0]);
        this.bus.unregisterListener(API.Event.finish, getClass().getSimpleName());
        CreateVoiceUtil createVoiceUtil = this.voiceUtil;
        if (createVoiceUtil != null) {
            createVoiceUtil.onDestroy();
        }
        VoicePlaybackHelp voicePlaybackHelp = this.voicePlaybackHelp;
        if (voicePlaybackHelp != null) {
            voicePlaybackHelp.onDeatory();
            this.voicePlaybackHelp = null;
        }
    }

    @Override
    public void updateNavigationStyle(JSONObject jSONObject) {
        super.updateNavigationStyle(jSONObject);
        try {
            int integer = SafeJsonUtil.getInteger(jSONObject, "navi_transparent");
            int integer2 = SafeJsonUtil.getInteger(jSONObject, "navi_style");
            getNavigator().getNaviSecondActionV().setImageResource(integer2 == 1 ? R.drawable.navi_icon_more_white : R.drawable.navi_icon_more);
            getNavigator().getNaviIconBackV().setImageResource(integer2 == 1 ? R.drawable.navi_icon__white_back : R.drawable.navi_icon_back);
            getNavigator().getTitleView().setTextColor(1 == integer2 ? getResources().getColor(R.color.white) : getResources().getColor(R.color.navigator_title));
            ((ImageView) this.naviCloseText).setImageResource(1 == integer2 ? R.drawable.web_close_white : R.drawable.web_close);
            if (integer == 1) {
                float floatValue = SafeJsonUtil.getFloat(jSONObject, "navi_transparency").floatValue();
                getActivity().findViewById(R.id.bg).setAlpha(floatValue);
                getActivity().findViewById(R.id.blank_for_statue).setAlpha(floatValue);
                getActivity().findViewById(R.id.navi_line).setAlpha(floatValue);
                updateWebViewLayout(true);
            }
            if (Build.VERSION.SDK_INT >= 23) {
                if (integer2 == 1) {
                    getWindow().getDecorView().setSystemUiVisibility(LogType.UNEXP_ANR);
                } else {
                    getWindow().getDecorView().setSystemUiVisibility(9472);
                }
            }
        } catch (Exception unused) {
        }
    }
}