package xyz.netfly.ads;

import android.os.Handler;
import android.os.Looper;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import xyz.stream.api.entity.BaseEntity;

/* JADX INFO: loaded from: classes3.dex */
public final class c implements xyz.stream.api.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ f f34834a;

    public c(f fVar) {
        this.f34834a = fVar;
    }

    @Override // xyz.stream.api.e
    public final void a(String str) {
    }

    @Override // xyz.stream.api.e
    public final void onSuccess(Object obj) {
        Object obj2;
        Map map;
        BaseEntity baseEntity = (BaseEntity) obj;
        if (baseEntity == null || baseEntity.getCode() != 200 || baseEntity.getData() == null) {
            return;
        }
        JsonElement data = baseEntity.getData();
        Type type = new ImaController$1$1().getType();
        Gson gson = xyz.stream.utils.m.f36162a;
        Map map2 = (Map) gson.fromJson(data, type);
        if (map2 == null || (obj2 = map2.get("ads_release_config")) == null || (map = (Map) gson.fromJson(gson.toJsonTree(obj2), new ImaController$1$2().getType())) == null) {
            return;
        }
        boolean z10 = xyz.stream.utils.e.d().f36118g;
        f fVar = this.f34834a;
        if (z10) {
            Object obj3 = map.get("tv");
            if (obj3 != null) {
                fVar.f34839b = (List) gson.fromJson(gson.toJsonTree(obj3), new ImaController$1$3().getType());
            }
        } else if (xyz.stream.utils.e.d().f36121j) {
            Object obj4 = map.get("phone");
            if (obj4 != null) {
                fVar.f34839b = (List) gson.fromJson(gson.toJsonTree(obj4), new ImaController$1$4().getType());
            }
        } else {
            Object obj5 = map.get("pad");
            if (obj5 != null) {
                fVar.f34839b = (List) gson.fromJson(gson.toJsonTree(obj5), new ImaController$1$5().getType());
            }
        }
        fVar.f34841d = System.currentTimeMillis();
        List list = fVar.f34839b;
        if (list == null || list.isEmpty()) {
            return;
        }
        if (fVar.f34838a == null || fVar.f34843f == null) {
            new Handler(Looper.getMainLooper()).post(new y.a(this, 29));
        }
    }
}
