Authentication method, device and system based on Android debugging bridge and storage medium

Replace the user's manual confirmation process through certificate authentication, and the Android debugging bridge authentication certificate is authenticated using the certificate authorization center certificate, which solves the problem that devices without interactive functions in the existing technology cannot realize adb connection authentication, and realizes efficient and secure adb connection Certification.

CN119402267APending Publication Date: 2025-02-07JINGWEI HIRAIN (TIANJIN) RES&DEV CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411563175.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing Android debugging bridge connection authentication solution requires the user to manually confirm whether the key sent by the host computer is trustworthy, resulting in devices that do not have interactive functions that cannot implement adb connection authentication.

Method used

By using certificate authentication instead of the user's manual confirmation process, the Android debugging bridge authentication certificate is authenticated using the preset certificate authorization center certificate to authenticate the legality of the public key, thereby determining whether to establish an Android debugging bridge connection with the host computer.

Benefits of technology

On the premise of ensuring the trust of the public key, the device's dependence on interactive functions is reduced, the adb connection authentication of devices that do not have interactive functions is realized, and information security is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402267A_ABST
    Figure CN119402267A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an authentication method, device and system based on an Android debugging bridge and a storage medium. The method comprises the following steps: storing an Android debugging bridge authentication certificate sent by an Android debugging bridge server; sending the first random number to an Android debugging bridge server; receiving a first signature sent by the Android debugging bridge server; authenticating the Android debugging bridge authentication certificate by using a preset certificate authorization center certificate; and after the authentication of the Android debugging bridge authentication certificate is passed, authenticating the first signature by using a first public key and a first random number in the Android debugging bridge authentication certificate to obtain an authentication result. Visibly, in the embodiment of the invention, the android debugging bridge authentication certificate comprises the first public key, so that the android debugging bridge authentication certificate is authenticated by using the certificate authorization center certificate, namely, the authentication of the legality of the public key is realized, the process of manually confirming the legality of the public key by a user can be replaced, and the user experience is improved. And the Android debugging bridge connection authentication of equipment without an interaction function is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and more specifically, to an authentication method, device, system and storage medium based on an Android debugging bridge. Background Art

[0002] To establish an Android Debug Bridge (adb) connection between the host computer and the device, the Android Debug Bridge Server (adb server) of the host computer and the Android Debug Bridge Daemon (adbd) of the device need to perform communication connection authentication.

[0003] In the existing adb connection authentication scheme, the user is required to manually confirm on the device whether the key sent by the host computer is credible, that is, the device must have an interactive function. Therefore, a device without an interactive function cannot be deployed according to the existing adb connection authentication scheme, and adb connection authentication of a device without an interactive function cannot be implemented. Summary of the invention

[0004] In view of this, the embodiments of the present application disclose an authentication method, device, system and storage medium based on Android Debug Bridge, which uses certificate authentication to replace the user's manual confirmation process to implement adb connection authentication for devices that do not have interactive functions.

[0005] The technical solutions provided by the embodiments of this application are as follows:

[0006] In a first aspect, an embodiment of the present application provides an authentication method based on an Android debugging bridge, the method comprising:

[0007] An Android debugging bridge authentication certificate sent by an Android debugging bridge server of a host computer is stored, wherein the Android debugging bridge authentication certificate includes: a first public key in a first key pair;

[0008] Sending a first random number to the Android Debug Bridge server;

[0009] Receiving a first signature sent by the Android Debug Bridge server, where the first signature is obtained by signing the first random number using a first private key in the first key pair;

[0010] Authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate;

[0011] After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result, and the authentication result is used to determine whether to establish an Android Debug Bridge connection with the host computer.

[0012] In a possible implementation, the Android Debug Bridge authentication certificate further includes common name information, and the method further includes:

[0013] Receiving the Android Debug Bridge authentication certificate;

[0014] Verifying the generic information using the device identification;

[0015] The Android Debug Bridge authentication certificate sent by the Android Debug Bridge server storing the host computer includes:

[0016] After the generic information is verified, the Android Debug Bridge authentication certificate is stored.

[0017] In a possible implementation, the method further includes:

[0018] Receiving a connection request sent by the host computer, wherein the connection request carries a user name and a host computer identifier;

[0019] Use the whitelist to verify the user name and the host computer ID:

[0020] After the user name and the host computer identifier are verified, an Android debugging bridge connection with the host computer is established based on the connection request.

[0021] In a possible implementation, the method further includes:

[0022] The operation information corresponding to the Android debugging bridge connection is recorded, wherein the operation information includes the user name, the host computer identifier and the operation instruction.

[0023] In a possible implementation, the Android Debug Bridge authentication certificate sent by the Android Debug Bridge server storing the host computer includes:

[0024] Store the Android Debug Bridge authentication certificate in a temporary directory.

[0025] In a possible implementation, the Android Debug Bridge authentication certificate and the first private key are stored in a first loading directory of the host computer, and a second loading directory of the host computer is used to store a second key pair, wherein the second key pair includes a second private key and a second public key.

[0026] In a second aspect, an embodiment of the present application provides an authentication device based on an Android debugging bridge, the device comprising:

[0027] A storage module, used for storing an Android Debug Bridge authentication certificate sent by an Android Debug Bridge server of a host computer, wherein the Android Debug Bridge authentication certificate includes: a first public key in a first key pair;

[0028] A sending module, used for sending a first random number to the Android debugging bridge server;

[0029] A receiving module, configured to receive a first signature sent by the Android Debug Bridge server, where the first signature is obtained by signing the first random number using a first private key in the first key pair;

[0030] An authentication module, used to authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate;

[0031] The authentication module is also used to authenticate the first signature using the first public key and the first random number after the Android debug bridge authentication certificate is authenticated, to obtain an authentication result, and the authentication result is used to determine whether to establish an Android debug bridge connection with the host computer.

[0032] In a third aspect, an embodiment of the present application provides an authentication system based on an Android debugging bridge, the system comprising a host computer and a device, the host computer comprising: an Android debugging bridge server, the device comprising: an Android debugging bridge daemon process;

[0033] The Android Debug Bridge server is used to send an Android Debug Bridge authentication certificate to the Android Debug Bridge daemon, wherein the Android Debug Bridge authentication certificate includes: a first public key in a first key pair;

[0034] The Android Debug Bridge daemon is used to store the Android Debug Bridge authentication certificate and send a first random number to an Android Debug Bridge server;

[0035] The Android Debug Bridge server is further configured to sign the first random number according to the first private key in the first key pair to obtain a first signature, and send the first signature to the Android Debug Bridge daemon process;

[0036] The Android Debug Bridge daemon process is also used to authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate. After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result, and the authentication result is used to determine whether to establish an Android Debug Bridge connection with the host computer.

[0037] In a fourth aspect, an embodiment of the present application provides an authentication device based on an Android debugging bridge, including:

[0038] A memory for storing instructions;

[0039] A processor is used to execute the instructions in the memory to perform the authentication method based on the Android debugging bridge as described in any one of the first aspects above.

[0040] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the authentication generation method based on the Android debugging bridge as described in any one of the first aspects above.

[0041] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the authentication method based on the Android debugging bridge as described in any one of the above first aspects.

[0042] Based on the above technical solution, this application has the following beneficial effects:

[0043] The embodiment of the present application discloses an authentication method, device, system and storage medium based on Android Debug Bridge. The method includes: storing an Android Debug Bridge authentication certificate sent by an Android Debug Bridge server of a host computer, the Android Debug Bridge authentication certificate including: a first public key in a first key pair; sending a first random number to the Android Debug Bridge server; receiving a first signature sent by the Android Debug Bridge server, the first signature being obtained by signing the first random number using a first private key in a key pair; authenticating the Android Debug Bridge authentication certificate using a preset certificate authority certificate; after the Android Debug Bridge authentication certificate is authenticated, authenticating the first signature using the first public key and the first random number to obtain an authentication result, the authentication result being used to determine whether to establish an Android Debug Bridge connection with the host computer. It can be seen that in the embodiment of the present application, since the certificate authority certificate has the characteristic of verifying the legitimacy of the digital certificate, the certificate authority certificate can be used to authenticate the Android Debug Bridge authentication certificate; since the Android Debug Bridge authentication certificate includes the first public key in the first key pair, the certificate authority certificate is used to authenticate the Android Debug Bridge authentication certificate, that is, to achieve authentication of the legitimacy of the public key, which can replace the process of users manually confirming the legitimacy of the public key, reduce the device's dependence on interactive functions while ensuring the credibility of the public key, and achieve Android Debug Bridge connection authentication for devices that do not have interactive functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without paying any creative work.

[0045] Figure 1 Flowchart of the existing Android Debug Bridge connection authentication method;

[0046] Figure 2 A flowchart of an authentication method based on Android Debug Bridge disclosed in an embodiment of the present application;

[0047] Figure 3 A flowchart of another authentication method based on the Android Debug Bridge disclosed in an embodiment of the present application;

[0048] Figure 4 A flowchart of a method for generating an Android debug bridge authentication certificate and a first key pair disclosed in an embodiment of the present application;

[0049] Figure 5 A flowchart of another authentication method based on Android Debug Bridge disclosed in an embodiment of the present application;

[0050] Figure 6 This is a schematic diagram of the structure of an authentication device based on an Android debugging bridge disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] See also Figure 1 , is a flow chart of an existing Android debug bridge connection authentication method. The method includes:

[0053] ① Enter adb-related operation instructions in the Android Debug Bridge Client (adbclient) on the host computer to start the adb server on the host computer.

[0054] ②The adb server sends a connection request to the device, and the message corresponding to the connection request may be CONNECT(version, maxdata, "system-identity-string").

[0055] ③After receiving the connection request, adbd in the device generates a set of random numbers (token) and sends the token to the adb server. The corresponding message can be AUTH(TOKEN, 0, "data").

[0056] ④After receiving the token, adb server first determines whether the host computer has an available key file. i.If the host computer does not have an available key file, adb server generates a set of asymmetric key pairs (Rivest Shamir Adleman, RSA), which include a private key adbkey and a public key adbkey.pub. adbkey is used for signing, and adbkey.pub is used for signature verification, and then executes ⑤. ii.If the host computer has an available key file, adb server will skip the step of sending adbkey.pub and directly execute ⑧.

[0057] ⑤The adb server sends the adbkey.pub in the host computer to adbd for confirmation. The corresponding message type is RSAPUBLICKEY, and the corresponding message can be AUTH(RSAPUBLICKEY, 0, "data").

[0058] ⑥adbd forwards the adbkey.pub sent by the adb server to the framework, which prints the corresponding information of adbkey.pub on the device interface in the form of a pop-up window, waiting for the user to manually confirm. If the user returns a rejection, the connection fails; if the user returns a confirmation, continue to execute ⑦.

[0059] ⑦After adbd receives the confirmation message from the framework, it saves adbkey.pub, generates a set of tokens again, and sends the regenerated tokens to the adb server. The corresponding message can be AUTH(TOKEN, 0, "data").

[0060] ⑧The adb server uses the adbkey in the RSA key pair to sign the regenerated token, obtains the signature result, and sends the signature result to adbd. The corresponding message type is SIGNATURE, and the corresponding message can be AUTH(SIGNATURE, 0, "data").

[0061] ⑨After adbd receives the signature result sent by the adb server, it will use the adbkey.pub and token saved in the device to verify the signature result and obtain the verification result.

[0062] ⑩adbd will respond to this connection request based on the signature verification result. If the verification is successful, the connection is successful, and the corresponding message can be CONNECT(version, maxdata, "system-identity-string"); if the verification fails, a set of tokens will be returned, and the corresponding message can be AUTH(TOKEN, 0, "data"), requiring re-verification and jumping to ④.

[0063] It can be seen that in the existing adb connection authentication scheme, the user needs to manually confirm on the device whether the key sent by the host computer is credible, that is, the device must have an interactive function. Therefore, devices without interactive functions cannot be deployed according to the existing adb connection authentication scheme, and adb connection authentication of devices without interactive functions cannot be implemented. Moreover, the user confirms whether the key sent by the host computer is credible, and the user needs to understand the credible key and make an accurate judgment.

[0064] At present, in order to enable devices without interactive functions to achieve adb connection, some legal adbkey.pub will be directly stored in the corresponding folder of the device, so that the process of users manually confirming the legitimacy of the public key can be skipped. However, if some legal adbkey.pub is not stored in the corresponding folder of the device, adb connection cannot be achieved. Alternatively, the corresponding code of the framework will be modified to directly skip the process of users manually confirming the legitimacy of the public key, but in this way, the legitimacy of the public key cannot be verified.

[0065] To this end, the present application embodiment discloses an authentication method, device, system and storage medium based on the Android Debug Bridge, which uses a preset certificate authority certificate to authenticate the Android Debug Bridge authentication certificate to achieve authentication of the legitimacy of the public key, thereby replacing the process of the user manually confirming the legitimacy of the public key, reducing the device's dependence on interactive functions while ensuring the public key is credible, and achieving adb connection authentication for devices without interactive functions. Moreover, there is no need for the user to confirm whether the key sent by the host computer is credible, so the user does not need to understand the credible key and make an accurate judgment.

[0066] See also Figure 2 , a flowchart of an authentication method based on Android Debug Bridge disclosed in an embodiment of the present application, the method comprising:

[0067] S201. Store the Android Debug Bridge authentication certificate sent by the Android Debug Bridge server of the host computer.

[0068] The Android Debug Bridge (adb) authentication certificate may include: a first public key in a first key pair.

[0069] According to the basics of cryptography, a certificate authority (CA) can issue a certificate file that it trusts, also called a CA certificate. A CA certificate can issue a digital certificate with a specific function to a user and verify its legitimacy. In the embodiment of the present application, a CA certificate can be used to issue and verify an adb authentication certificate, and the public key in the RSA key pair is packaged in the adb authentication certificate. Based on the property that the CA certificate can verify the legitimacy of the digital certificate, the legitimacy of the public key is authenticated, so that the verification of the CA certificate is used to replace the user's confirmation of the public key during the adb connection authentication process.

[0070] It should be noted that before executing the authentication method based on the Android Debug Bridge provided in the embodiment of the present application, the CA certificate will be pre-installed on the device and the key file will be pre-installed on the host computer in the embodiment of the present application. The key file includes an adb authentication certificate and the first private key in the first key pair. The adb authentication certificate can be stored in a file named adbkey.pub, and the first private key in the first key pair can be stored in a file named adbkey, so as to be consistent with the corresponding file names in the existing adb connection authentication method.

[0071] S202: Send a first random number to an Android Debug Bridge server.

[0072] It should be noted that after storing the adb authentication certificate, the adbd in the device will generate a first random number and send the first random number to the adb server. Among them, the device in the embodiment of the present application can be an electronic control unit (Electronic Control Unit, ECU) of a vehicle, etc., and the embodiment of the present application does not limit this and can be set according to actual needs.

[0073] S203: Receive a first signature sent by the Android Debug Bridge server.

[0074] The first signature is obtained by signing the first random number using the first private key in the first key pair. In the embodiment of the present application, the adb server may sign the first random number using the first private key to obtain the first signature.

[0075] S204: Authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate.

[0076] It should be noted that in the prior art, public key authentication cannot be achieved in adbd. In the embodiment of the present application, CA certificate is pre-set in adbd, so that public key authentication can be achieved in adbd, and software code verification replaces user manual verification, which not only ensures security but also simplifies the operation steps.

[0077] S205. After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result.

[0078] The authentication result is used to determine whether to establish an adb connection with the host computer.

[0079] It can be understood that, since the first signature is obtained by signing the first random number using the first private key, the first signature can be authenticated using the first public key corresponding to the first private key and the first random number.

[0080] It can be seen that in the embodiment of the present application, since the CA certificate has the characteristic of verifying the legitimacy of the digital certificate, the CA certificate can be used to authenticate the adb authentication certificate; since the adb authentication certificate includes the first public key in the first key pair, the CA certificate is used to authenticate the adb authentication certificate, that is, to realize the authentication of the legitimacy of the public key, which can replace the process of the user manually confirming the legitimacy of the public key, reduce the device's dependence on interactive functions while ensuring the credibility of the public key, and realize adb connection authentication for devices that do not have interactive functions. Moreover, there is no need for the user to confirm whether the key sent by the host computer is credible, so the user does not need to understand the trusted key and make an accurate judgment, which is smarter and more convenient than user confirmation.

[0081] See also Figure 3 , a flowchart of another authentication method based on Android Debug Bridge disclosed in an embodiment of the present application, Figure 3 exist Figure 2 Based on the public authentication method based on Android Debug Bridge, the authentication method based on Android Debug Bridge is described in more detail. Figure 3 The authentication methods based on Android Debug Bridge include:

[0082] S301, receiving a connection request sent by an Android debugging bridge server of a host computer.

[0083] The connection request in the embodiment of the present application carries a user name and a host computer identifier, which is used by the host computer to request to establish an adb connection with the device, wherein the host computer identifier is used to uniquely identify the host computer.

[0084] It should be noted that, in the embodiment of the present application, before receiving the connection request sent by the adb server, it is necessary to generate the adb authentication certificate and the first key pair, store the adb authentication certificate and the first private key in the first key pair in the host computer, and pre-set the whitelist and CA certificate in the device. Among them, the whitelist includes the association information between the user name allowed to connect to the device and the host computer allowed to connect to the device.

[0085] See also Figure 4, which is a flowchart of a method for generating an Android debug bridge authentication certificate and a first key pair disclosed in an embodiment of the present application. In the embodiment of the present application, the terminal corresponding to the security personnel can obtain the device identification of the device; the terminal corresponding to the security personnel can upload the device identification to the host computer to apply for an adb authentication key; then the host computer can upload the device identification to the authentication server to apply for an adb authentication key; after receiving the device identification, the authentication server can generate a first key pair, use the device identification as the common name (CN) information, generate a certificate request, and generate an adb authentication certificate based on the certificate request and the first key pair using the CA certificate; then the authentication server can send the adb authentication certificate, the first private key and the CA certificate to the host computer; the host computer sends the adb authentication certificate, the first private key and the CA certificate to the terminal corresponding to the security personnel; then the security personnel can preset the CA certificate in the device, and store the adb authentication certificate and the first private key in the host computer. Among them, Figure 4 The device identifier will be set as the CN information in the adb authentication certificate to generate an adb authentication certificate. The CN information is one of the important parameters of the certificate, which identifies the certificate holder information. It can be seen that in the embodiment of the present application, the first key pair is bound to the device identifier to generate an adb authentication certificate. In this way, the device identifier can be verified later to ensure that the adb connection is made using the adb authentication certificate corresponding to the device, further improving the security of the adb connection.

[0086] In a possible implementation, in the embodiment of the present application, the user name and the host computer identification can be associated based on the device's allowed connection information to obtain association information, a whitelist can be generated based on the association information, and the whitelist can be preset in the device. For example: the device allows a user named a1 to establish an adb connection with the host computer 1 with the host computer identification b1, the device allows a user named a1 to establish an adb connection with the host computer 1 with the host computer identification b2, and the device allows a user named a2 to establish an adb connection with the host computer 1 with the host computer identification b2 and the host computer 2 with the host computer identification b3. A1, a2, b1, b2, and b3 are associated to obtain association information a1-b1, a1-b2, a2-b2, and a2-b3, and a whitelist is generated based on the association information. In this way, a user named a1 can request to establish an adb connection with the device on mobile phone 1, and a user named a2 can be directly rejected when requesting to establish an adb connection with the device on mobile phone 1, and so on. It should be understood that the above description is merely exemplary and should not be construed as limiting the embodiments of the present application.

[0087] In a possible implementation, the device in the embodiment of the present application may be an ECU, and accordingly, the device identifier may be an ECU identifier. The ECU identifier refers to the device number of the ECU, and the ECU identifier is the unique identifier of the ECU. The ECU identifier is written into the norflash on the board through the Unified Diagnostic Services (UDS) during the production line stage, and the ECU identifier is written into the board as a read-only attribute during the system startup stage. Norflash is a non-volatile memory.

[0088] S302: Use the whitelist to verify the user name and host computer ID.

[0089] In the embodiment of the present application, a whitelist is used to verify the user name and the host computer identification, that is, the identity of the host computer is verified. Only the connection request sent by a specific user in the whitelist on a specific host computer can pass the verification and continue to perform subsequent operations, thereby ensuring the information security of the device.

[0090] S303: After the user name and the host computer identifier are verified, a second random number is sent to the Android Debug Bridge server.

[0091] It should be noted that after the user name and the host computer identifier are verified, it can be determined that the received connection request is valid, and subsequent steps can be executed. After that, adbd can generate a second random number and send the second random number to adbserver.

[0092] S304: Receive the second signature sent by the Android Debug Bridge server.

[0093] The second signature is obtained by signing the second random number using the first private key. In the embodiment of the present application, the adb server may sign the second random number using the first private key to obtain the second signature, and send the second signature to adbd.

[0094] S305: After failing to obtain the Android Debug Bridge authentication certificate based on the second signature, send an authentication failure message to the Android Debug Bridge server.

[0095] It should be noted that after adbd receives the second signature, adbd will obtain the adb authentication certificate from the temporary directory for authentication. However, since the adb authentication certificate is not stored in the temporary directory, it will fail to obtain the adb authentication certificate. It is necessary to send an authentication failure message to the adb server so that the adb server can be triggered to send the adb authentication certificate to adbd.

[0096] S306: Receive the Android Debug Bridge authentication certificate sent by the Android Debug Bridge server based on the authentication failure message.

[0097] In the embodiment of the present application, after the adb server receives the authentication failure message, it will send the adb authentication certificate to adbd, and adbd can receive the adb authentication certificate.

[0098] In a possible implementation, the adb authentication certificate in the embodiment of the present application may include a first public key and CN information, wherein the CN information may be a device identifier of a certain device, and if the CN information is the device identifier of the device that receives the connection request in S301, the subsequent CN information may be verified.

[0099] S307: Use the device identification to verify the generic information.

[0100] The device identifier may be a device number of the device.

[0101] S308. After the generic information is verified, the Android Debug Bridge authentication certificate is stored.

[0102] It can be understood that S308 in the embodiment of the present application is similar to S201 in the above embodiment, and the same parts will not be repeated here.

[0103] In the embodiment of the present application, if the CN information verification passes, it means that the CN information is consistent with the device identification, and the device has received the adb authentication certificate corresponding to the device, that is, it has received the device's exclusive connection certificate. Only then will the adb authentication certificate be stored and subsequent steps will be executed, thereby further ensuring the information security of the device.

[0104] In a possible implementation, S308 in the embodiment of the present application may include: storing the adb authentication certificate in a temporary directory. The temporary directory may be / tmp, etc., which is not limited in the embodiment of the present application. All files in the temporary directory are temporary files and are deleted upon restart. This can ensure the timeliness of the adb connection to a certain extent and improve the security of the adb connection.

[0105] S309: Send the first random number to the Android Debug Bridge server.

[0106] It can be understood that S309 in the embodiment of the present application is the same as S202 in the above embodiment, so it is not repeated here.

[0107] S310. Receive a first signature sent by the Android Debug Bridge server.

[0108] It can be understood that S310 in the embodiment of the present application is the same as S203 in the above embodiment, so it is not repeated here.

[0109] S311. Authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate.

[0110] It can be understood that S311 in the embodiment of the present application is similar to S204 in the above embodiment, and the same parts will not be repeated here.

[0111] The CA certificate in the embodiment of the present application can be pre-set in a read-only directory. The read-only directory may be / etc, etc., which is not limited in the embodiment of the present application. Files in the read-only directory are read-only during normal use, which can enhance the security of the CA certificate to a certain extent. Moreover, the security and tamper-proof of the CA certificate can be ensured by pre-setting the CA certificate in code.

[0112] S312: After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result.

[0113] It can be understood that S312 in the embodiment of the present application is similar to S205 in the above embodiment, and the same parts will not be repeated here.

[0114] In a possible implementation, the adb authentication certificate and the first private key in the embodiment of the present application can be stored in the first loading directory of the host computer, and the second loading directory of the host computer can be used to store the second key pair, which can include the second private key and the second public key, the second private key is used for signing, and the second public key is used for signature verification, and the first loading directory and the second loading directory are different directories. In this way, the relevant authentication files for public key legitimacy authentication implemented by the CA certificate and the relevant authentication files for public key legitimacy authentication manually implemented by the user are stored in different directories of the host computer, so that the same host computer can implement adb connection authentication by sending adb authentication, and can also implement adb connection authentication by directly sending a public key. Among them, the first loading directory can be / root / .android / , etc., and the embodiment of the present application does not limit this.

[0115] It is impossible for the same host computer to connect only to devices pre-installed with CA certificates, so the compatibility of the existing adb connection authentication method and the authentication method based on the Android debug bridge provided in the embodiment of the present application in the same host computer must be ensured. In the implementation of the present application, the adb authentication certificate and the first private key are stored in the first loading directory of the host computer, so that the host computer obtains the adb authentication certificate and the first private key from a fixed path, and sends a specific key file to the device for CA certificate authentication. If the adb authentication certificate and the first private key do not exist in the first loading directory, the adb server can obtain the second key pair from the second loading directory, or automatically generate a second key that complies with the existing adb connection authentication method, and store the second key pair in the second loading directory, so as to use the existing adb connection authentication method for subsequent authentication. In this way, the compatibility of the existing adb connection authentication method and the authentication method based on the Android debug bridge provided in the embodiment of the present application in the same host computer is guaranteed.

[0116] S313: When the authentication result is successful, an Android debugging bridge connection with the host computer is established based on the connection request.

[0117] It should be noted that, when the authentication result is authentication failure, a third random number can be generated and sent to the adb server, wherein the third random number is used to instruct the adb server to resend the adb authentication certificate to adbd to achieve re-authentication.

[0118] S314. Record operation information corresponding to the Android Debug Bridge connection.

[0119] The operation information includes user name, host computer identification and operation instructions.

[0120] In an embodiment of the present application, the operation information corresponding to each connection request can be recorded during the access process, which makes it easier to track device usage records during debugging.

[0121] It can be seen that the use of certificate legitimacy authentication in the embodiment of the present application replaces the interactive confirmation process between the user and the device, reduces the device's dependence on the interactive function under the premise of ensuring the credibility of the public key, and realizes the adb connection authentication of devices without interactive functions. Moreover, only a specific user can establish an adb connection by sending a connection request in a specific host computer and sending a specific adb authentication certificate corresponding to the device, which effectively protects the information security of the device.

[0122] See also Figure 5 , is a flow chart of another authentication method based on Android Debug Bridge disclosed in an embodiment of the present application, the method comprising:

[0123] 1) Enter adb-related operation instructions in the adb client of the host computer to start the adb server in the host computer.

[0124] The preparations before authentication include: i) pre-setting the CA certificate for connection authentication on the device; ii) placing the key file for connection authentication in the specified directory of the host computer. The key file includes: adbkey.pub and adbkey. adbkey.pub stores the adb authentication certificate, which includes the public key, and adbkey stores the private key.

[0125] 2) The adb server sends a connection request to the device. The connection request message can be CONNECT(version, maxdata, "system-identity-string").

[0126] 3) After receiving the connection request, adbd in the device generates a set of random number tokens and sends the tokens to the adb server. The message for sending the token can be AUTH(TOKEN, 0, "data").

[0127] 4) After receiving the token, the adb server determines whether there is an available key file in the host computer and whether to generate a key file. Since the key file has been placed in step ii) of the pre-authentication preparation work, it will query the available key file.

[0128] 5) adb server signs the token using adbkey and sends the signature to adbd. The corresponding message type is SIGNATURE, and the corresponding message can be AUTH(SIGNATURE, 0, "data").

[0129] 6) After adbd receives the signature sent by the adb server, it will read adbkey.pub in / tmp for authentication. Since adbkey.pub is not stored in / tmp, it will return an authentication failure and request re-authentication. The corresponding message can be AUTH(TOKEN, 0, "data").

[0130] 7) After receiving the authentication failure message from adbd, adb server will automatically check whether there is any adbkey.pub that has not been sent under / root / .android / . It will also send the adbkey.pub that has been placed in the host computer to adbd for confirmation. The corresponding message type is RSAPUBKEY, and the corresponding message can be AUTH(RSAPUBLICKEY, 0, "data").

[0131] 8) adbd stores the adbkey.pub sent by the adb server directly in the / tmp directory, and generates a new set of tokens and sends them to the adb server. The corresponding message can be AUTH(TOKEN, 0, "data").

[0132] 9) adb server uses adbkey to sign the newly generated token and sends the signature result to adbd. The corresponding message type is SIGNATURE, and the corresponding message can be AUTH(SIGNATURE, 0, "data").

[0133] 10) After adbd receives the signature result sent by the adb server, it will use the CA certificate preset in the device to authenticate the legitimacy of the saved adbkey.pub. After the legitimacy of the saved adbkey.pub is authenticated, the signature result is authenticated using the public key in adbkey.pub and the newly generated token to obtain the authentication result.

[0134] 11) adbd will respond to this connection request based on the authentication result. If the authentication is successful, it will return a connection success message. Otherwise, it will return a set of tokens and require re-authentication, and the step will jump to 7).

[0135] It can be seen that the legitimacy authentication of the certificate used in the embodiment of the present application replaces the interactive confirmation process between the user and the device, which reduces the dependence of the device on the interactive function under the premise of ensuring the credibility of the public key, and creates the possibility of adb connection authentication for devices that do not have interactive functions. Moreover, the embodiment of the present application mainly modifies the two authentication messages RSAPUBLICKEY and SIGNATURE on the adb side, completely inherits the original logic on the adb side, ensures the reusability of the adb application of the host computer, and reduces maintenance costs. In addition, the adb authentication key used in the embodiment of the present application uses a specific loading path to ensure the compatibility of the same host computer with the existing adb connection authentication method.

[0136] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0137] In order to better implement the above-mentioned solution of the embodiment of the present application, relevant devices for implementing the above-mentioned solution are also provided below.

[0138] See also Figure 6 , a structural diagram of an authentication device based on an Android debugging bridge disclosed in an embodiment of the present application, the device includes:

[0139] The storage module 601 is used to store the Android Debug Bridge authentication certificate sent by the Android Debug Bridge server of the host computer, wherein the Android Debug Bridge authentication certificate includes: the first public key in the first key pair;

[0140] A sending module 602 is used to send a first random number to the Android Debug Bridge server;

[0141] A receiving module 603 is used to receive a first signature sent by the Android Debug Bridge server, where the first signature is obtained by signing the first random number using a first private key in the first key pair;

[0142] The authentication module 604 is used to authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate;

[0143] The authentication module 604 is also used to authenticate the first signature using the first public key and the first random number after the Android debug bridge authentication certificate is authenticated, to obtain an authentication result, and the authentication result is used to determine whether to establish an Android debug bridge connection with the host computer.

[0144] It can be seen that in the embodiment of the present application, since the CA certificate has the characteristic of verifying the legitimacy of the digital certificate, the CA certificate can be used to authenticate the adb authentication certificate; since the adb authentication certificate includes the first public key in the first key pair, the CA certificate is used to authenticate the adb authentication certificate, that is, to realize the authentication of the legitimacy of the public key, which can replace the process of the user manually confirming the legitimacy of the public key, reduce the device's dependence on interactive functions while ensuring the credibility of the public key, and realize adb connection authentication for devices that do not have interactive functions. Moreover, there is no need for the user to confirm whether the key sent by the host computer is credible, so the user does not need to understand the trusted key and make an accurate judgment, which is smarter and more convenient than user confirmation.

[0145] In a possible implementation, in the authentication device based on the Android Debug Bridge provided in the embodiment of the present application, the Android Debug Bridge authentication certificate also includes common name information, and the receiving module 603 is further used to receive the Android Debug Bridge authentication certificate;

[0146] The authentication module 604 is further used to verify the generic information using the device identification;

[0147] The storage module 601 is specifically used to store the Android Debug Bridge authentication certificate after the generic information is verified.

[0148] In a possible implementation, in the authentication device based on the Android debug bridge provided in the embodiment of the present application, the receiving module 603 is further used to receive a connection request sent by the host computer, wherein the connection request carries a user name and a host computer identifier;

[0149] The authentication module 604 is further used to verify the user name and the host computer identifier using a whitelist;

[0150] The device also includes:

[0151] An establishing module is used to establish an Android debugging bridge connection with the host computer based on the connection request after the user name and the host computer identifier are verified.

[0152] In a possible implementation, the authentication device based on the Android debugging bridge provided in the embodiment of the present application further includes:

[0153] The recording module is used to record the operation information corresponding to the Android debugging bridge connection, and the operation information includes the user name, the host computer identifier and the operation instruction.

[0154] In a possible implementation, in the authentication device based on the Android Debug Bridge provided in the embodiment of the present application, the storage module 601 is specifically used to store the Android Debug Bridge authentication certificate in a temporary directory.

[0155] In a possible implementation, the Android Debug Bridge authentication certificate and the first private key are stored in a first loading directory of the host computer, and a second loading directory of the host computer is used to store a second key pair, wherein the second key pair includes a second private key and a second public key.

[0156] It should be noted that the information interaction, execution process, etc. between the modules in the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.

[0157] The embodiment of the present application also discloses an authentication system based on an Android debugging bridge, the system comprising a host computer and a device, the host computer comprising: an Android debugging bridge server, the device comprising: an Android debugging bridge daemon process;

[0158] The Android Debug Bridge server is used to send an Android Debug Bridge authentication certificate to the Android Debug Bridge daemon, wherein the Android Debug Bridge authentication certificate includes: a first public key in a first key pair;

[0159] The Android Debug Bridge daemon is used to store the Android Debug Bridge authentication certificate and send a first random number to an Android Debug Bridge server;

[0160] The Android Debug Bridge server is further configured to sign the first random number according to the first private key in the first key pair to obtain a first signature, and send the first signature to the Android Debug Bridge daemon process;

[0161] The Android Debug Bridge daemon process is also used to authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate. After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result, and the authentication result is used to determine whether to establish an Android Debug Bridge connection with the host computer.

[0162] In a possible implementation, in the authentication system based on the Android Debug Bridge provided in the embodiment of the present application, the Android Debug Bridge authentication certificate further includes common name information;

[0163] The Android Debug Bridge daemon process is further used to receive the Android Debug Bridge authentication certificate;

[0164] The Android Debug Bridge daemon is further used to verify the generic information using the device identifier;

[0165] The Android Debug Bridge daemon process is specifically used to store the Android Debug Bridge authentication certificate after the generic information is verified.

[0166] In a possible implementation, in the authentication system based on the Android Debug Bridge provided in the embodiment of the present application, the Android Debug Bridge server is further used to send a connection request;

[0167] The Android Debug Bridge daemon process is also used to receive a connection request, wherein the connection request carries a user name and a host computer identifier;

[0168] The Android Debug Bridge daemon is also used to verify the user name and the host computer identifier using a whitelist:

[0169] The Android Debug Bridge daemon process is also used to establish an Android Debug Bridge connection with the host computer based on the connection request after the user name and the host computer identifier are verified.

[0170] In a possible implementation, in the authentication system based on the Android Debug Bridge provided in an embodiment of the present application, the Android Debug Bridge daemon process is also used to record operation information corresponding to the Android Debug Bridge connection, and the operation information includes the user name, the host computer identifier and the operation instruction.

[0171] In a possible implementation, in the authentication system based on the Android Debug Bridge provided in the embodiment of the present application, the Android Debug Bridge daemon process is specifically used to store the Android Debug Bridge authentication certificate in a temporary directory.

[0172] In one possible implementation, in the authentication system based on the Android Debug Bridge provided in an embodiment of the present application, the Android Debug Bridge authentication certificate and the first private key are stored in a first loading directory of the host computer, and the second loading directory of the host computer is used to store a second key pair, and the second key pair includes a second private key and a second public key.

[0173] It should be noted that the information interaction, execution process, etc. between the Android Debug Bridge server and the Android Debug Bridge daemon in the above-mentioned system are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.

[0174] Furthermore, the embodiment of the present application also provides an authentication device based on Android Debug Bridge, including:

[0175] A memory for storing instructions;

[0176] A processor is used to execute instructions in the memory to perform any implementation method of the authentication method based on the Android debugging bridge.

[0177] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any one of the implementation methods of the above-mentioned authentication method based on the Android debugging bridge.

[0178] Furthermore, an embodiment of the present application also provides a computer program product, which, when running on a terminal device, enables the terminal device to execute any one of the implementation methods of the above-mentioned authentication method based on the Android Debug Bridge.

[0179] It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0180] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the devices and systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0181] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0182] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0183] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An authentication method based on Android Debug Bridge, characterized in that: The method comprises: An Android debugging bridge authentication certificate sent by an Android debugging bridge server of a host computer is stored, wherein the Android debugging bridge authentication certificate includes: a first public key in a first key pair; Sending a first random number to the Android Debug Bridge server; Receive a first signature sent by the Android Debug Bridge server, where the first signature is obtained by signing the first random number using a first private key in the first key pair; Authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate; After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result, and the authentication result is used to determine whether to establish an Android Debug Bridge connection with the host computer.

2. The method according to claim 1, characterized in that The Android Debug Bridge authentication certificate also includes common name information, and the method further includes: Receiving the Android Debug Bridge authentication certificate; Verifying the generic information using the device identification; The Android Debug Bridge authentication certificate sent by the Android Debug Bridge server storing the host computer includes: After the generic information is verified, the Android Debug Bridge authentication certificate is stored.

3. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: Receiving a connection request sent by the host computer, wherein the connection request carries a user name and a host computer identifier; Use the whitelist to verify the user name and the host computer ID: After the user name and the host computer identifier are verified, an Android debugging bridge connection with the host computer is established based on the connection request.

4. The method according to claim 3, characterized in that The method further comprises: The operation information corresponding to the Android debugging bridge connection is recorded, wherein the operation information includes the user name, the host computer identifier and the operation instruction.

5. The method according to claim 1, characterized in that The Android Debug Bridge authentication certificate sent by the Android Debug Bridge server storing the host computer includes: Store the Android Debug Bridge authentication certificate in a temporary directory.

6. The method according to claim 1, characterized in that The Android Debug Bridge authentication certificate and the first private key are stored in a first loading directory of the host computer, and a second loading directory of the host computer is used to store a second key pair, wherein the second key pair includes a second private key and a second public key.

7. An authentication device based on Android debugging bridge, characterized in that: The device comprises: A storage module, used for storing an Android Debug Bridge authentication certificate sent by an Android Debug Bridge server of a host computer, wherein the Android Debug Bridge authentication certificate includes: a first public key in a first key pair; A sending module, used for sending a first random number to the Android debugging bridge server; A receiving module, configured to receive a first signature sent by the Android Debug Bridge server, where the first signature is obtained by signing the first random number using a first private key in the first key pair; An authentication module, used to authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate; The authentication module is also used to authenticate the first signature using the first public key and the first random number after the Android debug bridge authentication certificate is authenticated, to obtain an authentication result, and the authentication result is used to determine whether to establish an Android debug bridge connection with the host computer.

8. An authentication system based on Android debugging bridge, characterized in that: The system includes a host computer and a device, wherein the host computer includes: an Android debugging bridge server, and the device includes: an Android debugging bridge daemon process; The Android Debug Bridge server is used to send an Android Debug Bridge authentication certificate to the Android Debug Bridge daemon, wherein the Android Debug Bridge authentication certificate includes: a first public key in a first key pair; The Android Debug Bridge daemon is used to store the Android Debug Bridge authentication certificate and send a first random number to an Android Debug Bridge server; The Android Debug Bridge server is further configured to sign the first random number according to the first private key in the first key pair to obtain a first signature, and send the first signature to the Android Debug Bridge daemon process; The Android Debug Bridge daemon process is also used to authenticate the Android Debug Bridge authentication certificate using a preset certificate authority certificate. After the Android Debug Bridge authentication certificate is authenticated, the first signature is authenticated using the first public key and the first random number to obtain an authentication result, and the authentication result is used to determine whether to establish an Android Debug Bridge connection with the host computer.

9. An authentication device based on Android debugging bridge, characterized in that: include: A memory for storing instructions; A processor, configured to execute the instructions in the memory to execute the authentication method based on the Android debugging bridge as described in any one of claims 1 to 6.

10. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the authentication method based on the Android Debug Bridge according to any one of claims 1 to 6.

Citation Information

Cited By

  • Secure debugging bridge connection method and device, electronic equipment and storage medium

    CN122389104A