钱能钱包 v3.10.2版本的 MD5 值为:339a4b585ef2aa3bfaf7e4baeb254647
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.netease.nis.alivedetected;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import cn.jpush.android.api.JThirdPlatFormInterface;
import cn.jpush.android.local.JPushConstants;
import cn.jpush.android.service.WakedResultReceiver;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.netease.cloud.nos.yidun.core.WanNOSObject;
import com.netease.cloud.nos.yidun.exception.InvalidChunkSizeException;
import com.netease.cloud.nos.yidun.exception.InvalidParameterException;
import com.netease.nis.alivedetected.entity.GetConfigResponse;
import com.netease.nis.basesdk.EncryptUtil;
import com.netease.nis.basesdk.HttpUtil;
import com.netease.nis.basesdk.Logger;
import java.io.File;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
public class a {
public final Gson a = new GsonBuilder().create();
public String f5804b;
public String f5805c;
public String f5806d;
public String f5807e;
public final String f5808f;
public int f5809g;
public int f5810h;
public GetConfigResponse.NosConfig f5811i;
public final String f5812j;
public class C0116a implements HttpUtil.ResponseCallBack {
public final d a;
public C0116a(d dVar) {
this.a = dVar;
}
@Override
public void onError(int i2, String str) {
String valueOf;
a aVar = a.this;
if (aVar.f5809g <= 0) {
com.netease.nis.alivedetected.e.d.a().a("3", a.this.f5804b, String.valueOf(i2), str, "");
Logger.e("AliveDetectedHelper", String.format(Locale.getDefault(), "获取配置文件失败,错误码:%d,原因:%s", Integer.valueOf(i2), str));
try {
if (com.netease.nis.alivedetected.e.b.f5825b == 3) {
a.this.f5804b = "reduce1" + EncryptUtil.getRandomString(24) + "0";
valueOf = "";
} else {
valueOf = String.valueOf((int) ((Math.random() * 4.0d) + 1.0d));
a.this.f5804b = "reduce1" + EncryptUtil.getRandomString(24) + valueOf;
}
String str2 = valueOf;
Logger.d("AliveDetectedHelper", "降级token生成:" + a.this.f5804b);
com.netease.nis.alivedetected.e.b.f5827d = WakedResultReceiver.WAKE_TYPE_KEY;
a aVar2 = a.this;
aVar2.f5811i = null;
this.a.onGetConfigSuccess(aVar2.f5804b, str2, true, true, null, null);
int i3 = com.netease.nis.alivedetected.e.b.f5825b;
if (i3 < 3) {
com.netease.nis.alivedetected.e.b.f5825b = i3 + 1;
return;
}
return;
} catch (Exception e2) {
Logger.e(e2.getMessage());
return;
}
}
int i4 = aVar.f5810h + 1;
aVar.f5810h = i4;
aVar.f5806d = JPushConstants.HTTPS_PRE.concat(com.netease.nis.alivedetected.e.b.a[i4]).concat("/v1/liveperson/getConf");
a.this.a(this.a);
a.this.f5809g--;
}
@Override
public void onSuccess(String str) {
GetConfigResponse getConfigResponse;
boolean z;
int i2;
a aVar = a.this;
String[] strArr = com.netease.nis.alivedetected.e.b.a;
aVar.f5807e = (strArr == null || strArr.length <= 0) ? "https://verify.dun.163.com/v1/liveperson/check" : JPushConstants.HTTPS_PRE.concat(strArr[aVar.f5810h]).concat("/v1/liveperson/check");
String str2 = null;
try {
getConfigResponse = (GetConfigResponse) a.this.a.fromJson(str, (Class<Object>) GetConfigResponse.class);
} catch (Exception unused) {
com.netease.nis.alivedetected.e.d.a().a(WakedResultReceiver.CONTEXT_KEY, a.this.f5804b, "", "返回值Json解析异常" + str, "");
Logger.e("AliveDetectedHelper", "返回值Json解析异常" + str);
this.a.onError(2, "返回值Json解析异常:" + str);
getConfigResponse = null;
}
if (getConfigResponse != null) {
if (getConfigResponse.code == 200) {
String str3 = getConfigResponse.result;
try {
String str4 = a.this.f5805c;
String AESDecrypt = EncryptUtil.AESDecrypt(str3, str4, str4);
Logger.d("AliveDetectedHelper", "获取配置文件成功:" + AESDecrypt);
try {
GetConfigResponse.Result result = (GetConfigResponse.Result) a.this.a.fromJson(AESDecrypt, (Class<Object>) GetConfigResponse.Result.class);
boolean z2 = result.needSample;
com.netease.nis.alivedetected.e.d.f5832b = z2;
com.netease.nis.alivedetected.e.a.f5822c = z2;
if (z2) {
com.netease.nis.alivedetected.e.a.f5821b = Float.parseFloat(result.sampleConfig.sampleTime) * 1000.0f;
}
String str5 = result.actions;
boolean z3 = result.asyncUploadImage;
boolean z4 = result.needCloudCheck;
boolean z5 = result.needHdImage;
String str6 = result.hdActions;
String str7 = "0";
if (z5) {
if (str6 != null) {
str2 = "0" + str6;
}
a aVar2 = a.this;
GetConfigResponse.NosConfig nosConfig = result.nosConfig;
aVar2.f5811i = nosConfig;
String str8 = result.token;
aVar2.f5804b = str8;
this.a.onGetConfigSuccess(str8, str5, z3, z4, str7, nosConfig);
z = result.needReduceCheck;
if (z) {
com.netease.nis.alivedetected.e.b.f5826c = result.reduceCount;
}
if (z || (i2 = com.netease.nis.alivedetected.e.b.f5825b) >= result.reduceCount) {
return;
}
com.netease.nis.alivedetected.e.b.f5825b = i2 + 1;
return;
}
str7 = str2;
a aVar22 = a.this;
GetConfigResponse.NosConfig nosConfig2 = result.nosConfig;
aVar22.f5811i = nosConfig2;
String str82 = result.token;
aVar22.f5804b = str82;
this.a.onGetConfigSuccess(str82, str5, z3, z4, str7, nosConfig2);
z = result.needReduceCheck;
if (z) {
}
if (z) {
return;
}
return;
} catch (Exception e2) {
com.netease.nis.alivedetected.e.d.a().a(WakedResultReceiver.CONTEXT_KEY, a.this.f5804b, "", "返回值Json解析异常" + AESDecrypt + e2.getMessage(), "");
Logger.e("AliveDetectedHelper", "返回值Json解析异常" + AESDecrypt + e2.getMessage());
this.a.onError(2, "返回值Json解析异常:" + AESDecrypt + e2.getMessage());
return;
}
} catch (Exception e3) {
com.netease.nis.alivedetected.e.d.a().a(WakedResultReceiver.CONTEXT_KEY, a.this.f5804b, "", "AES解密异常" + str3 + e3.getMessage(), "");
Logger.e("AliveDetectedHelper", "AES解密异常" + str3 + e3.getMessage());
this.a.onError(2, "返回值AES解密异常:" + str3 + e3.getMessage());
return;
}
}
com.netease.nis.alivedetected.e.d.a().a("3", a.this.f5804b, String.valueOf(getConfigResponse.code), getConfigResponse.msg, "");
this.a.onError(2, str);
}
}
}
public class b implements HttpUtil.ResponseCallBack {
public final String a;
public final File f5814b;
public final String f5815c;
public final WanNOSObject f5816d;
public b(String str, File file, String str2, WanNOSObject wanNOSObject) {
this.a = str;
this.f5814b = file;
this.f5815c = str2;
this.f5816d = wanNOSObject;
}
@Override
public void onError(int i2, String str) {
Logger.e("AliveDetectedHelper", "异常动作图片上传失败:" + str);
}
@Override
public void onSuccess(String str) {
Logger.d("AliveDetectedHelper", "异常动作图片上传成功" + this.a);
this.f5814b.delete();
com.netease.nis.alivedetected.e.d a = com.netease.nis.alivedetected.e.d.a();
String str2 = a.this.f5804b;
String str3 = this.f5815c;
String nosObjectName = this.f5816d.getNosObjectName();
a.getClass();
a.a(String.valueOf(System.currentTimeMillis()), "8", str2, "", "", str3, nosObjectName);
a.b();
}
}
public a(String str, String str2) {
String[] strArr = com.netease.nis.alivedetected.e.b.a;
this.f5806d = (strArr == null || strArr.length <= 0) ? "https://verify.dun.163.com/v1/liveperson/getConf" : JPushConstants.HTTPS_PRE.concat(strArr[0]).concat("/v1/liveperson/getConf");
String[] strArr2 = com.netease.nis.alivedetected.e.b.a;
this.f5807e = (strArr2 == null || strArr2.length <= 0) ? "https://verify.dun.163.com/v1/liveperson/check" : JPushConstants.HTTPS_PRE.concat(strArr2[0]).concat("/v1/liveperson/check");
String[] strArr3 = com.netease.nis.alivedetected.e.b.a;
this.f5809g = (strArr3 == null || strArr3.length <= 0) ? 0 : strArr3.length - 1;
this.f5810h = 0;
this.f5808f = str;
this.f5812j = str2;
}
public void a(d dVar) {
try {
Map<String, String> b2 = b(this.f5808f);
HashMap hashMap = new HashMap();
hashMap.put("terminal", WakedResultReceiver.CONTEXT_KEY);
hashMap.put("version", AliveDetector.SDK_VERSION);
hashMap.put("model", Build.MODEL);
hashMap.put("osVersion", Build.VERSION.RELEASE);
if (!TextUtils.isEmpty(this.f5812j)) {
hashMap.put("sessionId", this.f5812j);
}
HttpUtil.doPostRequestByForm(this.f5806d, b2, hashMap, new C0116a(dVar));
} catch (Exception e2) {
com.netease.nis.alivedetected.e.d a = com.netease.nis.alivedetected.e.d.a();
String str = this.f5804b;
a.a(WakedResultReceiver.CONTEXT_KEY, str, "", "参数设置Json解析异常" + e2.getMessage(), "");
Logger.e("AliveDetectedHelper", "参数设置Json解析异常" + e2.getMessage());
dVar.onError(1, e2.getMessage());
}
}
public final Map<String, String> b(String str) {
String str2;
String str3 = "";
JSONObject jSONObject = new JSONObject();
jSONObject.put("businessKey", str);
jSONObject.put("nonce", EncryptUtil.getRandomString(32));
jSONObject.put("timestamp", System.currentTimeMillis());
jSONObject.put("version", AliveDetector.SDK_VERSION);
jSONObject.put("sdkType", 1);
jSONObject.put("reduceType", com.netease.nis.alivedetected.e.b.f5825b == com.netease.nis.alivedetected.e.b.f5826c ? 1 : 0);
this.f5805c = EncryptUtil.getRandomString(16);
try {
String jSONObject2 = jSONObject.toString();
String str4 = this.f5805c;
str2 = EncryptUtil.AESEncrypt(jSONObject2, str4, str4);
} catch (Exception e2) {
e = e2;
str2 = "";
}
try {
str3 = EncryptUtil.RSAEncrypt(this.f5805c, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjZBIRMtccHrq2VXapzir50diR1uZrR/SHc/mHMvW7sCZ7Bw/VfJkgdYCaNyyLLiIuOGw/OxHiocw95qPayfiMJkkKSR+XUc5KKWQuFSHmw2LNmq9YPdVtsqAjAQ4Qe3XcN1WQnrSpLsLer0WFSI+h0riBnvR9y9kn25RlC/uCvEo0//4r340RgOC1XLr3OPE1Nxc4WbrTN8uEB0hZ6PtWAY0ZQ6X8G+EXecbWHIhgBi9LhKhsZmIx3u/O+z+Jqx54nGgNhxVawsHtUBblT/oUAJzO0NkvYU0zFZ2ses9VnXXo/QwoYqcwnLIcf7zrQg5nVLTNyVpPZAFNdF/WsYJLQIDAQAB");
} catch (Exception e3) {
e = e3;
com.netease.nis.alivedetected.e.d a = com.netease.nis.alivedetected.e.d.a();
String str5 = this.f5804b;
StringBuilder sb = new StringBuilder();
sb.append("参数设置Json解析异常");
sb.append(this.f5805c == null);
a.a(WakedResultReceiver.CONTEXT_KEY, str5, "", sb.toString(), "");
Logger.e(e.getMessage());
HashMap hashMap = new HashMap();
hashMap.put(b.d.a.n3.d1.d.a, str2);
hashMap.put("rk", str3);
hashMap.put("version", AliveDetector.SDK_VERSION);
return hashMap;
}
HashMap hashMap2 = new HashMap();
hashMap2.put(b.d.a.n3.d1.d.a, str2);
hashMap2.put("rk", str3);
hashMap2.put("version", AliveDetector.SDK_VERSION);
return hashMap2;
}
public void a(String str, int i2, String str2, Context context) {
String str3;
File file = new File(str);
if (!file.exists() || this.f5811i == null) {
return;
}
WanNOSObject wanNOSObject = new WanNOSObject();
wanNOSObject.setNosBucketName(this.f5811i.bucketName);
if (i2 == 0) {
GetConfigResponse.AvatarImageData avatarImageData = this.f5811i.avatarErrorData;
String str4 = avatarImageData.xNosToken;
wanNOSObject.setNosObjectName(avatarImageData.objectName);
str3 = str4;
} else {
int i3 = i2 - 1;
GetConfigResponse.ActionImageData[] actionImageDataArr = this.f5811i.errorImageDatas;
String str5 = actionImageDataArr[i3].xNosToken;
wanNOSObject.setNosObjectName(actionImageDataArr[i3].objectName);
str3 = str5;
}
try {
com.netease.nis.alivedetected.e.a.a(context, wanNOSObject, str3, str, new b(str, file, str2, wanNOSObject));
} catch (InvalidChunkSizeException | InvalidParameterException e2) {
Logger.e("AliveDetectedHelper", "上传异常动作图片到nos服务器失败:" + e2.getMessage());
}
}
public final Map<String, String> a(String str) {
String str2;
String str3 = "";
JSONObject jSONObject = new JSONObject();
jSONObject.put("businessKey", str);
jSONObject.put("timestamp", System.currentTimeMillis());
jSONObject.put("nonce", EncryptUtil.getRandomString(32));
jSONObject.put("version", AliveDetector.SDK_VERSION);
jSONObject.put("picType", com.netease.nis.alivedetected.e.b.f5827d);
if (com.netease.nis.alivedetected.e.b.f5827d.equals(WakedResultReceiver.WAKE_TYPE_KEY)) {
JSONArray jSONArray = new JSONArray();
for (int i2 = 0; i2 < com.netease.nis.alivedetected.e.b.f5828e.size(); i2++) {
if (i2 == 0) {
jSONObject.put("avatar", com.netease.nis.alivedetected.e.a.a(com.netease.nis.alivedetected.e.b.f5828e.get(i2)));
} else {
jSONArray.put(com.netease.nis.alivedetected.e.a.a(com.netease.nis.alivedetected.e.b.f5828e.get(i2)));
}
}
jSONObject.put("checkImages", jSONArray);
}
jSONObject.put(JThirdPlatFormInterface.KEY_TOKEN, this.f5804b);
jSONObject.put("sdkType", 1);
jSONObject.put("terminal", WakedResultReceiver.CONTEXT_KEY);
jSONObject.put("model", Build.MODEL);
jSONObject.put("systemVersion", Build.VERSION.RELEASE);
if (!TextUtils.isEmpty(this.f5812j)) {
jSONObject.put("sessionId", this.f5812j);
}
try {
String jSONObject2 = jSONObject.toString();
String str4 = this.f5805c;
str2 = EncryptUtil.AESEncrypt(jSONObject2, str4, str4);
} catch (Exception e2) {
e = e2;
str2 = "";
}
try {
str3 = EncryptUtil.RSAEncrypt(this.f5805c, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjZBIRMtccHrq2VXapzir50diR1uZrR/SHc/mHMvW7sCZ7Bw/VfJkgdYCaNyyLLiIuOGw/OxHiocw95qPayfiMJkkKSR+XUc5KKWQuFSHmw2LNmq9YPdVtsqAjAQ4Qe3XcN1WQnrSpLsLer0WFSI+h0riBnvR9y9kn25RlC/uCvEo0//4r340RgOC1XLr3OPE1Nxc4WbrTN8uEB0hZ6PtWAY0ZQ6X8G+EXecbWHIhgBi9LhKhsZmIx3u/O+z+Jqx54nGgNhxVawsHtUBblT/oUAJzO0NkvYU0zFZ2ses9VnXXo/QwoYqcwnLIcf7zrQg5nVLTNyVpPZAFNdF/WsYJLQIDAQAB");
} catch (Exception e3) {
e = e3;
com.netease.nis.alivedetected.e.d a = com.netease.nis.alivedetected.e.d.a();
String str5 = this.f5804b;
StringBuilder sb = new StringBuilder();
sb.append("参数设置Json解析异常");
sb.append(this.f5805c == null);
a.a(WakedResultReceiver.CONTEXT_KEY, str5, "", sb.toString(), "");
Logger.e(e.getMessage());
HashMap hashMap = new HashMap();
hashMap.put(b.d.a.n3.d1.d.a, str2);
hashMap.put("rk", str3);
hashMap.put("version", AliveDetector.SDK_VERSION);
return hashMap;
}
HashMap hashMap2 = new HashMap();
hashMap2.put(b.d.a.n3.d1.d.a, str2);
hashMap2.put("rk", str3);
hashMap2.put("version", AliveDetector.SDK_VERSION);
return hashMap2;
}
}