导航菜单

页面标题

页面副标题

Petal Maps v4.7.0.310001 - LocationAwakeningService.java 源代码

正在查看: Petal Maps v4.7.0.310001 应用的 LocationAwakeningService.java JAVA 源代码文件

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


package com.huawei.maps.app.common.location;

import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.text.TextUtils;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.huawei.maps.app.common.location.LocationAwakeningService;
import com.huawei.maps.businessbase.bean.NotificationMessage;
import com.huawei.maps.businessbase.manager.AbstractMapUIController;
import com.huawei.maps.businessbase.manager.location.a;
import com.huawei.maps.businessbase.report.b;
import com.huawei.secure.android.common.activity.SafeService;
import com.huawei.secure.android.common.intent.IntentUtils;
import defpackage.hm4;
import defpackage.kj2;
import defpackage.o41;
import defpackage.og3;
import defpackage.ok4;
import defpackage.p79;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.schedulers.Schedulers;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;

public class LocationAwakeningService extends SafeService {
    public static final String b = og3.a(new NotificationMessage());

    public static void d(Intent intent, NotificationMessage notificationMessage) {
        String pushType = notificationMessage.getPushType();
        if (TextUtils.isEmpty(pushType)) {
            pushType = "";
        }
        hm4.p("LocationAwakeningService", "onReceiveMsg pushType: " + pushType);
        p79.k("location_awakening_report_pushtype", pushType, o41.c());
        ok4.y(pushType);
        String safeGetStringExtra = intent.hasExtra(RemoteMessageConst.Notification.URL) ? IntentUtils.safeGetStringExtra(intent, RemoteMessageConst.Notification.URL) : "";
        if (TextUtils.equals(pushType, "AwakeningGeofenceNotify")) {
            new ok4(notificationMessage).i(safeGetStringExtra);
            return;
        }
        if (TextUtils.equals(pushType, "AwakeningNearbyNotify")) {
            new ok4(notificationMessage).s();
            return;
        }
        if (TextUtils.isEmpty(pushType) || "AwakeningPushtoken".equals(pushType)) {
            hm4.p("LocationAwakeningService", "onReceiveMsg other");
            return;
        }
        String safeGetStringExtra2 = intent.hasExtra("fenceId") ? IntentUtils.safeGetStringExtra(intent, "fenceId") : "";
        if (TextUtils.isEmpty(safeGetStringExtra2)) {
            hm4.p("LocationAwakeningService", "onReceiveMsg fenceId null");
            ok4.x(notificationMessage.getPushType(), "0");
        } else {
            notificationMessage.setFenceId(safeGetStringExtra2);
            new ok4(notificationMessage).g(safeGetStringExtra);
        }
    }

    public final void c(final Intent intent) {
        xr4.Q().F2("5");
        b.e().f();
        if (intent == null) {
            return;
        }
        if (!TextUtils.equals("com.huawei.maps.app.send.LOCATIONAWAKENING", intent.getAction())) {
            ok4.x("pushType", "2");
            return;
        }
        NotificationMessage notificationMessage = (NotificationMessage) og3.d(intent.hasExtra(RemoteMessageConst.Notification.CONTENT) ? IntentUtils.safeGetStringExtra(intent, RemoteMessageConst.Notification.CONTENT) : b, NotificationMessage.class);
        Optional.ofNullable(notificationMessage).ifPresent(new Consumer() {
            @Override
            public final void accept(Object obj) {
                LocationAwakeningService.d(intent, (NotificationMessage) obj);
            }
        });
        if (notificationMessage == null) {
            hm4.p("LocationAwakeningService", "onReceiveMsg msg nul");
            ok4.x("pushType", "1");
        }
    }

    public IBinder onBind(final Intent intent) {
        if (!kj2.h(o41.c())) {
            hm4.p("LocationAwakeningService", "is not HuaweiPhone return");
            return new Binder();
        }
        xr4.Q().F2("5");
        hm4.p("LocationAwakeningService", "onReceiveMsg");
        xb6.p(o41.c());
        if (!a.p()) {
            AbstractMapUIController.getInstance().startServicePermission("pushTokenUploadOnLocationAwakeningBroadcastReceiver");
        }
        Observable.empty().delay(15L, TimeUnit.SECONDS).subscribeOn(Schedulers.io()).observeOn(Schedulers.io()).doOnComplete(new Action() {
            public final void run() {
                LocationAwakeningService.this.c(intent);
            }
        }).subscribe();
        return new Binder();
    }
}