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


package com.xlx.speech.e;

import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Point;
import android.os.Build;
import android.provider.Settings;
import android.view.Display;
import android.view.WindowManager;
import com.kuaishou.weapon.p0.h;
import com.xlx.speech.f.b;
import com.xlx.speech.i.a;
import com.xlx.speech.m0.c0;
import com.xlx.speech.m0.f;
import com.xlx.speech.m0.p;
import com.xlx.speech.m0.w;
import com.xlx.speech.voicereadsdk.bean.AdSlot;
import com.xlx.speech.voicereadsdk.bean.VoiceConfig;
import com.xlx.speech.voicereadsdk.bean.req.LoginParams;
import com.xlx.speech.voicereadsdk.bean.resp.LoginResult;
import com.xlx.speech.voicereadsdk.entrance.SpeechVoiceSdk;
import java.security.MessageDigest;
import java.util.Locale;
import kotlin.UByte;

public class d {

    public class a extends b<LoginResult> {
        public final /* synthetic */ b a;

        public a(d dVar, b bVar) {
            this.a = bVar;
        }

        @Override // com.xlx.speech.f.e, com.xlx.speech.f.b
        public void onError(com.xlx.speech.f.a aVar) {
            this.a.onError(aVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // com.xlx.speech.f.e, com.xlx.speech.f.b
        public void onSuccess(LoginResult loginResult) {
            LoginResult loginResult2 = loginResult;
            c0.a(loginResult2);
            this.a.onSuccess(loginResult2);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:18:0x008e A[SYNTHETIC, Splitter:B:18:0x008e] */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x00ca  */
    /* JADX WARNING: Removed duplicated region for block: B:24:0x00cf  */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x00f6  */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x0121  */
    public void a(Context context, AdSlot adSlot, b<LoginResult> bVar) {
        String str;
        WindowManager windowManager;
        String str2;
        int i;
        WindowManager windowManager2;
        boolean z;
        String str3 = "";
        VoiceConfig voiceConfig = SpeechVoiceSdk.getAdManger().getVoiceConfig();
        boolean a2 = w.a("android.permission.RECORD_AUDIO");
        boolean a3 = w.a(h.c);
        boolean a4 = w.a(h.j);
        try {
            byte[] digest = MessageDigest.getInstance("SHA1").digest(context.getPackageManager().getPackageInfo(context.getPackageName(), 64).signatures[0].toByteArray());
            StringBuffer stringBuffer = new StringBuffer();
            for (byte b : digest) {
                String upperCase = Integer.toHexString(b & UByte.MAX_VALUE).toUpperCase(Locale.US);
                if (upperCase.length() == 1) {
                    stringBuffer.append("0");
                }
                stringBuffer.append(upperCase);
                stringBuffer.append(":");
            }
            String stringBuffer2 = stringBuffer.toString();
            str = stringBuffer2.substring(0, stringBuffer2.length() - 1);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            str = str3;
            String packageName = context.getPackageName();
            if (a3) {
            }
            String string = Settings.System.getString(context.getContentResolver(), "android_id");
            String a5 = f.a(context, true);
            String b2 = f.b(context);
            String appId = voiceConfig.getAppId();
            String appSecret = voiceConfig.getAppSecret();
            String mediaUserId = adSlot.getMediaUserId();
            String resourceId = adSlot.getResourceId();
            String str4 = Build.MODEL;
            String str5 = Build.BRAND;
            windowManager = (WindowManager) context.getSystemService("window");
            int i2 = -1;
            if (windowManager == null) {
            }
            windowManager2 = (WindowManager) context.getSystemService("window");
            if (windowManager2 != null) {
            }
            String str6 = Build.VERSION.RELEASE;
            boolean c = f.c(context);
            if (Settings.Secure.getInt(context.getContentResolver(), "adb_enabled", 0) > 0) {
            }
            z = false;
            LoginParams loginParams = new LoginParams(str3, a5, appId, appSecret, mediaUserId, a4 ? 1 : 0, a3 ? 1 : 0, a2 ? 1 : 0, b2, string, str2, str4, str5, i, i2, str6, packageName, str, c, z);
            p.a("login:" + loginParams.toString());
            a.C0409a.a.a.u(com.xlx.speech.f.d.a(loginParams)).enqueue(new a(this, bVar));
        } catch (Throwable th) {
            th.printStackTrace();
            str = str3;
            String packageName2 = context.getPackageName();
            if (a3) {
            }
            String string2 = Settings.System.getString(context.getContentResolver(), "android_id");
            String a52 = f.a(context, true);
            String b22 = f.b(context);
            String appId2 = voiceConfig.getAppId();
            String appSecret2 = voiceConfig.getAppSecret();
            String mediaUserId2 = adSlot.getMediaUserId();
            String resourceId2 = adSlot.getResourceId();
            String str42 = Build.MODEL;
            String str52 = Build.BRAND;
            windowManager = (WindowManager) context.getSystemService("window");
            int i22 = -1;
            if (windowManager == null) {
            }
            windowManager2 = (WindowManager) context.getSystemService("window");
            if (windowManager2 != null) {
            }
            String str62 = Build.VERSION.RELEASE;
            boolean c2 = f.c(context);
            if (Settings.Secure.getInt(context.getContentResolver(), "adb_enabled", 0) > 0) {
            }
            z = false;
            LoginParams loginParams2 = new LoginParams(str3, a52, appId2, appSecret2, mediaUserId2, a4 ? 1 : 0, a3 ? 1 : 0, a2 ? 1 : 0, b22, string2, str2, str42, str52, i, i22, str62, packageName2, str, c2, z);
            p.a("login:" + loginParams2.toString());
            a.C0409a.a.a.u(com.xlx.speech.f.d.a(loginParams2)).enqueue(new a(this, bVar));
        }
        String packageName22 = context.getPackageName();
        if (a3) {
            try {
                str3 = f.a(context);
            } catch (Throwable unused) {
            }
        }
        String string22 = Settings.System.getString(context.getContentResolver(), "android_id");
        String a522 = f.a(context, true);
        String b222 = f.b(context);
        String appId22 = voiceConfig.getAppId();
        String appSecret22 = voiceConfig.getAppSecret();
        String mediaUserId22 = adSlot.getMediaUserId();
        String resourceId22 = adSlot.getResourceId();
        String str422 = Build.MODEL;
        String str522 = Build.BRAND;
        windowManager = (WindowManager) context.getSystemService("window");
        int i222 = -1;
        if (windowManager == null) {
            str2 = resourceId22;
            i = -1;
        } else {
            Point point = new Point();
            str2 = resourceId22;
            if (Build.VERSION.SDK_INT >= 17) {
                windowManager.getDefaultDisplay().getRealSize(point);
            } else {
                windowManager.getDefaultDisplay().getSize(point);
            }
            i = point.x;
        }
        windowManager2 = (WindowManager) context.getSystemService("window");
        if (windowManager2 != null) {
            Point point2 = new Point();
            int i3 = Build.VERSION.SDK_INT;
            Display defaultDisplay = windowManager2.getDefaultDisplay();
            if (i3 >= 17) {
                defaultDisplay.getRealSize(point2);
            } else {
                defaultDisplay.getSize(point2);
            }
            i222 = point2.y;
        }
        String str622 = Build.VERSION.RELEASE;
        boolean c22 = f.c(context);
        try {
            try {
                if (Settings.Secure.getInt(context.getContentResolver(), "adb_enabled", 0) > 0) {
                    z = true;
                    LoginParams loginParams22 = new LoginParams(str3, a522, appId22, appSecret22, mediaUserId22, a4 ? 1 : 0, a3 ? 1 : 0, a2 ? 1 : 0, b222, string22, str2, str422, str522, i, i222, str622, packageName22, str, c22, z);
                    p.a("login:" + loginParams22.toString());
                    a.C0409a.a.a.u(com.xlx.speech.f.d.a(loginParams22)).enqueue(new a(this, bVar));
                }
            } catch (Exception unused2) {
            }
        } catch (Exception unused3) {
        }
        z = false;
        LoginParams loginParams222 = new LoginParams(str3, a522, appId22, appSecret22, mediaUserId22, a4 ? 1 : 0, a3 ? 1 : 0, a2 ? 1 : 0, b222, string22, str2, str422, str522, i, i222, str622, packageName22, str, c22, z);
        p.a("login:" + loginParams222.toString());
        a.C0409a.a.a.u(com.xlx.speech.f.d.a(loginParams222)).enqueue(new a(this, bVar));
    }
}