导航菜单

页面标题

页面副标题

Oolka v2.4.42 - InterstitialActivity.java 源代码

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

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


package com.freshchat.consumer.sdk.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.loader.app.LoaderManager;
import com.freshchat.consumer.sdk.ConversationOptions;
import com.freshchat.consumer.sdk.FaqOptions;
import com.freshchat.consumer.sdk.R;
import com.freshchat.consumer.sdk.beans.Channel;
import com.freshchat.consumer.sdk.receiver.FreshchatReceiver;
import com.freshchat.consumer.sdk.service.e.m;
import java.util.ArrayList;
import java.util.List;

public class InterstitialActivity extends cr {
    private boolean F;
    private FaqOptions g = new FaqOptions();
    private ConversationOptions aO = new ConversationOptions();
    private boolean fQ = false;
    LoaderManager.a<List<String>> fS = new du(this);
    LoaderManager.a<List<String>> fT = new dv(this);
    LoaderManager.a<List<Channel>> fU = new dw(this);

    private void cC() {
        if (this.fQ) {
            return;
        }
        if (getSupportActionBar() != null) {
            getSupportActionBar().l();
        }
        RelativeLayout relativeLayout = new RelativeLayout(this);
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
        ProgressBar progressBar = new ProgressBar(this);
        progressBar.setIndeterminate(true);
        RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-2, -2);
        layoutParams2.addRule(13, -1);
        relativeLayout.addView(progressBar, layoutParams2);
        setContentView(relativeLayout, layoutParams);
        this.fQ = true;
    }

    private void cD() {
        if (com.freshchat.consumer.sdk.util.w.e(this.g.getTags())) {
            s().jm();
            finish();
            return;
        }
        if (com.freshchat.consumer.sdk.util.au.bx(a())) {
            s().jw();
            finish();
            return;
        }
        ArrayList<String> arrayList = new ArrayList<>(this.g.getTags());
        cC();
        Bundle bundle = new Bundle();
        bundle.putStringArrayList("TAGS", arrayList);
        if (this.g.getFilterType() == FaqOptions.FilterType.ARTICLE) {
            getSupportLoaderManager().e(0, bundle, this.fT);
        } else if (this.g.getFilterType() == FaqOptions.FilterType.CATEGORY) {
            getSupportLoaderManager().e(0, bundle, this.fS);
        }
    }

    private void cE() {
        if (com.freshchat.consumer.sdk.util.ds.a((CharSequence) this.aO.getTopicName())) {
            this.aO.getTopicName().toLowerCase();
        }
        String conversationReferenceID = this.aO.getConversationReferenceID();
        if (com.freshchat.consumer.sdk.util.ds.a((CharSequence) conversationReferenceID)) {
            cC();
            Bundle bundle = new Bundle();
            bundle.putString("EXTRA_CONVERSATION_REFERENCE_ID", conversationReferenceID);
            getSupportLoaderManager().e(0, bundle, this.fU);
            return;
        }
        if (com.freshchat.consumer.sdk.util.w.e(this.aO.getTags())) {
            cF().jm();
            finish();
            return;
        }
        ArrayList<String> arrayList = new ArrayList<>(this.aO.getTags());
        cC();
        Bundle bundle2 = new Bundle();
        bundle2.putStringArrayList("TAGS", arrayList);
        getSupportLoaderManager().e(0, bundle2, this.fU);
    }

    public com.freshchat.consumer.sdk.util.y cF() {
        return com.freshchat.consumer.sdk.util.cc.a((Context) this, this.aO);
    }

    public void cb(@NonNull String str) {
        if (com.freshchat.consumer.sdk.util.db.cm(a())) {
            com.freshchat.consumer.sdk.util.b.a(a(), 19, m.a.IMMEDIATE, str);
        } else {
            Toast.makeText(a(), R.string.freshchat_error_message_not_connected_to_internet, 0).show();
            finish();
        }
    }

    public void d(List<String> list) {
        s().G(list);
        finish();
    }

    public void e(List<Channel> list) {
        cF().E(list);
        finish();
    }

    private void k(String str) {
        if (com.freshchat.consumer.sdk.util.ds.a((CharSequence) str)) {
            new Intent((Context) this, (Class<?>) FreshchatReceiver.class).setAction("com.freshchat.consumer.sdk.actions.NotificationClicked");
            com.freshchat.consumer.sdk.b.a.e((Context) this, str);
        } else {
            com.freshchat.consumer.sdk.util.co.d("FRESHCHAT_WARNING", com.freshchat.consumer.sdk.b.c.INVALID_NOTIFICATION_CLICK_ACTION_MISSING_DEEPLINK.toString().replace("{{action_str}}", "com.freshchat.consumer.sdk.actions.NotificationClicked"));
        }
        finish();
    }

    private com.freshchat.consumer.sdk.util.ao s() {
        return com.freshchat.consumer.sdk.util.cc.a((Context) this, this.g);
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Bundle extras = getIntent().getExtras();
        if (extras.getBoolean("IS_FROM_NOTIFICATION_CLICK", false)) {
            k(extras.getString("FRESHCHAT_DEEPLINK"));
            return;
        }
        if (!FaqOptions.class.getSimpleName().equals(extras.getString("OPTIONS_TYPE"))) {
            if (ConversationOptions.class.getSimpleName().equals(extras.getString("OPTIONS_TYPE"))) {
                this.aO = com.freshchat.consumer.sdk.util.x.d(getIntent().getExtras());
                cE();
                return;
            }
            return;
        }
        this.g = com.freshchat.consumer.sdk.util.an.e(getIntent().getExtras());
        boolean a = com.freshchat.consumer.sdk.util.dn.a(this);
        this.F = !a;
        if (a) {
            cD();
        } else {
            com.freshchat.consumer.sdk.util.b.ao(a());
            cC();
        }
    }

    public void c(List<String> list) {
        s().F(list);
        finish();
    }

    @Override
    public String[] b() {
        if (this.F) {
            return new String[]{"com.freshchat.consumer.sdk.actions.RemoteConfigUpdated", "com.freshchat.consumer.sdk.actions.ParallelConvUpdated", "com.freshchat.consumer.sdk.actions.FAQAvailable"};
        }
        return new String[]{"com.freshchat.consumer.sdk.actions.ParallelConvUpdated"};
    }

    public void a(@NonNull Channel channel, @NonNull String str) {
        if (com.freshchat.consumer.sdk.util.ds.a((CharSequence) str)) {
            com.freshchat.consumer.sdk.util.y a = com.freshchat.consumer.sdk.util.cc.a(a(), new ConversationOptions(str, channel.getName()));
            if (a != null) {
                a.f(channel);
                finish();
            }
        }
    }

    @Override
    public void a(Context context, Intent intent) {
        if (com.freshchat.consumer.sdk.util.ds.A(intent.getAction(), "com.freshchat.consumer.sdk.actions.FAQAvailable")) {
            if (this.g != null) {
                cD();
            }
        } else if (com.freshchat.consumer.sdk.util.ds.A(intent.getAction(), "com.freshchat.consumer.sdk.actions.ParallelConvUpdated")) {
            String conversationReferenceID = this.aO.getConversationReferenceID();
            String stringExtra = intent.getStringExtra("EXTRA_CONVERSATION_REFERENCE_ID");
            boolean booleanExtra = intent.getBooleanExtra("EXTRA_PARALLEL_CONV_FETCH_SUCCESS", false);
            if (com.freshchat.consumer.sdk.util.ds.A(stringExtra, conversationReferenceID)) {
                if (booleanExtra) {
                    Bundle bundle = new Bundle();
                    bundle.putString("EXTRA_CONVERSATION_REFERENCE_ID", conversationReferenceID);
                    getSupportLoaderManager().e(0, bundle, this.fU);
                } else {
                    Toast.makeText(a(), R.string.freshchat_error_message_not_connected_to_internet, 0).show();
                    finish();
                }
            }
        }
    }
}