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

import X.AnonymousClass81D;
import X.AnonymousClass81G;
import X.AnonymousClass81H;
import X.AnonymousClass81I;
import X.C22428Zd;
import X.C22438Ze;
import X.C25518ec;
import X.C42869Ft;
import X.C42909Fx;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.bytedance.crash.CrashType;
import com.bytedance.crash.Npth;
import com.bytedance.ies.abmock.SettingsManager;
import com.ss.android.agilelogger.ALog;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class CrashDumpTask implements C22438Ze {
    public String LIZ = "CrashDumpTask";

    static {
        Covode.recordClassIndex(90425);
    }

    public boolean meetTrigger() {
        return true;
    }

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

    public boolean serialExecute() {
        return false;
    }

    public int targetProcess() {
        return 1048575;
    }

    public List triggerOtherLegoComponents() {
        return null;
    }

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

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

    public C25518ec type() {
        return C25518ec.BOOT_FINISH;
    }

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

    public void run(Context context) {
        try {
            AnonymousClass81H r2 = (AnonymousClass81H) SettingsManager.LIZ().LIZ("CrashDumpConfig", AnonymousClass81H.class, AnonymousClass81I.LIZ);
            if (r2 == null || !r2.LIZ) {
                ALog.i(this.LIZ, "crashConfig: uninit");
                return;
            }
            ALog.i(this.LIZ, "crashConfig: open");
            ArrayList arrayList = new ArrayList();
            for (String str : r2.LIZIZ) {
                ALog.i(this.LIZ, "crashConfig str: ".concat(String.valueOf(str)));
                arrayList.add(str);
            }
            File LIZ2 = AnonymousClass81D.LIZ(context, "dumpCrashFileDir");
            LIZ2.mkdirs();
            File file = new File(LIZ2, "dump.hprof");
            if (file.exists()) {
                AnonymousClass81D.LIZ(context);
            }
            Npth.registerCrashCallback(new AnonymousClass81G(arrayList, file), CrashType.ALL);
        } catch (Throwable unused) {
        }
    }
}
