翰林优商.apk(点击下载) / c.java


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.b;
import com.iBookStar.utils.p;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class c {
    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("8", "onServiceConnected");
                this.a[0] = iBinder;
                this.b.countDown();
            } catch (Throwable th) {
                c.this.a.unbindService(this);
                throw th;
            }
            c.this.a.unbindService(this);
        }

        public void onServiceDisconnected(ComponentName componentName) {
            p.a("8", "onServiceDisconnected");
        }
    }

    public c(Context context) {
        this.a = context;
    }

    public String a() {
        try {
            if (this.a.getPackageManager().getPackageInfo("com.huawei.hwid", 0) != null) {
                Object[] objArr = new Object[1];
                CountDownLatch countDownLatch = new CountDownLatch(1);
                Intent intent = new Intent("com.uodis.opendevice.OPENIDS_SERVICE");
                intent.setPackage("com.huawei.hwid");
                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 b.a((IBinder) objArr[0]).b();
                        } catch (Throwable th2) {
                            th2.printStackTrace();
                        }
                    }
                }
                return null;
            }
        } catch (Throwable th3) {
            th3.printStackTrace();
        }
        p.a("8", "not support oaid");
        return null;
    }
}