Money Lover v8.14.0.6版本的 MD5 值为:48b9d922212c7ccfd438cdcc183ff396

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


package wj;

import android.text.TextUtils;
import com.zoostudio.moneylover.db.sync.item.g;
import com.zoostudio.moneylover.exception.MoneyError;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class f0 {

    public class a implements g.e {

        final b f37493a;

        final String f37494b;

        a(b bVar, String str) {
            this.f37493a = bVar;
            this.f37494b = str;
        }

        @Override
        public void onFail(MoneyError moneyError) {
            if (moneyError.a() != 404) {
                if (this.f37494b.isEmpty()) {
                    this.f37493a.a(moneyError);
                    return;
                } else {
                    f0.d("", this.f37493a);
                    return;
                }
            }
            this.f37493a.a(moneyError);
        }

        @Override
        public void onSuccess(JSONObject jSONObject) {
            boolean z10;
            try {
                ArrayList<n9.h> b10 = r.b(jSONObject.getJSONArray("data"));
                if (jSONObject.has("categories")) {
                    b10 = f0.c(b10, r.a(jSONObject.getJSONArray("categories")));
                }
                b bVar = this.f37493a;
                if (!TextUtils.isEmpty(this.f37494b)) {
                    z10 = true;
                } else {
                    z10 = false;
                }
                bVar.b(b10, z10);
            } catch (JSONException e10) {
                e10.printStackTrace();
                new MoneyError(e10).e(1);
                this.f37493a.a(new MoneyError(e10));
            }
        }
    }

    public interface b {
        void a(MoneyError moneyError);

        void b(ArrayList<n9.h> arrayList, boolean z10);
    }

    private static void b(ArrayList<Integer> arrayList, int[] iArr) {
        for (int i10 : iArr) {
            Iterator<Integer> it = arrayList.iterator();
            boolean z10 = false;
            while (it.hasNext()) {
                if (it.next().intValue() == i10) {
                    z10 = true;
                }
            }
            if (!z10) {
                arrayList.add(Integer.valueOf(i10));
            }
        }
    }

    public static ArrayList<n9.h> c(List<n9.h> list, List<v7.e> list2) {
        ArrayList<n9.h> arrayList = new ArrayList<>();
        if (list2 != null && list2.size() != 0) {
            ArrayList arrayList2 = new ArrayList();
            Iterator<v7.e> it = list2.iterator();
            while (it.hasNext()) {
                b(arrayList2, it.next().a());
            }
            Iterator it2 = arrayList2.iterator();
            while (it2.hasNext()) {
                int intValue = ((Integer) it2.next()).intValue();
                for (n9.h hVar : list) {
                    if (hVar.g().longValue() == intValue) {
                        arrayList.add(hVar);
                    }
                }
            }
        }
        return arrayList;
    }

    public static void d(String str, b bVar) {
        String str2;
        if (m7.a.f27647b) {
            str2 = "https://statictest.moneylover.me/data/rw-provider/provider_cache_dev";
        } else {
            str2 = "https://static.moneylover.me/data/rw-provider/provider_cache_production";
        }
        e(str2 + str + ".json", new a(bVar, str));
    }

    private static void e(String str, g.e eVar) {
        com.zoostudio.moneylover.db.sync.item.g.request(new com.zoostudio.moneylover.db.sync.item.h(2, str, null), eVar);
    }
}