- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
115 lines
3.7 KiB
Java
115 lines
3.7 KiB
Java
package com.ironsource;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.net.ConnectivityManager;
|
|
import android.net.LinkProperties;
|
|
import android.net.Network;
|
|
import android.net.NetworkCapabilities;
|
|
import android.net.NetworkRequest;
|
|
import android.os.Build;
|
|
import android.util.Log;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class bm implements yd {
|
|
private String a = bm.class.getSimpleName();
|
|
private int b = 23;
|
|
private final zd c;
|
|
private ConnectivityManager.NetworkCallback d;
|
|
|
|
public class a extends ConnectivityManager.NetworkCallback {
|
|
final /* synthetic */ Context a;
|
|
|
|
public a(Context context) {
|
|
this.a = context;
|
|
}
|
|
|
|
@Override // android.net.ConnectivityManager.NetworkCallback
|
|
public void onAvailable(Network network) {
|
|
if (network != null) {
|
|
bm.this.c.a(s8.a(network, this.a), s8.a(this.a, network));
|
|
return;
|
|
}
|
|
zd zdVar = bm.this.c;
|
|
String b = s8.b(this.a);
|
|
Context context = this.a;
|
|
zdVar.a(b, s8.a(context, s8.a(context)));
|
|
}
|
|
|
|
@Override // android.net.ConnectivityManager.NetworkCallback
|
|
public void onCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities) {
|
|
if (network != null) {
|
|
bm.this.c.b(s8.a(network, this.a), s8.a(this.a, network));
|
|
}
|
|
}
|
|
|
|
@Override // android.net.ConnectivityManager.NetworkCallback
|
|
public void onLinkPropertiesChanged(Network network, LinkProperties linkProperties) {
|
|
if (network != null) {
|
|
bm.this.c.b(s8.a(network, this.a), s8.a(this.a, network));
|
|
}
|
|
}
|
|
|
|
@Override // android.net.ConnectivityManager.NetworkCallback
|
|
public void onLost(Network network) {
|
|
if (s8.b(this.a).equals("none")) {
|
|
bm.this.c.a();
|
|
}
|
|
}
|
|
}
|
|
|
|
public bm(zd zdVar) {
|
|
this.c = zdVar;
|
|
}
|
|
|
|
@Override // com.ironsource.yd
|
|
public void a() {
|
|
this.d = null;
|
|
}
|
|
|
|
@Override // com.ironsource.yd
|
|
@SuppressLint({"NewApi"})
|
|
public void a(Context context) {
|
|
ConnectivityManager connectivityManager;
|
|
if (Build.VERSION.SDK_INT < this.b || this.d == null || context == null || (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) == null) {
|
|
return;
|
|
}
|
|
try {
|
|
connectivityManager.unregisterNetworkCallback(this.d);
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
Log.e(this.a, "NetworkCallback for was not registered or already unregistered");
|
|
}
|
|
}
|
|
|
|
@Override // com.ironsource.yd
|
|
@SuppressLint({"NewApi", "MissingPermission"})
|
|
public void b(Context context) {
|
|
if (Build.VERSION.SDK_INT >= this.b) {
|
|
a(context);
|
|
if (s8.b(context).equals("none")) {
|
|
this.c.a();
|
|
}
|
|
if (this.d == null) {
|
|
this.d = new a(context);
|
|
}
|
|
NetworkRequest build = new NetworkRequest.Builder().addCapability(12).build();
|
|
try {
|
|
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
|
|
if (connectivityManager != null) {
|
|
connectivityManager.registerNetworkCallback(build, this.d);
|
|
}
|
|
} catch (Exception e) {
|
|
i9.d().a(e);
|
|
Log.e(this.a, "NetworkCallback was not able to register");
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.ironsource.yd
|
|
public JSONObject c(Context context) {
|
|
return s8.a(context, s8.a(context));
|
|
}
|
|
}
|