导航菜单

页面标题

页面副标题

Niza v1.4.3 - g0.java 源代码

正在查看: Niza v1.4.3 应用的 g0.java JAVA 源代码文件

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


package com.sumsub.sentry;

import com.sumsub.log.logger.Logger;
import io.sentry.protocol.Request;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPOutputStream;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.ReplaceWith;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.io.ByteStreamsKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Lambda;
import kotlinx.serialization.KSerializer;
import kotlinx.serialization.Serializable;
import kotlinx.serialization.UnknownFieldException;
import kotlinx.serialization.descriptors.SerialDescriptor;
import kotlinx.serialization.encoding.CompositeDecoder;
import kotlinx.serialization.encoding.CompositeEncoder;
import kotlinx.serialization.encoding.Decoder;
import kotlinx.serialization.encoding.Encoder;
import kotlinx.serialization.internal.GeneratedSerializer;
import kotlinx.serialization.internal.PluginExceptionsKt;
import kotlinx.serialization.internal.PluginGeneratedSerialDescriptor;
import kotlinx.serialization.internal.SerializationConstructorMarker;
import kotlinx.serialization.internal.StringSerializer;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;

@Metadata(d1 = {"\u0000\\\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0001\u0018\u0000 $2\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0002\t%B\u000f\u0012\u0006\u0010\u0017\u001a\u00020\u0015¢\u0006\u0004\b\u001d\u0010\u001eB%\b\u0017\u0012\u0006\u0010 \u001a\u00020\u001f\u0012\b\u0010\u0017\u001a\u0004\u0018\u00010\u0015\u0012\b\u0010\"\u001a\u0004\u0018\u00010!¢\u0006\u0004\b\u001d\u0010#J!\u0010\t\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00002\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006HÇ\u0001J\u001b\u0010\t\u001a\u00020\u000b2\u0006\u0010\n\u001a\u00020\u0002H\u0096@ø\u0001\u0000¢\u0006\u0004\b\t\u0010\fJ#\u0010\t\u001a\u00020\b2\u0006\u0010\n\u001a\u00020\u00022\u0006\u0010\u000e\u001a\u00020\rH\u0096@ø\u0001\u0000¢\u0006\u0004\b\t\u0010\u000fJ\u001b\u0010\t\u001a\u00020\u000b2\u0006\u0010\u0011\u001a\u00020\u0010H\u0096@ø\u0001\u0000¢\u0006\u0004\b\t\u0010\u0012J\u0010\u0010\t\u001a\u00020\u000b2\u0006\u0010\u0014\u001a\u00020\u0013H\u0002R\u0014\u0010\u0017\u001a\u00020\u00158\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\t\u0010\u0016R\u001b\u0010\u001c\u001a\u00020\u00188BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0019\u0010\u001a\u001a\u0004\b\t\u0010\u001b\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006&"}, d2 = {"Lcom/sumsub/sentry/g0;", "Lcom/sumsub/sns/internal/log/cacher/a;", "Lcom/sumsub/sentry/v;", "self", "Lkotlinx/serialization/encoding/CompositeEncoder;", "output", "Lkotlinx/serialization/descriptors/SerialDescriptor;", "serialDesc", "", "a", "value", "", "(Lcom/sumsub/sentry/v;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "Ljava/io/OutputStream;", "outputStream", "(Lcom/sumsub/sentry/v;Ljava/io/OutputStream;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "Ljava/io/InputStream;", "inputStream", "(Ljava/io/InputStream;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "", "bytes", "", "Ljava/lang/String;", Request.JsonKeys.URL, "Lokhttp3/OkHttpClient;", "b", "Lkotlin/Lazy;", "()Lokhttp3/OkHttpClient;", "sentryOkHttpClient", "<init>", "(Ljava/lang/String;)V", "", "seen1", "Lkotlinx/serialization/internal/SerializationConstructorMarker;", "serializationConstructorMarker", "(ILjava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V", "Companion", "c", "idensic-mobile-sdk-aar_release"}, k = 1, mv = {1, 7, 1})
@Serializable
public final class g0 implements com.sumsub.sns.internal.log.cacher.a<v> {

    public static final Companion INSTANCE = new Companion(null);
    public static final String c = "SentrySink";

    public final String url;

    public final Lazy sentryOkHttpClient;

    @Deprecated(level = DeprecationLevel.HIDDEN, message = "This synthesized declaration should not be used directly", replaceWith = @ReplaceWith(expression = "", imports = {}))
    public static final class a implements GeneratedSerializer<g0> {
        public static final a a;
        public static final SerialDescriptor b;

        static {
            a aVar = new a();
            a = aVar;
            PluginGeneratedSerialDescriptor pluginGeneratedSerialDescriptor = new PluginGeneratedSerialDescriptor("com.sumsub.sentry.SentrySink", aVar, 1);
            pluginGeneratedSerialDescriptor.addElement(Request.JsonKeys.URL, false);
            b = pluginGeneratedSerialDescriptor;
        }

        public g0 deserialize(Decoder decoder) {
            String str;
            SerialDescriptor descriptor = getDescriptor();
            CompositeDecoder beginStructure = decoder.beginStructure(descriptor);
            int i = 1;
            SerializationConstructorMarker serializationConstructorMarker = null;
            if (beginStructure.decodeSequentially()) {
                str = beginStructure.decodeStringElement(descriptor, 0);
            } else {
                int i2 = 0;
                str = null;
                while (i != 0) {
                    int decodeElementIndex = beginStructure.decodeElementIndex(descriptor);
                    if (decodeElementIndex == -1) {
                        i = 0;
                    } else {
                        if (decodeElementIndex != 0) {
                            throw new UnknownFieldException(decodeElementIndex);
                        }
                        str = beginStructure.decodeStringElement(descriptor, 0);
                        i2 |= 1;
                    }
                }
                i = i2;
            }
            beginStructure.endStructure(descriptor);
            return new g0(i, str, serializationConstructorMarker);
        }

        public KSerializer<?>[] childSerializers() {
            return new KSerializer[]{StringSerializer.INSTANCE};
        }

        public SerialDescriptor getDescriptor() {
            return b;
        }

        public KSerializer<?>[] typeParametersSerializers() {
            return GeneratedSerializer.DefaultImpls.typeParametersSerializers(this);
        }

        public void serialize(Encoder encoder, g0 g0Var) {
            SerialDescriptor descriptor = getDescriptor();
            CompositeEncoder beginStructure = encoder.beginStructure(descriptor);
            g0.a(g0Var, beginStructure, descriptor);
            beginStructure.endStructure(descriptor);
        }
    }

    public static final class b extends Lambda implements Function0<OkHttpClient> {
        public static final b a = new b();

        public b() {
            super(0);
        }

        @Override
        public final OkHttpClient invoke() {
            OkHttpClient.Builder builder = new OkHttpClient.Builder();
            TimeUnit timeUnit = TimeUnit.SECONDS;
            return builder.callTimeout(30L, timeUnit).connectTimeout(30L, timeUnit).readTimeout(30L, timeUnit).writeTimeout(30L, timeUnit).pingInterval(20L, timeUnit).build();
        }
    }

    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final KSerializer<g0> serializer() {
            return a.a;
        }

        public Companion() {
        }
    }

    public static final class d extends Lambda implements Function0<OkHttpClient> {
        public static final d a = new d();

        public d() {
            super(0);
        }

        @Override
        public final OkHttpClient invoke() {
            OkHttpClient.Builder builder = new OkHttpClient.Builder();
            TimeUnit timeUnit = TimeUnit.SECONDS;
            return builder.callTimeout(30L, timeUnit).connectTimeout(30L, timeUnit).readTimeout(30L, timeUnit).writeTimeout(30L, timeUnit).pingInterval(20L, timeUnit).build();
        }
    }

    @Deprecated(level = DeprecationLevel.HIDDEN, message = "This synthesized declaration should not be used directly", replaceWith = @ReplaceWith(expression = "", imports = {}))
    public g0(int i, String str, SerializationConstructorMarker serializationConstructorMarker) {
        if (1 != (i & 1)) {
            PluginExceptionsKt.throwMissingFieldException(i, 1, a.a.getDescriptor());
        }
        this.url = str;
        this.sentryOkHttpClient = LazyKt.lazy(b.a);
    }

    @Override
    public Object a(v vVar, OutputStream outputStream, Continuation continuation) {
        return a2(vVar, outputStream, (Continuation<? super Unit>) continuation);
    }

    @Override
    public Object send(Object obj, Continuation continuation) {
        return a((v) obj, (Continuation<? super Boolean>) continuation);
    }

    @JvmStatic
    public static final void a(g0 self, CompositeEncoder output, SerialDescriptor serialDesc) {
        output.encodeStringElement(serialDesc, 0, self.url);
    }

    public final OkHttpClient a() {
        return (OkHttpClient) this.sentryOkHttpClient.getValue();
    }

    public Object a(v vVar, Continuation<? super Boolean> continuation) {
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream);
        try {
            m.a.a(vVar, gZIPOutputStream);
            Unit unit = Unit.INSTANCE;
            CloseableKt.closeFinally(gZIPOutputStream, null);
            return Boxing.boxBoolean(a(byteArrayOutputStream.toByteArray()));
        } finally {
        }
    }

    public g0(String str) {
        this.url = str;
        this.sentryOkHttpClient = LazyKt.lazy(d.a);
    }

    public Object a2(v vVar, OutputStream outputStream, Continuation<? super Unit> continuation) {
        m.a.a(vVar, outputStream);
        return Unit.INSTANCE;
    }

    @Override
    public Object a(InputStream inputStream, Continuation<? super Boolean> continuation) {
        boolean z;
        Logger.d$default(com.sumsub.sns.internal.log.a.a, c, "Resend envelope from cache", null, 4, null);
        try {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream);
            try {
                gZIPOutputStream.write(ByteStreamsKt.readBytes(inputStream));
                Unit unit = Unit.INSTANCE;
                CloseableKt.closeFinally(gZIPOutputStream, null);
                z = a(byteArrayOutputStream.toByteArray());
            } finally {
            }
        } catch (Exception e) {
            Logger.d$default(com.sumsub.sns.internal.log.a.a, c, "Can't resend envelope from cache: " + e, null, 4, null);
            z = false;
        }
        return Boxing.boxBoolean(z);
    }

    public final boolean a(byte[] bytes) {
        try {
            return a().newCall(new Request.Builder().url(this.url + "api/2/envelope/").header("Content-Encoding", "gzip").header("Accept", "application/json").header("Connection", "close").header("User-Agent", com.sumsub.sns.a.d).header("X-Sentry-Auth", "Sentry sentry_version=7,sentry_client=1.34.1,sentry_key=5ed67192b2104fb682468a5be4dee5da").post(RequestBody.Companion.create$default(RequestBody.Companion, bytes, MediaType.Companion.get("application/x-sentry-envelope"), 0, 0, 6, (Object) null)).build()).execute().isSuccessful();
        } catch (Exception unused) {
            return false;
        }
    }
}