Java Code Examples for android.os.Build#FINGERPRINT

The following examples show how to use android.os.Build#FINGERPRINT . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hoko-android   File: Device.java    License: Apache License 2.0 7 votes vote down vote up
/**
 * Returns the Android build number of the device Hoko is being run on.
 *
 * @return The Android build number in case it has been found, "HOKO" otherwise.
 */
public static String getBuildNumber() {
    String buildNumber = "HOKO";
    if (Build.FINGERPRINT != null) {
        String[] fingerPrintSplit = Build.FINGERPRINT.split("/");
        if (fingerPrintSplit.length > 3) {
            buildNumber = fingerPrintSplit[3];
        }
    }
    return buildNumber;
}
 
Example 2
Source Project: FimiX8-RE   File: AesCbcWithIntegrity.java    License: MIT License 6 votes vote down vote up
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 3
private String getUserReadableName() {
    String fingerprint = TextUtils.isEmpty(Build.FINGERPRINT) ? "" : Build.FINGERPRINT;
    String manufacturer = TextUtils.isEmpty(Build.MANUFACTURER) ? "" : Build.MANUFACTURER;
    String product = TextUtils.isEmpty(Build.PRODUCT) ? "" : Build.PRODUCT.replace("aokp_", "").replace("aosp_", "").replace("cm_", "").replace("lineage_", "");
    String model = TextUtils.isEmpty(Build.MODEL) ? "" : Build.MODEL;
    String device = TextUtils.isEmpty(Build.DEVICE) ? "" : Build.DEVICE;
    String result = (fingerprint.toLowerCase().contains(product.toLowerCase()) || product.toLowerCase().contains(device.toLowerCase()) || device.toLowerCase().contains(product.toLowerCase())) ? model : product;
    if (!result.toLowerCase().contains(manufacturer.toLowerCase())) {
        result = manufacturer + " " + result;
    }
    if (TextUtils.isEmpty(result)) {
        return "";
    }
    return (result.substring(0, 1).toUpperCase() + result.substring(1))
        .replace("\n", " ")
        .replace("\r", " ")
        .replace(",", " ")
        .trim()
    ;
}
 
Example 4
Source Project: Silence   File: PRNGFixes.java    License: GNU General Public License v3.0 6 votes vote down vote up
private static byte[] getBuildFingerprintAndDeviceSerial() {
  StringBuilder result = new StringBuilder();
  String fingerprint = Build.FINGERPRINT;
  if (fingerprint != null) {
    result.append(fingerprint);
  }
  String serial = getDeviceSerialNumber();
  if (serial != null) {
    result.append(serial);
  }
  try {
    return result.toString().getBytes("UTF-8");
  } catch (UnsupportedEncodingException e) {
    throw new RuntimeException("UTF-8 encoding not supported");
  }
}
 
Example 5
private static byte[] getBuildFingerprintAndDeviceSerial() {
    final StringBuilder result = new StringBuilder();
    final String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    final String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (final UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 6
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 7
Source Project: DeviceConnect-Android   File: PRNGFixes.java    License: MIT License 6 votes vote down vote up
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 8
private void recordInformations(Context context) {
	try {
		PackageManager pm = context.getPackageManager();
		PackageInfo pi;
		// Version
		pi = pm.getPackageInfo(context.getPackageName(), 0);
		versionName = pi.versionName;
		//buildNumber = currentVersionNumber(context);
		// Package name
		packageName = pi.packageName;

		// Device model
		phoneModel = Build.MODEL;
		// Android version
		androidVersion = Build.VERSION.RELEASE;

		board = Build.BOARD;
		brand = Build.BRAND;
		device = Build.DEVICE;
		display = Build.DISPLAY;
		fingerPrint = Build.FINGERPRINT;
		host = Build.HOST;
		id = Build.ID;
		model = Build.MODEL;
		product = Build.PRODUCT;
		manufacturer = Build.MANUFACTURER;
		tags = Build.TAGS;
		time = Build.TIME;
		type = Build.TYPE;
		user = Build.USER;

	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 9
Source Project: DeviceConnect-Android   File: PRNGFixes.java    License: MIT License 6 votes vote down vote up
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 10
Source Project: java-aes-crypto   File: AesCbcWithIntegrity.java    License: MIT License 6 votes vote down vote up
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 11
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 12
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported"); //NOPMD
    }
}
 
Example 13
Source Project: android   File: PRNGFixes.java    License: GNU General Public License v3.0 6 votes vote down vote up
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 14
private static byte[] getBuildFingerprintAndDeviceSerial() {
    StringBuilder result = new StringBuilder();
    String fingerprint = Build.FINGERPRINT;
    if (fingerprint != null) {
        result.append(fingerprint);
    }
    String serial = getDeviceSerialNumber();
    if (serial != null) {
        result.append(serial);
    }
    try {
        return result.toString().getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("UTF-8 encoding not supported");
    }
}
 
Example 15
public static String getDeviceInfo() {
    return "Build.PRODUCT: " + Build.PRODUCT + "\n" +
        "Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
        "Build.BRAND: " + Build.BRAND + "\n" +
        "Build.DEVICE: " + Build.DEVICE + "\n" +
        "Build.MODEL: " + Build.MODEL + "\n" +
        "Build.HARDWARE: " + Build.HARDWARE + "\n" +
        "Build.FINGERPRINT: " + Build.FINGERPRINT;
}
 
Example 16
Source Project: FloatWindow   File: RomUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static boolean isZTERom() {
    String manufacturer = Build.MANUFACTURER;
    String fingerPrint = Build.FINGERPRINT;
    return (!TextUtils.isEmpty(manufacturer) && (fingerPrint.toLowerCase().contains(ROM_NUBIA)
            || fingerPrint.toLowerCase().contains(ROM_ZTE)))
            || (!TextUtils.isEmpty(fingerPrint) && (fingerPrint.toLowerCase().contains(ROM_NUBIA)
            || fingerPrint.toLowerCase().contains(ROM_ZTE)));
}
 
Example 17
Source Project: CrashReporter   File: AppUtils.java    License: Apache License 2.0 5 votes vote down vote up
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;
    }
 
Example 18
Source Project: GravityBox   File: DevicesUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static String getBrand() {
    return Build.FINGERPRINT;
}
 
Example 19
@ReactMethod(isBlockingSynchronousMethod = true)
public String getFingerprintSync() { return Build.FINGERPRINT; }
 
Example 20
Source Project: DevUtils   File: DeviceUtils.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * 获取设备的唯一标识, 由设备的多个信息拼接合成
 * @return 设备的唯一标识, 由设备的多个信息拼接合成
 */
public static String getFingerprint() {
    return Build.FINGERPRINT;
}