package com.mobile.auth.gatewayauth.manager; import android.text.TextUtils; import android.util.SparseArray; import com.mobile.auth.gatewayauth.ExceptionProcessor; import com.mobile.auth.gatewayauth.manager.base.a; import com.mobile.auth.gatewayauth.model.VendorConfig; import java.util.UUID; public class VendorSdkInfoManager { private SparseArray<VendorConfig> a = new a(3); private SparseArray<VendorConfig> b = new a(3); private String c; private String d; private d e; private SystemManager f; private com.mobile.auth.m.a g; static { System.loadLibrary("pns-LogOnlineStandardRelease-2.12.4-SNAPSHOT_alijtca_plus"); } public VendorSdkInfoManager(d dVar, SystemManager systemManager) { this.e = dVar; this.g = dVar.a(); this.f = systemManager; } private void a(String[] strArr) { if (strArr != null) { try { if (strArr.length >= 8) { String str = strArr[6]; this.c = str; this.e.a(str); } } catch (Throwable th) { ExceptionProcessor.processException(th); } } } private void a(String[] strArr, SparseArray<VendorConfig> sparseArray) { if (strArr != null) { try { if (strArr.length < 6) { return; } if (sparseArray != null) { for (int i = 0; i < 3; i++) { VendorConfig vendorConfig = new VendorConfig(); int i2 = i * 2; vendorConfig.setVendorAccessId(strArr[i2]); vendorConfig.setVendorAccessSecret(strArr[i2 + 1]); if (i == 0) { vendorConfig.setVendorKey("cm_zyhl"); sparseArray.put(1, vendorConfig); } else if (i != 1) { vendorConfig.setVendorKey("ct_sjl"); sparseArray.put(3, vendorConfig); } else { vendorConfig.setVendorKey("cu_xw"); sparseArray.put(2, vendorConfig); } } } } catch (Throwable th) { ExceptionProcessor.processException(th); } } } private void b(String[] strArr) { if (strArr != null) { try { if (strArr.length >= 10) { this.d = strArr[9]; } } catch (Throwable th) { ExceptionProcessor.processException(th); } } } private native void loadVendorConfigsBySceneCodeFromDisk(String str); private native void storeVendorConfigsBySceneCodeToDisk(String str); public VendorConfig a(int i) { try { VendorConfig vendorConfig = this.b.get(i); return vendorConfig != null ? vendorConfig : this.a.get(i); } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public String a(boolean z) { if (z) { return "SceneCode"; } try { String str = this.c; return str == null ? UUID.randomUUID().toString() : str; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public void a(String str, RequestCallback<Void, String> requestCallback, e eVar) { if (requestCallback != null) { try { requestCallback.onSuccess(null); this.g.e("getVendorList isUploadMode = false"); } catch (Throwable th) { ExceptionProcessor.processException(th); } } } public boolean a() { try { return !TextUtils.isEmpty(this.c); } catch (Throwable th) { ExceptionProcessor.processException(th); return false; } } public boolean a(String str, e eVar) { try { b(); return b(); } catch (Throwable th) { ExceptionProcessor.processException(th); return false; } } public boolean b() { try { return this.b.size() > 0 || this.a.size() > 0; } catch (Throwable th) { ExceptionProcessor.processException(th); return false; } } public String c() { try { return this.c; } catch (Throwable th) { ExceptionProcessor.processException(th); return null; } } public boolean d() { return false; } public native void setLocalVendorSdkInfo(String str); }