问题描述
希望您知道,可以借助 Astro 文件管理器等应用程序将安装在 android 设备中的应用程序备份并存储为可安装文件(作为 APK 文件).同样的 apk 也可以安装在 android 模拟器中.因此,其他人有机会轻松挖掘已安装应用程序的文件,如 DB、共享首选项等.
Hope you know that an application which is installed in an android device can be backed up and stored as an installable file(as an APK file) with the help of apps like Astro file manager. The same apk can be installed in the android simulator as well. So there is a chance that other can easily dig into the installed app's files like DB, shared preference, etc..
有没有办法只允许在真机上安装而不是在模拟器上安装???
Is there any way to permit installing only in real device and not in simulators???
我知道,如果它是 ROOTED 设备,我们可以像在模拟器中一样访问应用程序的数据.即使我想知道我们是否可以限制在模拟器中安装 apk.
I know that if it is ROOTED device, we can access the app's data same like in the simulator. Even though i would like to know whether we can restrict installing apk in simulators.
提前致谢
推荐答案
使用这个函数:
public static boolean isEmulator() {
return Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
|| Build.MODEL.contains("google_sdk")
|| Build.MODEL.contains("Emulator")
|| Build.MODEL.contains("Android SDK built for x86")
|| Build.MANUFACTURER.contains("Genymotion")
|| (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
|| "google_sdk".equals(Build.PRODUCT);
}
为此:
if (isEmulator()) {
// emulator
} else {
//not emulator
}
我的建议:
从 github 尝试 this.
try this from github.
容易检测的安卓模拟器
- 在 Device Farm 中的真实设备上检查 (https://aws.amazon.com/device-farm/)
- 蓝叠
- Genymotion
- 安卓模拟器
- 安迪 46.2.207.0
- MEmu 玩
- Nox 应用播放器
- Koplayer
- .....
如何使用示例:
EmulatorDetector.with(this)
.setCheckTelephony(true)
.addPackageName("com.bluestacks")
.setDebug(true)
.detect(new EmulatorDetector.OnEmulatorDetectorListener() {
@Override
public void onResult(boolean isEmulator) {
}
});
这篇关于如何限制 APK 不安装在 Android Emulator/Simulator 中,而是安装在真实设备中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)