1 thought on “heart jewelry box wholesale Talk about the only device ID”

  1. jewelry boxes wholesale uk Equipment ID is simply a string of symbols (or numbers), mapping the hardware equipment in reality.
    If these symbols and devices correspond to one -to -one, it can be called "the only device ID (unique device)"

    I unfortunately, for the Android platform, there is no stable API API Can allow developers to get such device IDs.
    The developers usually encounter such dilemma:
    With the evolution of the project, more and more places need to use device ID;
    ID is getting harder and harder.
    It the problem of fragmentation of the Android platform, and obtaining the road of device ID can be said to be difficult.

    The role of device ID can be divided into the following points:

    The API fingers obtained by the device logo, and there are more problems with more or less.
    The conventional API has the following:

    IMEI's most ideal device ID, which has uniqueness, and restore the factory settings and will not change (real equipment related).
    , however, obtaining IMEI requires read_phone_state permissions. It is estimated that everyone knows how troubles this permissions are.
    Especially after Android 6.0, such permissions need to be dynamically applied, and many users may choose to refuse to authorize.
    We we can see that some apps do not authorize this permissions cannot be used, which may reduce the user's favorability of the app.
    , and Android 10.0 will completely ban third -party applications from obtaining the IMEI of the device, even if you apply for read_phone_state permissions.
    Therefore, if it is a new app, IMEI is not recommended as a device logo;
    It if IMEI has been used as a logo, it is necessary to quickly do compatible work, especially the mapping of new device logos and IMEI.

    Inned android.os.build.serial, provided by the manufacturer.
    If the manufacturer is more standardized, the device serial number build. It should be able to identify the device.
    But the reality is not all manufacturers according to specifications, especially the early equipment.
    The most fatal thing is that above the Android 8.0, Android.os.Build.serial always returns "UNKNOWN";
    It to obtain the serial number, you can call build.getSerial (), but you need to apply for read_phone_State permissions.
    This above Android 10.0, the same as IMEI is also prohibited.
    Generally speaking, the equipment sequence number is a bit chicken: it is tasteless, it is a pity to abandon.

    In obtaining the MAC address is also getting more and more difficult,
    Android 6.0 The MAC obtained will be fixed: 02: 00: 00: 00: 00,
    later read/sys/class/net/wlan0/address.
    The method can be obtained now only (you can get it without opening wifi):

    It again, maybe this method is not allowed, and cherish it ~

    Android ID is the lowest to obtain the threshold, without any permissions, the value range of 64bit, the uniqueness is very good.
    But the shortcomings are also obvious:
    1. Brush, root, restoration of factory settings, etc. will change the Android ID;
    2. After Android 8.0, the rules of Android ID have changed:

    The results caused by the two rules:
    First, if the user installed the APP device below 8.0, it was later uninstalled, and the application was reinstalled after upgrading to 8.0. The Android ID was different. ;
    Secondly, different signature apps, the Android ID obtained is different.
    If of which may affect the advertising alliance and the like.

    This I have previously written an article "The acquisition and structure of the unique identification of Android device", which mentioned two concepts of the device ID: uniqueness and stability.
    Division: The ID ID obtained by the two different devices is different;
    It stability: The same device is the same at different times.

    Analysis of uniqueness, we can start with the distribution of ID:

    The first column on the left is the number of BIT, the second column is the corresponding value range, and then the back is the back. The number of elements and the corresponding conflict probability.
    For example, if there are 50,000 random numbers of 32bit, the probability of at least two of these random numbers is 25%;
    The group has 50,000 random numbers, and about one of them will have duplicate numbers.
    32bit has a range of 4.3 billion. How can 50,000 random numbers have such a high probability of repetitive?
    If you are confused about this, you can understand the birthday paradox.

    Android ID is a hexadecimal string with a length of 16. In fact, it is 64bit. Let's analyze its duplicate probability:
    If the APP activation volume reaches 5 billion apps, There will be about one android ID of each two apps.
    but the "repetition" here is not a lot of duplication, but "at least two of the same", that is, if the device activation volume is 5 billion (many APPs cannot reach -_-), then it may be possible There are a small amount of repeated Android ID.
    In general, the uniqueness of Android ID is still good.
    JDK can be considered to be the random number of 128Bit (of which 6bit is fixed). Even if the number reaches 20 billion, the probability of duplication is only 10 negatives of 10 times, which is minimal.

    has two levels of stability:

    Whether it is statistical needs or business needs, the device ID is required to be unique and stable.
    If the device ID is repeated, active statistics, user portraits, orientation push are not accurate;
    Among them, the deepest impact is the directional push, and the wrong express delivery may be recovered. Pushing is wrong. It's hard to say, if the push content is more important, the consequences are unimaginable.
    If the device ID is unstable (ID change), it will affect active statistics (it will be considered as a new user), and it will also have a great impact on user portraits (the previous ID -associated behavior data cannot be tracked).

    For this, it is necessary to design a set of solutions to provide relatively stable, only device ID.
    First of all, the two prerequisites must be clarified:
    In the device ID analyzed earlier, under the premise of available, the probability of repetition is less; Overall, the probability that it is different from yesterday is also small.
    How to continue to reduce the probability under the premise of a smaller probability?

    The solution is a combination device ID (directly stitching, or after stitching calculation).
    For example, if the probability of duplicate and the probability of changing is one thousandths,
    For two different devices, the probability of the two devices at the same time is one million -dollar. First, at least one changes in the two devices have changed by about two thousandths.
    , that is, the effect of splicing ID is greatly improved, but to a certain extent, reduce stability (as long as one of the element changes, the id of the splicing ID will change).
    But in fact, the most prominent contradiction that can be obtained today is unstable, so we cannot sacrifice stability in order to improve the uniqueness.

    It to improve stability, you can introduce fault -tolerant schemes.
    The fault tolerance schemes, such as network transmission, use Checksum to check the message, if an error is issued;
    as a disk array, the data is written into two disks, only two disks at the same time at the same time at the same time When errors, the data will be lost, which greatly reduces the probability of losing data.
    But the above two schemes are not appropriate for device IDs, because the above solution needs to confirm whether the original information is modified through Checksum, and the device ID does not have such conditions.

    So you can introduce the "Byzantine Error tolerance" scheme used in similar virtual currencies.
    is simply to collect three devices ID to the cloud. If there are two (including two or more) device IDs the same as previous records, they are considered to be the same device.
    The same assume that the probability of duplicate and the probability of changes is one thousandth of thousands, then:
    The two collection of the same equipment, the condition of the same equipment is "at least two two at least two two The device ID is not the same as the last time. "The probability is about three millionth.
    The two different devices believe that the condition of the same one is "of the three devices ID, at least two devices ID and another device are the same", the probability is also about three million in the same probability.
    Therefore, with this solution, the uniqueness and stability can be improved.

    The basic idea is: the service side has a table of device ID, and the core attributes (column) are:
    ID | DID_1 | DID_2 | DID_3
    When the customer request, upload three three Equipment ID, server retrieval:

    If retrieval is retrieved, at least two DIDs are the same as uploaded, and return ID;
    Otherwise, insert the three device IDs uploaded and uploaded, and insert it, and Return the newly inserted record.

    . In general, the primary key of the server table is self -increase sequence (in order to ensure the orderly insertion),
    So we cannot return the main key of the table directly, otherwise it is easy to be speculated by others to speculate that other others other The device ID, and knowing the number of users.
    Therefore, besides the main key ID, we need another unique ID.
    has two ideas:

    Then, three devices are needed ...

    then if there is no READ_PHONE_STATE permissions, and after Android 10.0 How to deal with it?
    First of all, the equipment sequence number still needs to be collected. After all, there are some old versions of the device to get it, which can be distinguished. (The same model, there may be a variety of configurations, so you can also collect hardware information at the same time).
    The final matching rules are as follows:

    If the device without matching, it is considered to be a new device;
    At this time, generate a new UDID return, and insert the relevant information of the new device ( Device ID, hardware information).

    For hardware information, it is necessary to meet one requirement: after the device restarts, restore the factory settings, etc., it will not change.
    The conventional information has CPU cores, RAM/ROM size (collecting GB as a unit, not accurate to bitter, otherwise it is easy to change), screen resolution and DPI, etc., combined with models, conservative estimates that there are thousands or even even thousands Tens of thousands of possibilities are very different from 2^64 of Android ID, but they can still be used as auxiliary reference information.
    In imagination of the device sequence number cannot be obtained. When one of the Android ID and MAC address changes, the retrieval is only an Android ID or one of the matching records. The Android ID or Mac of the stage is the same.
    Which one is waiting at this time? Coupled with equipment information, it may be distinguished.
    C regular device information is easy to be tampered with. Therefore, in addition to conventional information, we can dig some unpopular device features, such as related information with sensors.
    Is when conventional information is tampered with, if the unpopular device information has not changed, the same device can still be identified.
    Is how to dig, then it is apparent, usually friends who do mobile phone hardware or ROM may know more APIs.
    In order to facilitate retrieval, we can use compressing the information to 64bit (long).

    In more, after obtaining UDID, you can upload UDID and device information to the cloud when you get UDID. This can improve the stability of UDID.
    For example, the user uninstalled the APP when the device was Android 7.0, and installed it back after the Android 8.0. At this time, the Android ID was changed, but we can recognize this device with Mac and device information. At the same time, it updates its Android ID;
    If the MAC will not be obtained in any day, we can still identify this device based on Android ID and device information.

    This This article introduces the purpose of the device ID, the status quo, and analyzes the characteristics of the existing device ID, and finally proposes a set of constructor of the device ID.
    If according to the trends in recent years, the APIs of various devices ID may be more and more tighter. It is more difficult to construct reliable device IDs from the client, while information collection and cloud comprehensive calculation are relative. easy.
    The implementation, the author wrote a demo, which has been released to github for reference.
    project address: github // udid

    Reference materials:
    54633077
    Blog.csdn/renlonggg/article/defails/78435986
    develOper.android/about/versions/android-8.0-zhl=zh- r n en.wikipdips /BIRTHDAY_ATTACK

Leave a Comment

Shopping Cart