导航菜单

页面标题

页面副标题

Kaspi.kz v5.85.1 - ProtoBufTypeOrBuilder.java 源代码

正在查看: Kaspi.kz v5.85.1 应用的 ProtoBufTypeOrBuilder.java JAVA 源代码文件

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


package o;

import android.content.Context;
import android.content.pm.PackageManager;
import android.net.TrafficStats;
import android.text.TextUtils;
import android.util.JsonReader;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.firebase.installations.FirebaseInstallationsException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
import java.util.zip.GZIPOutputStream;
import o.access7902;
import o.access8102;
import org.json.JSONException;
import org.json.JSONObject;

public class ProtoBufTypeOrBuilder {
    private static final String AudioAttributesCompatParcelizer = "Firebase-Installations";
    private static final String AudioAttributesImplApi21Parcelizer = "v1";
    private static final String AudioAttributesImplApi26Parcelizer = "FIS_v2";
    private static final String AudioAttributesImplBaseParcelizer = "firebaseinstallations.googleapis.com";
    private static final String IconCompatParcelizer = "Content-Type";
    private static final String MediaBrowserCompatCustomActionResultReceiver = "fire-installations-id";
    private static final String MediaBrowserCompatItemReceiver = "projects/%s/installations/%s/authTokens:generate";
    private static final String MediaBrowserCompatMediaItem = "gzip";
    private static final String MediaBrowserCompatSearchResultReceiver = "application/json";
    private static final int MediaControllerCompatMediaControllerImplApi21ExtraBinderRequestResultReceiver = 32768;
    private static final int MediaDescriptionCompat = 1;
    private static final String MediaMetadataCompat = "x-firebase-client";
    private static final int MediaSessionCompatQueueItem = 32770;
    private static final String MediaSessionCompatResultReceiverWrapper = "a:";
    private static final int MediaSessionCompatToken = 10000;
    private static final int ParcelableVolumeInfo = 32771;
    private static final String PlaybackStateCompat = "X-Android-Package";
    private static final String PlaybackStateCompatCustomAction = "x-goog-fis-android-iid-migration-auth";
    private static final int RatingCompat = 32769;
    private static final String RemoteActionCompatParcelizer = "projects/%s/installations/%s";
    private static final String read = "Content-Encoding";
    private static final String setBackground = "Accept";
    private static final String setContentView = "X-Android-Cert";
    private static final String setElement = "projects/%s/installations";
    private static final String setError = "no-cache";
    static final String setFieldValue = "Invalid Expiration Timestamp.";
    private static final String setLabel = "Cache-Control";
    private static final String setOptions = "x-goog-api-key";
    private final Context ComponentActivity3;
    private final access7802 ComponentActivity4 = new access7802();
    private boolean ComponentActivity6;
    private final access19602<setNullable> r8lambdaqrzmfDOyDuplJFtpJLozn3P9EZI;
    private static final Pattern write = Pattern.compile("[0-9]+s");
    private static final Charset ComponentActivity2 = Charset.forName("UTF-8");

    private static boolean setOptions(int i) {
        return i >= 200 && i < 300;
    }

    public ProtoBufTypeOrBuilder(@NonNull Context context, @NonNull access19602<setNullable> access19602Var) {
        this.ComponentActivity3 = context;
        this.r8lambdaqrzmfDOyDuplJFtpJLozn3P9EZI = access19602Var;
    }

    public access7902 setBackground(@NonNull String str, @androidx.annotation.Nullable String str2, @NonNull String str3, @NonNull String str4, @androidx.annotation.Nullable String str5) throws FirebaseInstallationsException {
        int responseCode;
        access7902 fieldValue;
        if (!this.ComponentActivity4.setLabel()) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.", FirebaseInstallationsException.setLabel.UNAVAILABLE);
        }
        URL options = setOptions(String.format(setElement, str3));
        for (int i = 0; i <= 1; i++) {
            TrafficStats.setThreadStatsTag(RatingCompat);
            HttpURLConnection background = setBackground(options, str);
            try {
                try {
                    background.setRequestMethod(BuiltInsBinaryVersionCompanion$setFieldValue.write);
                    background.setDoOutput(true);
                    if (str5 != null) {
                        background.addRequestProperty(PlaybackStateCompatCustomAction, str5);
                    }
                    setError(background, str2, str4);
                    responseCode = background.getResponseCode();
                    this.ComponentActivity4.setOptions(responseCode);
                } catch (IOException | AssertionError unused) {
                }
                if (setOptions(responseCode)) {
                    fieldValue = setFieldValue(background);
                } else {
                    setFieldValue(background, str4, str, str3);
                    if (responseCode == 429) {
                        throw new FirebaseInstallationsException("Firebase servers have received too many requests from this client in a short period of time. Please try again later.", FirebaseInstallationsException.setLabel.TOO_MANY_REQUESTS);
                    }
                    if (responseCode < 500 || responseCode >= 600) {
                        setLabel();
                        fieldValue = access7902.write().setFieldValue(access7902.setOptions.BAD_CONFIG).setOptions();
                    } else {
                        background.disconnect();
                        TrafficStats.clearThreadStatsTag();
                    }
                }
                return fieldValue;
            } finally {
                background.disconnect();
                TrafficStats.clearThreadStatsTag();
            }
        }
        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.", FirebaseInstallationsException.setLabel.UNAVAILABLE);
    }

    private void setError(HttpURLConnection httpURLConnection, @androidx.annotation.Nullable String str, @NonNull String str2) throws IOException {
        setLabel(httpURLConnection, setFieldValue(setOptions(str, str2)));
    }

    private static byte[] setFieldValue(JSONObject jSONObject) throws IOException {
        return jSONObject.toString().getBytes("UTF-8");
    }

    private static void setLabel(URLConnection uRLConnection, byte[] bArr) throws IOException {
        OutputStream outputStream = uRLConnection.getOutputStream();
        if (outputStream == null) {
            throw new IOException("Cannot send request to FIS servers. No OutputStream available.");
        }
        GZIPOutputStream gZIPOutputStream = new GZIPOutputStream(outputStream);
        try {
            gZIPOutputStream.write(bArr);
        } finally {
            try {
                gZIPOutputStream.close();
                outputStream.close();
            } catch (IOException unused) {
            }
        }
    }

    private static JSONObject setOptions(@androidx.annotation.Nullable String str, @NonNull String str2) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("fid", str);
            jSONObject.put(readNameResolver$setBackground.setFieldValue, str2);
            jSONObject.put("authVersion", AudioAttributesImplApi26Parcelizer);
            jSONObject.put(readNameResolver$setBackground.AudioAttributesImplApi26Parcelizer, "a:18.0.0");
            return jSONObject;
        } catch (JSONException e) {
            throw new IllegalStateException(e);
        }
    }

    private void setLabel(HttpURLConnection httpURLConnection) throws IOException {
        setLabel(httpURLConnection, setFieldValue(setBackground()));
    }

    private static JSONObject setBackground() {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put(readNameResolver$setBackground.AudioAttributesImplApi26Parcelizer, "a:18.0.0");
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("installation", jSONObject);
            return jSONObject2;
        } catch (JSONException e) {
            throw new IllegalStateException(e);
        }
    }

    public void setBackground(@NonNull String str, @NonNull String str2, @NonNull String str3, @NonNull String str4) throws FirebaseInstallationsException {
        int responseCode;
        URL options = setOptions(String.format(RemoteActionCompatParcelizer, str3, str2));
        int i = 0;
        while (i <= 1) {
            TrafficStats.setThreadStatsTag(MediaSessionCompatQueueItem);
            HttpURLConnection background = setBackground(options, str);
            try {
                background.setRequestMethod(BuiltInsBinaryVersionCompanion$setFieldValue.setLabel);
                background.addRequestProperty("Authorization", "FIS_v2 " + str4);
                responseCode = background.getResponseCode();
            } catch (IOException unused) {
            } catch (Throwable th) {
                background.disconnect();
                TrafficStats.clearThreadStatsTag();
                throw th;
            }
            if (responseCode != 200 && responseCode != 401 && responseCode != 404) {
                setFieldValue(background, (String) null, str, str3);
                if (responseCode != 429 && (responseCode < 500 || responseCode >= 600)) {
                    setLabel();
                    throw new FirebaseInstallationsException("Bad config while trying to delete FID", FirebaseInstallationsException.setLabel.BAD_CONFIG);
                }
                i++;
                background.disconnect();
                TrafficStats.clearThreadStatsTag();
            }
            background.disconnect();
            TrafficStats.clearThreadStatsTag();
            return;
        }
        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.", FirebaseInstallationsException.setLabel.UNAVAILABLE);
    }

    private URL setOptions(String str) throws FirebaseInstallationsException {
        try {
            return new URL(String.format("https://%s/%s/%s", AudioAttributesImplBaseParcelizer, AudioAttributesImplApi21Parcelizer, str));
        } catch (MalformedURLException e) {
            throw new FirebaseInstallationsException(e.getMessage(), FirebaseInstallationsException.setLabel.UNAVAILABLE);
        }
    }

    public access8102 setFieldValue(@NonNull String str, @NonNull String str2, @NonNull String str3, @NonNull String str4) throws FirebaseInstallationsException {
        int responseCode;
        access8102 options;
        if (!this.ComponentActivity4.setLabel()) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.", FirebaseInstallationsException.setLabel.UNAVAILABLE);
        }
        URL options2 = setOptions(String.format(MediaBrowserCompatItemReceiver, str3, str2));
        for (int i = 0; i <= 1; i++) {
            TrafficStats.setThreadStatsTag(ParcelableVolumeInfo);
            HttpURLConnection background = setBackground(options2, str);
            try {
                background.setRequestMethod(BuiltInsBinaryVersionCompanion$setFieldValue.write);
                background.addRequestProperty("Authorization", "FIS_v2 " + str4);
                background.setDoOutput(true);
                setLabel(background);
                responseCode = background.getResponseCode();
                this.ComponentActivity4.setOptions(responseCode);
            } catch (IOException | AssertionError unused) {
            } catch (Throwable th) {
                background.disconnect();
                TrafficStats.clearThreadStatsTag();
                throw th;
            }
            if (setOptions(responseCode)) {
                options = setOptions(background);
            } else {
                setFieldValue(background, (String) null, str, str3);
                if (responseCode != 401 && responseCode != 404) {
                    if (responseCode == 429) {
                        throw new FirebaseInstallationsException("Firebase servers have received too many requests from this client in a short period of time. Please try again later.", FirebaseInstallationsException.setLabel.TOO_MANY_REQUESTS);
                    }
                    if (responseCode < 500 || responseCode >= 600) {
                        setLabel();
                        options = access8102.setError().setOptions(access8102.setFieldValue.BAD_CONFIG).setBackground();
                    } else {
                        background.disconnect();
                        TrafficStats.clearThreadStatsTag();
                    }
                }
                options = access8102.setError().setOptions(access8102.setFieldValue.AUTH_ERROR).setBackground();
            }
            background.disconnect();
            TrafficStats.clearThreadStatsTag();
            return options;
        }
        throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.", FirebaseInstallationsException.setLabel.UNAVAILABLE);
    }

    private static void setLabel() {
        Log.e(AudioAttributesCompatParcelizer, "Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase.");
    }

    private HttpURLConnection setBackground(URL url, String str) throws FirebaseInstallationsException {
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
            httpURLConnection.setConnectTimeout(MediaSessionCompatToken);
            httpURLConnection.setUseCaches(false);
            httpURLConnection.setReadTimeout(MediaSessionCompatToken);
            httpURLConnection.addRequestProperty("Content-Type", MediaBrowserCompatSearchResultReceiver);
            httpURLConnection.addRequestProperty(setBackground, MediaBrowserCompatSearchResultReceiver);
            httpURLConnection.addRequestProperty(read, MediaBrowserCompatMediaItem);
            httpURLConnection.addRequestProperty("Cache-Control", setError);
            httpURLConnection.addRequestProperty(PlaybackStateCompat, this.ComponentActivity3.getPackageName());
            setNullable setnullable = (setNullable) this.r8lambdaqrzmfDOyDuplJFtpJLozn3P9EZI.get();
            if (setnullable != null) {
                try {
                    httpURLConnection.addRequestProperty(MediaMetadataCompat, (String) getHIDDEN_CONSTRUCTOR_SIGNATURES.setFieldValue(setnullable.setBackground()));
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                    Log.w("ContentValues", "Failed to get heartbeats header", e);
                } catch (ExecutionException e2) {
                    Log.w("ContentValues", "Failed to get heartbeats header", e2);
                }
            }
            httpURLConnection.addRequestProperty(setContentView, setOptions());
            httpURLConnection.addRequestProperty(setOptions, str);
            return httpURLConnection;
        } catch (IOException unused) {
            throw new FirebaseInstallationsException("Firebase Installations Service is unavailable. Please try again later.", FirebaseInstallationsException.setLabel.UNAVAILABLE);
        }
    }

    private access7902 setFieldValue(HttpURLConnection httpURLConnection) throws AssertionError, IOException {
        InputStream inputStream = httpURLConnection.getInputStream();
        JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, ComponentActivity2));
        access8102.setOptions error = access8102.setError();
        access7902.setBackground write2 = access7902.write();
        jsonReader.beginObject();
        while (jsonReader.hasNext()) {
            String nextName = jsonReader.nextName();
            if (nextName.equals("name")) {
                write2.setLabel(jsonReader.nextString());
            } else if (nextName.equals("fid")) {
                write2.setFieldValue(jsonReader.nextString());
            } else if (nextName.equals("refreshToken")) {
                write2.setBackground(jsonReader.nextString());
            } else if (nextName.equals("authToken")) {
                jsonReader.beginObject();
                while (jsonReader.hasNext()) {
                    String nextName2 = jsonReader.nextName();
                    if (nextName2.equals("token")) {
                        error.setBackground(jsonReader.nextString());
                    } else if (nextName2.equals("expiresIn")) {
                        error.setOptions(setLabel(jsonReader.nextString()));
                    } else {
                        jsonReader.skipValue();
                    }
                }
                write2.setFieldValue(error.setBackground());
                jsonReader.endObject();
            } else {
                jsonReader.skipValue();
            }
        }
        jsonReader.endObject();
        jsonReader.close();
        inputStream.close();
        return write2.setFieldValue(access7902.setOptions.OK).setOptions();
    }

    private access8102 setOptions(HttpURLConnection httpURLConnection) throws AssertionError, IOException {
        InputStream inputStream = httpURLConnection.getInputStream();
        JsonReader jsonReader = new JsonReader(new InputStreamReader(inputStream, ComponentActivity2));
        access8102.setOptions error = access8102.setError();
        jsonReader.beginObject();
        while (jsonReader.hasNext()) {
            String nextName = jsonReader.nextName();
            if (nextName.equals("token")) {
                error.setBackground(jsonReader.nextString());
            } else if (nextName.equals("expiresIn")) {
                error.setOptions(setLabel(jsonReader.nextString()));
            } else {
                jsonReader.skipValue();
            }
        }
        jsonReader.endObject();
        jsonReader.close();
        inputStream.close();
        return error.setOptions(access8102.setFieldValue.OK).setBackground();
    }

    private String setOptions() {
        try {
            Context context = this.ComponentActivity3;
            byte[] options = accessorKCallableImpllambda2.setOptions(context, context.getPackageName());
            if (options == null) {
                Log.e("ContentValues", "Could not get fingerprint hash for package: " + this.ComponentActivity3.getPackageName());
                return null;
            }
            return getDefaultCaller.setFieldValue(options, false);
        } catch (PackageManager.NameNotFoundException e) {
            Log.e("ContentValues", "No such package: " + this.ComponentActivity3.getPackageName(), e);
            return null;
        }
    }

    static long setLabel(String str) {
        accessorKClasseslambda2.setLabel(write.matcher(str).matches(), setFieldValue);
        if (str == null || str.length() == 0) {
            return 0L;
        }
        return Long.parseLong(str.substring(0, str.length() - 1));
    }

    private static void setFieldValue(HttpURLConnection httpURLConnection, @androidx.annotation.Nullable String str, @NonNull String str2, @NonNull String str3) {
        String background = setBackground(httpURLConnection);
        if (TextUtils.isEmpty(background)) {
            return;
        }
        Log.w(AudioAttributesCompatParcelizer, background);
        Log.w(AudioAttributesCompatParcelizer, setLabel(str, str2, str3));
    }

    private static String setLabel(@androidx.annotation.Nullable String str, @NonNull String str2, @NonNull String str3) {
        String str4;
        if (TextUtils.isEmpty(str)) {
            str4 = "";
        } else {
            str4 = ", " + str;
        }
        return String.format("Firebase options used while communicating with Firebase server APIs: %s, %s%s", str2, str3, str4);
    }

    private static String setBackground(HttpURLConnection httpURLConnection) {
        InputStream errorStream = httpURLConnection.getErrorStream();
        if (errorStream == null) {
            return null;
        }
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(errorStream, ComponentActivity2));
        try {
            try {
                StringBuilder sb = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    }
                    sb.append(readLine);
                    sb.append('\n');
                }
                String format = String.format("Error when communicating with the Firebase Installations server API. HTTP response: [%d %s: %s]", Integer.valueOf(httpURLConnection.getResponseCode()), httpURLConnection.getResponseMessage(), sb);
                try {
                    bufferedReader.close();
                } catch (IOException unused) {
                }
                return format;
            } catch (IOException unused2) {
                return null;
            }
        } catch (IOException unused3) {
            bufferedReader.close();
            return null;
        } catch (Throwable th) {
            try {
                bufferedReader.close();
            } catch (IOException unused4) {
            }
            throw th;
        }
    }
}