package defpackage;

import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import java.io.IOException;
import java.util.Map;

/* renamed from: ʾᵔᵪ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class RunnableC0275 implements Runnable {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final Object f1860;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final Object f1861;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final int f1862;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final Object f1863;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final /* synthetic */ int f1864 = 1;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final Object f1865;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final String f1866;

    public /* synthetic */ RunnableC0275(String str, InterfaceC2326 interfaceC2326, int i, IOException iOException, byte[] bArr, Map map) {
        ᵩʛʽ.ᵝᵵᵺ(interfaceC2326);
        this.f1865 = interfaceC2326;
        this.f1862 = i;
        this.f1863 = iOException;
        this.f1861 = bArr;
        this.f1866 = str;
        this.f1860 = map;
    }

    public RunnableC0275(C1736 c1736, int i, String str, Object obj, Object obj2, Object obj3) {
        this.f1862 = i;
        this.f1866 = str;
        this.f1865 = obj;
        this.f1863 = obj2;
        this.f1861 = obj3;
        this.f1860 = c1736;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f1864) {
            case 0:
                C1736 c1736 = (C1736) this.f1860;
                C4180 c4180 = ((C4205) ((ᵢˇᵭ) c1736).ᵧᵾˀˈ).f15717;
                C4205.m9134(c4180);
                if (!c4180.f20501) {
                    c1736.m4947();
                    return;
                }
                if (c1736.f6943 == 0) {
                    C1904 c1904 = ((C4205) ((ᵢˇᵭ) c1736).ᵧᵾˀˈ).f15726;
                    if (c1904.f7683 == null) {
                        synchronized (c1904) {
                            try {
                                if (c1904.f7683 == null) {
                                    C4205 c4205 = (C4205) ((ᵢˇᵭ) c1904).ᵧᵾˀˈ;
                                    ApplicationInfo applicationInfo = c4205.f15719.getApplicationInfo();
                                    String strM7992 = AbstractC3502.m7992();
                                    if (applicationInfo != null) {
                                        String str = applicationInfo.processName;
                                        c1904.f7683 = Boolean.valueOf(str != null && str.equals(strM7992));
                                    }
                                    if (c1904.f7683 == null) {
                                        c1904.f7683 = Boolean.TRUE;
                                        C1736 c17362 = c4205.f15715;
                                        C4205.m9132(c17362);
                                        c17362.f6937.m6038("My process not in the list of running processes");
                                    }
                                }
                            } finally {
                            }
                        }
                    }
                    if (c1904.f7683.booleanValue()) {
                        c1736.f6943 = 'C';
                    } else {
                        c1736.f6943 = 'c';
                    }
                }
                if (c1736.f6942 < 0) {
                    ((C4205) ((ᵢˇᵭ) c1736).ᵧᵾˀˈ).f15726.m5359();
                    c1736.f6942 = 161000L;
                }
                int i = this.f1862;
                char c = c1736.f6943;
                long j = c1736.f6942;
                String str2 = this.f1866;
                Object obj = this.f1865;
                Object obj2 = this.f1863;
                Object obj3 = this.f1861;
                char cCharAt = "01VDIWEA?".charAt(i);
                String strM4939 = C1736.m4939(true, str2, obj, obj2, obj3);
                StringBuilder sb = new StringBuilder(AbstractC1327.m4095(String.valueOf(cCharAt).length() + 1, String.valueOf(c).length(), String.valueOf(j).length(), 1) + strM4939.length());
                sb.append("2");
                sb.append(cCharAt);
                sb.append(c);
                sb.append(j);
                sb.append(":");
                sb.append(strM4939);
                String string = sb.toString();
                if (string.length() > 1024) {
                    string = str2.substring(0, 1024);
                }
                C2823 c2823 = c4180.f15640;
                if (c2823 != null) {
                    String str3 = (String) c2823.f10875;
                    C4180 c41802 = (C4180) c2823.f10873;
                    c41802.ˀᵗᵝᵭ();
                    if (((C4180) c2823.f10873).m9104().getLong((String) c2823.f10878, 0L) == 0) {
                        c2823.m6920();
                    }
                    SharedPreferences sharedPreferencesM9104 = c41802.m9104();
                    String str4 = (String) c2823.f10877;
                    long j2 = sharedPreferencesM9104.getLong(str4, 0L);
                    if (j2 <= 0) {
                        SharedPreferences.Editor editorEdit = c41802.m9104().edit();
                        editorEdit.putString(str3, string);
                        editorEdit.putLong(str4, 1L);
                        editorEdit.apply();
                        return;
                    }
                    C4864 c4864 = ((C4205) ((ᵢˇᵭ) c41802).ᵧᵾˀˈ).f15708;
                    C4205.m9134(c4864);
                    long jNextLong = c4864.m10218().nextLong() & Long.MAX_VALUE;
                    long j3 = j2 + 1;
                    long j4 = Long.MAX_VALUE / j3;
                    SharedPreferences.Editor editorEdit2 = c41802.m9104().edit();
                    if (jNextLong < j4) {
                        editorEdit2.putString(str3, string);
                    }
                    editorEdit2.putLong(str4, j3);
                    editorEdit2.apply();
                    return;
                }
                return;
            default:
                ((InterfaceC2326) this.f1865).mo1806(this.f1866, this.f1862, (Throwable) this.f1863, (byte[]) this.f1861, (Map) this.f1860);
                return;
        }
    }
}
