导航菜单

页面标题

页面副标题

冬瓜音乐 v1.0.7 - ExoDownloadService.java 源代码

正在查看: 冬瓜音乐 v1.0.7 应用的 ExoDownloadService.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.xifeng.music.playback;

import android.app.Notification;
import android.content.Intent;
import android.os.Build;
import android.os.Environment;
import androidx.compose.runtime.bc;
import androidx.media3.exoplayer.R$string;
import androidx.media3.exoplayer.scheduler.PlatformScheduler;
import com.xifeng.music.C1553a;
import com.xifeng.music.R$drawable;
import java.io.File;
import java.util.List;
import java.util.regex.Pattern;
import kotlinx.coroutines.bd;

public final class ExoDownloadService extends Hilt_ExoDownloadService {
    public static final int u = 0;
    public C1587i s;
    public final kotlinx.coroutines.internal.e t;

    public ExoDownloadService() {
        bd e = kotlinx.coroutines.G.e();
        kotlinx.coroutines.scheduling.d dVar = kotlinx.coroutines.O.a;
        this.t = kotlinx.coroutines.G.c(kotlin.coroutines.g.l(e, kotlinx.coroutines.internal.n.a));
    }

    @Override
    public final androidx.media3.exoplayer.offline.f b() {
        return i().h;
    }

    @Override
    public final android.app.Notification c(int r18, java.util.List r19) {
        throw new UnsupportedOperationException("Method not decompiled: com.xifeng.music.playback.ExoDownloadService.c(int, java.util.List):android.app.Notification");
    }

    @Override
    public final PlatformScheduler d() {
        return new PlatformScheduler(this, 1);
    }

    public final C1587i i() {
        C1587i c1587i = this.s;
        if (c1587i != null) {
            return c1587i;
        }
        kotlin.jvm.internal.l.k("downloadUtil");
        throw null;
    }

    @Override
    public final int onStartCommand(Intent intent, int i, int i2) {
        String str;
        if (kotlin.jvm.internal.l.a(intent != null ? intent.getAction() : null, "REMOVE_ALL_PENDING_DOWNLOADS")) {
            List<androidx.media3.exoplayer.offline.d> list = i().h.m;
            kotlin.jvm.internal.l.e(list, "getCurrentDownloads(...)");
            for (androidx.media3.exoplayer.offline.d dVar : list) {
                C1587i i3 = i();
                String str2 = dVar.a.f;
                androidx.media3.exoplayer.offline.f fVar = i3.h;
                fVar.f++;
                fVar.c.obtainMessage(8, str2).sendToTarget();
            }
        } else if (kotlin.jvm.internal.l.a(intent != null ? intent.getAction() : null, "com.zionhuang.music.ACTION_CUSTOM_DOWNLOAD")) {
            String stringExtra = intent.getStringExtra("song_id");
            if (stringExtra == null) {
                super.onStartCommand(intent, i, i2);
                return 1;
            }
            String stringExtra2 = intent.getStringExtra("song_title");
            String str3 = stringExtra2 == null ? stringExtra : stringExtra2;
            boolean booleanExtra = intent.getBooleanExtra("show_toast", true);
            C1553a c1553a = timber.log.a.a;
            c1553a.a(bc.p("收到自定义下载请求: ", stringExtra, ", ", str3), new Object[0]);
            Pattern compile = Pattern.compile("^\\d+$");
            kotlin.jvm.internal.l.e(compile, "compile(...)");
            if (!compile.matcher(stringExtra).matches()) {
                Notification a = i().g.a(this, R$drawable.error, "不支持下载YouTube音乐到自定义路径", R$string.exo_download_failed);
                kotlin.jvm.internal.l.e(a, "buildDownloadFailedNotification(...)");
                androidx.media3.common.util.C.a(this, 4, a);
                return 1;
            }
            boolean booleanValue = ((Boolean) com.xifeng.music.utils.t.b(com.xifeng.music.utils.t.c(this), com.xifeng.music.constants.m.ap, Boolean.TRUE)).booleanValue();
            c1553a.a("自定义下载路径设置状态: useCustomPath=" + booleanValue, new Object[0]);
            File f = i().f();
            if (f == null || (str = f.getAbsolutePath()) == null) {
                str = "null";
            }
            c1553a.a("获取到的自定义下载路径: ".concat(str), new Object[0]);
            kotlinx.coroutines.internal.e eVar = this.t;
            if (f != null) {
                kotlinx.coroutines.G.y(eVar, null, 0, new C1589k(this, f, stringExtra, str3, null, booleanExtra), 3);
                return 1;
            }
            String str4 = !booleanValue ? "未启用自定义下载路径,将使用应用专属存储空间" : !(Build.VERSION.SDK_INT >= 30 ? Environment.isExternalStorageManager() : com.xifeng.music.ui.utils.c.y(this, "android.permission.WRITE_EXTERNAL_STORAGE") == 0) ? "需要存储权限才能使用自定义下载路径,已使用应用专属存储空间" : "自定义下载路径无效,已使用应用专属存储空间";
            c1553a.a(str4, new Object[0]);
            Notification a2 = i().g.a(this, R$drawable.error, str4, R$string.exo_download_failed);
            kotlin.jvm.internal.l.e(a2, "buildDownloadFailedNotification(...)");
            androidx.media3.common.util.C.a(this, 4, a2);
            File file = new File(getExternalFilesDir(Environment.DIRECTORY_MUSIC), "Downloads");
            if (!file.exists()) {
                file.mkdirs();
            }
            if (file.isDirectory() && file.canWrite()) {
                kotlinx.coroutines.G.y(eVar, kotlinx.coroutines.O.c, 0, new C1592n(this, file, stringExtra, str3, null, booleanExtra), 2);
            }
            return 1;
        }
        super.onStartCommand(intent, i, i2);
        return 1;
    }
}