正在查看: BetterTogether v3.0.0 应用的 SubscriptionPlansInAppActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: BetterTogether v3.0.0 应用的 SubscriptionPlansInAppActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bettertogether.subscription;
import ae.k;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.k0;
import bc.j;
import cd.a1;
import cf.f;
import com.android.billingclient.api.ProductDetails;
import com.appsflyer.AFInAppEventType;
import com.appsflyer.AppsFlyerLib;
import com.bettertogether.BetterTogetherApp;
import com.bettertogether.base.BaseActivity;
import com.bettertogether.remote.model.common.subscription.LanguagesText;
import com.bettertogether.remote.model.common.subscription.SubscriptionPromotionalText;
import com.bettertogether.remote.model.common.subscription.SubscriptionReminderConfig;
import com.bettertogether.screens.main.MainActivity;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.e;
import et.d;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.g0;
import kotlin.ranges.IntRange;
import kotlin.text.u;
import kotlin.text.y;
import lq.m;
import lq.n;
import lq.o;
import lq.q;
import lq.x;
import s6.s;
import s8.h;
import tf.g;
import tf.i;
import tf.l;
import tf.p;
import uf.b;
import xs.c;
import zs.a;
@Metadata
public final class SubscriptionPlansInAppActivity extends BaseActivity implements p {
public static final int W = 0;
public AppsFlyerLib N;
public SubscriptionPromotionalText P;
public SubscriptionReminderConfig Q;
public final m T;
public final m U;
public final m V;
public b f5055i;
public ArrayList f5054e = new ArrayList();
public String f5056v = "";
public Integer f5057w = 0;
public String f5058x = "";
public String f5059y = "";
public String M = "";
public int O = -1;
public Integer R = -1;
public final x S = n.b(new i(this, 0));
static {
new f(6, 0);
}
public SubscriptionPlansInAppActivity() {
h s10 = e.s(this);
a a10 = ((ys.a) s10.a).a(e.o(), new c(g0.a(SubscriptionPlansActivity.class)));
int i10 = 1;
i iVar = new i(this, i10);
o oVar = o.f13215d;
this.T = n.a(oVar, new l(a10, iVar, 0));
ce.a aVar = null;
this.U = n.a(oVar, new tf.h(this, aVar, i10));
this.V = n.a(oVar, new tf.h(this, aVar, 2));
}
public static final void s(SubscriptionPlansInAppActivity subscriptionPlansInAppActivity) {
int size = subscriptionPlansInAppActivity.f5054e.size();
for (int i10 = 0; i10 < size; i10++) {
ProductDetails productDetails = ((tf.a) subscriptionPlansInAppActivity.f5054e.get(i10)).d;
String productId = productDetails != null ? productDetails.getProductId() : null;
if (Intrinsics.c(productId, "com.bettertogether.us.subscription1y")) {
subscriptionPlansInAppActivity.z(i10, 0);
} else if (Intrinsics.c(productId, "com.bettertogether.us.subscription1m")) {
subscriptionPlansInAppActivity.z(i10, 2);
} else if (Intrinsics.c(productId, "com.bettertogether.us.subscription3m")) {
subscriptionPlansInAppActivity.z(i10, 1);
}
}
RecyclerView recyclerView = subscriptionPlansInAppActivity.w().f4123h;
b bVar = new b(subscriptionPlansInAppActivity.f5054e, new k(subscriptionPlansInAppActivity, 16));
subscriptionPlansInAppActivity.f5055i = bVar;
recyclerView.setAdapter(bVar);
if (subscriptionPlansInAppActivity.P == null) {
((tf.n) subscriptionPlansInAppActivity.T.getValue()).d(subscriptionPlansInAppActivity.R);
} else {
subscriptionPlansInAppActivity.y();
}
}
public static final java.lang.String t(com.bettertogether.subscription.SubscriptionPlansInAppActivity r8, java.lang.Long r9, java.lang.String r10, java.lang.String r11) {
throw new UnsupportedOperationException("Method not decompiled: com.bettertogether.subscription.SubscriptionPlansInAppActivity.t(com.bettertogether.subscription.SubscriptionPlansInAppActivity, java.lang.Long, java.lang.String, java.lang.String):java.lang.String");
}
public static final void u(SubscriptionPlansInAppActivity subscriptionPlansInAppActivity, HashMap hashMap) {
AppsFlyerLib appsFlyerLib = subscriptionPlansInAppActivity.N;
if (appsFlyerLib == null) {
Intrinsics.m("mAppsFlyer");
throw null;
}
BetterTogetherApp betterTogetherApp = BetterTogetherApp.d;
appsFlyerLib.logEvent(s.j(), AFInAppEventType.PURCHASE, hashMap, new g(1, hashMap));
}
public static final void v(SubscriptionPlansInAppActivity subscriptionPlansInAppActivity) {
Bundle extras = subscriptionPlansInAppActivity.getIntent().getExtras();
if (extras == null || !extras.containsKey("open_from_create_or_join") || !extras.getBoolean("open_from_create_or_join") || subscriptionPlansInAppActivity.isDestroyed()) {
return;
}
d.b("BillingManager: moveBackWhenErrorFromOnBoarding called", new Object[0]);
MainActivity.Companion.getClass();
subscriptionPlansInAppActivity.startActivity(ye.a.b(subscriptionPlansInAppActivity, "CreateGroup", false));
subscriptionPlansInAppActivity.finishAffinity();
}
public static String x(LanguagesText languagesText) {
String language = Locale.getDefault().getLanguage();
Intrinsics.checkNotNullExpressionValue(language, "deviceLanguage");
return y.C(language, "de", false) ? languagesText.getDe() : y.C(language, "es", false) ? languagesText.getEs() : y.C(language, "fr", false) ? languagesText.getFr() : (y.C(language, "he", false) || y.C(language, "iw", false)) ? languagesText.getHe() : y.C(language, "zh", false) ? languagesText.getZh() : languagesText.getEn();
}
@Override
public final void c(SubscriptionPromotionalText subscriptionPromotionalText, SubscriptionReminderConfig subscriptionReminderConfig) {
this.P = subscriptionPromotionalText;
this.Q = subscriptionReminderConfig;
y();
}
@Override
public final View getView() {
RelativeLayout relativeLayout = w().f4116a;
Intrinsics.checkNotNullExpressionValue(relativeLayout, "binding.root");
return relativeLayout;
}
@Override
public final void initViews() {
this.f5054e = new ArrayList();
Bundle extras = getIntent().getExtras();
if (extras != null) {
if (extras.containsKey("group_day")) {
Integer valueOf = Integer.valueOf(extras.getInt("group_day"));
this.f5057w = valueOf;
d.c("GroupDay: " + valueOf, new Object[0]);
}
if (extras.containsKey("group_id")) {
this.R = Integer.valueOf(extras.getInt("group_id"));
d.c("GROUP_ID: group_id", new Object[0]);
}
if (extras.containsKey("open_from_create_or_join") && extras.getBoolean("open_from_create_or_join")) {
this.f5057w = -1;
}
}
w().f4121f.setOnClickListener(new j(this, 29));
if (this.P == null) {
((tf.n) this.T.getValue()).d(this.R);
} else {
y();
}
((wf.l) this.U.getValue()).e(this, new k0(this, 2));
AppsFlyerLib appsFlyerLib = AppsFlyerLib.getInstance();
Intrinsics.checkNotNullExpressionValue(appsFlyerLib, "getInstance()");
Intrinsics.checkNotNullParameter(appsFlyerLib, "<set-?>");
this.N = appsFlyerLib;
if (appsFlyerLib == null) {
Intrinsics.m("mAppsFlyer");
throw null;
}
BetterTogetherApp betterTogetherApp = BetterTogetherApp.d;
appsFlyerLib.start(s.j(), "wayzp4kcqdvYnqjoJQny9i", new lf.k(2));
}
@Override
public final void m() {
throw new q("An operation is not implemented: Not yet implemented");
}
@Override
public final ad.a providePresenter() {
return (tf.n) this.T.getValue();
}
public final a1 w() {
return (a1) this.S.getValue();
}
public final void y() {
String str;
Integer every14Days;
Integer twentyOneDays;
Integer twentyOneDays2;
Integer fourteenDaysAfter;
Integer numberOfTotalDaysToBlockFrom;
Integer fourteenDaysAfter2;
Integer sevenDaysAfter;
SubscriptionPromotionalText subscriptionPromotionalText = this.P;
if (subscriptionPromotionalText != null) {
this.f5056v = x(subscriptionPromotionalText.getMostPopular());
this.f5058x = x(subscriptionPromotionalText.getSubscription_plans().getBilledAnnually());
this.f5059y = x(subscriptionPromotionalText.getSubscription_plans().getBilledMonthly());
this.M = x(subscriptionPromotionalText.getSubscription_plans().getBilledOneTime());
w().f4126k.setText(x(subscriptionPromotionalText.getThankYouMessage()));
w().f4118c.setText(x(subscriptionPromotionalText.getCheckList().getOne()));
w().f4120e.setText(x(subscriptionPromotionalText.getCheckList().getTwo()));
w().f4119d.setText(x(subscriptionPromotionalText.getCheckList().getThree()));
Integer num = this.f5057w;
d.c("GroupDay:showTopText: " + num, new Object[0]);
if (num != null) {
int intValue = num.intValue();
SubscriptionReminderConfig subscriptionReminderConfig = this.Q;
int i10 = 14;
if (intValue >= ((subscriptionReminderConfig == null || (sevenDaysAfter = subscriptionReminderConfig.getSevenDaysAfter()) == null) ? 7 : sevenDaysAfter.intValue())) {
int intValue2 = num.intValue();
SubscriptionReminderConfig subscriptionReminderConfig2 = this.Q;
if (intValue2 < ((subscriptionReminderConfig2 == null || (fourteenDaysAfter2 = subscriptionReminderConfig2.getFourteenDaysAfter()) == null) ? 14 : fourteenDaysAfter2.intValue())) {
BetterTogetherApp betterTogetherApp = BetterTogetherApp.d;
FirebaseAnalytics.getInstance(s.j()).a(new Bundle(), "subscription_pro_afterSevenDays");
String x10 = x(subscriptionPromotionalText.getAfterSevenDaysAlert());
SubscriptionReminderConfig subscriptionReminderConfig3 = this.Q;
if (subscriptionReminderConfig3 != null && (numberOfTotalDaysToBlockFrom = subscriptionReminderConfig3.getNumberOfTotalDaysToBlockFrom()) != null) {
i10 = numberOfTotalDaysToBlockFrom.intValue();
}
str = u.m(x10, "%@", String.valueOf((i10 + 1) - num.intValue()));
}
}
int intValue3 = num.intValue();
SubscriptionReminderConfig subscriptionReminderConfig4 = this.Q;
if (intValue3 >= ((subscriptionReminderConfig4 == null || (fourteenDaysAfter = subscriptionReminderConfig4.getFourteenDaysAfter()) == null) ? 14 : fourteenDaysAfter.intValue())) {
int intValue4 = num.intValue();
SubscriptionReminderConfig subscriptionReminderConfig5 = this.Q;
if (intValue4 < ((subscriptionReminderConfig5 == null || (twentyOneDays2 = subscriptionReminderConfig5.getTwentyOneDays()) == null) ? 21 : twentyOneDays2.intValue())) {
BetterTogetherApp betterTogetherApp2 = BetterTogetherApp.d;
FirebaseAnalytics.getInstance(s.j()).a(new Bundle(), "subscription_pro_afterFourteenDays");
str = x(subscriptionPromotionalText.getAfterFourteenDaysAlert());
}
}
SubscriptionReminderConfig subscriptionReminderConfig6 = this.Q;
if (new IntRange((subscriptionReminderConfig6 == null || (twentyOneDays = subscriptionReminderConfig6.getTwentyOneDays()) == null) ? 21 : twentyOneDays.intValue(), 25).h(num.intValue())) {
xh.k.y();
str = x(subscriptionPromotionalText.getAfterTwentyOneDaysAlert());
} else if (num.intValue() > 25) {
int intValue5 = num.intValue() - 21;
SubscriptionReminderConfig subscriptionReminderConfig7 = this.Q;
if (subscriptionReminderConfig7 != null && (every14Days = subscriptionReminderConfig7.getEvery14Days()) != null) {
i10 = every14Days.intValue();
}
if (intValue5 % i10 == 0) {
BetterTogetherApp betterTogetherApp3 = BetterTogetherApp.d;
FirebaseAnalytics.getInstance(s.j()).a(new Bundle(), "subscription_pro_every14Days");
str = x(subscriptionPromotionalText.getEveryFourteenDaysAlert());
} else {
xh.k.y();
str = x(subscriptionPromotionalText.getAfterTwentyOneDaysAlert());
}
} else {
BetterTogetherApp betterTogetherApp4 = BetterTogetherApp.d;
FirebaseAnalytics.getInstance(s.j()).a(new Bundle(), "subscription_pro_groupCreated");
str = x(subscriptionPromotionalText.getAfterGroupCreatedOrJoined());
}
} else {
str = "";
}
w().f4125j.setText(str);
b bVar = this.f5055i;
if (bVar != null) {
String str2 = this.f5056v;
Intrinsics.checkNotNullParameter(str2, "mostPopularText");
d.c("onBindViewHolder setDataFromRemoteConfig mostPopularText: " + str2, new Object[0]);
bVar.f18823f = str2;
}
}
b bVar2 = this.f5055i;
if (bVar2 != null) {
bVar2.notifyDataSetChanged();
}
}
public final void z(int i10, int i11) {
ArrayList arrayList = this.f5054e;
this.f5054e.set(i10, (tf.a) arrayList.set(i11, arrayList.get(i10)));
}
}