Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f

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


package py;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.tasks.SuccessContinuation;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.TaskCompletionSource;
import com.google.android.gms.tasks.Tasks;
import iy.n0;
import iy.r;
import iy.s;
import iy.t;
import iy.w;
import java.util.Locale;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicReference;
import org.json.JSONException;
import org.json.JSONObject;

public class f implements i {

    public final Context f94807a;

    public final j f94808b;

    public final g f94809c;

    public final r f94810d;

    public final py.a f94811e;

    public final k f94812f;

    public final s f94813g;

    public final AtomicReference<d> f94814h;

    public final AtomicReference<TaskCompletionSource<d>> f94815i;

    public class a implements SuccessContinuation<Void, Void> {
        public a() {
        }

        @Override
        @NonNull
        public Task<Void> then(@Nullable Void r52) throws Exception {
            JSONObject a11 = f.this.f94812f.a(f.this.f94808b, true);
            if (a11 != null) {
                d b11 = f.this.f94809c.b(a11);
                f.this.f94811e.c(b11.f94792c, a11);
                f.this.q(a11, "Loaded settings: ");
                f fVar = f.this;
                fVar.r(fVar.f94808b.f94823f);
                f.this.f94814h.set(b11);
                ((TaskCompletionSource) f.this.f94815i.get()).trySetResult(b11);
            }
            return Tasks.forResult(null);
        }
    }

    public f(Context context, j jVar, r rVar, g gVar, py.a aVar, k kVar, s sVar) {
        AtomicReference<d> atomicReference = new AtomicReference<>();
        this.f94814h = atomicReference;
        this.f94815i = new AtomicReference<>(new TaskCompletionSource());
        this.f94807a = context;
        this.f94808b = jVar;
        this.f94810d = rVar;
        this.f94809c = gVar;
        this.f94811e = aVar;
        this.f94812f = kVar;
        this.f94813g = sVar;
        atomicReference.set(b.b(rVar));
    }

    public static f l(Context context, String str, w wVar, my.b bVar, String str2, String str3, ny.f fVar, s sVar) {
        String g11 = wVar.g();
        n0 n0Var = new n0();
        return new f(context, new j(str, wVar.h(), wVar.i(), wVar.j(), wVar, iy.h.h(iy.h.o(context), str, str3, str2), str3, str2, t.a(g11).b()), n0Var, new g(n0Var), new py.a(fVar), new c(String.format(Locale.US, "https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/%s/settings", str), bVar), sVar);
    }

    @Override
    public d a() {
        return this.f94814h.get();
    }

    @Override
    public Task<d> b() {
        return this.f94815i.get().getTask();
    }

    public boolean k() {
        return !n().equals(this.f94808b.f94823f);
    }

    public final d m(e eVar) {
        d dVar = null;
        try {
            if (!e.SKIP_CACHE_LOOKUP.equals(eVar)) {
                JSONObject b11 = this.f94811e.b();
                if (b11 != null) {
                    d b12 = this.f94809c.b(b11);
                    if (b12 != null) {
                        q(b11, "Loaded cached settings: ");
                        long a11 = this.f94810d.a();
                        if (!e.IGNORE_CACHE_EXPIRATION.equals(eVar) && b12.a(a11)) {
                            fy.f.f().i("Cached settings have expired.");
                        }
                        try {
                            fy.f.f().i("Returning cached settings.");
                            dVar = b12;
                        } catch (Exception e11) {
                            e = e11;
                            dVar = b12;
                            fy.f.f().e("Failed to get cached settings", e);
                            return dVar;
                        }
                    } else {
                        fy.f.f().e("Failed to parse cached settings data.", null);
                    }
                } else {
                    fy.f.f().b("No cached settings data found.");
                }
            }
        } catch (Exception e12) {
            e = e12;
        }
        return dVar;
    }

    public final String n() {
        return iy.h.s(this.f94807a).getString("existing_instance_identifier", "");
    }

    public Task<Void> o(Executor executor) {
        return p(e.USE_CACHE, executor);
    }

    public Task<Void> p(e eVar, Executor executor) {
        d m11;
        if (!k() && (m11 = m(eVar)) != null) {
            this.f94814h.set(m11);
            this.f94815i.get().trySetResult(m11);
            return Tasks.forResult(null);
        }
        d m12 = m(e.IGNORE_CACHE_EXPIRATION);
        if (m12 != null) {
            this.f94814h.set(m12);
            this.f94815i.get().trySetResult(m12);
        }
        return this.f94813g.h(executor).onSuccessTask(executor, new a());
    }

    public final void q(JSONObject jSONObject, String str) throws JSONException {
        fy.f.f().b(str + jSONObject.toString());
    }

    @SuppressLint({"CommitPrefEdits"})
    public final boolean r(String str) {
        SharedPreferences.Editor edit = iy.h.s(this.f94807a).edit();
        edit.putString("existing_instance_identifier", str);
        edit.apply();
        return true;
    }
}