Wallkin v1.86859532693版本的 MD5 值为:c3099a56aae2c3706b2239994117cc3a
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.joaomgcd.taskerm.signin;
import android.content.Context;
import b.a.p;
import c.a.z;
import c.f.b.k;
import c.f.b.l;
import c.q;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.joaomgcd.taskerm.net.ab;
import com.joaomgcd.taskerm.notification.as;
import com.joaomgcd.taskerm.notification.av;
import com.joaomgcd.taskerm.notification.aw;
import com.joaomgcd.taskerm.util.al;
import com.joaomgcd.taskerm.util.an;
import com.joaomgcd.taskerm.util.cr;
import com.joaomgcd.taskerm.util.cs;
import com.joaomgcd.taskerm.util.cu;
import com.joaomgcd.taskerm.util.cv;
import java.util.HashMap;
import net.danlew.android.joda.R;
import net.dinglisch.android.taskerm.bo;
public final class c {
public static final a f8926a = new a(null);
public static final class a {
public static final class f<T, R> implements b.a.d.g<T, R> {
public static final f f8936a = new f();
f() {
}
public final boolean a(String str) {
k.b(str, "it");
return true;
}
@Override
public Object apply(Object obj) {
return Boolean.valueOf(a((String) obj));
}
}
private a() {
}
public a(c.f.b.g gVar) {
this();
}
public final com.google.android.gms.auth.api.signin.c c(Context context, com.joaomgcd.taskerm.signin.a aVar) {
return com.google.android.gms.auth.api.signin.a.a(context, aVar.a());
}
private final com.google.android.gms.auth.api.signin.c e(Context context) {
GoogleSignInOptions b2;
b2 = com.joaomgcd.taskerm.signin.d.b();
return com.google.android.gms.auth.api.signin.a.a(context, b2);
}
public static final class j extends l implements c.f.a.a<b.a.l<GoogleSignInAccount>> {
final Context f8943a;
final com.joaomgcd.taskerm.signin.a f8944b;
j(Context context, com.joaomgcd.taskerm.signin.a aVar) {
super(0);
this.f8943a = context;
this.f8944b = aVar;
}
@Override
public final b.a.l<GoogleSignInAccount> invoke() {
com.google.android.gms.c.e<GoogleSignInAccount> b2 = c.f8926a.c(this.f8943a, this.f8944b).b();
k.a((Object) b2, "context.getGoogleAccount…ient(args).silentSignIn()");
return an.a((com.google.android.gms.c.e) b2);
}
}
public final b.a.l<GoogleSignInAccount> d(Context context, com.joaomgcd.taskerm.signin.a aVar) {
return com.joaomgcd.taskerm.rx.h.a(new j(context, aVar));
}
public static final class h extends l implements c.f.a.a<GoogleSignInAccount> {
final Context f8938a;
final com.joaomgcd.taskerm.signin.a f8939b;
h(Context context, com.joaomgcd.taskerm.signin.a aVar) {
super(0);
this.f8938a = context;
this.f8939b = aVar;
}
@Override
public final GoogleSignInAccount invoke() {
c.f8926a.d(this.f8938a).b();
cr b2 = new ActionGoogleSignIn(this.f8939b).run(this.f8938a).b();
if (b2 instanceof cs) {
throw new com.joaomgcd.taskerm.signin.b(((cs) b2).c());
}
if (b2 == null) {
throw new q("null cannot be cast to non-null type com.joaomgcd.taskerm.util.SimpleResultSuccessWithPayload<com.google.android.gms.auth.api.signin.GoogleSignInAccount>");
}
return (GoogleSignInAccount) ((cv) b2).c();
}
}
public final b.a.l<GoogleSignInAccount> e(Context context, com.joaomgcd.taskerm.signin.a aVar) {
return com.joaomgcd.taskerm.rx.h.b(new h(context, aVar));
}
public final aw f(Context context, com.joaomgcd.taskerm.signin.a aVar) {
String b2 = aVar.b();
if (b2 == null) {
b2 = al.a(context);
}
String a2 = an.a((int) R.string.dc_authorization_needed, context, new Object[0]);
String a3 = an.a((int) R.string.dc_click_here_to_authorize_app, context, b2);
aVar.a(true);
String str = a3;
return new aw(context, a2, str, null, null, null, false, com.joaomgcd.taskerm.util.g.f9751b.a() ? new av((int) R.drawable.mw_hardware_security) : new av(al.M(context)), null, a2 + a3, null, 0, 0L, new com.joaomgcd.taskerm.notification.c(context, new ActionGoogleSignIn(aVar), (String) null, (as) null, 12, (c.f.b.g) null), false, false, null, null, null, new com.joaomgcd.taskerm.notification.an("GA", a2, "Shown when further authorizations for the user's Google account are needed.", 0, null, null, false, null, false, null, null, 2040, null), null, false, false, 7855480, null);
}
public static final class C0244a extends l implements c.f.a.a<String> {
final String[] f8927a;
final Context f8928b;
final String f8929c;
final boolean f8930d;
C0244a(String[] strArr, Context context, String str, boolean z) {
super(0);
this.f8927a = strArr;
this.f8928b = context;
this.f8929c = str;
this.f8930d = z;
}
@Override
public final String invoke() {
String a2 = c.a.d.a(this.f8927a, " ", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (c.f.a.b) null, 62, (Object) null);
boolean z = false;
if (a2.length() == 0) {
a2 = "https://www.googleapis.com/auth/userinfo.email";
}
try {
Context context = this.f8928b;
String str = this.f8929c;
return com.google.android.gms.auth.b.a(context, str, "oauth2:" + a2);
} catch (Exception unused) {
if (this.f8930d && al.f(this.f8928b)) {
z = true;
}
if (z) {
c.f8926a.f(this.f8928b, new com.joaomgcd.taskerm.signin.a(null, null, false, this.f8927a, null, false, 55, null)).c().b();
}
StringBuilder sb = new StringBuilder();
sb.append("Can't get token for ");
sb.append(this.f8929c);
sb.append('.');
sb.append(z ? " Notification posted asking for authorization" : "");
sb.append(' ');
throw new com.joaomgcd.taskerm.signin.b(sb.toString());
}
}
}
public final b.a.l<String> a(Context context, String str, boolean z, String[] strArr) {
k.b(context, "context");
k.b(str, "account");
k.b(strArr, "scopes");
return com.joaomgcd.taskerm.rx.h.b(new C0244a(strArr, context, str, z));
}
public static final class b extends l implements c.f.a.a<String> {
final Context f8931a;
final com.joaomgcd.taskerm.signin.a f8932b;
b(Context context, com.joaomgcd.taskerm.signin.a aVar) {
super(0);
this.f8931a = context;
this.f8932b = aVar;
}
@Override
public final String invoke() {
GoogleSignInAccount a2 = c.f8926a.a(this.f8931a);
String c2 = a2 != null ? a2.c() : null;
if (c2 == null) {
c.f8926a.f(this.f8931a, this.f8932b).c().b();
throw new com.joaomgcd.taskerm.signin.b("No account currently signed in");
}
return c.f8926a.a(this.f8931a, c2, true, this.f8932b.e()).b();
}
}
public final b.a.l<String> a(Context context, com.joaomgcd.taskerm.signin.a aVar) {
k.b(context, "context");
k.b(aVar, "args");
return com.joaomgcd.taskerm.rx.h.b(new b(context, aVar));
}
static final class d<T, R> implements b.a.d.g<T, R> {
public static final d f8934a = new d();
d() {
}
@Override
public final HashMap<String, String> apply(String str) {
k.b(str, "it");
return z.b(ab.a(str));
}
}
public final b.a.l<HashMap<String, String>> b(Context context, com.joaomgcd.taskerm.signin.a aVar) {
k.b(context, "context");
k.b(aVar, "args");
return c.f8926a.a(context, aVar).c(d.f8934a);
}
public final b.a.l<Boolean> a(Context context, String str, String[] strArr) {
k.b(context, "context");
k.b(str, "account");
k.b(strArr, "scopes");
b.a.l<Boolean> d2 = a(context, str, false, strArr).c(f.f8936a).d(g.f8937a);
k.a((Object) d2, "getToken(context, accoun…just(false)\n }");
return d2;
}
public static final class g<T, R> implements b.a.d.g<Throwable, p<? extends Boolean>> {
public static final g f8937a = new g();
g() {
}
@Override
public final b.a.l<Boolean> apply(Throwable th) {
k.b(th, "it");
return b.a.l.a(false);
}
}
static final class C0245c<T, R> implements b.a.d.g<T, R> {
public static final C0245c f8933a = new C0245c();
C0245c() {
}
@Override
public final HashMap<String, String> apply(String str) {
k.b(str, "it");
return z.b(ab.a(str));
}
}
public final b.a.l<HashMap<String, String>> b(Context context, String str, boolean z, String[] strArr) {
k.b(context, "context");
k.b(str, "account");
k.b(strArr, "scopes");
return a(context, str, z, strArr).c(C0245c.f8933a);
}
public final GoogleSignInAccount a(Context context) {
k.b(context, "context");
return com.google.android.gms.auth.api.signin.a.a(context);
}
public final boolean b(Context context) {
k.b(context, "context");
return a(context) != null;
}
public final String c(Context context) {
String c2;
k.b(context, "context");
GoogleSignInAccount a2 = com.google.android.gms.auth.api.signin.a.a(context);
if (a2 == null || (c2 = a2.c()) == null) {
throw new com.joaomgcd.taskerm.signin.b("No account currently signed in");
}
return c2;
}
public static b.a.l a(a aVar, Context context, boolean z, com.joaomgcd.taskerm.signin.a aVar2, int i2, Object obj) {
if ((i2 & 2) != 0) {
z = true;
}
if ((i2 & 4) != 0) {
aVar2 = new com.joaomgcd.taskerm.signin.a(null, null, false, null, null, false, 63, null);
}
return aVar.a(context, z, aVar2);
}
public static final class i extends l implements c.f.a.a<GoogleSignInAccount> {
final boolean f8940a;
final Context f8941b;
final com.joaomgcd.taskerm.signin.a f8942c;
i(boolean z, Context context, com.joaomgcd.taskerm.signin.a aVar) {
super(0);
this.f8940a = z;
this.f8941b = context;
this.f8942c = aVar;
}
@Override
public final GoogleSignInAccount invoke() {
GoogleSignInAccount googleSignInAccount = null;
if (this.f8940a) {
googleSignInAccount = c.f8926a.a(this.f8941b);
String c2 = googleSignInAccount != null ? googleSignInAccount.c() : null;
if (c2 != null) {
try {
c.f8926a.a(this.f8941b, c2, false, this.f8942c.e()).b();
if (googleSignInAccount != null) {
return googleSignInAccount;
}
throw new RuntimeException("This should never happen. Account has to exist because email exists");
} catch (Exception unused) {
bo.b("GA", "Signed in account " + c2 + " needs extra permissions: " + c.a.d.a(this.f8942c.e(), ", ", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (c.f.a.b) null, 62, (Object) null));
}
}
}
if (this.f8940a) {
try {
googleSignInAccount = (GoogleSignInAccount) c.f8926a.d(this.f8941b, this.f8942c).b();
} catch (Exception unused2) {
googleSignInAccount = null;
}
}
return googleSignInAccount != null ? googleSignInAccount : (GoogleSignInAccount) c.f8926a.e(this.f8941b, this.f8942c).b();
}
}
public final b.a.l<GoogleSignInAccount> a(Context context, boolean z, com.joaomgcd.taskerm.signin.a aVar) {
k.b(context, "context");
k.b(aVar, "args");
return com.joaomgcd.taskerm.rx.h.b(new i(z, context, aVar));
}
public static final class e<T, R> implements b.a.d.g<Throwable, p<? extends cu>> {
public static final e f8935a = new e();
e() {
}
@Override
public final b.a.l<cu> apply(Throwable th) {
k.b(th, "it");
if (!(th instanceof com.google.android.gms.common.api.b)) {
return b.a.l.b(th);
}
if (((com.google.android.gms.common.api.b) th).b() != 4) {
return b.a.l.b(th);
}
return b.a.l.a(new cu());
}
}
private final b.a.l<cu> a(com.google.android.gms.c.e<Void> eVar) {
b.a.l<cu> d2 = an.b(eVar).d(e.f8935a);
k.a((Object) d2, "singleVoid.onErrorResume…uccess())\n\n\n }");
return d2;
}
public final b.a.l<cu> d(Context context) {
k.b(context, "context");
a aVar = this;
com.google.android.gms.c.e<Void> c2 = aVar.e(context).c();
k.a((Object) c2, "context.googleAccountClientBasic.signOut()");
return aVar.a(c2);
}
}
}