导航菜单

页面标题

页面副标题

Oolka v2.4.42 - d.java 源代码

正在查看: Oolka v2.4.42 应用的 d.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.freshchat.consumer.sdk.l;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.freshchat.consumer.sdk.R;
import com.freshchat.consumer.sdk.beans.BotFAQ;
import com.freshchat.consumer.sdk.beans.fragment.CallbackButtonFragment;
import com.freshchat.consumer.sdk.beans.fragment.MessageFragment;
import com.freshchat.consumer.sdk.beans.reqres.BotFAQFetchResponse;
import com.freshchat.consumer.sdk.service.Status;
import com.freshchat.consumer.sdk.util.aj;
import com.freshchat.consumer.sdk.util.ba;
import com.freshchat.consumer.sdk.util.db;
import com.freshchat.consumer.sdk.util.ds;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

public class d extends a {
    private Status Aa;
    private BotFAQ b;
    private String c;
    private String d;
    private String e;
    private final String f;
    private final String h;
    private final String i;
    private final String j;
    private String nN;

    public d(Context context) {
        super(context);
        this.f = "HL_ARTICLE_TITLE";
        this.h = "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"file:///android_res/raw/normalize.css\"/><script src='file:///freshchat_assets/freshchat_hacks.js'></script><title>HL_ARTICLE_TITLE</title></head>";
        this.i = "<!DOCTYPE html>\t<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"file:///android_res/raw/normalize.css\"/><script src='file:///freshchat_assets/freshchat_hacks.js'></script><title>HL_ARTICLE_TITLE</title></head><body onload='correctIframe()'> <bdi>";
        this.j = "</bdi></body></html>";
    }

    private void e(Status status) {
        this.Aa = status;
    }

    @NonNull
    private List<MessageFragment> kV() {
        BotFAQ botFAQ = this.b;
        return (botFAQ == null || botFAQ.getTemplateContentPayloads() == null || com.freshchat.consumer.sdk.util.w.e(this.b.getTemplateContentPayloads().getDescription())) ? new ArrayList() : this.b.getTemplateContentPayloads().getDescription();
    }

    public boolean J(List<MessageFragment> list) {
        return com.freshchat.consumer.sdk.util.w.e(list) || ds.c(list.get(0).getContent());
    }

    @NonNull
    public String P() {
        return a().getString(R.string.freshchat_no_faq_found);
    }

    public void c(@NonNull CallbackButtonFragment callbackButtonFragment) {
        if (callbackButtonFragment == null) {
            return;
        }
        ba.F(a(), callbackButtonFragment.getLabel());
        com.freshchat.consumer.sdk.util.b.a(a(), this.nN, callbackButtonFragment, this.d);
    }

    public boolean g(Bundle bundle) {
        return (bundle == null || !bundle.containsKey("MESSAGE_ALIAS") || ds.c(bundle.getString("MESSAGE_ALIAS")) || !bundle.containsKey("EXTRA_TITLE") || ds.c(bundle.getString("EXTRA_TITLE")) || !bundle.containsKey("REFERENCE_ID") || ds.c(bundle.getString("REFERENCE_ID")) || !bundle.containsKey("PLACEOLDER_REFERENCE_ID") || ds.c(bundle.getString("PLACEOLDER_REFERENCE_ID"))) ? false : true;
    }

    @Override
    public void h(@NonNull Intent intent) {
        super.h(intent);
        if (intent.hasExtra("MESSAGE_ALIAS")) {
            this.nN = intent.getStringExtra("MESSAGE_ALIAS");
        }
        if (intent.hasExtra("EXTRA_TITLE")) {
            this.c = intent.getStringExtra("EXTRA_TITLE");
        }
        if (intent.hasExtra("REFERENCE_ID")) {
            this.d = intent.getStringExtra("REFERENCE_ID");
        }
        if (intent.hasExtra("PLACEOLDER_REFERENCE_ID")) {
            this.e = intent.getStringExtra("PLACEOLDER_REFERENCE_ID");
        }
    }

    @Override
    public void kF() {
        this.b = null;
    }

    @Override
    public Status kG() {
        if (db.cm(a())) {
            com.freshchat.consumer.sdk.util.b.h(a(), this.d, this.e);
            e(Status.INIT_LOADING);
        } else {
            e(Status.NO_INTERNET);
        }
        return this.Aa;
    }

    public Status kP() {
        if (db.cm(a()) && this.Aa == Status.NO_INTERNET) {
            kG();
            e(Status.INIT_LOADING);
        }
        return this.Aa;
    }

    public Status kS() {
        return kG();
    }

    @NonNull
    public String kT() {
        return this.c;
    }

    public void kU() {
        ba.a(a(), kT(), this.d, this.e);
    }

    public String kW() {
        BotFAQ botFAQ = this.b;
        if (botFAQ == null || botFAQ.getTemplateContentPayloads() == null || com.freshchat.consumer.sdk.util.w.e(this.b.getTemplateContentPayloads().getArticleLinkFragments()) || this.b.getTemplateContentPayloads().getArticleLinkFragments().get(0) == null) {
            return null;
        }
        return this.b.getTemplateContentPayloads().getArticleLinkFragments().get(0).getContent();
    }

    public String kX() {
        List<MessageFragment> kV = kV();
        String kW = kW();
        if (J(kV) && ds.c(kW)) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        String str = "";
        String content = com.freshchat.consumer.sdk.util.w.a(kV) ? kV.get(0).getContent() : "";
        if (ds.c(content) && ds.a((CharSequence) kW)) {
            return "SKIP_ARTICLE_DISPLAY";
        }
        if (ds.a((CharSequence) content)) {
            content = content.replaceAll("src=\"//", "src=\"http://").replaceAll("value=\"//", "value=\"http://");
        }
        Pattern compile = Pattern.compile("<\\s*(img|iframe).*?src\\s*=[ '\"]+http[s]?:\\/\\/.*?>");
        if (!db.cm(a()) && compile.matcher(content).find()) {
            str = "<div class='offline-article-message'>" + a().getString(R.string.freshchat_faq_rich_media_content_cannot_be_displayed) + "</div>";
        }
        sb.append("<!DOCTYPE html>\t<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"file:///android_res/raw/normalize.css\"/><script src='file:///freshchat_assets/freshchat_hacks.js'></script><title>HL_ARTICLE_TITLE</title></head><body onload='correctIframe()'> <bdi>");
        sb.append(str);
        if (ds.a((CharSequence) content)) {
            sb.append("<div class=\"article-body\">");
            sb.append(content);
            sb.append("</div>");
        }
        if (ds.a((CharSequence) kW)) {
            String string = a().getString(R.string.freshchat_bot_article_link_text);
            sb.append("<center>");
            sb.append("<a class = \"article-link-anchor\" href = \"" + kW + "\">");
            sb.append("<button class=\"article-link-button\" align = \"center\"  type = \"button\">");
            sb.append("<span align = \"center\" class = \"article-link-text\">" + string);
            sb.append("<img align = \"center\" class = \"article-link-icon\" src =\"file:///android_res/raw/freshchat_article_link_icon.png\"/>");
            sb.append("</span>");
            sb.append("</button>");
            sb.append("</a>");
            sb.append("</center>");
        }
        sb.append("</bdi></body></html>");
        return sb.toString().replace("HL_ARTICLE_TITLE", kT());
    }

    @NonNull
    public Status h(Bundle bundle) {
        try {
        } catch (Exception e) {
            e(Status.ERROR);
            aj.a(e);
        }
        if (bundle != null) {
            BotFAQFetchResponse botFAQFetchResponse = (BotFAQFetchResponse) bundle.getParcelable("RESPONSE");
            if (botFAQFetchResponse != null) {
                this.b = botFAQFetchResponse.getBotFAQ();
                e(botFAQFetchResponse.getStatus());
                return this.Aa;
            }
            throw new IllegalArgumentException("botFAQFetchResponse cannot be null in BotFAQDetailViewModel::processResponse()");
        }
        throw new IllegalArgumentException("bundle cannot be null in BotFAQDetailViewModel::processResponse()");
    }

    @NonNull
    public List<MessageFragment> h() {
        BotFAQ botFAQ = this.b;
        if (botFAQ != null && botFAQ.getTemplateContentPayloads() != null && !com.freshchat.consumer.sdk.util.w.e(this.b.getTemplateContentPayloads().getCallbacks())) {
            return this.b.getTemplateContentPayloads().getCallbacks();
        }
        return new ArrayList();
    }
}