Files
rr3-apk/decompiled-community/sources/androidx/core/telephony/TelephonyManagerCompat.java
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- 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
2026-02-18 15:48:36 -08:00

85 lines
2.7 KiB
Java

package androidx.core.telephony;
import android.annotation.SuppressLint;
import android.os.Build;
import android.telephony.TelephonyManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RequiresPermission;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public class TelephonyManagerCompat {
private static Method sGetDeviceIdMethod;
private static Method sGetSubIdMethod;
@Nullable
@RequiresPermission("android.permission.READ_PHONE_STATE")
@SuppressLint({"MissingPermission"})
public static String getImei(@NonNull TelephonyManager telephonyManager) {
return Api26Impl.getImei(telephonyManager);
}
@SuppressLint({"SoonBlockedPrivateApi"})
public static int getSubscriptionId(@NonNull TelephonyManager telephonyManager) {
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.getSubscriptionId(telephonyManager);
}
try {
if (sGetSubIdMethod == null) {
Method declaredMethod = TelephonyManager.class.getDeclaredMethod("getSubId", new Class[0]);
sGetSubIdMethod = declaredMethod;
declaredMethod.setAccessible(true);
}
Integer num = (Integer) sGetSubIdMethod.invoke(telephonyManager, new Object[0]);
if (num == null || num.intValue() == -1) {
return Integer.MAX_VALUE;
}
return num.intValue();
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
return Integer.MAX_VALUE;
}
}
private TelephonyManagerCompat() {
}
@RequiresApi(30)
public static class Api30Impl {
private Api30Impl() {
}
public static int getSubscriptionId(TelephonyManager telephonyManager) {
return telephonyManager.getSubscriptionId();
}
}
@RequiresApi(26)
public static class Api26Impl {
private Api26Impl() {
}
@Nullable
@RequiresPermission("android.permission.READ_PHONE_STATE")
@SuppressLint({"MissingPermission"})
public static String getImei(TelephonyManager telephonyManager) {
return telephonyManager.getImei();
}
}
@RequiresApi(23)
public static class Api23Impl {
private Api23Impl() {
}
@Nullable
@RequiresPermission("android.permission.READ_PHONE_STATE")
@SuppressLint({"MissingPermission"})
public static String getDeviceId(TelephonyManager telephonyManager, int i) {
return telephonyManager.getDeviceId(i);
}
}
}