package com.sjm.sjmsdk.core.oaidhelper; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; import android.util.Log; import java.util.concurrent.LinkedBlockingQueue; public class c { private final Context a; private final LinkedBlockingQueue<IBinder> b = new LinkedBlockingQueue<>(1); private final ServiceConnection c = new ServiceConnection() { /* class com.sjm.sjmsdk.core.oaidhelper.c.AnonymousClass1 */ public void onServiceConnected(ComponentName componentName, IBinder iBinder) { try { Log.d("LenovoDeviceIDHelper", "onServiceConnected"); c.this.b.put(iBinder); } catch (Exception e) { e.printStackTrace(); } } public void onServiceDisconnected(ComponentName componentName) { } }; public c(Context context) { this.a = context; } public String a() { Context context; ServiceConnection serviceConnection; String str = ""; try { Intent intent = new Intent(); intent.setClassName("com.zui.deviceidservice", "com.zui.deviceidservice.DeviceidService"); if (this.a.bindService(intent, this.c, 1)) { try { str = new com.sjm.sjmsdk.core.oaidhelper.a.c(this.b.take()).a(); Log.d("LenovoDeviceIDHelper", "getOAID oaid:" + str); context = this.a; serviceConnection = this.c; } catch (Exception e) { e.printStackTrace(); context = this.a; serviceConnection = this.c; } catch (Throwable th) { this.a.unbindService(this.c); throw th; } context.unbindService(serviceConnection); } } catch (Exception e2) { Log.d("LenovoDeviceIDHelper", "getOAID Lenovo service not found"); e2.printStackTrace(); } return str; } }