当前位置: 首页>>代码示例>>Java>>正文


Java Build.SERIAL属性代码示例

本文整理汇总了Java中android.os.Build.SERIAL属性的典型用法代码示例。如果您正苦于以下问题:Java Build.SERIAL属性的具体用法?Java Build.SERIAL怎么用?Java Build.SERIAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.os.Build的用法示例。


在下文中一共展示了Build.SERIAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDeviceId

public static String getDeviceId(Context context) {
    String androidId = Settings.Secure.getString(context.getContentResolver(),
            Settings.Secure.ANDROID_ID);
    if (!TextUtils.isEmpty(androidId)) {
        String serial = Build.SERIAL;
        if (!"unknown".equalsIgnoreCase(serial)) {
            return androidId + serial;
        }
        return androidId;
    }

    File file = new File(context.getFilesDir(), "deviceId");
    file.mkdir();
    File[] files = file.listFiles();
    if (files.length > 0) {
        return files[0].getName();
    }
    String id = UUID.randomUUID().toString();
    (new File(file, id)).mkdir();
    return id;
}
 
开发者ID:homeii,项目名称:GxIconAndroid,代码行数:21,代码来源:ExtraUtil.java

示例2: getBuildFingerprintAndDeviceSerial

private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = Build.SERIAL;
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:16,代码来源:PRNGFixes.java

示例3: writeToEntropyPool

@Override
protected void writeToEntropyPool(DataOutputStream out) throws IOException {
	super.writeToEntropyPool(out);
	out.writeInt(android.os.Process.myPid());
	out.writeInt(android.os.Process.myTid());
	out.writeInt(android.os.Process.myUid());
	if (Build.FINGERPRINT != null) out.writeUTF(Build.FINGERPRINT);
	if (Build.SERIAL != null) out.writeUTF(Build.SERIAL);
	ContentResolver contentResolver = appContext.getContentResolver();
	String id = Settings.Secure.getString(contentResolver, ANDROID_ID);
	if (id != null) out.writeUTF(id);
	Parcel parcel = Parcel.obtain();
	WifiManager wm =
			(WifiManager) appContext.getSystemService(WIFI_SERVICE);
	List<WifiConfiguration> configs = wm.getConfiguredNetworks();
	if (configs != null) {
		for (WifiConfiguration config : configs)
			parcel.writeParcelable(config, 0);
	}
	BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
	if (bt != null) {
		for (BluetoothDevice device : bt.getBondedDevices())
			parcel.writeParcelable(device, 0);
	}
	out.write(parcel.marshall());
	parcel.recycle();
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:27,代码来源:AndroidSecureRandomProvider.java

示例4: getDeviceDetails

public static String getDeviceDetails(Context context) {

        return "Device Information\n"
                + "\nDEVICE.ID : " + getDeviceId(context)
                + "\nUSER.ID : " + getUserIdentity(context)
                + "\nAPP.VERSION : " + getAppVersion(context)
                + "\nLAUNCHER.APP : " + getCurrentLauncherApp(context)
                + "\nTIMEZONE : " + timeZone()
                + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE
                + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL
                + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT
                + "\nBOARD : " + Build.BOARD
                + "\nBOOTLOADER : " + Build.BOOTLOADER
                + "\nBRAND : " + Build.BRAND
                + "\nCPU_ABI : " + Build.CPU_ABI
                + "\nCPU_ABI2 : " + Build.CPU_ABI2
                + "\nDISPLAY : " + Build.DISPLAY
                + "\nFINGERPRINT : " + Build.FINGERPRINT
                + "\nHARDWARE : " + Build.HARDWARE
                + "\nHOST : " + Build.HOST
                + "\nID : " + Build.ID
                + "\nMANUFACTURER : " + Build.MANUFACTURER
                + "\nMODEL : " + Build.MODEL
                + "\nPRODUCT : " + Build.PRODUCT
                + "\nSERIAL : " + Build.SERIAL
                + "\nTAGS : " + Build.TAGS
                + "\nTIME : " + Build.TIME
                + "\nTYPE : " + Build.TYPE
                + "\nUNKNOWN : " + Build.UNKNOWN
                + "\nUSER : " + Build.USER;
    }
 
开发者ID:MindorksOpenSource,项目名称:CrashReporter,代码行数:31,代码来源:AppUtils.java

示例5: getDeviceSerialNumber

/**
 * Gets the hardware serial number of this device.
 *
 * @return serial number or {@code null} if not available.
 */
private static String getDeviceSerialNumber() {
    try {
        return Build.SERIAL;
    } catch (Exception ignored) {
        return null;
    }
}
 
开发者ID:RyuzakiKK,项目名称:NoteCrypt,代码行数:12,代码来源:PRNGFixes.java

示例6: getSerial

public static String getSerial() {
    return Build.SERIAL;
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:3,代码来源:DeviceUtils.java

示例7: getPhoneId

/**
 * 获取手机的ID
 *
 * @return 设备ID
 */
public String getPhoneId(Context context) {
    try {
        return Build.SERIAL;
    } catch (Exception e) {
        return "";
    }
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:12,代码来源:PhoneManager.java

示例8: getSerial

@TargetApi(9)
private static String getSerial() {
    try {
        return Build.SERIAL;
    } catch (Throwable e) {
        FLOG.w(TAG, "get serial failed(Throwable): " + e.getMessage());
        return null;
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:Device.java

示例9:

private void b0439й0439043904390439() {
    String str = Build.SERIAL;
    if (((b041EООО041EО + b041E041EОО041EО) * b041EООО041EО) % bОО041EО041EО != bО041EОО041EО) {
        b041EООО041EО = b041EО041EО041EО();
        bО041EОО041EО = b041EО041EО041EО();
    }
    this.bь044C044Cььь = str;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:ccrccc.java

示例10: b

public void b(Context context) {
    String simSerialNumber;
    TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
    try {
        String deviceId = telephonyManager.getDeviceId();
        if (deviceId != null) {
            this.a = UUID.nameUUIDFromBytes(deviceId.getBytes("UTF-8")).toString();
        }
    } catch (Exception e) {
        PingppLog.a(e.getMessage());
    }
    try {
        simSerialNumber = telephonyManager.getSimSerialNumber();
        if (simSerialNumber != null) {
            this.c = UUID.nameUUIDFromBytes(simSerialNumber.getBytes("UTF-8")).toString();
        }
    } catch (Exception e2) {
        PingppLog.a(e2.getMessage());
    }
    try {
        simSerialNumber = Secure.getString(context.getContentResolver(), "android_id");
        if (!(simSerialNumber == null || "9774d56d682e549c".equals(simSerialNumber))) {
            this.b = UUID.nameUUIDFromBytes(simSerialNumber.getBytes("UTF-8")).toString();
        }
    } catch (Exception e22) {
        PingppLog.a(e22.getMessage());
    }
    try {
        simSerialNumber = Build.SERIAL;
        if (simSerialNumber != null) {
            this.d = UUID.nameUUIDFromBytes(simSerialNumber.getBytes("UTF-8")).toString();
        }
    } catch (Exception e222) {
        PingppLog.a(e222.getMessage());
    }
    PingppLog.a("deviceId: " + this.a + "\nandroidId: " + this.b + "\nsimSerialNum: " + this
            .c + "\nserialNum: " + this.d);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:38,代码来源:l.java

示例11: getSerialNumber

public String getSerialNumber() {
    String str = "";
    try {
        return Build.SERIAL;
    } catch (Exception e) {
        return str;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:DeviceInfo.java

示例12: registerDevice

/**
 * register device
 */
public void registerDevice() {
    if (mqttService == null) return;

    String passcode = Build.SERIAL;
    if(Build.SERIAL == null) {
        Log.e(TAG, "Serial is NULL!");
        passcode = "12345"; //default
    }
    else
        Log.i(TAG, "Serial is " + Build.SERIAL);
    oneM2MAPI.getInstance().tpRegisterDevice(mqttService, passcode,
            "3", "true", new MQTTCallback<remoteCSEResponse>() {
                @Override
                public void onResponse(remoteCSEResponse response) {
                    device = response;
                    registerSensor();
                    registerControl();

                    if (stateListener != null) {
                        stateListener.onRegistered(true, device.dKey, device.getNl());
                    }
                }

                @Override
                public void onFailure(int errorCode, String message) {
                    Log.e(TAG, errorCode + " : " + message);
                    stateListener.onRegistered(false, null, null);
                }
            });
}
 
开发者ID:SKT-ThingPlug,项目名称:thingplug-sdk-android,代码行数:33,代码来源:OneM2MWorker.java

示例13: f

public String f() {
    if (VERSION.SDK_INT >= 9) {
        return Build.SERIAL;
    }
    return null;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:h.java

示例14: getSalt

public static String getSalt(int userId) {
	String def = (Build.SERIAL == null ? "" : Build.SERIAL);
	return getSetting(userId, cSettingSalt, def);
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:4,代码来源:PrivacyManager.java

示例15: removeLegacySalt

public static void removeLegacySalt(int userId) {
	String def = (Build.SERIAL == null ? "" : Build.SERIAL);
	String salt = getSetting(userId, cSettingSalt, null);
	if (def.equals(salt))
		setSetting(userId, cSettingSalt, null);
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:6,代码来源:PrivacyManager.java


注:本文中的android.os.Build.SERIAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。