package com.bytedance.ammt.mmt.impl;

import X.4Sh;
import X.AnonymousClass0PT;
import android.content.Context;
import android.os.SystemClock;
import com.bytedance.android.bytehook.ByteHook;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.librarian.Librarian;
import java.io.File;

public class NativeMMTPlugin extends AnonymousClass0PT {
    public static volatile NativeMMTPlugin LIZLLL;
    public static String LJ = "nmt";
    public String LJFF;
    public String LJI;

    public static native void native_dump(String str, String str2);

    public static native void native_setConfigParams(int i);

    public static native void native_setMemoryThreshold(long j, long j2);

    public static native void native_start();

    public static native void native_stop();

    static {
        Covode.recordClassIndex(4241);
        long uptimeMillis = SystemClock.uptimeMillis();
        Librarian.LIZ("mmt", false, (Context) null);
        4Sh.LIZ(uptimeMillis, "mmt");
    }

    public final void LIZ() {
        MethodCollector.i(13004);
        super.LIZ();
        ByteHook.init();
        native_start();
        this.LIZJ = true;
        MethodCollector.o(13004);
    }

    public final void LIZIZ() {
        MethodCollector.i(13214);
        super.LIZIZ();
        native_dump(this.LJFF, this.LJI);
        MethodCollector.o(13214);
    }

    public static NativeMMTPlugin LIZJ() {
        MethodCollector.i(10440);
        if (LIZLLL == null) {
            synchronized (NativeMMTPlugin.class) {
                try {
                    LIZLLL = new NativeMMTPlugin();
                } catch (Throwable th) {
                    MethodCollector.o(10440);
                    throw th;
                }
            }
        }
        NativeMMTPlugin nativeMMTPlugin = LIZLLL;
        MethodCollector.o(10440);
        return nativeMMTPlugin;
    }

    public final void LIZ(int i) {
        super.LIZ(i);
    }

    public final void LIZ(long j, long j2) {
        MethodCollector.i(13005);
        super.LIZ(j, j2);
        native_setMemoryThreshold(j, j2);
        MethodCollector.o(13005);
    }

    public final void LIZ(String str, String str2) {
        super.LIZ(str, str2);
        this.LJFF = str + File.separator + LJ;
        this.LJI = str2;
    }
}
