正在查看: Oolka v2.4.42 应用的 s.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Oolka v2.4.42 应用的 s.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.FAQ;
import com.freshchat.consumer.sdk.beans.reqres.FAQFetchResponse;
import com.freshchat.consumer.sdk.service.Status;
import com.freshchat.consumer.sdk.service.e.h;
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.regex.Pattern;
public class s extends a {
private Status Aa;
private final com.freshchat.consumer.sdk.b.d Bl;
private String b;
private String c;
private String d;
private FAQ e;
private String f;
private final String h;
private String s;
private final String t;
private final String u;
private boolean y;
private String z;
public s(Context context) {
super(context);
this.s = "HL_ARTICLE_TITLE";
String str = "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"file:///android_res/raw/normalize.css\"/><script src='file:///freshchat_assets/freshchat_hacks.js'></script><title>" + this.s + "</title></head>";
this.t = str;
this.u = "<!DOCTYPE html>\t<html>" + str + "<body onload='correctIframe()'> <bdi>";
this.h = "</bdi></body></html>";
this.Bl = new com.freshchat.consumer.sdk.b.d(a());
}
private void e(Status status) {
this.Aa = status;
}
private boolean lY() {
FAQ faq = this.e;
if (faq == null) {
return false;
}
return this.Bl.b(this.c, this.b, faq.getLastUpdatedAt());
}
private boolean lZ() {
FAQ faq = this.e;
if (faq == null) {
return false;
}
return this.Bl.a(this.c, this.b, faq.getLastUpdatedAt());
}
@NonNull
public String P() {
return a().getString(R.string.freshchat_no_articles_found);
}
public void a(@NonNull h.a aVar) {
com.freshchat.consumer.sdk.util.b.a(a(), this.c, this.b, aVar, this.e.getLanguage(), this.e.getLastUpdatedAt());
this.z = this.b;
b(aVar);
}
public void b(@NonNull h.a aVar) {
ba.a(a(), this.c, this.d, this.b, this.f, aVar == h.a.THUMBS_UP);
}
public boolean g(Bundle bundle) {
return (bundle == null || !bundle.containsKey("article_id") || ds.c(bundle.getString("article_id")) || !bundle.containsKey("category_id") || ds.c(bundle.getString("category_id"))) ? false : true;
}
@Override
public void h(@NonNull Intent intent) {
super.h(intent);
if (intent.hasExtra("article_id")) {
this.b = intent.getStringExtra("article_id");
}
if (intent.hasExtra("category_id")) {
this.c = intent.getStringExtra("category_id");
}
if (intent.hasExtra("EXTRA_FAQ_VIEW_TITLE")) {
this.f = intent.getStringExtra("EXTRA_FAQ_VIEW_TITLE");
}
if (intent.hasExtra("category_name")) {
this.d = intent.getStringExtra("category_name");
}
if (intent.hasExtra("LAUNCHED_FROM_CONVERSATION")) {
this.y = intent.getBooleanExtra("LAUNCHED_FROM_CONVERSATION", false);
}
}
public boolean i(Bundle bundle) {
com.freshchat.consumer.sdk.service.e.i iVar;
if (bundle == null || (iVar = (com.freshchat.consumer.sdk.service.e.i) bundle.getParcelable("RESPONSE")) == null) {
return false;
}
return Status.SUCCESS.equals(iVar.getStatus());
}
@Override
public void kF() {
this.e = null;
}
@Override
public Status kG() {
if (db.cm(a())) {
com.freshchat.consumer.sdk.util.b.g(a(), this.b, this.c);
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 ds.c(this.d) ? a().getString(R.string.freshchat_activity_title_article_detail) : this.d;
}
public String kX() {
String str;
if (this.e == null) {
return null;
}
StringBuilder sb = new StringBuilder();
String replaceAll = this.e.getContent().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(replaceAll).find()) {
str = "";
} else {
str = "<div class='offline-article-message'>" + a().getString(R.string.freshchat_faq_rich_media_content_cannot_be_displayed) + "</div>";
}
sb.append(this.u);
sb.append("<div class=\"article-title\";><h3 >");
sb.append(this.e.getTitle());
sb.append("</h3></div>");
sb.append(str);
sb.append("<div class=\"article-body\">");
sb.append(replaceAll);
sb.append("</div>");
sb.append("</bdi></body></html>");
String sb2 = sb.toString();
return !ds.c(this.e.getCategoryName()) ? sb2.replace(this.s, this.e.getCategoryName()) : sb2;
}
public void lX() {
ba.a(a(), this.c, this.d, this.b, this.f, this.B);
}
public boolean ma() {
String str = this.z;
if (str == null || !str.equals(this.b)) {
return !lY();
}
return false;
}
public boolean mb() {
if (e()) {
return lZ();
}
return false;
}
public boolean mc() {
return this.y;
}
@NonNull
public Status h(Bundle bundle) {
try {
} catch (Exception e) {
e(Status.ERROR);
aj.a(e);
}
if (bundle != null) {
FAQFetchResponse fAQFetchResponse = (FAQFetchResponse) bundle.getParcelable("RESPONSE");
if (fAQFetchResponse != null) {
this.e = fAQFetchResponse.getFaq();
e(fAQFetchResponse.getStatus());
return this.Aa;
}
throw new IllegalArgumentException("faqFetchResponse cannot be null in FAQDetailViewModel::processResponse()");
}
throw new IllegalArgumentException("bundle cannot be null in FAQDetailViewModel::processResponse()");
}
}