package com.iBookStar.e.a; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; import com.iBookStar.e.b.f; import com.iBookStar.utils.p; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; public class h { private Context a; class a implements ServiceConnection { final /* synthetic */ Object[] a; final /* synthetic */ CountDownLatch b; a(Object[] objArr, CountDownLatch countDownLatch) { this.a = objArr; this.b = countDownLatch; } public void onServiceConnected(ComponentName componentName, IBinder iBinder) { try { p.a("SamsungDeviceIDHelper", "onServiceConnected"); this.a[0] = iBinder; this.b.countDown(); } catch (Throwable th) { h.this.a.unbindService(this); throw th; } h.this.a.unbindService(this); } public void onServiceDisconnected(ComponentName componentName) { p.a("SamsungDeviceIDHelper", "onServiceDisconnected"); } } public h(Context context) { this.a = context; } public String a() { try { if (this.a.getPackageManager().getPackageInfo("com.samsung.android.deviceidservice", 0) != null) { Object[] objArr = new Object[1]; CountDownLatch countDownLatch = new CountDownLatch(1); Intent intent = new Intent(); intent.setClassName("com.samsung.android.deviceidservice", "com.samsung.android.deviceidservice.DeviceIdService"); if (this.a.bindService(intent, new a(objArr, countDownLatch), 1)) { try { countDownLatch.await(3, TimeUnit.SECONDS); } catch (Throwable th) { th.printStackTrace(); } if (objArr[0] != null) { try { return new f.a((IBinder) objArr[0]).b(); } catch (Throwable th2) { th2.printStackTrace(); } } } return null; } } catch (Throwable th3) { th3.printStackTrace(); } p.a("SamsungDeviceIDHelper", "not support oaid"); return null; } }