package p138.p176.p177.p242.p265.p266;

import android.content.SharedPreferences;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: ދ.ހ.֏.ހ.ބ.֏.ʶ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class RunnableC4798 implements Runnable {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final /* synthetic */ int f14462;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final /* synthetic */ String f14463;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final /* synthetic */ Object f14464;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final /* synthetic */ Object f14465;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final /* synthetic */ Object f14466;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final /* synthetic */ C4794 f14467;

    public RunnableC4798(C4794 c4794, int i, String str, Object obj, Object obj2, Object obj3) {
        this.f14467 = c4794;
        this.f14462 = i;
        this.f14463 = str;
        this.f14464 = obj;
        this.f14465 = obj2;
        this.f14466 = obj3;
    }

    @Override // java.lang.Runnable
    public final void run() {
        C4874 c4874M8501 = this.f14467.f14588.m8501();
        if (!c4874M8501.m8485()) {
            this.f14467.m8042(6, "Persisted config not initialized. Not logging error/warn");
            return;
        }
        C4794 c4794 = this.f14467;
        if (c4794.f14441 == 0) {
            if (c4794.f14588.f15015.m8187()) {
                C4794 c47942 = this.f14467;
                C4785 c4785 = c47942.f14588.f15014;
                c47942.f14441 = 'C';
            } else {
                C4794 c47943 = this.f14467;
                C4785 c47852 = c47943.f14588.f15014;
                c47943.f14441 = 'c';
            }
        }
        C4794 c47944 = this.f14467;
        if (c47944.f14442 < 0) {
            c47944.f14588.f15015.m8186();
            c47944.f14442 = 28000L;
        }
        char cCharAt = "01VDIWEA?".charAt(this.f14462);
        C4794 c47945 = this.f14467;
        char c = c47945.f14441;
        long j = c47945.f14442;
        String strM8040 = C4794.m8040(true, this.f14463, this.f14464, this.f14465, this.f14466);
        StringBuilder sb = new StringBuilder(C2803.m4895(strM8040, 24));
        sb.append("2");
        sb.append(cCharAt);
        sb.append(c);
        sb.append(j);
        sb.append(":");
        sb.append(strM8040);
        String string = sb.toString();
        if (string.length() > 1024) {
            string = this.f14463.substring(0, 1024);
        }
        C4871 c4871 = c4874M8501.f14647;
        c4871.f14641.mo8008();
        if (c4871.f14641.m8199().getLong(c4871.f14637, 0L) == 0) {
            c4871.m8193();
        }
        if (string == null) {
            string = "";
        }
        long j2 = c4871.f14641.m8199().getLong(c4871.f14638, 0L);
        if (j2 <= 0) {
            SharedPreferences.Editor editorEdit = c4871.f14641.m8199().edit();
            editorEdit.putString(c4871.f14639, string);
            editorEdit.putLong(c4871.f14638, 1L);
            editorEdit.apply();
            return;
        }
        long j3 = j2 + 1;
        boolean z = (c4871.f14641.m8167().m8273().nextLong() & Long.MAX_VALUE) < Long.MAX_VALUE / j3;
        SharedPreferences.Editor editorEdit2 = c4871.f14641.m8199().edit();
        if (z) {
            editorEdit2.putString(c4871.f14639, string);
        }
        editorEdit2.putLong(c4871.f14638, j3);
        editorEdit2.apply();
    }
}
