- 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
50 lines
2.0 KiB
Java
50 lines
2.0 KiB
Java
package com.firemonkeys.cloudcellapi;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.net.ConnectivityManager;
|
|
import android.net.NetworkInfo;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class NetworkStatusMonitor extends BroadcastReceiver {
|
|
private static final String CLASSNAME = "NetworkStatusMonitor";
|
|
public static final int CONNECTION_TYPE_CARRIER = 4;
|
|
public static final int CONNECTION_TYPE_ETHERNET = 6;
|
|
public static final int CONNECTION_TYPE_NONE = 1;
|
|
public static final int CONNECTION_TYPE_TRANSIENT_CARRIER = 5;
|
|
public static final int CONNECTION_TYPE_TRANSIENT_WIFI = 3;
|
|
public static final int CONNECTION_TYPE_UNKNOWN = 0;
|
|
public static final int CONNECTION_TYPE_WIFI = 2;
|
|
public static final int NUM_CONNECTION_TYPE = 7;
|
|
|
|
public static native void ReachabilityCallbackJNI(int i);
|
|
|
|
@Override // android.content.BroadcastReceiver
|
|
public void onReceive(Context context, Intent intent) {
|
|
try {
|
|
ReachabilityCallbackJNI(getNetworkConnectivity(context));
|
|
} catch (UnsatisfiedLinkError unused) {
|
|
}
|
|
}
|
|
|
|
public static int getNetworkConnectivity(Context context) {
|
|
NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
|
|
if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) {
|
|
int type = activeNetworkInfo.getType();
|
|
if (type == 1) {
|
|
Logging.CC_TRACE(CLASSNAME, "getNetworkConnectivity() - CONNECTION_TYPE_WIFI");
|
|
return 2;
|
|
}
|
|
if (type == 9) {
|
|
Logging.CC_TRACE(CLASSNAME, "getNetworkConnectivity() - CONNECTION_TYPE_ETHERNET");
|
|
return 6;
|
|
}
|
|
Logging.CC_TRACE(CLASSNAME, "getNetworkConnectivity() - CONNECTION_TYPE_CARRIER");
|
|
return 4;
|
|
}
|
|
Logging.CC_TRACE(CLASSNAME, "getNetworkConnectivity() - CONNECTION_TYPE_NONE");
|
|
return 1;
|
|
}
|
|
}
|