正在查看: Kreate v1.5.0 应用的 MyDownloadService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Kreate v1.5.0 应用的 MyDownloadService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package it.fast4x.rimusic.service;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import androidx.core.app.NotificationCompat;
import androidx.media3.common.util.NotificationUtil;
import androidx.media3.common.util.Util;
import androidx.media3.exoplayer.offline.Download;
import androidx.media3.exoplayer.offline.DownloadManager;
import androidx.media3.exoplayer.offline.DownloadNotificationHelper;
import androidx.media3.exoplayer.offline.DownloadService;
import androidx.media3.exoplayer.scheduler.PlatformScheduler;
import androidx.media3.exoplayer.scheduler.Requirements;
import app.kreate.android.R;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\b\u0007\u0018\u00002\u00020\u0001:\u0001\u0010B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\b\u0010\u0004\u001a\u00020\u0005H\u0014J\n\u0010\u0006\u001a\u0004\u0018\u00010\u0007H\u0014J#\u0010\b\u001a\u00070\t¢\u0006\u0002\b\n2\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\f2\u0006\u0010\u000e\u001a\u00020\u000fH\u0014¨\u0006\u0011"}, d2 = {"Lit/fast4x/rimusic/service/MyDownloadService;", "Landroidx/media3/exoplayer/offline/DownloadService;", "<init>", "()V", "getDownloadManager", "Landroidx/media3/exoplayer/offline/DownloadManager;", "getScheduler", "Landroidx/media3/exoplayer/scheduler/PlatformScheduler;", "getForegroundNotification", "Landroid/app/Notification;", "Lorg/jspecify/annotations/NonNull;", "downloads", "", "Landroidx/media3/exoplayer/offline/Download;", "notMetRequirements", "", "TerminalStateNotificationHelper", "composeApp_full"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class MyDownloadService extends DownloadService {
public static final int $stable = 0;
public MyDownloadService() {
super(8989, 1000L, MyDownloadHelper.DOWNLOAD_NOTIFICATION_CHANNEL_ID, R.string.download, 0);
}
protected DownloadManager getDownloadManager() {
Context context = (Context) this;
DownloadManager downloadManager = MyDownloadHelper.INSTANCE.getDownloadManager(context);
downloadManager.addListener(new TerminalStateNotificationHelper(context, MyDownloadHelper.INSTANCE.getDownloadNotificationHelper(context), 8990));
return downloadManager;
}
public PlatformScheduler m1121getScheduler() {
if (Util.SDK_INT >= 21) {
return new PlatformScheduler((Context) this, 8888);
}
return null;
}
protected Notification getForegroundNotification(List<Download> downloads, int notMetRequirements) {
Intrinsics.checkNotNullParameter(downloads, "downloads");
Context context = (Context) this;
Notification build = new NotificationCompat.Builder(context, MyDownloadHelper.INSTANCE.getDownloadNotificationHelper(context).buildProgressNotification(context, R.drawable.download_progress, (PendingIntent) null, downloads.size() + " in progress", downloads, notMetRequirements)).setChannelId(MyDownloadHelper.DOWNLOAD_NOTIFICATION_CHANNEL_ID).build();
Intrinsics.checkNotNullExpressionValue(build, "build(...)");
return build;
}
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u001f\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007¢\u0006\u0004\b\b\u0010\tJ(\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u000e\u0010\u0011\u001a\n\u0018\u00010\u0012j\u0004\u0018\u0001`\u0013H\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0014"}, d2 = {"Lit/fast4x/rimusic/service/MyDownloadService$TerminalStateNotificationHelper;", "Landroidx/media3/exoplayer/offline/DownloadManager$Listener;", "context", "Landroid/content/Context;", "notificationHelper", "Landroidx/media3/exoplayer/offline/DownloadNotificationHelper;", "firstNotificationId", "", "<init>", "(Landroid/content/Context;Landroidx/media3/exoplayer/offline/DownloadNotificationHelper;I)V", "nextNotificationId", "onDownloadChanged", "", "downloadManager", "Landroidx/media3/exoplayer/offline/DownloadManager;", "download", "Landroidx/media3/exoplayer/offline/Download;", "finalException", "Ljava/lang/Exception;", "Lkotlin/Exception;", "composeApp_full"}, k = 1, mv = {2, 1, 0}, xi = 48)
private static final class TerminalStateNotificationHelper implements DownloadManager.Listener {
private final Context context;
private int nextNotificationId;
private final DownloadNotificationHelper notificationHelper;
public void onDownloadRemoved(DownloadManager downloadManager, Download download) {
DownloadManager.Listener.-CC.$default$onDownloadRemoved(this, downloadManager, download);
}
public void onDownloadsPausedChanged(DownloadManager downloadManager, boolean z) {
DownloadManager.Listener.-CC.$default$onDownloadsPausedChanged(this, downloadManager, z);
}
public void onIdle(DownloadManager downloadManager) {
DownloadManager.Listener.-CC.$default$onIdle(this, downloadManager);
}
public void onInitialized(DownloadManager downloadManager) {
DownloadManager.Listener.-CC.$default$onInitialized(this, downloadManager);
}
public void onRequirementsStateChanged(DownloadManager downloadManager, Requirements requirements, int i) {
DownloadManager.Listener.-CC.$default$onRequirementsStateChanged(this, downloadManager, requirements, i);
}
public void onWaitingForRequirementsChanged(DownloadManager downloadManager, boolean z) {
DownloadManager.Listener.-CC.$default$onWaitingForRequirementsChanged(this, downloadManager, z);
}
public TerminalStateNotificationHelper(Context context, DownloadNotificationHelper notificationHelper, int i) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(notificationHelper, "notificationHelper");
this.context = context;
this.notificationHelper = notificationHelper;
this.nextNotificationId = i;
}
public void onDownloadChanged(DownloadManager downloadManager, Download download, Exception finalException) {
Notification buildDownloadCompletedNotification;
Intrinsics.checkNotNullParameter(downloadManager, "downloadManager");
Intrinsics.checkNotNullParameter(download, "download");
int i = download.state;
if (i == 3) {
buildDownloadCompletedNotification = this.notificationHelper.buildDownloadCompletedNotification(this.context, R.drawable.downloaded, (PendingIntent) null, Util.fromUtf8Bytes(download.request.data));
Intrinsics.checkNotNull(buildDownloadCompletedNotification);
} else {
if (i != 4) {
return;
}
buildDownloadCompletedNotification = this.notificationHelper.buildDownloadFailedNotification(this.context, R.drawable.alert_circle_not_filled, (PendingIntent) null, Util.fromUtf8Bytes(download.request.data));
Intrinsics.checkNotNull(buildDownloadCompletedNotification);
}
Context context = this.context;
int i2 = this.nextNotificationId;
this.nextNotificationId = i2 + 1;
NotificationUtil.setNotification(context, i2, buildDownloadCompletedNotification);
}
}
}