Money Lover v8.14.0.6版本的 MD5 值为:48b9d922212c7ccfd438cdcc183ff396
以下内容为反编译后的 l.java 源代码,内容仅作参考
package wj;
import android.content.Context;
import com.bookmark.money.R;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.zoostudio.moneylover.MoneyApplication;
import com.zoostudio.moneylover.adapter.item.PaymentItem;
import com.zoostudio.moneylover.help.utils.HelpsConstant;
import java.io.IOException;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import wj.m;
public class l {
class a implements m.a {
final e f37506a;
a(e eVar) {
this.f37506a = eVar;
}
@Override
public void a(Exception exc) {
this.f37506a.a(exc);
}
@Override
public void onSuccess(String str) {
if (str == null) {
this.f37506a.a(new NullPointerException("ko lấy dc file gói bán budget plus từ server"));
return;
}
try {
this.f37506a.b(l.c(str));
} catch (JSONException e10) {
e10.printStackTrace();
}
}
}
class b implements m.a {
final e f37507a;
b(e eVar) {
this.f37507a = eVar;
}
@Override
public void a(Exception exc) {
this.f37507a.a(exc);
}
@Override
public void onSuccess(String str) {
if (str == null) {
this.f37507a.a(new NullPointerException("ko lấy dc file linked wallet từ server"));
return;
}
try {
this.f37507a.b(l.g(str));
} catch (JSONException e10) {
e10.printStackTrace();
}
}
}
public class c implements m.a {
final d f37508a;
c(d dVar) {
this.f37508a = dVar;
}
@Override
public void a(Exception exc) {
this.f37508a.a(exc);
}
@Override
public void onSuccess(String str) {
if (str == null) {
this.f37508a.a(new NullPointerException("ko lấy dc file icon từ server"));
return;
}
try {
com.zoostudio.moneylover.utils.p.s(".icon_pack", MoneyApplication.C(), str, true);
} catch (IOException e10) {
FirebaseCrashlytics.getInstance().recordException(e10);
}
this.f37508a.b(str);
}
}
public interface d {
void a(Exception exc);
void b(String str);
}
public interface e {
void a(Exception exc);
void b(ArrayList<PaymentItem> arrayList);
}
public static ArrayList<PaymentItem> c(String str) throws JSONException {
JSONArray jSONArray = new JSONObject(str).getJSONArray("data");
int length = jSONArray.length();
ArrayList<PaymentItem> arrayList = new ArrayList<>();
for (int i10 = 0; i10 < length; i10++) {
JSONObject jSONObject = jSONArray.getJSONObject(i10);
JSONObject jSONObject2 = jSONObject.getJSONObject(HelpsConstant.ITEM_CHAT.ITEM_CHAT_META_DATA);
if (jSONObject2.getString("type").equals("budget_plus")) {
PaymentItem h10 = h(jSONObject, PaymentItem.TYPE_SUBSCRIPTION);
if (jSONObject2.has(FirebaseAnalytics.Param.DISCOUNT)) {
h10.setDiscount(jSONObject2.getInt(FirebaseAnalytics.Param.DISCOUNT));
}
arrayList.add(h10);
}
}
return arrayList;
}
public static void d(e eVar) {
m mVar = new m();
mVar.d(new a(eVar));
mVar.execute("https://static.moneylover.me/data/budget_plus.json");
}
public static void e(Context context, d dVar) {
m mVar = new m();
mVar.d(new c(dVar));
mVar.execute(context.getString(R.string.link_list_package_icon));
}
public static void f(e eVar) {
m mVar = new m();
mVar.d(new b(eVar));
mVar.execute("https://static.moneylover.me/data/subscription_product_android.json");
}
public static ArrayList<PaymentItem> g(String str) throws JSONException {
JSONArray jSONArray = new JSONObject(str).getJSONArray("data");
int length = jSONArray.length();
ArrayList<PaymentItem> arrayList = new ArrayList<>();
for (int i10 = 0; i10 < length; i10++) {
JSONObject jSONObject = jSONArray.getJSONObject(i10);
JSONObject jSONObject2 = jSONObject.getJSONObject(HelpsConstant.ITEM_CHAT.ITEM_CHAT_META_DATA);
if (jSONObject2.getString("type").equals("linked_wallet")) {
PaymentItem h10 = h(jSONObject, PaymentItem.TYPE_SUBSCRIPTION);
if (jSONObject2.has(FirebaseAnalytics.Param.DISCOUNT)) {
h10.setDiscount(jSONObject2.getInt(FirebaseAnalytics.Param.DISCOUNT));
}
arrayList.add(h10);
}
}
return arrayList;
}
private static PaymentItem h(JSONObject jSONObject, String str) throws JSONException {
PaymentItem paymentItem = new PaymentItem(str, jSONObject.getString("product_id"));
paymentItem.setName(jSONObject.getString("name"));
paymentItem.setPrice(jSONObject.getString("price_gl"));
if (jSONObject.has("expire_unit")) {
paymentItem.setExpireUnit(jSONObject.getString("expire_unit"));
}
if (jSONObject.has("expire_value") && !jSONObject.isNull("expire_value")) {
paymentItem.setExpireValue(jSONObject.getInt("expire_value"));
}
return paymentItem;
}
}