package com.mobile.auth.n; import android.content.Context; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkRequest; import android.os.Build; import android.text.TextUtils; import com.mobile.auth.gatewayauth.ExceptionProcessor; import com.mobile.auth.gatewayauth.utils.b; import com.nirvana.tools.requestqueue.TimeoutCallable; public class c implements TimeoutCallable<com.mobile.auth.s.c> { private Context a; private com.mobile.auth.m.a b; public static class a { private static volatile a a; private volatile String b = null; public a(Context context) { b(context); } public static a a(Context context) { try { if (a == null) { synchronized (a.class) { if (a == null) { a = new a(context); } } } return a; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } static /* synthetic */ String a(a aVar, String str) { try { aVar.b = str; return str; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public String a() { try { return this.b; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public void b(Context context) { try { this.b = b.b(); NetworkRequest.Builder builder = new NetworkRequest.Builder(); builder.addTransportType(0); builder.addCapability(12); ((ConnectivityManager) context.getSystemService("connectivity")).requestNetwork(builder.build(), new ConnectivityManager.NetworkCallback() { /* class com.mobile.auth.n.c.a.AnonymousClass1 */ public void onAvailable(Network network) { try { super.onAvailable(network); a.a(a.this, b.b()); } catch (Throwable th) { ExceptionProcessor.processException(th); } } }); } catch (Exception e) { try { e.printStackTrace(); } catch (Throwable th) { ExceptionProcessor.processException(th); } } } } public c(Context context, com.mobile.auth.m.a aVar) { this.a = context; this.b = aVar; } private void a(Context context, com.mobile.auth.s.c cVar) { try { String a2 = a.a(context).a(); if (TextUtils.isEmpty(a2)) { cVar.a(false); return; } cVar.a(true); cVar.a(a2); } catch (Throwable th) { ExceptionProcessor.processException(th); } } public com.mobile.auth.s.c a() { try { return new com.mobile.auth.s.c(true, false); } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public com.mobile.auth.s.c b() throws Exception { try { com.mobile.auth.s.c cVar = new com.mobile.auth.s.c(false, false); if (Build.VERSION.SDK_INT >= 21) { a(this.a, cVar); } else { cVar.a(false); } return cVar; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } @Override // java.util.concurrent.Callable public /* synthetic */ Object call() throws Exception { try { return b(); } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // com.nirvana.tools.requestqueue.TimeoutCallable public /* synthetic */ com.mobile.auth.s.c onTimeout() { try { return a(); } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } }