package a.c.b;

import java.util.HashMap;
import java.util.Map;

public class v {

    /* renamed from: a  reason: collision with root package name */
    public static final String f84a = "1.0";
    public static final String b = "1.5";
    public static final int c = 1;
    public static final int d = 1281;
    private static o e = o.PHONE;
    private static final Map<c, Map<Integer, String>> f;
    public static final int g = -1;

    public class a extends HashMap<Integer, String> {
        public a() {
            put(0, "ack");
        }
    }

    static {
        HashMap hashMap = new HashMap();
        f = hashMap;
        hashMap.put(c.ACK, new a());
    }

    public static o a() {
        return e;
    }

    public static s a(s sVar) {
        j.b(sVar, "message");
        d c2 = sVar.g().c();
        j.a((Object) c2, "message.header.cmdDescription");
        o e2 = c2.e();
        if (e2 == e) {
            return sVar;
        }
        throw new l("Can not create " + e2 + " message in " + e + " device");
    }

    public static String a(c cVar, int i) {
        Map<Integer, String> map;
        return (cVar != null && (map = f.get(cVar)) != null && !map.isEmpty() && map.containsKey(Integer.valueOf(i))) ? map.get(Integer.valueOf(i)) : "unknown";
    }

    /* access modifiers changed from: private */
    public static /* synthetic */ Map a(c cVar) {
        return new HashMap();
    }

    public static void a(c cVar, Map<Integer, String> map) {
        j.a((Object) cVar, "category");
        j.a((Object) map, "methodNames");
        f.computeIfAbsent(cVar, $$Lambda$v$y7bift2sgpNqgqE9fw878EeCJI.INSTANCE).putAll(map);
    }

    public static void a(f fVar, c cVar, int i, s sVar) {
        a(fVar, cVar, i, sVar, null);
    }

    public static void a(f fVar, c cVar, int i, s sVar, i iVar) {
        d c2 = sVar.g().c();
        if (fVar != c2.b()) {
            throw new l("Check dataFormat error: " + c2.b() + ", expect: " + fVar);
        } else if (cVar != c2.a()) {
            throw new l("Check category error: " + c2.a() + ", expect: " + cVar);
        } else if (i != -1 && i != c2.d()) {
            throw new l("Check method error: " + c2.d() + ", expect: " + i);
        } else if (iVar != null && iVar != sVar.i()) {
            throw new l("Check MessageType error: " + sVar.i() + ", expect: " + iVar);
        }
    }

    public static void a(o oVar) {
        j.b(oVar, "sourceDevice");
        e = oVar;
    }
}
