导航菜单

页面标题

页面副标题

Perplexity v2.48.1 - q.java 源代码

正在查看: Perplexity v2.48.1 应用的 q.java JAVA 源代码文件

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


package h3;

import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import i3.C2672l;
import i3.Y;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.io.TextStreamsKt;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
import om.D;

public final class q extends SuspendLambda implements Function2 {

    public final String f30911w;

    public final w f30912x;

    public final String f30913y;

    public final String f30914z;

    public q(String str, w wVar, String str2, String str3, Continuation continuation) {
        super(2, continuation);
        this.f30911w = str;
        this.f30912x = wVar;
        this.f30913y = str2;
        this.f30914z = str3;
    }

    public final Continuation create(Object obj, Continuation continuation) {
        return new q(this.f30911w, this.f30912x, this.f30913y, this.f30914z, continuation);
    }

    public final Object invoke(Object obj, Object obj2) {
        return create((D) obj, (Continuation) obj2).invokeSuspend(Unit.a);
    }

    public final Object invokeSuspend(Object obj) {
        BufferedReader bufferedReader;
        CoroutineSingletons coroutineSingletons = CoroutineSingletons.w;
        ResultKt.b(obj);
        URLConnection uRLConnection = (URLConnection) FirebasePerfUrlConnection.instrument(new URL("https://api.openai.com/v1/realtime?model=" + this.f30911w).openConnection());
        Intrinsics.f(uRLConnection, "null cannot be cast to non-null type java.net.HttpURLConnection");
        HttpURLConnection httpURLConnection = (HttpURLConnection) uRLConnection;
        try {
            String str = this.f30913y;
            httpURLConnection.setRequestMethod("POST");
            httpURLConnection.setRequestProperty("Content-Type", "application/sdp");
            httpURLConnection.setRequestProperty("Authorization", "Bearer " + str);
            httpURLConnection.setDoOutput(true);
            OutputStream outputStream = httpURLConnection.getOutputStream();
            String str2 = this.f30914z;
            try {
                Charset charset = Charsets.b;
                byte[] bytes = str2.getBytes(charset);
                Intrinsics.g(bytes, "getBytes(...)");
                outputStream.write(bytes);
                Unit unit = Unit.a;
                outputStream.close();
                int responseCode = httpURLConnection.getResponseCode();
                if (200 > responseCode || responseCode >= 300) {
                    InputStream errorStream = httpURLConnection.getErrorStream();
                    Intrinsics.g(errorStream, "getErrorStream(...)");
                    bufferedReader = new BufferedReader(new InputStreamReader(errorStream, charset), 8192);
                    try {
                        String b6 = TextStreamsKt.b(bufferedReader);
                        bufferedReader.close();
                        Mm.c cVar = (Mm.c) this.f30912x.f30929c.get();
                        cVar.getClass();
                        C2672l c2672l = ((Y) cVar.b(Y.Companion.serializer(), b6)).f31933a;
                        if (Intrinsics.c(c2672l.f31986b, "unsupported_country_region_territory")) {
                            throw new Exception() {
                            };
                        }
                        Jn.c.a.j(new IllegalStateException(), "getRemoteSdp error %s", new Object[]{c2672l.f31987c});
                        throw new IllegalStateException();
                    } finally {
                        try {
                            throw th;
                        } finally {
                        }
                    }
                }
                InputStream inputStream = httpURLConnection.getInputStream();
                Intrinsics.g(inputStream, "getInputStream(...)");
                bufferedReader = new BufferedReader(new InputStreamReader(inputStream, charset), 8192);
                try {
                    String b10 = TextStreamsKt.b(bufferedReader);
                    bufferedReader.close();
                    httpURLConnection.disconnect();
                    return b10;
                } finally {
                }
            } finally {
            }
        } catch (Throwable th) {
            httpURLConnection.disconnect();
            throw th;
        }
        httpURLConnection.disconnect();
        throw th;
    }
}