导航菜单

页面标题

页面副标题

Mint v5.7.3 - z0.java 源代码

正在查看: Mint v5.7.3 应用的 z0.java JAVA 源代码文件

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


package d8;

import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.htmedia.mint.AppController;
import com.htmedia.mint.htsubscription.SubscriptionPlanSingleton;
import com.htmedia.mint.htsubscription.SubscriptionTrigger;
import com.htmedia.mint.htsubscription.WebEngageAnalytices;
import com.htmedia.mint.htsubscription.planpagerewamp.ui.activities.PlanPageActivity;
import com.htmedia.mint.pojo.Content;
import com.htmedia.mint.pojo.NewsLetterItemNew;
import com.htmedia.mint.pojo.NewsLetterResponseModel;
import com.htmedia.mint.pojo.NewsLetterSubUnsubResponseModelNew;
import com.htmedia.mint.pojo.config.Config;
import com.htmedia.mint.ui.activity.NewsLetterActivityNew;
import com.htmedia.mint.ui.activity.WebViewActivityWithHeader;
import com.htmedia.mint.utils.n;
import com.htmedia.sso.activities.LoginRegisterActivity;
import com.htmedia.sso.helpers.SSOSingleton;
import com.htmedia.sso.helpers.ToastHelper;
import com.htmedia.sso.helpers.WebEngageNewSSOEvents;
import com.htmedia.sso.network.ApiClient;
import com.htmedia.sso.network.ApiServices;
import com.htmedia.sso.network.CustomObserver;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import in.juspay.hyper.constants.LogCategory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONObject;
import x4.ju;

public class z0 implements k6.u0 {
    private final LinearLayout a;
    private final AppCompatActivity b;
    private final Context c;
    private final Content d;
    private final int e;
    private View f;
    private ProgressBar h;
    private k6.x0 i;
    LinearLayout j;
    private TextView p;
    private TextView q;
    private List<NewsLetterItemNew> r;
    HashMap<String, String> g = new HashMap<>();
    public String o = "?utm_source=lm_androidapp&utm_medium=referral&utm_campaign=lm_androidappcarousel";

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            com.htmedia.mint.utils.n.N(z0.this.c, com.htmedia.mint.utils.n.Z1, com.htmedia.mint.utils.n.p(z0.this.b), com.htmedia.mint.utils.n.k(z0.this.c), z0.this.d, "home", com.htmedia.mint.utils.n.D, null, com.htmedia.mint.utils.n.M, String.valueOf(z0.this.e + 1), AppController.j().g().getNewsLetterListing());
            Intent intent = new Intent(z0.this.c, (Class<?>) NewsLetterActivityNew.class);
            intent.putExtra("origin", "Home");
            z0.this.c.startActivity(intent);
        }
    }

    class b implements View.OnClickListener {
        final NewsLetterItemNew a;

        b(NewsLetterItemNew newsLetterItemNew) {
            this.a = newsLetterItemNew;
        }

        @Override
        public void onClick(View view) {
            NewsLetterItemNew newsLetterItemNew = this.a;
            if (newsLetterItemNew != null && !TextUtils.isEmpty(newsLetterItemNew.getUrl())) {
                z0 z0Var = z0.this;
                z0Var.f(z0Var.c, this.a.getUrl());
            }
            com.htmedia.mint.utils.n.N(z0.this.c, com.htmedia.mint.utils.n.c2, com.htmedia.mint.utils.n.p(z0.this.b), com.htmedia.mint.utils.n.k(z0.this.c), z0.this.d, "home", com.htmedia.mint.utils.n.D, null, com.htmedia.mint.utils.n.D + " preview button", String.valueOf(z0.this.e + 1), AppController.j().g().getNewsLetterListing());
        }
    }

    class c implements View.OnClickListener {
        final NewsLetterItemNew a;
        final ju b;

        c(NewsLetterItemNew newsLetterItemNew, ju juVar) {
            this.a = newsLetterItemNew;
            this.b = juVar;
        }

        @Override
        public void onClick(View view) {
            com.htmedia.mint.utils.n.N(z0.this.c, com.htmedia.mint.utils.n.c2, com.htmedia.mint.utils.n.p(z0.this.b), com.htmedia.mint.utils.n.k(z0.this.c), z0.this.d, "home", com.htmedia.mint.utils.n.D, null, com.htmedia.mint.utils.n.D + " subscribe button", String.valueOf(z0.this.e + 1), AppController.j().g().getNewsLetterListing());
            z0 z0Var = z0.this;
            Context context = z0Var.c;
            NewsLetterItemNew newsLetterItemNew = this.a;
            ju juVar = this.b;
            z0Var.i(context, newsLetterItemNew, true, juVar.e, juVar.i);
        }
    }

    class d extends CustomObserver<NewsLetterSubUnsubResponseModelNew> {
        final boolean a;
        final ImageView b;
        final TextView c;
        final Context d;
        final NewsLetterItemNew e;

        d(Context context, boolean z, boolean z2, ImageView imageView, TextView textView, Context context2, NewsLetterItemNew newsLetterItemNew) {
            super(context, z);
            this.a = z2;
            this.b = imageView;
            this.c = textView;
            this.d = context2;
            this.e = newsLetterItemNew;
        }

        @Override
        public void onNext(NewsLetterSubUnsubResponseModelNew newsLetterSubUnsubResponseModelNew) {
            super.onNext(newsLetterSubUnsubResponseModelNew);
            if (!newsLetterSubUnsubResponseModelNew.isSuccess()) {
                ToastHelper.showToast(this.d, newsLetterSubUnsubResponseModelNew.getMessage());
                return;
            }
            if (this.a) {
                this.b.setVisibility(0);
                this.c.setVisibility(8);
            } else {
                this.b.setVisibility(8);
                this.c.setVisibility(0);
            }
            Context context = this.d;
            String str = com.htmedia.mint.utils.n.w0;
            String[] strArr = new String[2];
            strArr[0] = this.a ? "Subscribe" : "Unsubscribe";
            strArr[1] = this.e.getName();
            com.htmedia.mint.utils.n.M(context, str, "topic_page", null, BuildConfig.FLAVOR, strArr);
            ToastHelper.showToast(this.d, "Your newsletter preferences have been updated!");
        }
    }

    public z0(LinearLayout linearLayout, AppCompatActivity appCompatActivity, Context context, Content content, int i) {
        this.a = linearLayout;
        this.b = appCompatActivity;
        this.c = context;
        this.d = content;
        this.e = i;
    }

    void e() {
        LayoutInflater layoutInflater = (LayoutInflater) this.c.getSystemService("layout_inflater");
        if (this.r != null) {
            for (int i = 0; i < this.r.size(); i++) {
                NewsLetterItemNew newsLetterItemNew = this.r.get(i);
                ju c2 = ju.c(layoutInflater);
                View root = c2.getRoot();
                c2.e(Boolean.valueOf(AppController.j().E()));
                if (newsLetterItemNew.isIs_subscribed()) {
                    c2.e.setVisibility(0);
                    c2.i.setVisibility(8);
                } else {
                    c2.e.setVisibility(8);
                    c2.i.setVisibility(0);
                }
                c2.d.setOnClickListener(new b(newsLetterItemNew));
                c2.i.setOnClickListener(new c(newsLetterItemNew, c2));
                if (newsLetterItemNew.getLogo_app() != null) {
                    c2.b.setImageURI(newsLetterItemNew.getLogo_app());
                }
                c2.g.setText(newsLetterItemNew.getFrequency());
                if (newsLetterItemNew.getName() != null && newsLetterItemNew.getName().length() > 0) {
                    c2.h.setText(Html.fromHtml(Html.fromHtml(newsLetterItemNew.getName()).toString().trim()));
                }
                if (newsLetterItemNew.getDescription() != null && newsLetterItemNew.getDescription().length() > 0) {
                    c2.f.setText(newsLetterItemNew.getDescription().replace("â\u0080\u0099", "'"));
                }
                System.out.println("------------>>>>" + newsLetterItemNew.getDescription());
                if (newsLetterItemNew.getType().equalsIgnoreCase("FREE")) {
                    c2.c.setImageResource(2131232477);
                } else {
                    c2.c.setImageResource(2131232789);
                }
                this.j.addView(root);
            }
        }
    }

    public void f(Context context, String str) {
        com.htmedia.mint.utils.n.M(context, com.htmedia.mint.utils.n.w0, "topic_page", null, BuildConfig.FLAVOR, "View Newsletter");
        Intent intent = new Intent(context, (Class<?>) WebViewActivityWithHeader.class);
        intent.putExtra("url", com.htmedia.mint.utils.f0.v(str, context));
        intent.putExtra("Title", "NewsLetter");
        context.startActivity(intent);
    }

    public void g() {
        this.a.removeAllViews();
        AppController.j().g();
        View inflate = this.b.getLayoutInflater().inflate(2131624100, (ViewGroup) null);
        this.f = inflate;
        this.h = (ProgressBar) inflate.findViewById(2131430176);
        this.j = (LinearLayout) this.f.findViewById(2131428033);
        this.p = (TextView) this.f.findViewById(2131428039);
        this.q = (TextView) this.f.findViewById(2131428042);
        this.h.setVisibility(0);
        this.p.setText("NEWSLETTERS");
        this.q.setOnClickListener(new a());
        String str = AppController.j().g().getNewsLetterNetcore().getGetAllNewsletter() + "?email=" + (com.htmedia.mint.utils.f0.G1(this.c, "userName") != null ? com.htmedia.mint.utils.f0.G1(this.c, "userEmail") : BuildConfig.FLAVOR) + "&domain=LM";
        if (this.d.getSourceBodyPojo() != null && this.d.getSourceBodyPojo().getJsonObject() != null) {
            try {
                NewsLetterResponseModel newsLetterResponseModel = (NewsLetterResponseModel) new Gson().fromJson(this.d.getSourceBodyPojo().getJsonObject().toString(), NewsLetterResponseModel.class);
                ArrayList arrayList = new ArrayList();
                arrayList.addAll(newsLetterResponseModel.getData().getFREE());
                arrayList.addAll(newsLetterResponseModel.getData().getPAID());
                this.r = arrayList;
                com.htmedia.mint.utils.o1.a("TAG", this.d.getSourceBodyPojo().getJsonObject().toString());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (this.r != null) {
            this.h.setVisibility(8);
            e();
        } else if (!TextUtils.isEmpty(str)) {
            k6.x0 x0Var = new k6.x0(this.c, this);
            this.i = x0Var;
            x0Var.a(0, str, str, null, null, false, false);
        }
        if (AppController.j().E()) {
            this.f.findViewById(2131428649).setBackgroundColor(this.c.getResources().getColor(2131099805));
            ((TextView) this.f.findViewById(2131428039)).setTextColor(this.c.getResources().getColor(2131100599));
        } else {
            this.f.findViewById(2131428649).setBackgroundColor(this.c.getResources().getColor(2131101002));
            ((TextView) this.f.findViewById(2131428039)).setTextColor(this.c.getResources().getColor(2131100598));
        }
        this.a.addView(this.f);
    }

    @Override
    public void getResponse(JSONObject jSONObject, String str) {
        this.j.removeAllViews();
        if (jSONObject == null || str == null) {
            return;
        }
        NewsLetterResponseModel newsLetterResponseModel = (NewsLetterResponseModel) new Gson().fromJson(jSONObject.toString(), NewsLetterResponseModel.class);
        ArrayList arrayList = new ArrayList();
        if (com.htmedia.mint.utils.f0.I1().equalsIgnoreCase("subscriber")) {
            arrayList.addAll(newsLetterResponseModel.getData().getPAID());
            arrayList.addAll(newsLetterResponseModel.getData().getFREE());
        } else {
            arrayList.addAll(newsLetterResponseModel.getData().getFREE());
            arrayList.addAll(newsLetterResponseModel.getData().getPAID());
        }
        this.r = arrayList;
        this.h.setVisibility(8);
        e();
    }

    public void h(Context context, NewsLetterItemNew newsLetterItemNew, boolean z, ImageView imageView, TextView textView) {
        String unsubscribeNewsletter;
        List<NewsLetterItemNew> list = this.r;
        if (list == null || list.isEmpty()) {
            ToastHelper.showToast(context, "No newsletter present at the moment, Please try again later!");
            return;
        }
        newsLetterItemNew.setIs_subscribed(z);
        JsonObject jsonObject = new JsonObject();
        String G1 = com.htmedia.mint.utils.f0.G1(context, "userName") != null ? com.htmedia.mint.utils.f0.G1(context, "userEmail") : BuildConfig.FLAVOR;
        JsonArray jsonArray = new JsonArray();
        jsonObject.addProperty("domain", "LM");
        jsonObject.addProperty("email", G1);
        jsonArray.add(newsLetterItemNew.getNewsletter_id());
        jsonObject.add("newsletter_ids", jsonArray);
        if (z) {
            jsonObject.addProperty(LogCategory.ACTION, "ADD");
            unsubscribeNewsletter = AppController.j().g().getNewsLetterNetcore().getSubscribeNewsletter();
        } else {
            jsonObject.addProperty(LogCategory.ACTION, "DELETE");
            unsubscribeNewsletter = AppController.j().g().getNewsLetterNetcore().getUnsubscribeNewsletter();
        }
        ((ApiServices) ApiClient.getClient().create(ApiServices.class)).setUserNewsLetterSubscriptionData(unsubscribeNewsletter, jsonObject).s(sg.a.b()).k(ag.a.a()).a(new d(context, true, z, imageView, textView, context, newsLetterItemNew));
    }

    public void i(Context context, NewsLetterItemNew newsLetterItemNew, boolean z, ImageView imageView, TextView textView) {
        if (com.htmedia.mint.utils.f0.G1(context, "userName") == null) {
            n.a aVar = n.a.HEADER;
            com.htmedia.mint.utils.n.g0(null, null, aVar.a(), aVar.a());
            WebEngageNewSSOEvents.trackSSOLinkClicked("Login", "Home Login");
            Intent intent = new Intent(context, (Class<?>) LoginRegisterActivity.class);
            intent.putExtra("origin", "Home Login");
            intent.putExtra("referer", "Home Login");
            intent.putExtra("newsLetter", "News Letter");
            intent.setFlags(603979776);
            AppCompatActivity appCompatActivity = (AppCompatActivity) context;
            appCompatActivity.overridePendingTransition(2130772024, 2130772025);
            appCompatActivity.startActivityForResult(intent, 102, ActivityOptions.makeCustomAnimation(context, 2130772024, 2130772030).toBundle());
            return;
        }
        if (newsLetterItemNew.getType().equalsIgnoreCase("FREE")) {
            h(context, newsLetterItemNew, z, imageView, textView);
            return;
        }
        Config g = AppController.j().g();
        boolean z2 = true;
        boolean z3 = AppController.j().l() != null && AppController.j().l().isSubscriptionActive();
        if (g != null && (g.getSubscription() == null || !g.getSubscription().isSubscriptionEnable())) {
            z2 = false;
        }
        if (z3 || !z2) {
            h(context, newsLetterItemNew, z, imageView, textView);
            return;
        }
        WebEngageAnalytices.trackClickEvents("Hamburger_Subscribe", (String) null, (String) null, (Content) null, "Explore", BuildConfig.FLAVOR, BuildConfig.FLAVOR);
        Bundle bundle = new Bundle();
        bundle.putString(com.htmedia.mint.utils.n.X, "explore_menu");
        com.htmedia.mint.utils.n.l0(context, com.htmedia.mint.utils.n.t1, bundle);
        Intent intent2 = new Intent(context, (Class<?>) PlanPageActivity.class);
        if (context != null && (context instanceof AppCompatActivity)) {
            intent2 = SubscriptionTrigger.openPlanPageIntent((AppCompatActivity) context, "Newsletter", false);
        }
        intent2.putExtra("urlkey", "https://accounts.hindustantimes.com/lm/userplan");
        intent2.putExtra("keybuttonName", "Subscribe_Explore");
        intent2.putExtra("funnelName", "Explore");
        SubscriptionPlanSingleton.getInstance().setContent((Content) null);
        SSOSingleton.getInstance().setPlanPageReason("explore");
        SSOSingleton.getInstance().setPaywallReson(BuildConfig.FLAVOR);
        ((AppCompatActivity) context).startActivityForResult(intent2, 1009);
    }

    @Override
    public void onError(String str) {
        this.h.setVisibility(8);
    }
}