package com.ss.android.ugc.aweme.legoImp.task;

import X.0HH;
import X.4Mr;
import X.AnonymousClass9EH;
import X.C152987s;
import X.C22428Zd;
import X.C22438Ze;
import X.C25518ec;
import X.C25718ew;
import X.C27038h4;
import X.C42619Eu;
import X.C42869Ft;
import X.C42909Fx;
import android.content.Context;
import android.os.Build;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.abmock.SettingsManager;
import com.ss.android.common.applog.AppLog;
import com.ss.android.ugc.aweme.settings.LikoAnalysisConfig;
import java.util.List;
import kotlin.h.b.n;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class AnalysisHprofTask implements C22438Ze {
    public static volatile boolean LIZ;
    public static final C27038h4 LIZIZ = new C27038h4((byte) 0);

    static {
        Covode.recordClassIndex(90386);
    }

    public final boolean meetTrigger() {
        return true;
    }

    public final String prefix() {
        return "task_";
    }

    public final boolean serialExecute() {
        return false;
    }

    public final int targetProcess() {
        return 1;
    }

    public final List triggerOtherLegoComponents() {
        return null;
    }

    public final C42869Ft triggerType() {
        return C22428Zd.LIZ(this);
    }

    public final C42909Fx scenesType() {
        return C42909Fx.DEFAULT;
    }

    public final String key() {
        return getClass().getSimpleName();
    }

    public final C25518ec type() {
        ((Boolean) C42619Eu.LIZJ.getValue()).booleanValue();
        return C25518ec.BOOT_FINISH;
    }

    public final void run(Context context) {
        if (4Mr.LIZJ()) {
            LikoAnalysisConfig LIZLLL = 4Mr.LIZLLL();
            n.LIZIZ(LIZLLL, "");
            try {
                LIZ = true;
                JSONObject jSONObject = new JSONObject();
                if (!SettingsManager.LIZ().LIZ("enable_upload_hporf", false)) {
                    LIZ = false;
                    return;
                }
                jSONObject.put("strategy", 18);
                jSONObject.put("aid", AnonymousClass9EH.LJIILJJIL);
                jSONObject.put("channel", AnonymousClass9EH.LJIJI);
                jSONObject.put("device_id", AppLog.getServerDeviceId());
                jSONObject.put("app_version", AnonymousClass9EH.LJJIFFI.LJFF());
                jSONObject.put("update_version_code", String.valueOf(AnonymousClass9EH.LJJIFFI.LIZLLL()));
                jSONObject.put("current_update_version_code", String.valueOf(AnonymousClass9EH.LJJIFFI.LIZLLL()));
                jSONObject.put("os_version", Build.VERSION.RELEASE);
                jSONObject.put("os_api", Build.VERSION.SDK_INT);
                jSONObject.put("device_model", Build.MODEL);
                jSONObject.put("device_brand", Build.BRAND);
                jSONObject.put("device_manufacturer", Build.MANUFACTURER);
                jSONObject.put("process_name", AnonymousClass9EH.LJJIFFI.LIZ().getPackageName());
                jSONObject.put("version_code", (int) AnonymousClass9EH.LJJIFFI.LJII());
                jSONObject.put("region", "");
                jSONObject.put("oversea", true);
                jSONObject.put("delete_dump_file", true);
                JSONArray jSONArray = new JSONArray();
                jSONArray.put("android.app.Activity");
                jSONArray.put("android.app.Fragment");
                jSONArray.put("androidx.fragment.app.Fragment");
                jSONObject.put("detect_leak_classes", jSONArray);
                jSONObject.put("supportBigObjectAnalysis", LIZLLL.isSupportBigObjectAnalysis());
                jSONObject.put("bigObjectFilterSystem", LIZLLL.isBigObjectFilterSystem());
                jSONObject.put("bigObjectLatitude", LIZLLL.getBigObjectLatitude());
                jSONObject.put("supportObjectInstanceAnalysis", LIZLLL.isSupportObjectInstanceAnalysis());
                jSONObject.put("objectInstanceFilterSystem", LIZLLL.isObjectInstanceFilterSystem());
                jSONObject.put("objectInstanceLatitude", LIZLLL.getObjectInstanceLatitude());
                jSONObject.put("supportBitmapAnalysis", LIZLLL.isSupportBitmapAnalysis());
                jSONObject.put("bitmapLatitude", (long) LIZLLL.getBitmapLatitude());
                jSONObject.put("release_build", C25718ew.LIZ(context).LIZ("release_build", ""));
                String LJIIIIZZ = AnonymousClass9EH.LJJIFFI.LJIIIIZZ();
                jSONObject.put("version_name", LJIIIIZZ);
                int charAt = LJIIIIZZ.charAt(LJIIIIZZ.length() - 1) - '0';
                if (charAt > 0 && charAt < 4) {
                    jSONObject.put("env", "canary");
                }
                C152987s.LJI.LIZ(jSONObject);
                LIZ = false;
            } catch (JSONException e) {
                0HH.LIZ(e);
            } catch (Throwable unused) {
                LIZ = false;
            }
        }
    }
}
