正在查看: 火箭TNT加速 v1.5.4 应用的 ProfileReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 火箭TNT加速 v1.5.4 应用的 ProfileReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.github.kr328.clash.service;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import androidx.core.content.ContextCompat;
import com.facebook.react.uimanager.events.PointerEventHelper;
import com.github.kr328.clash.common.Global;
import com.github.kr328.clash.common.compat.IntentsKt;
import com.github.kr328.clash.common.compat.ServicesKt;
import com.github.kr328.clash.common.constants.Intents;
import com.github.kr328.clash.common.util.ComponentsKt;
import com.github.kr328.clash.common.util.IntentKt;
import com.github.kr328.clash.service.data.Imported;
import com.github.kr328.clash.service.document.Paths;
import com.github.kr328.clash.service.util.FilesKt;
import java.io.File;
import java.util.concurrent.TimeUnit;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.ranges.RangesKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.sync.Mutex;
import kotlinx.coroutines.sync.MutexKt;
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 \t2\u00020\u0001:\u0001\tB\u0005¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0016¨\u0006\n"}, d2 = {"Lcom/github/kr328/clash/service/ProfileReceiver;", "Landroid/content/BroadcastReceiver;", "()V", "onReceive", PointerEventHelper.POINTER_TYPE_UNKNOWN, "context", "Landroid/content/Context;", "intent", "Landroid/content/Intent;", "Companion", "service_meta-alphaRelease"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class ProfileReceiver extends BroadcastReceiver {
private static boolean initialized;
public static final Companion INSTANCE = new Companion(null);
private static final Mutex lock = MutexKt.Mutex$default(false, 1, (Object) null);
@Override
public void onReceive(Context context, Intent intent) {
int hashCode;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(intent, "intent");
String action = intent.getAction();
if ((action == null || ((hashCode = action.hashCode()) == 502473491 ? !action.equals("android.intent.action.TIMEZONE_CHANGED") : !(hashCode == 798292259 ? action.equals("android.intent.action.BOOT_COMPLETED") : hashCode == 1737074039 && action.equals("android.intent.action.MY_PACKAGE_REPLACED")))) ? Intrinsics.areEqual(action, "android.intent.action.TIME_SET") : true) {
BuildersKt.launch$default(Global.INSTANCE, (CoroutineContext) null, (CoroutineStart) null, new ProfileReceiver$onReceive$1(context, null), 3, (Object) null);
} else if (Intrinsics.areEqual(action, Intents.INSTANCE.getACTION_PROFILE_REQUEST_UPDATE())) {
Intent component = intent.setComponent(ComponentsKt.getComponentName(Reflection.getOrCreateKotlinClass(ProfileWorker.class)));
Intrinsics.checkNotNullExpressionValue(component, "intent.setComponent(Prof…ker::class.componentName)");
ServicesKt.startForegroundServiceCompat(context, component);
}
}
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fJ\u0018\u0010\r\u001a\u00020\u000e2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0002J\u0019\u0010\u000f\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0086@ø\u0001\u0000¢\u0006\u0002\u0010\u0010J\u0011\u0010\u0011\u001a\u00020\bH\u0082@ø\u0001\u0000¢\u0006\u0002\u0010\u0012J\u0016\u0010\u0013\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fJ\u0016\u0010\u0014\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fR\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006\u0015"}, d2 = {"Lcom/github/kr328/clash/service/ProfileReceiver$Companion;", PointerEventHelper.POINTER_TYPE_UNKNOWN, "()V", "initialized", PointerEventHelper.POINTER_TYPE_UNKNOWN, "lock", "Lkotlinx/coroutines/sync/Mutex;", "cancelNext", PointerEventHelper.POINTER_TYPE_UNKNOWN, "context", "Landroid/content/Context;", "imported", "Lcom/github/kr328/clash/service/data/Imported;", "pendingIntentOf", "Landroid/app/PendingIntent;", "rescheduleAll", "(Landroid/content/Context;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "reset", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "schedule", "scheduleNext", "service_meta-alphaRelease"}, k = 1, mv = {1, 7, 1}, xi = 48)
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final java.lang.Object rescheduleAll(android.content.Context r10, kotlin.coroutines.Continuation<? super kotlin.Unit> r11) {
throw new UnsupportedOperationException("Method not decompiled: com.github.kr328.clash.service.ProfileReceiver.Companion.rescheduleAll(android.content.Context, kotlin.coroutines.Continuation):java.lang.Object");
}
public final void cancelNext(Context context, Imported imported) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(imported, "imported");
PendingIntent pendingIntentOf = pendingIntentOf(context, imported);
AlarmManager alarmManager = (AlarmManager) ContextCompat.getSystemService(context, AlarmManager.class);
if (alarmManager != null) {
alarmManager.cancel(pendingIntentOf);
}
}
public final void schedule(Context context, Imported imported) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(imported, "imported");
PendingIntent pendingIntentOf = pendingIntentOf(context, imported);
AlarmManager alarmManager = (AlarmManager) ContextCompat.getSystemService(context, AlarmManager.class);
if (alarmManager != null) {
alarmManager.cancel(pendingIntentOf);
}
pendingIntentOf.send(context, 0, (Intent) null);
}
public final void scheduleNext(Context context, Imported imported) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(imported, "imported");
PendingIntent pendingIntentOf = pendingIntentOf(context, imported);
AlarmManager alarmManager = (AlarmManager) ContextCompat.getSystemService(context, AlarmManager.class);
if (alarmManager != null) {
alarmManager.cancel(pendingIntentOf);
}
if (imported.getInterval() < TimeUnit.MINUTES.toMillis(15L)) {
return;
}
long currentTimeMillis = System.currentTimeMillis();
File importedDir = FilesKt.getImportedDir(context);
String uuid = imported.getUuid().toString();
Intrinsics.checkNotNullExpressionValue(uuid, "imported.uuid.toString()");
long lastModified = kotlin.io.FilesKt.resolve(kotlin.io.FilesKt.resolve(importedDir, uuid), Paths.CONFIGURATION_ID).lastModified();
if (lastModified < 0) {
return;
}
long coerceAtLeast = RangesKt.coerceAtLeast(imported.getInterval() - (currentTimeMillis - lastModified), 0L);
AlarmManager alarmManager2 = (AlarmManager) ContextCompat.getSystemService(context, AlarmManager.class);
if (alarmManager2 != null) {
alarmManager2.set(1, currentTimeMillis + coerceAtLeast, pendingIntentOf);
}
}
public final java.lang.Object reset(kotlin.coroutines.Continuation<? super kotlin.Unit> r6) {
throw new UnsupportedOperationException("Method not decompiled: com.github.kr328.clash.service.ProfileReceiver.Companion.reset(kotlin.coroutines.Continuation):java.lang.Object");
}
private final PendingIntent pendingIntentOf(Context context, Imported imported) {
Intent component = new Intent(Intents.INSTANCE.getACTION_PROFILE_REQUEST_UPDATE()).setComponent(ComponentsKt.getComponentName(Reflection.getOrCreateKotlinClass(ProfileReceiver.class)));
Intrinsics.checkNotNullExpressionValue(component, "Intent(Intents.ACTION_PR…ver::class.componentName)");
PendingIntent broadcast = PendingIntent.getBroadcast(context, 0, IntentKt.setUUID(component, imported.getUuid()), IntentsKt.pendingIntentFlags$default(134217728, false, 2, null));
Intrinsics.checkNotNullExpressionValue(broadcast, "getBroadcast(\n …TE_CURRENT)\n )");
return broadcast;
}
}
}