CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 TokenGenerator.java 源代码,内容仅作参考
package com.mobile.auth.gatewayauth.utils;
import android.content.Context;
import android.text.TextUtils;
import com.mobile.auth.gatewayauth.ExceptionProcessor;
import com.mobile.auth.gatewayauth.annotations.SafeProtector;
import com.mobile.auth.gatewayauth.manager.SystemManager;
import com.mobile.auth.gatewayauth.manager.VendorSdkInfoManager;
import com.nirvana.tools.core.CryptUtil;
import com.nirvana.tools.core.ExecutorManager;
import java.io.UnsupportedEncodingException;
public class TokenGenerator {
private com.mobile.auth.q.a a;
private SystemManager f13178b;
private VendorSdkInfoManager f13179c;
static {
b.a.a.a.SLoad("pns-2.13.2.1-LogOnlineStandardCuumRelease_alijtca_plus");
}
public TokenGenerator(com.mobile.auth.q.a aVar, SystemManager systemManager, VendorSdkInfoManager vendorSdkInfoManager) {
this.a = aVar;
this.f13178b = systemManager;
this.f13179c = vendorSdkInfoManager;
}
@SafeProtector
private native String assembleCustomizeToken(Context context, String str, String str2, String str3, String str4, String str5, String str6);
@SafeProtector
private native String generateCsrf(String str);
public String a(Context context, String str, String str2, String str3, boolean z, String str4, String str5, String str6, boolean z2, String str7) {
try {
return assembleToken(context, null, null, null, str, str2, str3, z, str4, str5, str6, z2, str7);
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
@SafeProtector
public String assembleToken(Context context, String str, String str2, String str3, String str4, String str5, String str6, boolean z, String str7, String str8, String str9, boolean z2, String str10) {
String str11;
boolean z3;
int i;
String encode;
String str12 = "";
if (z) {
try {
str12 = generateCsrf(str5);
} catch (Throwable th) {
try {
ExceptionProcessor.processException(th);
return null;
} catch (Throwable th2) {
ExceptionProcessor.processException(th2);
return null;
}
}
}
String str13 = str12;
if (z2) {
str11 = k.g(context, "rpk");
if (!TextUtils.isEmpty(str11)) {
z3 = true;
if (z3) {
try {
encode = CryptUtil.Base64.encode(EncryptUtils.encryptToken(context, str, str2, str3, this.f13179c.c(), str4, str5, str6, str13, true, str10).getBytes("UTF-8"));
} catch (UnsupportedEncodingException e2) {
e = e2;
i = 1;
com.mobile.auth.q.a aVar = this.a;
String[] strArr = new String[i];
strArr[0] = ExecutorManager.getErrorInfoFromException(e);
aVar.e(strArr);
return null;
}
} else {
i = 1;
try {
encode = assembleCustomizeToken(context, str4, str5, str7, str8, str9, str11);
} catch (UnsupportedEncodingException e3) {
e = e3;
com.mobile.auth.q.a aVar2 = this.a;
String[] strArr2 = new String[i];
strArr2[0] = ExecutorManager.getErrorInfoFromException(e);
aVar2.e(strArr2);
return null;
}
}
return encode;
}
} else {
str11 = null;
}
z3 = false;
if (z3) {
}
return encode;
}
}