CN111931254A - Hybrid identification method for unique identification of Android device - Google Patents

Hybrid identification method for unique identification of Android device Download PDF

Info

Publication number
CN111931254A
CN111931254A CN202011028065.9A CN202011028065A CN111931254A CN 111931254 A CN111931254 A CN 111931254A CN 202011028065 A CN202011028065 A CN 202011028065A CN 111931254 A CN111931254 A CN 111931254A
Authority
CN
China
Prior art keywords
android
unique
hybrid
identification
system version
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011028065.9A
Other languages
Chinese (zh)
Inventor
张福军
蒋如超
鲍碧波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Green Man Technology Co ltd
Original Assignee
Green Man Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Green Man Technology Co ltd filed Critical Green Man Technology Co ltd
Priority to CN202011028065.9A priority Critical patent/CN111931254A/en
Publication of CN111931254A publication Critical patent/CN111931254A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/73Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by creating or determining hardware identification, e.g. serial numbers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention relates to a hybrid identification method of unique identification of Android equipment. The invention is very integrated for the hybrid method for obtaining the unique identification code, can meet most requirements in the development of application, does not need to dynamically apply for the authority by a user, is effective and reliable, and more conveniently obtains the equipment id corresponding to the current system version of the user through the requirements of different versions on the equipment authority on the basis of the system version number; the method can be applied to scenes with high safety requirements after understanding the generation process.

Description

Hybrid identification method for unique identification of Android device
Technical Field
The invention relates to the technical field of digital information transmission, such as telegraph communication, in particular to a hybrid identification method for unique identification of Android equipment.
Background
In the development of the Android system, the requirement for obtaining the unique identifier of the device is often met, and the main purpose is to bind a security account and the device, accurately issue data or perform data statistical analysis, and to count the number of devices logged by a user and daily activities.
In order to obtain the unique identification of a device, a previously common way is to obtain the device _ id of the current device, but this way has some problems:
(1) acquiring device _ id of the current equipment requires permission, which cannot be acquired at all in many times, and particularly after Android6.0 is updated, many domestic ROMs can modify related permission in system setting, so that an application program is prohibited from acquiring the device _ id;
(2) after Android Q, only the application signed by the system is allowed to obtain device _ id; the Android Q starts to add the right READ _ PRIVILEGED _ PHONE _ STATE and delete the READ _ PHONE _ STATE, the application must have the READ _ PRIVILEGED _ PHONE _ STATE to obtain the device _ id, but the normal application of the right cannot obtain the device _ id, the right is only opened to the system-level application, if the application does not have the right but tries to obtain the identifiers, different results occur according to different application target versions:
when the target version of the application is Android Q (targetSdkVersion = Q), a SecurityException is thrown, which is a runtime exception, and causes the application to crash;
the target version of the application is Android 9.0 or lower (targetSdkVersion < Q), if the application has READ _ PHONE _ STATE permission, 'null' or placeholder data is returned, such as 'unsewn', otherwise, SecurityException is thrown.
For the above problems, the storage using UUID and SharePreference or SD card storage is common in the prior art, and the two solutions have the disadvantages:
the former will be deleted with the APP, i.e., the APP is reinstalled and the DeviceId value will change;
the latter requires user authorization, in most use cases hardware identifiers such as ssaid (Android id) and IMEI can be avoided without limiting the required functionality, whereas from Android 10 the application must be a device or profile owner application, with special operator permissions, or with READ PRIVILEGED _ PHONE _ STATE privileges to access the non-resettable device identifier.
In the prior art, an android _ id is used for identification, but the android _ id is reset after the device is booted, that is, different devices may generate the same android _ id.
Disclosure of Invention
The invention solves the problems in the prior art and provides an optimized hybrid identification method for the unique identification of the Android device.
The technical scheme adopted by the invention is that a hybrid identification method of the unique identification of the Android equipment comprises the following steps:
step 1: detecting the starting of App; acquiring a system version number of the current Android device;
step 2: if the system version number is not lower than Android6.0, performing the next step, otherwise, attempting to acquire the unique equipment identifier, if the unique equipment identifier is successful, storing the unique equipment identifier, otherwise, generating a universal code, and ending;
and step 3: if the system version number does not meet the requirement that the system version number is larger than or equal to Android6.0 and smaller than Android 10.0, performing the next step, otherwise, requesting authorization; if the unique equipment identifier is successfully acquired after authorization, the unique equipment identifier is stored, otherwise, the next step is carried out;
and 4, step 4: and acquiring Android _ id through a system API, and identifying and storing the unique equipment identifier of the current Android equipment based on the Android _ id.
Preferably, in the step 2, the universal code is generated locally and is encrypted and written into a plurality of positions of the SD card.
Preferably, in step 3, the authorization is to inquire the right of READ _ PHONE _ STATE, if the device _ id is obtained, the success is achieved, otherwise, step 4 is performed.
Preferably, in the step 4, whether the android _ id is empty or not is judged, if not, the android _ id is stored locally for global use, otherwise, a universal code is generated locally, and the process is ended.
Preferably, the universal code encryption is written in several positions of the SD card.
Preferably, the head of the universal code is provided with a universal code identification.
The invention relates to an optimized hybrid identification method of unique identification of Android equipment.
The invention is very integrated for the hybrid method for obtaining the unique identification code, can meet most requirements in the development of application, does not need to dynamically apply for the authority by a user, is effective and reliable, and more conveniently obtains the equipment id corresponding to the current system version of the user through the requirements of different versions on the equipment authority on the basis of the system version number; the method can be applied to scenes with high safety requirements after understanding the generation process.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The present invention is described in further detail with reference to the following examples, but the scope of the present invention is not limited thereto.
The invention relates to a hybrid identification method of unique identification of Android equipment, which effectively solves the problems that in the prior art,
(1) when only using DEVICE _ ID, it is required to pass
getSystemservice (context. Telephony _ SERVICE). getDeviceId () acquisition, but READ _ PHONE _ STATE must be applied after Andriod 6.0, and this acquired value is not reliable in different vendors and devices;
(2) the MAC address is the MAC address of the wireless network card, and requires an ACCESS _ WIFI _ STATE authority, and the value cannot be obtained in many cases, and the MAC address is not very reliable;
(3) ANDROID _ ID is a 64-bit number that the system generates when a new device is first started or factory reset, and this value is now (after ANDROID 4.0) very reliable, but there is still a BUG for a custom system from an individual vendor, causing this value to be returned to null
To a problem of (a).
As shown in fig. 1, the method comprises the steps of:
step 1: detecting the starting of App; acquiring a system version number of the current Android device;
step 2: if the system version number is not lower than Android6.0, performing the next step, otherwise, attempting to acquire the unique equipment identifier, if the unique equipment identifier is successful, storing the unique equipment identifier, otherwise, generating a universal code, and ending;
in the step 2, the universal code is generated locally and is encrypted and written into a plurality of positions of the SD card.
In the invention, when the App is started, the version number of the current system is firstly acquired, and if the system version number is lower than Android6.0, the Android deviceId which is the unique identifier of the equipment can be directly acquired;
when the acquisition is successful, the general code UUID is generated locally and is encrypted and written into a plurality of positions of the SD card.
And step 3: if the system version number does not meet the requirement that the system version number is larger than or equal to Android6.0 and smaller than Android 10.0, performing the next step, otherwise, requesting authorization; if the unique equipment identifier is successfully acquired after authorization, the unique equipment identifier is stored, otherwise, the next step is carried out;
in the step 3, the authorization is to inquire the READ _ PHONE _ STATE authority, if the device _ id is obtained, the success is achieved, otherwise, the step 4 is performed.
In the invention, the step 3 is triggered by the system version number not lower than Android 6.0.
In the invention, when the Android system version is more than or equal to 6.0 and less than 10.0, the READ _ PHONE _ STATE authority is inquired, and the device _ id is authorized to be acquired;
when the acquisition is successful, the data is saved, generally, encryption is needed, and when the acquisition fails, step 4 is performed.
And 4, step 4: and acquiring Android _ id through a system API, and identifying and storing the unique equipment identifier of the current Android equipment based on the Android _ id.
In the step 4, whether the android _ id is empty or not is judged, if not, the android _ id is stored locally for global use, otherwise, a universal code is generated locally, and the operation is finished.
In the invention, step 4 is triggered by that the system version number is greater than or equal to 10 or the device _ id is null in the state that the system version number is greater than or equal to 6.0 and less than 10.0.
In the invention, the android _ id is acquired through a system API, the android _ id is not null and is stored locally for global use, and if the android _ id is null, the universal coding UUID is locally generated.
In summary, when the APP obtains the unique identifier of the device, the unique identifier is first obtained from the configuration file of the APP, and if the unique identifier does not exist, the unique identifier is read from the memory card, and if the unique identifier does not exist, the unique identifier is regenerated.
The universal coding encryption is written into a plurality of positions of the SD card.
The head of the universal code is provided with a universal code mark.
In the invention, the universal code is written into a plurality of positions of the SD card after being encrypted, so that the error deletion is prevented, the unique identifier of the equipment cannot be easily lost when the App is cleared of information or unloaded and reloaded, and the uniqueness is ensured; in this process, encryption is a technique that can be easily handled by those skilled in the art, and can be implemented by various encryption means.
In the invention, the head of the universal code is provided with a universal code identifier, namely a UUID identifier, which is convenient for identification.
The method and the device directly acquire the system version number of the current Android device after detecting that the App is started, set different processing nodes for the system version number, and acquire the unique identifier of the device based on different system version numbers.
The invention is very integrated for the hybrid method for obtaining the unique identification code, can meet most requirements in the development of application, does not need to dynamically apply for the authority by a user, is effective and reliable, and more conveniently obtains the equipment id corresponding to the current system version of the user through the requirements of different versions on the equipment authority on the basis of the system version number; the method can be applied to scenes with high safety requirements after understanding the generation process.

Claims (6)

1. A hybrid identification method of unique identification of Android equipment is characterized by comprising the following steps: the method comprises the following steps:
step 1: detecting the starting of App; acquiring a system version number of the current Android device;
step 2: if the system version number is not lower than Android6.0, performing the next step, otherwise, attempting to acquire the unique equipment identifier, if the unique equipment identifier is successful, storing the unique equipment identifier, otherwise, generating a universal code, and ending;
and step 3: if the system version number does not meet the requirement that the system version number is larger than or equal to Android6.0 and smaller than Android 10.0, performing the next step, otherwise, requesting authorization; if the unique equipment identifier is successfully acquired after authorization, the unique equipment identifier is stored, otherwise, the next step is carried out;
and 4, step 4: and acquiring Android _ id through a system API, and identifying and storing the unique equipment identifier of the current Android equipment based on the Android _ id.
2. The hybrid identification method for the unique identification of the Android device according to claim 1, characterized in that: in the step 2, the universal code is generated locally and is encrypted and written into a plurality of positions of the SD card.
3. The hybrid identification method for the unique identification of the Android device according to claim 1, characterized in that: in the step 3, the authorization is to inquire the READ _ PHONE _ STATE authority, if the device _ id is obtained, the success is achieved, otherwise, the step 4 is performed.
4. The hybrid identification method for the unique identification of the Android device according to claim 1, characterized in that: in the step 4, whether the android _ id is empty or not is judged, if not, the android _ id is stored locally for global use, otherwise, a universal code is generated locally, and the operation is finished.
5. The hybrid identification method for the unique identification of the Android device according to claim 4, characterized in that: the universal coding encryption is written into a plurality of positions of the SD card.
6. The hybrid identification method for the unique identification of the Android device according to claim 1, 2, 4 or 5, wherein: the head of the universal code is provided with a universal code mark.
CN202011028065.9A 2020-09-26 2020-09-26 Hybrid identification method for unique identification of Android device Pending CN111931254A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011028065.9A CN111931254A (en) 2020-09-26 2020-09-26 Hybrid identification method for unique identification of Android device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011028065.9A CN111931254A (en) 2020-09-26 2020-09-26 Hybrid identification method for unique identification of Android device

Publications (1)

Publication Number Publication Date
CN111931254A true CN111931254A (en) 2020-11-13

Family

ID=73333890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011028065.9A Pending CN111931254A (en) 2020-09-26 2020-09-26 Hybrid identification method for unique identification of Android device

Country Status (1)

Country Link
CN (1) CN111931254A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112507291A (en) * 2020-11-18 2021-03-16 北京深思数盾科技股份有限公司 Method and device for generating unique identifier of Android device
CN115687367A (en) * 2023-01-04 2023-02-03 成都精灵云科技有限公司 ID generation method and system based on ETCD key value version number
CN116702163A (en) * 2022-09-27 2023-09-05 荣耀终端有限公司 Authority management method and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375528A (en) * 2016-10-27 2017-02-01 上海斐讯数据通信技术有限公司 Mobile phone ID determining method and abnormal detection and processing method
CN110008758A (en) * 2019-03-29 2019-07-12 北京金山安全软件有限公司 ID obtaining method and device, electronic equipment and storage medium
CN110177093A (en) * 2019-05-22 2019-08-27 上海上湖信息技术有限公司 A kind of equipment, equipment and recognition methods for identification carrying out identification
CN111601304A (en) * 2020-04-29 2020-08-28 上海伊邦医药信息科技有限公司 Method for generating unique identification code of mobile terminal equipment for controlling security risk

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375528A (en) * 2016-10-27 2017-02-01 上海斐讯数据通信技术有限公司 Mobile phone ID determining method and abnormal detection and processing method
CN110008758A (en) * 2019-03-29 2019-07-12 北京金山安全软件有限公司 ID obtaining method and device, electronic equipment and storage medium
CN110177093A (en) * 2019-05-22 2019-08-27 上海上湖信息技术有限公司 A kind of equipment, equipment and recognition methods for identification carrying out identification
CN111601304A (en) * 2020-04-29 2020-08-28 上海伊邦医药信息科技有限公司 Method for generating unique identification code of mobile terminal equipment for controlling security risk

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
快乐丸: "Android10获取设备标识方案探究", 《HTTPS://WWW.JIANSHU.COM/P/E8B6CAFA91D5》 *
罗伊德: "Android开发-获取Android设备的唯一标识码(Android 6.0或更高)", 《HTTPS://WWW.CNBLOGS.COM/LLOYD-ZH/P/9805088.HTML》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112507291A (en) * 2020-11-18 2021-03-16 北京深思数盾科技股份有限公司 Method and device for generating unique identifier of Android device
CN112507291B (en) * 2020-11-18 2022-09-13 深思数盾(天津)科技有限公司 Method and device for generating unique identifier of Android device
CN116702163A (en) * 2022-09-27 2023-09-05 荣耀终端有限公司 Authority management method and terminal equipment
CN115687367A (en) * 2023-01-04 2023-02-03 成都精灵云科技有限公司 ID generation method and system based on ETCD key value version number

Similar Documents

Publication Publication Date Title
US10911939B2 (en) Embedded universal integrated circuit card profile management method and apparatus
CN111931254A (en) Hybrid identification method for unique identification of Android device
CN110178393B (en) Method, device and server for downloading subscription data set
US10257800B2 (en) Method and apparatus for authenticating access authorization in wireless communication system
US11340885B2 (en) Method and apparatus for updating operating system
US8028167B2 (en) Method and apparatus for certificate roll-over
EP3337219B1 (en) Carrier configuration processing method, device and system, and computer storage medium
EP3001713B1 (en) Method, apparatus and system for distributing virtual subscriber identity module data
CN109196891B (en) Method, terminal and server for managing subscription data set
US8707444B2 (en) Systems and methods for implementing application control security
US20120303954A1 (en) Managing method, device and terminal for application program
US11234131B2 (en) Information verification method and related device
CN113038451B (en) Machine-card binding method and device, communication module and storage medium
CN112202747A (en) Target device binding method and device, storage medium and electronic device
US11503474B2 (en) Technique for obtaining a network access profile
US20140025954A1 (en) Information processing device, information processing method, and computer program product
CN106133739A (en) Data are to the safeguard protection of the loading in the nonvolatile memory of safety element
CN109492384B (en) Method for receiving entity access and accessing password device, password device and entity
CN107305608A (en) The management method and device of terminal device
CN111211898B (en) Method for setting control authority of electronic equipment, electronic equipment and readable storage medium
US10531296B2 (en) Method for loading a subscription into an embedded security element of a mobile terminal
US8959602B2 (en) Modification of a secured parameter in a user identification module
US11698994B2 (en) Method for a first start-up operation of a secure element which is not fully customized
CN110287725B (en) Equipment, authority control method thereof and computer readable storage medium
KR20170089887A (en) Method of restoring a secure element to a factory state

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201113

RJ01 Rejection of invention patent application after publication