CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 MainLoginActivity.java 源代码,内容仅作参考
package org.godfootsteps.more.user;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import carbon.custom.FitWidthImageView;
import carbon.widget.FrameLayout;
import com.blankj.utilcode.util.NetworkUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.facebook.AccessToken;
import com.facebook.AuthenticationTokenClaims;
import com.facebook.FacebookException;
import com.facebook.login.LoginBehavior;
import com.facebook.login.LoginClient;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.common.Scopes;
import d.c.a.g.e;
import d.c.a.j.v;
import d.c.g.k3.q0;
import i.c.a.c.m;
import i.c.a.c.m0;
import i.c.a.c.n0;
import i.c.a.c.w;
import i.c.a.c.y;
import i.h.b0.p;
import i.h.c0.j;
import i.h.i;
import i.j.a.e.t.d;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import n.f.g;
import n.g.f.a.c;
import n.i.a.l;
import n.i.b.h;
import n.m.t.a.p.m.e1.a;
import org.commons.sociallogin.SocialLoginFragment;
import org.godfootsteps.arch.R$string;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.model.BaseModel;
import org.godfootsteps.arch.api.model.User;
import org.godfootsteps.arch.api.util.RequestNoResult;
import org.godfootsteps.arch.api.util.UserRequest;
import org.godfootsteps.arch.base.FullScreenActivity;
import org.godfootsteps.arch.util.DebugLog;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.more.R$color;
import org.godfootsteps.more.R$id;
import org.godfootsteps.more.R$layout;
import org.godfootsteps.more.db.UserContext;
import org.godfootsteps.more.user.EmailLoginActivity;
import org.godfootsteps.more.user.MainLoginActivity;
import org.godfootsteps.more.user.UserHelper;
import org.json.JSONObject;
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u0000 \u000f2\u00020\u0001:\u0001\u000fB\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\t\u001a\u00020\nH\u0002J\b\u0010\u000b\u001a\u00020\fH\u0014J\b\u0010\r\u001a\u00020\nH\u0014J\b\u0010\u000e\u001a\u00020\nH\u0014R\u001b\u0010\u0003\u001a\u00020\u00048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0007\u0010\b\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0010"}, d2 = {"Lorg/godfootsteps/more/user/MainLoginActivity;", "Lorg/godfootsteps/arch/base/FullScreenActivity;", "()V", "progressDialog", "Lorg/godfootsteps/arch/dialog/LoadingDialog;", "getProgressDialog", "()Lorg/godfootsteps/arch/dialog/LoadingDialog;", "progressDialog$delegate", "Lkotlin/Lazy;", "clearActivity", "", "getLayoutId", "", "initData", "initView", "Companion", "more_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class MainLoginActivity extends FullScreenActivity {
public static WeakReference<Activity> f16054m;
public final n.c f16055l = i.j.a.e.t.d.n3(new n.i.a.a<d.c.a.g.e>() {
{
super(0);
}
@Override
public final e invoke() {
return new e(MainLoginActivity.this);
}
});
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¨\u0006\u0005"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "org/godfootsteps/arch/util/ViewKt$haveInternetClick$1"}, k = 3, mv = {1, 5, 1}, xi = 48)
public static final class a implements View.OnClickListener {
public final View f16056i;
public final MainLoginActivity f16057j;
public final d.a.d.e f16058k;
public a(View view, MainLoginActivity mainLoginActivity, d.a.d.e eVar) {
this.f16056i = view;
this.f16057j = mainLoginActivity;
this.f16058k = eVar;
}
@Override
public final void onClick(View view) {
if (!NetworkUtils.c()) {
ToastUtils.b(R$string.app_no_internet);
} else {
d.c.a.m.a.r0(this.f16057j, new c(this.f16058k), null);
}
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¨\u0006\u0005"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "org/godfootsteps/arch/util/ViewKt$haveInternetClick$1"}, k = 3, mv = {1, 5, 1}, xi = 48)
public static final class b implements View.OnClickListener {
public final View f16059i;
public final MainLoginActivity f16060j;
public final d.a.d.f f16061k;
public b(View view, MainLoginActivity mainLoginActivity, d.a.d.f fVar) {
this.f16059i = view;
this.f16060j = mainLoginActivity;
this.f16061k = fVar;
}
@Override
public final void onClick(View view) {
if (!NetworkUtils.c()) {
ToastUtils.b(R$string.app_no_internet);
return;
}
MainLoginActivity mainLoginActivity = this.f16060j;
d.c.a.m.a.r0(mainLoginActivity, new d(this.f16061k), null);
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u00032\u0006\u0010\u0005\u001a\u00020\u0006H\n"}, d2 = {"<anonymous>", "", "<anonymous parameter 0>", "Landroid/content/DialogInterface;", "kotlin.jvm.PlatformType", "<anonymous parameter 1>", ""}, k = 3, mv = {1, 5, 1}, xi = 48)
public static final class c implements DialogInterface.OnClickListener {
public final d.a.d.e f16062i;
public c(d.a.d.e eVar) {
this.f16062i = eVar;
}
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
SocialLoginFragment socialLoginFragment;
Activity activity;
Class<?> cls;
String str = null;
if (v.i()) {
List<Activity> b = m0.b();
h.d(b, "getActivityList()");
int i3 = 0;
for (Object obj : b) {
int i4 = i3 + 1;
if (i3 >= 0) {
Activity activity2 = (Activity) obj;
DebugLog debugLog = DebugLog.c;
DebugLog.a().b("fblogin before i:" + i3 + ' ' + ((Object) activity2.getClass().getSimpleName()));
if (i3 == 1) {
h.d(activity2, "activity");
if (e.c0.a.T(activity2)) {
MainLoginActivity.f16054m = new WeakReference<>(activity2);
}
}
i3 = i4;
} else {
g.X();
throw null;
}
}
}
DebugLog debugLog2 = DebugLog.c;
DebugLog a = DebugLog.a();
WeakReference<Activity> weakReference = MainLoginActivity.f16054m;
if (weakReference != null && (activity = weakReference.get()) != null && (cls = activity.getClass()) != null) {
str = cls.getSimpleName();
}
a.b(h.j("fblogin before ", str));
d.a.d.e eVar = this.f16062i;
eVar.c.a = LoginBehavior.NATIVE_WITH_FALLBACK;
ArrayList arrayList = new ArrayList();
arrayList.add("public_profile");
arrayList.add("email");
j jVar = eVar.c;
if (eVar.f4335e == null) {
FragmentManager fragmentManager = eVar.a;
int i5 = SocialLoginFragment.f15174j;
Fragment F = fragmentManager.F("SocialLoginFragment");
if (F == null) {
SocialLoginFragment socialLoginFragment2 = new SocialLoginFragment();
socialLoginFragment2.f15175i = eVar;
e.o.a.d dVar = new e.o.a.d(fragmentManager);
dVar.g(0, socialLoginFragment2, "SocialLoginFragment", 1);
dVar.e();
socialLoginFragment = socialLoginFragment2;
} else {
try {
((SocialLoginFragment) F).f15175i = eVar;
boolean isAdded = F.isAdded();
socialLoginFragment = F;
if (!isAdded) {
e.o.a.d dVar2 = new e.o.a.d(fragmentManager);
dVar2.g(0, F, "SocialLoginFragment", 1);
dVar2.e();
socialLoginFragment = F;
}
} catch (Exception e2) {
e2.printStackTrace();
socialLoginFragment = F;
}
}
eVar.f4335e = (SocialLoginFragment) socialLoginFragment;
}
SocialLoginFragment socialLoginFragment3 = eVar.f4335e;
Objects.requireNonNull(jVar);
p pVar = new p(socialLoginFragment3);
Iterator it = arrayList.iterator();
while (it.hasNext()) {
String str2 = (String) it.next();
if (j.b(str2)) {
throw new FacebookException(String.format("Cannot pass a publish or manage permission (%s) to a request for read authorization", str2));
}
}
String uuid = UUID.randomUUID().toString();
h.d(uuid, "UUID.randomUUID().toString()");
h.e(uuid, AuthenticationTokenClaims.JSON_KEY_NONCE);
if (uuid.length() == 0 ? false : !(n.o.a.l(uuid, ' ', 0, false, 6) >= 0)) {
HashSet hashSet = new HashSet(arrayList);
hashSet.add(Scopes.OPEN_ID);
Set unmodifiableSet = Collections.unmodifiableSet(hashSet);
h.d(unmodifiableSet, "Collections.unmodifiableSet(permissions)");
LoginClient.Request request = new LoginClient.Request(jVar.a, Collections.unmodifiableSet(new HashSet(unmodifiableSet)), jVar.b, jVar.f10167d, i.c(), UUID.randomUUID().toString(), jVar.f10170g, uuid);
request.setRerequest(AccessToken.isCurrentAccessTokenActive());
request.setMessengerPageId(jVar.f10168e);
request.setResetMessengerState(jVar.f10169f);
request.setFamilyLogin(jVar.f10171h);
request.setShouldSkipAccountDeduplication(jVar.f10172i);
jVar.i(new j.d(pVar), request);
return;
}
throw new IllegalArgumentException("Failed requirement.".toString());
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u00032\u0006\u0010\u0005\u001a\u00020\u0006H\n"}, d2 = {"<anonymous>", "", "<anonymous parameter 0>", "Landroid/content/DialogInterface;", "kotlin.jvm.PlatformType", "<anonymous parameter 1>", ""}, k = 3, mv = {1, 5, 1}, xi = 48)
public static final class d implements DialogInterface.OnClickListener {
public final d.a.d.f f16064j;
public d(d.a.d.f fVar) {
this.f16064j = fVar;
}
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
SocialLoginFragment socialLoginFragment;
MainLoginActivity.b0(MainLoginActivity.this).b();
d.a.d.f fVar = this.f16064j;
if (fVar.f4336d == null) {
FragmentManager fragmentManager = fVar.a;
int i3 = SocialLoginFragment.f15174j;
Fragment F = fragmentManager.F("SocialLoginFragment");
if (F == null) {
SocialLoginFragment socialLoginFragment2 = new SocialLoginFragment();
socialLoginFragment2.f15175i = fVar;
e.o.a.d dVar = new e.o.a.d(fragmentManager);
dVar.g(0, socialLoginFragment2, "SocialLoginFragment", 1);
dVar.e();
socialLoginFragment = socialLoginFragment2;
} else {
try {
((SocialLoginFragment) F).f15175i = fVar;
boolean isAdded = F.isAdded();
socialLoginFragment = F;
if (!isAdded) {
e.o.a.d dVar2 = new e.o.a.d(fragmentManager);
dVar2.g(0, F, "SocialLoginFragment", 1);
dVar2.e();
socialLoginFragment = F;
}
} catch (Exception e2) {
e2.printStackTrace();
socialLoginFragment = F;
}
}
fVar.f4336d = (SocialLoginFragment) socialLoginFragment;
}
fVar.f4336d.startActivityForResult(fVar.b.getSignInIntent(), 99);
}
}
@Metadata(d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\u001c\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0016J\u0012\u0010\t\u001a\u00020\u00032\b\u0010\n\u001a\u0004\u0018\u00010\u000bH\u0016¨\u0006\f"}, d2 = {"org/godfootsteps/more/user/MainLoginActivity$initView$facebookLogin$1", "Lorg/commons/sociallogin/FBLoginListener;", "onCancel", "", "onCompleted", "jsonObject", "Lorg/json/JSONObject;", "token", "Lcom/facebook/AccessToken;", "onError", "error", "Lcom/facebook/FacebookException;", "more_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class e implements d.a.d.c {
@Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"org/godfootsteps/more/user/MainLoginActivity$initView$facebookLogin$1$onCompleted$1", "Lorg/godfootsteps/more/user/UserHelper$LoginListener;", "onLoginFailure", "", "onLoginSuccess", "more_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class a implements UserHelper.a {
public final MainLoginActivity f16065i;
public a(MainLoginActivity mainLoginActivity) {
this.f16065i = mainLoginActivity;
}
@Override
public void D() {
GAEventSendUtil.a.y("Facebook");
ToastUtils.b(org.godfootsteps.more.R$string.user_login_success);
this.f16065i.finish();
}
@Override
public void v() {
MainLoginActivity.a0(this.f16065i);
ToastUtils.b(org.godfootsteps.more.R$string.app_error_occurred);
}
}
public e() {
}
@Override
public void a(FacebookException facebookException) {
MainLoginActivity.a0(MainLoginActivity.this);
ToastUtils.b(org.godfootsteps.more.R$string.app_error_occurred);
}
@Override
public void b() {
MainLoginActivity.a0(MainLoginActivity.this);
ToastUtils.b(org.godfootsteps.more.R$string.app_cancel);
}
@Override
public void c(JSONObject jSONObject, AccessToken accessToken) {
if (jSONObject == null) {
MainLoginActivity.a0(MainLoginActivity.this);
ToastUtils.b(org.godfootsteps.more.R$string.app_error_occurred);
return;
}
UserHelper userHelper = new UserHelper(new a(MainLoginActivity.this));
h.e(jSONObject, "jsonObject");
final q0 q0Var = userHelper.c;
Objects.requireNonNull(q0Var);
h.e(jSONObject, "jsonObject");
try {
String optString = jSONObject.optString("id");
String J = e.c0.a.J(w.c(), jSONObject.optString("first_name"));
String J2 = e.c0.a.J(w.c(), jSONObject.optString("last_name"));
String optString2 = jSONObject.optString("email");
String J3 = e.c0.a.J(w.c(), jSONObject.optString("name"));
final User user = new User();
user.setUserId(optString);
user.setFirstName(J);
user.setLastName(J2);
user.setAccountType(1);
user.setAvatar("https://graph.facebook.com/" + ((Object) optString) + "/picture?type=large");
final JSONObject jSONObject2 = new JSONObject();
jSONObject2.put(AccessToken.DEFAULT_GRAPH_DOMAIN, optString);
jSONObject2.put("firstName", J);
jSONObject2.put("lastName", J2);
jSONObject2.put("email", optString2);
jSONObject2.put("name", J3);
jSONObject2.put("com", "android");
n.m.t.a.p.m.e1.a.g2(new l<RequestNoResult<BaseModel<String>, BaseModel<String>>, n.e>() {
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", ""}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.more.user.UserDataSource$fbRegister$1$1", f = "UserDataSource.kt", l = {137}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super BaseModel<String>>, Object> {
public final JSONObject $userObj;
public int label;
public AnonymousClass1(JSONObject jSONObject, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$userObj = jSONObject;
}
@Override
public final n.g.c<n.e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$userObj, cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<String>> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(n.e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
String j0;
String j02;
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(AppClient.a);
AppClient appClient = AppClient.Companion.f15176d;
String jSONObject = this.$userObj.toString();
h.d(jSONObject, "userObj.toString()");
j0 = a.j0(n.o.a.w(jSONObject, "\\", "", false, 4), (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
this.label = 1;
String c = i.c.a.c.j.a().c();
h.d(c, "getInstance().sequence");
j02 = a.j0(c, (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
obj = appClient.g0(j0, j02, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public n.e invoke(RequestNoResult<BaseModel<String>, BaseModel<String>> requestNoResult) {
invoke2(requestNoResult);
return n.e.a;
}
public final void invoke2(RequestNoResult<BaseModel<String>, BaseModel<String>> requestNoResult) {
h.e(requestNoResult, "$this$requestNoResult");
requestNoResult.f(new AnonymousClass1(jSONObject2, null));
final User user2 = user;
final q0 q0Var2 = q0Var;
requestNoResult.f15180l = new l<BaseModel<String>, n.e>() {
{
super(1);
}
@Override
public n.e invoke(BaseModel<String> baseModel) {
invoke2(baseModel);
return n.e.a;
}
public final void invoke2(BaseModel<String> baseModel) {
l<? super Integer, n.e> lVar;
boolean z;
String avatar;
h.e(baseModel, "model");
try {
int status = baseModel.getStatus();
if (status == -2) {
q0.a(q0Var2);
} else if (status != 1 && status != 2) {
l<? super Integer, n.e> lVar2 = q0Var2.a;
if (lVar2 == null) {
return;
}
lVar2.invoke(-1);
} else {
if (status == 2) {
User user3 = (User) m.a(a.Z(baseModel.getResult(), null, 1), User.class);
User user4 = User.this;
user4.setFirstName(user3.getFirstName());
user4.setLastName(user3.getLastName());
String avatar2 = user3.getAvatar();
if (avatar2 != null && avatar2.length() != 0) {
z = false;
if (!z) {
String avatar3 = user3.getAvatar();
h.d(avatar3, "resultUser.avatar");
if (!n.o.a.B(avatar3, "http", true)) {
Objects.requireNonNull(AppClient.a);
avatar = h.j("https://appservercn.kingdomsalvation.org", user3.getAvatar());
} else {
avatar = user3.getAvatar();
}
user4.setAvatar(avatar);
}
user4.setSignature(user3.getSignature());
user4.setUserSignature(user3.getUserSignature());
user4.setInsider(user3.getInsider());
user4.setCountry(user3.getCountry());
user4.setClientId(user3.getClientId());
user4.setUserUrl(user3.getUserUrl());
}
z = true;
if (!z) {
}
user4.setSignature(user3.getSignature());
user4.setUserSignature(user3.getUserSignature());
user4.setInsider(user3.getInsider());
user4.setCountry(user3.getCountry());
user4.setClientId(user3.getClientId());
user4.setUserUrl(user3.getUserUrl());
}
User.this.setStatus(1);
User.this.setAccountType(1);
UserContext userContext = UserContext.a;
boolean z2 = h.a(UserContext.c.getInsider(), User.this.getInsider()) ? false : true;
if (UserContext.p(User.this)) {
l<? super Integer, n.e> lVar3 = q0Var2.a;
if (lVar3 != null) {
lVar3.invoke(1);
}
if (z2 && (lVar = q0Var2.a) != null) {
lVar.invoke(-998);
return;
}
return;
}
l<? super Integer, n.e> lVar4 = q0Var2.a;
if (lVar4 == null) {
return;
}
lVar4.invoke(-1000);
}
} catch (Exception unused) {
l<? super Integer, n.e> lVar5 = q0Var2.a;
if (lVar5 == null) {
return;
}
lVar5.invoke(-1000);
}
}
};
final q0 q0Var3 = q0Var;
requestNoResult.f15181m = new n.i.a.p<Integer, String, n.e>() {
{
super(2);
}
@Override
public n.e invoke(Integer num, String str) {
invoke(num.intValue(), str);
return n.e.a;
}
public final void invoke(int i2, String str) {
h.e(str, "$noName_1");
l<? super Integer, n.e> lVar = q0.this.a;
if (lVar == null) {
return;
}
lVar.invoke(-1);
}
};
}
});
} catch (Exception unused) {
l<? super Integer, n.e> lVar = q0Var.a;
if (lVar == null) {
return;
}
lVar.invoke(-1000);
}
}
}
@Metadata(d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016J\u0012\u0010\u0005\u001a\u00020\u00032\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0016¨\u0006\b"}, d2 = {"org/godfootsteps/more/user/MainLoginActivity$initView$googleLogin$1", "Lorg/commons/sociallogin/GoogleLoginListener;", "onCanceled", "", "onFailed", "onSuccess", "account", "Lcom/google/android/gms/auth/api/signin/GoogleSignInAccount;", "more_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class f implements d.a.d.g {
@Metadata(d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\b\u0010\u0004\u001a\u00020\u0003H\u0016¨\u0006\u0005"}, d2 = {"org/godfootsteps/more/user/MainLoginActivity$initView$googleLogin$1$onSuccess$1", "Lorg/godfootsteps/more/user/UserHelper$LoginListener;", "onLoginFailure", "", "onLoginSuccess", "more_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public static final class a implements UserHelper.a {
public final MainLoginActivity f16066i;
public a(MainLoginActivity mainLoginActivity) {
this.f16066i = mainLoginActivity;
}
@Override
public void D() {
d.c.a.g.e b0 = MainLoginActivity.b0(this.f16066i);
if (b0 != null) {
b0.a();
}
GAEventSendUtil.a.y("Google");
ToastUtils.b(org.godfootsteps.more.R$string.user_login_success);
this.f16066i.finish();
}
@Override
public void v() {
d.c.a.g.e b0 = MainLoginActivity.b0(this.f16066i);
if (b0 != null) {
b0.a();
}
ToastUtils.b(org.godfootsteps.more.R$string.app_error_occurred);
}
}
public f() {
}
@Override
public void a(final GoogleSignInAccount googleSignInAccount) {
String uri;
UserHelper userHelper = new UserHelper(new a(MainLoginActivity.this));
h.e(googleSignInAccount, "account");
final q0 q0Var = userHelper.c;
Objects.requireNonNull(q0Var);
h.e(googleSignInAccount, "account");
try {
final String email = googleSignInAccount.getEmail();
String str = "";
if (email == null) {
email = "";
}
final JSONObject jSONObject = new JSONObject();
Context c = w.c();
String givenName = googleSignInAccount.getGivenName();
if (givenName == null) {
givenName = "";
}
jSONObject.put("firstName", e.c0.a.J(c, givenName));
Context c2 = w.c();
String familyName = googleSignInAccount.getFamilyName();
if (familyName == null) {
familyName = "";
}
jSONObject.put("lastName", e.c0.a.J(c2, familyName));
jSONObject.put("email", email);
String idToken = googleSignInAccount.getIdToken();
if (idToken == null) {
idToken = "";
}
jSONObject.put("token", idToken);
Uri photoUrl = googleSignInAccount.getPhotoUrl();
if (photoUrl != null && (uri = photoUrl.toString()) != null) {
str = uri;
}
jSONObject.put("avatar", str);
jSONObject.put("com", "android");
n.m.t.a.p.m.e1.a.N2(new l<UserRequest<String, BaseModel<String>>, n.e>() {
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", ""}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.more.user.UserDataSource$googleRegister$1$1", f = "UserDataSource.kt", l = {269}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super BaseModel<String>>, Object> {
public final JSONObject $userObj;
public int label;
public AnonymousClass1(JSONObject jSONObject, n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
this.$userObj = jSONObject;
}
@Override
public final n.g.c<n.e> create(n.g.c<?> cVar) {
return new AnonymousClass1(this.$userObj, cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<String>> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(n.e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
String j0;
String j02;
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(AppClient.a);
AppClient appClient = AppClient.Companion.f15176d;
String jSONObject = this.$userObj.toString();
h.d(jSONObject, "userObj.toString()");
j0 = a.j0(n.o.a.w(jSONObject, "\\", "", false, 4), (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
this.label = 1;
String c = i.c.a.c.j.a().c();
h.d(c, "getInstance().sequence");
j02 = a.j0(c, (r2 & 1) != 0 ? "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjaVHmBid5Zx/6sKltt396TEDWt55xO1aCHqtUZh2XMC1Yrzm3CzhW+cbIyuQTZP2nLPDpkfk/UdBNafaqzTYNFPqwBKbcrlDukKcRTytS5mVQDwP7g0CJpJtDOQhBX4Vl/5aL8H91cSXqGa2E6PnR77uRwsyihufRWM6zcwf6QQIDAQAB" : null);
obj = appClient.Q(j0, j02, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public n.e invoke(UserRequest<String, BaseModel<String>> userRequest) {
invoke2(userRequest);
return n.e.a;
}
public final void invoke2(UserRequest<String, BaseModel<String>> userRequest) {
h.e(userRequest, "$this$userRequest");
userRequest.f(new AnonymousClass1(jSONObject, null));
final q0 q0Var2 = q0Var;
final String str2 = email;
final GoogleSignInAccount googleSignInAccount2 = googleSignInAccount;
userRequest.f15180l = new l<String, n.e>() {
{
super(1);
}
@Override
public n.e invoke(String str3) {
invoke2(str3);
return n.e.a;
}
public final void invoke2(String str3) {
boolean z;
Uri photoUrl2;
String str4;
l<? super Integer, n.e> lVar;
String uri2;
h.e(str3, "result");
User user = (User) m.a(a.Z(str3, null, 1), User.class);
UserContext userContext = UserContext.a;
boolean z2 = !h.a(UserContext.c.getInsider(), user.getInsider());
try {
String str5 = str2;
GoogleSignInAccount googleSignInAccount3 = googleSignInAccount2;
user.setUserId(str5);
String avatar = user.getAvatar();
if (avatar != null && avatar.length() != 0) {
z = false;
if (!z) {
String avatar2 = user.getAvatar();
h.d(avatar2, "avatar");
if (!n.o.a.B(avatar2, "http", true)) {
Objects.requireNonNull(AppClient.a);
user.setAvatar(h.j("https://appservercn.kingdomsalvation.org", user.getAvatar()));
}
}
user.setStatus(1);
user.setAccountType(2);
user.setFirstName(googleSignInAccount3.getGivenName());
user.setLastName(googleSignInAccount3.getFamilyName());
photoUrl2 = googleSignInAccount3.getPhotoUrl();
str4 = "";
if (photoUrl2 != null && (uri2 = photoUrl2.toString()) != null) {
str4 = uri2;
}
user.setAvatar(str4);
h.d(user, "user");
if (!UserContext.p(user)) {
l<? super Integer, n.e> lVar2 = q0.this.a;
if (lVar2 != null) {
lVar2.invoke(1);
}
if (z2 && (lVar = q0.this.a) != null) {
lVar.invoke(-998);
return;
}
return;
}
l<? super Integer, n.e> lVar3 = q0.this.a;
if (lVar3 == null) {
return;
}
lVar3.invoke(-1000);
return;
}
z = true;
if (!z) {
}
user.setStatus(1);
user.setAccountType(2);
user.setFirstName(googleSignInAccount3.getGivenName());
user.setLastName(googleSignInAccount3.getFamilyName());
photoUrl2 = googleSignInAccount3.getPhotoUrl();
str4 = "";
if (photoUrl2 != null) {
str4 = uri2;
}
user.setAvatar(str4);
h.d(user, "user");
if (!UserContext.p(user)) {
}
} catch (Exception unused) {
l<? super Integer, n.e> lVar4 = q0.this.a;
if (lVar4 == null) {
return;
}
lVar4.invoke(-1000);
}
}
};
final q0 q0Var3 = q0Var;
userRequest.f15181m = new n.i.a.p<Integer, String, n.e>() {
{
super(2);
}
@Override
public n.e invoke(Integer num, String str3) {
invoke(num.intValue(), str3);
return n.e.a;
}
public final void invoke(int i2, String str3) {
h.e(str3, "$noName_1");
if (i2 == -2) {
q0.a(q0.this);
return;
}
l<? super Integer, n.e> lVar = q0.this.a;
if (lVar == null) {
return;
}
lVar.invoke(Integer.valueOf(i2));
}
};
}
});
} catch (Exception unused) {
l<? super Integer, n.e> lVar = q0Var.a;
if (lVar == null) {
return;
}
lVar.invoke(-1000);
}
}
@Override
public void b() {
d.c.a.g.e b0 = MainLoginActivity.b0(MainLoginActivity.this);
if (b0 != null) {
b0.a();
}
ToastUtils.b(org.godfootsteps.more.R$string.app_error_occurred);
}
@Override
public void onCanceled() {
d.c.a.g.e b0 = MainLoginActivity.b0(MainLoginActivity.this);
if (b0 != null) {
b0.a();
}
ToastUtils.b(org.godfootsteps.more.R$string.app_cancel);
}
}
public static final void a0(MainLoginActivity mainLoginActivity) {
Objects.requireNonNull(mainLoginActivity);
f16054m = null;
}
public static final d.c.a.g.e b0(MainLoginActivity mainLoginActivity) {
return (d.c.a.g.e) mainLoginActivity.f16055l.getValue();
}
@Override
public int Q() {
return R$layout.activity_main_login;
}
@Override
public void R() {
}
@Override
public void W() {
if (v.i()) {
((FrameLayout) findViewById(R$id.ll_fb_login)).getLayoutParams().width = y.E(360.0f);
ViewGroup.LayoutParams layoutParams = ((ImageView) findViewById(R$id.iv_back)).getLayoutParams();
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
ConstraintLayout.a aVar = (ConstraintLayout.a) layoutParams;
int i2 = R$id.iv_logo;
aVar.bottomToTop = ((FitWidthImageView) findViewById(i2)).getId();
aVar.verticalChainStyle = 1;
ViewGroup.LayoutParams layoutParams2 = ((FitWidthImageView) findViewById(i2)).getLayoutParams();
Objects.requireNonNull(layoutParams2, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
ConstraintLayout.a aVar2 = (ConstraintLayout.a) layoutParams2;
((ViewGroup.MarginLayoutParams) aVar2).topMargin = 0;
int i3 = R$id.cl_btns;
aVar2.bottomToTop = ((carbon.widget.ConstraintLayout) findViewById(i3)).getId();
int E = y.E(96.0f);
((ViewGroup.MarginLayoutParams) aVar2).width = E;
((ViewGroup.MarginLayoutParams) aVar2).height = E;
ViewGroup.LayoutParams layoutParams3 = ((carbon.widget.ConstraintLayout) findViewById(i3)).getLayoutParams();
Objects.requireNonNull(layoutParams3, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
ConstraintLayout.a aVar3 = (ConstraintLayout.a) layoutParams3;
((ViewGroup.MarginLayoutParams) aVar3).topMargin = 0;
aVar3.bottomToBottom = ((ConstraintLayout) findViewById(R$id.cl_root)).getId();
carbon.widget.ConstraintLayout constraintLayout = (carbon.widget.ConstraintLayout) findViewById(i3);
h.d(constraintLayout, "cl_btns");
n0.s(constraintLayout, y.E(8.0f));
}
((carbon.widget.ConstraintLayout) findViewById(R$id.cl_btns)).post(new Runnable() {
@Override
public final void run() {
MainLoginActivity mainLoginActivity = MainLoginActivity.this;
WeakReference<Activity> weakReference = MainLoginActivity.f16054m;
n.i.b.h.e(mainLoginActivity, "this$0");
View rootView = ((android.widget.FrameLayout) mainLoginActivity.findViewById(16908290)).getRootView();
if (rootView.getBackground() != null) {
rootView.getBackground().mutate().setColorFilter(e.i.b.a.b(mainLoginActivity, R$color.background1), PorterDuff.Mode.SRC_IN);
}
}
});
if (e.c0.a.R()) {
r2.intValue();
r2 = v.j() ? 654311423 : null;
int intValue = r2 == null ? -3092272 : r2.intValue();
((FrameLayout) findViewById(R$id.ll_fb_login)).setBackgroundColor(intValue);
((FrameLayout) findViewById(R$id.ll_google_login)).setBackgroundColor(intValue);
((FrameLayout) findViewById(R$id.ll_email_login)).setBackgroundColor(intValue);
FrameLayout frameLayout = (FrameLayout) findViewById(R$id.fl_create_account);
Integer num = 654311423;
num.intValue();
Integer num2 = v.j() ? num : null;
frameLayout.setBackgroundColor(num2 == null ? 452984831 : num2.intValue());
((TextView) findViewById(R$id.tv_create_account)).setTextColor(e.i.b.a.b(this, R$color.login_btn_text_color));
if (v.i()) {
((ConstraintLayout) findViewById(R$id.cl_root)).setBackgroundColor(0);
((TextView) findViewById(R$id.tv_fb_login)).setTextColor(-15196633);
((TextView) findViewById(R$id.tv_google_login)).setTextColor(-15196633);
((TextView) findViewById(R$id.tv_email_login)).setTextColor(-15196633);
}
}
((ImageView) findViewById(R$id.iv_back)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MainLoginActivity mainLoginActivity = MainLoginActivity.this;
WeakReference<Activity> weakReference = MainLoginActivity.f16054m;
n.i.b.h.e(mainLoginActivity, "this$0");
mainLoginActivity.onBackPressed();
}
});
d.a.d.e eVar = new d.a.d.e(this, new e());
FrameLayout frameLayout2 = (FrameLayout) findViewById(R$id.ll_fb_login);
h.d(frameLayout2, "ll_fb_login");
e.c0.a.b(frameLayout2, 500L, new a(frameLayout2, this, eVar));
d.a.d.f fVar = new d.a.d.f("71252397327-sl6r0vd22qa2tolb3tv1mqbrkoid1ap2.apps.googleusercontent.com", this, new f());
FrameLayout frameLayout3 = (FrameLayout) findViewById(R$id.ll_google_login);
h.d(frameLayout3, "ll_google_login");
e.c0.a.b(frameLayout3, 500L, new b(frameLayout3, this, fVar));
((FrameLayout) findViewById(R$id.ll_email_login)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MainLoginActivity mainLoginActivity = MainLoginActivity.this;
WeakReference<Activity> weakReference = MainLoginActivity.f16054m;
n.i.b.h.e(mainLoginActivity, "this$0");
n.i.b.h.e(mainLoginActivity, "context");
Intent putExtra = new Intent(mainLoginActivity, EmailLoginActivity.class).putExtra("isLogin", true);
n.i.b.h.d(putExtra, "Intent(context, EmailLog…Extra(\"isLogin\", isLogin)");
mainLoginActivity.startActivity(putExtra);
}
});
((FrameLayout) findViewById(R$id.fl_create_account)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MainLoginActivity mainLoginActivity = MainLoginActivity.this;
WeakReference<Activity> weakReference = MainLoginActivity.f16054m;
n.i.b.h.e(mainLoginActivity, "this$0");
n.i.b.h.e(mainLoginActivity, "context");
Intent putExtra = new Intent(mainLoginActivity, EmailLoginActivity.class).putExtra("isLogin", false);
n.i.b.h.d(putExtra, "Intent(context, EmailLog…Extra(\"isLogin\", isLogin)");
mainLoginActivity.startActivity(putExtra);
}
});
}
}