package com.tencent.mm.plugin.account.bind.ui; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.text.Spannable; import android.text.TextPaint; import android.text.style.ClickableSpan; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; import android.widget.TextView; import bw3.c42; import com.tencent.mm.R; import com.tencent.mm.app.w1; import com.tencent.mm.plugin.appbrand.jsapi.media.JsApiChooseMultiMedia; import com.tencent.mm.sdk.platformtools.Log; import com.tencent.mm.sdk.platformtools.Util; import com.tencent.mm.ui.MMActivity; import com.tencent.mm.ui.widget.MMSwitchBtn; import d60.z; import eh0.p; import i14.j; import java.util.ArrayList; import jh2.k0; import nf0.u0; import yf0.n; import yf0.y; public class BindLinkedInUI extends MMActivity implements n { public static final /* synthetic */ int F = 0; public String A; public String B; public String C; public String D; public ProgressDialog E; /* renamed from: e reason: collision with root package name */ public boolean f81022e = false; /* renamed from: f reason: collision with root package name */ public String f81023f; /* renamed from: g reason: collision with root package name */ public String f81024g; /* renamed from: h reason: collision with root package name */ public boolean f81025h = false; /* renamed from: i reason: collision with root package name */ public boolean f81026i = false; /* renamed from: j reason: collision with root package name */ public boolean f81027j = false; /* renamed from: n reason: collision with root package name */ public Bundle f81028n; /* renamed from: o reason: collision with root package name */ public int f81029o; /* renamed from: p reason: collision with root package name */ public boolean f81030p = false; /* renamed from: q reason: collision with root package name */ public boolean f81031q = false; /* renamed from: r reason: collision with root package name */ public TextView f81032r; /* renamed from: s reason: collision with root package name */ public TextView f81033s; /* renamed from: t reason: collision with root package name */ public View f81034t; /* renamed from: u reason: collision with root package name */ public MMSwitchBtn f81035u; /* renamed from: v reason: collision with root package name */ public TextView f81036v; /* renamed from: w reason: collision with root package name */ public TextView f81037w; /* renamed from: x reason: collision with root package name */ public TextView f81038x; /* renamed from: y reason: collision with root package name */ public String f81039y; /* renamed from: z reason: collision with root package name */ public String f81040z; public class a implements MMSwitchBtn.b { public a() { } @Override // com.tencent.mm.ui.widget.MMSwitchBtn.b public void onStatusChange(boolean z15) { BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; int i15 = BindLinkedInUI.F; bindLinkedInUI.Y7(z15, true); } } public class b implements DialogInterface.OnClickListener { public b() { } public void onClick(DialogInterface dialogInterface, int i15) { BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; int i16 = BindLinkedInUI.F; bindLinkedInUI.U7(); } } public class c implements View.OnClickListener { public c() { } public void onClick(View view) { ArrayList arrayList = new ArrayList(); arrayList.add(view); Object[] array = arrayList.toArray(); arrayList.clear(); j30.a.b("com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$2", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array); String str = (String) z.s().i().e(286723, null); if (!Util.isNullOrNil(str)) { Intent intent = new Intent(); intent.putExtra("rawUrl", str); intent.putExtra("geta8key_username", u0.r()); sv3.b.j(BindLinkedInUI.this, "webview", "com.tencent.mm.plugin.webview.ui.tools.WebViewUI", intent, null); } j30.a.g(this, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$2", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V"); } } public class d implements View.OnClickListener { public class a implements DialogInterface.OnClickListener { public a() { } public void onClick(DialogInterface dialogInterface, int i15) { BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; int i16 = BindLinkedInUI.F; bindLinkedInUI.T7(false); } } public class b implements DialogInterface.OnClickListener { public b(d dVar) { } public void onClick(DialogInterface dialogInterface, int i15) { } } public d() { } public void onClick(View view) { ArrayList arrayList = new ArrayList(); arrayList.add(view); Object[] array = arrayList.toArray(); arrayList.clear(); j30.a.b("com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$3", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array); BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; if (!bindLinkedInUI.f81026i) { bindLinkedInUI.getClass(); Intent intent = new Intent(); intent.putExtra("rawUrl", "http://www.linkedin.com/bind/plugin/"); intent.putExtra("geta8key_username", u0.r()); if (bindLinkedInUI.f81027j) { intent.putExtra("geta8key_scene", 3); } else { intent.putExtra("geta8key_scene", 8); } sv3.b.n(bindLinkedInUI, "webview", "com.tencent.mm.plugin.webview.ui.tools.WebViewUI", intent, 100); } else if (!bindLinkedInUI.f81022e) { bindLinkedInUI.T7(false); } else { j.u(bindLinkedInUI, bindLinkedInUI.getString(R.string.bee), null, new a(), new b(this)); } j30.a.g(this, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$3", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V"); } } public class e implements View.OnClickListener { public class a implements DialogInterface.OnClickListener { /* renamed from: com.tencent.mm.plugin.account.bind.ui.BindLinkedInUI$e$a$a reason: collision with other inner class name */ public class DialogInterface$OnCancelListenerC0774a implements DialogInterface.OnCancelListener { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ pk0.d f81048d; public DialogInterface$OnCancelListenerC0774a(a aVar, pk0.d dVar) { this.f81048d = dVar; } public void onCancel(DialogInterface dialogInterface) { z.d().d(this.f81048d); } } public a() { } public void onClick(DialogInterface dialogInterface, int i15) { pk0.d dVar = new pk0.d(1); BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; bindLinkedInUI.E = j.Q(bindLinkedInUI, null, bindLinkedInUI.getString(R.string.ggc), true, false, new DialogInterface$OnCancelListenerC0774a(this, dVar)); z.d().f(dVar); } } public class b implements DialogInterface.OnClickListener { public b(e eVar) { } public void onClick(DialogInterface dialogInterface, int i15) { } } public e() { } public void onClick(View view) { ArrayList arrayList = new ArrayList(); arrayList.add(view); Object[] array = arrayList.toArray(); arrayList.clear(); j30.a.b("com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$4", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array); BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; j.u(bindLinkedInUI, bindLinkedInUI.getString(R.string.beg), null, new a(), new b(this)); j30.a.g(this, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$4", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V"); } } public class f implements View.OnClickListener { public f() { } public void onClick(View view) { ArrayList arrayList = new ArrayList(); arrayList.add(view); Object[] array = arrayList.toArray(); arrayList.clear(); j30.a.b("com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$5", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array); BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; int i15 = BindLinkedInUI.F; bindLinkedInUI.U7(); j30.a.g(this, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$5", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V"); } } public class g implements MenuItem.OnMenuItemClickListener { public g() { } public boolean onMenuItemClick(MenuItem menuItem) { BindLinkedInUI bindLinkedInUI = BindLinkedInUI.this; int i15 = BindLinkedInUI.F; bindLinkedInUI.U7(); return true; } } public class h implements DialogInterface.OnCancelListener { /* renamed from: d reason: collision with root package name */ public final /* synthetic */ pk0.a f81051d; public h(BindLinkedInUI bindLinkedInUI, pk0.a aVar) { this.f81051d = aVar; } public void onCancel(DialogInterface dialogInterface) { z.d().d(this.f81051d); } } public class i extends ClickableSpan { public i() { } public void onClick(View view) { ArrayList arrayList = new ArrayList(); arrayList.add(view); Object[] array = arrayList.toArray(); arrayList.clear(); j30.a.b("com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$8", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V", this, array); j30.a.g(this, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI$8", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V"); } public void updateDrawState(TextPaint textPaint) { textPaint.setColor(BindLinkedInUI.this.getResources().getColor(R.color.f358734vo)); textPaint.setUnderlineText(false); } } public final void T7(boolean z15) { int i15; pk0.a aVar; if (this.f81028n == null) { Log.e("MicroMsg.BindLinkedInUI", "bindBundle is null !!"); return; } if (this.f81035u.f187306y) { i15 = 1; } else { i15 = 2; } pk0.a aVar2 = new pk0.a(1, i15, this.f81039y, this.f81040z, "", this.A, this.B, this.C, this.D); if (!z15) { aVar = aVar2; this.E = j.Q(this, null, getString(R.string.ggc), true, false, new h(this, aVar2)); } else { aVar = aVar2; } z.d().f(aVar); } public final void U7() { if (!this.f81026i) { setResult(-1); finish(); } else if (this.f81031q) { Intent b15 = ((w1) ((dn.h) yz3.j.c(dn.h.class)).mU()).b(this); b15.addFlags(603979776); b15.putExtra("preferred_tab", 2); k30.a aVar = new k30.a(); aVar.c(b15); j30.a.d(this, aVar.b(), "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "goBack", "()V", "Undefined", "startActivity", "(Landroid/content/Intent;)V"); startActivity((Intent) aVar.a(0)); j30.a.e(this, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "goBack", "()V", "Undefined", "startActivity", "(Landroid/content/Intent;)V"); } else { setResult(-1); finish(); } } public final void V7() { String str = (String) z.s().i().e(286721, null); this.f81023f = str; boolean z15 = true; this.f81022e = !Util.isNullOrNil(str); this.f81024g = (String) z.s().i().e(286722, null); int p15 = u0.p(); this.f81029o = p15; if ((p15 & 4194304) == 0) { z15 = false; } this.f81025h = z15; } public final void W7(String str) { int indexOf = getString(R.string.bec).indexOf("%s"); Spannable newSpannable = Spannable.Factory.getInstance().newSpannable(getString(R.string.bec, str)); newSpannable.setSpan(new i(), indexOf, str.length() + indexOf, 33); this.f81032r.setText(newSpannable); } public final void X7(boolean z15, boolean z16, String str, boolean z17) { this.f81038x.setVisibility(8); if (z15) { this.f81033s.setVisibility(8); this.f81032r.setVisibility(0); W7(str); View view = this.f81034t; k30.a aVar = new k30.a(); ThreadLocal<k30.a> threadLocal = k30.c.f244265a; aVar.c(0); j30.a.d(view, aVar.b(), "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "showNormalBindView", "(ZZLjava/lang/String;Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V"); view.setVisibility(((Integer) aVar.a(0)).intValue()); j30.a.e(view, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "showNormalBindView", "(ZZLjava/lang/String;Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V"); this.f81036v.setVisibility(8); if (z16) { this.f81037w.setVisibility(0); } this.f81035u.setCheck(z17); this.f81035u.setSwitchListener(new a()); return; } this.f81032r.setVisibility(8); this.f81032r.setText(getString(R.string.bed)); this.f81033s.setVisibility(0); View view2 = this.f81034t; k30.a aVar2 = new k30.a(); ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a; aVar2.c(8); j30.a.d(view2, aVar2.b(), "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "showNormalBindView", "(ZZLjava/lang/String;Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V"); view2.setVisibility(((Integer) aVar2.a(0)).intValue()); j30.a.e(view2, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "showNormalBindView", "(ZZLjava/lang/String;Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V"); this.f81036v.setVisibility(0); this.f81037w.setVisibility(8); } public final void Y7(boolean z15, boolean z16) { int i15; if (z15) { this.f81029o |= 4194304; } else { this.f81029o &= -4194305; } if (z15) { i15 = 1; } else { i15 = 2; } z.s().i().K(7, Integer.valueOf(this.f81029o)); if (z16) { c42 c422 = new c42(); c422.f17931d = 33; c422.f17932e = i15; ((p) ((k0) z.q(k0.class)).Na0()).h(new kh2.n(23, c422)); ((dn.h) yz3.j.c(dn.h.class)).Ev().tz(); } } public final void Z7() { boolean z15 = this.f81026i; if (z15 && this.f81028n == null) { Log.e("MicroMsg.BindLinkedInUI", "bindBundle is null"); } else if (this.f81027j) { X7(this.f81022e, false, this.f81024g, this.f81025h); } else { boolean z16 = true; if (z15) { if (!this.f81022e || !this.f81023f.equals(this.f81039y)) { z16 = false; } String str = this.f81040z; boolean z17 = this.f81025h; this.f81032r.setVisibility(0); W7(str); View view = this.f81034t; k30.a aVar = new k30.a(); ThreadLocal<k30.a> threadLocal = k30.c.f244265a; aVar.c(0); j30.a.d(view, aVar.b(), "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "showQrBindView", "(ZLjava/lang/String;Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V"); view.setVisibility(((Integer) aVar.a(0)).intValue()); j30.a.e(view, "com/tencent/mm/plugin/account/bind/ui/BindLinkedInUI", "showQrBindView", "(ZLjava/lang/String;Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V"); this.f81037w.setVisibility(8); if (z16) { this.f81033s.setVisibility(8); this.f81036v.setVisibility(8); this.f81038x.setVisibility(8); this.f81035u.setCheck(z17); this.f81035u.setSwitchListener(new rk0.g(this)); return; } this.f81033s.setVisibility(0); this.f81036v.setVisibility(0); this.f81038x.setVisibility(0); this.f81035u.setCheck(z17); this.f81035u.setSwitchListener(new rk0.f(this)); return; } X7(this.f81022e, true, this.f81024g, this.f81025h); } } @Override // com.tencent.mm.ui.MMActivity public int getLayoutId() { return R.layout.f365513ka; } @Override // com.tencent.mm.ui.MMActivity public void initView() { if (this.f81026i) { setMMTitle(R.string.bep); } else if (this.f81027j) { setMMTitle(R.string.bes); } else { setMMTitle(R.string.bei); } this.f81032r = (TextView) findViewById(R.id.f364553mo2); this.f81033s = (TextView) findViewById(R.id.f364554mo3); this.f81034t = findViewById(R.id.mvm); this.f81035u = (MMSwitchBtn) findViewById(R.id.mvl); this.f81036v = (TextView) findViewById(R.id.aht); this.f81037w = (TextView) findViewById(R.id.ory); this.f81038x = (TextView) findViewById(R.id.b5h); this.f81032r.setOnClickListener(new c()); this.f81036v.setOnClickListener(new d()); this.f81037w.setOnClickListener(new e()); this.f81038x.setOnClickListener(new f()); setBackBtn(new g()); Z7(); } @Override // androidx.activity.ComponentActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.MMFragmentActivity public void onActivityResult(int i15, int i16, Intent intent) { int i17; if (intent != null) { if (i15 != 100) { Log.e("MicroMsg.BindLinkedInUI", "onActivityResult unknow request"); return; } Bundle bundleExtra = intent.getBundleExtra("result_data"); String string = bundleExtra.getString("ret"); String string2 = bundleExtra.getString("limid"); String string3 = bundleExtra.getString("liname"); String string4 = bundleExtra.getString("liurl"); String string5 = bundleExtra.getString("liswitch"); if (Util.isNullOrNil(string)) { Log.e("MicroMsg.BindLinkedInUI", "linkedin oauth ret is null, maybe canceled"); return; } int safeParseInt = Util.safeParseInt(string); boolean z15 = true; if (safeParseInt != 0) { Log.e("MicroMsg.BindLinkedInUI", "linkedin oauth bind failed ret %s ", Integer.valueOf(safeParseInt)); if (safeParseInt == 1) { i17 = R.string.ben; } else { i17 = R.string.bem; } j.s(this, getString(i17), null); } else if (Util.isNullOrNil(string2)) { Log.e("MicroMsg.BindLinkedInUI", "linkedin member id is null"); } else { z.s().i().K(286722, string3); z.s().i().K(286721, string2); z.s().i().K(286723, string4); if (!Util.isNullOrNil(string5)) { if (Util.safeParseInt(string5) != 1) { z15 = false; } Y7(z15, false); } V7(); Z7(); String string6 = getString(R.string.bej); if (!isFinishing()) { ak.a.makeText(this, string6, 0).show(); } } } } @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity public void onCreate(Bundle bundle) { super.onCreate(bundle); z.d().a(JsApiChooseMultiMedia.CTRL_INDEX, this); z.d().a(com.tencent.mm.plugin.appbrand.jsapi.contact.n.CTRL_INDEX, this); Bundle bundleExtra = getIntent().getBundleExtra("qrcode_bundle"); this.f81028n = bundleExtra; this.f81026i = bundleExtra != null; if (bundleExtra != null) { this.f81039y = bundleExtra.getString("i"); this.f81040z = this.f81028n.getString("n"); this.A = this.f81028n.getString("t"); this.B = this.f81028n.getString("o"); this.C = this.f81028n.getString("s"); String string = this.f81028n.getString("r"); this.D = string; if (this.f81039y == null || this.f81040z == null || this.A == null || this.C == null || string == null) { j.G(this, getString(R.string.bef), null, false, new b()); } } this.f81027j = getIntent().getBooleanExtra("oversea_entry", false); V7(); if (this.f81026i) { this.f81025h = true; } initView(); if (this.f81028n != null && this.f81022e && this.f81023f.equals(this.f81039y)) { this.f81030p = true; T7(true); } } @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity public void onDestroy() { z.d().p(com.tencent.mm.plugin.appbrand.jsapi.contact.n.CTRL_INDEX, this); z.d().p(JsApiChooseMultiMedia.CTRL_INDEX, this); super.onDestroy(); } @Override // androidx.appcompat.app.AppCompatActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity public boolean onKeyDown(int i15, KeyEvent keyEvent) { if (i15 != 4) { return super.onKeyDown(i15, keyEvent); } U7(); return true; } @Override // androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity public void onPause() { super.onPause(); } @Override // androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity public void onResume() { super.onResume(); } @Override // yf0.n public void onSceneEnd(int i15, int i16, String str, y yVar) { int i17; int i18; ProgressDialog progressDialog = this.E; if (progressDialog != null) { progressDialog.dismiss(); this.E = null; } if (i15 == 0 && i16 == 0) { if (yVar.getType() == 549) { this.f81031q = true; if (!this.f81030p) { i18 = R.string.bej; } else { i18 = R.string.bek; } } else if (yVar.getType() == 550) { i18 = R.string.beu; } else { return; } String string = getString(i18); if (!isFinishing()) { ak.a.makeText(this, string, 0).show(); } V7(); this.f81025h = this.f81035u.f187306y; Z7(); return; } if (yVar.getType() == 549) { if (i16 == 1) { i17 = R.string.ben; } else { i17 = R.string.bem; } } else if (yVar.getType() == 550) { i17 = R.string.beo; } else { return; } j.s(this, getString(i17), null); } }