LINE.apk(点击下载) / SuggestionAgreementActivity.java
package com.linecorp.line.avatar.suggestion.agreement;
import ai.clova.cic.clientlib.exoplayer2.text.ttml.TtmlNode;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.lifecycle.e1;
import androidx.lifecycle.o0;
import em3.q;
import em3.s;
import java.util.Locale;
import java.util.Objects;
import jp.naver.line.android.R;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import oz.h;
import qk.f1;
import sm3.r;
@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lcom/linecorp/line/avatar/suggestion/agreement/SuggestionAgreementActivity;", "Luy/d;", "<init>", "()V", "avatar_release"}, k = 1, mv = {1, 6, 0})
public final class SuggestionAgreementActivity extends uy.d {
/* renamed from: m reason: collision with root package name */
public static final /* synthetic */ int f34696m = 0;
/* renamed from: d reason: collision with root package name */
public boolean f34697d = true;
/* renamed from: e reason: collision with root package name */
public final Lazy f34698e = LazyKt.lazy(new f(this));
/* renamed from: f reason: collision with root package name */
public final Lazy f34699f = LazyKt.lazy(new a(this));
/* renamed from: g reason: collision with root package name */
public final Lazy f34700g = LazyKt.lazy(new b(this));
/* renamed from: h reason: collision with root package name */
public final Lazy f34701h = LazyKt.lazy(new d(this));
/* renamed from: i reason: collision with root package name */
public final Lazy f34702i = LazyKt.lazy(new g(this));
/* renamed from: j reason: collision with root package name */
public final Lazy f34703j = LazyKt.lazy(new e(this));
/* renamed from: k reason: collision with root package name */
public final Lazy f34704k = LazyKt.lazy(new c(this));
/* renamed from: l reason: collision with root package name */
public String f34705l;
public static final class a extends s implements dm3.a<TextView> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34706b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public a(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34706b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public TextView invoke() {
return (TextView) this.f34706b.findViewById(R.id.btn_agree);
}
}
public static final class b extends s implements dm3.a<TextView> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34707b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public b(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34707b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public TextView invoke() {
return (TextView) this.f34707b.findViewById(R.id.btn_dis_agree);
}
}
public static final class c extends s implements dm3.a<h> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34708b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public c(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34708b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public h invoke() {
return new h(this.f34708b, new a(this.f34708b), new b(this.f34708b));
}
}
public static final class d extends s implements dm3.a<LinearLayout> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34709b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public d(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34709b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public LinearLayout invoke() {
return (LinearLayout) this.f34709b.findViewById(R.id.page_agreement_detail);
}
}
public static final class e extends s implements dm3.a<oz.b> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34710b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public e(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34710b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public oz.b invoke() {
String str;
String str2;
Object value = this.f34710b.f34702i.getValue();
q.e(value, "<get-webViewFrame>(...)");
FrameLayout frameLayout = (FrameLayout) value;
SuggestionAgreementActivity suggestionAgreementActivity = this.f34710b;
q.f(suggestionAgreementActivity, "context");
StringBuilder sb4 = new StringBuilder();
sb4.append(((bz.c) rb.a.d(suggestionAgreementActivity, bz.c.f15891e0)).h() ? "https://terms.line-beta.me/line_avatar_ml/sp?lang=" : "https://terms.line.me/line_avatar_ml/sp?lang=");
String a14 = pd3.d.c().a();
if (a14 != null) {
str = a14.toLowerCase(Locale.ROOT);
q.e(str, "this as java.lang.String).toLowerCase(Locale.ROOT)");
} else {
str = null;
}
if (r.r("JP", str, true)) {
str2 = "ja";
} else if (r.r("TH", str, true)) {
str2 = "th";
} else if (r.r("TW", str, true)) {
str2 = "zh-Hant";
} else if (r.r("ID", str, true)) {
str2 = TtmlNode.ATTR_ID;
} else {
str2 = r.r("KR", str, true) ? "ko" : "en";
}
sb4.append(str2);
return new oz.b(frameLayout, sb4.toString(), new c(this.f34710b), new d(this.f34710b));
}
}
public static final class f extends s implements dm3.a<oz.f> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34711b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public f(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34711b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public oz.f invoke() {
return (oz.f) new e1(this.f34711b).b(oz.f.class);
}
}
public static final class g extends s implements dm3.a<FrameLayout> {
/* renamed from: b reason: collision with root package name */
public final /* synthetic */ SuggestionAgreementActivity f34712b;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public g(SuggestionAgreementActivity suggestionAgreementActivity) {
super(0);
this.f34712b = suggestionAgreementActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // dm3.a
public FrameLayout invoke() {
return (FrameLayout) this.f34712b.findViewById(R.id.page_agreement_detail_webview);
}
}
public static final void E8(Context context, int i14) {
q.f(context, "context");
SharedPreferences sharedPreferences = context.getSharedPreferences("suggestion_pref", 0);
q.e(sharedPreferences, "context.getSharedPrefere…ME, Context.MODE_PRIVATE)");
sharedPreferences.edit().putInt("agreement.image_collect.showed", i14).apply();
}
public final LinearLayout A8() {
Object value = this.f34701h.getValue();
q.e(value, "<get-learnMoreDetailPage>(...)");
return (LinearLayout) value;
}
public final oz.f B8() {
return (oz.f) this.f34698e.getValue();
}
public final void C8() {
z8().setOnDismissListener(null);
z8().dismiss();
A8().setVisibility(0);
y8().setOnClickListener(new oz.e(this, 0));
x8().setOnClickListener(new zm.e(this, 3));
y8().setEnabled(false);
x8().setEnabled(false);
((oz.b) this.f34703j.getValue()).b();
rz.h.h(rz.h.f140914a, "ml_agreement", this.f34705l, null, null, null, null, null, 124);
}
public final void D8(boolean z14) {
String str;
if (!q.b(Boolean.valueOf(z14), B8().f125226a.getValue())) {
if (z14) {
str = getString(R.string.avatar_common_toast_accessallowed);
} else {
str = getString(R.string.avatar_common_toast_accessdenied);
}
q.e(str, "if (isAgreed) {\n …cessdenied)\n }");
Toast.makeText(this, str, 1).show();
}
oz.f B8 = B8();
Objects.requireNonNull(B8);
pd3.a c14 = pd3.d.c();
uf3.a aVar = uf3.a.AVATAR_ML_AGREEMENT;
c14.s(aVar, Boolean.valueOf(z14));
o0<Boolean> o0Var = B8.f125226a;
Object H = c14.H(aVar, Boolean.FALSE);
Objects.requireNonNull(H, "null cannot be cast to non-null type kotlin.Boolean");
o0Var.setValue(Boolean.valueOf(((Boolean) H).booleanValue()));
Intent intent = new Intent();
intent.putExtra("avatar_ml_agreement_of_off", z14);
w8(-1, intent);
finish();
}
public void finish() {
super.finish();
overridePendingTransition(0, 0);
}
@Override // androidx.activity.ComponentActivity
public void onBackPressed() {
if (!(A8().getVisibility() == 0) || !this.f34697d) {
super.onBackPressed();
return;
}
z8().show();
z8().setOnDismissListener(new oz.d(this, 0));
A8().setVisibility(8);
((oz.b) this.f34703j.getValue()).a();
}
@Override // androidx.activity.ComponentActivity, a2.f, uy.d, androidx.fragment.app.n
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_suggestion_agreement);
Objects.requireNonNull(B8());
if (!((bz.c) rb.a.d(this, bz.c.f15891e0)).z()) {
finish();
return;
}
Window window = getWindow();
window.addFlags(Integer.MIN_VALUE);
bw2.d.c(window, 0, false, 6);
this.f34705l = getIntent().getStringExtra("media.location");
this.f34697d = getIntent().getBooleanExtra("avatar_ml_bottom_sheet_dialog_on_off", true);
boolean booleanExtra = getIntent().getBooleanExtra("avatar_ml_show_learn_more_on_start", false);
boolean booleanExtra2 = getIntent().getBooleanExtra("avatar_ml_direct_agree_or_disagree_value", false);
if (this.f34697d) {
z8().show();
z8().setOnDismissListener(new oz.d(this, 0));
B8().f125226a.observe(this, new f1(this, 3));
} else if (booleanExtra) {
C8();
} else {
if (booleanExtra2) {
if (!q.b(Boolean.valueOf(booleanExtra2), B8().f125226a.getValue())) {
C8();
}
}
D8(booleanExtra2);
}
E8(this, 1);
}
public final View x8() {
Object value = this.f34699f.getValue();
q.e(value, "<get-agreeButton>(...)");
return (View) value;
}
public final View y8() {
Object value = this.f34700g.getValue();
q.e(value, "<get-disAgreeButton>(...)");
return (View) value;
}
public final h z8() {
return (h) this.f34704k.getValue();
}
}