热门
join now

IAPP检测模拟器环境检测 V5.0

编程相关3周前更新 云程
11 0 0

原理:检测光传感器,由于光传感器模拟器不容易伪造 在这里判断设备是否存在光传感器来判断是否为模拟器

java文件内代码

package com.i628fa2dd2abd558d;
import java.lang.*;
import com.i628fa2dd2abd558d.R;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Build;
import java.util.List;
public class JAVA文件名 {
public static boolean checkEmulatorSensor(Context context) {
boolean isSupportSensor = false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
List sensorList = sensorManager.getSensorList(Sensor.TYPE_ALL);
if (sensorList != null && sensorList.size() > 0) {
isSupportSensor = true;
}
}
return isSupportSensor;
}
}

调用测试:
java{
boolean isSensorSupported = JAVA文件名.checkEmulatorSensor(this);
gj.sc(isSensorSupported)
}

返回true则是支持光传感 反之返回false则是不支持 就是模拟器环境

#IAPP V5 技术 源码 交流分享#

欢迎大佬萌新们来交流分享[滑稽][玫瑰][玫瑰]

IAPP检测模拟器环境检测 V5.0

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...