导航菜单

页面标题

页面副标题

Online Loans v421.2.42 - FlutterLocationService.java 源代码

正在查看: Online Loans v421.2.42 应用的 FlutterLocationService.java JAVA 源代码文件

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


package com.lyokone.location;

import L.AbstractC0640b;
import android.app.Activity;
import android.app.Service;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import f5.C1446j;
import f5.InterfaceC1448l;
import f5.InterfaceC1450n;
import f6.o;
import java.util.Map;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.collections.D;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import t4.C2607b;
import t4.C2614i;
import t4.C2621p;

@Metadata
public final class FlutterLocationService extends Service implements InterfaceC1450n {

    public static final a f13638i = new a(null);

    public final b f13639a = new b();

    public boolean f13640b;

    public Activity f13641e;

    public C2607b f13642f;

    public C2614i f13643g;

    public C1446j.d f13644h;

    public static final class a {
        public a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public a() {
        }
    }

    public final class b extends Binder {
        public b() {
        }

        public final FlutterLocationService a() {
            return FlutterLocationService.this;
        }
    }

    public final Map a(C2621p c2621p) {
        Intrinsics.checkNotNullParameter(c2621p, "options");
        C2607b c2607b = this.f13642f;
        if (c2607b != null) {
            c2607b.f(c2621p, this.f13640b);
        }
        if (this.f13640b) {
            return D.i(new Pair[]{o.a("channelId", "flutter_location_channel_01"), o.a("notificationId", 75418)});
        }
        return null;
    }

    public final boolean b() {
        if (Build.VERSION.SDK_INT >= 29) {
            Activity activity = this.f13641e;
            if (activity != null) {
                return M.a.a(activity, "android.permission.ACCESS_BACKGROUND_LOCATION") == 0;
            }
            throw new ActivityNotFoundException();
        }
        C2614i c2614i = this.f13643g;
        if (c2614i != null) {
            return c2614i.h();
        }
        return false;
    }

    public final void c() {
        if (Build.VERSION.SDK_INT >= 24) {
            stopForeground(1);
        } else {
            stopForeground(true);
        }
        this.f13640b = false;
    }

    public final void d() {
        if (this.f13640b) {
            return;
        }
        C2607b c2607b = this.f13642f;
        Intrinsics.c(c2607b);
        startForeground(75418, c2607b.a());
        this.f13640b = true;
    }

    public final C2614i e() {
        return this.f13643g;
    }

    public final InterfaceC1448l f() {
        return this.f13643g;
    }

    public final InterfaceC1450n g() {
        return this.f13643g;
    }

    public final boolean i() {
        return this.f13640b;
    }

    public final void j() {
        if (Build.VERSION.SDK_INT >= 29) {
            Activity activity = this.f13641e;
            if (activity == null) {
                throw new ActivityNotFoundException();
            }
            AbstractC0640b.w(activity, new String[]{"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_BACKGROUND_LOCATION"}, 641);
            return;
        }
        C2614i c2614i = this.f13643g;
        if (c2614i != null) {
            c2614i.f21483p = this.f13644h;
        }
        if (c2614i != null) {
            c2614i.q();
        }
        this.f13644h = null;
    }

    public final void k(Activity activity) {
        this.f13641e = activity;
        C2614i c2614i = this.f13643g;
        if (c2614i != null) {
            c2614i.t(activity);
        }
    }

    public final void l(C1446j.d dVar) {
        this.f13644h = dVar;
    }

    public final boolean m() {
        if (Build.VERSION.SDK_INT < 29) {
            return false;
        }
        Activity activity = this.f13641e;
        if (activity != null) {
            return AbstractC0640b.z(activity, "android.permission.ACCESS_BACKGROUND_LOCATION");
        }
        throw new ActivityNotFoundException();
    }

    @Override
    public IBinder onBind(Intent intent) {
        return this.f13639a;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        this.f13643g = new C2614i(getApplicationContext(), null);
        Context applicationContext = getApplicationContext();
        Intrinsics.checkNotNullExpressionValue(applicationContext, "getApplicationContext(...)");
        this.f13642f = new C2607b(applicationContext, "flutter_location_channel_01", 75418);
    }

    @Override
    public void onDestroy() {
        this.f13643g = null;
        this.f13642f = null;
        super.onDestroy();
    }

    @Override
    public boolean onRequestPermissionsResult(int i6, String[] strArr, int[] iArr) {
        Intrinsics.checkNotNullParameter(strArr, "permissions");
        Intrinsics.checkNotNullParameter(iArr, "grantResults");
        if (Build.VERSION.SDK_INT >= 29 && i6 == 641 && strArr.length == 2 && Intrinsics.a(strArr[0], "android.permission.ACCESS_FINE_LOCATION") && Intrinsics.a(strArr[1], "android.permission.ACCESS_BACKGROUND_LOCATION")) {
            if (iArr[0] == 0 && iArr[1] == 0) {
                d();
                C1446j.d dVar = this.f13644h;
                if (dVar != null) {
                    dVar.success(1);
                }
                this.f13644h = null;
            } else {
                if (m()) {
                    C1446j.d dVar2 = this.f13644h;
                    if (dVar2 != null) {
                        dVar2.error("PERMISSION_DENIED", "Background location permission denied", null);
                    }
                } else {
                    C1446j.d dVar3 = this.f13644h;
                    if (dVar3 != null) {
                        dVar3.error("PERMISSION_DENIED_NEVER_ASK", "Background location permission denied forever - please open app settings", null);
                    }
                }
                this.f13644h = null;
            }
        }
        return false;
    }

    @Override
    public boolean onUnbind(Intent intent) {
        return super.onUnbind(intent);
    }

    public final InterfaceC1450n h() {
        return this;
    }
}