package com.yht.util; import android.app.Activity; import android.app.ActivityManager; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Build; import android.provider.Settings; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.view.inputmethod.InputMethodManager; import com.health.im.b; import com.netease.yunxin.base.utils.StringUtils; import com.yht.a.a; import com.yht.app.BaseApplication; import com.yht.d.g; import java.io.File; public final class z { /* renamed from: a reason: collision with root package name */ private static final String f16178a = "z"; /* renamed from: b reason: collision with root package name */ private static boolean f16179b = true; /* renamed from: c reason: collision with root package name */ private static boolean f16180c = false; /* renamed from: d reason: collision with root package name */ private static String f16181d = "https://health91.oss-cn-qingdao.aliyuncs.com/"; /* renamed from: e reason: collision with root package name */ private static String f16182e = "https://health91.oss-cn-qingdao.aliyuncs.com/"; /* renamed from: f reason: collision with root package name */ private static int f16183f = 200; /* renamed from: g reason: collision with root package name */ private static String f16184g; /* renamed from: h reason: collision with root package name */ private static int f16185h; private static String i; private static String j; private z() { } public static String a(Context context) { String str; synchronized (z.class) { if (f16184g == null) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone"); StringBuilder sb = new StringBuilder(); String imei = telephonyManager.getImei(); if (!TextUtils.isEmpty(imei)) { sb.append("/nDeviceId(IMEI) = "); sb.append(imei); } String deviceSoftwareVersion = telephonyManager.getDeviceSoftwareVersion(); if (!TextUtils.isEmpty(deviceSoftwareVersion)) { sb.append("/nDeviceSoftwareVersion = "); sb.append(deviceSoftwareVersion); } String line1Number = telephonyManager.getLine1Number(); if (!TextUtils.isEmpty(line1Number)) { sb.append("/nLine1Number = "); sb.append(line1Number); } String networkCountryIso = telephonyManager.getNetworkCountryIso(); if (!TextUtils.isEmpty(networkCountryIso)) { sb.append("/nNetworkCountryIso = "); sb.append(networkCountryIso); } String networkOperator = telephonyManager.getNetworkOperator(); if (!TextUtils.isEmpty(networkOperator)) { sb.append("/nNetworkOperator = "); sb.append(networkOperator); } String networkOperatorName = telephonyManager.getNetworkOperatorName(); if (!TextUtils.isEmpty(networkOperatorName)) { sb.append("/nNetworkOperatorName = "); sb.append(networkOperatorName); } sb.append("/nNetworkType = "); sb.append(telephonyManager.getNetworkType()); sb.append("/nPhoneType = "); sb.append(telephonyManager.getPhoneType()); sb.append("/nSimCountryIso = "); sb.append(telephonyManager.getSimCountryIso()); sb.append("/nSimOperator = "); sb.append(telephonyManager.getSimOperator()); sb.append("/nSimOperatorName = "); sb.append(telephonyManager.getSimOperatorName()); String simSerialNumber = telephonyManager.getSimSerialNumber(); if (!TextUtils.isEmpty(simSerialNumber)) { sb.append("/nSimSerialNumber = "); sb.append(simSerialNumber); } sb.append("/nSimState = "); sb.append(telephonyManager.getSimState()); String subscriberId = telephonyManager.getSubscriberId(); if (!TextUtils.isEmpty(subscriberId)) { sb.append("/nSubscriberId(IMSI) = "); sb.append(subscriberId); } String voiceMailNumber = telephonyManager.getVoiceMailNumber(); if (!TextUtils.isEmpty(voiceMailNumber)) { sb.append("/nVoiceMailNumber = "); sb.append(voiceMailNumber); } s.b("info", sb.toString()); WifiInfo connectionInfo = ((WifiManager) context.getSystemService("wifi")).getConnectionInfo(); if (connectionInfo != null) { sb.append("/nMacAddress = "); sb.append(connectionInfo.getMacAddress()); } String string = Settings.Secure.getString(context.getContentResolver(), "android_id"); sb.append("/nAndroidId = "); sb.append(string); f16184g = sb.toString(); sb.setLength(0); } str = f16184g; } return str; } public static String a(String str) { return TextUtils.isEmpty(str) ? "" : str.replace("xinxiang", i); } public static void a(int i2) { f16185h = i2; } public static void a(Activity activity) { InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService("input_method"); if (inputMethodManager.isActive() && activity.getCurrentFocus() != null && activity.getCurrentFocus().getWindowToken() != null) { inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 2); } } public static void a(boolean z) { f16179b = z; g.g(); } public static boolean a() { return e(".hack"); } public static boolean a(Context context, String str) { return "2".equalsIgnoreCase(d(context, "app")) && a.a() && !TextUtils.isEmpty(str) && str.contains("-patient-"); } public static String b(Context context) { synchronized (z.class) { if (Build.VERSION.SDK_INT >= 23) { return b.b(context); } return ((TelephonyManager) context.getSystemService("phone")).getDeviceId(); } } public static String b(String str) { return TextUtils.isEmpty(str) ? "" : str.replace("${h5_path}", i); } public static void b(int i2) { f16183f = i2; } public static void b(boolean z) { f16180c = z; } public static boolean b() { return BaseApplication.getInstance().isDebugBuild() || a(); } public static boolean b(Context context, String str) { return "2".equalsIgnoreCase(d(context, "app")) && !TextUtils.isEmpty(str) && str.contains("-patient-") && b.a(false); } public static int c() { return f16185h; } public static int c(Context context) { String str; StringBuilder sb; String str2; try { Class<?> cls = Class.forName("com.android.internal.R$dimen"); return context.getApplicationContext().getResources().getDimensionPixelSize(Integer.parseInt(cls.getField("status_bar_height").get(cls.newInstance()).toString())); } catch (ClassNotFoundException e2) { str2 = f16178a; sb = new StringBuilder(); sb.append(StringUtils.SPACE); str = e2.getMessage(); } catch (IllegalAccessException e3) { str2 = f16178a; sb = new StringBuilder(); sb.append(StringUtils.SPACE); str = e3.getMessage(); } catch (InstantiationException e4) { str2 = f16178a; sb = new StringBuilder(); sb.append(StringUtils.SPACE); str = e4.getMessage(); } catch (NoSuchFieldException e5) { str2 = f16178a; sb = new StringBuilder(); sb.append(StringUtils.SPACE); str = e5.getMessage(); } sb.append(str); s.b(str2, sb.toString()); return 0; } public static void c(String str) { if (p()) { f16182e = str; } else { f16181d = str; } } public static boolean c(Context context, String str) { return str.equals(((ActivityManager) context.getSystemService("activity")).getRunningTasks(1).get(0).topActivity.getClassName()); } public static String d() { return HostUtils.f16113b.d() + "/doctor/html/health/testDetail.html"; } public static String d(Context context) { try { return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; } catch (Exception unused) { return "0.0.0"; } } public static String d(Context context, String str) { return String.valueOf(c()); } public static void d(String str) { j = str; } public static String e() { return HostUtils.f16113b.d() + "/doctor/html/health/hospitalizedReportDetail.html"; } public static boolean e(Context context) { return i(context) && b.ba(); } private static boolean e(String str) { return new File(m() + File.separator + str).exists(); } public static String f() { return HostUtils.f16113b.d() + "/doctor/html/health/checkDetail.html"; } public static boolean f(Context context) { String d2 = d(context, "app"); return "3".equalsIgnoreCase(d2) || "2".equalsIgnoreCase(d2); } public static String g() { return HostUtils.f16113b.d() + "/doctor/html/health/examDetail.html"; } public static boolean g(Context context) { String d2 = d(context, "app"); return "3".equalsIgnoreCase(d2) || "2".equalsIgnoreCase(d2); } public static String h() { return HostUtils.f16113b.d() + "/doctor/html/prescription/detail.html"; } public static boolean h(Context context) { String d2 = d(context, "app"); return !"3".equalsIgnoreCase(d2) && !"2".equalsIgnoreCase(d2); } public static String i() { return i; } public static boolean i(Context context) { return TextUtils.equals("2", d(context, "app")); } public static String j() { return a(HostUtils.f16113b.d() + "/app/html/project/xinxiang/mine/orderExamDetail.html"); } public static String j(Context context) { return context.getPackageName() + "." + "taogu.intent.appointment.detail"; } public static String k() { return a(HostUtils.f16113b.d() + "/app/html/project/xinxiang/mine/orderCheckDetail.html"); } public static String k(Context context) { return context.getPackageName() + "." + "taogu.intent.favorite"; } public static String l() { return HostUtils.a() + "common/picturesUpload"; } public static String l(Context context) { return context.getPackageName() + "." + "taogu.intent.rpl"; } public static String m() { String str = w.d(BaseApplication.getInstance()).getPath() + File.separator + "toogoo"; File file = new File(str); if (!file.exists()) { s.a("getToogooPath mkdir " + file.mkdir()); } return str; } public static String m(Context context) { return context.getPackageName() + "." + "taogu.intent.webview"; } public static String n() { return p() ? f16182e : f16181d; } public static boolean n(Context context) { return i(context) && b.h(false); } public static String o() { return HostUtils.a() + "common/perform_upload_file"; } public static boolean p() { return f16179b; } public static boolean q() { return Build.VERSION.SDK_INT >= 11; } public static boolean r() { return f16180c; } }