导航菜单

页面标题

页面副标题

Hopscotch v9.7.2 - FeatureCardIntentService.java 源代码

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

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


package in.hopscotch.android.service.applaunch;

import android.content.Intent;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.core.app.j;
import in.hopscotch.android.activity.FeatureCardActivity;
import in.hopscotch.android.api.factory.ResourcesApiFactory;
import in.hopscotch.android.api.model.FeatureCard;
import in.hopscotch.android.api.response.ActionResponse;
import in.hopscotch.android.domain.response.base.b;
import in.hopscotch.android.util.a1;
import in.hopscotch.android.util.g;
import java.io.IOException;
import java.io.Serializable;
import java.util.List;
import retrofit2.Response;

public class FeatureCardIntentService extends j {
    private String fromScreen;

    public final void d(@NonNull Intent intent) {
        if (intent != null) {
            this.fromScreen = intent.getStringExtra("fromScreen");
            try {
                f();
            } catch (IOException e) {
                g.b(e);
            }
        }
    }

    public final void f() throws IOException {
        Response execute;
        FeatureCard featureCard;
        List list;
        long j;
        if (ResourcesApiFactory.getInstance().getResourcesApi() == null || (execute = ResourcesApiFactory.getInstance().getResourcesApi().getFeatureCard().execute()) == null || !execute.isSuccessful() || (featureCard = (FeatureCard) execute.body()) == null) {
            return;
        }
        String str = ((ActionResponse) featureCard).action;
        String str2 = a1.a;
        if (!b.SUCCESS.equalsIgnoreCase(str) || (list = featureCard.actions) == null || list.size() <= 0 || TextUtils.isEmpty(featureCard.title) || TextUtils.isEmpty(((ActionResponse) featureCard).message)) {
            return;
        }
        synchronized (in.hopscotch.android.db.a.class) {
            j = in.hopscotch.android.db.a.x().getLong("LAST_FEATURE_CARD_ID", 0L);
        }
        if (j != featureCard.id) {
            if (TextUtils.isEmpty(featureCard.imageUrl)) {
                g(featureCard, false);
            } else if (TextUtils.isEmpty(featureCard.imageUrl)) {
                g(featureCard, false);
            } else {
                g(featureCard, true);
            }
        }
    }

    public final void g(FeatureCard featureCard, boolean z) {
        Intent intent = new Intent(getBaseContext(), (Class<?>) FeatureCardActivity.class);
        intent.putExtra("featureCard", (Serializable) featureCard);
        intent.putExtra("hasImage", z);
        intent.putExtra("FROM_SCREEN", this.fromScreen);
        intent.addFlags(268435456);
        getApplication().startActivity(intent);
    }
}