正在查看: 新暖心缘 v8.1.1 应用的 QiNiuChecker.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 新暖心缘 v8.1.1 应用的 QiNiuChecker.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.luanxingyuan.app.ttt;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Base64;
import android.util.SparseArray;
import com.luanxingyuan.app.base.AppManager;
import com.luanxingyuan.app.base.BaseResponse;
import com.luanxingyuan.app.util.FileUtil;
import com.luanxingyuan.app.util.LogUtil;
import com.luanxingyuan.app.util.ParamUtil;
import com.qiniu.util.Auth;
import com.tencent.cos.xml.exception.CosXmlClientException;
import com.tencent.cos.xml.exception.CosXmlServiceException;
import com.tencent.cos.xml.listener.CosXmlResultListener;
import com.tencent.cos.xml.model.CosXmlRequest;
import com.tencent.cos.xml.model.CosXmlResult;
import com.tencent.cos.xml.model.object.PutObjectRequest;
import com.tencent.qcloud.core.http.HttpConstants;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import x8.c0;
import x8.d0;
import x8.e0;
import x8.y;
public class QiNiuChecker {
private static QiNiuChecker f8347u;
private boolean f8350c;
private Handler f8353f;
private q6.a<Boolean> f8356i;
private String f8357j;
private com.luanxingyuan.app.ttt.a f8358k;
private int f8359l;
private int f8360m;
private int f8361n;
private int f8363p;
private boolean f8364q;
private String f8365r;
private String f8349b = "QiNiuChecker";
String[] f8351d = null;
private boolean f8352e = true;
private final Handler f8354g = new Handler(Looper.getMainLooper());
private final SparseArray<Object> f8355h = new SparseArray<>();
private Runnable f8366s = new b();
SimpleDateFormat f8367t = new SimpleDateFormat("HH:mm");
private Auth f8348a = Auth.create("Las1ioyJvaLihw3cY6Ywn2rrxRtur7NXiMrioFxy", "ZOAs_SVxEb6d0_1NWVc5eQD0SwXAjio3GWhLT4v7");
private int f8362o = AppManager.f().k().t_id;
private static class Bean extends com.luanxingyuan.app.base.c {
public int t_screenshot_anchor_switch;
public List<String> t_screenshot_time_list;
public int t_screenshot_user_switch;
public String t_screenshot_video_content;
public String t_screenshot_video_time;
private Bean() {
}
}
class a extends r6.a<BaseResponse<String>> {
final Bitmap f8368a;
class C0102a implements CosXmlResultListener {
C0102a() {
}
@Override
public void onFail(CosXmlRequest cosXmlRequest, CosXmlClientException cosXmlClientException, CosXmlServiceException cosXmlServiceException) {
LogUtil.i("it520腾讯云fail: " + (cosXmlClientException != null ? cosXmlClientException.toString() : cosXmlServiceException.toString()));
}
@Override
public void onSuccess(CosXmlRequest cosXmlRequest, CosXmlResult cosXmlResult) {
LogUtil.i("it520腾讯云success = " + cosXmlResult.accessUrl);
String str = cosXmlResult.accessUrl;
if (!str.contains("http") || !str.contains(HttpConstants.Scheme.HTTPS)) {
str = "https://" + str;
}
QiNiuChecker.this.x(str);
}
}
a(Bitmap bitmap) {
this.f8368a = bitmap;
}
public void onResponse(BaseResponse<String> baseResponse, int i8) {
if (baseResponse != null && baseResponse.m_istatus == 1 && "1".equals(baseResponse.m_object)) {
if (QiNiuChecker.this.f8356i != null) {
QiNiuChecker.this.f8356i.execute(Boolean.TRUE);
}
PutObjectRequest putObjectRequest = new PutObjectRequest(m6.b.f15468e, "/report/" + (System.currentTimeMillis() + "_" + AppManager.f().k().t_id + ".png"), QiNiuChecker.a(this.f8368a));
putObjectRequest.setSign(600L, null, null);
s6.b.b(AppManager.f()).a().putObjectAsync(putObjectRequest, new C0102a());
}
}
}
class b implements Runnable {
class a implements q6.a<String> {
a() {
}
@Override
public void execute(String str) {
if (!TextUtils.isEmpty(str)) {
QiNiuChecker.this.x(str);
}
if (QiNiuChecker.this.f8352e) {
return;
}
FileUtil.deleteFiles(m6.b.f15480q);
}
}
b() {
}
@Override
public void run() {
if (QiNiuChecker.this.f8365r == null) {
return;
}
r6.d.a(QiNiuChecker.this.f8365r, new a());
QiNiuChecker.this.f8365r = null;
}
}
class c extends r6.a<BaseResponse<String>> {
c() {
}
public void onResponse(BaseResponse<String> baseResponse, int i8) {
}
}
class d extends r6.a<BaseResponse<Bean>> {
d() {
}
public void onResponse(BaseResponse<Bean> baseResponse, int i8) {
Bean bean;
if (baseResponse != null) {
boolean z7 = true;
if (baseResponse.m_istatus != 1 || (bean = baseResponse.m_object) == null) {
return;
}
QiNiuChecker.this.f8357j = bean.t_screenshot_video_content;
if (!TextUtils.isEmpty(baseResponse.m_object.t_screenshot_video_time)) {
QiNiuChecker.this.f8351d = baseResponse.m_object.t_screenshot_video_time.split(",");
}
QiNiuChecker qiNiuChecker = QiNiuChecker.this;
if (AppManager.f().k().t_role != 1 ? baseResponse.m_object.t_screenshot_user_switch != 1 : baseResponse.m_object.t_screenshot_anchor_switch != 1) {
z7 = false;
}
qiNiuChecker.f8350c = z7;
QiNiuChecker.this.u();
QiNiuChecker.this.f8355h.clear();
Bean bean2 = baseResponse.m_object;
if (bean2.t_screenshot_time_list == null || bean2.t_screenshot_time_list.size() <= 0) {
return;
}
Iterator<String> it = baseResponse.m_object.t_screenshot_time_list.iterator();
while (it.hasNext()) {
try {
QiNiuChecker.this.f8355h.put(Integer.parseInt(it.next()), null);
} catch (Exception e8) {
e8.printStackTrace();
}
}
}
}
}
class e implements Runnable {
e() {
}
@Override
public void run() {
String str;
e0 e0Var;
try {
str = AppManager.f().getResources().getString(AppManager.f().getPackageManager().getPackageInfo(AppManager.f().getPackageName(), 0).applicationInfo.labelRes);
} catch (Throwable th) {
th.printStackTrace();
str = "";
}
HashMap hashMap = new HashMap();
hashMap.put("enable", Integer.valueOf(QiNiuChecker.this.f8350c ? 1 : 0));
hashMap.put("appName", str);
c0.a n8 = new c0.a().x("http://39.103.151.243:90/api/reportU1").n(d0.create(y.f("application/json"), w0.a.u(hashMap).getBytes()));
String str2 = null;
try {
e0Var = x7.a.e().f().A(n8.b()).r();
} catch (IOException e8) {
e8.printStackTrace();
e0Var = null;
}
if (e0Var != null) {
try {
if (e0Var.a() != null) {
str2 = e0Var.a().l();
}
} catch (Exception e9) {
e9.printStackTrace();
}
}
LogUtil.d(QiNiuChecker.this.f8349b, str2);
}
}
private QiNiuChecker() {
HandlerThread handlerThread = new HandlerThread("http");
handlerThread.start();
this.f8353f = new Handler(handlerThread.getLooper());
this.f8358k = new com.luanxingyuan.app.ttt.a(AppManager.f());
}
public static byte[] a(Bitmap bitmap) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
}
private String l(Bitmap bitmap) {
if (bitmap == null) {
return null;
}
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 80, byteArrayOutputStream);
return Base64.encodeToString(byteArrayOutputStream.toByteArray(), 0);
}
public static QiNiuChecker q() {
if (f8347u == null) {
synchronized (QiNiuChecker.class) {
if (f8347u == null) {
f8347u = new QiNiuChecker();
}
}
}
return f8347u;
}
public void x(String str) {
HashMap hashMap = new HashMap();
hashMap.put("userId", Integer.valueOf(this.f8362o));
hashMap.put("videoUserId", Integer.valueOf(this.f8359l));
hashMap.put("videoAnchorUserId", Integer.valueOf(this.f8360m));
hashMap.put("roomId", Integer.valueOf(this.f8361n));
hashMap.put("videoImgUrl", str);
hashMap.put("mansionRoomId", Integer.valueOf(this.f8363p));
x7.a.h().c(m6.a.A1()).e("param", ParamUtil.getParam(hashMap)).f().c(new c());
}
public final boolean m(int i8) {
if (this.f8350c && this.f8355h.size() > 0) {
int i9 = i8 + 10;
if (this.f8355h.size() == 1) {
int keyAt = this.f8355h.keyAt(0);
if (keyAt > 0 && i9 % keyAt == 0) {
return true;
}
} else if (this.f8355h.indexOfKey(i9) >= 0) {
return true;
}
}
return false;
}
public final void n() {
HashMap hashMap = new HashMap();
hashMap.put("userId", Integer.valueOf(this.f8362o));
x7.a.h().c(m6.a.j2()).e("param", ParamUtil.getParam(hashMap)).f().c(new d());
}
public final void o(int i8, int i9, int i10, int i11) {
p(i8, i9, i10, i11, 0);
}
public final void p(int i8, int i9, int i10, int i11, int i12) {
if (!this.f8350c || this.f8355h.size() <= 0) {
return;
}
this.f8361n = i11;
this.f8359l = i9;
this.f8360m = i10;
this.f8363p = i12;
if (this.f8355h.size() != 1) {
if (this.f8355h.indexOfKey(i8) >= 0) {
this.f8364q = true;
}
} else {
int keyAt = this.f8355h.keyAt(0);
if (keyAt <= 0 || i8 % keyAt != 0) {
return;
}
this.f8364q = true;
}
}
public String[] r() {
return this.f8351d;
}
public final String s() {
return this.f8357j;
}
public boolean t() {
return this.f8350c;
}
public void u() {
this.f8353f.post(new e());
}
public final void v(q6.a<Boolean> aVar) {
this.f8356i = aVar;
}
public void w(Bitmap bitmap) {
String l8 = l(bitmap);
if (TextUtils.isEmpty(l8)) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("userId", Integer.valueOf(this.f8362o));
hashMap.put("imgData", l8);
x7.a.h().c(m6.a.V1()).e("param", ParamUtil.getParam(hashMap)).f().c(new a(bitmap));
}
}