Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package com.helpshift.network;
import com.helpshift.network.HSResponse;
import com.helpshift.network.exception.HSRootApiException;
import com.helpshift.network.exception.NetworkException;
import com.helpshift.util.Utils;
/* loaded from: classes3.dex */
public class AuthenticationFailureNetwork implements HSNetwork {
public final HSNetwork network;
public AuthenticationFailureNetwork(HSNetwork hSNetwork) {
this.network = hSNetwork;
}
@Override // com.helpshift.network.HSNetwork
public HSResponse makeRequest(HSRequestData hSRequestData) {
HSResponse makeRequest = this.network.makeRequest(hSRequestData);
if (makeRequest.getStatus() == HSResponse.NetworkResponseCodes.UNAUTHORIZED_ACCESS.intValue() && !Utils.isEmpty(makeRequest.getResponseString())) {
if ("missing user auth token".equalsIgnoreCase(makeRequest.getResponseString())) {
NetworkException networkException = NetworkException.AUTH_TOKEN_NOT_PROVIDED;
networkException.serverStatusCode = HSResponse.NetworkResponseCodes.AUTH_TOKEN_NOT_PROVIDED.intValue();
throw HSRootApiException.wrap(null, networkException);
}
if ("invalid user auth token".equalsIgnoreCase(makeRequest.getResponseString())) {
NetworkException networkException2 = NetworkException.INVALID_AUTH_TOKEN;
networkException2.serverStatusCode = HSResponse.NetworkResponseCodes.INVALID_AUTH_TOKEN.intValue();
throw HSRootApiException.wrap(null, networkException2);
}
}
return makeRequest;
}
}

View File

@@ -0,0 +1,35 @@
package com.helpshift.network;
import com.helpshift.network.HSRequest;
import com.helpshift.network.exception.HSRootApiException;
import com.helpshift.network.exception.NetworkException;
import com.helpshift.util.Utils;
import com.ironsource.v8;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Map;
/* loaded from: classes3.dex */
public class GETNetwork extends HSBaseNetwork implements HSNetwork {
public GETNetwork(HTTPTransport hTTPTransport, String str) {
super(hTTPTransport, str);
}
@Override // com.helpshift.network.HSBaseNetwork
public HSRequest getRequest(HSRequestData hSRequestData) {
return new HSRequest(HSRequest.Method.GET, getURL() + "?" + getQuery(hSRequestData.body), hSRequestData.headers, "", 5000);
}
public final String getQuery(Map map) {
ArrayList arrayList = new ArrayList();
for (Map.Entry entry : map.entrySet()) {
try {
arrayList.add(((String) entry.getKey()) + v8.i.b + URLEncoder.encode((String) entry.getValue(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw HSRootApiException.wrap(e, NetworkException.UNSUPPORTED_ENCODING_EXCEPTION);
}
}
return Utils.join(v8.i.c, arrayList);
}
}

View File

@@ -0,0 +1,23 @@
package com.helpshift.network;
/* loaded from: classes3.dex */
public abstract class HSBaseNetwork implements HSNetwork {
public HTTPTransport httpTransport;
public String url;
public abstract HSRequest getRequest(HSRequestData hSRequestData);
public String getURL() {
return this.url;
}
public HSBaseNetwork(HTTPTransport hTTPTransport, String str) {
this.httpTransport = hTTPTransport;
this.url = str;
}
@Override // com.helpshift.network.HSNetwork
public HSResponse makeRequest(HSRequestData hSRequestData) {
return this.httpTransport.makeRequest(getRequest(hSRequestData));
}
}

View File

@@ -0,0 +1,304 @@
package com.helpshift.network;
import androidx.webkit.ProxyConfig;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import com.helpshift.log.HSLogger;
import com.helpshift.util.ListUtil;
import com.helpshift.util.Utils;
import com.ironsource.nb;
import com.mbridge.msdk.foundation.download.database.DownloadModel;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.util.List;
import java.util.Map;
import java.util.zip.GZIPInputStream;
import javax.net.ssl.HttpsURLConnection;
import org.json.JSONObject;
/* loaded from: classes3.dex */
public class HSDownloaderNetwork {
public final URLConnectionProvider urlConnectionProvider;
public HSDownloaderNetwork(URLConnectionProvider uRLConnectionProvider) {
this.urlConnectionProvider = uRLConnectionProvider;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r10v0 */
/* JADX WARN: Type inference failed for: r10v13 */
/* JADX WARN: Type inference failed for: r10v18 */
/* JADX WARN: Type inference failed for: r10v2, types: [java.io.Closeable] */
/* JADX WARN: Type inference failed for: r10v7 */
public HSDownloaderResponse downloadResource(String str, Map map, File file) {
String str2;
boolean z;
Exception exc;
String str3;
UnknownHostException unknownHostException;
?? r10;
FileOutputStream fileOutputStream;
boolean z2;
String str4;
String str5;
String str6;
FileOutputStream fileOutputStream2;
str2 = "";
String str7 = nb.N;
JSONObject jSONObject = new JSONObject();
int i = 404;
try {
try {
try {
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(this.urlConnectionProvider.getURL(str).openConnection()));
map.put("Accept-Encoding", "gzip");
for (Map.Entry entry : map.entrySet()) {
try {
httpsURLConnection.setRequestProperty((String) entry.getKey(), (String) entry.getValue());
} catch (UnknownHostException e) {
unknownHostException = e;
str3 = "";
z = false;
fileOutputStream = null;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str + " \n " + unknownHostException.getMessage());
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
} catch (Exception e2) {
exc = e2;
str3 = "";
z = false;
fileOutputStream = null;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str, exc);
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
}
}
i = httpsURLConnection.getResponseCode();
str7 = httpsURLConnection.getContentEncoding();
String contentType = httpsURLConnection.getContentType();
try {
Map<String, List<String>> headerFields = httpsURLConnection.getHeaderFields();
for (Map.Entry<String, List<String>> entry2 : headerFields.entrySet()) {
try {
if (entry2.getKey() != null || entry2.getValue() != null) {
if (entry2.getKey() == null) {
jSONObject.put("", generateHeaderValue(entry2.getValue()));
} else {
jSONObject.put(entry2.getKey(), generateHeaderValue(entry2.getValue()));
if (entry2.getKey().equalsIgnoreCase("Access-Control-Allow-Origin")) {
jSONObject.put(entry2.getKey(), ProxyConfig.MATCH_ALL_SCHEMES);
}
}
}
} catch (UnknownHostException e3) {
unknownHostException = e3;
str3 = str2;
str2 = contentType;
z = false;
fileOutputStream = null;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str + " \n " + unknownHostException.getMessage());
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
} catch (Exception e4) {
exc = e4;
str3 = str2;
str2 = contentType;
z = false;
fileOutputStream = null;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str, exc);
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
}
}
List<String> list = headerFields.get(DownloadModel.ETAG);
str2 = ListUtil.isNotEmpty(list) ? list.get(0) : "";
if (i < 200 || i > 300) {
z = false;
fileOutputStream2 = null;
} else {
InputStream inputStream = httpsURLConnection.getInputStream();
if (Utils.isNotEmpty(str7) && str7.contains("gzip")) {
inputStream = new GZIPInputStream(inputStream);
}
FileOutputStream fileOutputStream3 = new FileOutputStream(file);
try {
try {
byte[] bArr = new byte[8192];
while (true) {
int read = inputStream.read(bArr);
if (read == -1) {
break;
}
z = false;
try {
fileOutputStream3.write(bArr, 0, read);
} catch (UnknownHostException e5) {
e = e5;
fileOutputStream = fileOutputStream3;
unknownHostException = e;
str3 = str2;
str2 = contentType;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str + " \n " + unknownHostException.getMessage());
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
} catch (Exception e6) {
e = e6;
fileOutputStream = fileOutputStream3;
exc = e;
str3 = str2;
str2 = contentType;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str, exc);
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
}
}
z = false;
fileOutputStream2 = fileOutputStream3;
} catch (Throwable th) {
th = th;
r10 = fileOutputStream3;
Utils.closeQuietly(r10);
throw th;
}
} catch (UnknownHostException e7) {
e = e7;
z = false;
} catch (Exception e8) {
e = e8;
z = false;
}
}
if ((i >= 200 && i <= 300) || i == 304) {
try {
HSLogger.d("dwnldrNet", "Successfully downloaded the resource with Url: " + str + " headers: " + map);
z = true;
} catch (UnknownHostException e9) {
unknownHostException = e9;
str3 = str2;
str2 = contentType;
fileOutputStream = fileOutputStream2;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str + " \n " + unknownHostException.getMessage());
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
} catch (Exception e10) {
exc = e10;
str3 = str2;
str2 = contentType;
fileOutputStream = fileOutputStream2;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str, exc);
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
} catch (Throwable th2) {
th = th2;
r10 = fileOutputStream2;
Utils.closeQuietly(r10);
throw th;
}
}
Utils.closeQuietly(fileOutputStream2);
str6 = str2;
z2 = z;
str5 = contentType;
str4 = str7;
} catch (UnknownHostException e11) {
z = false;
unknownHostException = e11;
str3 = str2;
str2 = contentType;
fileOutputStream = null;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str + " \n " + unknownHostException.getMessage());
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
} catch (Exception e12) {
z = false;
exc = e12;
str3 = str2;
str2 = contentType;
fileOutputStream = null;
HSLogger.e("dwnldrNet", "Error downloading resource: " + str, exc);
Utils.closeQuietly(fileOutputStream);
r10 = str3;
str5 = str2;
str4 = str7;
z2 = z;
str6 = r10;
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
}
} catch (Throwable th3) {
th = th3;
}
} catch (Throwable th4) {
th = th4;
r10 = 0;
}
} catch (UnknownHostException e13) {
z = false;
unknownHostException = e13;
str3 = "";
} catch (Exception e14) {
z = false;
exc = e14;
str3 = "";
}
return new HSDownloaderResponse(i, jSONObject, str6, str5, str4, z2);
}
public static String generateHeaderValue(List list) {
if (ListUtil.isEmpty(list)) {
return "";
}
StringBuilder sb = new StringBuilder((String) list.get(0));
for (int i = 1; i < list.size(); i++) {
sb.append(";");
sb.append((String) list.get(i));
}
return sb.toString();
}
}

View File

@@ -0,0 +1,22 @@
package com.helpshift.network;
import org.json.JSONObject;
/* loaded from: classes3.dex */
public class HSDownloaderResponse {
public final String encoding;
public final String etag;
public final JSONObject headers;
public final boolean isSuccess;
public final String mimetype;
public final int status;
public HSDownloaderResponse(int i, JSONObject jSONObject, String str, String str2, String str3, boolean z) {
this.status = i;
this.headers = jSONObject;
this.etag = str;
this.mimetype = str2;
this.encoding = str3;
this.isSuccess = z;
}
}

View File

@@ -0,0 +1,73 @@
package com.helpshift.network;
import com.helpshift.util.Utils;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.net.ssl.HttpsURLConnection;
/* loaded from: classes3.dex */
public class HSHttpTransport implements HTTPTransport {
public final void closeHelpshiftSSLSocketFactorySockets(HttpsURLConnection httpsURLConnection) {
}
public final void fixSSLSocketProtocols(HttpsURLConnection httpsURLConnection) {
}
/* JADX WARN: Not initialized variable reg: 11, insn: 0x03d6: MOVE (r5 I:??[OBJECT, ARRAY]) = (r11 I:??[OBJECT, ARRAY]), block:B:305:0x03d4 */
/* JADX WARN: Not initialized variable reg: 5, insn: 0x03d5: MOVE (r6 I:??[OBJECT, ARRAY]) = (r5 I:??[OBJECT, ARRAY]), block:B:305:0x03d4 */
/* JADX WARN: Removed duplicated region for block: B:58:0x0487 A[Catch: Exception -> 0x048b, TRY_LEAVE, TryCatch #24 {Exception -> 0x048b, blocks: (B:56:0x0482, B:58:0x0487), top: B:55:0x0482 }] */
/* JADX WARN: Removed duplicated region for block: B:61:? A[SYNTHETIC] */
@Override // com.helpshift.network.HTTPTransport
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public com.helpshift.network.HSResponse makeRequest(com.helpshift.network.HSRequest r20) {
/*
Method dump skipped, instructions count: 1169
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.helpshift.network.HSHttpTransport.makeRequest(com.helpshift.network.HSRequest):com.helpshift.network.HSResponse");
}
public final String readStream(InputStream inputStream) {
InputStreamReader inputStreamReader;
Throwable th;
BufferedReader bufferedReader;
if (inputStream == null) {
return null;
}
StringBuilder sb = new StringBuilder();
try {
inputStreamReader = new InputStreamReader(inputStream);
try {
bufferedReader = new BufferedReader(inputStreamReader);
while (true) {
try {
String readLine = bufferedReader.readLine();
if (readLine != null) {
sb.append(readLine);
} else {
Utils.closeQuietly(bufferedReader);
Utils.closeQuietly(inputStreamReader);
return sb.toString();
}
} catch (Throwable th2) {
th = th2;
Utils.closeQuietly(bufferedReader);
Utils.closeQuietly(inputStreamReader);
throw th;
}
}
} catch (Throwable th3) {
th = th3;
bufferedReader = null;
}
} catch (Throwable th4) {
inputStreamReader = null;
th = th4;
bufferedReader = null;
}
}
}

View File

@@ -0,0 +1,6 @@
package com.helpshift.network;
/* loaded from: classes3.dex */
public interface HSNetwork {
HSResponse makeRequest(HSRequestData hSRequestData);
}

View File

@@ -0,0 +1,45 @@
package com.helpshift.network;
import java.util.Map;
/* loaded from: classes3.dex */
public class HSRequest {
public final String body;
public final Map headers;
public final Method method;
public final int timeout;
public final String url;
public enum Method {
POST,
GET
}
public String getBody() {
return this.body;
}
public Map getHeaders() {
return this.headers;
}
public Method getMethod() {
return this.method;
}
public int getTimeout() {
return this.timeout;
}
public String getUrl() {
return this.url;
}
public HSRequest(Method method, String str, Map map, String str2, int i) {
this.method = method;
this.url = str;
this.headers = map;
this.body = str2;
this.timeout = i;
}
}

View File

@@ -0,0 +1,14 @@
package com.helpshift.network;
import java.util.Map;
/* loaded from: classes3.dex */
public class HSRequestData {
public final Map body;
public final Map headers;
public HSRequestData(Map map, Map map2) {
this.headers = map;
this.body = map2;
}
}

View File

@@ -0,0 +1,33 @@
package com.helpshift.network;
import java.util.Map;
/* loaded from: classes3.dex */
public class HSResponse {
public final Map headers;
public final String responseString;
public final int status;
public interface NetworkResponseCodes {
public static final Integer OK = 200;
public static final Integer CONTENT_UNCHANGED = 304;
public static final Integer OBJECT_NOT_FOUND = 400;
public static final Integer UNAUTHORIZED_ACCESS = 401;
public static final Integer AUTH_TOKEN_NOT_PROVIDED = 441;
public static final Integer INVALID_AUTH_TOKEN = 443;
}
public String getResponseString() {
return this.responseString;
}
public int getStatus() {
return this.status;
}
public HSResponse(int i, String str, Map map) {
this.status = i;
this.responseString = str;
this.headers = map;
}
}

View File

@@ -0,0 +1,6 @@
package com.helpshift.network;
/* loaded from: classes3.dex */
public interface HTTPTransport {
HSResponse makeRequest(HSRequest hSRequest);
}

View File

@@ -0,0 +1,16 @@
package com.helpshift.network;
import com.facebook.internal.security.CertificateUtil;
import com.helpshift.platform.Device;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes3.dex */
public abstract class NetworkConstants {
public static Map buildHeaderMap(Device device, String str) {
HashMap hashMap = new HashMap();
hashMap.put("Authorization", "Basic " + device.encodeBase64(str + CertificateUtil.DELIMITER));
hashMap.put("Accept", "application/vnd+hsapi-v2+json");
return hashMap;
}
}

View File

@@ -0,0 +1,47 @@
package com.helpshift.network;
import com.helpshift.network.HSRequest;
import com.helpshift.network.exception.HSRootApiException;
import com.helpshift.network.exception.NetworkException;
import com.helpshift.util.Utils;
import com.ironsource.v8;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes3.dex */
public class POSTNetwork extends HSBaseNetwork implements HSNetwork {
public POSTNetwork(HTTPTransport hTTPTransport, String str) {
super(hTTPTransport, str);
}
@Override // com.helpshift.network.HSBaseNetwork
public HSRequest getRequest(HSRequestData hSRequestData) {
return new HSRequest(HSRequest.Method.POST, getURL(), hSRequestData.headers, getBody(cleanData(hSRequestData.body)), 5000);
}
public final String getBody(Map map) {
ArrayList arrayList = new ArrayList();
for (Map.Entry entry : map.entrySet()) {
try {
arrayList.add(URLEncoder.encode((String) entry.getKey(), "UTF-8") + v8.i.b + URLEncoder.encode((String) entry.getValue(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw HSRootApiException.wrap(e, NetworkException.UNSUPPORTED_ENCODING_EXCEPTION);
}
}
return Utils.join(v8.i.c, arrayList);
}
public static Map cleanData(Map map) {
String str;
HashMap hashMap = new HashMap();
for (String str2 : map.keySet()) {
if (str2 != null && (str = (String) map.get(str2)) != null) {
hashMap.put(str2, str);
}
}
return hashMap;
}
}

View File

@@ -0,0 +1,10 @@
package com.helpshift.network;
import java.net.URL;
/* loaded from: classes3.dex */
public class URLConnectionProvider {
public URL getURL(String str) {
return new URL(str);
}
}

View File

@@ -0,0 +1,39 @@
package com.helpshift.network.exception;
/* loaded from: classes3.dex */
public class HSRootApiException extends RuntimeException {
public final String errorMessage;
public final Exception exception;
public final ExceptionType exceptionType;
public interface ExceptionType {
}
public HSRootApiException(Exception exc, ExceptionType exceptionType, String str) {
super(str, exc);
this.exception = exc;
this.exceptionType = exceptionType;
this.errorMessage = str;
}
public static HSRootApiException wrap(Exception exc, ExceptionType exceptionType) {
return wrap(exc, exceptionType, null);
}
public static HSRootApiException wrap(Exception exc, ExceptionType exceptionType, String str) {
if (exc instanceof HSRootApiException) {
HSRootApiException hSRootApiException = (HSRootApiException) exc;
Exception exc2 = hSRootApiException.exception;
if (exceptionType == null) {
exceptionType = hSRootApiException.exceptionType;
}
if (str == null) {
str = hSRootApiException.errorMessage;
}
exc = exc2;
} else if (exceptionType == null) {
exceptionType = UnexpectedException.GENERIC;
}
return new HSRootApiException(exc, exceptionType, str);
}
}

View File

@@ -0,0 +1,19 @@
package com.helpshift.network.exception;
import com.helpshift.network.exception.HSRootApiException;
/* loaded from: classes3.dex */
public enum NetworkException implements HSRootApiException.ExceptionType {
GENERIC,
NO_CONNECTION,
UNKNOWN_HOST,
SSL_PEER_UNVERIFIED,
SSL_HANDSHAKE,
TIMESTAMP_CORRECTION_RETRIES_EXHAUSTED,
UNSUPPORTED_ENCODING_EXCEPTION,
AUTH_TOKEN_NOT_PROVIDED,
INVALID_AUTH_TOKEN;
public String route;
public int serverStatusCode;
}

View File

@@ -0,0 +1,8 @@
package com.helpshift.network.exception;
import com.helpshift.network.exception.HSRootApiException;
/* loaded from: classes3.dex */
public enum UnexpectedException implements HSRootApiException.ExceptionType {
GENERIC
}