package com.mobile.auth.p; import android.content.Context; import android.text.TextUtils; import com.mobile.auth.a.c; import com.mobile.auth.gatewayauth.ExceptionProcessor; import com.mobile.auth.gatewayauth.manager.RequestCallback; import com.mobile.auth.gatewayauth.manager.a; import com.mobile.auth.gatewayauth.manager.base.b; import com.mobile.auth.gatewayauth.manager.d; import com.mobile.auth.gatewayauth.model.MonitorStruct; import com.mobile.auth.gatewayauth.model.ctcctoken.CTCCTokenRet; import com.mobile.auth.gatewayauth.model.ctcctoken.Data; import com.nirvana.tools.core.ExecutorManager; public class a extends com.mobile.auth.gatewayauth.manager.a { private c i = new c() { /* class com.mobile.auth.p.a.AnonymousClass1 */ @Override // com.mobile.auth.a.c public void a(String str, String str2) { try { a.a(a.this).a(str, str2); } catch (Throwable th) { ExceptionProcessor.processException(th); } } @Override // com.mobile.auth.a.c public void a(String str, String str2, Throwable th) { if (th != null) { try { a.b(a.this).c(str, str2, ExecutorManager.getErrorInfoFromException(th)); } catch (Throwable th2) { ExceptionProcessor.processException(th2); } } else { a.c(a.this).c(str, str2); } } }; public a(Context context, d dVar) { super(context, dVar, "ct_sjl", null); } static /* synthetic */ com.mobile.auth.m.a a(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } private synchronized void a(final RequestCallback<a.C0248a, b> requestCallback, final MonitorStruct monitorStruct, final String str) { try { com.mobile.auth.a.a.a((int) this.c, (int) this.c, (int) this.c, this.i); com.mobile.auth.a.a.a(this.d, this.a, this.b, new com.mobile.auth.a.b() { /* class com.mobile.auth.p.a.AnonymousClass2 */ @Override // com.mobile.auth.a.b public void a(String str) { try { monitorStruct.setCarrierReturnTime(System.currentTimeMillis()); a.d(a.this).a("ctcc:", "getLoginInfo:", str); if (TextUtils.isEmpty(str)) { a.a(a.this, requestCallback, "-10008", "CTCC 获得的手机授权码结果为空", "", "ct_sjl", monitorStruct, str); return; } try { CTCCTokenRet fromJson = CTCCTokenRet.fromJson(str); if (fromJson != null) { monitorStruct.setCarrierTraceId(fromJson.getReqId()); if (fromJson.getResult() != 0 || fromJson.getData() == null) { a.d(a.this, requestCallback, String.valueOf(fromJson.getResult()), fromJson.getMsg(), str, "ct_sjl", monitorStruct, str); return; } Data data = fromJson.getData(); String number = data.getNumber(); String accessCode = data.getAccessCode(); if (!TextUtils.isEmpty(number)) { requestCallback.onSuccess(a.C0248a.a().a(number).c("天翼账号认证服务条款").d("https://e.189.cn/sdk/agreement/detail.do?isWap=true&hidetop=true&appKey=8138111118").b(accessCode).a(System.currentTimeMillis() + ((long) (data.getExpiredTime() * 1000))).a()); monitorStruct.setPhoneNumber(number); monitorStruct.setAccessCode(accessCode); a.a(a.this, String.valueOf(fromJson.getResult()), "", "", true, "ct_sjl", monitorStruct); return; } a.c(a.this, requestCallback, String.valueOf(fromJson.getResult()), fromJson.getMsg(), str, "ct_sjl", monitorStruct, str); } } catch (Exception e) { a.e(a.this).e("CTCCValidManager init exception:", ExecutorManager.getErrorInfoFromException(e)); a.b(a.this, requestCallback, "-10008", "JSON转换失败", str, "ct_sjl", monitorStruct, str); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } }); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ void a(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ void a(a aVar, String str, String str2, String str3, boolean z, String str4, MonitorStruct monitorStruct) { try { aVar.a(str, str2, str3, z, str4, monitorStruct); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ com.mobile.auth.m.a b(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void b(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ void b(a aVar, String str, String str2, String str3, boolean z, String str4, MonitorStruct monitorStruct) { try { aVar.a(str, str2, str3, z, str4, monitorStruct); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ com.mobile.auth.m.a c(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void c(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ com.mobile.auth.m.a d(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void d(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ com.mobile.auth.m.a e(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void e(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ com.mobile.auth.m.a f(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void f(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ com.mobile.auth.m.a g(a aVar) { try { return aVar.h; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ void g(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } static /* synthetic */ void h(a aVar, RequestCallback requestCallback, String str, String str2, String str3, String str4, MonitorStruct monitorStruct, String str5) { try { aVar.a(requestCallback, str, str2, str3, str4, monitorStruct, str5); } catch (Throwable th) { ExceptionProcessor.processException(th); } } @Override // com.mobile.auth.gatewayauth.manager.a public void a(boolean z) { } @Override // com.mobile.auth.gatewayauth.manager.a public String b(String str, String str2) { try { if (TextUtils.isEmpty(str)) { return str; } try { Integer valueOf = Integer.valueOf(Integer.parseInt(str)); if (valueOf.intValue() >= 10000 && valueOf.intValue() <= 40000) { return str2; } } catch (Exception unused) { } char c = 65535; switch (str.hashCode()) { case -1389750326: if (str.equals("-720002")) { c = 5; break; } break; case 43274408: if (str.equals("-8003")) { c = 4; break; } break; case 43274409: if (str.equals("-8004")) { c = '\t'; break; } break; case 43275366: if (str.equals("-8100")) { c = 6; break; } break; case 53194808: if (str.equals("80000")) { c = 1; break; } break; case 53194811: if (str.equals("80003")) { c = 7; break; } break; case 53194812: if (str.equals("80004")) { c = '\b'; break; } break; case 53194813: if (str.equals("80005")) { c = 2; break; } break; case 53202496: if (str.equals("80800")) { c = 3; break; } break; case 1335041958: if (str.equals("-10002")) { c = 0; break; } break; } switch (c) { case 0: return "600025"; case 1: case 2: case 3: case 4: case 5: return "600015"; case 6: case 7: case '\b': case '\t': return "-10006"; default: return str2; } } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } @Override // com.mobile.auth.gatewayauth.manager.a public void c() { } @Override // com.mobile.auth.gatewayauth.manager.a public synchronized void d(RequestCallback<a.C0248a, b> requestCallback, a.b bVar) { try { MonitorStruct monitorStruct = new MonitorStruct(); monitorStruct.putApiParam("timeout", String.valueOf(this.c)); monitorStruct.setSessionId(bVar.c()); monitorStruct.setRequestId(bVar.b()); monitorStruct.setStartTime(System.currentTimeMillis()); monitorStruct.setAction("ctcc.get.logincode"); monitorStruct.setNetworkType(com.mobile.auth.gatewayauth.utils.b.a(this.d, true)); a(requestCallback, monitorStruct, "600012"); } catch (Throwable th) { ExceptionProcessor.processException(th); } } @Override // com.mobile.auth.gatewayauth.manager.a public synchronized void e(RequestCallback<a.C0248a, b> requestCallback, a.b bVar) { try { MonitorStruct monitorStruct = new MonitorStruct(); monitorStruct.putApiParam("timeout", String.valueOf(this.c)); monitorStruct.setSessionId(bVar.c()); monitorStruct.setRequestId(bVar.b()); monitorStruct.setStartTime(System.currentTimeMillis()); monitorStruct.setAction("ctcc.get.logintoken"); monitorStruct.setNetworkType(com.mobile.auth.gatewayauth.utils.b.a(this.d, true)); a(requestCallback, monitorStruct, "600011"); } catch (Throwable th) { ExceptionProcessor.processException(th); } } @Override // com.mobile.auth.gatewayauth.manager.a public synchronized void f(final RequestCallback<a.C0248a, b> requestCallback, a.b bVar) { try { final MonitorStruct monitorStruct = new MonitorStruct(); monitorStruct.putApiParam("timeout", String.valueOf(this.c)); monitorStruct.setSessionId(bVar.c()); monitorStruct.setRequestId(bVar.b()); monitorStruct.setStartTime(System.currentTimeMillis()); monitorStruct.setAction("ctcc.getoken"); monitorStruct.setNetworkType(com.mobile.auth.gatewayauth.utils.b.a(this.d, true)); com.mobile.auth.a.a.a((int) this.c, (int) this.c, (int) this.c, this.i); com.mobile.auth.a.a.a(this.d, this.a, this.b, new com.mobile.auth.a.b() { /* class com.mobile.auth.p.a.AnonymousClass3 */ @Override // com.mobile.auth.a.b public void a(String str) { try { monitorStruct.setCarrierReturnTime(System.currentTimeMillis()); a.f(a.this).a("ctcc:", "getVerifyInfo:", str); if (TextUtils.isEmpty(str)) { a.e(a.this, requestCallback, "-10008", "CTCC 获得认证Token结果为空", "", "ct_sjl", monitorStruct, "600011"); return; } try { CTCCTokenRet fromJson = CTCCTokenRet.fromJson(str); if (fromJson != null) { monitorStruct.setCarrierTraceId(fromJson.getReqId()); if (fromJson.getResult() != 0 || fromJson.getData() == null) { a.h(a.this, requestCallback, String.valueOf(fromJson.getResult()), fromJson.getMsg(), str, "ct_sjl", monitorStruct, "600011"); return; } Data data = fromJson.getData(); String accessCode = data.getAccessCode(); if (!TextUtils.isEmpty(accessCode)) { monitorStruct.setAccessCode(accessCode); a.b(a.this, String.valueOf(fromJson.getResult()), fromJson.getMsg(), "", true, "ct_sjl", monitorStruct); requestCallback.onSuccess(a.C0248a.a().b(accessCode).a(System.currentTimeMillis() + ((long) (data.getExpiredTime() * 1000))).a()); return; } a.g(a.this, requestCallback, String.valueOf(fromJson.getResult()), fromJson.getMsg(), str, "ct_sjl", monitorStruct, "600011"); } } catch (Exception e) { a.g(a.this).e("CTCCValidManager init exception:", ExecutorManager.getErrorInfoFromException(e)); a.f(a.this, requestCallback, "-10008", "JSON转换失败", str, "ct_sjl", monitorStruct, "600011"); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } }); } catch (Throwable th) { ExceptionProcessor.processException(th); } } }