正在查看: Mint v5.7.3 应用的 f0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mint v5.7.3 应用的 f0.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.htmedia.mint.utils;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.text.Html;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.ClickableSpan;
import android.util.Base64;
import android.util.Log;
import android.util.Patterns;
import android.util.TypedValue;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.databinding.BindingAdapter;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import com.htmedia.mint.AppController;
import com.htmedia.mint.author.pojo.Author;
import com.htmedia.mint.htsubscription.CheckSubscriptionFromLocal;
import com.htmedia.mint.htsubscription.SubscriptionConverter;
import com.htmedia.mint.htsubscription.SubscriptionPlanSingleton;
import com.htmedia.mint.htsubscription.SubscriptionTrigger;
import com.htmedia.mint.htsubscription.WebEngageAnalytices;
import com.htmedia.mint.htsubscription.deviceidtracking.OfferBannerSingleton;
import com.htmedia.mint.htsubscription.deviceidtracking.pojo.DeviceEligibilityData;
import com.htmedia.mint.piano.PianoResponse;
import com.htmedia.mint.piano.PianoResponseSingleTon;
import com.htmedia.mint.pojo.BookmarkIdpojo;
import com.htmedia.mint.pojo.BookmarkStatus;
import com.htmedia.mint.pojo.Content;
import com.htmedia.mint.pojo.GainerLoserPojo;
import com.htmedia.mint.pojo.Image;
import com.htmedia.mint.pojo.Images;
import com.htmedia.mint.pojo.L1order;
import com.htmedia.mint.pojo.LeadMedia;
import com.htmedia.mint.pojo.Metadata;
import com.htmedia.mint.pojo.RetentionModel;
import com.htmedia.mint.pojo.SocialResponsePojo;
import com.htmedia.mint.pojo.Table;
import com.htmedia.mint.pojo.config.AdFreeSubscription;
import com.htmedia.mint.pojo.config.Config;
import com.htmedia.mint.pojo.config.Event;
import com.htmedia.mint.pojo.config.SSO;
import com.htmedia.mint.pojo.config.Section;
import com.htmedia.mint.pojo.config.TaboolaModel;
import com.htmedia.mint.pojo.config.mobilepaywall.Items;
import com.htmedia.mint.pojo.config.mobilepaywall.MobilePaywall;
import com.htmedia.mint.pojo.config.mobilepaywall.PaywallTypes;
import com.htmedia.mint.pojo.config.skuplan.SKUPlansL1;
import com.htmedia.mint.pojo.mintpiller.Card;
import com.htmedia.mint.pojo.mintstockwidget.EstimatePojo;
import com.htmedia.mint.pojo.mintstockwidget.Measure;
import com.htmedia.mint.pojo.mintstockwidget.Period;
import com.htmedia.mint.pojo.mywatchlist.LiveMarketPrice;
import com.htmedia.mint.pojo.onBoarding.CheckOnBoardingResponse;
import com.htmedia.mint.pojo.onBoarding.setting.SectionPreferences;
import com.htmedia.mint.pojo.podcast.Episode;
import com.htmedia.mint.pojo.premiumstories.PianoNonLogin;
import com.htmedia.mint.pojo.premiumstories.PianoUnlockArticle;
import com.htmedia.mint.pojo.premiumstories.PremiumStoryMeter;
import com.htmedia.mint.pojo.subscription.PlanInterval;
import com.htmedia.mint.pojo.subscription.SubscriptionSource;
import com.htmedia.mint.pojo.subscription.SubscriptionStatus;
import com.htmedia.mint.pojo.subscription.userdetail.MintSubscriptionDetail;
import com.htmedia.mint.ui.activity.EpaperActivity;
import com.htmedia.mint.ui.activity.HomeActivity;
import com.htmedia.mint.ui.activity.MyAccountActivity;
import com.htmedia.mint.ui.activity.SplashActivity;
import com.htmedia.mint.ui.activity.VideoDetailActivity;
import com.htmedia.mint.ui.activity.WebViewActivityWithHeader;
import com.htmedia.mint.ui.activity.WebViewActivityWithoutHeader;
import com.htmedia.mint.ui.activity.d3;
import com.htmedia.mint.ui.fragments.CallBackInterfaceEdit;
import com.htmedia.mint.ui.fragments.EPaperPayWallBottomSheetFragment;
import com.htmedia.mint.ui.fragments.HomeTabViewFragment;
import com.htmedia.mint.utils.q;
import com.htmedia.sso.helpers.SSOSingleton;
import com.htmedia.sso.helpers.ToastHelper;
import com.razorpay.Checkout;
import com.taboola.android.TBLClassicUnit;
import com.taboola.android.Taboola;
import com.taboola.android.global_components.eventsmanager.TBLEventType;
import com.taboola.android.listeners.TBLClassicListener;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import com.truecaller.android.sdk.R;
import com.zoho.zsm.inapppurchase.model.ZSPlan;
import com.zoho.zsm.inapppurchase.model.ZSPlanInterval;
import com.zoho.zsm.inapppurchase.model.ZSSuscriptionDetail;
import in.juspay.hyper.constants.Labels;
import in.juspay.hypersdk.core.PaymentConstants;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.json.JSONException;
import org.json.JSONObject;
public class f0 {
public static long a = 0;
public static boolean b = false;
public static q1 c = null;
public static boolean d = false;
public static String e = "";
public static boolean f;
public static boolean g;
public static long h;
public static long i;
public static long j;
public static long k;
public static long l;
public static boolean m;
public static int p;
public static ArrayList<String> n = new ArrayList<>();
public static ArrayList<Content> o = new ArrayList<>();
public static int q = 1;
public static boolean r = false;
public static int s = 0;
public static int t = 0;
public static int u = 0;
public static ArrayList<String> v = new ArrayList<>();
public static ArrayList<String> w = new ArrayList<>();
private static final Charset x = StandardCharsets.UTF_8;
public static ArrayList<String> y = new ArrayList<>();
class a implements k6.f {
final String a;
final Context b;
final RecyclerView.Adapter c;
final boolean d;
final ArrayList e;
final Content f;
final d3 g;
final String h;
final MenuItem i;
final boolean j;
a(String str, Context context, RecyclerView.Adapter adapter, boolean z, ArrayList arrayList, Content content, d3 d3Var, String str2, MenuItem menuItem, boolean z2) {
this.a = str;
this.b = context;
this.c = adapter;
this.d = z;
this.e = arrayList;
this.f = content;
this.g = d3Var;
this.h = str2;
this.i = menuItem;
this.j = z2;
}
@Override
public void getBookmarkIdResponse(BookmarkIdpojo bookmarkIdpojo, String str) {
String str2;
if (bookmarkIdpojo != null && bookmarkIdpojo.getResult() != null) {
AppController.O.c();
for (int i = 0; i < bookmarkIdpojo.getResult().size(); i++) {
AppController.O.j(bookmarkIdpojo.getResult().get(i), "live");
}
}
if (!str.equals("allBookmarkLogin") || (str2 = this.a) == null || AppController.O.a(str2)) {
return;
}
f0.p(this.a, this.b, "addLogin", null, this.c, this.d, this.e, this.f, this.g, false);
}
@Override
public void getBookmarkResponse(BookmarkStatus bookmarkStatus) {
ArrayList arrayList;
Content content;
ArrayList<Content> arrayList2;
if (this.h.equals("add") && !AppController.O.a(this.a)) {
AppController.O.j(this.a, "offline");
Context context = this.b;
Toast.makeText(context, context.getResources().getString(2131951672), 1).show();
if (this.i != null) {
if (AppController.j().E()) {
if (this.j) {
this.i.setIcon(2131232537);
} else {
this.i.setIcon(2131232312);
}
} else if (this.j) {
this.i.setIcon(2131232536);
} else {
this.i.setIcon(2131231597);
}
}
com.htmedia.mint.utils.n.M(this.b, com.htmedia.mint.utils.n.e2, "article_detail_page", this.f, BuildConfig.FLAVOR, "bookmark");
f0.c.b(this.f, BuildConfig.FLAVOR, "Bookmark");
return;
}
if (!this.h.equals("remove") || !AppController.O.a(this.a)) {
if (this.h.equals("addLogin")) {
AppController.O.j(this.a, "offline");
Toast.makeText(this.b, "Login Successful", 1).show();
return;
}
return;
}
AppController.O.e(this.a);
if (this.d && (arrayList = this.e) != null && (content = this.f) != null) {
arrayList.remove(content);
HomeActivity homeActivity = this.b;
if (homeActivity != null && homeActivity.i0.a.q != null) {
homeActivity.i0.a.q.setExpanded(true, true);
}
d3 d3Var = this.g;
if (d3Var != null && (arrayList2 = this.e) != null) {
d3Var.onBookmarkDelete(arrayList2);
}
}
Context context2 = this.b;
Toast.makeText(context2, context2.getResources().getString(2131952479), 1).show();
if (this.i != null) {
if (AppController.j().E()) {
if (this.j) {
this.i.setIcon(2131232315);
} else {
this.i.setIcon(2131232316);
}
} else if (this.j) {
this.i.setIcon(2131232314);
} else {
this.i.setIcon(2131232311);
}
}
f0.c.b(this.f, BuildConfig.FLAVOR, "Bookmark");
}
@Override
public void onBookmarkError(String str) {
if (this.h.equals("allBookmarkLogin") || this.h.equals("addLogin")) {
Toast.makeText(this.b, "Login Successful", 1).show();
}
if (str.contains("T_002") && !this.h.equalsIgnoreCase("allBookmark")) {
AppController.O.d();
f0.L(this.b);
Context context = this.b;
p1.a((Activity) context, context.getResources().getString(2131952169), this.a, true);
return;
}
if (this.h.equals("add") || this.h.equals("remove")) {
try {
JSONObject jSONObject = new JSONObject(str);
if (jSONObject.getBoolean("success")) {
return;
}
Toast.makeText(this.b, jSONObject.getString("text"), 1).show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
class a0 implements k6.f {
final String a;
final Context b;
final boolean c;
final ArrayList d;
final Content e;
final d3 f;
final int g;
final boolean h;
final boolean i;
final boolean j;
final String o;
final ImageView p;
final ImageView q;
final RecyclerView.Adapter r;
a0(String str, Context context, boolean z, ArrayList arrayList, Content content, d3 d3Var, int i, boolean z2, boolean z3, boolean z4, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter) {
this.a = str;
this.b = context;
this.c = z;
this.d = arrayList;
this.e = content;
this.f = d3Var;
this.g = i;
this.h = z2;
this.i = z3;
this.j = z4;
this.o = str2;
this.p = imageView;
this.q = imageView2;
this.r = adapter;
}
@Override
public void getBookmarkIdResponse(BookmarkIdpojo bookmarkIdpojo, String str) {
d3 d3Var;
if (bookmarkIdpojo != null && bookmarkIdpojo.getResult() != null) {
AppController.O.c();
for (int i = 0; i < bookmarkIdpojo.getResult().size(); i++) {
AppController.O.j(bookmarkIdpojo.getResult().get(i), "live");
}
}
if (!str.equals("allBookmarkLogin")) {
if (!"allBookmarkOnboardLogin".equalsIgnoreCase(str) || (d3Var = this.f) == null) {
return;
}
d3Var.getAllBookmarkList(bookmarkIdpojo != null ? bookmarkIdpojo.getResult() : null);
return;
}
String str2 = this.a;
if (str2 == null || AppController.O.a(str2)) {
if (this.j) {
((Activity) this.b).setResult(-1);
((Activity) this.b).finish();
}
} else {
f0.m(this.a, this.b, "addLogin", null, null, null, this.c, this.d, this.e, this.f, this.g, this.h, true, this.i);
}
}
@Override
public void getBookmarkResponse(BookmarkStatus bookmarkStatus) {
ArrayList arrayList;
Content content;
ArrayList<Content> arrayList2;
if (this.o.equals("add") && !AppController.O.a(this.a)) {
AppController.O.j(this.a, "offline");
Context context = this.b;
Toast.makeText(context, context.getResources().getString(2131951672), 1).show();
if (this.p != null) {
if (AppController.j().E()) {
if (this.i) {
this.p.setImageResource(2131232537);
} else {
this.p.setImageResource(2131232312);
}
} else if (this.i) {
this.p.setImageResource(2131232536);
} else {
this.p.setImageResource(2131231597);
}
}
if (this.q != null) {
if (AppController.j().E()) {
if (this.i) {
this.q.setImageResource(2131232537);
} else {
this.q.setImageResource(2131232312);
}
} else if (this.i) {
this.q.setImageResource(2131232536);
} else {
this.q.setImageResource(2131231597);
}
}
} else if (this.o.equals("remove") && AppController.O.a(this.a)) {
AppController.O.e(this.a);
if (this.c && (arrayList = this.d) != null && (content = this.e) != null) {
arrayList.remove(content);
HomeActivity homeActivity = this.b;
if (homeActivity != null && (homeActivity instanceof HomeActivity) && homeActivity.i0.a.q != null) {
homeActivity.i0.a.q.setExpanded(true, true);
}
d3 d3Var = this.f;
if (d3Var != null && (arrayList2 = this.d) != null) {
d3Var.onBookmarkDelete(arrayList2);
}
}
Context context2 = this.b;
Toast.makeText(context2, context2.getResources().getString(2131952479), 1).show();
if (this.p != null) {
if (AppController.j().E()) {
if (this.i) {
this.p.setImageResource(2131232315);
} else {
this.p.setImageResource(2131232316);
}
} else if (this.i) {
this.p.setImageResource(2131232314);
} else {
this.p.setImageResource(2131232311);
}
}
if (this.q != null) {
if (AppController.j().E()) {
if (this.i) {
this.q.setImageResource(2131232314);
} else {
this.q.setImageResource(2131232316);
}
} else if (this.i) {
this.q.setImageResource(2131232314);
} else {
this.q.setImageResource(2131232311);
}
}
} else if (this.o.equals("addLogin")) {
AppController.O.j(this.a, "offline");
Toast.makeText(this.b, "Login Successful", 1).show();
if (this.j) {
((Activity) this.b).setResult(-1);
((Activity) this.b).finish();
}
}
RecyclerView.Adapter adapter = this.r;
if (adapter != null) {
if (this.h) {
adapter.notifyItemChanged(this.g);
} else {
adapter.notifyDataSetChanged();
}
}
}
@Override
public void onBookmarkError(String str) {
d3 d3Var;
if (this.o.equals("allBookmarkLogin") || this.o.equals("addLogin")) {
Toast.makeText(this.b, "Login Successful", 1).show();
if (this.j) {
((Activity) this.b).setResult(-1);
((Activity) this.b).finish();
}
} else if ("allBookmarkOnboardLogin".equalsIgnoreCase(this.o) && (d3Var = this.f) != null) {
d3Var.getAllBookmarkList(null);
}
if (str.contains("T_002") && !this.o.equalsIgnoreCase("allBookmark")) {
AppController.O.d();
f0.L(this.b);
Context context = this.b;
p1.a((Activity) context, context.getResources().getString(2131952169), this.a, true);
return;
}
if (this.o.equals("add") || this.o.equals("remove")) {
try {
JSONObject jSONObject = new JSONObject(str);
if (jSONObject.getBoolean("success")) {
return;
}
Toast.makeText(this.b, jSONObject.getString("text"), 1).show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
class b implements k6.s {
final String a;
final k6.e b;
final JSONObject c;
final HashMap d;
b(String str, k6.e eVar, JSONObject jSONObject, HashMap hashMap) {
this.a = str;
this.b = eVar;
this.c = jSONObject;
this.d = hashMap;
}
@Override
public void getConfig(Config config) {
String str;
AppController.j().L(config);
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (this.a.equals("add") || this.a.equals("addLogin")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (this.a.equals("remove")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
this.b.a(1, this.a, str, this.c, this.d, false, true);
}
@Override
public void onError(String str) {
}
}
class b0 implements k6.s {
final String a;
final k6.e b;
final JSONObject c;
final HashMap d;
b0(String str, k6.e eVar, JSONObject jSONObject, HashMap hashMap) {
this.a = str;
this.b = eVar;
this.c = jSONObject;
this.d = hashMap;
}
@Override
public void getConfig(Config config) {
String str;
AppController.j().L(config);
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (this.a.equals("add") || this.a.equals("addLogin")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (this.a.equals("remove")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
this.b.a(1, this.a, str, this.c, this.d, false, true);
}
@Override
public void onError(String str) {
}
}
class c implements k6.f {
final String a;
final String b;
final Context c;
final ImageView d;
final ImageView e;
c(String str, String str2, Context context, ImageView imageView, ImageView imageView2) {
this.a = str;
this.b = str2;
this.c = context;
this.d = imageView;
this.e = imageView2;
}
@Override
public void getBookmarkIdResponse(BookmarkIdpojo bookmarkIdpojo, String str) {
if (bookmarkIdpojo == null || bookmarkIdpojo.getResult() == null) {
return;
}
AppController.O.c();
for (int i = 0; i < bookmarkIdpojo.getResult().size(); i++) {
AppController.O.j(bookmarkIdpojo.getResult().get(i), "live");
}
}
@Override
public void getBookmarkResponse(BookmarkStatus bookmarkStatus) {
if (this.a.equals("add") && !AppController.O.a(this.b)) {
AppController.O.j(this.b, "offline");
Context context = this.c;
Toast.makeText(context, context.getResources().getString(2131951672), 1).show();
ImageView imageView = this.d;
if (imageView != null) {
imageView.setImageResource(2131232312);
}
ImageView imageView2 = this.e;
if (imageView2 != null) {
imageView2.setImageResource(2131232312);
return;
}
return;
}
if (this.a.equals("remove") && AppController.O.a(this.b)) {
AppController.O.e(this.b);
Context context2 = this.c;
Toast.makeText(context2, context2.getResources().getString(2131952479), 1).show();
ImageView imageView3 = this.d;
if (imageView3 != null) {
imageView3.setImageResource(2131232312);
}
ImageView imageView4 = this.e;
if (imageView4 != null) {
imageView4.setImageResource(2131232312);
}
}
}
@Override
public void onBookmarkError(String str) {
if (str.contains("T_002") && !this.a.equalsIgnoreCase("allBookmark")) {
AppController.O.d();
f0.L(this.c);
Context context = this.c;
p1.a((Activity) context, context.getResources().getString(2131952169), this.b, true);
return;
}
if (this.a.equals("add") || this.a.equals("remove")) {
Toast.makeText(this.c, "Action failed, " + str, 1).show();
}
}
}
class c0 implements k6.f {
final String a;
final Context b;
final boolean c;
final ArrayList d;
final Content e;
final d3 f;
final int g;
final boolean h;
final boolean i;
final boolean j;
final String o;
final ImageView p;
final ImageView q;
final RecyclerView.Adapter r;
c0(String str, Context context, boolean z, ArrayList arrayList, Content content, d3 d3Var, int i, boolean z2, boolean z3, boolean z4, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter) {
this.a = str;
this.b = context;
this.c = z;
this.d = arrayList;
this.e = content;
this.f = d3Var;
this.g = i;
this.h = z2;
this.i = z3;
this.j = z4;
this.o = str2;
this.p = imageView;
this.q = imageView2;
this.r = adapter;
}
@Override
public void getBookmarkIdResponse(BookmarkIdpojo bookmarkIdpojo, String str) {
if (bookmarkIdpojo != null && bookmarkIdpojo.getResult() != null) {
AppController.O.c();
for (int i = 0; i < bookmarkIdpojo.getResult().size(); i++) {
AppController.O.j(bookmarkIdpojo.getResult().get(i), "live");
}
}
if (str.equals("allBookmarkLogin")) {
String str2 = this.a;
if (str2 == null || AppController.O.a(str2)) {
if (this.j) {
((Activity) this.b).setResult(-1);
((Activity) this.b).finish();
}
} else {
f0.m(this.a, this.b, "addLogin", null, null, null, this.c, this.d, this.e, this.f, this.g, this.h, true, this.i);
}
}
}
@Override
public void getBookmarkResponse(BookmarkStatus bookmarkStatus) {
ArrayList arrayList;
Content content;
ArrayList<Content> arrayList2;
if (this.o.equals("add") && !AppController.O.a(this.a)) {
AppController.O.j(this.a, "offline");
Context context = this.b;
Toast.makeText(context, context.getResources().getString(2131951672), 1).show();
if (this.p != null) {
if (AppController.j().E()) {
if (this.i) {
this.p.setImageResource(2131231599);
} else {
this.p.setImageResource(2131231599);
}
} else if (this.i) {
this.p.setImageResource(2131231598);
} else {
this.p.setImageResource(2131231598);
}
}
if (this.q != null) {
if (AppController.j().E()) {
if (this.i) {
this.q.setImageResource(2131231599);
} else {
this.q.setImageResource(2131231599);
}
} else if (this.i) {
this.q.setImageResource(2131231598);
} else {
this.q.setImageResource(2131231598);
}
}
} else if (this.o.equals("remove") && AppController.O.a(this.a)) {
AppController.O.e(this.a);
if (this.c && (arrayList = this.d) != null && (content = this.e) != null) {
arrayList.remove(content);
HomeActivity homeActivity = this.b;
if (homeActivity != null && (homeActivity instanceof HomeActivity) && homeActivity.i0.a.q != null) {
homeActivity.i0.a.q.setExpanded(true, true);
}
d3 d3Var = this.f;
if (d3Var != null && (arrayList2 = this.d) != null) {
d3Var.onBookmarkDelete(arrayList2);
}
}
Context context2 = this.b;
Toast.makeText(context2, context2.getResources().getString(2131952479), 1).show();
if (this.p != null) {
if (AppController.j().E()) {
if (this.i) {
this.p.setImageResource(2131233525);
} else {
this.p.setImageResource(2131233525);
}
} else if (this.i) {
this.p.setImageResource(2131233524);
} else {
this.p.setImageResource(2131233524);
}
}
if (this.q != null) {
if (AppController.j().E()) {
if (this.i) {
this.q.setImageResource(2131233525);
} else {
this.q.setImageResource(2131233525);
}
} else if (this.i) {
this.q.setImageResource(2131233524);
} else {
this.q.setImageResource(2131233524);
}
}
} else if (this.o.equals("addLogin")) {
AppController.O.j(this.a, "offline");
Toast.makeText(this.b, "Login Successful", 1).show();
if (this.j) {
((Activity) this.b).setResult(-1);
((Activity) this.b).finish();
}
}
RecyclerView.Adapter adapter = this.r;
if (adapter != null) {
if (this.h) {
adapter.notifyItemChanged(this.g);
} else {
adapter.notifyDataSetChanged();
}
}
}
@Override
public void onBookmarkError(String str) {
if (this.o.equals("allBookmarkLogin") || this.o.equals("addLogin")) {
Toast.makeText(this.b, "Login Successful", 1).show();
if (this.j) {
((Activity) this.b).setResult(-1);
((Activity) this.b).finish();
}
}
if (str.contains("T_002") && !this.o.equalsIgnoreCase("allBookmark")) {
AppController.O.d();
f0.L(this.b);
Context context = this.b;
p1.a((Activity) context, context.getResources().getString(2131952169), this.a, true);
return;
}
if (this.o.equals("add") || this.o.equals("remove")) {
try {
JSONObject jSONObject = new JSONObject(str);
if (jSONObject.getBoolean("success")) {
return;
}
Toast.makeText(this.b, jSONObject.getString("text"), 1).show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
class d implements k6.s {
final String a;
final k6.e b;
final JSONObject c;
final HashMap d;
d(String str, k6.e eVar, JSONObject jSONObject, HashMap hashMap) {
this.a = str;
this.b = eVar;
this.c = jSONObject;
this.d = hashMap;
}
@Override
public void getConfig(Config config) {
String str;
AppController.j().L(config);
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (this.a.equals("add") || this.a.equals("addLogin")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (this.a.equals("remove")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
this.b.a(1, this.a, str, this.c, this.d, false, true);
}
@Override
public void onError(String str) {
}
}
class d0 implements k6.s {
final String a;
final k6.e b;
final JSONObject c;
final HashMap d;
d0(String str, k6.e eVar, JSONObject jSONObject, HashMap hashMap) {
this.a = str;
this.b = eVar;
this.c = jSONObject;
this.d = hashMap;
}
@Override
public void getConfig(Config config) {
String str;
AppController.j().L(config);
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (this.a.equals("add") || this.a.equals("addLogin")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (this.a.equals("remove")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
this.b.a(1, this.a, str, this.c, this.d, false, true);
}
@Override
public void onError(String str) {
}
}
class e implements DialogInterface.OnClickListener {
e() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}
public static class e0 implements Comparator<RetentionModel> {
@Override
public int compare(RetentionModel retentionModel, RetentionModel retentionModel2) {
return retentionModel.getTimeStamp() > retentionModel2.getTimeStamp() ? 1 : -1;
}
}
class f implements DialogInterface.OnClickListener {
final CallBackInterfaceEdit a;
f(CallBackInterfaceEdit callBackInterfaceEdit) {
this.a = callBackInterfaceEdit;
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
CallBackInterfaceEdit callBackInterfaceEdit = this.a;
if (callBackInterfaceEdit != null) {
callBackInterfaceEdit.callBackEdit();
}
dialogInterface.dismiss();
}
}
class g implements DialogInterface.OnClickListener {
g() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}
class h implements k6.s {
final String a;
final k6.e b;
final JSONObject c;
final HashMap d;
h(String str, k6.e eVar, JSONObject jSONObject, HashMap hashMap) {
this.a = str;
this.b = eVar;
this.c = jSONObject;
this.d = hashMap;
}
@Override
public void getConfig(Config config) {
String str;
AppController.j().L(config);
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (this.a.equals("add") || this.a.equals("addLogin")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (this.a.equals("remove")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else if (this.a.equals("getAllIds")) {
str = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
} else {
str = BuildConfig.FLAVOR;
}
String str2 = str;
o1.a("bookmark TAG", str2);
this.b.a(1, this.a, str2, this.c, this.d, false, true);
}
@Override
public void onError(String str) {
}
}
class i implements View.OnClickListener {
final Activity a;
final String b;
final Content c;
i(Activity activity, String str, Content content) {
this.a = activity;
this.b = str;
this.c = content;
}
@Override
public void onClick(View view) {
com.htmedia.mint.utils.n.M(this.a, com.htmedia.mint.utils.n.T1, this.b, this.c, BuildConfig.FLAVOR, "Share");
v2.n(this.a, this.c);
}
}
class j implements View.OnClickListener {
final Activity a;
final String b;
final Content c;
j(Activity activity, String str, Content content) {
this.a = activity;
this.b = str;
this.c = content;
}
@Override
public void onClick(View view) {
com.htmedia.mint.utils.n.M(this.a, com.htmedia.mint.utils.n.T1, this.b, this.c, BuildConfig.FLAVOR, "Share");
v2.j(this.a, this.c);
}
}
class k implements View.OnClickListener {
final Context a;
final String b;
final Content c;
final String d;
final ImageView e;
final ImageView f;
final Activity g;
k(Context context, String str, Content content, String str2, ImageView imageView, ImageView imageView2, Activity activity) {
this.a = context;
this.b = str;
this.c = content;
this.d = str2;
this.e = imageView;
this.f = imageView2;
this.g = activity;
}
@Override
public void onClick(View view) {
com.htmedia.mint.utils.n.M(this.a, com.htmedia.mint.utils.n.T1, this.b, this.c, BuildConfig.FLAVOR, "Bookmark");
if (f0.G1(this.a, "userName") == null) {
p1.a(this.g, this.a.getResources().getString(2131952168), this.d, false);
} else if (AppController.O.a(this.d)) {
f0.l(this.d, this.a, "remove", this.e, this.f);
} else {
f0.l(this.d, this.a, "add", this.e, this.f);
}
}
}
class l implements View.OnClickListener {
final Context a;
final String b;
final Content c;
final String d;
final ImageView e;
final ImageView f;
final Activity g;
l(Context context, String str, Content content, String str2, ImageView imageView, ImageView imageView2, Activity activity) {
this.a = context;
this.b = str;
this.c = content;
this.d = str2;
this.e = imageView;
this.f = imageView2;
this.g = activity;
}
@Override
public void onClick(View view) {
com.htmedia.mint.utils.n.M(this.a, com.htmedia.mint.utils.n.T1, this.b, this.c, BuildConfig.FLAVOR, "Bookmark");
if (f0.G1(this.a, "userName") == null) {
p1.a(this.g, this.a.getResources().getString(2131952168), this.d, false);
} else if (AppController.O.a(this.d)) {
f0.l(this.d, this.a, "remove", this.e, this.f);
} else {
f0.l(this.d, this.a, "add", this.e, this.f);
}
}
}
class m implements k6.f {
int a = 0;
final int b;
final Context c;
final String d;
final ImageView e;
final ImageView f;
final RecyclerView.Adapter g;
final boolean h;
final ArrayList i;
final Content j;
final d3 o;
final int p;
final boolean q;
m(int i, Context context, String str, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z, ArrayList arrayList, Content content, d3 d3Var, int i2, boolean z2) {
this.b = i;
this.c = context;
this.d = str;
this.e = imageView;
this.f = imageView2;
this.g = adapter;
this.h = z;
this.i = arrayList;
this.j = content;
this.o = d3Var;
this.p = i2;
this.q = z2;
}
@Override
public void getBookmarkIdResponse(BookmarkIdpojo bookmarkIdpojo, String str) {
if (bookmarkIdpojo == null || bookmarkIdpojo.getResult() == null || !str.equals("getAllIds")) {
return;
}
for (String str2 : bookmarkIdpojo.getResult()) {
if (str2.contains("-")) {
String[] split = str2.split("-");
this.a++;
o1.a("TAG photo", split[1]);
}
}
o1.a("TAG bookmark", this.a + " " + this.b);
if (this.a >= this.b) {
f0.P3(this.c);
} else {
f0.m(this.d, this.c, "add", this.e, this.f, this.g, this.h, this.i, this.j, this.o, this.p, true, true, this.q);
}
}
@Override
public void getBookmarkResponse(BookmarkStatus bookmarkStatus) {
}
@Override
public void onBookmarkError(String str) {
}
}
class n extends TimerTask {
final Context a;
n(Context context) {
this.a = context;
}
@Override
public void run() {
j1.x0(1, this.a);
}
}
class o implements Runnable {
final TextView a;
final String b;
final String c;
final Context d;
final String e;
class a extends ClickableSpan {
a() {
}
@Override
public void onClick(View view) {
}
@Override
public void updateDrawState(TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setColor(o.this.d.getResources().getColor(2131099915));
}
}
class b implements View.OnClickListener {
b() {
}
@Override
public void onClick(View view) {
o oVar = o.this;
f0.K3(oVar.d, oVar.b, oVar.e);
}
}
o(TextView textView, String str, String str2, Context context, String str3) {
this.a = textView;
this.b = str;
this.c = str2;
this.d = context;
this.e = str3;
}
@Override
public void run() {
int maxLines = this.a.getMaxLines();
if (this.a.getLineCount() > maxLines) {
String str = this.b.substring(0, this.a.getLayout().getLineVisibleEnd(maxLines - 1) - (this.c.length() + 8)) + "... " + this.c;
int indexOf = str.indexOf(this.c);
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str);
this.a.setText(spannableStringBuilder);
spannableStringBuilder.setSpan(new a(), indexOf, this.c.length() + indexOf, 33);
this.a.setText(spannableStringBuilder);
this.a.setOnClickListener(new b());
}
}
}
class p extends TypeToken<ArrayList<ArrayList<String>>> {
p() {
}
}
class q implements k6.s {
final Context a;
q(Context context) {
this.a = context;
}
@Override
public void getConfig(Config config) {
AppController j = AppController.j();
if (j != null && config != null) {
j.L(config);
}
HomeActivity homeActivity = this.a;
HomeActivity homeActivity2 = (homeActivity == null || !(homeActivity instanceof HomeActivity)) ? null : homeActivity;
if (homeActivity2 != null) {
f0.U3(homeActivity2);
}
}
@Override
public void onError(String str) {
HomeActivity homeActivity = this.a;
HomeActivity homeActivity2 = (homeActivity == null || !(homeActivity instanceof HomeActivity)) ? null : homeActivity;
if (homeActivity2 != null) {
f0.U3(homeActivity2);
}
}
}
class r extends TBLClassicListener {
r() {
}
@Override
public boolean onItemClick(String str, String str2, String str3, boolean z, String str4) {
return super.onItemClick(str, str2, str3, z, str4);
}
}
class s extends TBLClassicListener {
s() {
}
@Override
public boolean onItemClick(String str, String str2, String str3, boolean z, String str4) {
return super.onItemClick(str, str2, str3, z, str4);
}
}
class t extends TypeToken<ArrayList<String>> {
t() {
}
}
class u extends TypeToken<ArrayList<L1order>> {
u() {
}
}
class v implements Runnable {
final CollapsingToolbarLayout a;
v(CollapsingToolbarLayout collapsingToolbarLayout) {
this.a = collapsingToolbarLayout;
}
@Override
public void run() {
ViewGroup.LayoutParams layoutParams = (AppBarLayout.LayoutParams) this.a.getLayoutParams();
layoutParams.setScrollFlags(0);
this.a.setLayoutParams(layoutParams);
}
}
static class w {
static final int[] a;
static final int[] b;
static {
int[] iArr = new int[ZSPlanInterval.values().length];
b = iArr;
try {
iArr[ZSPlanInterval.Weekly.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[ZSPlanInterval.Monthly.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
b[ZSPlanInterval.Yearly.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
int[] iArr2 = new int[PlanInterval.values().length];
a = iArr2;
try {
iArr2[PlanInterval.weeks.ordinal()] = 1;
} catch (NoSuchFieldError unused4) {
}
try {
a[PlanInterval.months.ordinal()] = 2;
} catch (NoSuchFieldError unused5) {
}
try {
a[PlanInterval.years.ordinal()] = 3;
} catch (NoSuchFieldError unused6) {
}
}
}
class x extends TypeToken<ArrayList<RetentionModel>> {
x() {
}
}
class y implements Runnable {
final Context a;
final boolean b;
y(Context context, boolean z) {
this.a = context;
this.b = z;
}
@Override
public void run() {
SharedPreferences.Editor edit = this.a.getSharedPreferences("ShowCoachMarkPref", 0).edit();
edit.putBoolean("isShowCoachMark", this.b);
edit.commit();
Log.i("CommonMethods", "setShownCoachMark() Executed");
}
}
class z extends TypeToken<List<Table>> {
z() {
}
}
public static void A(Context context, String str) {
try {
PackageManager packageManager = context.getPackageManager();
String str2 = context.getPackageName() + ".PremiumAlias";
String str3 = context.getPackageName() + ".DefaultAlias";
if (S1(context, str2)) {
packageManager.setComponentEnabledSetting(new ComponentName(context, str2), 2, 1);
Log.i("App Icon Disabled", "Successfully Disabled" + str2);
}
if (S1(context, str3)) {
packageManager.setComponentEnabledSetting(new ComponentName(context, str3), 2, 1);
Log.i("App Icon Disabled", "Successfully Disabled" + str3);
}
if (!S1(context, str2) && !S1(context, str3)) {
packageManager.setComponentEnabledSetting(new ComponentName(context, str), 1, 1);
Log.i("Changed App Icon", "Successfully Changed");
}
Log.i("Changed App Icon Method", "Successfully Executed");
} catch (Exception e2) {
Log.i("Changed App Icon Method Failed", "Unsccessfull");
e2.printStackTrace();
}
}
public static String A0() {
String str = Build.MANUFACTURER;
String str2 = Build.MODEL;
if (str2.startsWith(str)) {
return str2;
}
if (str.equalsIgnoreCase("HTC")) {
return "HTC " + str2;
}
return str + " " + str2;
}
public static String A1(String str, long j2) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
Date parse = simpleDateFormat.parse(str);
return (simpleDateFormat2.format(parse).equalsIgnoreCase(simpleDateFormat2.format(new Date())) ? new SimpleDateFormat("hh:mm a ") : new SimpleDateFormat("dd MMM ")).format(parse);
} catch (Exception e2) {
o0.f(e2);
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static void A2(Context context, String str) {
if (TextUtils.isEmpty(G1(context, "userToken"))) {
C2(context);
} else {
new f7.a(context, str).a();
}
}
public static void A3(List<GainerLoserPojo> list, List<GainerLoserPojo> list2) {
ArrayList arrayList = new ArrayList();
if (list.size() > 0) {
int size = list.size() > 3 ? 3 : list.size();
for (int i2 = 0; i2 < size; i2++) {
arrayList.add("Search \"" + list.get(i2).getSNAME() + "\"");
}
}
if (list2.size() > 0) {
int size2 = list2.size() <= 3 ? list2.size() : 3;
for (int i3 = 0; i3 < size2; i3++) {
arrayList.add("Search \"" + list2.get(i3).getSNAME() + " \"");
}
}
y.addAll(arrayList);
}
public static String B(String str) {
if (TextUtils.isEmpty(str)) {
return str;
}
if (str.toLowerCase().contains("mint premium")) {
str = str.replaceAll("Mint Premium", "Mint");
}
return str.toLowerCase().contains("the wsj") ? str.replaceAll("The WSJ", "WSJ") : str;
}
public static String B0(Context context) {
String F1 = F1(context);
return (TextUtils.isEmpty(F1) || F1.endsWith("htdigital.sso")) ? BuildConfig.FLAVOR : F1;
}
public static long B1(long j2, long j3) {
return ((j3 - j2) / 60000) % 60;
}
public static void B2(Context context) {
Intent intent = new Intent(context, (Class<?>) EpaperActivity.class);
Config g2 = AppController.j().g();
if (g2 == null || g2.getEpaper() == null || TextUtils.isEmpty(g2.getEpaper().getSubscribedEpaperUrl())) {
return;
}
intent.putExtra("URL", g2.getEpaper().getSubscribedEpaperUrl() + "?token=" + G1(context, "userToken"));
context.startActivity(intent);
}
public static void B3(Context context, boolean z2) {
if (context != null) {
ExecutorService newSingleThreadExecutor = Executors.newSingleThreadExecutor();
newSingleThreadExecutor.execute(new y(context, z2));
newSingleThreadExecutor.shutdown();
}
}
public static void C() {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
f0.r2();
}
}, 2000L);
}
public static String C0(Content content) {
String str = com.htmedia.mint.utils.n.Z1;
if (content == null || content.getMetadata() == null || content.getMetadata().getDesign() == null) {
return str;
}
String design = content.getMetadata().getDesign();
design.hashCode();
switch (design) {
case "Design 19":
case "Design 2":
case "Design 5":
case "Design 6":
return com.htmedia.mint.utils.n.c2;
default:
return com.htmedia.mint.utils.n.Z1;
}
}
public static String C1(String str, long j2) {
try {
String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
Date date = new Date(Long.parseLong(str));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
return (simpleDateFormat.format(date).equalsIgnoreCase(format) ? new SimpleDateFormat("hh:mm a 'IST'") : new SimpleDateFormat("dd MMM yyyy")).format(date);
} catch (Exception e2) {
o0.f(e2);
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static void C2(Context context) {
EPaperPayWallBottomSheetFragment ePaperPayWallBottomSheetFragment = new EPaperPayWallBottomSheetFragment();
FragmentTransaction beginTransaction = ((AppCompatActivity) context).getSupportFragmentManager().beginTransaction();
beginTransaction.add(ePaperPayWallBottomSheetFragment, "epaper_paywall");
beginTransaction.commitAllowingStateLoss();
}
public static void C3(long j2) {
l = j2;
}
public static String D(String str) {
return !TextUtils.isEmpty(str) ? (str.toLowerCase().contains("the wall street journal") || str.toLowerCase().contains("wall wtreet journal") || str.toLowerCase().contains("The WSJ")) ? "WSJ" : str : str;
}
public static String D0(Content content) {
String str = com.htmedia.mint.utils.n.V1;
if (content == null || content.getMetadata() == null || content.getMetadata().getDesign() == null) {
return str;
}
String design = content.getMetadata().getDesign();
design.hashCode();
switch (design) {
case "Design 12":
case "Design 15":
case "Design 18":
case "Design 19":
case "Design 2":
case "Design 5":
case "Design 6":
return com.htmedia.mint.utils.n.f2;
default:
return com.htmedia.mint.utils.n.V1;
}
}
public static String D1(String str) {
try {
return new String(e0(str.replace("â\u0080\u0099", "'")), x);
} catch (Exception e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static void D2(Context context, String str) {
Intent intent = new Intent("android.intent.action.SENDTO");
intent.setData(Uri.parse("mailto:"));
intent.putExtra("android.intent.extra.EMAIL", new String[]{str});
intent.putExtra("android.intent.extra.SUBJECT", BuildConfig.FLAVOR);
intent.putExtra("android.intent.extra.TEXT", BuildConfig.FLAVOR);
context.startActivity(Intent.createChooser(intent, "Send mail..."));
}
public static String D3(Content content) {
Metadata metadata = content != null ? content.getMetadata() : null;
ArrayList arrayList = new ArrayList();
StringBuilder sb2 = new StringBuilder();
if (metadata != null) {
if (metadata.getAgencyByLine() != null) {
metadata.getAgencyByLine();
Collections.addAll(arrayList, metadata.getAgencyByLine());
}
if (metadata.getAuthors() != null) {
metadata.getAuthors();
for (String str : metadata.getAuthors()) {
arrayList.add("<b><a href=\"" + str + "\">" + str + "</a></b>");
}
}
if (metadata.getReportedBy() != null) {
metadata.getReportedBy();
for (String str2 : metadata.getReportedBy()) {
arrayList.add("<b><a href=\"" + str2 + "\">" + str2 + "</a></b>");
}
}
if (metadata.getWrittenBy() != null) {
metadata.getWrittenBy();
for (String str3 : metadata.getWrittenBy()) {
arrayList.add("<b><a href=\"" + str3 + "\">" + str3 + "</a></b>");
}
}
if (metadata.getEditedBy() != null) {
metadata.getEditedBy();
for (String str4 : metadata.getEditedBy()) {
arrayList.add("<b><a href=\"" + str4 + "\">" + str4 + "</a></b>");
}
}
if (!TextUtils.isEmpty(metadata.getAgency())) {
String replace = metadata.getAgency().replace("Economist", "The Economist").replace("WSJ", "The Wall Street Journal");
if (arrayList.size() <= 0) {
arrayList.add(replace);
} else if (replace.contains("The Wall Street Journal") || replace.contains("The Economist")) {
arrayList.add(replace);
} else {
arrayList.add(" (with inputs from " + replace + ")");
}
}
for (int i2 = 0; i2 < arrayList.size(); i2++) {
sb2.append((String) arrayList.get(i2));
if (i2 < arrayList.size() - 2) {
sb2.append(", ");
} else if (i2 == arrayList.size() - 2 && !((String) arrayList.get(i2 + 1)).contains(" (with inputs from")) {
sb2.append(" & ");
}
}
}
Log.e("htmlString", sb2.toString());
return sb2.toString();
}
public static boolean E(String str, String str2) {
try {
new SimpleDateFormat(str).parse(str2);
return true;
} catch (ParseException unused) {
return false;
}
}
public static int E0(int i2) {
return i2 >= 5 ? 4 : 0;
}
public static String E1(Context context) {
SharedPreferences sharedPreferences;
return (context == null || (sharedPreferences = context.getSharedPreferences("CommonAppDataSP", 0)) == null) ? BuildConfig.FLAVOR : sharedPreferences.getString("userCountry", BuildConfig.FLAVOR);
}
public static void E2(Context context) {
if (context != null) {
Intent intent = new Intent(context, (Class<?>) WebViewActivityWithoutHeader.class);
intent.addFlags(67108864);
intent.putExtra("url", "https://mintgenie.livemint.com/");
context.startActivity(intent);
}
}
private static void E3(Context context, Menu menu) {
if (context == null || menu == null || menu.size() <= 0) {
return;
}
int size = menu.size();
for (int i2 = 0; i2 < size; i2++) {
MenuItem item = menu.getItem(i2);
if (item != null) {
View view = new View(context);
view.setTag(BuildConfig.FLAVOR + item.getItemId());
item.setActionView(view);
}
}
}
public static boolean F() {
try {
int i2 = Calendar.getInstance().get(11);
return i2 >= 18 || i2 < 7;
} catch (Exception e2) {
e2.printStackTrace();
return false;
}
}
public static String F0(String str, String str2, String str3) {
if (TextUtils.isEmpty(str)) {
return BuildConfig.FLAVOR;
}
Locale locale = Locale.ENGLISH;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(str2, locale);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
try {
Date parse = simpleDateFormat.parse(str);
return parse != null ? new SimpleDateFormat(str3, locale).format(parse) : BuildConfig.FLAVOR;
} catch (ParseException e2) {
o0.f(e2);
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static String F1(Context context) {
String G1 = G1(context, "userEmail");
if (TextUtils.isEmpty(G1) || (!TextUtils.isEmpty(G1) && G1.endsWith("htdigital.sso"))) {
String G12 = G1(context, "userSecondaryEmail");
if (!TextUtils.isEmpty(G12)) {
return G12;
}
}
return G1;
}
public static void F2(Activity activity) {
WebEngageAnalytices.trackClickEvents("Remove Ads", (String) null, "Remove Ads", (Content) null, "Remove Ads", BuildConfig.FLAVOR, BuildConfig.FLAVOR);
com.htmedia.mint.utils.n.M(activity, "ad_interaction", BuildConfig.FLAVOR, null, BuildConfig.FLAVOR, "Remove Ad", "Click Interaction");
Intent openPlanPageIntent = SubscriptionTrigger.openPlanPageIntent(activity, "others", false);
openPlanPageIntent.putExtra("urlkey", BuildConfig.FLAVOR);
openPlanPageIntent.putExtra("keybuttonName", "remove_ads");
openPlanPageIntent.putExtra("funnelName", "remove_ads");
openPlanPageIntent.putExtra("keyPremiumStrory", BuildConfig.FLAVOR);
SSOSingleton.getInstance().setPreviousScreenReferrer(BuildConfig.FLAVOR);
SSOSingleton.getInstance().setSsoOrigin("Remove Ads");
SSOSingleton.getInstance().setPlanPageReason("Remove Ads");
activity.startActivityForResult(openPlanPageIntent, 1009);
}
public static void F3(View view, Activity activity, String str) {
Bitmap w2 = w2(view);
try {
File file = new File(activity.getCacheDir(), "images");
file.mkdirs();
FileOutputStream fileOutputStream = new FileOutputStream(file + "/image.png");
w2.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
fileOutputStream.close();
Uri uriForFile = FileProvider.getUriForFile(activity, "com.htmedia.mint.fileprovider", new File(new File(activity.getCacheDir(), "images"), "image.png"));
if (uriForFile != null) {
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.addFlags(1);
intent.setDataAndType(uriForFile, activity.getContentResolver().getType(uriForFile));
intent.putExtra("android.intent.extra.STREAM", uriForFile);
intent.putExtra("android.intent.extra.TEXT", str);
activity.startActivity(Intent.createChooser(intent, "Choose an app"));
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
public static boolean G(final String str, List<String> list) {
if (list == null) {
return false;
}
Stream<String> stream = list.stream();
Objects.requireNonNull(str);
return stream.anyMatch(new Predicate() {
@Override
public final boolean test(Object obj) {
return str.equalsIgnoreCase((String) obj);
}
});
}
public static String G0(String str, String str2, String str3) {
if (!TextUtils.isEmpty(str)) {
Locale locale = Locale.ENGLISH;
try {
return new SimpleDateFormat(str3, locale).format(new SimpleDateFormat(str2, locale).parse(str));
} catch (ParseException e2) {
o0.f(e2);
e2.printStackTrace();
}
}
return BuildConfig.FLAVOR;
}
public static String G1(Context context, String str) {
if (context != null) {
return "mintgenieUserID".equalsIgnoreCase(str) ? context.getSharedPreferences("MintGineeSP", 0).getString(str, null) : context.getSharedPreferences("LoginData", 0).getString(str, null);
}
return null;
}
public static void G2(Context context, String str) {
if (context == null || TextUtils.isEmpty(str) || !(context instanceof Activity)) {
return;
}
Intent intent = new Intent(context, (Class<?>) WebViewActivityWithHeader.class);
intent.putExtra("url", str);
context.startActivity(intent);
}
public static void G3(View view, Activity activity, int i2, String str) {
Bitmap w2 = w2(view.findViewById(2131429586));
try {
File file = new File(activity.getCacheDir(), "images");
file.mkdirs();
FileOutputStream fileOutputStream = new FileOutputStream(file + "/image.png");
w2.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
fileOutputStream.close();
Uri uriForFile = FileProvider.getUriForFile(activity, "com.htmedia.mint.fileprovider", new File(new File(activity.getCacheDir(), "images"), "image.png"));
String str2 = "https://www.livemint.com/news-in-numbers/" + str + "/" + i2;
if (uriForFile != null) {
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.addFlags(1);
intent.setDataAndType(uriForFile, activity.getContentResolver().getType(uriForFile));
intent.putExtra("android.intent.extra.STREAM", uriForFile);
intent.putExtra("android.intent.extra.TEXT", "Check out today's news in numbers - Numbers that help you understand news better! Exclusively on the app " + str2 + "\nDownload mint app for latest in Business News - https://bit.ly/32XEfFE");
activity.startActivity(Intent.createChooser(intent, "Choose an app"));
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
public static void H(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, int i2, boolean z3, boolean z4, boolean z5) {
f0(context, "getAllIds", new m(AppController.j().g().getInlineImageBookmarkLimit(), context, str, imageView, imageView2, adapter, z2, arrayList, content, d3Var, i2, z5));
}
public static String H0(String str) {
if (str != null) {
try {
} catch (Exception unused) {
o1.a("Exception in", " formatting number ");
}
if (!str.equalsIgnoreCase(BuildConfig.FLAVOR)) {
str = String.format("%,.2f", Float.valueOf(Float.parseFloat(str)));
return str;
}
}
str = BuildConfig.FLAVOR + str;
return str;
}
public static MintSubscriptionDetail H1(Context context) {
if (context == null) {
return null;
}
String string = context.getSharedPreferences("LoginData", 0).getString("UserSubscriptionObject", null);
if (TextUtils.isEmpty(string)) {
return null;
}
return (MintSubscriptionDetail) new Gson().fromJson(string, MintSubscriptionDetail.class);
}
public static String H2(int i2) {
int i3 = i2 % 10;
int i4 = i2 % 100;
if (i3 == 1 && i4 != 11) {
return i2 + "st";
}
if (i3 == 2 && i4 != 12) {
return i2 + "nd";
}
if (i3 != 3 || i4 == 13) {
return i2 + "th";
}
return i2 + "rd";
}
public static void H3(AppCompatActivity appCompatActivity, String str) {
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.putExtra("android.intent.extra.TEXT", str);
intent.setType("text/plain");
appCompatActivity.startActivity(Intent.createChooser(intent, null));
}
public static boolean I(String str, String str2, String str3) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
Date parse = simpleDateFormat.parse(str);
Date parse2 = simpleDateFormat.parse(str2);
Date parse3 = simpleDateFormat.parse(str3);
if (parse3.after(parse)) {
return parse3.before(parse2);
}
return false;
} catch (ParseException e2) {
e2.printStackTrace();
return false;
}
}
public static String I0(Context context) {
return G1(context, "userName") != null ? G1(context, "userClient") : f6.d.b(context);
}
public static String I1() {
AppController j2 = AppController.j();
if (j2 != null && j2.l() != null) {
if (j2.l().isSubscriptionActive()) {
return "subscriber";
}
if (SubscriptionConverter.isSKUPlanActive(j2.l())) {
return "sku";
}
if (j2.l() != null && j2.l().getStatus() != null && (j2.l().getStatus() == SubscriptionStatus.Expired || j2.l().getStatus() == SubscriptionStatus.Cancelled)) {
return "churnedUser";
}
}
return "nonSubscriber";
}
public static void I2(Context context) {
ArrayList arrayList = new ArrayList();
for (Map.Entry<Integer, String> entry : g1().entrySet()) {
RetentionModel retentionModel = new RetentionModel();
Calendar calendar = Calendar.getInstance();
calendar.add(6, entry.getKey().intValue());
Date time = calendar.getTime();
retentionModel.setEventName(entry.getValue());
retentionModel.setTimeStamp(time.getTime());
arrayList.add(retentionModel);
}
Collections.sort(arrayList, new e0());
Z2(arrayList, "Retention_events", context);
}
public static void I3(View view, Activity activity, Section section) {
String str;
Bitmap w2 = w2(view);
try {
File file = new File(activity.getCacheDir(), "images");
file.mkdirs();
FileOutputStream fileOutputStream = new FileOutputStream(file + "/image.png");
w2.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
fileOutputStream.close();
Uri uriForFile = FileProvider.getUriForFile(activity, "com.htmedia.mint.fileprovider", new File(new File(activity.getCacheDir(), "images"), "image.png"));
String websiteUrl = section.getWebsiteUrl();
if (uriForFile != null) {
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.addFlags(1);
intent.setDataAndType(uriForFile, activity.getContentResolver().getType(uriForFile));
intent.putExtra("android.intent.extra.STREAM", uriForFile);
if (r0() == null || r0().getOneLinkiOS() == null || TextUtils.isEmpty(r0().getOneLinkiOS())) {
str = "Checkout Sensex Stats live on Mint App, download Now - https://bit.ly/32XEfFE";
} else {
str = "Checkout Sensex Stats live on Mint App, download Now - " + r0().getOneLinkiOS();
}
intent.putExtra("android.intent.extra.TEXT", websiteUrl + "\n" + str);
activity.startActivity(Intent.createChooser(intent, "Choose an app"));
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
public static void J() {
SharedPreferences.Editor edit = AppController.j().getApplicationContext().getSharedPreferences("DeviceIdPref", 0).edit();
edit.clear();
edit.apply();
}
public static Map<String, Integer> J0() {
HashMap hashMap = new HashMap();
hashMap.put("foryou_page_analytics", 101);
hashMap.put("news_page", 201);
hashMap.put("premium_section", 301);
hashMap.put("market_page", 401);
hashMap.put("foryou_tab", 501);
return hashMap;
}
public static List<Author> J1(List<Author> list) {
ArrayList arrayList = new ArrayList();
if (list != null && !list.isEmpty()) {
for (int i2 = 0; i2 < list.size(); i2++) {
Author author = list.get(i2);
if (author != null && !TextUtils.isEmpty(String.valueOf(author.getId())) && !TextUtils.isEmpty(author.getBio())) {
arrayList.add(author);
}
}
}
return arrayList;
}
public static int J2(int i2) {
return (int) (i2 / Resources.getSystem().getDisplayMetrics().density);
}
public static void J3(View view, Activity activity, String str, String str2) {
Bitmap w2 = w2(view);
try {
File file = new File(activity.getCacheDir(), "images");
file.mkdirs();
FileOutputStream fileOutputStream = new FileOutputStream(file + "/image.png");
w2.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
fileOutputStream.close();
Uri uriForFile = FileProvider.getUriForFile(activity, "com.htmedia.mint.fileprovider", new File(new File(activity.getCacheDir(), "images"), "image.png"));
if (uriForFile != null) {
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.addFlags(1);
intent.setDataAndType(uriForFile, activity.getContentResolver().getType(uriForFile));
intent.putExtra("android.intent.extra.STREAM", uriForFile);
intent.putExtra("android.intent.extra.SUBJECT", Html.fromHtml(str2).toString() + " - Livemint.com ");
intent.putExtra("android.intent.extra.TEXT", Html.fromHtml(str2).toString() + " " + str + "\nDownload mint app for latest in Business News - https://bit.ly/32XEfFE");
activity.startActivity(Intent.createChooser(intent, "Choose an app"));
}
} catch (IOException e2) {
e2.printStackTrace();
}
}
public static void K(String str, Context context) {
if (context == null) {
context = AppController.j();
}
if (context != null) {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(context).edit();
edit.putString(str, null);
edit.apply();
}
}
public static ArrayList<Section> K0(Context context) {
HashMap<String, Section> hashMap;
SKUPlansL1 sKUPlansL1;
Section section;
ArrayList<Event> arrayList;
int i2;
ArrayList<Event> arrayList2;
int i3;
int i4;
if (context == null) {
context = AppController.j();
}
if (context == null) {
return new ArrayList<>();
}
Config r0 = r0();
ArrayList arrayList3 = new ArrayList();
String h2 = i2.g().h();
ArrayList<ArrayList<String>> arrayList4 = new ArrayList<>();
MintSubscriptionDetail l2 = AppController.j().l();
int i5 = 0;
if (!TextUtils.isEmpty(h2)) {
ArrayList<ArrayList<String>> k0 = l2 != null && l2.isSubscriptionActive() ? k0(h2, "l1MenuSub") : k0(h2, "l1Menu");
if ((k0 == null || k0.isEmpty()) && r0 != null && !r0.getHomeL1MenuOrder().isEmpty()) {
k0 = r0.getHomeL1MenuOrder();
}
arrayList4 = k0;
} else if (r0 != null && r0.getHomeL1MenuOrder() != null && !r0.getHomeL1MenuOrder().isEmpty()) {
arrayList4 = r0.getHomeL1MenuOrder();
}
if (arrayList4.isEmpty()) {
hashMap = null;
sKUPlansL1 = null;
} else {
hashMap = M1(r0);
sKUPlansL1 = SubscriptionConverter.checkAndUpdateOrderAndMap(r0, l2, arrayList4, hashMap);
for (int i6 = 0; i6 < arrayList4.size(); i6++) {
int i10 = 0;
while (true) {
if (i10 < arrayList4.get(i6).size()) {
L1order l1order = new L1order();
Section section2 = hashMap.get(arrayList4.get(i6).get(i10));
if (section2 != null) {
try {
i3 = Integer.parseInt(section2.getAndroidVersion().trim());
i4 = 304;
} catch (Exception e2) {
e2.printStackTrace();
i3 = 0;
i4 = 0;
}
if (i3 <= i4 && !TextUtils.isEmpty(section2.getId())) {
l1order.f4id = section2.getId();
l1order.name = section2.getDisplayName();
l1order.isFreeze = false;
arrayList3.add(l1order);
break;
}
}
i10++;
}
}
}
}
if (!arrayList3.isEmpty()) {
ArrayList O0 = O0("l1_menu_order", context);
if (O0 != null && !O0.isEmpty()) {
for (int i11 = 0; i11 < arrayList3.size(); i11++) {
if (!O0.contains(arrayList3.get(i11))) {
if (O0.size() >= i11) {
O0.add(i11, (L1order) arrayList3.get(i11));
} else {
O0.add((L1order) arrayList3.get(i11));
}
}
}
}
if (O0 != null && !O0.isEmpty()) {
ArrayList arrayList5 = new ArrayList();
for (int i12 = 0; i12 < O0.size(); i12++) {
if (arrayList3.contains(O0.get(i12))) {
arrayList5.add((L1order) O0.get(i12));
}
}
O0.clear();
O0.addAll(arrayList5);
}
if (sKUPlansL1 != null) {
arrayList = (r0 == null || (arrayList2 = r0.events) == null || arrayList2.isEmpty()) ? new ArrayList<>() : (ArrayList) r0.events.clone();
if (arrayList == null) {
arrayList = new ArrayList<>();
}
if (!arrayList.isEmpty()) {
Iterator<Event> it = arrayList.iterator();
while (it.hasNext()) {
Event next = it.next();
if (next != null && (i2 = next.pos) == 1) {
next.pos = i2 + 1;
}
}
}
Event event = new Event();
event.pos = 1;
event.f17id = sKUPlansL1.getL1MenuId();
event.name = sKUPlansL1.getName();
arrayList.add(event);
} else {
arrayList = r0.events;
}
if (O0 == null || O0.size() <= 0 || arrayList == null || arrayList.size() <= 0) {
if (arrayList == null) {
arrayList = new ArrayList<>();
}
int size = !arrayList.isEmpty() ? arrayList.size() : 0;
for (int i13 = 0; i13 < size; i13++) {
Event event2 = arrayList.get(i13);
if (event2 != null) {
String str = event2.f17id;
Iterator it2 = arrayList3.iterator();
while (it2.hasNext()) {
L1order l1order2 = (L1order) it2.next();
if (l1order2 != null && !TextUtils.isEmpty(l1order2.f4id) && l1order2.f4id.equalsIgnoreCase(str)) {
it2.remove();
}
}
}
}
int size2 = arrayList3.size();
int size3 = arrayList.size();
while (i5 < size3) {
Event event3 = arrayList.get(i5);
if (event3 != null) {
int i14 = event3.pos;
L1order l1order3 = new L1order();
l1order3.f4id = event3.f17id;
l1order3.name = event3.name;
l1order3.isFreeze = true;
if (i14 >= size2) {
arrayList3.add(l1order3);
} else {
arrayList3.add(i14, l1order3);
}
}
i5++;
}
} else {
ArrayList<Event> S3 = S3(arrayList);
int size4 = S3.size();
for (int i15 = 0; i15 < size4; i15++) {
String str2 = S3.get(i15).f17id;
Iterator it3 = O0.iterator();
while (it3.hasNext()) {
L1order l1order4 = (L1order) it3.next();
if (!TextUtils.isEmpty(l1order4.f4id) && l1order4.f4id.equalsIgnoreCase(str2)) {
it3.remove();
}
}
}
if (!O0.isEmpty()) {
int size5 = O0.size();
int size6 = S3.size();
while (i5 < size6) {
Event event4 = S3.get(i5);
int i16 = event4.pos;
L1order l1order5 = new L1order();
l1order5.f4id = event4.f17id;
l1order5.name = event4.name;
l1order5.isFreeze = true;
if (i16 >= size5) {
O0.add(l1order5);
} else {
O0.add(i16, l1order5);
}
i5++;
}
}
}
if (O0 == null || O0.isEmpty()) {
W2(arrayList3, "l1_menu_order", context);
} else {
W2(O0, "l1_menu_order", context);
arrayList3 = O0;
}
}
ArrayList<Section> arrayList6 = new ArrayList<>();
if (!arrayList3.isEmpty()) {
Iterator it4 = arrayList3.iterator();
while (it4.hasNext()) {
L1order l1order6 = (L1order) it4.next();
String str3 = l1order6 != null ? l1order6.f4id : BuildConfig.FLAVOR;
if (!TextUtils.isEmpty(str3) && hashMap != null && !hashMap.isEmpty() && hashMap.containsKey(str3) && (section = hashMap.get(str3)) != null) {
arrayList6.add(section);
}
}
}
return arrayList6;
}
public static List<Author> K1(List<Author> list) {
ArrayList arrayList = new ArrayList();
if (list != null && list.size() > 0) {
for (int i2 = 0; i2 < list.size(); i2++) {
Author author = list.get(i2);
if (author != null && !TextUtils.isEmpty(String.valueOf(author.getId())) && author.getId() != null) {
arrayList.add(author);
}
}
}
return (ArrayList) arrayList.stream().collect(Collectors.collectingAndThen(Collectors.toMap(new Function() {
@Override
public final Object apply(Object obj) {
return ((Author) obj).getId();
}
}, new Function() {
@Override
public final Object apply(Object obj) {
Author s2;
s2 = f0.s2((Author) obj);
return s2;
}
}, new BinaryOperator() {
@Override
public final Object apply(Object obj, Object obj2) {
Author t2;
t2 = f0.t2((Author) obj, (Author) obj2);
return t2;
}
}), new Function() {
@Override
public final Object apply(Object obj) {
ArrayList u2;
u2 = f0.u2((Map) obj);
return u2;
}
}));
}
public static void K2(Context context) {
f6.l.m(context, "storyReadCounter", 0);
f6.l.m(context, "storyId", 0L);
f6.l.m(context, "Skipbuttonlogin", Boolean.FALSE);
AppController.j().f();
}
public static void K3(Context context, String str, String str2) {
final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(context);
bottomSheetDialog.setContentView(2131624074);
View findViewById = bottomSheetDialog.findViewById(2131429194);
Objects.requireNonNull(findViewById);
((ImageView) findViewById).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
bottomSheetDialog.dismiss();
}
});
((TextView) bottomSheetDialog.findViewById(2131431228)).setText(str2);
((TextView) bottomSheetDialog.findViewById(2131431216)).setText(str);
bottomSheetDialog.show();
}
public static void L(Context context) {
AppController.O.c();
context.getSharedPreferences("LoginData", 0).edit().clear().commit();
}
public static int L0() {
return t;
}
public static String L1(long j2, ZSPlanInterval zSPlanInterval) {
if (zSPlanInterval != null) {
int i2 = w.b[zSPlanInterval.ordinal()];
if (i2 == 1) {
return j2 + " WEEK";
}
if (i2 == 2) {
return j2 + " MONTH";
}
if (i2 == 3) {
return j2 + " YEAR";
}
}
return BuildConfig.FLAVOR;
}
public static void L2(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, int i2, boolean z3, boolean z4, boolean z5, k6.f fVar) {
String str3;
if (!m0.a(context)) {
Toast.makeText(context, "Network not available", 1).show();
return;
}
k6.e eVar = new k6.e(context, fVar, str2);
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("storyId", str);
} catch (JSONException e2) {
e2.printStackTrace();
o0.f(e2);
}
}
jSONObject.put("type", "Apps");
jSONObject.put("os", "Android");
jSONObject.put("siteId", "LM");
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", G1(context, "userToken"));
if (AppController.j() == null && AppController.j().g() == null) {
return;
}
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (str2.equals("remove")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str3 = BuildConfig.FLAVOR;
}
eVar.a(1, str2, str3, jSONObject, hashMap, false, true);
}
public static void L3(AppCompatActivity appCompatActivity, String str) {
if (appCompatActivity != null) {
View inflate = appCompatActivity.getLayoutInflater().inflate(2131624785, (ViewGroup) appCompatActivity.findViewById(2131430380));
((TextView) inflate.findViewById(2131429800)).setText(str);
Toast toast = new Toast(appCompatActivity);
toast.setGravity(80, 0, -200);
toast.setMargin(0.0f, -100.0f);
toast.setDuration(1);
toast.setView(inflate);
toast.show();
}
}
public static void M(Context context) {
AppController.j().g0((ZSSuscriptionDetail) null);
MintSubscriptionDetail l2 = AppController.j().l();
if (l2 != null) {
l2.setSubscriptionActive(false);
}
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
edit.putString("subs_status", null);
edit.putString("zscurrentplan", null);
edit.putString("zscurrentplanid", null);
edit.putFloat("zscurrentprice", 0.0f);
edit.putBoolean("issubscribedmint", false);
edit.putBoolean("isAdFreeUser", false);
edit.apply();
}
public static int M0(long j2, long j3) {
return (int) ((new Date(j3).getTime() - new Date(j2).getTime()) / 3600000);
}
public static HashMap<String, Section> M1(Config config) {
JSONObject l1MenuJson = config.getL1MenuJson();
HashMap<String, Section> hashMap = new HashMap<>();
Gson gson = new Gson();
if (l1MenuJson != null) {
try {
if (l1MenuJson.length() > 0) {
Iterator<String> keys = l1MenuJson.keys();
while (keys.hasNext()) {
String next = keys.next();
if (!TextUtils.isEmpty(next)) {
hashMap.put(next, (Section) gson.fromJson(l1MenuJson.getJSONObject(next).toString(), Section.class));
}
}
}
} catch (JSONException e2) {
e2.printStackTrace();
}
}
return hashMap;
}
public static void M2(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, boolean z3, k6.f fVar) {
L2(str, context, str2, imageView, imageView2, adapter, z2, arrayList, content, d3Var, 0, false, z3, false, fVar);
}
public static void M3(AppCompatActivity appCompatActivity, String str) {
if (appCompatActivity != null) {
boolean Z1 = Z1();
View inflate = appCompatActivity.getLayoutInflater().inflate(2131624209, (ViewGroup) appCompatActivity.findViewById(2131428162));
TextView textView = (TextView) inflate.findViewById(2131430937);
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(2131428162);
textView.setText(str);
if (Z1) {
linearLayout.setBackground(ContextCompat.getDrawable(appCompatActivity, 2131234277));
textView.setTextColor(ContextCompat.getColor(appCompatActivity, 2131100064));
} else {
linearLayout.setBackground(ContextCompat.getDrawable(appCompatActivity, 2131234276));
textView.setTextColor(ContextCompat.getColor(appCompatActivity, 2131100064));
}
Toast toast = new Toast(appCompatActivity);
toast.setDuration(1);
toast.setView(inflate);
toast.show();
}
}
public static String N(String str) {
try {
return new SimpleDateFormat("dd MMM''yy", Locale.getDefault()).format(new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(str));
} catch (ParseException e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static JsonObject N0(LinkedHashMap<String, String> linkedHashMap) throws JSONException {
return new Gson().toJsonTree(linkedHashMap).getAsJsonObject();
}
public static void N1(Activity activity) {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService("input_method");
View currentFocus = activity.getCurrentFocus();
if (currentFocus == null) {
currentFocus = new View(activity);
}
inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
}
public static String N2(String str) {
if (str.contains("₹") && str.contains(".")) {
String substring = str.substring(0, str.lastIndexOf(46));
if (!TextUtils.isEmpty(substring)) {
return substring;
}
}
return str;
}
public static void N3(AppCompatActivity appCompatActivity, String str) {
View inflate = appCompatActivity.getLayoutInflater().inflate(2131624208, (ViewGroup) null);
((TextView) inflate.findViewById(2131430833)).setText(str);
Toast toast = new Toast(appCompatActivity);
toast.setDuration(1);
toast.setView(inflate);
toast.show();
}
public static Content O(Episode episode) {
Content content = new Content();
content.setId(episode.f62id);
content.setPodcastEpisode(episode.isEpisode);
content.setPodcastTitle(episode.getPodcastTitle());
content.setMobileHeadline(episode.getTitle());
content.setType("Podcast");
o1.a("id", episode.getId() + " ");
content.setSummary(episode.getContent());
Metadata metadata = new Metadata();
metadata.setAudioSourceUrl(episode.getMp3Url());
metadata.setUrl(episode.getHref());
content.setMetadata(metadata);
LeadMedia leadMedia = new LeadMedia();
Image image = new Image();
Images images = new Images();
images.setThumbnailImage(episode.episodeImage);
image.setImages(images);
leadMedia.setImage(image);
content.setLeadMedia(leadMedia);
return content;
}
public static ArrayList<L1order> O0(String str, Context context) {
if (context == null) {
context = AppController.j();
}
if (context == null) {
return null;
}
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
Gson gson = new Gson();
String string = defaultSharedPreferences.getString(str, null);
if (TextUtils.isEmpty(string)) {
return null;
}
return (ArrayList) gson.fromJson(string, new u().getType());
}
public static boolean O1() {
if (OfferBannerSingleton.getInstance().getDeviceEligibilityData() != null) {
return OfferBannerSingleton.getInstance().getDeviceEligibilityData().isIs_add_free();
}
return false;
}
public static String O2(String str, double d2) {
if (TextUtils.isEmpty(str)) {
str = BuildConfig.FLAVOR;
}
String str2 = str + d2;
if (d2 != Math.floor(d2) || Double.isInfinite(d2)) {
return str2;
}
if (str.trim().equalsIgnoreCase("Rs.")) {
str = "₹";
}
return str + ((int) d2);
}
public static void O3(Context context, String str, String str2, CallBackInterfaceEdit callBackInterfaceEdit) {
if (context != null) {
AlertDialog.Builder builder = Z1() ? new AlertDialog.Builder(context, 2132017409) : new AlertDialog.Builder(context, 2132017410);
builder.setTitle(str);
builder.setMessage(str2);
builder.setPositiveButton("Yes", new f(callBackInterfaceEdit));
builder.setNegativeButton("No", new g());
builder.setCancelable(false);
AlertDialog create = builder.create();
if (((Activity) context).isFinishing()) {
return;
}
create.show();
}
}
public static Bundle P(Map<String, String> map) {
Set<String> keySet = map.keySet();
Bundle bundle = new Bundle();
for (String str : keySet) {
bundle.putString(str, map.get(str));
}
return bundle;
}
public static String P0(String str) {
String path;
try {
if (TextUtils.isEmpty(str) || (path = new URI(str).getPath()) == null || path.isEmpty()) {
return BuildConfig.FLAVOR;
}
return path.split("/")[r1.length - 1];
} catch (Exception unused) {
return BuildConfig.FLAVOR;
}
}
public static boolean P1() {
MintSubscriptionDetail l2 = AppController.j().l();
Config r0 = r0();
AdFreeSubscription adFreeSubscription = r0 != null ? r0.getAdFreeSubscription() : null;
if (l2 == null || TextUtils.isEmpty(l2.getPlanCode()) || adFreeSubscription == null || adFreeSubscription.getAdLitePlans().isEmpty()) {
return false;
}
return adFreeSubscription.getAdLitePlans().contains(l2.getPlanCode());
}
public static String P2(double d2) {
String str = d2 + BuildConfig.FLAVOR;
if (d2 != Math.floor(d2) || Double.isInfinite(d2)) {
return str;
}
return ((int) d2) + BuildConfig.FLAVOR;
}
public static void P3(Context context) {
if (context != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("Bookmark limit Exceed");
builder.setMessage("Oops! Looks like you have exceeded the limit to bookmark the image. Remove some to bookmark this image.");
builder.setPositiveButton(R.string.ok, new e());
builder.setCancelable(false);
AlertDialog create = builder.create();
if (((Activity) context).isFinishing()) {
return;
}
create.show();
}
}
public static String Q(String str) {
try {
Locale locale = Locale.US;
return new SimpleDateFormat("MMM yyyy", locale).format(new SimpleDateFormat("yyyy-MM-dd", locale).parse(str));
} catch (ParseException e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static int Q0() {
return u;
}
public static boolean Q1() {
if (OfferBannerSingleton.getInstance().getDeviceEligibilityData() != null) {
return OfferBannerSingleton.getInstance().getDeviceEligibilityData().isAddLite();
}
return false;
}
public static String Q2(@NonNull String str) {
return new String(str.replace("â\u0080\u0099", "'").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
}
public static void Q3(Context context, long j2, long j3) {
Log.d("SplashLoadTime", "Splash Load Time: " + Math.abs(j2 - j3) + " ms");
}
public static Float R(double d2) {
return Float.valueOf((float) d2);
}
public static q.n R0(Context context) {
return TextUtils.isEmpty(G1(context, "userPhoneNumber")) ? q.n.EMAIL : (G1(context, "userEmail").contains("htdigital.sso") && TextUtils.isEmpty(G1(context, "userSecondaryEmail"))) ? q.n.PHONE : q.n.BOTH;
}
public static boolean R1(Context context) {
if (context == null) {
return false;
}
context.getSharedPreferences("AdsDatePref", 0).getBoolean("adFree", false);
return true;
}
public static void R2(Intent intent, Activity activity) {
Content content;
if (activity == null || intent == null) {
return;
}
activity.overridePendingTransition(com.moengage.inapp.R.anim.fade_in, 2130772002);
if (activity instanceof HomeActivity) {
if (SubscriptionPlanSingleton.getInstance().getContent() != null && (content = SubscriptionPlanSingleton.getInstance().getContent()) != null) {
Bundle bundle = new Bundle();
bundle.putString("story_id", content.getId() + BuildConfig.FLAVOR);
bundle.putInt("isNotification", q.m.DEEPLINK.ordinal());
intent.putExtras(bundle);
SubscriptionPlanSingleton.getInstance().setContent((Content) null);
}
activity.finish();
} else if (activity instanceof MyAccountActivity) {
activity.finish();
}
activity.startActivity(intent);
}
public static void R3(ImageView imageView, ImageView imageView2, Activity activity, Content content, String str) {
if (imageView != null) {
imageView.setOnClickListener(new i(activity, str, content));
}
if (imageView2 != null) {
imageView2.setOnClickListener(new j(activity, str, content));
}
}
public static <T> T S(Object obj) {
Gson gson = new Gson();
return (T) gson.fromJson(gson.toJsonTree(obj).getAsJsonObject(), obj.getClass());
}
public static boolean S0(Context context, String str) {
if (context == null || TextUtils.isEmpty(str)) {
return false;
}
return context.getSharedPreferences("LoginData", 0).getBoolean(str, false);
}
private static boolean S1(Context context, String str) {
try {
int componentEnabledSetting = context.getPackageManager().getComponentEnabledSetting(new ComponentName(context, str));
return (componentEnabledSetting == 2 || componentEnabledSetting == 3) ? false : true;
} catch (Exception e2) {
e2.printStackTrace();
return false;
}
}
public static String S2(Context context, long j2, long j3) {
return String.valueOf(Math.abs(j2 - j3));
}
private static ArrayList<Event> S3(ArrayList<Event> arrayList) {
if (arrayList == null || arrayList.isEmpty()) {
return arrayList;
}
ArrayList<Event> arrayList2 = new ArrayList<>(arrayList);
int size = arrayList2.size();
for (int i2 = 0; i2 < size - 1; i2++) {
int i3 = 0;
while (i3 < (size - i2) - 1) {
Event event = arrayList2.get(i3);
int i4 = i3 + 1;
Event event2 = arrayList2.get(i4);
if (event != null && event2 != null && event.pos > event2.pos) {
Event event3 = arrayList2.get(i3);
arrayList2.set(i3, arrayList2.get(i4));
arrayList2.set(i4, event3);
}
i3 = i4;
}
}
return arrayList2;
}
public static void T(String str, String str2, String str3, Context context) {
HashMap hashMap = new HashMap();
hashMap.put("storyId", str3);
hashMap.put("buttonName", str);
hashMap.put("targetUrl", str2);
k1.z(k1.l(context), null, hashMap, "iglu:com.htdigital.streams/button_click/jsonschema/1-0-0");
o1.a("SnowPlow Analytics", "Button Click Event Fired");
}
public static Long T0(Context context, String str) {
if (context != null) {
return Long.valueOf(PreferenceManager.getDefaultSharedPreferences(context).getLong(str, 0L));
}
return 0L;
}
public static void T1(w7.f fVar) {
if (v.size() != w.size() || fVar == null) {
return;
}
fVar.h();
}
public static void T2(List<String> list, String str, Context context) {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(context).edit();
edit.putString(str, new Gson().toJson(list));
edit.apply();
}
public static int T3(float f2, Context context) {
int applyDimension = (int) TypedValue.applyDimension(2, f2, context.getResources().getDisplayMetrics());
if (applyDimension > 0) {
return applyDimension;
}
return 1;
}
public static void U(String str, int i2, Content content, Section section, Context context) {
}
public static MintSubscriptionDetail U0() {
return AppController.j().l();
}
public static boolean U1(long j2) {
if (AppController.j().o() != null && AppController.j().o().getPartners() != null && AppController.j().o().getPartners().getPianoNonLogin() != null && AppController.j().o().getPartners().getPianoNonLogin().getPremiumStories() != null && AppController.j().o().getPartners().getPianoNonLogin().getPremiumStories().size() > 0) {
List<String> premiumStories = AppController.j().o().getPartners().getPianoNonLogin().getPremiumStories();
if (!premiumStories.isEmpty() && premiumStories.size() > 0) {
for (String str : premiumStories) {
if (str != null && !TextUtils.isEmpty(str) && z(str).longValue() == j2) {
return true;
}
}
}
}
if (AppController.j().o() == null || AppController.j().o().getPartners() == null || AppController.j().o().getPartners().getPiano() == null || AppController.j().o().getPartners().getPiano().getPremiumStories() == null || AppController.j().o().getPartners().getPiano().getPremiumStories().size() <= 0) {
return false;
}
List<String> premiumStories2 = AppController.j().o().getPartners().getPiano().getPremiumStories();
if (premiumStories2.isEmpty() || premiumStories2.size() <= 0) {
return false;
}
for (String str2 : premiumStories2) {
if (str2 != null && !TextUtils.isEmpty(str2) && z(str2).longValue() == j2) {
return true;
}
}
return false;
}
public static void U2(String str, Context context, boolean z2) {
if (context != null) {
String str2 = null;
try {
if (!TextUtils.isEmpty(str)) {
for (String str3 : new URI(str).getQuery().split("&")) {
String[] split = str3.split("=");
if (split != null && split.length > 1 && (split[0].equals("utm_campaign") || split[0].equals("session_campaign"))) {
str2 = split[1];
}
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
if (z2) {
if (str2 == null) {
str2 = "Organic";
}
b3(context, "sessionCampaign", str2);
} else {
b3(context, "sessionCampaign", str2 != null ? str2 : "Organic");
if (str2 == null) {
str2 = "Organic";
}
b3(context, "acqCampaign", str2);
}
}
}
public static void U3(Activity activity) {
if (activity != null) {
Intent intent = new Intent(activity, (Class<?>) HomeActivity.class);
intent.setFlags(65536);
intent.setFlags(67108864);
activity.overridePendingTransition(0, 0);
activity.startActivity(intent);
}
}
public static void V(String str, int i2, Content content, Section section, Context context, String str2) {
}
static String V0(int i2) {
try {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMM");
calendar.set(2, i2 - 1);
return simpleDateFormat.format(calendar.getTime());
} catch (Exception e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static boolean V1() {
return AppController.d0;
}
public static void V2(DeviceEligibilityData deviceEligibilityData) {
Context applicationContext = AppController.j().getApplicationContext();
String json = new Gson().toJson(deviceEligibilityData);
SharedPreferences.Editor edit = applicationContext.getSharedPreferences("DeviceIdPref", 0).edit();
edit.putString("DeviceIdAPIResponse", json);
edit.apply();
}
public static CharSequence V3(CharSequence charSequence) {
if (charSequence == null) {
return BuildConfig.FLAVOR;
}
int length = charSequence.length();
do {
length--;
if (length < 0) {
break;
}
} while (Character.isWhitespace(charSequence.charAt(length)));
return charSequence.subSequence(0, length + 1);
}
public static void W(String str, String str2, Context context) {
HashMap hashMap = new HashMap();
hashMap.put("buttonName", str);
hashMap.put("storyId", str2);
k1.z(k1.l(context), null, hashMap, "iglu:com.htdigital.streams/button_click/jsonschema/1-0-0");
o1.a("SnowPlow Analytics", "Dark Button Click Event Fired");
}
public static String W0() {
String str = AppController.L;
return !TextUtils.isEmpty(str) ? (str.contains("notification") || str.contains("Notification")) ? com.htmedia.mint.utils.n.y2 : str.equals("Deeplink") ? "Deeplink" : BuildConfig.FLAVOR : BuildConfig.FLAVOR;
}
public static boolean W1(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
return str.matches("[+-]?([0-9]*[.])?[0-9]+");
}
public static void W2(List<L1order> list, String str, Context context) {
if (context == null) {
context = AppController.j();
}
if (context != null) {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(context).edit();
edit.putString(str, new Gson().toJson(list));
edit.apply();
}
}
public static void W3(Context context, String str, String str2) {
if ("mintgenieUserID".equalsIgnoreCase(str)) {
SharedPreferences.Editor edit = context.getSharedPreferences("MintGineeSP", 0).edit();
edit.putString(str, str2);
edit.apply();
} else {
SharedPreferences.Editor edit2 = context.getSharedPreferences("LoginData", 0).edit();
edit2.putString(str, str2);
edit2.apply();
}
}
public static ShapeDrawable X(Context context, String str) {
int b02;
int b03;
ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape());
shapeDrawable.getPaint().setColor(Color.parseColor(str));
if (context != null) {
b02 = context.getResources().getDimensionPixelSize(2131165358);
b03 = context.getResources().getDimensionPixelSize(2131165357);
} else {
b02 = b0(5);
b03 = b0(5);
if (b02 == 0) {
b02 = 15;
}
if (b03 == 0) {
b03 = 15;
}
}
shapeDrawable.setIntrinsicWidth(b02);
shapeDrawable.setIntrinsicHeight(b03);
return shapeDrawable;
}
public static String X0(Context context) {
String G1 = G1(context, "userPhoneNumber");
if (TextUtils.isEmpty(G1) || G1.contains("+")) {
return BuildConfig.FLAVOR;
}
return "+" + G1;
}
public static boolean X1(String str) {
int i2;
if (str == null || str.isEmpty()) {
return false;
}
int length = str.length();
if (str.charAt(0) != '-') {
i2 = 0;
} else {
if (length == 1) {
return false;
}
i2 = 1;
}
while (i2 < length) {
char charAt = str.charAt(i2);
if (charAt < '0' || charAt > '9') {
return false;
}
i2++;
}
return true;
}
public static void X2(Context context, SocialResponsePojo socialResponsePojo) {
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
if (TextUtils.isEmpty(socialResponsePojo.getData().getName())) {
edit.putString("userName", "User");
} else {
edit.putString("userName", socialResponsePojo.getData().getName());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getEmail())) {
edit.putString("userEmail", BuildConfig.FLAVOR);
} else {
edit.putString("userEmail", socialResponsePojo.getData().getEmail());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getSecondaryEmail())) {
edit.putString("userSecondaryEmail", BuildConfig.FLAVOR);
} else {
edit.putString("userSecondaryEmail", socialResponsePojo.getData().getSecondaryEmail());
}
if (!TextUtils.isEmpty(socialResponsePojo.getLoginSource())) {
edit.putString("userLoginSource", socialResponsePojo.getLoginSource());
}
if (!TextUtils.isEmpty(socialResponsePojo.getLoginMode())) {
edit.putString("userLoginMode", socialResponsePojo.getLoginMode());
}
edit.putString("userClient", socialResponsePojo.getData().getClientId());
edit.putBoolean("login_source", socialResponsePojo.isSocialLogin());
if (TextUtils.isEmpty(socialResponsePojo.getData().getMobileNumber())) {
edit.putString("userPhoneNumber", BuildConfig.FLAVOR);
} else {
edit.putString("userPhoneNumber", socialResponsePojo.getData().getMobileNumber());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getGender())) {
edit.putString("userGender", BuildConfig.FLAVOR);
} else {
edit.putString("userGender", socialResponsePojo.getData().getGender());
}
edit.putBoolean("isFirstTimelogin", true);
edit.apply();
}
public static void X3(Context context, SocialResponsePojo socialResponsePojo) {
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
if (TextUtils.isEmpty(socialResponsePojo.getData().getName())) {
edit.putString("userName", "User");
} else {
edit.putString("userName", socialResponsePojo.getData().getName());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getMobileNumber())) {
edit.putString("userPhoneNumber", BuildConfig.FLAVOR);
} else {
edit.putString("userPhoneNumber", socialResponsePojo.getData().getMobileNumber());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getGender())) {
edit.putString("userGender", BuildConfig.FLAVOR);
} else {
edit.putString("userGender", socialResponsePojo.getData().getGender());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getEmail())) {
edit.putString("userEmail", BuildConfig.FLAVOR);
} else {
edit.putString("userEmail", socialResponsePojo.getData().getEmail());
}
if (TextUtils.isEmpty(socialResponsePojo.getData().getSecondaryEmail())) {
edit.putString("userSecondaryEmail", BuildConfig.FLAVOR);
} else {
edit.putString("userSecondaryEmail", socialResponsePojo.getData().getSecondaryEmail());
}
edit.putBoolean("userWhatsAppOptin", MyAccountActivity.K0(socialResponsePojo.getData() != null ? socialResponsePojo.getData().getWhatsAppConsent() : null));
edit.apply();
}
public static void Y(CollapsingToolbarLayout collapsingToolbarLayout) {
new Handler().postDelayed(new v(collapsingToolbarLayout), 500L);
}
public static String Y0(long j2, String str) {
if (TextUtils.isEmpty(str)) {
return BuildConfig.FLAVOR;
}
if ("weeks".equalsIgnoreCase(str)) {
return j2 + " WEEK";
}
if ("months".equalsIgnoreCase(str)) {
return j2 + " MONTH";
}
if ("years".equalsIgnoreCase(str)) {
return j2 + " YEAR";
}
if ("unknown".equalsIgnoreCase(str)) {
return BuildConfig.FLAVOR;
}
return j2 + str;
}
public static boolean Y1() {
return AppController.a0;
}
public static void Y2(Context context, String str) {
SharedPreferences sharedPreferences = context.getSharedPreferences("PollQuizDataSP", 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
String string = sharedPreferences.getString("PollQuizElementId", BuildConfig.FLAVOR);
if (!TextUtils.isEmpty(string)) {
if (string.contains(str)) {
str = string;
} else {
str = string + "," + str;
}
}
edit.putString("PollQuizElementId", str);
edit.apply();
}
public static void Y3(Context context, HashMap<String, SectionPreferences> hashMap) {
if (context == null || hashMap == null || hashMap.isEmpty()) {
return;
}
String k2 = f6.l.k(context, "onboarding_api_response");
if (TextUtils.isEmpty(k2)) {
return;
}
try {
JSONObject jSONObject = new JSONObject(k2);
Gson gson = new Gson();
CheckOnBoardingResponse checkOnBoardingResponse = (CheckOnBoardingResponse) gson.fromJson(jSONObject.toString(), CheckOnBoardingResponse.class);
if (checkOnBoardingResponse != null) {
HashMap<String, SectionPreferences> userPreferences = checkOnBoardingResponse.getUserPreferences();
if (userPreferences == null) {
userPreferences = new HashMap<>();
}
for (Map.Entry<String, SectionPreferences> entry : hashMap.entrySet()) {
String key = entry.getKey();
SectionPreferences value = entry.getValue();
if (userPreferences.containsKey(key)) {
SectionPreferences sectionPreferences = userPreferences.get(key);
if (sectionPreferences != null) {
boolean z2 = true;
sectionPreferences.setSkipped(value != null && value.getSkipped());
if (value == null || !value.isPreferencesSet()) {
z2 = false;
}
sectionPreferences.setPreferencesSet(z2);
} else {
userPreferences.put(key, value);
}
} else {
userPreferences.put(key, value);
}
}
f6.l.m(context, "onboarding_api_response", gson.toJson(checkOnBoardingResponse));
}
} catch (JSONException e2) {
throw new RuntimeException(e2);
}
}
public static void Z(FrameLayout frameLayout) {
frameLayout.getLayoutParams().setBehavior((CoordinatorLayout.Behavior) null);
}
public static String Z0(int i2, PlanInterval planInterval) {
if (planInterval == null) {
return BuildConfig.FLAVOR;
}
String name = planInterval.name();
int i3 = w.a[planInterval.ordinal()];
if (i3 == 1) {
return "Weekly";
}
if (i3 == 2) {
return i2 == 1 ? "Monthly" : i2 == 3 ? "Quarterly" : i2 == 6 ? "Half Yearly" : name;
}
if (i3 != 3) {
return name;
}
if (i2 <= 1) {
return "Yearly";
}
return i2 + " Yearly";
}
public static boolean Z1() {
return AppController.j().E();
}
public static void Z2(List<RetentionModel> list, String str, Context context) {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(context).edit();
edit.putString(str, new Gson().toJson(list));
edit.apply();
}
public static void Z3(Context context, HashMap<String, SectionPreferences> hashMap) {
if (hashMap == null || hashMap.isEmpty()) {
return;
}
String k2 = f6.l.k(context, "onboarding_api_response");
if (TextUtils.isEmpty(k2)) {
return;
}
try {
JSONObject jSONObject = new JSONObject(k2);
Gson gson = new Gson();
CheckOnBoardingResponse checkOnBoardingResponse = (CheckOnBoardingResponse) gson.fromJson(jSONObject.toString(), CheckOnBoardingResponse.class);
if (checkOnBoardingResponse != null) {
HashMap<String, SectionPreferences> userPreferences = checkOnBoardingResponse.getUserPreferences();
if (userPreferences == null) {
userPreferences = new HashMap<>();
}
for (Map.Entry<String, SectionPreferences> entry : hashMap.entrySet()) {
String key = entry.getKey();
SectionPreferences value = entry.getValue();
if (userPreferences.containsKey(key)) {
SectionPreferences sectionPreferences = userPreferences.get(key);
if (sectionPreferences != null) {
boolean z2 = true;
sectionPreferences.setPreferencesSet(value != null && value.isPreferencesSet());
if (value == null || !value.isJourneyCompleted()) {
z2 = false;
}
sectionPreferences.setJourneyCompleted(z2);
} else {
userPreferences.put(key, value);
}
} else {
userPreferences.put(key, value);
}
}
f6.l.m(context, "onboarding_api_response", gson.toJson(checkOnBoardingResponse));
}
} catch (JSONException e2) {
throw new RuntimeException(e2);
}
}
public static int a0(int i2) {
return i2 * (Resources.getSystem().getDisplayMetrics().densityDpi / 160);
}
public static String a1(ZSPlan zSPlan) {
ZSPlanInterval zSPlanInterval = zSPlan.intervalUnit;
String name = zSPlanInterval.name();
if (zSPlanInterval == ZSPlanInterval.Monthly) {
return zSPlan.getInterval() == 3 ? "Quarterly" : zSPlan.getInterval() == 6 ? "Half-Yearly" : name;
}
if (zSPlanInterval != ZSPlanInterval.Yearly || zSPlan.getInterval() <= 1) {
return name;
}
return zSPlan.getInterval() + " Yearly";
}
public static boolean a2(String str) {
Config g2 = AppController.j().g();
String[] paywallPartners = g2 != null ? g2.getPaywallPartners() : null;
return paywallPartners != null && Arrays.asList(paywallPartners).contains(str);
}
public static void a3(Context context, boolean z2, boolean z3, String str) {
f6.l.n(context, "sso_pref_onboarding", "isOnBoardingBackPress", Boolean.valueOf(z2));
f6.l.n(context, "sso_pref_onboarding", "sso_onboarding_type", Boolean.valueOf(z3));
f6.l.n(context, "sso_pref_onboarding", "email_mobile", str + BuildConfig.FLAVOR);
}
public static void a4(Context context, String str, SectionPreferences sectionPreferences) {
if (context == null) {
context = AppController.j();
}
if (context != null) {
String k2 = f6.l.k(context, "onboarding_api_response");
if (TextUtils.isEmpty(k2)) {
return;
}
try {
JSONObject jSONObject = new JSONObject(k2);
Gson gson = new Gson();
CheckOnBoardingResponse checkOnBoardingResponse = (CheckOnBoardingResponse) gson.fromJson(jSONObject.toString(), CheckOnBoardingResponse.class);
if (checkOnBoardingResponse != null) {
HashMap<String, SectionPreferences> userPreferences = checkOnBoardingResponse.getUserPreferences();
if (userPreferences == null) {
userPreferences = new HashMap<>();
}
if (userPreferences.containsKey(str)) {
SectionPreferences sectionPreferences2 = userPreferences.get(str);
if (sectionPreferences2 != null) {
sectionPreferences2.setPreferencesSet(sectionPreferences != null && sectionPreferences.isPreferencesSet());
} else {
userPreferences.put(str, sectionPreferences);
}
} else {
userPreferences.put(str, sectionPreferences);
}
f6.l.m(context, "onboarding_api_response", gson.toJson(checkOnBoardingResponse));
}
} catch (JSONException e2) {
throw new RuntimeException(e2);
}
}
}
public static int b0(int i2) {
Resources system = Resources.getSystem();
if (system == null) {
return 0;
}
return (int) ((i2 * system.getDisplayMetrics().density) + 0.5f);
}
public static String b1(int i2, PlanInterval planInterval) {
if (planInterval == null) {
return BuildConfig.FLAVOR;
}
String name = planInterval.name();
int i3 = w.a[planInterval.ordinal()];
if (i3 == 1) {
return "Weekly";
}
if (i3 == 2) {
return i2 == 1 ? "Monthly" : i2 == 3 ? "Quarterly" : i2 == 6 ? "Half Yearly" : name;
}
if (i3 != 3) {
return name;
}
if (i2 == 2) {
return "bi-annually";
}
if (i2 == 1) {
return "annually";
}
return i2 + " Yearly";
}
public static boolean b2(String str) {
return "Razorpay".equalsIgnoreCase(str) || "Juspay".equalsIgnoreCase(str);
}
public static void b3(Context context, String str, String str2) {
if (context == null || TextUtils.isEmpty(str)) {
return;
}
SharedPreferences.Editor edit = context.getSharedPreferences("campaignDatePref", 0).edit();
edit.putString(str, str2);
edit.apply();
}
public static void b4(Context context, long j2, String str) {
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(context).edit();
edit.putLong(str, j2);
edit.apply();
}
public static void c0(CollapsingToolbarLayout collapsingToolbarLayout) {
AppBarLayout.LayoutParams layoutParams = collapsingToolbarLayout.getLayoutParams();
layoutParams.setScrollFlags(5);
collapsingToolbarLayout.setLayoutParams(layoutParams);
}
public static String c1(MintSubscriptionDetail mintSubscriptionDetail) {
PlanInterval intervalUnit;
if (mintSubscriptionDetail == null || (intervalUnit = mintSubscriptionDetail.getIntervalUnit()) == null) {
return BuildConfig.FLAVOR;
}
return intervalUnit == PlanInterval.months ? mintSubscriptionDetail.getInterval() == 3 ? "Quarterly" : mintSubscriptionDetail.getInterval() == 6 ? "Half Yearly" : "Monthly" : intervalUnit == PlanInterval.years ? "Yearly" : intervalUnit == PlanInterval.weeks ? "Weekly" : intervalUnit.name();
}
public static boolean c2(Context context, String str) {
String string = context.getSharedPreferences("PollQuizDataSP", 0).getString("PollQuizElementId", BuildConfig.FLAVOR);
if (TextUtils.isEmpty(string)) {
return false;
}
return string.contains(str);
}
public static void c3(Context context, String str) {
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
edit.putString("mintsubscriptionobject", str);
edit.putBoolean("syncFail", true);
edit.apply();
}
public static void c4(Context context, MintSubscriptionDetail mintSubscriptionDetail) {
if (mintSubscriptionDetail == null || context == null) {
return;
}
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
if (mintSubscriptionDetail.getStatus() != null) {
edit.putString("subs_status", mintSubscriptionDetail.getStatus().name());
}
if (!TextUtils.isEmpty(mintSubscriptionDetail.getPlanName())) {
edit.putString("zscurrentplan", mintSubscriptionDetail.getPlanName());
}
if (!TextUtils.isEmpty(mintSubscriptionDetail.getPlanCode())) {
edit.putString("zscurrentplanid", mintSubscriptionDetail.getPlanCode());
}
edit.putFloat("zscurrentprice", (float) mintSubscriptionDetail.getAmount());
mintSubscriptionDetail.isSubscriptionActive();
edit.putBoolean("issubscribedmint", true);
edit.putBoolean("isAdFreeUser", mintSubscriptionDetail.isAdFreeUser());
edit.apply();
}
public static void d0(FrameLayout frameLayout) {
frameLayout.getLayoutParams().setBehavior(new AppBarLayout.ScrollingViewBehavior());
}
public static String d1(ZSSuscriptionDetail zSSuscriptionDetail) {
ZSPlanInterval intervalUnit = zSSuscriptionDetail.getIntervalUnit();
String name = intervalUnit.name();
return intervalUnit == ZSPlanInterval.Monthly ? zSSuscriptionDetail.getInterval() == 3 ? "Quarterly" : zSSuscriptionDetail.getInterval() == 6 ? "Half Yearly" : name : name;
}
public static boolean d2(String str, Config config, Content content) {
if (config == null) {
config = AppController.j().g();
}
String[] excludeSectionFromPaywall = config != null ? config.getExcludeSectionFromPaywall() : null;
return excludeSectionFromPaywall != null && Arrays.asList(excludeSectionFromPaywall).contains(str);
}
public static void d3(Context context) {
Config g2 = AppController.j().g();
if ((g2 == null || g2.getSubscription() == null || !g2.getSubscription().isSubscriptionEnable()) ? false : true) {
String G1 = G1(context, "userName");
MintSubscriptionDetail l2 = AppController.j().l();
MintSubscriptionDetail H1 = H1(context);
if (TextUtils.isEmpty(G1) || l2 != null || H1 == null) {
return;
}
AppController.j().V(H1);
}
}
private static final byte[] e0(String str) {
return str.getBytes(x);
}
public static String e1(int i2) {
Calendar calendar = Calendar.getInstance();
calendar.add(1, -i2);
return new SimpleDateFormat("yyyy").format(calendar.getTime());
}
public static boolean e2(Context context, MintSubscriptionDetail mintSubscriptionDetail) {
return G1(context, "userName") != null && mintSubscriptionDetail != null && mintSubscriptionDetail.isSubscriptionActive() && mintSubscriptionDetail.isRenewApplicable();
}
public static void e3(Context context, String str) {
f3(context, str);
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
edit.putString("userCountry", str);
edit.apply();
}
public static void f0(Context context, String str, k6.f fVar) {
String str2;
if (!m0.a(context)) {
Toast.makeText(context, "no network available", 1).show();
return;
}
k6.e eVar = new k6.e(context, fVar, str);
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("type", "Apps");
jSONObject.put("os", "Android");
jSONObject.put("siteId", "LM");
} catch (JSONException e2) {
o0.f(e2);
e2.printStackTrace();
}
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", G1(context, "userToken"));
if (AppController.j() == null || AppController.j().g() == null) {
new k6.r(context, new h(str, eVar, jSONObject, hashMap));
return;
}
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (str.equals("add") || str.equals("addLogin")) {
str2 = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (str.equals("remove")) {
str2 = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str2 = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
eVar.a(1, str, str2, jSONObject, hashMap, false, true);
}
public static List<Table> f1(Context context) {
ArrayList arrayList = new ArrayList();
if (context == null) {
return arrayList;
}
String string = context.getSharedPreferences("RecentlyViewStockPref", 0).getString("RecentlyViewStock", BuildConfig.FLAVOR);
return !TextUtils.isEmpty(string) ? (List) new Gson().fromJson(string, new z().getType()) : arrayList;
}
public static boolean f2(int i2) {
return i2 % 2 != 0;
}
public static void f3(Context context, String str) {
SharedPreferences.Editor edit = context.getSharedPreferences("CommonAppDataSP", 0).edit();
edit.putString("userCountry", str);
edit.apply();
}
public static Author g0(String str, Content content) {
if (content == null || content.getMetadata() == null || content.getMetadata().getAuthorsList() == null || content.getMetadata().getAuthorsList().size() <= 0) {
return null;
}
ArrayList<Author> authorsList = content.getMetadata().getAuthorsList();
int size = authorsList.size();
for (int i2 = 0; i2 < size; i2++) {
Author author = authorsList.get(i2);
if (author != null && !TextUtils.isEmpty(author.getName()) && author.getName().equalsIgnoreCase(str)) {
return author;
}
}
return null;
}
public static HashMap<Integer, String> g1() {
HashMap<Integer, String> hashMap = new HashMap<>();
hashMap.put(1, "retention_d1");
hashMap.put(2, "retention_d2");
hashMap.put(3, "retention_d3");
hashMap.put(4, "retention_d4");
hashMap.put(5, "retention_d5");
hashMap.put(6, "retention_d6");
hashMap.put(7, "retention_d7");
hashMap.put(8, "retention_d8");
hashMap.put(9, "retention_d9");
hashMap.put(10, "retention_d10");
hashMap.put(11, "retention_d11");
hashMap.put(15, "retention_d15");
hashMap.put(20, "retention_d20");
hashMap.put(25, "retention_d25");
hashMap.put(30, "retention_d30");
hashMap.put(60, "retention_d60");
hashMap.put(90, "retention_d90");
hashMap.put(120, "retention_d120");
hashMap.put(150, "retention_d150");
hashMap.put(180, "retention_d180");
return hashMap;
}
public static boolean g2(Context context) {
if (context != null) {
return context.getSharedPreferences("ShowCoachMarkPref", 0).getBoolean("isShowCoachMark", false);
}
return false;
}
public static void g3(Context context, MintSubscriptionDetail mintSubscriptionDetail) {
String json = new Gson().toJson(mintSubscriptionDetail);
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
edit.putString("UserSubscriptionObject", json);
edit.apply();
}
public static void h(Menu menu, String str, Config config, Section section, Context context, BottomNavigationView bottomNavigationView, int i2) {
String displayName;
MenuItem icon;
displayName = section.getDisplayName();
n.add(section.getUrl());
str.hashCode();
switch (str) {
case "foryou_tab":
if (TextUtils.isEmpty(displayName)) {
displayName = "My Mint";
}
icon = menu.add(0, 501, 0, displayName).setIcon(2131233386);
break;
case "foryou_page_analytics":
case "foryou_page":
if (TextUtils.isEmpty(displayName)) {
displayName = "Home";
}
icon = menu.add(0, 101, 0, displayName).setIcon(2131232013);
break;
case "latest":
case "1534506343254":
if (TextUtils.isEmpty(displayName)) {
displayName = "Latest";
}
icon = menu.add(0, 601, 0, displayName).setIcon(2131233384);
break;
case "mymint_tab":
if (TextUtils.isEmpty(displayName)) {
displayName = "My Mint";
}
icon = menu.add(0, 1003, 0, displayName).setIcon(2131233675);
break;
case "mint_shorts":
if (TextUtils.isEmpty(displayName)) {
displayName = "Quick reads";
}
icon = menu.add(0, 1001, 0, displayName).setIcon(2131233523);
break;
case "global_tab":
if (!TextUtils.isEmpty(section.getTabImageId())) {
String tabImageId = section.getTabImageId();
Locale locale = Locale.ENGLISH;
if (!tabImageId.toLowerCase(locale).contains("wsj")) {
if (!section.getTabImageId().toLowerCase(locale).contains("economist")) {
if (!section.getTabImageId().toLowerCase(locale).contains("barron")) {
if (TextUtils.isEmpty(displayName)) {
displayName = "Global";
}
icon = menu.add(0, 901, 0, displayName).setIcon(2131231965);
break;
} else {
if (TextUtils.isEmpty(displayName)) {
displayName = "Global";
}
icon = menu.add(0, 901, 0, displayName).setIcon(2131234269);
break;
}
} else {
if (TextUtils.isEmpty(displayName)) {
displayName = "Global";
}
icon = menu.add(0, 901, 0, displayName).setIcon(2131234270);
break;
}
} else {
if (TextUtils.isEmpty(displayName)) {
displayName = "Global";
}
icon = menu.add(0, 901, 0, displayName).setIcon(2131234378);
break;
}
} else {
if (TextUtils.isEmpty(displayName)) {
displayName = "Global";
}
icon = menu.add(0, 901, 0, displayName).setIcon(2131231965);
break;
}
case "153450634534":
case "my_reads":
if (TextUtils.isEmpty(displayName)) {
displayName = "My Reads";
}
icon = menu.add(0, 301, 0, displayName).setIcon(2131233679);
break;
case "daily_capsule":
if (TextUtils.isEmpty(displayName)) {
displayName = "Daily Capsule";
}
icon = menu.add(0, 1002, 0, displayName).setIcon(2131232309);
break;
case "market_page":
if (TextUtils.isEmpty(displayName)) {
displayName = "Markets";
}
icon = menu.add(0, 401, 0, displayName).setIcon(2131233823);
break;
case "news_page":
if (TextUtils.isEmpty(displayName)) {
displayName = "News";
}
icon = menu.add(0, 201, 0, displayName).setIcon(2131233715);
break;
case "premium_section":
if (TextUtils.isEmpty(displayName)) {
displayName = "Premium";
}
icon = menu.add(0, 801, 0, displayName).setIcon(2131233892);
break;
case "popular_page":
if (TextUtils.isEmpty(displayName)) {
displayName = "Trending";
}
icon = menu.add(0, 701, 0, displayName).setIcon(2131233824);
break;
case "generic_tab":
if (TextUtils.isEmpty(displayName)) {
displayName = TBLEventType.GENERIC;
}
icon = menu.add(0, 1020, 0, displayName).setIcon(2131231771);
break;
case "top_news_tab":
if (TextUtils.isEmpty(displayName)) {
displayName = "Top News";
}
icon = menu.add(0, 1004, 0, displayName).setIcon(2131234285);
break;
case "video_tab":
if (TextUtils.isEmpty(displayName)) {
displayName = "Videos";
}
icon = menu.add(0, 1000, 0, displayName).setIcon(2131234350);
break;
default:
icon = null;
break;
}
if (icon != null) {
View view = new View(context);
view.setTag(!TextUtils.isEmpty(section.getId()) ? section.getId() : BuildConfig.FLAVOR);
icon.setActionView(view);
}
x3(i2, section, AppController.j(), bottomNavigationView);
}
public static int h0(int i2, int i3) {
return ((int) (Math.random() * (i2 - i3))) + i3;
}
public static List<RetentionModel> h1(String str, Context context) {
return (List) new Gson().fromJson(PreferenceManager.getDefaultSharedPreferences(context).getString(str, null), new x().getType());
}
public static boolean h2(String str, Long l2, Activity activity) {
try {
return q0(activity, str).longValue() <= l2.longValue();
} catch (ParseException e2) {
o0.f(e2);
e2.printStackTrace();
return false;
}
}
public static void h3(Context context, boolean z2) {
SharedPreferences.Editor edit = context.getSharedPreferences("LoginData", 0).edit();
edit.putBoolean("userWhatsAppOptin", z2);
edit.apply();
}
public static void i(Context context, BottomNavigationView bottomNavigationView, Config config) {
int i2;
int i3;
bottomNavigationView.getMenu().clear();
n.clear();
Menu menu = bottomNavigationView.getMenu();
ArrayList<ArrayList<String>> arrayList = new ArrayList<>();
String h2 = i2.g().h();
if (!TextUtils.isEmpty(h2)) {
MintSubscriptionDetail l2 = AppController.j().l();
arrayList = l2 != null && l2.isSubscriptionActive() ? k0(h2, "tabBarSub") : k0(h2, "tabBar");
} else if (config != null && config.getBottomItemsUpgradeAndroid() != null && config.getBottomItemsUpgradeAndroid().size() > 0) {
arrayList = config.getBottomItemsUpgradeAndroid();
}
ArrayList<ArrayList<String>> arrayList2 = arrayList;
if (arrayList2 == null || arrayList2.size() <= 0) {
t(menu, bottomNavigationView, config, context);
return;
}
Map<String, Section> p0 = p0(config);
if (p0 == null) {
t(menu, bottomNavigationView, config, context);
return;
}
for (int i4 = 0; i4 < arrayList2.size(); i4++) {
int i5 = 0;
while (true) {
if (i5 >= arrayList2.get(i4).size()) {
break;
}
Section section = p0.get(arrayList2.get(i4).get(i5));
if (section != null) {
int i6 = 304;
if (!"generic_tab".equalsIgnoreCase(section.getId())) {
try {
i2 = Integer.parseInt(section.getAndroidVersion().trim());
} catch (Exception e2) {
e2.printStackTrace();
i2 = 0;
i6 = 0;
}
if (i2 <= i6 && !TextUtils.isEmpty(section.getId())) {
h(menu, section.getId(), config, section, context, bottomNavigationView, i4);
break;
}
} else if (i2.g().b()) {
try {
i3 = Integer.parseInt(section.getAndroidVersion().trim());
} catch (Exception e3) {
e3.printStackTrace();
i3 = 0;
i6 = 0;
}
if (i3 <= i6 && !TextUtils.isEmpty(section.getId())) {
h(menu, section.getId(), config, section, context, bottomNavigationView, i4);
break;
}
} else {
continue;
}
}
i5++;
}
}
}
public static String i0() {
if (OfferBannerSingleton.getInstance().getDeviceEligibilityData() != null) {
return OfferBannerSingleton.getInstance().getDeviceEligibilityData().getAddLiteStartDate();
}
return null;
}
public static String i1(Context context, String str) {
return context.getSharedPreferences("NotificationDatePref", 0).getString(str, null);
}
public static boolean i2(String str, ArrayList<String> arrayList) {
if (arrayList != null && TextUtils.isEmpty(str)) {
Iterator<String> it = arrayList.iterator();
while (it.hasNext()) {
if (P0(str).equals(it.next())) {
return true;
}
}
}
return false;
}
public static void i3(Context context, String str, String str2) {
SharedPreferences.Editor edit = context.getSharedPreferences("NotificationDatePref", 0).edit();
edit.putString(str, str2);
edit.apply();
}
public static HashMap<String, String> j(Context context, HashMap<String, String> hashMap) {
int length;
if (hashMap == null) {
hashMap = new HashMap<>();
}
String str = hashMap.containsKey(TBLEventType.DEFAULT) ? hashMap.get(TBLEventType.DEFAULT) : BuildConfig.FLAVOR;
if (str != null) {
str = str.trim();
}
Log.d("TAG", "addMobileNumber: " + str);
if (TextUtils.isEmpty(str)) {
String G1 = G1(context, "userPhoneNumber");
Log.d("TAG", "addMobileNumber: mobileNumber " + G1);
Log.d("TAG", "addMobileNumber: context " + context);
if (!TextUtils.isEmpty(G1) && (length = G1.length()) >= 10) {
if (length > 10) {
G1 = G1.substring(G1.length() - 10);
}
hashMap.put(TBLEventType.DEFAULT, G1);
}
}
return hashMap;
}
public static List<String> j0(String str, Context context) {
if (context == null || TextUtils.isEmpty(str)) {
return new ArrayList();
}
return (List) new Gson().fromJson(PreferenceManager.getDefaultSharedPreferences(context).getString(str, null), new t().getType());
}
public static int j1(Context context) {
Display defaultDisplay = ((WindowManager) context.getSystemService("window")).getDefaultDisplay();
Point point = new Point();
defaultDisplay.getSize(point);
return point.y;
}
public static boolean j2(String str, ArrayList<String> arrayList) {
if (arrayList != null && str != null) {
Iterator<String> it = arrayList.iterator();
while (it.hasNext()) {
if (str.contains(it.next())) {
return true;
}
}
}
return false;
}
public static void j3(Activity activity, String str, String str2, String str3) {
Intent intent = new Intent("android.intent.action.SENDTO");
intent.setData(Uri.parse("mailto:"));
intent.putExtra("android.intent.extra.EMAIL", new String[]{str});
intent.putExtra("android.intent.extra.SUBJECT", str2);
intent.putExtra("android.intent.extra.TEXT", str3);
try {
activity.startActivity(Intent.createChooser(intent, "Share"));
} catch (Exception e2) {
e2.printStackTrace();
Toast.makeText(activity, activity.getString(2131952025), 0).show();
}
}
public static void k(Context context, Table table) {
if (context != null) {
SharedPreferences.Editor edit = context.getSharedPreferences("RecentlyViewStockPref", 0).edit();
List<Table> f1 = f1(context);
if (f1.size() > 0) {
int i2 = 0;
while (true) {
if (i2 >= f1.size()) {
break;
}
if (f1.get(i2).getIndexCode().equalsIgnoreCase(table.getIndexCode())) {
f1.remove(i2);
break;
}
i2++;
}
if (f1.size() > 3) {
f1.remove(0);
}
}
f1.add(table);
edit.putString("RecentlyViewStock", new Gson().toJson(f1));
edit.apply();
}
}
public static ArrayList<ArrayList<String>> k0(String str, String str2) {
ArrayList<ArrayList<String>> arrayList = new ArrayList<>();
try {
JsonObject asJsonObject = JsonParser.parseString(str).getAsJsonObject();
if (asJsonObject != null) {
return asJsonObject.size() > 0 ? (ArrayList) new Gson().fromJson(asJsonObject.get(str2), new p().getType()) : arrayList;
}
return arrayList;
} catch (Exception e2) {
e2.printStackTrace();
return arrayList;
}
}
public static String k1(String str, String str2) {
return str;
}
public static boolean k2(String str, List<String> list) {
if ((TextUtils.isEmpty(str) || !str.contains("/credit-score") || str.contains(".html")) && !TextUtils.isEmpty(str) && list != null && !list.isEmpty()) {
for (String str2 : list) {
if (!TextUtils.isEmpty(str2) && str.toLowerCase().trim().contains(str2.toLowerCase().trim())) {
return true;
}
}
}
return false;
}
public static void k3(Context context, String str, String str2) {
String str3;
if (str != null) {
if (str.equalsIgnoreCase("MARKET")) {
str3 = (context.getString(2131952182) + "-" + context.getString(2131952186)).toLowerCase();
} else if (str.equalsIgnoreCase("MUTUAL_FUNDS")) {
str3 = (context.getString(2131952182) + "-" + context.getString(2131952266)).toLowerCase();
} else if (str.equalsIgnoreCase("STOCKS")) {
str3 = (context.getString(2131952182) + "-" + context.getString(2131952569)).toLowerCase();
} else {
str3 = BuildConfig.FLAVOR;
}
com.htmedia.mint.utils.n.P(context, com.htmedia.mint.utils.n.I2, "market/market_dashboard", "market/market_dashboard", null, str2, str3, BuildConfig.FLAVOR, com.htmedia.mint.utils.n.M);
}
}
public static void l(String str, Context context, String str2, ImageView imageView, ImageView imageView2) {
String str3;
if (!m0.a(context)) {
Toast.makeText(context, "no network available", 1).show();
return;
}
k6.e eVar = new k6.e(context, new c(str2, str, context, imageView, imageView2), str2);
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("storyId", str);
} catch (JSONException e2) {
o0.f(e2);
e2.printStackTrace();
}
}
jSONObject.put("type", "Apps");
jSONObject.put("os", "Android");
jSONObject.put("siteId", "LM");
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", G1(context, "userToken"));
if (AppController.j() == null || AppController.j().g() == null) {
new k6.r(context, new d(str2, eVar, jSONObject, hashMap));
return;
}
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (str2.equals("add") || str2.equals("addLogin")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (str2.equals("remove")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
eVar.a(1, str2, str3, jSONObject, hashMap, false, true);
}
public static Section l0(Config config, String str) {
for (Section section : config.getOthers()) {
if (section.getId().equalsIgnoreCase(com.htmedia.mint.utils.q.d[12])) {
section.setDisplayName(str);
return section;
}
}
return null;
}
public static String l1(String str, String str2) {
String replace = str.replace(' ', '-');
StringBuilder sb2 = new StringBuilder("/");
if (str.equalsIgnoreCase("Top News")) {
Log.i("Zax ", sb2.toString());
return sb2.toString();
}
if (str2 != null && !str2.isEmpty()) {
sb2.append(str2.replace(' ', '-'));
sb2.append("/");
}
sb2.append(replace);
return sb2.toString();
}
private static boolean l2(MintSubscriptionDetail mintSubscriptionDetail) {
return (mintSubscriptionDetail == null || TextUtils.isEmpty(mintSubscriptionDetail.getNextBillingDate())) ? false : true;
}
public static void l3(Context context, Content content) {
m3(context, content, null);
}
public static void m(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, int i2, boolean z3, boolean z4, boolean z5) {
String sb2;
if (!m0.a(context)) {
Toast.makeText(context, "Network not available", 1).show();
return;
}
c = new q1(context);
k6.e eVar = new k6.e(context, new a0(str, context, z2, arrayList, content, d3Var, i2, z3, z5, z4, str2, imageView, imageView2, adapter), str2);
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("storyId", str);
} catch (JSONException e2) {
e2.printStackTrace();
o0.f(e2);
}
}
jSONObject.put("type", "Apps");
jSONObject.put("os", "Android");
jSONObject.put("siteId", "LM");
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", G1(context, "userToken"));
if (AppController.j() == null || AppController.j().g() == null) {
new k6.r(context, new b0(str2, eVar, jSONObject, hashMap));
return;
}
Config g2 = AppController.j() != null ? AppController.j().g() : null;
if (g2 == null || g2.getBookmark() == null) {
return;
}
SSO sso = g2.getSso();
String str3 = BuildConfig.FLAVOR;
String ssoBaseUrl = (sso == null || TextUtils.isEmpty(g2.getSso().getSsoBaseUrl())) ? BuildConfig.FLAVOR : g2.getSso().getSsoBaseUrl();
if (str2.equals("add") || str2.equals("addLogin")) {
StringBuilder sb3 = new StringBuilder();
sb3.append(ssoBaseUrl);
if (!TextUtils.isEmpty(g2.getBookmark().getAddBookmark())) {
str3 = g2.getBookmark().getAddBookmark();
}
sb3.append(str3);
sb2 = sb3.toString();
} else if (str2.equals("remove")) {
StringBuilder sb4 = new StringBuilder();
sb4.append(ssoBaseUrl);
if (!TextUtils.isEmpty(g2.getBookmark().getRemoveBookmark())) {
str3 = g2.getBookmark().getRemoveBookmark();
}
sb4.append(str3);
sb2 = sb4.toString();
} else {
StringBuilder sb5 = new StringBuilder();
sb5.append(ssoBaseUrl);
if (!TextUtils.isEmpty(g2.getBookmark().getGetAllIds())) {
str3 = g2.getBookmark().getGetAllIds();
}
sb5.append(str3);
sb2 = sb5.toString();
}
eVar.a(1, str2, sb2, jSONObject, hashMap, false, true);
}
public static String m0() {
String str = "Basic " + Base64.encodeToString(String.format("%s:%s", "LiveMint", "Live@Hindust@n$").getBytes(), 0);
o1.a("Auth Header", str);
return str;
}
public static int m1(Context context) {
Display defaultDisplay = ((WindowManager) context.getSystemService("window")).getDefaultDisplay();
Point point = new Point();
defaultDisplay.getSize(point);
return point.x;
}
public static boolean m2(Context context, MintSubscriptionDetail mintSubscriptionDetail) {
if (G1(context, "userName") != null && p2(mintSubscriptionDetail) && !l2(mintSubscriptionDetail)) {
if (b2(mintSubscriptionDetail != null ? mintSubscriptionDetail.getPaymentSource() : BuildConfig.FLAVOR)) {
return true;
}
}
return false;
}
public static void m3(Context context, Content content, ArrayList<Content> arrayList) {
u7.q.J(content, context);
Intent intent = new Intent(context, (Class<?>) VideoDetailActivity.class);
Bundle bundle = new Bundle();
bundle.putParcelable("video_content", content);
if (arrayList != null) {
bundle.putParcelableArrayList("video_content_list", arrayList);
}
intent.putExtra("content", bundle);
context.startActivity(intent);
}
public static void n(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, boolean z3) {
m(str, context, str2, imageView, imageView2, adapter, z2, arrayList, content, d3Var, 0, false, z3, false);
}
public static int n0(String str, TextView textView) {
textView.setVisibility(0);
str.hashCode();
switch (str) {
case "Moderately Bearish":
textView.setTextColor(ContextCompat.getColor(textView.getContext(), 2131099881));
return 2131232293;
case "Bearish":
textView.setTextColor(ContextCompat.getColor(textView.getContext(), 2131100966));
return 2131233015;
case "Moderately Bullish":
textView.setTextColor(ContextCompat.getColor(textView.getContext(), 2131099941));
return 2131232324;
case "Bullish":
textView.setTextColor(ContextCompat.getColor(textView.getContext(), 2131100967));
return 2131233016;
default:
textView.setVisibility(8);
return 0;
}
}
public static String n1(int i2) {
int i3 = i2 % 5;
int i4 = i2 / 5;
if (i3 == 0) {
i4--;
}
int i5 = i4 * 5;
return "[" + (i5 + 1) + "-" + (i5 + 5) + "]";
}
public static boolean n2(Context context) {
if (context != null) {
return !TextUtils.isEmpty(G1(context, "userName"));
}
return false;
}
public static void n3(LinearLayout linearLayout, Context context) {
TaboolaModel taboola = AppController.j().g().getAdsAndroidNew().getTaboola();
if (taboola != null) {
TBLClassicUnit build = Taboola.getClassicPage(taboola.getPageUrl(), taboola.getAsset2().getType()).build(context, taboola.getAsset2().getPlacement(), taboola.getAsset2().getMode(), 0, new r());
build.setTargetType("mix");
linearLayout.addView(build);
build.fetchContent();
}
}
public static void o(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, boolean z3, boolean z4) {
m(str, context, str2, imageView, imageView2, adapter, z2, arrayList, content, d3Var, 0, false, z3, z4);
}
public static boolean o0(Context context) {
PianoResponse pianoResponse;
MobilePaywall mobilePaywall;
PaywallTypes unlockArticleTemplate;
if (PianoResponseSingleTon.getInstance().getPianoResponse() != null && (pianoResponse = PianoResponseSingleTon.getInstance().getPianoResponse()) != null && pianoResponse.getMobilePaywall() != null && (mobilePaywall = pianoResponse.getMobilePaywall()) != null && mobilePaywall.getUnlockArticleTemplate() != null && (unlockArticleTemplate = mobilePaywall.getUnlockArticleTemplate()) != null && unlockArticleTemplate.getItems() != null) {
Items items = unlockArticleTemplate.getItems() != null ? unlockArticleTemplate.getItems() : new Items();
if (AppController.j().o() != null && AppController.j().o().getPartners() != null && AppController.j().o().getPartners().getPiano() != null && AppController.j().o().getPartners().getPianoNonLogin() != null) {
PianoUnlockArticle piano = AppController.j().o().getPartners().getPiano();
PianoNonLogin pianoNonLogin = AppController.j().o().getPartners().getPianoNonLogin();
if (items != null && (piano.getBalance() > 0 || pianoNonLogin.getBalance() > 0)) {
boolean z2 = G1(context, "userName") != null;
int limit = (z2 ? piano.getLimit() : pianoNonLogin.getLimit()) - (z2 ? piano.getBalance() : pianoNonLogin.getBalance());
int loggedInUnlockArticleLimit = z2 ? items.getLoggedInUnlockArticleLimit() : items.getNonLoggedInUnlockArticleLimit();
if (!z2 && limit <= loggedInUnlockArticleLimit) {
return true;
}
if (z2 && limit < loggedInUnlockArticleLimit) {
return true;
}
}
}
}
return false;
}
public static int o1(long j2, long j3) {
return (int) ((new Date(j3).getTime() - new Date(j2).getTime()) / 1000);
}
public static boolean o2(CharSequence charSequence) {
return !TextUtils.isEmpty(charSequence) && Patterns.EMAIL_ADDRESS.matcher(charSequence).matches();
}
public static void o3(LinearLayout linearLayout, Context context) {
if (linearLayout == null || context == null) {
return;
}
linearLayout.removeAllViews();
TaboolaModel taboola = (AppController.j() == null || AppController.j().g() == null || AppController.j().g().getAdsAndroidNew() == null) ? null : AppController.j().g().getAdsAndroidNew().getTaboola();
if (taboola != null) {
TBLClassicUnit build = Taboola.getClassicPage(taboola.getPageUrl(), taboola.getAsset1().getType()).build(context, taboola.getAsset1().getPlacement(), taboola.getAsset1().getMode(), 0, new s());
build.setTargetType("mix");
linearLayout.addView(build);
build.fetchContent();
}
}
public static void p(String str, Context context, String str2, MenuItem menuItem, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, boolean z3) {
String str3;
if (!m0.a(context)) {
Toast.makeText(context, "Network not available", 1).show();
return;
}
c = new q1(context);
k6.e eVar = new k6.e(context, new a(str, context, adapter, z2, arrayList, content, d3Var, str2, menuItem, z3), str2);
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("storyId", str);
} catch (JSONException e2) {
e2.printStackTrace();
o0.f(e2);
}
}
jSONObject.put("type", "Apps");
jSONObject.put("os", "Android");
jSONObject.put("siteId", "LM");
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", G1(context, "userToken"));
if (AppController.j() == null || AppController.j().g() == null) {
new k6.r(context, new b(str2, eVar, jSONObject, hashMap));
return;
}
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (str2.equals("add") || str2.equals("addLogin")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (str2.equals("remove")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
eVar.a(1, str2, str3, jSONObject, hashMap, false, true);
}
public static Map<String, Section> p0(Config config) {
HashMap hashMap = new HashMap();
if (config.getBottomNav() != null && config.getBottomNav().size() > 0) {
for (int i2 = 0; i2 < config.getBottomNav().size(); i2++) {
hashMap.put(config.getBottomNav().get(i2).getId(), config.getBottomNav().get(i2));
}
}
return hashMap;
}
public static Section p1(String str, Config config, Context context) {
if (config == null || config.getBottomNav() == null || config.getBottomNav().size() <= 0) {
return null;
}
for (int i2 = 0; i2 < config.getBottomNav().size(); i2++) {
if (config.getBottomNav().get(i2).getId() != null && config.getBottomNav().get(i2).getId().equals(str)) {
Section section = config.getBottomNav().get(i2);
Section section2 = new Section();
try {
section2 = (Section) section.clone();
} catch (CloneNotSupportedException e2) {
e2.printStackTrace();
}
if (section2 != null && !TextUtils.isEmpty(section2.getUrl()) && section2.getUrl().contains("personalize")) {
String G1 = G1(context, "userName") != null ? G1(context, "userClient") : f6.d.b(context);
section2.setUrl(section2.getUrl().contains("?") ? section2.getUrl() + "htfpId=" + G1 + "&propertyId=lm&platformId=app&numStories=40" : section2.getUrl() + "?htfpId=" + G1 + "&propertyId=lm&platformId=app&numStories=40");
}
return section2;
}
}
return null;
}
public static boolean p2(MintSubscriptionDetail mintSubscriptionDetail) {
return mintSubscriptionDetail != null && mintSubscriptionDetail.isSubscriptionActive() && mintSubscriptionDetail.getSource() != null && mintSubscriptionDetail.getSource() == SubscriptionSource.app;
}
public static void p3(Context context, boolean z2) {
if (context != null) {
SharedPreferences.Editor edit = context.getSharedPreferences("AdsDatePref", 0).edit();
edit.putBoolean("adFree", z2);
edit.apply();
}
}
public static void q(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, int i2, boolean z3, boolean z4, boolean z5) {
String str3;
if (!m0.a(context)) {
Toast.makeText(context, "Network not available", 1).show();
return;
}
c = new q1(context);
k6.e eVar = new k6.e(context, new c0(str, context, z2, arrayList, content, d3Var, i2, z3, z5, z4, str2, imageView, imageView2, adapter), str2);
JSONObject jSONObject = new JSONObject();
if (str != null) {
try {
jSONObject.put("storyId", str);
} catch (JSONException e2) {
e2.printStackTrace();
o0.f(e2);
}
}
jSONObject.put("type", "Apps");
jSONObject.put("os", "Android");
jSONObject.put("siteId", "LM");
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("Authorization", G1(context, "userToken"));
if (AppController.j() == null || AppController.j().g() == null) {
new k6.r(context, new d0(str2, eVar, jSONObject, hashMap));
return;
}
String ssoBaseUrl = AppController.j().g().getSso().getSsoBaseUrl();
if (str2.equals("add") || str2.equals("addLogin")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getAddBookmark();
} else if (str2.equals("remove")) {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getRemoveBookmark();
} else {
str3 = ssoBaseUrl + AppController.j().g().getBookmark().getGetAllIds();
}
eVar.a(1, str2, str3, jSONObject, hashMap, false, true);
}
public static Long q0(Activity activity, String str) throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'+'SSSS");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
long time = simpleDateFormat.parse(str).getTime();
o1.a("Epoch Time", time + BuildConfig.FLAVOR);
return Long.valueOf(time);
}
public static String q1(String str, Config config, Context context) {
Section p1 = p1(str, config, context);
return (p1 == null || p1.getUrl() == null) ? BuildConfig.FLAVOR : p1.getUrl();
}
public static boolean q2(String str) {
return !TextUtils.isEmpty(str) && str.equalsIgnoreCase(SubscriptionConverter.PLAN_CATEGORY.WSJ.getPlanCategory());
}
public static void q3(ImageView imageView, boolean z2, int i2, int i3, int i4, int i5) {
if (imageView == null) {
return;
}
boolean z3 = AppController.j() != null && AppController.j().E();
if (z2) {
if (z3) {
imageView.setImageResource(i2);
return;
} else {
imageView.setImageResource(i3);
return;
}
}
if (z3) {
imageView.setImageResource(i4);
} else {
imageView.setImageResource(i5);
}
}
public static void r(String str, Context context, String str2, ImageView imageView, ImageView imageView2, RecyclerView.Adapter adapter, boolean z2, ArrayList<Content> arrayList, Content content, d3 d3Var, boolean z3, boolean z4) {
q(str, context, str2, imageView, imageView2, adapter, z2, arrayList, content, d3Var, 0, false, z3, z4);
}
public static Config r0() {
return AppController.j().g();
}
public static long r1() {
return a;
}
public static void r2() {
AppController.j().N(false);
}
public static void r3() {
AppController.d0 = true;
}
public static void s(Context context, Intent intent) {
}
private static void s0(Context context) {
if (context == null || !(context instanceof HomeActivity)) {
return;
}
new k6.r(context, new q(context)).e(0, "Config Update", "https://images.livemint.com/apps/v3/deviceconfig.json", false, true);
}
public static String s1(Context context, String str) {
return (context == null || TextUtils.isEmpty(str)) ? "Organic" : context.getSharedPreferences("campaignDatePref", 0).getString(str, "Organic");
}
public static Author s2(Author author) {
return author;
}
public static void s3(boolean z2) {
AppController.j().S(z2);
}
public static void t(Menu menu, BottomNavigationView bottomNavigationView, Config config, Context context) {
s0(context);
menu.add(0, 101, 0, "Home").setIcon(2131232013);
n.add(q1("foryou_page_analytics", config, context));
menu.add(0, 201, 0, "News").setIcon(2131233386);
n.add(q1("news_page", config, context));
menu.add(0, 301, 0, "Premium").setIcon(2131233892);
menu.add(0, 401, 0, "Markets").setIcon(2131233823);
menu.add(0, 501, 0, "My Mint").setIcon(2131233386);
if (config == null || !config.isShowPremiumSection()) {
n.add(q1("153450634534", config, context));
} else {
MenuItem findItem = bottomNavigationView.getMenu().findItem(301);
if (findItem != null) {
findItem.setIcon(ContextCompat.getDrawable(context, 2131233892));
findItem.setTitle("Premium");
}
n.add(q1("premium_section", config, context));
}
n.add(q1("market_page", config, context));
n.add(q1("foryou_tab", config, context));
E3(context, menu);
}
public static ArrayList<Content> t0(int i2) {
ArrayList<Content> g2 = AppController.O.g();
if (g2.size() < i2) {
return g2;
}
ArrayList<Content> arrayList = new ArrayList<>();
for (int i3 = 0; i3 < i2; i3++) {
arrayList.add(g2.get(i3));
}
return arrayList;
}
public static String t1() {
return "---From Live Mint (Android) App\n App version: 5.7.3\n OS: Android " + Build.VERSION.RELEASE + "\n Device Maker: " + A0() + " \n";
}
public static Author t2(Author author, Author author2) {
return author;
}
public static void t3(Content content, ImageView imageView, ImageView imageView2, Context context, Activity activity, String str) {
String str2 = content.getId() + BuildConfig.FLAVOR;
if (AppController.O.a(str2)) {
if (imageView != null) {
imageView.setImageResource(2131232312);
}
if (imageView2 != null) {
imageView2.setImageResource(2131232312);
}
} else {
if (imageView != null) {
imageView.setImageResource(2131232316);
}
if (imageView2 != null) {
imageView2.setImageResource(2131232316);
}
}
if (imageView != null) {
imageView.setOnClickListener(new k(context, str, content, str2, imageView, imageView2, activity));
}
if (imageView2 != null) {
imageView2.setOnClickListener(new l(context, str, content, str2, imageView, imageView2, activity));
}
}
public static void u(TextView textView, String str, String str2, int i2, Context context, String str3) {
try {
textView.post(new o(textView, str, str2, context, str3));
} catch (Exception e2) {
e2.printStackTrace();
}
}
public static String u0(String str) {
if (TextUtils.isEmpty(str)) {
return BuildConfig.FLAVOR;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(str, Locale.ENGLISH);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
return simpleDateFormat.format(Calendar.getInstance().getTime());
}
public static String u1() {
return "\n App version: 5.7.3\n OS: Android " + Build.VERSION.RELEASE + "\n Device Maker: " + A0() + " \n Source: feedback for internal rating less than 4 \n";
}
public static ArrayList u2(Map map) {
return new ArrayList(map.values());
}
public static void u3(int i2) {
t = i2;
}
public static String v(String str, Context context) {
if (TextUtils.isEmpty(str)) {
return str;
}
try {
Uri parse = Uri.parse(str);
Set<String> queryParameterNames = parse.getQueryParameterNames();
HashMap hashMap = new HashMap();
if (queryParameterNames != null && !queryParameterNames.isEmpty()) {
for (String str2 : queryParameterNames) {
if (!TextUtils.isEmpty(parse.getQueryParameter(str2))) {
hashMap.put(str2, parse.getQueryParameter(str2));
}
}
}
hashMap.put(Labels.Android.WEBVIEW, "true");
String G1 = G1(context, "userToken");
if (!TextUtils.isEmpty(G1)) {
hashMap.put("token", G1);
}
String G12 = G1(context, "userClient");
if (!TextUtils.isEmpty(G12)) {
hashMap.put(PaymentConstants.CLIENT_ID, G12);
}
if (j1.b0(true, true, str)) {
j(context, hashMap);
if (!TextUtils.isEmpty(f6.d.b(context))) {
hashMap.put("deviceId", f6.d.b(context));
}
}
Uri.Builder buildUpon = parse.buildUpon();
if (!hashMap.isEmpty()) {
buildUpon = buildUpon.clearQuery();
for (String str3 : hashMap.keySet()) {
String str4 = (String) hashMap.get(str3);
if (!TextUtils.isEmpty(str4)) {
buildUpon.appendQueryParameter(str3, str4);
}
}
}
return buildUpon.build().toString();
} catch (Exception unused) {
return str;
}
}
public static String v0() {
Calendar calendar = Calendar.getInstance();
calendar.get(7);
return new SimpleDateFormat("EEEE", Locale.getDefault()).format(calendar.getTime());
}
public static long v1() {
return l;
}
public static void v3(int i2) {
u = i2;
}
public static String w(String str, Context context, String str2, String str3) {
if (TextUtils.isEmpty(str)) {
return str;
}
try {
Uri parse = Uri.parse(str);
Set<String> queryParameterNames = parse.getQueryParameterNames();
HashMap hashMap = new HashMap();
if (queryParameterNames != null && !queryParameterNames.isEmpty()) {
for (String str4 : queryParameterNames) {
if (!TextUtils.isEmpty(parse.getQueryParameter(str4))) {
hashMap.put(str4, parse.getQueryParameter(str4));
}
}
}
hashMap.put(Labels.Android.WEBVIEW, "true");
if (!TextUtils.isEmpty(str2)) {
hashMap.put("token", str2);
}
if (!TextUtils.isEmpty(str3)) {
hashMap.put(PaymentConstants.CLIENT_ID, str3);
}
j(context, hashMap);
hashMap.put("deviceId", f6.d.b(context));
hashMap.put("cta_position", "lmapp_webview");
Uri.Builder buildUpon = parse.buildUpon();
if (!hashMap.isEmpty()) {
buildUpon = buildUpon.clearQuery();
for (String str5 : hashMap.keySet()) {
String str6 = (String) hashMap.get(str5);
if (!TextUtils.isEmpty(str6)) {
buildUpon.appendQueryParameter(str5, str6);
}
}
}
return buildUpon.build().toString();
} catch (Exception unused) {
return str;
}
}
public static EstimatePojo w0(Measure measure) {
ArrayList<String> arrayList = new ArrayList<>();
ArrayList<Float> arrayList2 = new ArrayList<>();
ArrayList<Float> arrayList3 = new ArrayList<>();
if (measure != null && measure.getPeriods() != null && measure.getPeriods().getPeriod() != null && measure.getPeriods().getPeriod().size() > 0) {
List<Period> period = measure.getPeriods().getPeriod();
for (int i2 = 0; i2 < period.size(); i2++) {
if (period.get(i2) != null && period.get(i2).getRelativePeriod() != null && !TextUtils.isEmpty(period.get(i2).getRelativePeriod().getType()) && period.get(i2).getRelativePeriod().getType().equalsIgnoreCase("Annual") && period.get(i2).getFiscalPeriod() != null && !TextUtils.isEmpty(period.get(i2).getFiscalPeriod().getType()) && period.get(i2).getFiscalPeriod().getType().equalsIgnoreCase("FY")) {
StringBuilder sb2 = new StringBuilder();
sb2.append(V0(period.get(i2).getCalendarMonth()));
sb2.append("-");
sb2.append((period.get(i2).getCalendarYear() + BuildConfig.FLAVOR).substring(2, 4));
arrayList.add(sb2.toString());
StringBuilder sb3 = new StringBuilder();
sb3.append(V0(period.get(i2).getCalendarMonth()));
sb3.append("-");
sb3.append((period.get(i2).getCalendarYear() + BuildConfig.FLAVOR).substring(2, 4));
Log.e("getDataForMiniStockEstimates: ", sb3.toString());
if (period.get(i2).getActuals() != null && period.get(i2).getActuals().getActuals() != null && period.get(i2).getActuals().getActuals().size() > 0) {
arrayList2.add(Float.valueOf(period.get(i2).getActuals().getActuals().get(0).getReported()));
double calculatedEstimate = period.get(i2).getActuals().getActuals().get(0).getCalculatedEstimate();
arrayList3.add(Float.valueOf((float) calculatedEstimate));
Log.e("getDataForMiniStockEstimates: ", "actuals" + period.get(i2).getActuals().getActuals().get(0).getReported());
Log.e("getDataForMiniStockEstimates: ", "estimates" + calculatedEstimate);
}
if (period.get(i2).getEstimates() != null && period.get(i2).getEstimates().getEstimate() != null && period.get(i2).getEstimates().getEstimate().size() > 0) {
arrayList3.add(R(period.get(i2).getEstimates().getEstimate().get(0).getMean()));
Log.e("getDataForMiniStockEstimates: ", "estimates" + R(period.get(i2).getEstimates().getEstimate().get(0).getMean()));
}
}
}
}
EstimatePojo estimatePojo = new EstimatePojo();
estimatePojo.setEstimates(arrayList3);
estimatePojo.setActuals(arrayList2);
estimatePojo.setYears(arrayList);
return estimatePojo;
}
public static Section w1(Config config) {
for (Section section : config.getOthers()) {
if (section.getId().equalsIgnoreCase(com.htmedia.mint.utils.q.d[6])) {
return section;
}
}
return null;
}
public static Bitmap w2(View view) {
Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
view.draw(new Canvas(createBitmap));
return createBitmap;
}
public static void w3(Context context, String str, boolean z2) {
if (context != null) {
context.getSharedPreferences("LoginData", 0).edit().putBoolean(str, z2);
}
}
public static void x(Context context, k6.g gVar, String str) {
String k2 = f6.l.k(context, "deviceId");
if (str == null) {
str = "http://api-gateway.dev.hindustantimes.com/api/adserve/lm?user=";
}
String str2 = str + k2;
o1.a("CDP target url URL", str2);
gVar.b(str2);
}
public static EstimatePojo x0(com.htmedia.mint.pojo.mintstockwidgetnew.Measure measure) {
ArrayList<String> arrayList = new ArrayList<>();
ArrayList<Float> arrayList2 = new ArrayList<>();
ArrayList<Float> arrayList3 = new ArrayList<>();
if (measure != null && measure.getPeriods() != null && measure.getPeriods().getPeriod() != null && measure.getPeriods().getPeriod().size() > 0) {
List<com.htmedia.mint.pojo.mintstockwidgetnew.Period> period = measure.getPeriods().getPeriod();
for (int i2 = 0; i2 < period.size(); i2++) {
if (period.get(i2) != null && period.get(i2).getRelativePeriod() != null && !TextUtils.isEmpty(period.get(i2).getRelativePeriod().getType()) && period.get(i2).getRelativePeriod().getType().equalsIgnoreCase("Annual") && period.get(i2).getFiscalPeriod() != null && !TextUtils.isEmpty(period.get(i2).getFiscalPeriod().getType()) && period.get(i2).getFiscalPeriod().getType().equalsIgnoreCase("FY")) {
StringBuilder sb2 = new StringBuilder();
sb2.append(V0(period.get(i2).getCalendarMonth()));
sb2.append("-");
sb2.append((period.get(i2).getCalendarYear() + BuildConfig.FLAVOR).substring(2, 4));
arrayList.add(sb2.toString());
StringBuilder sb3 = new StringBuilder();
sb3.append(V0(period.get(i2).getCalendarMonth()));
sb3.append("-");
sb3.append((period.get(i2).getCalendarYear() + BuildConfig.FLAVOR).substring(2, 4));
Log.e("getDataForMiniStockEstimates: ", sb3.toString());
if (period.get(i2).getActuals() != null && period.get(i2).getActuals().getActuals() != null && period.get(i2).getActuals().getActuals().size() > 0) {
arrayList2.add(Float.valueOf(period.get(i2).getActuals().getActuals().get(0).getReported()));
double calculatedEstimate = period.get(i2).getActuals().getActuals().get(0).getCalculatedEstimate();
arrayList3.add(Float.valueOf((float) calculatedEstimate));
Log.e("getDataForMiniStockEstimates: ", "actuals" + period.get(i2).getActuals().getActuals().get(0).getReported());
Log.e("getDataForMiniStockEstimates: ", "estimates" + calculatedEstimate);
} else if (period.get(i2).getEstimates() != null && period.get(i2).getEstimates().getEstimate() != null && period.get(i2).getEstimates().getEstimate().size() > 0) {
arrayList3.add(R(period.get(i2).getEstimates().getEstimate().get(0).getMean()));
Log.e("getDataForMiniStockEstimates: ", "estimates" + R(period.get(i2).getEstimates().getEstimate().get(0).getMean()));
}
}
}
}
EstimatePojo estimatePojo = new EstimatePojo();
estimatePojo.setEstimates(arrayList3);
estimatePojo.setActuals(arrayList2);
estimatePojo.setYears(arrayList);
return estimatePojo;
}
public static String x1(Card card) {
return (card == null || card.getStory() == null || TextUtils.isEmpty(card.getStory().getMobileHeadline())) ? BuildConfig.FLAVOR : Html.fromHtml(card.getStory().getMobileHeadline()).toString();
}
public static void x2(Context context, String str, ImageView imageView, int i2) {
if (context == null || imageView == null) {
return;
}
if (TextUtils.isEmpty(str)) {
imageView.setImageResource(i2);
return;
}
try {
Glide.u(context).j(str).R(i2).g(i2).q0(imageView);
} catch (Exception e2) {
Log.e("CommonMethods", "Error loading image: " + e2.getMessage());
imageView.setImageResource(i2);
}
}
private static void x3(int i2, Section section, Context context, BottomNavigationView bottomNavigationView) {
if (section == null || bottomNavigationView == null || i2 >= bottomNavigationView.getMenu().size()) {
return;
}
String androidBadgeText = section.getAndroidBadgeText();
if (TextUtils.isEmpty(androidBadgeText)) {
return;
}
TextView textView = (TextView) LayoutInflater.from(context).inflate(2131625144, (ViewGroup) bottomNavigationView.getChildAt(0).getChildAt(i2), true).findViewById(2131431329);
textView.setText(androidBadgeText);
textView.setAlpha(0.92f);
}
public static void y(String str, k6.t tVar, String str2) {
if (TextUtils.isEmpty(str)) {
str = "https://www.livemint.com";
}
if (TextUtils.isEmpty(str2)) {
return;
}
String str3 = str2 + str;
o1.a("TAG URL", str3);
tVar.b(str3);
}
public static int y0(long j2, long j3) {
return (int) ((new Date(j3).getTime() - new Date(j2).getTime()) / 86400000);
}
public static String y1(String str, long j2) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
if (str == null || str.isEmpty()) {
return BuildConfig.FLAVOR;
}
Date parse = simpleDateFormat.parse(str);
return (simpleDateFormat2.format(parse).equalsIgnoreCase(simpleDateFormat2.format(new Date())) ? new SimpleDateFormat("hh:mm a 'IST'") : new SimpleDateFormat("dd MMM yyyy")).format(parse);
} catch (Exception e2) {
o0.f(e2);
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static void y2(Context context) {
y5.o.a.b(context);
b6.b.a.b();
W3(context, "mintgenieUserID", BuildConfig.FLAVOR);
if (CheckSubscriptionFromLocal.isSubscribedUser(context)) {
K("l1_menu_order", context);
HomeTabViewFragment.INSTANCE.setFromFilterMenu(true);
}
AppController.O.d();
L(context);
g = false;
WebEngageAnalytices.setLogOut();
K2(context);
Boolean bool = Boolean.FALSE;
f6.l.m(context, "keyisSubscribed", bool);
PianoResponseSingleTon.getInstance().setUserScopeData((String) null);
if (!(context instanceof SplashActivity)) {
HomeActivity.D0 = true;
}
AppController.j().W((PremiumStoryMeter) null);
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(context).edit();
edit.putString("whatsapp_popup_date", BuildConfig.FLAVOR);
edit.apply();
SubscriptionPlanSingleton.getInstance().setOptChannels((List) null);
AppController.j().g0((ZSSuscriptionDetail) null);
AppController.j().V((MintSubscriptionDetail) null);
p3(context, false);
e7.a.k();
Checkout.clearUserData(context);
e1.s();
e7.d.f();
f6.l.m(context, "onboarding_api_response", (Object) null);
f6.l.m(context, "IS_ONBOARDING_SYNC_COMPLETE", bool);
f6.l.n(context, "is_icon_bottom_sheet_shown", "icon_bottom_sheet", bool);
}
@BindingAdapter({"setNewPriceArrow"})
public static void y3(TextView textView, LiveMarketPrice liveMarketPrice) {
if (liveMarketPrice == null) {
textView.setText("-");
return;
}
float parseFloat = Float.parseFloat(!TextUtils.isEmpty(liveMarketPrice.getPercentChange()) ? liveMarketPrice.getPercentChange() : "0");
float parseFloat2 = Float.parseFloat(TextUtils.isEmpty(liveMarketPrice.getNetChange()) ? "0" : liveMarketPrice.getNetChange());
String format = String.format("%s", Float.valueOf(Math.abs(parseFloat2)));
if (parseFloat >= 0.0f) {
textView.setCompoundDrawablesWithIntrinsicBounds(2131231304, 0, 0, 0);
} else if (parseFloat < 0.0f) {
format = String.format("%s", Float.valueOf(Math.abs(parseFloat2)));
textView.setCompoundDrawablesWithIntrinsicBounds(2131231303, 0, 0, 0);
} else {
textView.setCompoundDrawablesWithIntrinsicBounds(2131231303, 0, 0, 0);
}
textView.setText(format);
}
public static Long z(String str) {
if (str != null) {
return Long.valueOf(Long.parseLong(str));
}
return null;
}
public static DeviceEligibilityData z0() {
Context applicationContext = AppController.j().getApplicationContext();
if (applicationContext == null) {
return null;
}
String string = applicationContext.getSharedPreferences("DeviceIdPref", 0).getString("DeviceIdAPIResponse", null);
if (TextUtils.isEmpty(string)) {
return null;
}
return (DeviceEligibilityData) new Gson().fromJson(string, DeviceEligibilityData.class);
}
public static String z1(String str, boolean z2) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("IST"));
Date parse = simpleDateFormat.parse(str);
return (simpleDateFormat2.format(parse).equalsIgnoreCase(simpleDateFormat2.format(new Date())) ? z2 ? new SimpleDateFormat("hh:mm a") : new SimpleDateFormat("hh:mm a 'IST'") : new SimpleDateFormat("dd MMM yyyy")).format(parse);
} catch (Exception e2) {
o0.f(e2);
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static void z2(Context context, String str) {
Intent intent;
if (context == null || TextUtils.isEmpty(str)) {
if (context != null) {
ToastHelper.showToast(context, "Page not found. Please try again later.", 0);
return;
}
return;
}
j1.x0(2, context);
try {
CustomTabsIntent build = new CustomTabsIntent.Builder().build();
if (build == null || (intent = build.intent) == null) {
G2(context, str);
} else {
intent.setData(Uri.parse(str));
List<ResolveInfo> queryIntentActivities = context.getPackageManager().queryIntentActivities(build.intent, 65536);
if (queryIntentActivities != null && !queryIntentActivities.isEmpty()) {
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
while (it.hasNext()) {
String str2 = it.next().activityInfo.packageName;
if (TextUtils.equals(str2, "com.android.chrome")) {
build.intent.setPackage("com.android.chrome");
} else if (TextUtils.equals(str2, "com.sec.android.app.sbrowser")) {
build.intent.setPackage("com.sec.android.app.sbrowser");
}
}
}
Intent intent2 = build.intent;
if (intent2 == null || TextUtils.isEmpty(intent2.getPackage())) {
G2(context, str);
} else {
build.launchUrl(context, Uri.parse(str));
}
}
} catch (Exception unused) {
G2(context, str);
}
new Timer().schedule(new n(context), 300L);
}
@BindingAdapter({"setPriceSmallValue"})
public static void z3(TextView textView, LiveMarketPrice liveMarketPrice) {
if (liveMarketPrice == null) {
textView.setText("-");
return;
}
float parseFloat = Float.parseFloat(!TextUtils.isEmpty(liveMarketPrice.getPercentChange()) ? liveMarketPrice.getPercentChange() : "0");
String format = String.format("(%s%%)", Float.valueOf(Math.abs(parseFloat)));
if (parseFloat < 0.0f && parseFloat < 0.0f) {
format = String.format("(-%s%%)", Float.valueOf(Math.abs(parseFloat)));
}
textView.setText(format);
}
}