Money Lover v8.14.0.6版本的 MD5 值为:48b9d922212c7ccfd438cdcc183ff396
以下内容为反编译后的 FoursquareLocationHelper.java 源代码,内容仅作参考
package com.zoostudio.moneylover.utils;
import android.content.Context;
import android.content.res.Resources;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import com.google.gson.annotations.SerializedName;
import fr.z;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import sr.a;
import ut.t;
public class FoursquareLocationHelper {
private static final FourSquareService f14789a = (FourSquareService) new t.b().f(d()).c("https://api.foursquare.com").d().b(FourSquareService.class);
private static int f14790b = 40;
public interface FourSquareService {
@wt.f("/v2/venues/search")
void searchPlaces(@wt.t("v") String str, @wt.t("ll") String str2, @wt.t("limit") int i10, @wt.t("query") String str3, @wt.t("client_id") String str4, @wt.t("client_secret") String str5, ut.d<FoursquareResponse> dVar);
}
public static class FoursquareCategory {
public FoursquareIcon icon;
public String f14791id;
public String name;
public boolean primary;
private FoursquareCategory() {
}
}
private static class FoursquareData {
public ArrayList<FoursquareVenue> venues;
private FoursquareData() {
}
}
public static class FoursquareIcon {
public String prefix;
public String suffix;
private FoursquareIcon() {
}
}
public static class FoursquareLocation {
public String address;
public String city;
public String country;
public double distance;
public double lat;
public double lng;
public String state;
private FoursquareLocation() {
}
}
private static class FoursquareMeta {
public int code;
private FoursquareMeta() {
}
}
private static class FoursquareResponse {
@SerializedName("response")
public FoursquareData data;
public FoursquareMeta meta;
private FoursquareResponse() {
}
}
public static class FoursquareVenue {
public ArrayList<FoursquareCategory> categories;
public String f14792id;
public FoursquareLocation location;
public String name;
public String url;
private FoursquareVenue() {
}
}
public static com.zoostudio.moneylover.adapter.item.t b(FoursquareVenue foursquareVenue) {
String str;
com.zoostudio.moneylover.adapter.item.t tVar = new com.zoostudio.moneylover.adapter.item.t();
FoursquareLocation foursquareLocation = foursquareVenue.location;
tVar.setLatitude(foursquareLocation.lat);
tVar.setLongitude(foursquareLocation.lng);
tVar.setName(foursquareVenue.name);
if (foursquareVenue.categories.size() > 0) {
tVar.setCategory(foursquareVenue.categories.get(0).name);
}
String str2 = foursquareLocation.address;
if (TextUtils.isEmpty(str2)) {
str2 = foursquareLocation.city;
}
if (TextUtils.isEmpty(str2)) {
str2 = foursquareLocation.country;
}
tVar.setAddress(str2);
if (foursquareVenue.categories.size() > 0) {
str = foursquareVenue.categories.get(0).icon.prefix;
} else {
str = "";
}
if (!TextUtils.isEmpty(str)) {
tVar.setIconFourSquare(str + f14790b + ".png");
} else {
tVar.setIconFourSquare("https://ss1.4sqi.net/img/categories_v2/parks_outdoors/default_" + f14790b + ".png");
}
return tVar;
}
public static void c(final String str, double d10, double d11, final gf.a aVar) {
f(str, d10, d11, new ii.d<List<FoursquareVenue>>() {
@Override
public void onFailure(ii.b bVar) {
gf.a.this.onFailure();
}
@Override
public void onSuccess(List<FoursquareVenue> list) {
ArrayList<com.zoostudio.moneylover.adapter.item.t> arrayList = new ArrayList<>();
Iterator<FoursquareVenue> it = list.iterator();
while (it.hasNext()) {
arrayList.add(FoursquareLocationHelper.b(it.next()));
}
gf.a.this.a(str, arrayList);
}
});
}
private static fr.z d() {
z.a aVar = new z.a();
sr.a aVar2 = new sr.a();
aVar2.d(a.EnumC0592a.BASIC);
aVar.a(aVar2);
return aVar.b();
}
public static void e(Context context) {
if (context == null) {
f14790b = 32;
return;
}
Resources resources = context.getResources();
if (resources == null) {
f14790b = 32;
return;
}
DisplayMetrics displayMetrics = resources.getDisplayMetrics();
if (displayMetrics == null) {
f14790b = 32;
return;
}
int i10 = (int) (displayMetrics.density * 160.0f);
if (i10 >= 320) {
f14790b = 88;
} else if (i10 >= 240 && i10 < 320) {
f14790b = 64;
} else {
f14790b = 32;
}
}
private static void f(String str, double d10, double d11, final ii.d<List<FoursquareVenue>> dVar) {
f14789a.searchPlaces("20131016", "" + d11 + "," + d10, 30, str, "IHRO3CQ0C32QCWZB413AGMSWVBNF2GHFE0UNWY4XGW5TBZ3P", "BMZRT1CNDZO1BVWCYKO01PYBNYWYR54SNOXO05FG3COC4ZUR", new ut.d<FoursquareResponse>() {
@Override
public void onFailure(ut.b<FoursquareResponse> bVar, Throwable th2) {
ii.d.this.onFailure(new ii.b(""));
}
@Override
public void onResponse(ut.b<FoursquareResponse> bVar, ut.s<FoursquareResponse> sVar) {
if (sVar.a() != null && sVar.a().meta.code != 200) {
ii.d.this.onFailure(new ii.b(""));
}
if (sVar.a() != null) {
ii.d.this.onSuccess(sVar.a().data.venues);
}
}
});
}
}