lamster2018 / easyprotector Goto Github PK
View Code? Open in Web Editor NEW一行代码检测XP/调试/多开/模拟器/root
License: Apache License 2.0
一行代码检测XP/调试/多开/模拟器/root
License: Apache License 2.0
夜神511
ceshi start||aosp_shamu-user|universal8895|msm8084|2:cpu:/
1:cpuacct:/uid_10031/pid_3267
|end
夜神712
ceshi start||dream2qltezh-user|msm8998|msm8998|2:cpu:/
1:cpuacct:/uid_10037/pid_3573
|end
天天601
emulatorInfo:ceshi start||hlteatt-userdebug|DUK-AL20|Hi6210sft|2:cpu:/
1:cpuacct:/uid_10033/pid_1668
|end
大佬,vivo x9s OS7.1.2 虚拟机、多开检测无效
bluestacks 平台版本号3.1.20.678,引擎版本号2.10.42.9406
打印信息
ceshi start|null|null|MSM8974|msm8974|universal5420|support CameraFlash|sensorNum7|userAppNum1|2:cpu:/apps
1:cpuacct:/uid/10063
|end
koplayer 版本号2.0.0
打印信息
ceshi start|null|hlteatt-user|SM-N950S|Hi6210sft|androidVM_x86|unsupport CameraFlash|sensorNum13|userAppNum2|2:cpu:/
1:cpuacct:/uid_10037/pid_2502
|end
数据
ceshi start||dream2qltezh-user|SM-G955F|msm8998|2:cpu:/
1:cpuacct:/uid_10037/pid_4060
|end
检测模拟器过程中发现 各个模拟器在获取无障碍服务列表时均未空
提示Could not find which method maven() to invoke from this list:
public abstract org.gradle.api.artifacts.repositories.MavenArtifactRepository org.gradle.api.artifacts.dsl.RepositoryHandler#maven(groovy.lang.Closure)
public abstract org.gradle.api.artifacts.repositories.MavenArtifactRepository org.gradle.api.artifacts.dsl.RepositoryHandler#maven(org.gradle.api.Action)
实测发现夜神模拟器和雷电模拟器 获取进程组信息时,数量都是2 并且类别都是 cpu 和cpuaact。
因此我自己加了判断进程组数量 小于3 则认为有模拟器嫌疑
EasyProtectorLib.checkIsUsingMultiVirtualApp() 这个方法不能检测应用双开多开吗,我使用这个方法打log ,在多开的情况下不能识别的,求助,哪位大佬有检测应用多开的好工具
引入包之后报这个错误,是不是用到了fileprovider
多开之后getFilesDir()得到的路径 不一样,应该是可以作为依据的
这里发一个。说不定那边做分身的或者虚拟机的就对应改一个。就跟提BUG一样
一款名多开分身的会检测失败,经测试多开分身软件能进行修改机型,地理位置模拟,分身的应用的包名会跟原应用一致
VirtualApkCheckUtil.getSingleInstance().checkByPortListening(getPackageName(), () -> {
DialogUtils.showMessDialog((Activity) getApplicationContext(), "禁止双开");
System.exit(0);
});
public boolean checkByHasSameUid() {
String filter = getUidStrFormat();
String result = CommandUtil.getSingleInstance().exec("ps");
if (result == null || result.isEmpty()) {
return false;
}
String[] lines = result.split("\n");
if (lines == null || lines.length <= 0) {
return false;
}
int exitDirCount = 0;
for (int i = 0; i < lines.length; i++) {
### //如果filter 为空 contains 会报空指针异常
if (lines[i].contains(filter)) {
int pkgStartIndex = lines[i].lastIndexOf(" ");
String processName = lines[i].substring(pkgStartIndex <= 0
? 0 : pkgStartIndex + 1, lines[i].length());
File dataFile = new File(String.format("/data/data/%s", processName, Locale.CHINA));
if (dataFile.exists()) {
exitDirCount++;
}
}
}
return exitDirCount > 1;
}
android.permission.BIND_ACCESSIBILITY_SERVICE
why need this permission_request in manifest.xml ?
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
at com.lahm.library.EmulatorCheckUtil.int getUserAppNums(java.lang.String)(EmulatorCheckUtil.java:98)
at com.lahm.library.EmulatorCheckUtil.boolean readSysProperty(android.content.Context,com.lahm.library.EmulatorCheckCallback)(EmulatorCheckUtil.java:73)
at com.lahm.library.EmulatorCheckUtil.boolean readSysProperty()(EmulatorCheckUtil.java:30)
at com.lahm.library.EasyProtectorLib.boolean checkIsRunningInEmulator()(EasyProtectorLib.java:62)
at com.cnepay.android.utils.SafeUtils.boolean isEmulator()(SafeUtils.java:124)
at com.cnepay.android.utils.SafeUtils.java.lang.String isSafe(boolean,android.content.Context)(SafeUtils.java:58)
at com.cnepay.android.swiper.MainActivity$10.void run()(MainActivity.java:560)
at java.lang.Thread.null run(null)(Thread.java)
Cause: com.novoda.gradle.release.AndroidLibrary$LibraryUsage.getDependencyConstraints()Ljava/util/Set;
public static void isEmulator() {
if (EasyProtectorLib.checkIsRunningInEmulator()) {
KLog.e("是模拟器");
System.exit(0);
}else {
KLog.e("不是模拟器");
}
}
#isEmulator ] 不是模拟器
ceshi start|M_V3_P10,M_V3_P10|full_oppo6771_17197-user|oppo6771_17197|mt6771|
4:cpuset:/top-app
3:cpu:/
2:schedtune:/top-app
1:cpuacct:/uid_10137/pid_18790
|end
Attempt to invoke virtual method 'java.lang.String[] android.os.Bundle.getStringArray(java.lang.String)' on a null object reference
集成lib到项目,真机运行发现总闪退
美图手机型号Meitu M4,android系统版本是4.4.4,
小米手机具体型号不清楚,android系统版本是4.4.2,
打包apk的时候,发现少了'x86_64', 'arm64-v8a这两个架构的编译
emulatorInfo:
ceshi start|1.0.0.0|sdk_gphone_x86-userdebug|goldfish_x86||2:cpu:/
1:cpuacct:/uid_10085/pid_6675
|end
2018-10-19 15:40:30.140 6011-6160/com.google.android.gms E/CheckinRequestProcessor: CheckinNowTaskTag : Checkin failed: https://android.clients.google.com/checkin (fragment #0): java.net.ConnectException: Failed to connect to android.clients.google.com/64.233.189.101:443
java.net.ConnectException: Failed to connect to android.clients.google.com/64.233.189.101:443
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:143)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:26)
at nmb.a(:com.google.android.gms@[email protected] (040700-199405334):23)
at nmb.a(:com.google.android.gms@[email protected] (040700-199405334):273)
at com.google.android.gms.checkin.CheckinChimeraService.a(:com.google.android.gms@[email protected] (040700-199405334):167)
at nlw.run(:com.google.android.gms@[email protected] (040700-199405334):2)
at pmy.run(:com.google.android.gms@[email protected] (040700-199405334):24)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at pta.run(Unknown Source:7)
at java.lang.Thread.run(Thread.java:764)
android 自带的虚拟机9.0检测不出来。打印了检测的日志如下:
isEmulator --- >baseBandVersion 1.0.0.0
buildFlavor sdk_gphone_x86-user
productboard goldfish_x86
boardplatform
filter 2:cpu:/
1:cpuacct:/uid_10091/pid_2675
希望能够尽快适配
逍遥模拟器检测不到
start|null|MIX|MIX|null|intel|unsupport CameraFlash|sensorNum7|userAppNum16||end
雷电模拟器检测不出来
if ((str.endsWith(".so")) || (str.endsWith(".jar"))) {
((Set) localObject).add(str.substring(str.lastIndexOf(" ") + 1));
}
Line 1187: ef5bd000-ef615000 r--p 00000000 fd:00 1294357 /data/dalvik-cache/arm/system@[email protected]@classes.dex
Line 1188: ef615000-ef65e000 r-xp 00058000 fd:00 1294357 /data/dalvik-cache/arm/system@[email protected]@classes.dex
Line 1189: ef65e000-ef65f000 rw-p 000a1000 fd:00 1294357 /data/dalvik-cache/arm/system@[email protected]@classes.dex
public class App extends Application {
LocalServerSocket mServerSocket;
@Override
public void onCreate() {
super.onCreate();
try {
// 借鉴自 AMS 与 zygote 通信
mServerSocket = new LocalServerSocket(getPackageName());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
不需要开线程,不需要遍历端口,只需要一个唯一确定的名字即可。唯一的缺点是多开的 app 之间无法通信,是因为 SELinux 的保护机制限制了文件访问权限
检测夜神模拟器6.2.8.0失效,用的是1.1.0版本
建议:
if (null == baseBandVersion || baseBandVersion.contains("1.0.0.0"))
suspectCount += 2;//基带信息
if (sensorSize <= 7) ++suspectCount;//传感器个数
if (userAppSize <= 5) ++suspectCount;//用户安装的app个数
亲测:夜神,雷电、逍遥、mumu,腾讯手游助手,genymotion有效、
AndroidP API27 x86
夜游神模拟器6.3.0.7无法检测出来
pan.baidu.com/s/1CABLvF3lPS7ukevHeK24pA提取码:m28z
oppo R7 虚拟机检测 有时候会把真机判断为虚拟机。概率事件
不好复现
突然产生了大量空指针问题,貌似都是发生在按back键退出app的时候发生的
崩溃率很大,可否尽快加入非空判断?
是在Application初始化时调用的,具体kotlin代码如下:
if (ProcessUtil.isMainProcess(application)) {
VirtualApkCheckUtil.getSingleInstance().checkByPortListening(application.packageName) {
Log.e("Application", "find multiapp suspect")
DeviceInfo = generateDeviceInfo(application, true)
}
}
天天模拟器未能检测出来
pm list package 。 因为大部分手机会有一个”是否允许应用读取手机应用列表”的权限,不知这个pm list package 和权限是否有关联。
ceshi start|null|null|sdm660|msm8084|qcom|support CameraFlash|sensorNum7|userAppNum3|2:cpu:/apps
1:cpuacct:/uid/10028
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.