Money Lover v8.14.0.6版本的 MD5 值为:48b9d922212c7ccfd438cdcc183ff396
以下内容为反编译后的 a.java 源代码,内容仅作参考
package kl;
import android.content.Context;
import android.util.Base64;
import com.bookmark.money.fcm.MLFirebaseMessagingService;
import com.facebook.appevents.UserDataStore;
import com.facebook.internal.AnalyticsEvents;
import com.google.auth.http.AuthHttpConstants;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.zoostudio.moneylover.db.sync.item.g;
import com.zoostudio.moneylover.exception.MoneyError;
import com.zoostudio.moneylover.utils.b1;
import ii.c;
import org.json.JSONException;
import org.json.JSONObject;
public class a {
private static String f26239a;
public class C0434a implements c.a {
final j f26240a;
C0434a(j jVar) {
this.f26240a = jVar;
}
@Override
public void b(JSONObject jSONObject) {
if (jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
String unused = a.f26239a = jSONObject.optString("request_token");
this.f26240a.onSuccess(jSONObject);
return;
}
FirebaseCrashlytics.getInstance().log("header: AuthorizationBasic " + Base64.encodeToString("MRVsdH2QoSyc:VqPgZq9F7j29NeDLycNGlHWjEqL7Uj".getBytes(), 2) + "\told token: " + zi.f.i().B() + "\tresponse: " + jSONObject.toString());
this.f26240a.onFail(new MoneyError(jSONObject.optString("code")));
}
@Override
public void onFail(MoneyError moneyError) {
FirebaseCrashlytics.getInstance().recordException(moneyError);
this.f26240a.onFail(moneyError);
}
}
public class b implements c.a {
final JSONObject f26241a;
final j f26242b;
b(JSONObject jSONObject, j jVar) {
this.f26241a = jSONObject;
this.f26242b = jVar;
}
@Override
public void b(JSONObject jSONObject) {
if (jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
if (this.f26241a.has("is_new_user")) {
try {
jSONObject.put("is_new_user", this.f26241a.optBoolean("is_new_user"));
} catch (JSONException e10) {
FirebaseCrashlytics.getInstance().recordException(e10);
}
}
if (this.f26241a.has("social")) {
try {
jSONObject.put("social", this.f26241a.getString("social"));
} catch (JSONException e11) {
FirebaseCrashlytics.getInstance().recordException(e11);
}
} else {
try {
jSONObject.put("social", "");
} catch (JSONException e12) {
FirebaseCrashlytics.getInstance().recordException(e12);
}
}
this.f26242b.onSuccess(jSONObject);
return;
}
MoneyError moneyError = new MoneyError();
moneyError.e(jSONObject.optInt("error"));
this.f26242b.onFail(moneyError);
}
@Override
public void onFail(MoneyError moneyError) {
this.f26242b.onFail(moneyError);
}
}
class c implements c.a {
final j f26243a;
final String f26244b;
final String f26245c;
c(j jVar, String str, String str2) {
this.f26243a = jVar;
this.f26244b = str;
this.f26245c = str2;
}
@Override
public void b(JSONObject jSONObject) {
if (jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
String optString = jSONObject.optString("access_token");
String optString2 = jSONObject.optString("refresh_token");
zi.f.i().D0(optString);
zi.f.i().z0(optString2);
this.f26243a.onSuccess(jSONObject);
return;
}
FirebaseCrashlytics.getInstance().log(this.f26244b + "\trefreshToken: " + this.f26245c + "\told token: " + zi.f.i().B() + "\tresponse: " + jSONObject.toString());
this.f26243a.onFail(new MoneyError(jSONObject.optString("code")));
}
@Override
public void onFail(MoneyError moneyError) {
FirebaseCrashlytics.getInstance().recordException(moneyError);
this.f26243a.onFail(moneyError);
}
}
public class d implements j {
final String f26246a;
final JSONObject f26247b;
final j f26248c;
class C0435a implements c.a {
C0435a() {
}
@Override
public void b(JSONObject jSONObject) {
if (jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
String optString = jSONObject.optString("access_token");
String optString2 = jSONObject.optString("refresh_token");
zi.f.i().D0(optString);
zi.f.i().z0(optString2);
zi.f.i().c();
if (jSONObject.has("is_new_user")) {
try {
d.this.f26247b.putOpt("is_new_user", Boolean.valueOf(jSONObject.optBoolean("is_new_user")));
} catch (JSONException e10) {
FirebaseCrashlytics.getInstance().recordException(e10);
}
}
d dVar = d.this;
a.k(dVar.f26247b, optString, dVar.f26248c);
} else {
FirebaseCrashlytics.getInstance().log("requestToken: " + a.f26239a + "\tbody: " + d.this.f26247b.toString() + "\tresponse: " + jSONObject.toString());
d.this.f26248c.onFail(new MoneyError(jSONObject.optString("code")));
}
String unused = a.f26239a = "";
}
@Override
public void onFail(MoneyError moneyError) {
String unused = a.f26239a = "";
FirebaseCrashlytics.getInstance().recordException(moneyError);
d.this.f26248c.onFail(moneyError);
}
}
d(String str, JSONObject jSONObject, j jVar) {
this.f26246a = str;
this.f26247b = jSONObject;
this.f26248c = jVar;
}
@Override
public void onFail(MoneyError moneyError) {
this.f26248c.onFail(moneyError);
}
@Override
public void onSuccess(JSONObject jSONObject) {
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, this.f26246a, com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(this.f26247b));
hVar.addHeader(AuthHttpConstants.BEARER, a.f26239a);
new ii.c().b(hVar, new C0435a());
}
}
public class e implements j {
final JSONObject f26250a;
final j f26251b;
class C0436a implements c.a {
C0436a() {
}
@Override
public void b(JSONObject jSONObject) {
if (jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
e.this.f26251b.onSuccess(jSONObject);
return;
}
MoneyError moneyError = new MoneyError(jSONObject.optString("code"));
if (moneyError.a() != 200) {
FirebaseCrashlytics.getInstance().log("\trequestToken: " + a.f26239a + "\tbody: " + e.this.f26250a.toString() + "\tresponse: " + jSONObject.toString());
}
e.this.f26251b.onFail(moneyError);
}
@Override
public void onFail(MoneyError moneyError) {
String unused = a.f26239a = "";
FirebaseCrashlytics.getInstance().recordException(moneyError);
e.this.f26251b.onFail(moneyError);
}
}
e(JSONObject jSONObject, j jVar) {
this.f26250a = jSONObject;
this.f26251b = jVar;
}
@Override
public void onFail(MoneyError moneyError) {
this.f26251b.onFail(moneyError);
}
@Override
public void onSuccess(JSONObject jSONObject) {
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, a.h("/user/register"), com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(this.f26250a));
hVar.addHeader(AuthHttpConstants.BEARER, a.f26239a);
new ii.c().b(hVar, new C0436a());
}
}
class f implements c.a {
final j f26253a;
f(j jVar) {
this.f26253a = jVar;
}
@Override
public void b(JSONObject jSONObject) {
try {
if (jSONObject.getBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
this.f26253a.onSuccess(jSONObject);
} else {
MoneyError moneyError = new MoneyError();
moneyError.e(207);
this.f26253a.onFail(moneyError);
}
} catch (JSONException e10) {
MoneyError moneyError2 = new MoneyError(e10);
moneyError2.e(1);
this.f26253a.onFail(moneyError2);
}
}
@Override
public void onFail(MoneyError moneyError) {
this.f26253a.onFail(moneyError);
}
}
class g implements g.e {
final j f26254a;
g(j jVar) {
this.f26254a = jVar;
}
@Override
public void onFail(MoneyError moneyError) {
this.f26254a.onFail(moneyError);
}
@Override
public void onSuccess(JSONObject jSONObject) {
this.f26254a.onSuccess(jSONObject);
}
}
class h implements j {
final j f26255a;
final JSONObject f26256b;
class C0437a implements c.a {
C0437a() {
}
@Override
public void b(JSONObject jSONObject) {
if (jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
String optString = jSONObject.optString("access_token");
String optString2 = jSONObject.optString("refresh_token");
zi.f.i().D0(optString);
zi.f.i().z0(optString2);
zi.f.i().c();
h.this.f26255a.onSuccess(jSONObject);
return;
}
h.this.f26255a.onFail(new MoneyError(jSONObject.optString("code")));
}
@Override
public void onFail(MoneyError moneyError) {
moneyError.printStackTrace();
h.this.f26255a.onFail(moneyError);
}
}
h(j jVar, JSONObject jSONObject) {
this.f26255a = jVar;
this.f26256b = jSONObject;
}
@Override
public void onFail(MoneyError moneyError) {
moneyError.printStackTrace();
}
@Override
public void onSuccess(JSONObject jSONObject) {
if (!jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
zi.f.i().N0(false);
MoneyError moneyError = new MoneyError();
moneyError.e(jSONObject.optInt("code"));
this.f26255a.onFail(moneyError);
return;
}
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, a.h("/migrate"), com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(this.f26256b));
hVar.addHeader(AuthHttpConstants.BEARER, a.f26239a);
new ii.c().b(hVar, new C0437a());
}
}
class i implements j {
final JSONObject f26258a;
final j f26259b;
class C0438a implements c.a {
C0438a() {
}
@Override
public void b(JSONObject jSONObject) {
if (!jSONObject.optBoolean(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS)) {
i.this.f26259b.onFail(new MoneyError(jSONObject.optString("code")));
} else {
i.this.f26259b.onSuccess(jSONObject);
}
}
@Override
public void onFail(MoneyError moneyError) {
moneyError.printStackTrace();
i.this.f26259b.onFail(moneyError);
}
}
i(JSONObject jSONObject, j jVar) {
this.f26258a = jSONObject;
this.f26259b = jVar;
}
@Override
public void onFail(MoneyError moneyError) {
}
@Override
public void onSuccess(JSONObject jSONObject) {
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, a.h("/user/forgot-password"), com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(this.f26258a));
hVar.addHeader(AuthHttpConstants.BEARER, a.f26239a);
new ii.c().b(hVar, new C0438a());
}
}
public interface j {
void onFail(MoneyError moneyError);
void onSuccess(JSONObject jSONObject);
}
public static JSONObject e(Context context, JSONObject jSONObject) throws JSONException {
jSONObject.put("grant_type", "password");
String d10 = MLFirebaseMessagingService.f8135a.d(context);
if (!b1.g(d10)) {
jSONObject.put("did", d10);
}
jSONObject.put("v", rt.a.d(context));
jSONObject.put("pl", 1);
jSONObject.put("lang", zi.f.a().E0());
String f10 = rt.e.f();
if (f10.isEmpty()) {
f10 = "Android " + rt.e.d();
}
jSONObject.put("na", f10);
String g02 = zi.f.a().g0("");
if (!b1.g(g02)) {
jSONObject.put("ref", g02);
}
if (zi.f.a().S2()) {
String g03 = zi.f.a().g0("");
if (!b1.g(g03)) {
jSONObject.put("ref", g03);
}
}
jSONObject.put("aid", 1);
jSONObject.put("script", m7.e.f27664h);
return jSONObject;
}
public static void f(String str, String str2, j jVar) {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put(UserDataStore.EMAIL, str);
jSONObject.put("pw", str2);
new ii.c().b(new com.zoostudio.moneylover.db.sync.item.h(1, com.zoostudio.moneylover.db.sync.item.g.getMoneyCloudUrl() + "/api/oauth", com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(jSONObject)), new f(jVar));
} catch (JSONException e10) {
e10.printStackTrace();
jVar.onFail(new MoneyError(e10));
}
}
public static void g(JSONObject jSONObject, j jVar) {
i(new i(jSONObject, jVar));
}
public static String h(String str) {
if (m7.a.f27647b) {
return "https://oauth-sandbox.moneylover.me" + str;
}
return "https://oauth.moneylover.me" + str;
}
private static void i(j jVar) {
JSONObject jSONObject = new JSONObject();
if (!b1.g(f26239a)) {
jVar.onSuccess(jSONObject);
return;
}
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, h("/request-token"), com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(jSONObject));
hVar.addHeader("Basic", Base64.encodeToString("MRVsdH2QoSyc:VqPgZq9F7j29NeDLycNGlHWjEqL7Uj".getBytes(), 2));
new ii.c().b(hVar, new C0434a(jVar));
}
private static void j(JSONObject jSONObject, String str, j jVar) {
i(new d(str, jSONObject, jVar));
}
public static void k(JSONObject jSONObject, String str, j jVar) {
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, com.zoostudio.moneylover.db.sync.item.g.getMoneyCloudUrl() + "/api/signin-info", com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(jSONObject));
hVar.addHeader(AuthHttpConstants.BEARER, str);
new ii.c().b(hVar, new b(jSONObject, jVar));
}
public static void l(JSONObject jSONObject, j jVar) {
j(jSONObject, h("/token"), jVar);
}
public static void m(JSONObject jSONObject, j jVar) {
j(jSONObject, h("/token/social"), jVar);
}
public static void n(JSONObject jSONObject, j jVar) {
com.zoostudio.moneylover.db.sync.item.g.requestToServer(com.zoostudio.moneylover.db.sync.item.g.LOGOUT, jSONObject, new g(jVar));
}
public static void o(JSONObject jSONObject, j jVar) {
i(new h(jVar, jSONObject));
}
public static void p(String str, String str2, j jVar) {
com.zoostudio.moneylover.db.sync.item.h hVar = new com.zoostudio.moneylover.db.sync.item.h(1, h("/refresh-token"), com.zoostudio.moneylover.db.sync.item.h.Companion.makeBody(new JSONObject()));
hVar.addHeader(AuthHttpConstants.BEARER, str2);
new ii.c().b(hVar, new c(jVar, str, str2));
}
public static void q(JSONObject jSONObject, j jVar) {
r(jSONObject, jVar);
}
private static void r(JSONObject jSONObject, j jVar) {
i(new e(jSONObject, jVar));
}
}