How to modify the device Number of mtk6573

Source: Internet
Author: User

When mtk6573 is used, the ADB, eclipse, and 91 assistants are connected, and 0123456789 abcdef is displayed.

This is the serial number of the mobile phone. How to obtain a sequence number that uniquely identifies each Android device?

There are many answers to this question, but most of them are valid only in some cases.

Based on tests:

1) All devices can return oneTelephonyManager.getDeviceId()

2) All GSM devices (the test devices are loaded with SIM cards) can return oneTelephonyManager.getSimSerialNumber()

3) All CDMA DevicesgetSimSerialNumber()Returns a null value!

4) all devices with a Google account can return oneANDROID_ID

5) All CDMA DevicesANDROID_ID AndTelephonyManager.getDeviceId()Returns the same value (as long as a Google account is added at the time of setup)

6) not tested: GSM devices without SIM cards, GSM devices without Google accounts, and devices in flight mode.

So if you want to get the unique serial number of the device,TelephonyManager.getDeviceId()That's enough. However, obviously exposing DeviceID will make some users dissatisfied, so it is best to encrypt these IDs. In fact, the encrypted serial number can still uniquely identify the device and does not explicitly expose the user's specific device. For example
String. hashcode (), combined with UUID:

 

1 final
TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
2   
3     final
String tmDevice, tmSerial, tmPhone, androidId;
4     tmDevice =
"" + tm.getDeviceId();
5     tmSerial =
"" + tm.getSimSerialNumber();
6     androidId =
"" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
7   
8     UUID deviceUuid =
new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() <<
32) | tmSerial.hashCode());
9     String uniqueId = deviceUuid.toString();

 

The final DeviceID may be as follows:00000000-54b3-e7c7-0000-000046bffd97


In general, the device serial number is filled with xxx_hsusb_pdata in this struct, or


Search for serial_number under the kernel, or directly search for your own device number.


"0123456789abcdef.

Modify mtk6573 in mt6573_devs.c (mediatek \ platform \ mt6573 \ kernel \ core): memcpy (serial_number, "0123456789 abcdef", 16 ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.