射射AV v6.8.3版本的 MD5 值为:4b0475341d3c62fa7e762c41558fd25f
以下内容为反编译后的 AvNightWebService.java 源代码,内容仅作参考
package com.avnight.webservice;
import android.util.Log;
import com.avnight.AvNightApplication;
import com.avnight.SharedPreference.Av9SharedPref;
import com.avnight.tools.Jni;
import com.avnight.tools.e0;
import com.google.firebase.perf.network.FirebasePerfOkHttpClient;
import i.a0;
import i.b0;
import i.c0;
import i.e;
import i.f;
import i.o;
import i.v;
import i.x;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;
public class AvNightWebService {
private static String ApiHostUrl = null;
private static String a = "https://api.api98.xyz";
private static String b;
private static final v c = v.d("application/json; charset=utf-8");
private static x f3164d;
private static x f3165e;
class a implements f {
a() {
}
@Override
public void a(e eVar, IOException iOException) {
}
@Override
public void b(e eVar, c0 c0Var) throws IOException {
e0.a("cpi", c0Var.toString());
}
}
class b implements f {
b() {
}
@Override
public void a(e eVar, IOException iOException) {
}
@Override
public void b(e eVar, c0 c0Var) throws IOException {
e0.a("cpi", c0Var.toString());
}
}
class c implements f {
c() {
}
@Override
public void a(e eVar, IOException iOException) {
}
@Override
public void b(e eVar, c0 c0Var) throws IOException {
e0.a("cpi", c0Var.toString());
}
}
public static class d implements o {
private long b;
private TimeUnit c;
class a implements Callable<List<InetAddress>> {
final String a;
a(d dVar, String str) {
this.a = str;
}
@Override
public List<InetAddress> call() throws Exception {
return Arrays.asList(InetAddress.getAllByName(this.a));
}
}
public d(long j2, TimeUnit timeUnit) {
this.b = j2;
this.c = timeUnit;
}
@Override
public List<InetAddress> a(String str) throws UnknownHostException {
if (str != null) {
try {
FutureTask futureTask = new FutureTask(new a(this, str));
new Thread(futureTask).start();
return (List) futureTask.get(this.b, this.c);
} catch (Exception e2) {
UnknownHostException unknownHostException = new UnknownHostException("Broken system behaviour for dns lookup of " + str);
unknownHostException.initCause(e2);
throw unknownHostException;
}
}
throw new UnknownHostException("hostname == null");
}
}
private static void a(String str, String str2, f fVar) {
a0.a aVar = new a0.a();
aVar.i(str2);
aVar.a("Accept", mobi.oneway.export.d.f.f13558d);
aVar.a("Authorization", e(str));
a0 b2 = aVar.b();
if (fVar != null) {
FirebasePerfOkHttpClient.enqueue(g().b(b2), fVar);
}
}
public static void b(String str, HashMap<String, String> hashMap) {
String str2 = a + "SetImpression";
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, String> entry : hashMap.entrySet()) {
try {
jSONObject.put(entry.getKey(), entry.getValue());
} catch (JSONException e2) {
e2.printStackTrace();
}
}
long currentTimeMillis = System.currentTimeMillis() / 1000;
try {
b0 d2 = b0.d(v.d("text/plain; charset=utf-8"), h((int) currentTimeMillis).b(jSONObject.toString()));
a0.a aVar = new a0.a();
aVar.i(str2);
aVar.a("X-AVNIGHT-TIME", currentTimeMillis + "");
aVar.a("X-AVNIGHT-STRING", str);
aVar.f(d2);
FirebasePerfOkHttpClient.enqueue(f().b(aVar.b()), new a());
} catch (Exception e3) {
e3.printStackTrace();
}
}
public static void c(String str, HashMap<String, String> hashMap) {
String str2 = a + "SetInstall";
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, String> entry : hashMap.entrySet()) {
try {
jSONObject.put(entry.getKey(), entry.getValue());
} catch (JSONException e2) {
e2.printStackTrace();
}
}
long currentTimeMillis = System.currentTimeMillis() / 1000;
try {
b0 d2 = b0.d(v.d("text/plain; charset=utf-8"), h((int) currentTimeMillis).b(jSONObject.toString()));
a0.a aVar = new a0.a();
aVar.i(str2);
aVar.a("X-AVNIGHT-TIME", currentTimeMillis + "");
aVar.a("X-AVNIGHT-STRING", str);
aVar.f(d2);
FirebasePerfOkHttpClient.enqueue(f().b(aVar.b()), new b());
} catch (Exception e3) {
e3.printStackTrace();
}
}
public static void d(String str, HashMap<String, String> hashMap) {
String str2 = a + "SetOpen";
JSONObject jSONObject = new JSONObject();
for (Map.Entry<String, String> entry : hashMap.entrySet()) {
try {
jSONObject.put(entry.getKey(), entry.getValue());
} catch (JSONException e2) {
e2.printStackTrace();
}
}
long currentTimeMillis = System.currentTimeMillis() / 1000;
try {
b0 d2 = b0.d(v.d("text/plain; charset=utf-8"), h((int) currentTimeMillis).b(jSONObject.toString()));
a0.a aVar = new a0.a();
aVar.i(str2);
aVar.a("X-AVNIGHT-TIME", currentTimeMillis + "");
aVar.a("X-AVNIGHT-STRING", str);
aVar.a("Accept", mobi.oneway.export.d.f.f13558d);
aVar.f(d2);
FirebasePerfOkHttpClient.enqueue(f().b(aVar.b()), new c());
} catch (Exception e3) {
e3.printStackTrace();
}
}
private static String e(String str) {
return Jni.getToken(AvNightApplication.e(), str);
}
public static synchronized x f() {
x xVar;
synchronized (AvNightWebService.class) {
if (f3164d == null) {
f3164d = new x();
}
xVar = f3164d;
}
return xVar;
}
public static synchronized x g() {
x xVar;
synchronized (AvNightWebService.class) {
if (f3165e == null) {
x.b bVar = new x.b();
TimeUnit timeUnit = TimeUnit.SECONDS;
bVar.c(10L, timeUnit);
bVar.e(10L, timeUnit);
bVar.f(10L, timeUnit);
bVar.d(new d(10L, timeUnit));
f3165e = bVar.b();
}
xVar = f3165e;
}
return xVar;
}
public static com.avnight.webservice.a h(int i2) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08:00"));
try {
return new com.avnight.webservice.a(simpleDateFormat.format(new Date(i2 * 1000)));
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
public static String i() {
return a;
}
public static String j() {
if (ApiHostUrl == null) {
Log.d("TAG", "ApiHostUrl == null");
ApiHostUrl = Av9SharedPref.f1359k.w();
}
return ApiHostUrl;
}
public static String k() {
if (b == null) {
b = Av9SharedPref.f1359k.H();
}
return b;
}
public static void l(String str, String str2, f fVar) {
a(str, j() + str2, fVar);
}
public static void m(String str) {
if (AvNightApplication.h()) {
ApiHostUrl = AvNightApplication.j();
} else {
ApiHostUrl = str;
}
Av9SharedPref.f1359k.e0(ApiHostUrl);
}
public static void n(String str) {
if (AvNightApplication.h()) {
a = "https://dev-avnight-cpi.appdev.icu/API/";
} else {
a = str;
}
}
public static void o(String str, String str2, JSONObject jSONObject, f fVar) throws JSONException {
String str3 = j() + str2 + "/video_speed_test";
b0 d2 = b0.d(c, jSONObject.toString());
a0.a aVar = new a0.a();
aVar.i(str3);
aVar.a("Accept", mobi.oneway.export.d.f.f13558d);
aVar.a("Authorization", e(str));
aVar.f(d2);
a0 b2 = aVar.b();
if (fVar != null) {
FirebasePerfOkHttpClient.enqueue(f().b(b2), fVar);
}
}
}