导航菜单

页面标题

页面副标题

Zepto v25.1.4 - EventsPublisherWorker.java 源代码

正在查看: Zepto v25.1.4 应用的 EventsPublisherWorker.java JAVA 源代码文件

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


package com.amazon.apay.instrumentation.worker;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import androidx.work.Data;
import androidx.work.ListenableWorker;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
import com.amazon.apay.instrumentation.clients.HttpsClient;
import com.amazon.apay.instrumentation.utils.b;
import com.amazon.apay.instrumentation.writer.a;
import com.amazon.identity.auth.device.authorization.AuthorizationResponseParser;
import java.sql.Timestamp;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import javax.net.ssl.HttpsURLConnection;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;

@Metadata
public final class EventsPublisherWorker extends Worker {
    public final Context f;
    public final WorkerParameters g;
    public final HttpsClient h;
    public final String i;
    public final a j;
    public final com.amazon.apay.instrumentation.encryptor.a k;
    public final String l;

    public EventsPublisherWorker(@NotNull Context context, @NotNull WorkerParameters workerParameters) {
        super(context, workerParameters);
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(workerParameters, "workerParams");
        this.f = context;
        this.g = workerParameters;
        this.h = new HttpsClient();
        this.j = new a(context);
        String valueOf = String.valueOf(workerParameters.f6261b.b(AuthorizationResponseParser.CLIENT_ID_STATE));
        this.l = valueOf;
        this.k = new com.amazon.apay.instrumentation.encryptor.a(valueOf);
        this.i = String.valueOf(workerParameters.f6261b.b("event"));
    }

    public final String a(WorkerParameters workerParameters) {
        String str;
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("sessionId", (Object) null);
        Context context = this.f;
        jSONObject.put("appId", context.getPackageName());
        jSONObject.put("brand", Build.BRAND);
        jSONObject.put("device", Build.DEVICE);
        jSONObject.put("buildId", Build.ID);
        jSONObject.put(AuthorizationResponseParser.CLIENT_ID_STATE, this.l);
        jSONObject.put("clientSdkVersion", workerParameters.f6261b.b("clientSdkVersion"));
        Data data = workerParameters.f6261b;
        jSONObject.put("clientSdkName", data.b("clientSdkName"));
        jSONObject.put("clientAdditionalMetadata", data.b("clientAdditionalMetadata"));
        jSONObject.put("instrumentationSdkVersion", "I.1.1.4");
        try {
            str = context.getPackageManager().getPackageInfo("in.amazon.mShop.android.shopping", 0).versionName;
            Intrinsics.checkNotNullExpressionValue(str, "context.packageManager.g…            ).versionName");
        } catch (PackageManager.NameNotFoundException unused) {
            str = "mshopNotInstalled";
        }
        jSONObject.put("mshopVersion", str);
        jSONObject.put("product", Build.PRODUCT);
        jSONObject.put("releaseVersion", Build.VERSION.RELEASE);
        jSONObject.put("sdkVersion", Build.VERSION.SDK_INT);
        String jSONObject2 = jSONObject.toString();
        Intrinsics.checkNotNullExpressionValue(jSONObject2, "payload.toString()");
        return jSONObject2;
    }

    public final String c(Map map) {
        StringBuilder sb = new StringBuilder();
        sb.append(((String) map.get("iv")) + '\n');
        sb.append(((String) map.get("encryptedSessionKey")) + '\n');
        sb.append(((String) map.get("encryptedData")) + '\n');
        sb.append(((String) map.get(AuthorizationResponseParser.CLIENT_ID_STATE)) + '\n');
        String sb2 = sb.toString();
        Intrinsics.checkNotNullExpressionValue(sb2, "stringBuilder.toString()");
        return sb2;
    }

    @Override
    public final ListenableWorker.Result doWork() {
        HttpsClient httpsClient;
        a aVar = this.j;
        String str = this.i;
        Iterator it = aVar.a(str).iterator();
        while (true) {
            boolean hasNext = it.hasNext();
            httpsClient = this.h;
            if (!hasNext) {
                break;
            }
            String str2 = (String) it.next();
            try {
                long time = new Timestamp(System.currentTimeMillis()).getTime();
                long d = aVar.d(str2);
                if (StringsKt.m(str2, ".log", false) || time - d > 240000) {
                    if (StringsKt.m(str2, ".tmp", false)) {
                        b.f7486a.getClass();
                        str2 = b.a(aVar, str2, str);
                    }
                    Integer a2 = httpsClient.a(str.equals("MetricEvent") ? "https://amazonpay.amazon.in/v3/sdk/metric-events" : "https://amazonpay.amazon.in/v3/sdk/crash-events", str2, c(this.k.a(a(this.g) + '\n' + aVar.f(str2, str))));
                    if (a2 != null && (a2.intValue() / 100 == 2 || a2.intValue() / 100 == 4)) {
                        aVar.b(str2, str);
                    }
                    Thread.sleep(1000L);
                }
            } catch (Exception e) {
                e.toString();
                Objects.toString(e.getCause());
            }
        }
        HttpsURLConnection httpsURLConnection = httpsClient.f7466a;
        if (httpsURLConnection != null) {
            httpsURLConnection.disconnect();
        }
        ListenableWorker.Result.Success success = new ListenableWorker.Result.Success();
        Intrinsics.checkNotNullExpressionValue(success, "success()");
        return success;
    }
}