导航菜单

页面标题

页面副标题

火箭TNT加速 v1.5.4 - ClashService.java 源代码

正在查看: 火箭TNT加速 v1.5.4 应用的 ClashService.java JAVA 源代码文件

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


package com.github.kr328.clash.service;

import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import com.facebook.react.uimanager.events.PointerEventHelper;
import com.github.kr328.clash.common.log.Log;
import com.github.kr328.clash.service.clash.ClashRuntime;
import com.github.kr328.clash.service.clash.ClashRuntimeKt;
import com.github.kr328.clash.service.clash.module.StaticNotificationModule;
import com.github.kr328.clash.service.util.BroadcastKt;
import com.github.kr328.clash.service.util.CoroutineKt;
import kotlin.Metadata;

@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0005\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016J\b\u0010\u000e\u001a\u00020\u000fH\u0016J\b\u0010\u0010\u001a\u00020\u000fH\u0016J\"\u0010\u0011\u001a\u00020\u00122\b\u0010\f\u001a\u0004\u0018\u00010\r2\u0006\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0014\u001a\u00020\u0012H\u0016J\u0010\u0010\u0015\u001a\u00020\u000f2\u0006\u0010\u0016\u001a\u00020\u0012H\u0016R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0007\u001a\u00020\u00008BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\t¨\u0006\u0017"}, d2 = {"Lcom/github/kr328/clash/service/ClashService;", "Lcom/github/kr328/clash/service/BaseService;", "()V", "reason", PointerEventHelper.POINTER_TYPE_UNKNOWN, "runtime", "Lcom/github/kr328/clash/service/clash/ClashRuntime;", "self", "getSelf", "()Lcom/github/kr328/clash/service/ClashService;", "onBind", "Landroid/os/IBinder;", "intent", "Landroid/content/Intent;", "onCreate", PointerEventHelper.POINTER_TYPE_UNKNOWN, "onDestroy", "onStartCommand", PointerEventHelper.POINTER_TYPE_UNKNOWN, "flags", "startId", "onTrimMemory", "level", "service_meta-alphaRelease"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class ClashService extends BaseService {
    private String reason;
    private final ClashRuntime runtime = ClashRuntimeKt.clashRuntime(this, new ClashService$runtime$1(this, null));

    public final ClashService getSelf() {
        return this;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        if (StatusProvider.INSTANCE.getServiceRunning()) {
            stopSelf();
            return;
        }
        StatusProvider.INSTANCE.setServiceRunning(true);
        ClashService clashService = this;
        StaticNotificationModule.INSTANCE.createNotificationChannel(clashService);
        StaticNotificationModule.INSTANCE.notifyLoadingNotification(clashService);
        this.runtime.launch();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        BroadcastKt.sendClashStarted(this);
        return 1;
    }

    @Override
    public IBinder onBind(Intent intent) {
        return new Binder();
    }

    @Override
    public void onDestroy() {
        StatusProvider.INSTANCE.setServiceRunning(false);
        BroadcastKt.sendClashStopped(this, this.reason);
        CoroutineKt.cancelAndJoinBlocking(this);
        Log log = Log.INSTANCE;
        StringBuilder sb = new StringBuilder();
        sb.append("ClashService destroyed: ");
        String str = this.reason;
        if (str == null) {
            str = "successfully";
        }
        sb.append(str);
        Log.i$default(log, sb.toString(), null, 2, null);
        super.onDestroy();
    }

    @Override
    public void onTrimMemory(int level) {
        super.onTrimMemory(level);
        this.runtime.requestGc();
    }
}