Fast Orange v3.5.3版本的 MD5 值为:33b91aba50c566533dfd683a85f79158
以下内容为反编译后的 ChatVisitorClient.java 源代码,内容仅作参考
package zendesk.chat;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import com.free.vpn.proxy.hotspot.ge1;
import com.free.vpn.proxy.hotspot.jf2;
import com.free.vpn.proxy.hotspot.oj3;
import com.free.vpn.proxy.hotspot.p74;
import com.free.vpn.proxy.hotspot.pj3;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.Collections;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import okhttp3.OkHttpClient;
import zendesk.chat.AuthenticationStorage;
import zendesk.chat.ChatSocketClient;
import zendesk.chat.MachineIdStorage;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public class ChatVisitorClient {
private static final String BASE_AUTH_URL = "https://id.zopim.com";
private static final String BASE_URL = "wss://widget-mediator.zopim.com";
private static final String USER_AGENT_FORMAT = "%s %s/%s-%s %s/%s";
private final pj3 authenticationRetrofit;
private final AuthenticationStorage authenticationStorage;
private final ChatSocketClient chatSocketClient;
private final NetworkConnectivity connectivity;
private final Gson gson;
private final MachineIdStorage machineIdStorage;
private final ScheduledExecutorService scheduledExecutorService;
private final String sourceVersion;
private final String userAgent;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public class Builder {
private NetworkConnectivity networkConnectivity;
private OkHttpClient okHttpClient;
private ScheduledExecutorService scheduledExecutorService;
private String appName = "_";
private String appVersion = "_";
private String sdkName = "_";
private String sdkVersion = "_";
private String baseUrl = ChatVisitorClient.BASE_URL;
private String baseAuthUrl = ChatVisitorClient.BASE_AUTH_URL;
private MachineIdStorage machineIdStorage = null;
private AuthenticationStorage authenticationStorage = null;
public ChatVisitorClient build() {
char c;
Object[] objArr = new Object[6];
objArr[0] = p74.a(System.getProperty("http.agent"));
objArr[1] = this.appName;
objArr[2] = this.appVersion;
if (this.baseUrl.contains("zopim.com")) {
c = 'p';
} else {
c = 'd';
}
objArr[3] = Character.valueOf(c);
objArr[4] = this.sdkName;
objArr[5] = this.sdkVersion;
String format = String.format(ChatVisitorClient.USER_AGENT_FORMAT, objArr);
if (this.networkConnectivity == null) {
this.networkConnectivity = new NetworkConnectivity();
}
if (this.okHttpClient == null) {
this.okHttpClient = new OkHttpClient();
}
if (this.scheduledExecutorService == null) {
this.scheduledExecutorService = Executors.newScheduledThreadPool(5);
}
if (this.machineIdStorage == null) {
this.machineIdStorage = new MachineIdStorage.InMemory();
}
if (this.authenticationStorage == null) {
this.authenticationStorage = new AuthenticationStorage.InMemory();
}
Gson create = new GsonBuilder().serializeNulls().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
ChatSocketClient build = new ChatSocketClient.Builder(new MediatorEndpoint(jf2.r(new StringBuilder(), this.baseUrl, "/s/W"), Clock.SYSTEM_CLOCK)).withScheduledExecutorService(this.scheduledExecutorService).withExecutor(this.scheduledExecutorService).withOkHttpClient(this.okHttpClient).build();
oj3 oj3Var = new oj3();
oj3Var.a(this.baseAuthUrl);
oj3Var.c.add(ge1.d(create));
oj3Var.c(this.okHttpClient);
return new ChatVisitorClient(format, this.sdkVersion, build, this.scheduledExecutorService, create, this.networkConnectivity, this.machineIdStorage, this.authenticationStorage, oj3Var.b());
}
public Builder withAppInfo(@NonNull String str, @NonNull String str2) {
if (p74.c(str)) {
this.appName = str.replaceAll(" ", "");
}
if (p74.c(str2)) {
this.appVersion = str2.replaceAll(" ", "");
}
return this;
}
public Builder withAuthenticationStorage(@NonNull AuthenticationStorage authenticationStorage) {
this.authenticationStorage = authenticationStorage;
return this;
}
public Builder withBaseAuthUrl(@NonNull String str) {
if (p74.c(str)) {
this.baseAuthUrl = str;
}
return this;
}
public Builder withBaseUrl(@NonNull String str) {
if (p74.c(str)) {
this.baseUrl = str;
}
return this;
}
public Builder withMachineIdStorage(@NonNull MachineIdStorage machineIdStorage) {
this.machineIdStorage = machineIdStorage;
return this;
}
public Builder withNetworkConnectivity(@NonNull NetworkConnectivity networkConnectivity) {
this.networkConnectivity = networkConnectivity;
return this;
}
public Builder withOkHttpClient(@NonNull OkHttpClient okHttpClient) {
this.okHttpClient = okHttpClient;
return this;
}
public Builder withScheduledExecutorService(@NonNull ScheduledExecutorService scheduledExecutorService) {
this.scheduledExecutorService = scheduledExecutorService;
return this;
}
public Builder withSdkInfo(@NonNull String str, @NonNull String str2) {
if (p74.c(str)) {
this.sdkName = str.replaceAll(" ", "");
}
if (p74.c(str2)) {
this.sdkVersion = str2.replaceAll(" ", "");
}
return this;
}
}
private ChatVisitorClient(String str, String str2, ChatSocketClient chatSocketClient, ScheduledExecutorService scheduledExecutorService, Gson gson, NetworkConnectivity networkConnectivity, MachineIdStorage machineIdStorage, AuthenticationStorage authenticationStorage, pj3 pj3Var) {
this.userAgent = str;
this.sourceVersion = str2;
this.chatSocketClient = chatSocketClient;
this.scheduledExecutorService = scheduledExecutorService;
this.gson = gson;
this.connectivity = networkConnectivity;
this.machineIdStorage = machineIdStorage;
this.authenticationStorage = authenticationStorage;
this.authenticationRetrofit = pj3Var;
}
public ChatSession createNewSession(@NonNull String str, @NonNull String str2, @Nullable String str3, @NonNull VisitorPath visitorPath) {
return createNewSession(str, str2, str3, visitorPath, null);
}
public ChatSession createNewSession(@NonNull String str, @NonNull String str2, @Nullable String str3, @NonNull VisitorPath visitorPath, @Nullable JwtAuthenticator jwtAuthenticator) {
LoginDetailsProvider jwtLoginDetailsProvider;
DataNode dataNode = new DataNode(this.gson);
DataStore dataStore = new DataStore(dataNode);
LoginDetailsFactory loginDetailsFactory = new LoginDetailsFactory(str, str2, this.userAgent, this.sourceVersion, str3, visitorPath.getUrl(), visitorPath.getTitle());
MachineIdStorage machineIdStorage = this.machineIdStorage;
if (jwtAuthenticator == null) {
jwtLoginDetailsProvider = new AnonymousLoginDetailsProvider(machineIdStorage, dataStore, loginDetailsFactory);
} else {
AnonymousLoginDetailsProvider anonymousLoginDetailsProvider = new AnonymousLoginDetailsProvider(machineIdStorage, dataStore, loginDetailsFactory);
jwtLoginDetailsProvider = new JwtLoginDetailsProvider(Clock.SYSTEM_CLOCK, jwtAuthenticator, (AuthenticationService) this.authenticationRetrofit.b(AuthenticationService.class), this.authenticationStorage, this.machineIdStorage, loginDetailsFactory, str, anonymousLoginDetailsProvider);
}
Connection connection = new Connection(dataNode, this.chatSocketClient, jwtLoginDetailsProvider, this.connectivity, this.scheduledExecutorService, dataStore.getConnectionStateMachine(), Collections.emptySet());
FileUploader fileUploader = new FileUploader(this.chatSocketClient.getOkHttpClient(), dataNode, connection);
PathValueSender pathValueSender = new PathValueSender(connection);
return new DefaultChatSession(dataStore, connection, new LinkedBlockingQueue(), pathValueSender, new RequestSender(dataNode, pathValueSender, fileUploader, dataStore.getConnectionStateMachine()), new MessageIdGenerator());
}
public ChatSession createNewSession(@NonNull String str, @Nullable String str2, @NonNull VisitorPath visitorPath) {
return createNewSession(str, "", str2, visitorPath, null);
}
}