导航菜单

页面标题

页面副标题

BodyTech v7.6.4 - GeofenceRegistrationReceiver.java 源代码

正在查看: BodyTech v7.6.4 应用的 GeofenceRegistrationReceiver.java JAVA 源代码文件

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


package com.fitnessmobileapps.fma.geofence;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.fitnessmobileapps.fma.geofence.GeofenceRegistrationReceiver;
import com.fitnessmobileapps.fma.model.GetLocationsResponse;
import com.fitnessmobileapps.fma.model.Location;
import com.fitnessmobileapps.fma.util.q0;
import f6.f;
import h1.a;
import java.util.ArrayList;
import java.util.List;
import n6.k;

public class GeofenceRegistrationReceiver extends BroadcastReceiver {

    private k f10183a;

    public void e(VolleyError volleyError) {
        this.f10183a = null;
    }

    public void f(a aVar, Context context, GetLocationsResponse getLocationsResponse) {
        this.f10183a = null;
        ArrayList arrayList = new ArrayList();
        if (getLocationsResponse.getLocations() != null) {
            arrayList.addAll(getLocationsResponse.getLocations());
        }
        aVar.B(arrayList);
        h(context, arrayList);
    }

    public void d(final Context context, final a aVar) {
        k kVar = this.f10183a;
        if (kVar != null) {
            kVar.cancel();
        }
        k kVar2 = new k(new Response.ErrorListener() {
            @Override
            public final void onErrorResponse(VolleyError volleyError) {
                GeofenceRegistrationReceiver.this.e(volleyError);
            }
        }, new Response.Listener() {
            @Override
            public final void onResponse(Object obj) {
                GeofenceRegistrationReceiver.this.f(aVar, context, (GetLocationsResponse) obj);
            }
        });
        this.f10183a = kVar2;
        kVar2.i();
    }

    public void h(Context context, final List<Location> list) {
        if (a.k(context).t()) {
            final f h10 = f.h(context);
            h10.o(new Runnable() {
                @Override
                public final void run() {
                    f.this.q(list);
                }
            });
        }
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if ("com.fitnessmobileapps.bodytech39559.GEOFENCE_REGISTER".equals(intent.getAction())) {
            mo.a.i("GeoFence").a("Received Registration intent! %s", intent);
            if (context == null || !q0.INSTANCE.e(context)) {
                return;
            }
            mo.a.i("GeoFence").a("Permissions are granted for Location!", new Object[0]);
            a k10 = a.k(context.getApplicationContext());
            if (k10.s() || k10.f() == null) {
                return;
            }
            ArrayList<Location> m10 = k10.m();
            if (m10 == null || m10.size() == 0) {
                d(context, k10);
            } else {
                h(context, m10);
            }
        }
    }
}