导航菜单

页面标题

页面副标题

Housing v14.7.8 - HttpTransaction.java 源代码

正在查看: Housing v14.7.8 应用的 HttpTransaction.java JAVA 源代码文件

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


package com.chuckerteam.chucker.internal.data.entity;

import android.content.Context;
import android.graphics.Bitmap;
import android.text.SpannableStringBuilder;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import com.chuckerteam.chucker.internal.support.n0;
import com.chuckerteam.chucker.internal.support.o;
import com.chuckerteam.chucker.internal.support.p;
import com.chuckerteam.chucker.internal.support.t;
import com.facebook.appevents.iap.InAppPurchaseConstants;
import com.facebook.gamingservices.cloudgaming.internal.SDKConstants;
import com.facebook.internal.AnalyticsEvents;
import com.facebook.react.views.textinput.ReactEditTextInputConnectionWrapper;
import com.google.gson.i;
import com.google.gson.m;
import com.google.gson.n;
import com.newrelic.agent.android.instrumentation.BitmapFactoryInstrumentation;
import com.newrelic.agent.android.instrumentation.GsonInstrumentation;
import com.newrelic.agent.android.instrumentation.Instrumented;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import kotlin.Metadata;
import kotlin.enums.EnumEntries;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.jvm.internal.r;
import kotlin.text.q;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXParseException;

@Metadata(d1 = {"\u0000n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\r\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0002\b\t\n\u0002\u0010\u0012\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\r\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b_\n\u0002\u0018\u0002\n\u0002\b\u0014\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0001\u0018\u00002\u00020\u0001:\u0002»\u0001B³\u0002\u0012\b\b\u0002\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\b\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\t\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\n\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u000b\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\f\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\r\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u000e\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u000f\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u0010\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u0011\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u0012\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u0013\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u0014\u001a\u0004\u0018\u00010\u0007\u0012\b\b\u0002\u0010\u0016\u001a\u00020\u0015\u0012\b\u0010\u0018\u001a\u0004\u0018\u00010\u0017\u0012\b\u0010\u0019\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u001a\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u001b\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u001c\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u001d\u001a\u0004\u0018\u00010\u0007\u0012\b\u0010\u001e\u001a\u0004\u0018\u00010\u0002\u0012\b\u0010\u001f\u001a\u0004\u0018\u00010\u0007\u0012\b\b\u0002\u0010 \u001a\u00020\u0015\u0012\b\u0010\"\u001a\u0004\u0018\u00010!\u0012\b\b\u0002\u0010#\u001a\u00020\u0015\u0012\b\u0010$\u001a\u0004\u0018\u00010\u0007¢\u0006\u0004\b%\u0010&B\t\b\u0017¢\u0006\u0004\b%\u0010'J\u0015\u0010+\u001a\u00020*2\u0006\u0010)\u001a\u00020(¢\u0006\u0004\b+\u0010,J\u001b\u0010+\u001a\u00020*2\f\u0010)\u001a\b\u0012\u0004\u0012\u00020.0-¢\u0006\u0004\b+\u0010/J\u0015\u00100\u001a\u00020*2\u0006\u0010)\u001a\u00020(¢\u0006\u0004\b0\u0010,J\u0015\u00101\u001a\n\u0012\u0004\u0012\u00020.\u0018\u00010-¢\u0006\u0004\b1\u00102J\u0015\u00103\u001a\n\u0012\u0004\u0012\u00020.\u0018\u00010-¢\u0006\u0004\b3\u00102J\u0015\u00105\u001a\u00020\u00072\u0006\u00104\u001a\u00020\u0015¢\u0006\u0004\b5\u00106J\u0015\u00107\u001a\u00020*2\u0006\u0010)\u001a\u00020(¢\u0006\u0004\b7\u0010,J\u001b\u00107\u001a\u00020*2\f\u0010)\u001a\b\u0012\u0004\u0012\u00020.0-¢\u0006\u0004\b7\u0010/J\u0015\u00108\u001a\u00020\u00072\u0006\u00104\u001a\u00020\u0015¢\u0006\u0004\b8\u00106J\r\u00109\u001a\u00020\u0007¢\u0006\u0004\b9\u0010:J\u0017\u0010>\u001a\u00020=2\b\u0010<\u001a\u0004\u0018\u00010;¢\u0006\u0004\b>\u0010?J\r\u0010@\u001a\u00020\u0007¢\u0006\u0004\b@\u0010:J\u0017\u0010A\u001a\u00020=2\b\u0010<\u001a\u0004\u0018\u00010;¢\u0006\u0004\bA\u0010?J\u0015\u0010D\u001a\u00020\u00002\u0006\u0010C\u001a\u00020B¢\u0006\u0004\bD\u0010EJ\u0015\u0010G\u001a\u00020\u00072\u0006\u0010F\u001a\u00020\u0015¢\u0006\u0004\bG\u00106J\u0015\u0010H\u001a\u00020\u00072\u0006\u0010F\u001a\u00020\u0015¢\u0006\u0004\bH\u00106J\r\u0010I\u001a\u00020\u0002¢\u0006\u0004\bI\u0010JJ\r\u0010K\u001a\u00020\u0002¢\u0006\u0004\bK\u0010JJ\r\u0010L\u001a\u00020\u0002¢\u0006\u0004\bL\u0010JJ\u0017\u0010N\u001a\u00020\u00152\b\u0010M\u001a\u0004\u0018\u00010\u0000¢\u0006\u0004\bN\u0010OJ\u001d\u0010P\u001a\b\u0012\u0004\u0012\u00020.0-2\u0006\u0010)\u001a\u00020(H\u0002¢\u0006\u0004\bP\u0010QJ!\u0010T\u001a\u00020\u00072\u0006\u0010R\u001a\u00020\u00072\b\u0010S\u001a\u0004\u0018\u00010\u0007H\u0002¢\u0006\u0004\bT\u0010UJ+\u0010V\u001a\u00020=2\u0006\u0010R\u001a\u00020=2\b\u0010S\u001a\u0004\u0018\u00010\u00072\b\u0010<\u001a\u0004\u0018\u00010;H\u0002¢\u0006\u0004\bV\u0010WJ\u0017\u0010Y\u001a\u00020\u00072\u0006\u0010X\u001a\u00020\u0002H\u0002¢\u0006\u0004\bY\u0010ZR\"\u0010\u0003\u001a\u00020\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0003\u0010[\u001a\u0004\b\\\u0010J\"\u0004\b]\u0010^R$\u0010\u0004\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0004\u0010_\u001a\u0004\b`\u0010a\"\u0004\bb\u0010cR$\u0010\u0005\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0005\u0010_\u001a\u0004\bd\u0010a\"\u0004\be\u0010cR$\u0010\u0006\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0006\u0010_\u001a\u0004\bf\u0010a\"\u0004\bg\u0010cR$\u0010\b\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\b\u0010h\u001a\u0004\bi\u0010:\"\u0004\bj\u0010kR$\u0010\t\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\t\u0010h\u001a\u0004\bl\u0010:\"\u0004\bm\u0010kR$\u0010\n\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\n\u0010h\u001a\u0004\bn\u0010:\"\u0004\bo\u0010kR$\u0010\u000b\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u000b\u0010h\u001a\u0004\bp\u0010:\"\u0004\bq\u0010kR$\u0010\f\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\f\u0010h\u001a\u0004\br\u0010:\"\u0004\bs\u0010kR$\u0010\r\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\r\u0010h\u001a\u0004\bt\u0010:\"\u0004\bu\u0010kR$\u0010\u000e\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u000e\u0010h\u001a\u0004\bv\u0010:\"\u0004\bw\u0010kR$\u0010\u000f\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u000f\u0010h\u001a\u0004\bx\u0010:\"\u0004\by\u0010kR$\u0010\u0010\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0010\u0010_\u001a\u0004\bz\u0010a\"\u0004\b{\u0010cR$\u0010\u0011\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0011\u0010h\u001a\u0004\b|\u0010:\"\u0004\b}\u0010kR$\u0010\u0012\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0012\n\u0004\b\u0012\u0010h\u001a\u0004\b~\u0010:\"\u0004\b+\u0010kR%\u0010\u0013\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0013\n\u0004\b\u0013\u0010_\u001a\u0004\b\u007f\u0010a\"\u0005\b\u0080\u0001\u0010cR&\u0010\u0014\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u0014\u0010h\u001a\u0005\b\u0081\u0001\u0010:\"\u0005\b\u0082\u0001\u0010kR&\u0010\u0016\u001a\u00020\u00158\u0006@\u0006X\u0087\u000e¢\u0006\u0016\n\u0005\b\u0016\u0010\u0083\u0001\u001a\u0005\b\u0016\u0010\u0084\u0001\"\u0006\b\u0085\u0001\u0010\u0086\u0001R)\u0010\u0018\u001a\u0004\u0018\u00010\u00178\u0006@\u0006X\u0087\u000e¢\u0006\u0017\n\u0005\b\u0018\u0010\u0087\u0001\u001a\u0006\b\u0088\u0001\u0010\u0089\u0001\"\u0006\b\u008a\u0001\u0010\u008b\u0001R&\u0010\u0019\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u0019\u0010h\u001a\u0005\b\u008c\u0001\u0010:\"\u0005\b\u008d\u0001\u0010kR&\u0010\u001a\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u001a\u0010h\u001a\u0005\b\u008e\u0001\u0010:\"\u0005\b\u008f\u0001\u0010kR&\u0010\u001b\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u001b\u0010_\u001a\u0005\b\u0090\u0001\u0010a\"\u0005\b\u0091\u0001\u0010cR&\u0010\u001c\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u001c\u0010h\u001a\u0005\b\u0092\u0001\u0010:\"\u0005\b\u0093\u0001\u0010kR%\u0010\u001d\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0013\n\u0004\b\u001d\u0010h\u001a\u0005\b\u0094\u0001\u0010:\"\u0004\b7\u0010kR&\u0010\u001e\u001a\u0004\u0018\u00010\u00028\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u001e\u0010_\u001a\u0005\b\u0095\u0001\u0010a\"\u0005\b\u0096\u0001\u0010cR&\u0010\u001f\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0014\n\u0004\b\u001f\u0010h\u001a\u0005\b\u0097\u0001\u0010:\"\u0005\b\u0098\u0001\u0010kR&\u0010 \u001a\u00020\u00158\u0006@\u0006X\u0087\u000e¢\u0006\u0016\n\u0005\b \u0010\u0083\u0001\u001a\u0005\b \u0010\u0084\u0001\"\u0006\b\u0099\u0001\u0010\u0086\u0001R)\u0010\"\u001a\u0004\u0018\u00010!8\u0006@\u0006X\u0087\u000e¢\u0006\u0017\n\u0005\b\"\u0010\u009a\u0001\u001a\u0006\b\u009b\u0001\u0010\u009c\u0001\"\u0006\b\u009d\u0001\u0010\u009e\u0001R'\u0010#\u001a\u00020\u00158\u0006@\u0006X\u0087\u000e¢\u0006\u0017\n\u0005\b#\u0010\u0083\u0001\u001a\u0006\b\u009f\u0001\u0010\u0084\u0001\"\u0006\b \u0001\u0010\u0086\u0001R%\u0010$\u001a\u0004\u0018\u00010\u00078\u0006@\u0006X\u0087\u000e¢\u0006\u0013\n\u0004\b$\u0010h\u001a\u0005\b¡\u0001\u0010:\"\u0004\b0\u0010kR\u0015\u0010¥\u0001\u001a\u00030¢\u00018F¢\u0006\b\u001a\u0006\b£\u0001\u0010¤\u0001R\u0015\u0010§\u0001\u001a\u0004\u0018\u00010\u00078F¢\u0006\u0007\u001a\u0005\b¦\u0001\u0010:R\u0015\u0010©\u0001\u001a\u0004\u0018\u00010\u00078F¢\u0006\u0007\u001a\u0005\b¨\u0001\u0010:R\u0015\u0010«\u0001\u001a\u0004\u0018\u00010\u00078F¢\u0006\u0007\u001a\u0005\bª\u0001\u0010:R\u0013\u0010\u00ad\u0001\u001a\u00020\u00078F¢\u0006\u0007\u001a\u0005\b¬\u0001\u0010:R\u0015\u0010¯\u0001\u001a\u0004\u0018\u00010\u00078F¢\u0006\u0007\u001a\u0005\b®\u0001\u0010:R\u0013\u0010±\u0001\u001a\u00020\u00078F¢\u0006\u0007\u001a\u0005\b°\u0001\u0010:R\u0015\u0010³\u0001\u001a\u0004\u0018\u00010\u00078F¢\u0006\u0007\u001a\u0005\b²\u0001\u0010:R\u0013\u0010µ\u0001\u001a\u00020\u00078F¢\u0006\u0007\u001a\u0005\b´\u0001\u0010:R\u0014\u0010¶\u0001\u001a\u00020\u00158F¢\u0006\b\u001a\u0006\b¶\u0001\u0010\u0084\u0001R\u0017\u0010º\u0001\u001a\u0005\u0018\u00010·\u00018F¢\u0006\b\u001a\u0006\b¸\u0001\u0010¹\u0001¨\u0006¼\u0001"}, d2 = {"Lcom/chuckerteam/chucker/internal/data/entity/HttpTransaction;", "", "", "id", "requestDate", "responseDate", "tookMs", "", "protocol", "method", "url", "host", "path", "scheme", "responseTlsVersion", "responseCipherSuite", "requestPayloadSize", "requestContentType", "requestHeaders", "requestHeadersSize", "requestBody", "", "isRequestBodyEncoded", "", "responseCode", "responseMessage", "error", "responsePayloadSize", "responseContentType", "responseHeaders", "responseHeadersSize", "responseBody", "isResponseBodyEncoded", "", "responseImageData", "graphQlDetected", "graphQlOperationName", "<init>", "(JLjava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Z[BZLjava/lang/String;)V", "()V", "Lokhttp3/Headers;", "headers", "Lzp/j0;", "setRequestHeaders", "(Lokhttp3/Headers;)V", "", "Lk5/a;", "(Ljava/util/List;)V", "setGraphQlOperationName", "getParsedRequestHeaders", "()Ljava/util/List;", "getParsedResponseHeaders", "withMarkup", "getRequestHeadersString", "(Z)Ljava/lang/String;", "setResponseHeaders", "getResponseHeadersString", "getFormattedRequestBody", "()Ljava/lang/String;", "Landroid/content/Context;", "context", "", "getSpannedRequestBody", "(Landroid/content/Context;)Ljava/lang/CharSequence;", "getFormattedResponseBody", "getSpannedResponseBody", "Lokhttp3/HttpUrl;", "httpUrl", "populateUrl", "(Lokhttp3/HttpUrl;)Lcom/chuckerteam/chucker/internal/data/entity/HttpTransaction;", "encode", "getFormattedUrl", "getFormattedPath", "getRequestTotalSize", "()J", "getResponseTotalSize", "getHarResponseBodySize", "other", "hasTheSameContent", "(Lcom/chuckerteam/chucker/internal/data/entity/HttpTransaction;)Z", "toHttpHeaderList", "(Lokhttp3/Headers;)Ljava/util/List;", SDKConstants.PARAM_A2U_BODY, "contentType", "formatBody", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "spanBody", "(Ljava/lang/CharSequence;Ljava/lang/String;Landroid/content/Context;)Ljava/lang/CharSequence;", "bytes", "formatBytes", "(J)Ljava/lang/String;", "J", "getId", "setId", "(J)V", "Ljava/lang/Long;", "getRequestDate", "()Ljava/lang/Long;", "setRequestDate", "(Ljava/lang/Long;)V", "getResponseDate", "setResponseDate", "getTookMs", "setTookMs", "Ljava/lang/String;", "getProtocol", "setProtocol", "(Ljava/lang/String;)V", "getMethod", "setMethod", "getUrl", "setUrl", "getHost", "setHost", "getPath", "setPath", "getScheme", "setScheme", "getResponseTlsVersion", "setResponseTlsVersion", "getResponseCipherSuite", "setResponseCipherSuite", "getRequestPayloadSize", "setRequestPayloadSize", "getRequestContentType", "setRequestContentType", "getRequestHeaders", "getRequestHeadersSize", "setRequestHeadersSize", "getRequestBody", "setRequestBody", "Z", "()Z", "setRequestBodyEncoded", "(Z)V", "Ljava/lang/Integer;", InAppPurchaseConstants.METHOD_GET_RESPONSE_CODE, "()Ljava/lang/Integer;", "setResponseCode", "(Ljava/lang/Integer;)V", "getResponseMessage", "setResponseMessage", "getError", "setError", "getResponsePayloadSize", "setResponsePayloadSize", "getResponseContentType", "setResponseContentType", "getResponseHeaders", "getResponseHeadersSize", "setResponseHeadersSize", "getResponseBody", "setResponseBody", "setResponseBodyEncoded", "[B", "getResponseImageData", "()[B", "setResponseImageData", "([B)V", "getGraphQlDetected", "setGraphQlDetected", "getGraphQlOperationName", "Lcom/chuckerteam/chucker/internal/data/entity/HttpTransaction$a;", "getStatus", "()Lcom/chuckerteam/chucker/internal/data/entity/HttpTransaction$a;", AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS, "getRequestDateString", "requestDateString", "getResponseDateString", "responseDateString", "getDurationString", "durationString", "getRequestSizeString", "requestSizeString", "getResponseSizeString", "responseSizeString", "getTotalSizeString", "totalSizeString", "getResponseSummaryText", "responseSummaryText", "getNotificationText", "notificationText", "isSsl", "Landroid/graphics/Bitmap;", "getResponseImageBitmap", "()Landroid/graphics/Bitmap;", "responseImageBitmap", "a", "com.github.ChuckerTeam.Chucker.library"}, k = 1, mv = {2, 0, 0}, xi = 48)
@Entity(tableName = "transactions")
@Instrumented
@SourceDebugExtension({"SMAP\nHttpTransaction.kt\nKotlin\n*S Kotlin\n*F\n+ 1 HttpTransaction.kt\ncom/chuckerteam/chucker/internal/data/entity/HttpTransaction\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,345:1\n1#2:346\n*E\n"})
public final class HttpTransaction {

    @ColumnInfo(name = "error")
    @Nullable
    private String error;

    @ColumnInfo(name = "graphQlDetected")
    private boolean graphQlDetected;

    @ColumnInfo(name = "graphQlOperationName")
    @Nullable
    private String graphQlOperationName;

    @ColumnInfo(name = "host")
    @Nullable
    private String host;

    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    private long id;

    @ColumnInfo(name = "isRequestBodyEncoded")
    private boolean isRequestBodyEncoded;

    @ColumnInfo(name = "isResponseBodyEncoded")
    private boolean isResponseBodyEncoded;

    @ColumnInfo(name = "method")
    @Nullable
    private String method;

    @ColumnInfo(name = "path")
    @Nullable
    private String path;

    @ColumnInfo(name = "protocol")
    @Nullable
    private String protocol;

    @ColumnInfo(name = "requestBody")
    @Nullable
    private String requestBody;

    @ColumnInfo(name = "requestContentType")
    @Nullable
    private String requestContentType;

    @ColumnInfo(name = "requestDate")
    @Nullable
    private Long requestDate;

    @ColumnInfo(name = "requestHeaders")
    @Nullable
    private String requestHeaders;

    @ColumnInfo(name = "requestHeadersSize")
    @Nullable
    private Long requestHeadersSize;

    @ColumnInfo(name = "requestPayloadSize")
    @Nullable
    private Long requestPayloadSize;

    @ColumnInfo(name = "responseBody")
    @Nullable
    private String responseBody;

    @ColumnInfo(name = "responseCipherSuite")
    @Nullable
    private String responseCipherSuite;

    @ColumnInfo(name = "responseCode")
    @Nullable
    private Integer responseCode;

    @ColumnInfo(name = "responseContentType")
    @Nullable
    private String responseContentType;

    @ColumnInfo(name = "responseDate")
    @Nullable
    private Long responseDate;

    @ColumnInfo(name = "responseHeaders")
    @Nullable
    private String responseHeaders;

    @ColumnInfo(name = "responseHeadersSize")
    @Nullable
    private Long responseHeadersSize;

    @ColumnInfo(name = "responseImageData")
    @Nullable
    private byte[] responseImageData;

    @ColumnInfo(name = "responseMessage")
    @Nullable
    private String responseMessage;

    @ColumnInfo(name = "responsePayloadSize")
    @Nullable
    private Long responsePayloadSize;

    @ColumnInfo(name = "responseTlsVersion")
    @Nullable
    private String responseTlsVersion;

    @ColumnInfo(name = "scheme")
    @Nullable
    private String scheme;

    @ColumnInfo(name = "tookMs")
    @Nullable
    private Long tookMs;

    @ColumnInfo(name = "url")
    @Nullable
    private String url;

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0086\u0081\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001j\u0002\b\u0002j\u0002\b\u0003j\u0002\b\u0004¨\u0006\u0005"}, d2 = {"Lcom/chuckerteam/chucker/internal/data/entity/HttpTransaction$a;", "", "Requested", "Complete", AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_FAILED, "com.github.ChuckerTeam.Chucker.library"}, k = 1, mv = {2, 0, 0}, xi = 48)
    public static final class a {
        private static final EnumEntries $ENTRIES;
        private static final a[] $VALUES;
        public static final a Complete;
        public static final a Failed;
        public static final a Requested;

        static {
            a aVar = new a("Requested", 0);
            Requested = aVar;
            a aVar2 = new a("Complete", 1);
            Complete = aVar2;
            a aVar3 = new a(AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_FAILED, 2);
            Failed = aVar3;
            a[] aVarArr = {aVar, aVar2, aVar3};
            $VALUES = aVarArr;
            $ENTRIES = fq.a.a(aVarArr);
        }

        @NotNull
        public static EnumEntries<a> getEntries() {
            return $ENTRIES;
        }

        public static a valueOf(String str) {
            return (a) Enum.valueOf(a.class, str);
        }

        public static a[] values() {
            return (a[]) $VALUES.clone();
        }
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
    public class b {
        public static final int[] $EnumSwitchMapping$0;

        static {
            int[] iArr = new int[a.values().length];
            try {
                iArr[a.Failed.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[a.Requested.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            $EnumSwitchMapping$0 = iArr;
        }
    }

    public HttpTransaction(long j, @Nullable Long l, @Nullable Long l2, @Nullable Long l3, @Nullable String str, @Nullable String str2, @Nullable String str3, @Nullable String str4, @Nullable String str5, @Nullable String str6, @Nullable String str7, @Nullable String str8, @Nullable Long l4, @Nullable String str9, @Nullable String str10, @Nullable Long l9, @Nullable String str11, boolean z, @Nullable Integer num, @Nullable String str12, @Nullable String str13, @Nullable Long l10, @Nullable String str14, @Nullable String str15, @Nullable Long l11, @Nullable String str16, boolean z2, @Nullable byte[] bArr, boolean z3, @Nullable String str17) {
        this.id = j;
        this.requestDate = l;
        this.responseDate = l2;
        this.tookMs = l3;
        this.protocol = str;
        this.method = str2;
        this.url = str3;
        this.host = str4;
        this.path = str5;
        this.scheme = str6;
        this.responseTlsVersion = str7;
        this.responseCipherSuite = str8;
        this.requestPayloadSize = l4;
        this.requestContentType = str9;
        this.requestHeaders = str10;
        this.requestHeadersSize = l9;
        this.requestBody = str11;
        this.isRequestBodyEncoded = z;
        this.responseCode = num;
        this.responseMessage = str12;
        this.error = str13;
        this.responsePayloadSize = l10;
        this.responseContentType = str14;
        this.responseHeaders = str15;
        this.responseHeadersSize = l11;
        this.responseBody = str16;
        this.isResponseBodyEncoded = z2;
        this.responseImageData = bArr;
        this.graphQlDetected = z3;
        this.graphQlOperationName = str17;
    }

    private final String formatBody(String body, String contentType) {
        if (contentType == null || q.D(contentType)) {
            return body;
        }
        if (q.m(contentType, "json", true)) {
            o.INSTANCE.getClass();
            r.k(body, "json");
            try {
                i b2 = n.b(body);
                t.INSTANCE.getClass();
                return GsonInstrumentation.toJson(t.a(), b2);
            } catch (m unused) {
                return body;
            }
        }
        if (!q.m(contentType, "xml", true)) {
            if (!q.m(contentType, "x-www-form-urlencoded", true)) {
                return body;
            }
            o.INSTANCE.getClass();
            r.k(body, "form");
            return q.D(body) ? body : kotlin.collections.t.N(q.W(body, new String[]{"&"}, 0, 6), ReactEditTextInputConnectionWrapper.NEWLINE_RAW_VALUE, (String) null, (String) null, new b8.b(25), 30);
        }
        o.INSTANCE.getClass();
        r.k(body, "xml");
        try {
            DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
            r.j(newInstance, "newInstance(...)");
            newInstance.setExpandEntityReferences(false);
            DocumentBuilder newDocumentBuilder = newInstance.newDocumentBuilder();
            r.j(newDocumentBuilder, "newDocumentBuilder(...)");
            Charset defaultCharset = Charset.defaultCharset();
            r.j(defaultCharset, "defaultCharset(...)");
            byte[] bytes = body.getBytes(defaultCharset);
            r.j(bytes, "getBytes(...)");
            Document parse = newDocumentBuilder.parse(new InputSource(new ByteArrayInputStream(bytes)));
            r.j(parse, "parse(...)");
            DOMSource dOMSource = new DOMSource(parse);
            StringWriter stringWriter = new StringWriter();
            StreamResult streamResult = new StreamResult(stringWriter);
            TransformerFactory newInstance2 = TransformerFactory.newInstance();
            newInstance2.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", true);
            Transformer newTransformer = newInstance2.newTransformer();
            newTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
            newTransformer.setOutputProperty("indent", "yes");
            newTransformer.transform(dOMSource, streamResult);
            return stringWriter.toString();
        } catch (UnsupportedEncodingException | IOException | IllegalArgumentException | TransformerException | SAXParseException unused2) {
            return body;
        }
    }

    private final String formatBytes(long bytes) {
        o.INSTANCE.getClass();
        return o.a(bytes);
    }

    private final CharSequence spanBody(CharSequence body, String contentType, Context context) {
        return (contentType == null || q.D(contentType)) ? body : (!q.m(contentType, "json", true) || context == null) ? formatBody(body.toString(), contentType) : new n0(context).a(body);
    }

    private final List<k5.a> toHttpHeaderList(Headers headers) {
        ArrayList arrayList = new ArrayList();
        int size = headers.size();
        for (int i = 0; i < size; i++) {
            arrayList.add(new k5.a(headers.name(i), headers.value(i)));
        }
        return arrayList;
    }

    @Nullable
    public final String getDurationString() {
        Long l = this.tookMs;
        if (l == null) {
            return null;
        }
        return l.longValue() + " ms";
    }

    @Nullable
    public final String getError() {
        return this.error;
    }

    @NotNull
    public final String getFormattedPath(boolean encode) {
        HttpUrl httpUrl;
        String str = this.url;
        if (str == null || (httpUrl = HttpUrl.Companion.get(str)) == null) {
            return "";
        }
        p.INSTANCE.getClass();
        return p.Companion.a(httpUrl, encode).b();
    }

    @NotNull
    public final String getFormattedRequestBody() {
        String formatBody;
        String str = this.requestBody;
        return (str == null || (formatBody = formatBody(str, this.requestContentType)) == null) ? "" : formatBody;
    }

    @NotNull
    public final String getFormattedResponseBody() {
        String formatBody;
        String str = this.responseBody;
        return (str == null || (formatBody = formatBody(str, this.responseContentType)) == null) ? "" : formatBody;
    }

    @NotNull
    public final String getFormattedUrl(boolean encode) {
        HttpUrl httpUrl;
        String str = this.url;
        if (str == null || (httpUrl = HttpUrl.Companion.get(str)) == null) {
            return "";
        }
        p.INSTANCE.getClass();
        return p.Companion.a(httpUrl, encode).d();
    }

    public final boolean getGraphQlDetected() {
        return this.graphQlDetected;
    }

    @Nullable
    public final String getGraphQlOperationName() {
        return this.graphQlOperationName;
    }

    public final long getHarResponseBodySize() {
        Long l;
        Integer num = this.responseCode;
        if ((num != null && num.intValue() == 304) || (l = this.responsePayloadSize) == null) {
            return 0L;
        }
        return l.longValue();
    }

    @Nullable
    public final String getHost() {
        return this.host;
    }

    public final long getId() {
        return this.id;
    }

    @Nullable
    public final String getMethod() {
        return this.method;
    }

    @NotNull
    public final String getNotificationText() {
        int i = b.$EnumSwitchMapping$0[getStatus().ordinal()];
        if (i == 1) {
            return a.m(" ! ! !  ", this.method, " ", this.path);
        }
        if (i == 2) {
            return a.m(" . . .  ", this.method, " ", this.path);
        }
        return this.responseCode + " " + this.method + " " + this.path;
    }

    @Nullable
    public final List<k5.a> getParsedRequestHeaders() {
        t.INSTANCE.getClass();
        return (List) GsonInstrumentation.fromJson(t.a(), this.requestHeaders, t9.a.getParameterized(List.class, new Type[]{k5.a.class}).getType());
    }

    @Nullable
    public final List<k5.a> getParsedResponseHeaders() {
        t.INSTANCE.getClass();
        return (List) GsonInstrumentation.fromJson(t.a(), this.responseHeaders, t9.a.getParameterized(List.class, new Type[]{k5.a.class}).getType());
    }

    @Nullable
    public final String getPath() {
        return this.path;
    }

    @Nullable
    public final String getProtocol() {
        return this.protocol;
    }

    @Nullable
    public final String getRequestBody() {
        return this.requestBody;
    }

    @Nullable
    public final String getRequestContentType() {
        return this.requestContentType;
    }

    @Nullable
    public final Long getRequestDate() {
        return this.requestDate;
    }

    @Nullable
    public final String getRequestDateString() {
        Long l = this.requestDate;
        if (l != null) {
            return new Date(l.longValue()).toString();
        }
        return null;
    }

    @Nullable
    public final String getRequestHeaders() {
        return this.requestHeaders;
    }

    @Nullable
    public final Long getRequestHeadersSize() {
        return this.requestHeadersSize;
    }

    @NotNull
    public final String getRequestHeadersString(boolean withMarkup) {
        o oVar = o.INSTANCE;
        List<k5.a> parsedRequestHeaders = getParsedRequestHeaders();
        oVar.getClass();
        return o.b(parsedRequestHeaders, withMarkup);
    }

    @Nullable
    public final Long getRequestPayloadSize() {
        return this.requestPayloadSize;
    }

    @NotNull
    public final String getRequestSizeString() {
        Long l = this.requestPayloadSize;
        return formatBytes(l != null ? l.longValue() : 0L);
    }

    public final long getRequestTotalSize() {
        Long l = this.requestHeadersSize;
        long longValue = l != null ? l.longValue() : 0L;
        Long l2 = this.requestPayloadSize;
        return longValue + (l2 != null ? l2.longValue() : 0L);
    }

    @Nullable
    public final String getResponseBody() {
        return this.responseBody;
    }

    @Nullable
    public final String getResponseCipherSuite() {
        return this.responseCipherSuite;
    }

    @Nullable
    public final Integer getResponseCode() {
        return this.responseCode;
    }

    @Nullable
    public final String getResponseContentType() {
        return this.responseContentType;
    }

    @Nullable
    public final Long getResponseDate() {
        return this.responseDate;
    }

    @Nullable
    public final String getResponseDateString() {
        Long l = this.responseDate;
        if (l != null) {
            return new Date(l.longValue()).toString();
        }
        return null;
    }

    @Nullable
    public final String getResponseHeaders() {
        return this.responseHeaders;
    }

    @Nullable
    public final Long getResponseHeadersSize() {
        return this.responseHeadersSize;
    }

    @NotNull
    public final String getResponseHeadersString(boolean withMarkup) {
        o oVar = o.INSTANCE;
        List<k5.a> parsedResponseHeaders = getParsedResponseHeaders();
        oVar.getClass();
        return o.b(parsedResponseHeaders, withMarkup);
    }

    @Nullable
    public final Bitmap getResponseImageBitmap() {
        byte[] bArr = this.responseImageData;
        if (bArr != null) {
            return BitmapFactoryInstrumentation.decodeByteArray(bArr, 0, bArr.length);
        }
        return null;
    }

    @Nullable
    public final byte[] getResponseImageData() {
        return this.responseImageData;
    }

    @Nullable
    public final String getResponseMessage() {
        return this.responseMessage;
    }

    @Nullable
    public final Long getResponsePayloadSize() {
        return this.responsePayloadSize;
    }

    @Nullable
    public final String getResponseSizeString() {
        Long l = this.responsePayloadSize;
        if (l != null) {
            return formatBytes(l.longValue());
        }
        return null;
    }

    @Nullable
    public final String getResponseSummaryText() {
        int i = b.$EnumSwitchMapping$0[getStatus().ordinal()];
        if (i == 1) {
            return this.error;
        }
        if (i == 2) {
            return null;
        }
        return this.responseCode + " " + this.responseMessage;
    }

    @Nullable
    public final String getResponseTlsVersion() {
        return this.responseTlsVersion;
    }

    public final long getResponseTotalSize() {
        Long l = this.responseHeadersSize;
        return getHarResponseBodySize() + (l != null ? l.longValue() : 0L);
    }

    @Nullable
    public final String getScheme() {
        return this.scheme;
    }

    @NotNull
    public final CharSequence getSpannedRequestBody(@Nullable Context context) {
        CharSequence spanBody;
        String str = this.requestBody;
        if (str != null && (spanBody = spanBody(str, this.requestContentType, context)) != null) {
            return spanBody;
        }
        SpannableStringBuilder valueOf = SpannableStringBuilder.valueOf("");
        r.j(valueOf, "valueOf(...)");
        return valueOf;
    }

    @NotNull
    public final CharSequence getSpannedResponseBody(@Nullable Context context) {
        CharSequence spanBody;
        String str = this.responseBody;
        if (str != null && (spanBody = spanBody(str, this.responseContentType, context)) != null) {
            return spanBody;
        }
        SpannableStringBuilder valueOf = SpannableStringBuilder.valueOf("");
        r.j(valueOf, "valueOf(...)");
        return valueOf;
    }

    @NotNull
    public final a getStatus() {
        return this.error != null ? a.Failed : this.responseCode == null ? a.Requested : a.Complete;
    }

    @Nullable
    public final Long getTookMs() {
        return this.tookMs;
    }

    @NotNull
    public final String getTotalSizeString() {
        Long l = this.requestPayloadSize;
        long longValue = l != null ? l.longValue() : 0L;
        Long l2 = this.responsePayloadSize;
        return formatBytes(longValue + (l2 != null ? l2.longValue() : 0L));
    }

    @Nullable
    public final String getUrl() {
        return this.url;
    }

    public final boolean hasTheSameContent(@org.jetbrains.annotations.Nullable com.chuckerteam.chucker.internal.data.entity.HttpTransaction r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.chuckerteam.chucker.internal.data.entity.HttpTransaction.hasTheSameContent(com.chuckerteam.chucker.internal.data.entity.HttpTransaction):boolean");
    }

    public final boolean getIsRequestBodyEncoded() {
        return this.isRequestBodyEncoded;
    }

    public final boolean getIsResponseBodyEncoded() {
        return this.isResponseBodyEncoded;
    }

    public final boolean isSsl() {
        return q.v(this.scheme, "https", true);
    }

    @NotNull
    public final HttpTransaction populateUrl(@NotNull HttpUrl httpUrl) {
        r.k(httpUrl, "httpUrl");
        p.INSTANCE.getClass();
        p a2 = p.Companion.a(httpUrl, false);
        this.url = a2.d();
        this.host = a2.getHost();
        this.path = a2.b();
        this.scheme = a2.getScheme();
        return this;
    }

    public final void setError(@Nullable String str) {
        this.error = str;
    }

    public final void setGraphQlDetected(boolean z) {
        this.graphQlDetected = z;
    }

    public final void setGraphQlOperationName(@Nullable String str) {
        this.graphQlOperationName = str;
    }

    public final void setHost(@Nullable String str) {
        this.host = str;
    }

    public final void setId(long j) {
        this.id = j;
    }

    public final void setMethod(@Nullable String str) {
        this.method = str;
    }

    public final void setPath(@Nullable String str) {
        this.path = str;
    }

    public final void setProtocol(@Nullable String str) {
        this.protocol = str;
    }

    public final void setRequestBody(@Nullable String str) {
        this.requestBody = str;
    }

    public final void setRequestBodyEncoded(boolean z) {
        this.isRequestBodyEncoded = z;
    }

    public final void setRequestContentType(@Nullable String str) {
        this.requestContentType = str;
    }

    public final void setRequestDate(@Nullable Long l) {
        this.requestDate = l;
    }

    public final void setRequestHeaders(@Nullable String str) {
        this.requestHeaders = str;
    }

    public final void setRequestHeadersSize(@Nullable Long l) {
        this.requestHeadersSize = l;
    }

    public final void setRequestPayloadSize(@Nullable Long l) {
        this.requestPayloadSize = l;
    }

    public final void setResponseBody(@Nullable String str) {
        this.responseBody = str;
    }

    public final void setResponseBodyEncoded(boolean z) {
        this.isResponseBodyEncoded = z;
    }

    public final void setResponseCipherSuite(@Nullable String str) {
        this.responseCipherSuite = str;
    }

    public final void setResponseCode(@Nullable Integer num) {
        this.responseCode = num;
    }

    public final void setResponseContentType(@Nullable String str) {
        this.responseContentType = str;
    }

    public final void setResponseDate(@Nullable Long l) {
        this.responseDate = l;
    }

    public final void setResponseHeaders(@Nullable String str) {
        this.responseHeaders = str;
    }

    public final void setResponseHeadersSize(@Nullable Long l) {
        this.responseHeadersSize = l;
    }

    public final void setResponseImageData(@Nullable byte[] bArr) {
        this.responseImageData = bArr;
    }

    public final void setResponseMessage(@Nullable String str) {
        this.responseMessage = str;
    }

    public final void setResponsePayloadSize(@Nullable Long l) {
        this.responsePayloadSize = l;
    }

    public final void setResponseTlsVersion(@Nullable String str) {
        this.responseTlsVersion = str;
    }

    public final void setScheme(@Nullable String str) {
        this.scheme = str;
    }

    public final void setTookMs(@Nullable Long l) {
        this.tookMs = l;
    }

    public final void setUrl(@Nullable String str) {
        this.url = str;
    }

    public final void setGraphQlOperationName(@NotNull Headers headers) {
        Object obj;
        r.k(headers, "headers");
        Iterator<T> it = toHttpHeaderList(headers).iterator();
        while (true) {
            if (!it.hasNext()) {
                obj = null;
                break;
            }
            obj = it.next();
            String lowerCase = ((k5.a) obj).getName().toLowerCase(Locale.ROOT);
            r.j(lowerCase, "toLowerCase(...)");
            if (q.m(lowerCase, "operation-name", false)) {
                break;
            }
        }
        k5.a aVar = (k5.a) obj;
        this.graphQlOperationName = aVar != null ? aVar.getValue() : null;
    }

    public final void setRequestHeaders(@NotNull Headers headers) {
        r.k(headers, "headers");
        setRequestHeaders(toHttpHeaderList(headers));
    }

    public final void setResponseHeaders(@NotNull Headers headers) {
        r.k(headers, "headers");
        setResponseHeaders(toHttpHeaderList(headers));
    }

    public final void setRequestHeaders(@NotNull List<k5.a> headers) {
        r.k(headers, "headers");
        t.INSTANCE.getClass();
        this.requestHeaders = GsonInstrumentation.toJson(t.a(), headers);
    }

    public final void setResponseHeaders(@NotNull List<k5.a> headers) {
        r.k(headers, "headers");
        t.INSTANCE.getClass();
        this.responseHeaders = GsonInstrumentation.toJson(t.a(), headers);
    }

    public HttpTransaction(long j, Long l, Long l2, Long l3, String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, Long l4, String str9, String str10, Long l9, String str11, boolean z, Integer num, String str12, String str13, Long l10, String str14, String str15, Long l11, String str16, boolean z2, byte[] bArr, boolean z3, String str17, int i, DefaultConstructorMarker defaultConstructorMarker) {
        this((i & 1) != 0 ? 0L : j, l, l2, l3, str, str2, str3, str4, str5, str6, str7, str8, l4, str9, str10, l9, str11, (i & 131072) != 0 ? false : z, num, str12, str13, l10, str14, str15, l11, str16, (i & 67108864) != 0 ? false : z2, bArr, (i & 268435456) != 0 ? false : z3, str17);
    }

    @Ignore
    public HttpTransaction() {
        this(0L, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, null, null, null, false, null, false, null, 335675393, null);
    }
}