WO2017198155A1 - 一种启动adb调试的方法及终端 - Google Patents

一种启动adb调试的方法及终端 Download PDF

Info

Publication number
WO2017198155A1
WO2017198155A1 PCT/CN2017/084582 CN2017084582W WO2017198155A1 WO 2017198155 A1 WO2017198155 A1 WO 2017198155A1 CN 2017084582 W CN2017084582 W CN 2017084582W WO 2017198155 A1 WO2017198155 A1 WO 2017198155A1
Authority
WO
WIPO (PCT)
Prior art keywords
password
startup password
startup
terminal
random code
Prior art date
Application number
PCT/CN2017/084582
Other languages
English (en)
French (fr)
Inventor
姚梦雪
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017198155A1 publication Critical patent/WO2017198155A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation

Definitions

  • the present application relates to, but is not limited to, the field of communications, and in particular, to a method and terminal for initiating ADB debugging.
  • the Android Debug Bridge can debug Android devices, mainly for debugging bridges. With the ADB tool, you can manage the status of your device or mobile terminal emulator. There are also many mobile terminal operations, such as installing software, upgrading systems, running shell commands, and more. Therefore, the ADB connection is a bridge connecting the mobile terminal and the PC end equipped with the Android system, and the ADB connection allows the user to perform comprehensive operations on the mobile terminal on the PC.
  • the present application provides a method and terminal for starting ADB debugging.
  • the application provides a method for starting ADB debugging, the method comprising:
  • the ADB debugging is started according to the second startup password.
  • the generating the first activation password according to the random code and the medium access control MAC address of the terminal including: calculating, according to the first preset algorithm, the random code and the MAC address, to obtain the first Start password.
  • the calculating, by using the first preset algorithm, the random code and the MAC address, to obtain the first startup password including: using the random code, the MAC address, and multiple preset string constants Combining to obtain a first password; calculating the first password according to the fifth version of the message digest algorithm to obtain a second password; and calculating the second password according to the secure hash algorithm SHA256, to obtain the first password A startup password.
  • receiving the second startup password includes: receiving a second startup password input by the user; or receiving a second startup password sent by the terminal manufacturer side; wherein the second startup password is confirmed by the terminal manufacturer side
  • the ADB debugging permission is started, it is obtained according to the random code and the MAC address.
  • the method further includes: setting the usage frequency of the second startup password And determining whether the number of remaining uses of the second startup password is greater than zero, wherein the remaining usage times of the second startup password decreases as the number of ADB debug startups increases; if the remaining usage of the second startup password is used If the number of times is greater than zero, the ADB debugging is started according to the second startup password; if the remaining usage number of the second startup password is not greater than zero, then an instruction to start an Android debugging bridge ADB debugging is received, and generated according to the instruction.
  • a random code step is performed by: setting the usage frequency of the second startup password And determining whether the number of remaining uses of the second startup password is greater than zero, wherein the remaining usage times of the second startup password decreases as the number of ADB debug startups increases; if the remaining usage of the second startup password is used If the number of times is greater than zero, the ADB debugging is started according to the second startup password; if the remaining usage number of the second startup password is not greater than zero, then
  • the application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • the application further provides a terminal, where the terminal includes:
  • Receiving a generating module configured to receive an instruction to start an Android debug bridge ADB debugging, and generate a random code according to the instruction;
  • Generating a module configured to generate a first startup password according to the random code and a media access control MAC address of the terminal;
  • Receiving a matching module configured to receive a second startup password, and matching the second startup password with the first startup password
  • the startup module is configured to start ADB debugging according to the second startup password if the second startup password matches the first startup password.
  • the generating module is configured to use the random code and the MAC according to the first preset algorithm.
  • the address is calculated to obtain the first boot password.
  • the generating module is configured to combine the random code, the MAC address, and the plurality of preset string constants to obtain a first password; and calculate the first password according to the fifth version of the message digest algorithm. Obtaining a second password; calculating the second password according to the secure hash algorithm SHA256 to obtain the first startup password.
  • the receiving and matching module is configured to: receive a second startup password input by the user; or receive a second startup password sent by the terminal manufacturer side; wherein the second startup password is confirmed by the terminal manufacturer side
  • the ADB debugging permission is activated, it is obtained according to the random code and the MAC address.
  • the terminal further includes a determining module, where the determining module is configured to set a number of uses of the second boot password, and determine whether the remaining number of uses of the second boot password is greater than zero, wherein the The number of times of use of the second boot password decreases as the number of ADB debug starts increases; if the number of remaining uses of the second boot password is greater than zero, the ADB debug is started according to the second boot password; The number of remaining uses of the password is not greater than zero, and the receiving generation module is triggered.
  • the determining module is configured to set a number of uses of the second boot password, and determine whether the remaining number of uses of the second boot password is greater than zero, wherein the The number of times of use of the second boot password decreases as the number of ADB debug starts increases; if the number of remaining uses of the second boot password is greater than zero, the ADB debug is started according to the second boot password; The number of remaining uses of the password is not greater than zero, and the receiving generation module is triggered.
  • the first startup password is generated by using the random code and the MAC address, and the ADB debugging is started by matching the received second startup password with the first startup password, thereby solving the related art that the user can start the ADB debugging arbitrarily.
  • the problem that the ADB connection is frequent is reduced, the number of ADB connection operations of the user to the terminal is reduced, and the security of the terminal is ensured to the greatest extent.
  • FIG. 1 is a flow chart showing the steps of a method for starting ADB debugging in a first embodiment of the present invention
  • FIG. 2 is a flow chart showing the steps of calculating a random code and a MAC address according to a first preset algorithm to obtain a first boot password according to the first embodiment of the present invention
  • Figure 3 shows the activation of ADB in accordance with the second boot password in the first embodiment of the present invention.
  • Fig. 4 is a block diagram showing the structure of a terminal in the second embodiment of the present invention.
  • the current Android platform has no restrictions on ADB connections. As long as the driver installation of the PC is completed, any application and process can perform ADB connection. Because the privilege of the ADB is very large, there are many security risks in the arbitrariness of the ADB connection in the related technology, which causes great damage to the mobile terminal and the mobile terminal user. Therefore, it is necessary to reduce the ADB connection operation of the user to the mobile terminal as much as possible to ensure The security of the mobile terminal.
  • FIG. 1 it is a flow chart of steps of a method for starting ADB debugging in a first embodiment of the present invention, the method comprising the following steps:
  • Step 101 Receive an instruction to start an Android debug bridge ADB debugging, and generate a random code according to the instruction.
  • a random code is generated according to the instruction.
  • the random code can be set to a multi-digit number, for example, a five-digit number, or other multi-digit letters, and the specific digits and character types of the random code are not limited herein.
  • Step 102 Generate a first startup password according to the random code and the medium access control MAC address of the mobile terminal.
  • the terminal may save the first startup password generated according to the random code and the medium access control (MAC) address to facilitate matching with the second startup password.
  • MAC medium access control
  • Step 103 Receive a second startup password, and match the second startup password with the first startup password.
  • the terminal receives the second startup password, and matches the second startup password with the first startup password. If the second startup password matches the first startup password, the process proceeds to step 104. If the second startup password and the first startup password do not match, the second startup password needs to be re-entered.
  • the terminal may receive the second startup password input by the user, or receive the second startup password sent by the terminal manufacturer side, wherein the second startup password may be the terminal manufacturer side confirming that the terminal has the startup password.
  • ADB debugs permissions it is obtained based on random code and MAC address.
  • the terminal may first send the random code and the MAC address to the terminal manufacturer side, or the user sends the random code and the MAC address to the terminal manufacturer side, and then the terminal manufacturer side decides. Whether the terminal has the right to start ADB debugging, if the terminal has the right to start ADB debugging, the second startup password is generated according to the random code and the MAC address.
  • the terminal manufacturer side can determine according to the trust degree of the terminal.
  • Step 104 If the second startup password matches the first startup password, start ADB debugging according to the second startup password.
  • the ADB debugging is started according to the second startup password.
  • the second startup password is matched with the first startup password, it indicates that the obtained second startup password is a legal startup password, and the terminal improves the security of the terminal ADB connection when the terminal starts the ADB debugging according to the second startup password.
  • the second startup password is started according to the second startup password.
  • ADB debugging solves the problem that the ADB connection caused by the user can start ADB debugging arbitrarily in the related technology, and reduces the number of times the user connects to the terminal ADB, thereby reducing the damage to the application on the terminal and the terminal, and maximizing the damage. The security of the terminal is guaranteed.
  • the first preset algorithm calculates the random code and the MAC address to obtain a first boot password.
  • a flow chart of the first startup password is obtained.
  • the first startup password may include the following steps:
  • Step 201 combining a random code, a MAC address, and a plurality of preset string constants to obtain First password.
  • the random code, the MAC address, and the plurality of preset string constants may be arbitrarily combined to obtain the first password.
  • the first password may be: a first preset string constant + a random code + a second preset string constant + a MAC address + a third preset string constant.
  • Step 202 Calculate the first password according to the fifth version of the message digest algorithm to obtain a second password.
  • the first password may be calculated according to the fifth version of the message digest algorithm to obtain the second password.
  • Step 203 Calculate the second password according to the secure hash algorithm SHA256 to obtain a first startup password.
  • the second password may be calculated according to the Secure Hash Algorithm 256 (SHA256) to obtain the first startup password.
  • SHA256 Secure Hash Algorithm 256
  • the received second startup password may be obtained by generating a first startup password, that is, Similarly, according to the first preset algorithm, the random code and the MAC address are calculated to obtain a second startup password. In this way, when the second startup password and the first startup password are matched, as long as the second startup password is a legal startup password, the second startup password is easily matched with the first startup password, thereby starting ADB debugging.
  • the first preset algorithm is used to calculate the random code and the MAC address to obtain the first startup password, which increases the complexity and security of the first startup password, so that the user can only start the ADB debugging by legal means when starting the ADB debugging.
  • the number of times the user connects to the terminal ADB is reduced, and the security of the terminal is ensured.
  • the method may further include the following step:
  • Step 301 Set the number of times the second startup password is used, and determine whether the remaining usage number of the second startup password is greater than zero.
  • the number of times of using the second startup password can be set, and it is determined whether the remaining usage number of the second startup password is greater than zero. If it is greater than zero, the process proceeds to step 302. If it is not greater than zero, it proceeds to step 303.
  • the number of remaining uses of the second boot password decreases as the number of ADB debug starts increases. For example, if the number of times the second startup password is set to be 20 times, when the number of times the ADB debugging is started according to the second startup password is 5 times, the remaining usage number of the second startup password is 15 times, according to the second startup password. When the number of times of starting ADB debugging is increased to 6 times, the remaining number of times of using the second startup password is 14 times. In this way, when determining the validity of the second startup password, if the user needs to start ADB debugging frequently, the second startup password is not repeatedly received, which provides convenience for the user to start ADB debugging, while ensuring terminal security. Increased convenience for ADB connections.
  • Step 302 If the remaining number of the second startup password is greater than zero, start ADB debugging according to the second startup password.
  • the remaining number of the second startup password is greater than zero, it can be stated that the second startup password has security to a certain extent, and then the ADB debugging can be started according to the second startup password, so that the user does not need to re- Receiving the second startup password increases the convenience of starting ADB debugging.
  • Step 303 If the number of remaining uses of the second startup password is not greater than zero, enter a step of receiving an instruction to start the Android debug bridge ADB debugging, and generate a random code according to the instruction.
  • the remaining usage number of the second startup password is not greater than zero, in order to ensure the security of the terminal, it is necessary to re-receive the instruction for starting the ADB debugging, and generate a random code according to the instruction, so that it will be retrieved.
  • the first startup password and the second startup password are re-received to ensure the security of the terminal to the greatest extent.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • FIG. 4 it is a schematic structural diagram of a terminal according to a second embodiment of the present invention, where the terminal includes:
  • the receiving and generating module 401 is configured to receive an instruction for starting the debugging of the Android debugging bridge ADB, and generate a random code according to the instruction;
  • the generating module 402 is configured to generate a first startup password according to the random code and the medium access control MAC address of the terminal;
  • the receiving matching module 403 is configured to receive the second startup password, and match the second startup password with the first startup password;
  • the startup module 404 is configured to start ADB debugging according to the second startup password if the second startup password matches the first startup password.
  • the generating module 402 is configured to calculate the random code and the MAC address according to the first preset algorithm to obtain a first startup password.
  • the generating module 402 is configured to combine the random code, the MAC address, and the plurality of preset string constants to obtain the first password.
  • the first password is calculated to obtain the second password.
  • the password is calculated according to the secure hash algorithm SHA256, and the first startup password is obtained.
  • the receiving matching module 403 is configured to receive a second startup password input by the user; or receive a second startup password sent by the terminal manufacturer side; wherein the second startup password is confirmed by the terminal manufacturer side to have the startup ADB When debugging permissions, it is obtained based on random code and MAC address.
  • the terminal further includes a determining module, configured to set the number of times of using the second startup password, and determine whether the remaining usage times of the second startup password are greater than zero, wherein the remaining usage times of the second startup password are started with ADB debugging. If the number of times of use of the second startup password is greater than zero, the ADB debugging is started according to the second startup password; if the remaining usage of the second startup password is not greater than zero, the receiving generation module is triggered. .
  • a determining module configured to set the number of times of using the second startup password, and determine whether the remaining usage times of the second startup password are greater than zero, wherein the remaining usage times of the second startup password are started with ADB debugging. If the number of times of use of the second startup password is greater than zero, the ADB debugging is started according to the second startup password; if the remaining usage of the second startup password is not greater than zero, the receiving generation module is triggered.
  • computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer.
  • communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
  • the first startup password is generated by using the random code and the MAC address, and the ADB debugging is started by matching the received second startup password with the first startup password, thereby solving the related art that the user can start the ADB debugging arbitrarily.
  • the problem that the ADB connection is frequent is reduced, the number of ADB connection operations of the user to the terminal is reduced, and the security of the terminal is ensured to the greatest extent.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种启动ADB调试的方法及终端,其中,方法包括:接收一启动安卓调试桥ADB调试的指令,并根据指令生成一随机码(101);根据随机码和终端的介质访问控制MAC地址生成第一启动密码(102);接收第二启动密码,并将第二启动密码和第一启动密码进行匹配(103);若第二启动密码和第一启动密码相匹配,则根据第二启动密码启动ADB调试(104)。本方法减少了用户对终端进行ADB连接操作的次数,最大程度的保证了终端的安全性。

Description

一种启动ADB调试的方法及终端 技术领域
本申请涉及但不限于通信领域,尤其是涉及一种启动ADB调试的方法及终端。
背景技术
安卓调试桥(Android Debug Bridge,ADB)可以调试Android设备,主要起到调试桥的作用。借助ADB工具,可以管理设备或移动终端模拟器的状态。还可以进行很多移动终端操作,如安装软件、系统升级、运行shell命令等等。因此,ADB连接就是连接装有Android系统的移动终端与PC端的桥梁,利用ADB连接可以让用户在PC上对移动终端进行全面的操作。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
为了减少用户对终端的ADB连接操作的次数,保证终端的安全性,本申请提供了一种启动ADB调试的方法及终端。
本申请提供了一种启动ADB调试的方法,所述方法包括:
接收一启动安卓调试桥ADB调试的指令,并根据所述指令生成一随机码;
根据所述随机码和终端的介质访问控制MAC地址生成第一启动密码;
接收第二启动密码,并将所述第二启动密码和第一启动密码进行匹配;
若所述第二启动密码和第一启动密码相匹配,则根据所述第二启动密码启动ADB调试。
可选的,所述根据所述随机码和终端的介质访问控制MAC地址生成第一启动密码,包括:根据第一预设算法,对所述随机码和MAC地址进行计算,得到所述第一启动密码。
可选的,所述根据第一预设算法,对所述随机码和MAC地址进行计算,得到所述第一启动密码,包括:将所述随机码、MAC地址和多个预设字符串常量进行组合,得到第一密码;根据消息摘要算法第五版,对所述第一密码进行计算,得到第二密码;根据安全散列算法SHA256,对所述第二密码进行计算,得到所述第一启动密码。
可选的,接收第二启动密码包括:接收用户输入的第二启动密码;或者接收终端生产商侧发送的第二启动密码;其中,所述第二启动密码由终端生产商侧在确认终端具有启动ADB调试权限时,根据所述随机码和MAC地址得到。
可选的,所述若所述第二启动密码和第一启动密码相匹配,则根据所述第二启动密码启动ADB调试之后,所述方法还包括:设置所述第二启动密码的使用次数,并判断所述第二启动密码的剩余使用次数是否大于零,其中,所述第二启动密码的剩余使用次数随着ADB调试启动次数的增多而减少;若所述第二启动密码的剩余使用次数大于零,则根据所述第二启动密码启动ADB调试;若所述第二启动密码的剩余使用次数不大于零,则进入接收一启动安卓调试桥ADB调试的指令,并根据所述指令生成一随机码的步骤。
本申请另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
依据本申请的另一个方面,本申请还提供了一种终端,所述终端包括:
接收生成模块,设置成接收一启动安卓调试桥ADB调试的指令,并根据所述指令生成一随机码;
生成模块,设置成根据所述随机码和终端的介质访问控制MAC地址生成第一启动密码;
接收匹配模块,设置成接收第二启动密码,并将所述第二启动密码和第一启动密码进行匹配;
启动模块,设置成若所述第二启动密码和第一启动密码相匹配,则根据所述第二启动密码启动ADB调试。
可选的,所述生成模块设置成根据第一预设算法,对所述随机码和MAC 地址进行计算,得到所述第一启动密码。
可选的,所述生成模块设置成将所述随机码、MAC地址和多个预设字符串常量进行组合,得到第一密码;根据消息摘要算法第五版,对所述第一密码进行计算,得到第二密码;根据安全散列算法SHA256,对所述第二密码进行计算,得到所述第一启动密码。
可选的,所述接收匹配模块设置成:接收用户输入的第二启动密码;或者接收终端生产商侧发送的第二启动密码;其中,所述第二启动密码由终端生产商侧在确认终端具有启动ADB调试权限时,根据所述随机码和MAC地址得到。
可选的,所述终端还包括判断模块,所述判断模块设置成设置所述第二启动密码的使用次数,并判断所述第二启动密码的剩余使用次数是否大于零,其中,所述第二启动密码的剩余使用次数随着ADB调试启动次数的增多而减少;若所述第二启动密码的剩余使用次数大于零,则根据所述第二启动密码启动ADB调试;若所述第二启动密码的剩余使用次数不大于零,则触发所述接收生成模块。
本发明实施例的有益效果是:
本发明实施例通过随机码和MAC地址生成第一启动密码,并通过将接收的第二启动密码与第一启动密码进行匹配的方式来启动ADB调试,解决了相关技术中用户可以任意启动ADB调试造成的ADB连接较为频繁的问题,减少了用户对终端的ADB连接操作的次数,最大程度的保证了终端的安全性。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1表示本发明的第一实施例中启动ADB调试的方法的步骤流程图;
图2表示本发明的第一实施例中根据第一预设算法,对随机码和MAC地址进行计算,得到第一启动密码的步骤流程图;
图3表示本发明的第一实施例中在根据第二启动密码启动ADB调试之 后的步骤流程图;
图4表示本发明的第二实施例中终端的结构框图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
目前的Android平台对ADB连接没有任何限制,只要PC端的驱动安装完成,任何应用、进程都可以进行ADB连接。因为ADB的权限非常大,相关技术中ADB连接的任意性存在很多安全隐患,对移动终端以及移动终端用户会造成比较大的损害,因此需要尽可能减少用户对移动终端的ADB连接操作,以保证移动终端的安全性。
如图1所示,为本发明的第一实施例中启动ADB调试的方法的步骤流程图,该方法包括如下步骤:
步骤101,接收一启动安卓调试桥ADB调试的指令,并根据指令生成一随机码。
在本步骤中,当终端接收启动ADB调试的指令时,根据指令生成一随机码。该随机码可以设置为一多位数的数字,例如为一五位数数字,或者其他多位数的字母,在此并不对随机码的具体位数及字符类型进行限定。
步骤102,根据随机码和移动终端的介质访问控制MAC地址生成第一启动密码。
在本步骤中,终端可以将根据随机码和介质访问控制(MAC)地址生成的第一启动密码进行保存,以便于与第二启动密码进行匹配。
步骤103,接收第二启动密码,并将第二启动密码和第一启动密码进行匹配。
在本步骤中,终端接收第二启动密码,并将第二启动密码和第一启动密码进行匹配,其中,若第二启动密码和第一启动密码相匹配,则进入步骤104。 若第二启动密码和第一启动密码不匹配,则需要重新输入第二启动密码。
终端在接收第二启动密码时,可以接收用户输入的第二启动密码,或者接收终端生产商侧发送的第二启动密码,其中,该第二启动密码可以为终端生产商侧在确认终端具有启动ADB调试权限时,根据随机码和MAC地址得到。此外,终端在接收第二启动密码前,可以先由终端将随机码和MAC地址发送至终端生产商侧,或者由用户将随机码和MAC地址发送至终端生产商侧,然后终端生产商侧决定该终端是否具有启动ADB调试权限,若该终端具有启动ADB调试的权限,则根据随机码和MAC地址生成第二启动密码。终端生产商侧在决定该终端是否具有启动ADB调试权限时,可以根据终端的信任度等方面进行判定。
步骤104,若第二启动密码和第一启动密码相匹配,则根据第二启动密码启动ADB调试。
在本步骤中,若第二启动密码和第一启动密码相匹配,则根据第二启动密码启动ADB调试。当第二启动密码和第一启动密码相匹配时,说明获得的第二启动密码为合法的启动密码,则终端根据第二启动密码启动ADB调试时,提高了终端ADB连接的安全性。
这样,在本发明的实施例中,通过将接收的第二启动密码和终端生成的第一启动密码进行匹配,当第二启动密码与第一启动密码相匹配时,则根据第二启动密码启动ADB调试,解决了相关技术中用户可以任意启动ADB调试造成的ADB连接较为频繁的问题,减少了用户对终端ADB连接操作的次数,从而减小了对终端及终端上应用的损害,最大程度的保证了终端的安全性。
此外,可选的,为了保证第一启动密码的安全性,从而保证与第一启动密码相匹配的第二启动密码的安全性,在根据随机码和MAC地址生成第一启动密码时,可以根据第一预设算法,对随机码和MAC地址进行计算,得到第一启动密码。如图2所述,为根据第一预设算法,对随机码和MAC地址进行计算,得到第一启动密码的步骤流程图,得到第一启动密码时可以包括如下步骤:
步骤201,将随机码、MAC地址和多个预设字符串常量进行组合,得到 第一密码。
在本步骤中,可以将随机码、MAC地址和多个预设字符串常量进行任意组合,得到第一密码。例如,第一密码可以为:第一预设字符串常量+随机码+第二预设字符串常量+MAC地址+第三预设字符串常量。
步骤202,根据消息摘要算法第五版,对第一密码进行计算,得到第二密码。
在本步骤中,在得到第一密码之后,为了增加第一密码的安全性,可以根据消息摘要算法第五版,对第一密码进行计算,得到第二密码。
步骤203,根据安全散列算法SHA256,对第二密码进行计算,得到第一启动密码。
在本步骤中,在得到第二密码之后,为了加强第二密码的安全性,则可以根据安全散列算法-256(Secure Hash Algorithm256,SHA256)对第二密码进行计算,得到第一启动密码。
此外,在得到第一启动密码之后,为了保证终端接收的第二启动密码能够很好的和第一启动密码进行匹配,则接收的第二启动密码可以采用生成第一启动密码的方法得到,即同样根据第一预设算法,对随机码和MAC地址进行计算,得到第二启动密码。这样,在将第二启动密码和第一启动密码进行匹配时,只要第二启动密码是合法的启动密码,则第二启动密码就很容易和第一启动密码匹配成功,从而启动ADB调试。
通过第一预设算法对随机码和MAC地址进行计算,得到第一启动密码,增加了第一启动密码的复杂性和安全性,使得用户在启动ADB调试时,只能通过合法途径启动ADB调试,减少了用户对终端ADB连接操作的次数,保证了终端的安全性。
另外,在保证启动ADB调试的合法性的同时,还需要尽可能的为用户启动ADB调试提供方便,因此在根据第二启动密码启动ADB调试之后,如图3所示,该方法还可以包括如下步骤:
步骤301,设置第二启动密码的使用次数,并判断第二启动密码的剩余使用次数是否大于零。
在本步骤中,当确认第二启动密码可以启动ADB调试之后,可以设置第二启动密码的使用次数,并判断第二启动密码的剩余使用次数是否大于零,若大于零,则进入步骤302,若不大于零,则进入步骤303。
第二启动密码的剩余使用次数随着ADB调试启动次数的增多而减少。例如,设置第二启动密码的使用次数为20次,则当根据第二启动密码启动ADB调试的次数为5次时,则第二启动密码的剩余使用次数为15次,当根据第二启动密码启动ADB调试的次数增加为6次时,第二启动密码的剩余使用次数为14次。这样,当确定第二启动密码的合法性时,如果用户需要频繁的启动ADB调试,则不用重复的接收第二启动密码,为用户启动ADB调试提供了方便,在保证了终端安全性的同时,增加了ADB连接的便利性。
步骤302,若第二启动密码的剩余次数大于零,则根据第二启动密码启动ADB调试。
在本步骤中,若第二启动密码的剩余次数大于零,则可以说明第二启动密码在一定程度上具有安全性,则可以根据第二启动密码启动ADB调试,这样,用户就不需要再重新接收第二启动密码,增加了启动ADB调试的便利性。
步骤303,若所述第二启动密码的剩余使用次数不大于零,则进入接收一启动安卓调试桥ADB调试的指令,并根据指令生成一随机码的步骤。
在本步骤中,若第二启动密码的剩余使用次数不大于零,则为了保证终端的安全性,则需要重新接收启动ADB调试的指令,并根据指令生成一随机码,这样,就会重新得到第一启动密码,并重新接收第二启动密码,最大程度的保证了终端的安全性。
这样,通过设置第二启动密码的使用次数,可以在最大程度保证终端安全性的同时,增加用户使用第二启动密码启动ADB调试的便利性。
本发明实施例另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
依据本发明实施例的另一个方面,如图4所示,为本发明的第二实施例中终端的结构示意图,该终端包括:
接收生成模块401,设置成接收一启动安卓调试桥ADB调试的指令,并根据指令生成一随机码;
生成模块402,设置成根据随机码和终端的介质访问控制MAC地址生成第一启动密码;
接收匹配模块403,设置成接收第二启动密码,并将第二启动密码和第一启动密码进行匹配;
启动模块404,设置成若第二启动密码和第一启动密码相匹配,则根据第二启动密码启动ADB调试。
可选的,生成模块402设置成,根据第一预设算法,对随机码和MAC地址进行计算,得到第一启动密码。
可选的,生成模块402设置成,将随机码、MAC地址和多个预设字符串常量进行组合,得到第一密码;根据消息摘要算法第五版,对第一密码进行计算,得到第二密码;根据安全散列算法SHA256,对第二密码进行计算,得到第一启动密码。
可选的,接收匹配模块403设置成,接收用户输入的第二启动密码;或者接收终端生产商侧发送的第二启动密码;其中,第二启动密码由终端生产商侧在确认终端具有启动ADB调试权限时,根据随机码和MAC地址得到。
可选的,终端还包括判断模块,设置成设置第二启动密码的使用次数,并判断第二启动密码的剩余使用次数是否大于零,其中,第二启动密码的剩余使用次数随着ADB调试启动次数的增多而减少;若所述第二启动密码的剩余使用次数大于零,则根据第二启动密码启动ADB调试;若所述第二启动密码的剩余使用次数不大于零,则触发接收生成模块。
以上所述的是本发明的优选实施例,应当指出对于本技术领域的普通人员来说,在不脱离本发明实施例所述的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本申请的保护范围内。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一 定对应于物理单元的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或者所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
工业实用性
本发明实施例通过随机码和MAC地址生成第一启动密码,并通过将接收的第二启动密码与第一启动密码进行匹配的方式来启动ADB调试,解决了相关技术中用户可以任意启动ADB调试造成的ADB连接较为频繁的问题,减少了用户对终端的ADB连接操作的次数,最大程度的保证了终端的安全性。

Claims (10)

  1. 一种启动ADB调试的方法,包括:
    接收一启动安卓调试桥ADB调试的指令,并根据所述指令生成一随机码;
    根据所述随机码和终端的介质访问控制MAC地址生成第一启动密码;
    接收第二启动密码,并将所述第二启动密码和第一启动密码进行匹配;
    若所述第二启动密码和第一启动密码相匹配,则根据所述第二启动密码启动ADB调试。
  2. 根据权利要求1所述的方法,其中,所述根据所述随机码和终端的介质访问控制MAC地址生成第一启动密码,包括:
    根据第一预设算法,对所述随机码和MAC地址进行计算,得到所述第一启动密码。
  3. 根据权利要求2所述的方法,其中,所述根据第一预设算法,对所述随机码和MAC地址进行计算,得到所述第一启动密码,包括:
    将所述随机码、MAC地址和多个预设字符串常量进行组合,得到第一密码;
    根据消息摘要算法第五版,对所述第一密码进行计算,得到第二密码;
    根据安全散列算法SHA256,对所述第二密码进行计算,得到所述第一启动密码。
  4. 根据权利要求1所述的方法,其中,接收第二启动密码包括:
    接收用户输入的第二启动密码;或者
    接收终端生产商侧发送的第二启动密码;其中,所述第二启动密码由终端生产商侧在确认终端具有启动ADB调试权限时,根据所述随机码和MAC地址得到。
  5. 根据权利要求1所述的方法,所述若所述第二启动密码和第一启动密码相匹配,则根据所述第二启动密码启动ADB调试之后,所述方法还包括:
    设置所述第二启动密码的使用次数,并判断所述第二启动密码的剩余使用次数是否大于零,其中,所述第二启动密码的剩余使用次数随着ADB调试启动次数的增多而减少;
    若所述第二启动密码的剩余使用次数大于零,则根据所述第二启动密码启动ADB调试;
    若所述第二启动密码的剩余使用次数不大于零,则进入接收一启动安卓调试桥ADB调试的指令,并根据所述指令生成一随机码的步骤。
  6. 一种终端,包括:
    接收生成模块,设置成接收一启动安卓调试桥ADB调试的指令,并根据所述指令生成一随机码;
    生成模块,设置成根据所述随机码和终端的介质访问控制MAC地址生成第一启动密码;
    接收匹配模块,设置成接收第二启动密码,并将所述第二启动密码和第一启动密码进行匹配;
    启动模块,设置成若所述第二启动密码和第一启动密码相匹配,则根据所述第二启动密码启动ADB调试。
  7. 根据权利要求6所述的终端,其中,所述生成模块设置成根据第一预设算法,对所述随机码和MAC地址进行计算,得到所述第一启动密码。
  8. 根据权利要求7所述的终端,其中,所述生成模块设置成:将所述随机码、MAC地址和多个预设字符串常量进行组合,得到第一密码;根据消息摘要算法第五版,对所述第一密码进行计算,得到第二密码;根据安全散列算法SHA256,对所述第二密码进行计算,得到所述第一启动密码。
  9. 根据权利要求6所述的终端,其中,所述接收匹配模块设置成:接收用户输入的第二启动密码;或者接收终端生产商侧发送的第二启动密码;其中,所述第二启动密码由终端生产商侧在确认终端具有启动ADB调试权限时,根据所述随机码和MAC地址得到。
  10. 根据权利要求6所述的终端,还包括判断模块,所述判断模块设置成设置所述第二启动密码的使用次数,并判断所述第二启动密码的剩余使用次数是否大于零,其中,所述第二启动密码的剩余使用次数随着ADB调试启动次数的增多而减少;若所述第二启动密码的剩余使用次数大于零,则根据所述第二启动密码启动ADB调试;若所述第二启动密码的剩余使用次数不大于零,则触发所述接收生成模块。
PCT/CN2017/084582 2016-05-18 2017-05-16 一种启动adb调试的方法及终端 WO2017198155A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610330294.3A CN107402876A (zh) 2016-05-18 2016-05-18 一种启动adb调试的方法及终端
CN201610330294.3 2016-05-18

Publications (1)

Publication Number Publication Date
WO2017198155A1 true WO2017198155A1 (zh) 2017-11-23

Family

ID=60325713

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/084582 WO2017198155A1 (zh) 2016-05-18 2017-05-16 一种启动adb调试的方法及终端

Country Status (2)

Country Link
CN (1) CN107402876A (zh)
WO (1) WO2017198155A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109089252A (zh) * 2018-09-26 2018-12-25 广州高清视信数码科技股份有限公司 一种安卓智能设备的adb连接控制方法、系统和装置
CN109711143A (zh) * 2018-12-11 2019-05-03 北京云测信息技术有限公司 一种基于adb识别Android设备的方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442398B (zh) * 2019-08-09 2022-11-29 四川虹美智能科技有限公司 一种adb工具启动方法、智能设备和系统
CN112818331A (zh) * 2021-01-20 2021-05-18 深圳市智微智能软件开发有限公司 一种adb工具加密控制方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1234081C (zh) * 2003-09-25 2005-12-28 联想(北京)有限公司 利用bios通过身份认证实现安全访问硬盘的方法
CN104915607A (zh) * 2015-04-28 2015-09-16 武汉理工大学 一种基于移动终端的密码数据处理和交换方法
CN105227521A (zh) * 2014-06-09 2016-01-06 中兴通讯股份有限公司 通信终端及其安全管理方法、装置
CN105279460A (zh) * 2014-07-24 2016-01-27 中兴通讯股份有限公司 一种usb调试模式接口启动的方法、装置及终端
US20160042191A1 (en) * 2014-08-11 2016-02-11 North Carolina State University Programmable interface for extending security of application-based operating system, such as android

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440467B (zh) * 2013-08-30 2016-06-15 广东欧珀移动通信有限公司 利用adb连接控制移动终端的方法
US20150370680A1 (en) * 2014-06-20 2015-12-24 Halo-Digi Technology Co., Ltd. Method for transmitting human input event and electrical device
CN104134026B (zh) * 2014-07-30 2017-10-17 广东欧珀移动通信有限公司 一种应用于移动终端的深度安全解锁方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1234081C (zh) * 2003-09-25 2005-12-28 联想(北京)有限公司 利用bios通过身份认证实现安全访问硬盘的方法
CN105227521A (zh) * 2014-06-09 2016-01-06 中兴通讯股份有限公司 通信终端及其安全管理方法、装置
CN105279460A (zh) * 2014-07-24 2016-01-27 中兴通讯股份有限公司 一种usb调试模式接口启动的方法、装置及终端
US20160042191A1 (en) * 2014-08-11 2016-02-11 North Carolina State University Programmable interface for extending security of application-based operating system, such as android
CN104915607A (zh) * 2015-04-28 2015-09-16 武汉理工大学 一种基于移动终端的密码数据处理和交换方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109089252A (zh) * 2018-09-26 2018-12-25 广州高清视信数码科技股份有限公司 一种安卓智能设备的adb连接控制方法、系统和装置
CN109711143A (zh) * 2018-12-11 2019-05-03 北京云测信息技术有限公司 一种基于adb识别Android设备的方法

Also Published As

Publication number Publication date
CN107402876A (zh) 2017-11-28

Similar Documents

Publication Publication Date Title
WO2017198155A1 (zh) 一种启动adb调试的方法及终端
KR102204733B1 (ko) 계정 로그인을 위한 방법, 장치, 및 서버
JP5873571B2 (ja) アプリケーション・データを処理するための方法及び計算ノード
US10162565B2 (en) Data erasure of a target device
US20100082955A1 (en) Verification of chipset firmware updates
US20170223539A1 (en) Authentication method, wireless router and computer storage medium
US20210019418A1 (en) Technique for authentication and prerequisite checks for software updates
KR102147026B1 (ko) 애플리케이션 다운로드 방법 및 디바이스
US20170134384A1 (en) Method and device for obtaining superuser permission
JP2019071053A (ja) 認証の加速のための信頼できるストレージデバイスでのチェックサムの生成
CN107360165B (zh) 终端设备、云服务器以及管控操作系统的方法及装置
WO2016062146A1 (zh) 序列号信息的更新方法、装置及终端
JP2015201091A (ja) 通信端末装置、通信端末装置の起動方法およびコンピュータプログラム
US9430638B2 (en) Authentication method, authentication apparatus and authentication device
US20180337922A1 (en) Method and device for controlling smart device, server and storage medium
CN112148314A (zh) 一种嵌入式系统的镜像验证方法、装置、设备及存储介质
EP3553653A1 (en) System reset method, apparatus and electronic device
JP2006268861A (ja) ユーザーデータに対するコンピュータのアクセスを制御する方法および制御装置
US11354107B2 (en) Communicating a data image for installing an operating system
CN111046389A (zh) 固件组件安全更新的方法以及用以实施的携行计算机站
CN110781527B (zh) 一种控制寄存器保护方法与装置
CN110968852B (zh) 一种虚拟机密码管理方法、系统、设备及计算机存储介质
CN114282205A (zh) 固件启动方法及装置、计算机可读存储介质
CN108121562B (zh) 固件版本切换方法、电子设备和bios芯片
CN113067697A (zh) 一种远程密码输入方法、存储介质、装置及设备

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17798718

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17798718

Country of ref document: EP

Kind code of ref document: A1