导航菜单

页面标题

页面副标题

Hopscotch v9.7.2 - RegistrationIntentService.java 源代码

正在查看: Hopscotch v9.7.2 应用的 RegistrationIntentService.java JAVA 源代码文件

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


package in.hopscotch.android.service;

import android.app.IntentService;
import android.content.Intent;
import androidx.media3.exoplayer.trackselection.i;
import com.clevertap.android.sdk.u;
import com.google.firebase.messaging.FirebaseMessaging;
import in.hopscotch.android.api.factory.CustomerInfoApiFactory;
import in.hopscotch.android.api.response.ActionResponse;
import in.hopscotch.android.api.rest.HSRetrofitCallback;
import in.hopscotch.android.common.helper.b;
import in.hopscotch.android.domain.response.base.b;
import in.hopscotch.android.util.a1;
import in.hopscotch.android.util.g;
import in.juspay.hyper.constants.LogSubCategory;
import retrofit2.Response;

public class RegistrationIntentService extends IntentService {
    private static final String TAG = "in.hopscotch.android.service.RegistrationIntentService";
    public static final int a = 0;

    public class a extends HSRetrofitCallback<ActionResponse> {
        public final String a;

        public a(RegistrationIntentService registrationIntentService, String str) {
            this.a = str;
        }

        public final void onFailure(Throwable th) {
        }

        public final void onResponse(Response<ActionResponse> response) {
            if (response == null || !response.isSuccessful() || response.body() == null) {
                return;
            }
            String str = response.body().action;
            String str2 = a1.a;
            if (b.SUCCESS.equalsIgnoreCase(str)) {
                in.hopscotch.android.db.a.P(true);
                in.hopscotch.android.db.a.k().putString("GCM_TOKEN", this.a);
                in.hopscotch.android.db.a.k().apply();
            }
        }
    }

    public RegistrationIntentService() {
        super(TAG);
    }

    public final void a(String str) {
        CustomerInfoApiFactory.getInstance().registerDevice(android.support.v4.media.a.o("deviceToken", str, "deviceType", LogSubCategory.LifeCycle.ANDROID), new a(this, str));
    }

    @Override
    public final void onHandleIntent(Intent intent) {
        try {
            synchronized (TAG) {
                try {
                    in.hopscotch.android.db.a.P(false);
                    b.a.a.getClass();
                    u b = b.a.b();
                    if (intent.getStringExtra("TOKEN") != null) {
                        a(intent.getStringExtra("TOKEN"));
                    } else {
                        FirebaseMessaging.j().l().addOnCompleteListener(new i(this, b));
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        } catch (Exception e) {
            g.b(e);
        }
    }
}