• 推测的手机型号和cpu模型


    <span style="font-size:18px;">推断手机型号:</span>
    <span style="font-size:18px;">private boolean isUnusualPhone(){
    		try {
    
    
    			Class<?

    > cl = Class.forName("android.os.SystemProperties"); Object invoker = cl.newInstance(); Method m = cl.getMethod("get", new Class[] { String.class, String.class }); Object result = m.invoke(invoker, new Object[] { "gsm.version.baseband", "no message" }); return ((String) result).equals("I9250XXLJ1") || Build.MODEL.equals("MI 3"); } catch (Exception e) { return true; } }</span>


    推断手机cpu型号:

    <span style="font-size:18px;">// android 2.3 for arm v5 yanqing
    	public boolean hasCompatibleCPU() {
    		// If already checked return cached result
    
    		String CPU_ABI = android.os.Build.CPU_ABI;
    		String CPU_ABI2 = "none";
    		if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) { // CPU_ABI2
    			// since
    			// 2.2
    			try {
    				CPU_ABI2 = (String) android.os.Build.class.getDeclaredField(
    						"CPU_ABI2").get(null);
    			} catch (Exception e) {
    				return false;
    			}
    		}
    
    		if (CPU_ABI.equals("armeabi-v7a") || CPU_ABI2.equals("armeabi-v7a")) {
    			return true;
    		}
    
    		try {
    			FileReader fileReader = new FileReader("/proc/cpuinfo");
    			BufferedReader br = new BufferedReader(fileReader);
    			String line;
    			while ((line = br.readLine()) != null) {
    				if (line.contains("ARMv7")) {
    					return true;
    				}
    
    			}
    			fileReader.close();
    		} catch (IOException ex) {
    			ex.printStackTrace();
    			return false;
    		}
    		return false;
    	}</span>


    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    合代码、merge代码
    springboot 获取项目版本
    软考复习思路之疫情来的太突然之备战明年软考中级之软件设计师
    供应链管理笔记 概述2
    供应链管理笔记
    供应链管理 流程与实施1
    Winform中内嵌显示Office
    数据库提交数据注意事项
    工业互联网
    C#利用using System.Net实现Json数据提交WebAPI
  • 原文地址:https://www.cnblogs.com/hrhguanli/p/4629183.html
Copyright © 2020-2023  润新知