Habilidades de detección del emulador

1. Técnicas de detección de emuladores de dispositivos comunes

1.1 Arquitectura de detección y procesamiento

private static boolean isEmulatorFromAbi(){
    String abi = PropertiesGet.getString("ro.product.cpu.abi");
    return !TextUtils.isEmpty(abi) && abi.contains("x86");
}

1.2 Conjunto de herramientas de productos de detección

public static boolean isEmulatorViaBuild(Context context){
    String model = PropertiesGet.getString("ro.product.model")
    if(!TextUtils.isEmpty(model) && model.toLowerCase().contains("sdk"))
        return true;

    String manufacture = PropertiesGet.getString("ro.product.manufactuer")
    if(!TextUtils.isEmpty(manufacture) && manufacture.toLowerCase().contains("unknown"))
        return true;

    String device = PropertiesGet.getString("ro.product.device")
    if(!TextUtils.isEmpty(device) && device.toLowerCase().contains("generic"))
        return true;

Supongo que te gusta

Origin blog.csdn.net/MusicDancing/article/details/132432549
Recomendado
Clasificación