package com.ss.android.ugc.aweme.main.replace;

import X.Lnj;
import X.M12;
import android.app.Activity;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.router.SmartRoute;
import com.bytedance.router.SmartRouter;
import com.ss.android.ugc.aweme.IReplaceMusicDownloadService;

public final class ReplaceMusicDownloadService implements IReplaceMusicDownloadService {
    static {
        Covode.recordClassIndex(91879);
    }

    public static IReplaceMusicDownloadService LIZ() {
        MethodCollector.i(9430);
        IReplaceMusicDownloadService iReplaceMusicDownloadService = (IReplaceMusicDownloadService) Lnj.LIZ(IReplaceMusicDownloadService.class, false);
        if (iReplaceMusicDownloadService != null) {
            MethodCollector.o(9430);
            return iReplaceMusicDownloadService;
        }
        Object LIZIZ = Lnj.LIZIZ(IReplaceMusicDownloadService.class, false);
        if (LIZIZ != null) {
            IReplaceMusicDownloadService iReplaceMusicDownloadService2 = (IReplaceMusicDownloadService) LIZIZ;
            MethodCollector.o(9430);
            return iReplaceMusicDownloadService2;
        }
        if (Lnj.d == null) {
            synchronized (IReplaceMusicDownloadService.class) {
                try {
                    if (Lnj.d == null) {
                        Lnj.d = new ReplaceMusicDownloadService();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(9430);
                    throw th;
                }
            }
        }
        ReplaceMusicDownloadService replaceMusicDownloadService = (ReplaceMusicDownloadService) Lnj.d;
        MethodCollector.o(9430);
        return replaceMusicDownloadService;
    }

    public final void LIZ(String str, Activity activity, String str2) {
        M12.LIZ(str, activity, str2);
        SmartRoute buildRoute = SmartRouter.buildRoute(activity, "//replace_music/download");
        buildRoute.withParam("aweme_id", str);
        buildRoute.withParam("type", "ban_music");
        buildRoute.open();
    }
}
