package com.seewo.remote.g;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import com.cvte.vman.R;
import com.seewo.remote.base.App;
import com.seewo.sdk.model.SDKSourceModel;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;

/* JADX INFO: compiled from: Utils.java */
/* JADX INFO: loaded from: classes.dex */
public class w {
    public static String a(byte[] bArr) {
        StringBuilder sb = new StringBuilder();
        for (byte b : bArr) {
            String hexString = Integer.toHexString(b & 255);
            sb.append("0x");
            if (hexString.length() == 1) {
                sb.append("0");
            }
            sb.append(hexString);
            sb.append(" ");
        }
        return sb.toString().toUpperCase();
    }

    public static String b(byte[] bArr) {
        StringBuilder sb = new StringBuilder();
        for (byte b : bArr) {
            String hexString = Integer.toHexString(b & 255);
            if (hexString.length() == 1) {
                sb.append("0");
            }
            sb.append(hexString);
        }
        return sb.toString().toUpperCase();
    }

    public static boolean c(Context context, String str, String str2) {
        try {
            Resources resourcesForApplication = context.getApplicationContext().getPackageManager().getResourcesForApplication(str);
            return resourcesForApplication.getBoolean(resourcesForApplication.getIdentifier(str2, "bool", str));
        } catch (Exception e2) {
            e2.printStackTrace();
            return false;
        }
    }

    @TargetApi(19)
    public static <T, E> T d(Map<T, E> map, E e2) {
        for (Map.Entry<T, E> entry : map.entrySet()) {
            if (Objects.equals(e2, entry.getValue())) {
                return entry.getKey();
            }
        }
        return null;
    }

    public static boolean e() {
        return e.c.e.f.a.j(com.seewo.remote.d.b.b().a(), com.seewo.remote.d.b.b().a().getString(R.string.note_ezwrite_pkg));
    }

    public static boolean f() {
        return e.c.e.f.a.j(com.seewo.remote.d.b.b().a(), com.seewo.remote.d.b.b().a().getString(R.string.note_ezwrite_pkg_old));
    }

    public static boolean g(Context context) {
        return e.c.e.f.a.i(context, "com.ifpdos.touchpanel");
    }

    public static boolean h(Context context) {
        return e.c.e.f.a.j(context, "com.ifpdos.windowsettings");
    }

    public static boolean i() {
        return e.c.d.m.a.f() == com.seewo.sdk.interfaces.r.ANDROID;
    }

    public static boolean j(com.seewo.sdk.interfaces.r rVar) {
        if (rVar == null) {
            return false;
        }
        Iterator<SDKSourceModel> it = e.c.d.m.a.d().iterator();
        while (it.hasNext()) {
            if (it.next().sourceItem.name().equals(rVar.name())) {
                return true;
            }
        }
        return false;
    }

    public static boolean k() {
        return e.c.e.f.a.i(App.b, "com.cvte.udi.service.core");
    }

    public static boolean l() {
        return e.c.e.f.a.j(com.seewo.remote.d.b.b().a(), com.seewo.remote.d.b.b().a().getString(R.string.wifi_source_pkg2));
    }

    public static boolean m() {
        return "0".equals(t.a("persist.sys.rs232.app_type", "0"));
    }

    public static boolean n() {
        return e.c.e.f.a.j(com.seewo.remote.d.b.b().a(), com.seewo.remote.d.b.b().a().getString(R.string.wifi_source_pkg));
    }

    public static void o() {
        if (com.seewo.remote.d.a.j()) {
            com.seewo.remote.d.b.b().a().sendBroadcast(new Intent("com.ifpdos.osservice.show_volume_bar"));
        }
    }
}
