X-plore v4.37.09版本的 MD5 值为:1ac588cd7c13e9578c2d4266387e2f4f

以下内容为反编译后的 g1.java 源代码,内容仅作参考


package l3;

import android.app.Activity;
import android.app.Application;
import android.os.Handler;
import android.util.JsonReader;
import android.util.JsonWriter;
import android.util.Log;
import android.webkit.WebSettings;
import g4.C6527a;
import g4.c;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.concurrent.Executor;

public final class g1 {

    private final Application f51248a;

    private final C6944c f51249b;

    private final Handler f51250c;

    private final Executor f51251d;

    private final C6972q f51252e;

    private final I f51253f;

    private final V0 f51254g;

    private final j1 f51255h;

    private final Q0 f51256i;

    public g1(Application application, C6944c c6944c, Handler handler, Executor executor, C6972q c6972q, I i9, V0 v02, j1 j1Var, Q0 q02) {
        this.f51248a = application;
        this.f51249b = c6944c;
        this.f51250c = handler;
        this.f51251d = executor;
        this.f51252e = c6972q;
        this.f51253f = i9;
        this.f51254g = v02;
        this.f51255h = j1Var;
        this.f51256i = q02;
    }

    private final C6955h0 d(C6951f0 c6951f0) {
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) new URL("https://fundingchoicesmessages.google.com/a/consent").openConnection();
            httpURLConnection.setRequestProperty("User-Agent", WebSettings.getDefaultUserAgent(this.f51248a));
            httpURLConnection.setConnectTimeout(10000);
            httpURLConnection.setReadTimeout(30000);
            httpURLConnection.setDoOutput(true);
            httpURLConnection.setRequestMethod("POST");
            httpURLConnection.setRequestProperty("Content-Type", "application/json");
            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(httpURLConnection.getOutputStream(), "UTF-8");
            try {
                JsonWriter jsonWriter = new JsonWriter(outputStreamWriter);
                try {
                    jsonWriter.beginObject();
                    String str = c6951f0.f51236a;
                    if (str != null) {
                        jsonWriter.name("admob_app_id");
                        jsonWriter.value(str);
                    }
                    C6943b0 c6943b0 = c6951f0.f51237b;
                    if (c6943b0 != null) {
                        jsonWriter.name("device_info");
                        jsonWriter.beginObject();
                        int i9 = c6943b0.f51212c;
                        if (i9 != 1) {
                            jsonWriter.name("os_type");
                            int i10 = i9 - 1;
                            if (i10 == 0) {
                                jsonWriter.value("UNKNOWN");
                            } else if (i10 == 1) {
                                jsonWriter.value("ANDROID");
                            }
                        }
                        String str2 = c6943b0.f51210a;
                        if (str2 != null) {
                            jsonWriter.name("model");
                            jsonWriter.value(str2);
                        }
                        Integer num = c6943b0.f51211b;
                        if (num != null) {
                            jsonWriter.name("android_api_level");
                            jsonWriter.value(num);
                        }
                        jsonWriter.endObject();
                    }
                    String str3 = c6951f0.f51238c;
                    if (str3 != null) {
                        jsonWriter.name("language_code");
                        jsonWriter.value(str3);
                    }
                    Boolean bool = c6951f0.f51239d;
                    if (bool != null) {
                        jsonWriter.name("tag_for_under_age_of_consent");
                        jsonWriter.value(bool.booleanValue());
                    }
                    Map map = c6951f0.f51240e;
                    if (!map.isEmpty()) {
                        jsonWriter.name("stored_infos_map");
                        jsonWriter.beginObject();
                        for (Map.Entry entry : map.entrySet()) {
                            jsonWriter.name((String) entry.getKey());
                            jsonWriter.value((String) entry.getValue());
                        }
                        jsonWriter.endObject();
                    }
                    C6947d0 c6947d0 = c6951f0.f51241f;
                    if (c6947d0 != null) {
                        jsonWriter.name("screen_info");
                        jsonWriter.beginObject();
                        Integer num2 = c6947d0.f51226a;
                        if (num2 != null) {
                            jsonWriter.name("width");
                            jsonWriter.value(num2);
                        }
                        Integer num3 = c6947d0.f51227b;
                        if (num3 != null) {
                            jsonWriter.name("height");
                            jsonWriter.value(num3);
                        }
                        Double d9 = c6947d0.f51228c;
                        if (d9 != null) {
                            jsonWriter.name("density");
                            jsonWriter.value(d9);
                        }
                        List<C6945c0> list = c6947d0.f51229d;
                        if (!list.isEmpty()) {
                            jsonWriter.name("screen_insets");
                            jsonWriter.beginArray();
                            for (C6945c0 c6945c0 : list) {
                                jsonWriter.beginObject();
                                Integer num4 = c6945c0.f51216a;
                                if (num4 != null) {
                                    jsonWriter.name("top");
                                    jsonWriter.value(num4);
                                }
                                Integer num5 = c6945c0.f51217b;
                                if (num5 != null) {
                                    jsonWriter.name("left");
                                    jsonWriter.value(num5);
                                }
                                Integer num6 = c6945c0.f51218c;
                                if (num6 != null) {
                                    jsonWriter.name("right");
                                    jsonWriter.value(num6);
                                }
                                Integer num7 = c6945c0.f51219d;
                                if (num7 != null) {
                                    jsonWriter.name("bottom");
                                    jsonWriter.value(num7);
                                }
                                jsonWriter.endObject();
                            }
                            jsonWriter.endArray();
                        }
                        jsonWriter.endObject();
                    }
                    Z z8 = c6951f0.f51242g;
                    if (z8 != null) {
                        jsonWriter.name("app_info");
                        jsonWriter.beginObject();
                        String str4 = z8.f51191a;
                        if (str4 != null) {
                            jsonWriter.name("package_name");
                            jsonWriter.value(str4);
                        }
                        String str5 = z8.f51192b;
                        if (str5 != null) {
                            jsonWriter.name("publisher_display_name");
                            jsonWriter.value(str5);
                        }
                        String str6 = z8.f51193c;
                        if (str6 != null) {
                            jsonWriter.name("version");
                            jsonWriter.value(str6);
                        }
                        jsonWriter.endObject();
                    }
                    C6949e0 c6949e0 = c6951f0.f51243h;
                    if (c6949e0 != null) {
                        jsonWriter.name("sdk_info");
                        jsonWriter.beginObject();
                        String str7 = c6949e0.f51232a;
                        if (str7 != null) {
                            jsonWriter.name("version");
                            jsonWriter.value(str7);
                        }
                        jsonWriter.endObject();
                    }
                    List list2 = c6951f0.f51244i;
                    if (!list2.isEmpty()) {
                        jsonWriter.name("debug_params");
                        jsonWriter.beginArray();
                        Iterator it = list2.iterator();
                        while (it.hasNext()) {
                            int ordinal = ((EnumC6941a0) it.next()).ordinal();
                            if (ordinal == 0) {
                                jsonWriter.value("DEBUG_PARAM_UNKNOWN");
                            } else if (ordinal == 1) {
                                jsonWriter.value("ALWAYS_SHOW");
                            } else if (ordinal == 2) {
                                jsonWriter.value("GEO_OVERRIDE_EEA");
                            } else if (ordinal == 3) {
                                jsonWriter.value("GEO_OVERRIDE_NON_EEA");
                            } else if (ordinal == 4) {
                                jsonWriter.value("PREVIEWING_DEBUG_MESSAGES");
                            }
                        }
                        jsonWriter.endArray();
                    }
                    jsonWriter.endObject();
                    jsonWriter.close();
                    outputStreamWriter.close();
                    int responseCode = httpURLConnection.getResponseCode();
                    if (responseCode != 200) {
                        throw new IOException("Http error code - " + responseCode + ".\n" + new Scanner(httpURLConnection.getErrorStream()).useDelimiter("\\A").next());
                    }
                    String headerField = httpURLConnection.getHeaderField("x-ump-using-header");
                    if (headerField != null) {
                        C6955h0 a9 = C6955h0.a(new JsonReader(new StringReader(headerField)));
                        a9.f51269a = new Scanner(httpURLConnection.getInputStream()).useDelimiter("\\A").next();
                        return a9;
                    }
                    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
                    try {
                        bufferedReader.readLine();
                        JsonReader jsonReader = new JsonReader(bufferedReader);
                        try {
                            C6955h0 a10 = C6955h0.a(jsonReader);
                            jsonReader.close();
                            bufferedReader.close();
                            return a10;
                        } finally {
                        }
                    } catch (Throwable th) {
                        try {
                            bufferedReader.close();
                        } catch (Throwable th2) {
                            th.addSuppressed(th2);
                        }
                        throw th;
                    }
                } finally {
                }
            } catch (Throwable th3) {
                try {
                    outputStreamWriter.close();
                } catch (Throwable th4) {
                    th3.addSuppressed(th4);
                }
                throw th3;
            }
        } catch (SocketTimeoutException e9) {
            throw new S0(4, "The server timed out.", e9);
        } catch (IOException e10) {
            throw new S0(2, "Error making request.", e10);
        }
    }

    public final void a(final c.b bVar, l1 l1Var) {
        Objects.requireNonNull(bVar);
        this.f51250c.post(new Runnable() {
            @Override
            public final void run() {
                c.b.this.a();
            }
        });
        if (l1Var.f51301b != c.EnumC0747c.NOT_REQUIRED) {
            this.f51253f.c();
        }
    }

    public final void b(Activity activity, g4.d dVar, final c.b bVar, final c.a aVar) {
        try {
            C6527a a9 = dVar.a();
            if (a9 != null) {
                if (!a9.b()) {
                }
                final l1 a10 = new i1(this.f51255h, d(this.f51254g.c(activity, dVar))).a();
                this.f51252e.e(a10.f51300a);
                this.f51252e.f(a10.f51301b);
                this.f51253f.d(a10.f51302c);
                this.f51256i.a().execute(new Runnable() {
                    @Override
                    public final void run() {
                        g1.this.a(bVar, a10);
                    }
                });
            }
            Log.i("UserMessagingPlatform", "Use new ConsentDebugSettings.Builder().addTestDeviceHashedId(\"" + AbstractC6957i0.a(this.f51248a) + "\") to set this as a debug device.");
            final l1 a102 = new i1(this.f51255h, d(this.f51254g.c(activity, dVar))).a();
            this.f51252e.e(a102.f51300a);
            this.f51252e.f(a102.f51301b);
            this.f51253f.d(a102.f51302c);
            this.f51256i.a().execute(new Runnable() {
                @Override
                public final void run() {
                    g1.this.a(bVar, a102);
                }
            });
        } catch (RuntimeException e9) {
            final S0 s02 = new S0(1, "Caught exception when trying to request consent info update: ".concat(String.valueOf(Log.getStackTraceString(e9))));
            this.f51250c.post(new Runnable() {
                @Override
                public final void run() {
                    c.a.this.a(s02.a());
                }
            });
        } catch (S0 e10) {
            this.f51250c.post(new Runnable() {
                @Override
                public final void run() {
                    c.a.this.a(e10.a());
                }
            });
        }
    }

    public final void c(final Activity activity, final g4.d dVar, final c.b bVar, final c.a aVar) {
        this.f51251d.execute(new Runnable() {
            @Override
            public final void run() {
                g1.this.b(activity, dVar, bVar, aVar);
            }
        });
    }
}