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,18 @@
package csdk.glucentralservices.network;
import csdk.glucentralservices.network.Downloader;
/* loaded from: classes4.dex */
public class DownloadInfo {
public final String destinationPath;
public final long downloadID;
public final Downloader.DownloadListener listener;
public final String sourcePath;
public DownloadInfo(long j, String str, String str2, Downloader.DownloadListener downloadListener) {
this.downloadID = j;
this.sourcePath = str;
this.destinationPath = str2;
this.listener = downloadListener;
}
}

View File

@@ -0,0 +1,226 @@
package csdk.glucentralservices.network;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.net.Uri;
import android.text.TextUtils;
import com.facebook.share.internal.ShareConstants;
import com.vungle.ads.internal.presenter.NativeAdPresenter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/* loaded from: classes4.dex */
public class Downloader {
private final Context mContext;
private final Map<Long, DownloadInfo> mDownloadInfoMap = new ConcurrentHashMap();
private final DownloadManager mDownloadManager;
private BroadcastReceiver mReceiver;
public interface DownloadListener {
void onDownloadComplete(boolean z, DownloadInfo downloadInfo);
}
public Downloader(Context context) {
this.mContext = context;
this.mDownloadManager = (DownloadManager) context.getSystemService(NativeAdPresenter.DOWNLOAD);
}
public void init() {
this.mReceiver = new DownloadReceiver();
this.mContext.registerReceiver(this.mReceiver, new IntentFilter("android.intent.action.DOWNLOAD_COMPLETE"), 2);
}
public void destroy() {
BroadcastReceiver broadcastReceiver = this.mReceiver;
if (broadcastReceiver != null) {
this.mContext.unregisterReceiver(broadcastReceiver);
}
}
public void download(String str, String str2, DownloadListener downloadListener) {
long downloadID = getDownloadID(Uri.parse(str));
DownloadInfo downloadInfo = new DownloadInfo(downloadID, str, str2, downloadListener);
if (downloadID >= 0) {
int downloadStatus = downloadStatus(downloadID);
if (downloadStatus == 8) {
boolean copyToDestination = copyToDestination(downloadInfo);
deleteDownload(downloadID);
if (copyToDestination) {
onDownloadComplete(true, downloadInfo);
return;
}
} else if (downloadStatus == 1 || downloadStatus == 2) {
return;
}
}
if (startDownload(downloadInfo)) {
return;
}
onDownloadComplete(false, downloadInfo);
}
/* JADX INFO: Access modifiers changed from: private */
public static void onDownloadComplete(boolean z, DownloadInfo downloadInfo) throws SecurityException {
DownloadListener downloadListener = downloadInfo.listener;
if (downloadListener != null) {
downloadListener.onDownloadComplete(z, downloadInfo);
}
}
/* JADX INFO: Access modifiers changed from: private */
public boolean copyToDestination(DownloadInfo downloadInfo) {
String str;
InputStream fileInputStream;
Cursor query = this.mDownloadManager.query(new DownloadManager.Query().setFilterById(downloadInfo.downloadID));
if (query == null) {
return false;
}
try {
if (!query.moveToFirst()) {
return false;
}
Uri parse = Uri.parse(query.getString(query.getColumnIndex("local_uri")));
InputStream inputStream = null;
try {
str = query.getString(query.getColumnIndex("local_filename"));
} catch (Exception unused) {
str = null;
}
query.close();
try {
try {
fileInputStream = this.mContext.getContentResolver().openInputStream(parse);
} catch (SecurityException unused2) {
fileInputStream = new FileInputStream(str);
}
inputStream = fileInputStream;
new File(downloadInfo.destinationPath).getParentFile().mkdirs();
NetworkUtils.copyIntoFile(inputStream, new File(downloadInfo.destinationPath));
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException unused3) {
}
}
return true;
} catch (IOException unused4) {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException unused5) {
}
}
return false;
} catch (Exception unused6) {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException unused7) {
}
}
return false;
} catch (Throwable th) {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException unused8) {
}
}
throw th;
}
} finally {
query.close();
}
}
private boolean startDownload(DownloadInfo downloadInfo) {
try {
long enqueue = this.mDownloadManager.enqueue(new DownloadManager.Request(Uri.parse(downloadInfo.sourcePath)).setVisibleInDownloadsUi(false));
this.mDownloadInfoMap.put(Long.valueOf(enqueue), new DownloadInfo(enqueue, downloadInfo.sourcePath, downloadInfo.destinationPath, downloadInfo.listener));
return true;
} catch (IllegalArgumentException unused) {
return false;
}
}
private long getDownloadID(Uri uri) {
Cursor query = this.mDownloadManager.query(new DownloadManager.Query());
long j = -1;
if (query == null) {
return -1L;
}
try {
if (query.moveToFirst()) {
String uri2 = uri.toString();
int columnIndex = query.getColumnIndex(ShareConstants.MEDIA_URI);
int columnIndex2 = query.getColumnIndex("_id");
do {
if (TextUtils.equals(uri2, query.getString(columnIndex))) {
j = Math.max(query.getLong(columnIndex2), j);
}
} while (query.moveToNext());
query.close();
return j;
}
query.close();
return -1L;
} catch (Throwable th) {
query.close();
throw th;
}
}
/* JADX INFO: Access modifiers changed from: private */
public int downloadStatus(long j) {
Cursor query = this.mDownloadManager.query(new DownloadManager.Query().setFilterById(j));
if (query == null) {
return 16;
}
try {
if (query.moveToFirst()) {
return query.getInt(query.getColumnIndex("status"));
}
return 16;
} finally {
query.close();
}
}
/* JADX INFO: Access modifiers changed from: private */
public void deleteDownload(long j) {
this.mDownloadManager.remove(j);
}
public class DownloadReceiver extends BroadcastReceiver {
public DownloadReceiver() {
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
DownloadInfo downloadInfo;
boolean z;
if (TextUtils.equals(intent.getAction(), "android.intent.action.DOWNLOAD_COMPLETE")) {
long longExtra = intent.getLongExtra("extra_download_id", -1L);
if (longExtra >= 0 && (downloadInfo = (DownloadInfo) Downloader.this.mDownloadInfoMap.remove(Long.valueOf(longExtra))) != null) {
if (Downloader.this.downloadStatus(longExtra) == 8) {
z = Downloader.this.copyToDestination(downloadInfo);
if (z) {
Downloader.this.deleteDownload(longExtra);
}
} else {
z = false;
}
Downloader.onDownloadComplete(z, downloadInfo);
}
}
}
}
}

View File

@@ -0,0 +1,108 @@
package csdk.glucentralservices.network;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
/* loaded from: classes4.dex */
public class GluTLS12SocketFactory extends SSLSocketFactory {
private final SSLSocketFactory delegate;
private static final Object contextLock = new Object();
private static final String[] SUPPORTED_PROTOCOLS = {"TLSv1.2"};
private static SSLContext sslContext = null;
@Nullable
public static GluTLS12SocketFactory createGluTLS12SocketFactory(@Nullable SSLContext sSLContext) {
return null;
}
public static void fixTLSPre21(@NonNull HttpsURLConnection httpsURLConnection, @Nullable GluTLS12SocketFactory gluTLS12SocketFactory) {
}
@Nullable
public static GluTLS12SocketFactory createGluTLS12SocketFactory() {
return createGluTLS12SocketFactory(null);
}
public static void fixTLSPre21(@NonNull HttpsURLConnection httpsURLConnection) {
fixTLSPre21(httpsURLConnection, createGluTLS12SocketFactory());
}
private GluTLS12SocketFactory(@Nullable SSLContext sSLContext) throws KeyManagementException, NoSuchAlgorithmException {
if (sSLContext != null) {
this.delegate = sSLContext.getSocketFactory();
return;
}
synchronized (contextLock) {
try {
if (sslContext == null) {
SSLContext sSLContext2 = SSLContext.getInstance("TLS");
sslContext = sSLContext2;
sSLContext2.init(null, null, null);
}
} catch (Throwable th) {
throw th;
}
}
this.delegate = sslContext.getSocketFactory();
}
@Override // javax.net.ssl.SSLSocketFactory
public String[] getDefaultCipherSuites() {
return this.delegate.getDefaultCipherSuites();
}
@Override // javax.net.ssl.SSLSocketFactory
public String[] getSupportedCipherSuites() {
return this.delegate.getSupportedCipherSuites();
}
@Override // javax.net.SocketFactory
public Socket createSocket() throws IOException {
return updateTLSProtocols((SSLSocket) this.delegate.createSocket());
}
@Override // javax.net.ssl.SSLSocketFactory
public Socket createSocket(Socket socket, String str, int i, boolean z) throws IOException {
return updateTLSProtocols((SSLSocket) this.delegate.createSocket(socket, str, i, z));
}
@Override // javax.net.SocketFactory
public Socket createSocket(String str, int i) throws IOException, UnknownHostException {
return updateTLSProtocols((SSLSocket) this.delegate.createSocket(str, i));
}
@Override // javax.net.SocketFactory
public Socket createSocket(String str, int i, InetAddress inetAddress, int i2) throws IOException, UnknownHostException {
return updateTLSProtocols((SSLSocket) this.delegate.createSocket(str, i, inetAddress, i2));
}
@Override // javax.net.SocketFactory
public Socket createSocket(InetAddress inetAddress, int i) throws IOException {
return updateTLSProtocols((SSLSocket) this.delegate.createSocket(inetAddress, i));
}
@Override // javax.net.SocketFactory
public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress2, int i2) throws IOException {
return updateTLSProtocols((SSLSocket) this.delegate.createSocket(inetAddress, i, inetAddress2, i2));
}
private Socket updateTLSProtocols(Socket socket) {
if (socket instanceof SSLSocket) {
try {
((SSLSocket) socket).setEnabledProtocols(SUPPORTED_PROTOCOLS);
} catch (Exception unused) {
}
}
return socket;
}
}

View File

@@ -0,0 +1,29 @@
package csdk.glucentralservices.network;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/* loaded from: classes4.dex */
public class NetworkResponse {
public final byte[] body;
public final int code;
public final Exception exception;
public Map<String, String> responseHeaders;
public NetworkResponse(int i, byte[] bArr, Map<String, List<String>> map, Exception exc) {
this.code = i;
this.body = bArr;
this.exception = exc;
this.responseHeaders = null;
if (map != null) {
this.responseHeaders = new HashMap();
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
String key = entry.getKey();
if (key != null && entry.getValue() != null && entry.getValue().size() > 0) {
this.responseHeaders.put(key, entry.getValue().get(0));
}
}
}
}
}

View File

@@ -0,0 +1,243 @@
package csdk.glucentralservices.network;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Collections;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLHandshakeException;
import org.apache.http.client.methods.HttpPut;
/* loaded from: classes4.dex */
public class NetworkUtils {
private static final int REQUEST_TIME_OUT_MS = 3000;
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v0 */
/* JADX WARN: Type inference failed for: r1v1 */
/* JADX WARN: Type inference failed for: r1v2, types: [java.io.Closeable] */
/* JADX WARN: Type inference failed for: r1v3 */
/* JADX WARN: Type inference failed for: r3v1 */
/* JADX WARN: Type inference failed for: r3v4, types: [java.net.HttpURLConnection] */
/* JADX WARN: Type inference failed for: r3v8 */
/* JADX WARN: Type inference failed for: r3v9 */
public static NetworkResponse sendRequest(String str, URL url, Map<String, String> map, String str2, long j) {
?? r3;
HttpsURLConnection httpsURLConnection;
InputStream inputStream;
?? r1 = 0;
r1 = 0;
try {
try {
httpsURLConnection = openConnection(str, url, map, str2, j);
} catch (Throwable th) {
th = th;
r1 = map;
r3 = str;
}
try {
int responseCode = httpsURLConnection.getResponseCode();
inputStream = responseCode >= 400 ? httpsURLConnection.getErrorStream() : httpsURLConnection.getInputStream();
try {
NetworkResponse networkResponse = new NetworkResponse(responseCode, readAsByteArrayAndClose(inputStream), httpsURLConnection.getHeaderFields(), null);
close(inputStream);
httpsURLConnection.disconnect();
return networkResponse;
} catch (SSLHandshakeException e) {
e = e;
PrintStream printStream = System.out;
printStream.println("SSLHandshakeException occurred: " + e.getMessage());
Throwable cause = e.getCause();
if (cause != null) {
printStream.println("Cause: " + cause.getMessage());
}
e.printStackTrace();
NetworkResponse networkResponse2 = new NetworkResponse(-1, null, null, e);
close(inputStream);
if (httpsURLConnection != null) {
httpsURLConnection.disconnect();
}
return networkResponse2;
} catch (Exception e2) {
e = e2;
System.out.println("Exception type: " + e.getClass());
NetworkResponse networkResponse3 = new NetworkResponse(-1, null, null, e);
close(inputStream);
if (httpsURLConnection != null) {
httpsURLConnection.disconnect();
}
return networkResponse3;
}
} catch (SSLHandshakeException e3) {
e = e3;
inputStream = null;
} catch (Exception e4) {
e = e4;
inputStream = null;
} catch (Throwable th2) {
th = th2;
r3 = httpsURLConnection;
close(r1);
if (r3 != 0) {
r3.disconnect();
}
throw th;
}
} catch (SSLHandshakeException e5) {
e = e5;
httpsURLConnection = null;
inputStream = null;
} catch (Exception e6) {
e = e6;
httpsURLConnection = null;
inputStream = null;
} catch (Throwable th3) {
th = th3;
r3 = 0;
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Not initialized variable reg: 10, insn: 0x002f: MOVE (r0 I:??[OBJECT, ARRAY]) = (r10 I:??[OBJECT, ARRAY]), block:B:35:0x002f */
/* JADX WARN: Type inference failed for: r7v0, types: [java.net.URL] */
/* JADX WARN: Type inference failed for: r7v1 */
/* JADX WARN: Type inference failed for: r7v2 */
/* JADX WARN: Type inference failed for: r7v3, types: [java.net.HttpURLConnection] */
/* JADX WARN: Type inference failed for: r7v4, types: [java.net.HttpURLConnection] */
/* JADX WARN: Type inference failed for: r7v5, types: [java.net.HttpURLConnection, java.net.URLConnection, javax.net.ssl.HttpsURLConnection] */
public static NetworkResponse downloadIntoFile(URL url, File file, long j) {
InputStream inputStream;
Closeable closeable;
Closeable closeable2 = null;
try {
try {
url = openConnection("GET", url, Collections.emptyMap(), null, j);
} catch (Throwable th) {
th = th;
closeable2 = closeable;
}
try {
int responseCode = url.getResponseCode();
if (responseCode >= 200 && responseCode < 300) {
inputStream = url.getInputStream();
try {
copyIntoFile(inputStream, file);
NetworkResponse networkResponse = new NetworkResponse(responseCode, null, null, null);
close(inputStream);
url.disconnect();
return networkResponse;
} catch (Exception e) {
e = e;
NetworkResponse networkResponse2 = new NetworkResponse(-1, null, null, e);
close(inputStream);
if (url != 0) {
url.disconnect();
}
return networkResponse2;
}
}
NetworkResponse networkResponse3 = new NetworkResponse(responseCode, null, null, null);
close(null);
url.disconnect();
return networkResponse3;
} catch (Exception e2) {
e = e2;
inputStream = null;
} catch (Throwable th2) {
th = th2;
close(closeable2);
if (url != 0) {
url.disconnect();
}
throw th;
}
} catch (Exception e3) {
e = e3;
url = 0;
inputStream = null;
} catch (Throwable th3) {
th = th3;
url = 0;
}
}
public static void copyData(@NonNull InputStream inputStream, @NonNull OutputStream outputStream) throws IOException {
byte[] bArr = new byte[16384];
while (true) {
int read = inputStream.read(bArr);
if (read < 0) {
return;
} else {
outputStream.write(bArr, 0, read);
}
}
}
public static void copyIntoFile(@NonNull InputStream inputStream, @NonNull File file) throws IOException {
FileOutputStream fileOutputStream = new FileOutputStream(file);
try {
copyData(inputStream, fileOutputStream);
} finally {
fileOutputStream.close();
}
}
private static HttpsURLConnection openConnection(String str, URL url, Map<String, String> map, String str2, long j) throws IOException {
boolean z = TextUtils.equals(str, "POST") || TextUtils.equals(str, HttpPut.METHOD_NAME);
HttpsURLConnection httpsURLConnection = (HttpsURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url.openConnection()));
GluTLS12SocketFactory.fixTLSPre21(httpsURLConnection);
httpsURLConnection.setRequestMethod(str);
for (Map.Entry<String, String> entry : map.entrySet()) {
httpsURLConnection.setRequestProperty(entry.getKey(), entry.getValue());
}
httpsURLConnection.setAllowUserInteraction(false);
httpsURLConnection.setConnectTimeout(3000);
httpsURLConnection.setReadTimeout((int) j);
httpsURLConnection.setUseCaches(false);
if (z) {
httpsURLConnection.setDoOutput(true);
httpsURLConnection.connect();
OutputStream outputStream = httpsURLConnection.getOutputStream();
try {
outputStream.write(str2.getBytes("UTF-8"));
} finally {
outputStream.close();
}
} else {
httpsURLConnection.connect();
}
return httpsURLConnection;
}
private static byte[] readAsByteArrayAndClose(InputStream inputStream) throws IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
copyData(inputStream, byteArrayOutputStream);
return byteArrayOutputStream.toByteArray();
} finally {
byteArrayOutputStream.close();
}
}
private static void close(@Nullable Closeable closeable) {
if (closeable == null) {
return;
}
try {
closeable.close();
} catch (IOException unused) {
}
}
}