CN116305010B - ADB secure interaction method and device, electronic equipment and readable storage medium - Google Patents

ADB secure interaction method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116305010B
CN116305010B CN202310600007.6A CN202310600007A CN116305010B CN 116305010 B CN116305010 B CN 116305010B CN 202310600007 A CN202310600007 A CN 202310600007A CN 116305010 B CN116305010 B CN 116305010B
Authority
CN
China
Prior art keywords
verification code
encryption
instruction
android terminal
encrypted data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310600007.6A
Other languages
Chinese (zh)
Other versions
CN116305010A (en
Inventor
张峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chaoge Digital Technology Co ltd
Original Assignee
Beijing Chaoge Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chaoge Digital Technology Co ltd filed Critical Beijing Chaoge Digital Technology Co ltd
Priority to CN202310600007.6A priority Critical patent/CN116305010B/en
Publication of CN116305010A publication Critical patent/CN116305010A/en
Application granted granted Critical
Publication of CN116305010B publication Critical patent/CN116305010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Abstract

The application provides an ADB safe interaction method, which comprises the following steps: sending a first encryption instruction to the android terminal, wherein the first encryption instruction comprises an instruction for acquiring a verification code; receiving first encrypted data from the android terminal, wherein the first encrypted data comprises a verification code randomly generated by the android terminal; decrypting the first encrypted data to obtain a verification code; sending a second encryption instruction to the android terminal, wherein the second encryption instruction comprises a verification code and an operation instruction; receiving second encrypted data from the android terminal, wherein the second encrypted data comprises an execution result of the operation instruction; decrypting the second encrypted data and displaying the execution result. The application also provides an ADB safe interaction device of the android system, electronic equipment and a readable storage medium. Compared with the traditional ADB login mode, the ADB security interaction mechanism is not easy to break, has high security coefficient and can better ensure the security of an android system.

Description

ADB secure interaction method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an ADB secure interaction method, an ADB secure interaction device, an electronic device, and a readable storage medium.
Background
The Android adb is generally called Android Debug Bridge, which refers to an Android debug bridge, and the outside can log in an Android system from the background through the adb connection by a network or usb, so that the control right of the Android system is obtained.
Adb is originally a channel which is convenient for developers to know the running state of the Android system, control and debug the system. However, if the unsafe personnel control the system through the adb, the consequences are very serious, which not only threatens the system safety, but also causes technical leakage. Market is often refreshed, parameters are modified by ADBs, and some unsafe operations such as installing software are performed.
Although adb in the Android commercial release version is closed by default, a background switch is reserved by a common manufacturer, so that maintenance is facilitated if a problem occurs after a product is put into the market. The traditional safety mode is to design a coded switch or make a special action to open the switch entrance of the adb. Although these also provide some protection, the risk of leakage is still significant.
Disclosure of Invention
In view of the above, the embodiments of the present application provide an ADB secure interaction method, apparatus, electronic device, and readable storage medium that can effectively improve security and reduce leakage risk, so as to solve the problem in the prior art that the security of ADB login and operation is not high.
In a first aspect, the application discloses an android system ADB safe interaction method, which comprises the following steps:
sending a first encryption instruction to an android terminal, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
receiving first encrypted data from the android terminal, wherein the first encrypted data comprises a verification code randomly generated by the android terminal;
decrypting the first encrypted data to obtain the verification code;
sending a second encryption instruction to the android terminal, wherein the second encryption instruction comprises the verification code and an operation instruction;
receiving second encrypted data from the android terminal, wherein the second encrypted data comprises an execution result of the operation instruction;
decrypting the second encrypted data and displaying the execution result.
The application also discloses an ADB safe interaction method of the android system, which comprises the following steps:
receiving and decrypting a first encryption instruction from an upper computer, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
randomly generating a verification code and recording the verification code in a memory;
generating first encrypted data according to the verification code, and sending the first encrypted data to the upper computer;
receiving and decrypting a second encryption instruction from the upper computer, wherein the second encryption instruction comprises a verification code to be verified and an operation instruction;
comparing whether the verification code to be verified is consistent with the verification code in the memory, and executing the operation instruction if the verification code to be verified is consistent with the verification code in the memory;
and generating second encrypted data according to an execution result of the operation instruction, and sending the second encrypted data to the upper computer.
In a second aspect, the application discloses an android system ADB safe interaction device, which is applied to an upper computer and comprises:
the verification code request module is used for sending a first encryption instruction to the android terminal, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
the verification code acquisition module is used for receiving first encrypted data from the android terminal, wherein the first encrypted data comprises a verification code randomly generated by the android terminal;
the verification code decryption module decrypts the first encrypted data to obtain the verification code;
the operation instruction sending module is used for sending a second encryption instruction to the android terminal, wherein the second encryption instruction comprises the verification code and the operation instruction;
the execution result acquisition module is used for receiving second encrypted data from the android terminal, wherein the second encrypted data comprises an execution result of the operation instruction;
and the execution result decryption module decrypts the second encrypted data and displays the execution result.
The application also discloses an ADB safe interaction device of the android system, which is applied to the android terminal and comprises the following steps:
the first decryption module is used for receiving a first encryption instruction from the upper computer and decrypting the first encryption instruction, wherein the first encryption instruction comprises an instruction for acquiring the verification code;
the verification code generation module is used for randomly generating a verification code and recording the verification code in the memory;
the first encryption transmission module is used for generating first encryption data according to the verification code and transmitting the first encryption data to the upper computer;
the second decryption module is used for receiving and decrypting a second encryption instruction from the upper computer, wherein the second encryption instruction comprises a verification code to be verified and an operation instruction;
the verification execution module is used for comparing whether the verification code to be verified is consistent with the verification code in the memory, and executing the operation instruction if the verification code to be verified is consistent with the verification code in the memory;
and the second encryption transmission module is used for generating second encryption data according to the execution result of the operation instruction and transmitting the second encryption data to the upper computer.
In a third aspect, an electronic device, comprising:
a processor; and
a memory in which a program is stored,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform any of the methods described in the first aspect.
In a fourth aspect, a readable storage medium has stored therein computer instructions for causing a computer to perform any of the methods described in the first aspect.
The one or more technical schemes provided in the embodiments of the present application can achieve the following technical effects:
by utilizing the verification code to carry out encryption communication on the interaction data between the upper computer and the android terminal, a safe interaction mechanism is provided for the ADB, and compared with the traditional ADB login and control mode, the mechanism is not easy to crack, reduces the leakage risk and has high safety coefficient.
Drawings
Further details, features and advantages of the application are disclosed in the following description of exemplary embodiments with reference to the following drawings, in which:
fig. 1 illustrates one of a flowchart of an ADB secure interaction method according to an exemplary embodiment of the present application;
fig. 2 illustrates a timing diagram of an ADB secure interaction method according to an exemplary embodiment of the present application;
fig. 3 illustrates a second flowchart of an ADB secure interaction method according to an exemplary embodiment of the present application;
fig. 4 shows a flowchart of a step S100 of an ADB security interaction method according to an exemplary embodiment of the present application;
fig. 5 illustrates a third flowchart of an ADB secure interaction method according to an exemplary embodiment of the present application;
fig. 6 shows one of the schematic block diagrams of an ADB secure interaction device according to an exemplary embodiment of the application;
fig. 7 shows a schematic block diagram of an ADB secure interaction device according to an exemplary embodiment of the application;
fig. 8 shows a schematic block diagram of an inspection module of an ADB security interaction device according to an exemplary embodiment of the present application;
fig. 9 shows a schematic block diagram of an ADB secure interaction device according to an exemplary embodiment of the present application;
fig. 10 shows a block diagram of an exemplary electronic device that can be used to implement an embodiment of the application.
Detailed Description
Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While the application is susceptible of embodiment in the drawings, it is to be understood that the application may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the application. It should be understood that the drawings and embodiments of the application are for illustration purposes only and are not intended to limit the scope of the present application.
It should be understood that the various steps recited in the method embodiments of the present application may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the application is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below. It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of such messages or information.
In a first aspect of the present application, an ADB secure interaction method is provided, which is applied to an upper computer, as shown in fig. 1 and fig. 2, and includes the following steps:
s110: sending a first encryption instruction to the android terminal, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
s120: receiving first encrypted data from the android terminal, wherein the first encrypted data comprises a verification code randomly generated by the android terminal;
s130: decrypting the first encrypted data to obtain the verification code;
s140: sending a second encryption instruction to the android terminal, wherein the second encryption instruction comprises the verification code and an operation instruction;
s150: receiving second encrypted data from the android terminal, wherein the second encrypted data comprises an execution result of the operation instruction;
s160: decrypting the second encrypted data and displaying the execution result.
Wherein, the upper computer can be a PC. As shown in fig. 2, encryption and decryption in the method can be performed by adopting an asymmetric encryption algorithm (such as RSA algorithm), for example, a private key can be deployed on the upper computer, and a public key can be deployed on the android terminal. Specifically, the first encryption instruction and the second encryption instruction sent in the method can be encrypted through private key signature, and decryption is performed through public key authentication at the android terminal; the received first encrypted data and the second encrypted data may be decrypted by a private key. Generally, after the upper computer acquires the IP address of the android terminal, the upper computer can safely interact with the android terminal by adopting the method.
The operation instruction may be an ADB opening command (the ADB opening command is the first operation instruction after the verification code is acquired, and the purpose of the operation instruction is to log in the ADB safely), or may be other operation instructions; as shown in fig. 1, after the ADB opening command is executed, other operation instructions may be executed by repeatedly executing steps S140 to S160. Once the ADB is started, the verification code obtained at the beginning of interaction can be combined with each subsequent operation instruction respectively for re-encryption to form an encryption instruction (as described in step S140), so that the ADB can be conveniently and safely logged in and used, the protection effect is good, and the leakage risk is remarkably reduced.
The method in the embodiment can communicate between the upper computer and the android terminal in a UDP unicast mode. The data message of the method can be composed of a message header of 4 bytes, a message content length of 4 bytes and a message content ciphertext. Wherein the message content ciphertext may be selected to be 512 bytes, and the entire data message is 520 bytes in size. The interface of the data interaction of the method can be defined as follows (taking the verification code acquisition interface and the ADB command opening interface as examples):
(1) Acquiring an identifying code interface:
(1) the android terminal is sent by the upper computer, and the android terminal can be shown in table 1:
TABLE 1
The data specifically transmitted can be packaged by using a JSON string format, for example, as follows:
{cmd:”getKey”,time:“1560216217123” }。
(2) the android terminal sends the data to the upper computer as shown in table 2:
TABLE 2
The data specifically transmitted can be packaged by using a JSON string format, for example, as follows:
{key:”xxxxxxxx”, time:”1560216227123”}。
(2) Open ADB command interface (corresponding to the operation instruction):
(1) the android terminal is sent by the upper computer, and the android terminal can be shown in table 3:
TABLE 3 Table 3
The data specifically transmitted can be packaged by using a JSON string format, for example, as follows:
{cmd:”openAdb”,key:”xxxxxxxx”,time:”1560216637123”}。
(2) the android terminal sends the data to the upper computer as shown in table 4:
TABLE 4 Table 4
The data specifically transmitted can be packaged by using a JSON string format, for example, as follows:
{ result: "OK", time: "1560216817123" } or { result: "NOK", desc: "key error" }, time: "1560216817123" }.
Compared with the traditional ADB login and control mode, the method provides a safe interaction mechanism, is not easy to break, has high safety coefficient, and can better ensure the safety of an android system.
In one embodiment, before the step S110, as shown in fig. 3, the method further includes the following steps:
s100: checking whether the login has authorization or not when receiving the login request, if so, continuing to execute, and if not, or if the authorization period has elapsed, stopping executing or continuing to execute after acquiring the authorization.
Before the first encryption instruction is sent to the android terminal, authorization verification can be performed on whether personnel have the use qualification.
Specifically, in the step S100, if the authorization is not authorized or the authorization period has elapsed, the method continues after the authorization is obtained, as shown in fig. 4, and may include the following steps S101 to S103.
S101: if the authorization is not authorized or the authorization period is over, generating a random activation code, and generating an authorization code corresponding to the activation code through a certain algorithm.
The authorization code generation algorithm is not limited as long as the authorization code can be corresponding to the activation code. The authorization code is convenient for a manager to conduct authorization management on ADB login and operation of the android system, and can be issued to authenticated operators.
S102: the activation code is presented and an attempt is made to acquire the input data.
The activation code is used for displaying to an operator, and a specific display mode can be displayed visually (for example, a display screen connected with the upper computer is used for displaying), or can be displayed in an auditory or tactile mode or a combination of modes. When the activation code is presented, a data input function (such as keyboard input, touch input, voice input, etc.) is also provided to obtain the authorization code entered by the operator. The operator can obtain the corresponding authorization code through the activation code.
S103: and when the acquired input data is consistent with the authorization code, continuing to execute the subsequent steps.
Wherein the operator can obtain the authorization code corresponding to the activation code from the manager and input the authorization code. When the data input by the operator is consistent with the authorization code generated in step S101, it is indicated that the operator has been authorized, and the operator is allowed to perform subsequent operations. If the ADB login attempts are inconsistent, an alarm can be sent out or the ADB login attempts can be terminated after a certain number of input errors are triggered.
In addition, the application also provides an ADB safe interaction method which is applied to the android terminal, as shown in fig. 2 and 5, and comprises the following steps:
s210: receiving and decrypting a first encryption instruction from an upper computer, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
s220: randomly generating a verification code and recording the verification code in a memory;
s230: generating first encrypted data according to the verification code, and sending the first encrypted data to the upper computer;
s240: receiving and decrypting a second encryption instruction from the upper computer, wherein the second encryption instruction comprises a verification code to be verified and an operation instruction;
s250: comparing whether the verification code to be verified is consistent with the verification code in the memory, and executing the operation instruction if the verification code to be verified is consistent with the verification code in the memory;
s260: and generating second encrypted data according to an execution result of the operation instruction, and sending the second encrypted data to the upper computer.
Wherein, the upper computer can be a PC terminal. As shown in fig. 2, encryption and decryption in the method can be performed by adopting an asymmetric encryption algorithm (such as RSA algorithm), for example, a private key can be deployed on the upper computer, and a public key can be deployed on the android terminal. Specifically, the first encryption instruction and the second encryption instruction received in the method can be encrypted by a private key signature at the upper computer, and decrypted by public key authentication at the android terminal; the generated first encrypted data and the second encrypted data may be encrypted by a public key.
The operation instruction may be an ADB opening command (the ADB opening command is the first operation instruction after the verification code is acquired, and the purpose of the operation instruction is to log in the ADB safely), or may be other operation instructions; as shown in fig. 5, after the ADB opening command is executed, other operation instructions may be executed by repeatedly executing steps S240 to S260. Once the ADB is started, the verification code generated at the beginning of the interaction can be compared with the verification code in each encryption instruction received later, and the corresponding operation instruction is executed after the comparison is consistent, so that the leakage risk can be remarkably reduced.
In another aspect of the present application, an ADB security interaction device 1 is provided, which is applied to an upper computer, as shown in fig. 6, and includes:
the verification code request module 110 is configured to send a first encryption instruction to the android terminal, where the first encryption instruction includes an instruction for obtaining a verification code;
the verification code obtaining module 120 is configured to receive first encrypted data from the android terminal, where the first encrypted data includes a verification code randomly generated by the android terminal;
a verification code decryption module 130, configured to decrypt the first encrypted data to obtain the verification code;
an operation instruction sending module 140, configured to send a second encryption instruction to the android terminal, where the second encryption instruction includes the verification code and an operation instruction;
an execution result obtaining module 150, configured to receive second encrypted data from the android terminal, where the second encrypted data includes an execution result of the operation instruction;
and the execution result decryption module 160 is configured to decrypt the second encrypted data and display the execution result.
Wherein, the upper computer can be a PC. As shown in fig. 2, encryption and decryption in the device can be performed by adopting an asymmetric encryption algorithm (such as RSA algorithm), for example, a private key can be deployed on the upper computer, and a public key can be deployed on the android terminal. Specifically, the first encryption instruction and the second encryption instruction sent in the device can be encrypted through private key signature, and decryption is performed through public key authentication at the android terminal; the received first encrypted data and the second encrypted data may be decrypted by a private key.
The operation instruction may be an ADB opening command (the ADB opening command is the first operation instruction after the verification code is acquired, and the purpose of the operation instruction is to log in the ADB safely), or may be other operation instructions; as shown in fig. 6, after the ADB opening command is executed, other operation instructions may also be executed by repeatedly triggering the modules 140 to 160. Once the ADB is started, the verification code obtained at the beginning of interaction can be combined with each subsequent operation instruction respectively for re-encryption to form an encryption instruction (as described in the operation instruction sending module 140), so that the ADB can be conveniently and safely logged in and used, the protection effect is good, and the leakage risk is remarkably reduced.
In one embodiment, the ADB security interaction device 1, as shown in fig. 7, further includes:
the checking module 100 is configured to check, when a login request is received, whether the login has authorization, if so, trigger the verification code request module, and if not authorized or the authorization period has elapsed, stop the activity or continue to trigger the verification code request module after obtaining the authorization.
Before the first encryption instruction is sent to the android terminal, authorization verification can be performed on whether personnel have the use qualification.
Specifically, in the inspection module, as shown in fig. 8, a generation module 101, an input/output module 102, and a comparison module 103 may be included.
The generating module 101 is configured to generate a random activation code if the activation code is not authorized or the authorization period has elapsed, and generate an authorization code corresponding to the activation code through a certain algorithm.
The authorization code generation algorithm is not limited as long as the authorization code can be corresponding to the activation code. The authorization code is convenient for a manager to conduct authorization management on ADB login and operation of the android system, and can be issued to authenticated operators.
The input/output module 102 is configured to display the activation code and attempt to acquire input data.
The activation code is used for displaying to an operator, and a specific display mode can be displayed visually (for example, a display screen connected with the upper computer is used for displaying), or can be displayed in an auditory or tactile mode or a combination of modes. When the activation code is presented, a data input function (such as keyboard input, touch input, voice input, etc.) is also provided to obtain the authorization code entered by the operator. The operator can obtain the corresponding authorization code through the activation code.
And the comparison module 103 is used for continuously triggering the verification code request module when the acquired input data is consistent with the authorization code.
Wherein the operator can obtain the authorization code corresponding to the activation code from the manager and input the authorization code. When the data input by the operator is consistent with the authorization code generated in the generation module 101, the operator is informed that the operator has been authorized, and the operator is allowed to perform subsequent operations. If the ADB login attempts are inconsistent, an alarm can be sent out or the ADB login attempts can be terminated after a certain number of input errors are triggered.
In addition, the application also provides an ADB safe interaction device 2 which is applied to the android terminal, as shown in fig. 9, and comprises:
the first decryption module 210 is configured to receive a first encryption instruction from the upper computer and decrypt the first encryption instruction, where the first encryption instruction includes an instruction for obtaining the verification code;
the verification code generation module 220 is configured to randomly generate a verification code, and record the verification code in the memory;
the first encryption sending module 230 is configured to generate first encrypted data according to the verification code, and send the first encrypted data to the upper computer;
the second decryption module 240 is configured to receive and decrypt a second encryption instruction from the upper computer, where the second encryption instruction includes a verification code to be verified and an operation instruction;
the verification execution module 250 is configured to compare whether the verification code to be verified is consistent with the verification code in the memory, and if so, execute the operation instruction;
and the second encryption sending module 260 is configured to generate second encrypted data according to an execution result of the operation instruction, and send the second encrypted data to the upper computer.
Wherein, the upper computer can be a PC terminal. As shown in fig. 2, encryption and decryption in the device can be performed by adopting an asymmetric encryption algorithm (such as RSA algorithm), for example, a private key can be deployed on the upper computer, and a public key can be deployed on the android terminal. Specifically, the first encryption instruction and the second encryption instruction received in the device can be encrypted by a private key signature at the upper computer, and decrypted by public key authentication at the android terminal; the generated first encrypted data and the second encrypted data may be encrypted by a public key.
The operation instruction may be an ADB opening command (the ADB opening command is the first operation instruction after the verification code is acquired, and the purpose of the operation instruction is to log in the ADB safely), or may be other operation instructions; as shown in fig. 9, after the ADB command is executed, other operation instructions may be executed by repeatedly triggering the modules 240 to 260. Once the ADB is started, the verification code generated at the beginning of the interaction can be compared with the verification code in each encryption instruction received later, and the corresponding operation instruction is executed after the comparison is consistent, so that the leakage risk can be remarkably reduced.
The exemplary embodiment of the application also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor for causing the electronic device to perform a method according to an embodiment of the application when executed by the at least one processor.
The exemplary embodiments of the present application also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the present application.
The exemplary embodiments of the application also provide a computer program product comprising a computer program, wherein the computer program, when being executed by a processor of a computer, is for causing the computer to perform a method according to an embodiment of the application.
Referring to fig. 10, a block diagram of an electronic device 300 that may be a server or a client of the present application will now be described, which is an example of a hardware device that may be applied to aspects of the present application. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 10, the electronic device 300 includes a computing unit 301 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 302 or a computer program loaded from a storage unit 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 may also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other by a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Various components in the electronic device 300 are connected to the I/O interface 305, including: an input unit 306, an output unit 307, a storage unit 308, and a communication unit 309. The input unit 306 may be any type of device capable of inputting information to the electronic device 300, and the input unit 306 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. The output unit 307 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 304 may include, but is not limited to, magnetic disks, optical disks. The communication unit 309 allows the electronic device 300 to exchange information/data with other devices through a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 301 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 301 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the respective methods and processes described above. For example, in some embodiments, the method in the first aspect may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 308. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 300 via the ROM 302 and/or the communication unit 309. In some embodiments, the computing unit 301 may be configured to perform the method by any other suitable means (e.g., by means of firmware).
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including keyboard input, voice input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (10)

1. The ADB safe interaction method is characterized by being applied to an upper computer and comprising the following steps of:
sending a first encryption instruction to an android terminal, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
receiving first encrypted data from the android terminal, wherein the first encrypted data comprises a verification code randomly generated by the android terminal;
decrypting the first encrypted data to obtain the verification code;
sending a second encryption instruction to the android terminal, wherein the second encryption instruction comprises the verification code and an operation instruction, and the android terminal compares whether the verification code carried by the second encryption instruction is consistent with the verification code randomly generated by the android terminal or not, and if so, the operation instruction is executed;
receiving second encrypted data from the android terminal, wherein the second encrypted data comprises an execution result of the operation instruction;
decrypting the second encrypted data and displaying the execution result;
the upper computer encrypts through a private key, and the android terminal decrypts through a public key.
2. The ADB secure interaction method of claim 1, wherein:
before sending the first encryption instruction to the android terminal, the method further comprises the following steps:
checking whether the login has authorization or not when receiving the login request, if so, continuing to execute, and if not, stopping executing or continuing executing after acquiring the authorization.
3. The ADB secure interaction method of claim 2, wherein:
and if the authorization is not authorized or the authorization period is over, continuing to execute after the authorization is acquired, wherein the method comprises the following steps of:
if the authorization is not authorized or the authorization period is over, generating a random activation code, and generating an authorization code corresponding to the activation code through a certain algorithm;
displaying the activation code and attempting to acquire input data;
and when the acquired input data is consistent with the authorization code, continuing to execute the subsequent steps.
4. The ADB secure interaction method of claim 1, wherein:
the first encryption instruction and the second encryption instruction are encrypted through private key signature, and the first encryption data and the second encryption data are decrypted through private key.
5. The ADB secure interaction method is characterized by being applied to an android terminal and comprising the following steps of:
receiving and decrypting a first encryption instruction from an upper computer, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
randomly generating a verification code and recording the verification code in a memory;
generating first encrypted data according to the verification code, and sending the first encrypted data to the upper computer;
receiving and decrypting a second encryption instruction from the upper computer, wherein the second encryption instruction comprises a verification code to be verified and an operation instruction;
comparing whether the verification code to be verified is consistent with the verification code in the memory, and executing the operation instruction if the verification code to be verified is consistent with the verification code in the memory;
generating second encrypted data according to the execution result of the operation instruction, and sending the second encrypted data to the upper computer;
the upper computer encrypts through a private key, and the android terminal decrypts through a public key.
6. The ADB secure interaction method of claim 5, wherein:
the first encryption instruction and the second encryption instruction are decrypted through public key authentication, and the first encryption data and the second encryption data are encrypted through public keys.
7. An ADB security interaction device applied to an upper computer, comprising:
the verification code request module is used for sending a first encryption instruction to the android terminal, wherein the first encryption instruction comprises an instruction for acquiring a verification code;
the verification code acquisition module is used for receiving first encrypted data from the android terminal, wherein the first encrypted data comprises a verification code randomly generated by the android terminal;
the verification code decryption module decrypts the first encrypted data to obtain the verification code;
the operation instruction sending module is used for sending a second encryption instruction to the android terminal, wherein the second encryption instruction comprises the verification code and the operation instruction, the android terminal compares whether the verification code carried by the second encryption instruction is consistent with the verification code randomly generated by the android terminal, and if so, the operation instruction is executed;
the execution result acquisition module is used for receiving second encrypted data from the android terminal, wherein the second encrypted data comprises an execution result of the operation instruction;
the execution result decryption module decrypts the second encrypted data and displays the execution result;
the upper computer encrypts through a private key, and the android terminal decrypts through a public key.
8. An ADB safe interaction device is applied to an android terminal and is characterized by comprising:
the first decryption module is used for receiving a first encryption instruction from the upper computer and decrypting the first encryption instruction, wherein the first encryption instruction comprises an instruction for acquiring the verification code;
the verification code generation module is used for randomly generating a verification code and recording the verification code in the memory;
the first encryption transmission module is used for generating first encryption data according to the verification code and transmitting the first encryption data to the upper computer;
the second decryption module is used for receiving and decrypting a second encryption instruction from the upper computer, wherein the second encryption instruction comprises a verification code to be verified and an operation instruction;
the verification execution module is used for comparing whether the verification code to be verified is consistent with the verification code in the memory, and executing the operation instruction if the verification code to be verified is consistent with the verification code in the memory;
the second encryption sending module is used for generating second encryption data according to the execution result of the operation instruction and sending the second encryption data to the upper computer;
the upper computer encrypts through a private key, and the android terminal decrypts through a public key.
9. An electronic device, comprising:
a processor; and
a memory in which a program is stored,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any of claims 1-6.
10. A readable storage medium having stored therein computer instructions for causing a computer to perform the method according to any one of claims 1-6.
CN202310600007.6A 2023-05-25 2023-05-25 ADB secure interaction method and device, electronic equipment and readable storage medium Active CN116305010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310600007.6A CN116305010B (en) 2023-05-25 2023-05-25 ADB secure interaction method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310600007.6A CN116305010B (en) 2023-05-25 2023-05-25 ADB secure interaction method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN116305010A CN116305010A (en) 2023-06-23
CN116305010B true CN116305010B (en) 2023-08-15

Family

ID=86820805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310600007.6A Active CN116305010B (en) 2023-05-25 2023-05-25 ADB secure interaction method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116305010B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756703A (en) * 2020-06-03 2020-10-09 拉扎斯网络科技(上海)有限公司 Debugging interface management method and device and electronic equipment
CN111881423A (en) * 2020-07-28 2020-11-03 杭州海康威视数字技术股份有限公司 Method, device and system for limiting function use authorization
CN112528257A (en) * 2020-12-04 2021-03-19 百度在线网络技术(北京)有限公司 Security debugging method and device, electronic equipment and storage medium
CN112738024A (en) * 2020-12-09 2021-04-30 杭州安恒信息技术股份有限公司 Encryption authentication method, system, storage medium and device
CN113901401A (en) * 2021-09-14 2022-01-07 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Terminal software authorization system and method based on machine fingerprint and USBKey
CN113987421A (en) * 2021-11-01 2022-01-28 北京朝歌数码科技股份有限公司 Software authorization method, system and storage medium
US11409865B1 (en) * 2021-08-16 2022-08-09 Cyberark Software Ltd. Verification code injection at build time

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756703A (en) * 2020-06-03 2020-10-09 拉扎斯网络科技(上海)有限公司 Debugging interface management method and device and electronic equipment
CN111881423A (en) * 2020-07-28 2020-11-03 杭州海康威视数字技术股份有限公司 Method, device and system for limiting function use authorization
CN112528257A (en) * 2020-12-04 2021-03-19 百度在线网络技术(北京)有限公司 Security debugging method and device, electronic equipment and storage medium
CN112738024A (en) * 2020-12-09 2021-04-30 杭州安恒信息技术股份有限公司 Encryption authentication method, system, storage medium and device
US11409865B1 (en) * 2021-08-16 2022-08-09 Cyberark Software Ltd. Verification code injection at build time
CN113901401A (en) * 2021-09-14 2022-01-07 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Terminal software authorization system and method based on machine fingerprint and USBKey
CN113987421A (en) * 2021-11-01 2022-01-28 北京朝歌数码科技股份有限公司 Software authorization method, system and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孔琰 ; 赵帅兵 ; 刘若琳 ; 梁爽 ; 庄园 ; 冯世舫 ; 王刚 ; 刘晓光 ; 李忠伟 ; .基于安卓平台的多云存储系统.计算机应用.2017,(S1),全文. *

Also Published As

Publication number Publication date
CN116305010A (en) 2023-06-23

Similar Documents

Publication Publication Date Title
US11509485B2 (en) Identity authentication method and system, and computing device
EP3324572B1 (en) Information transmission method and mobile device
US10129240B2 (en) Distributing security codes through a restricted communications channel
US9003519B2 (en) Verifying transactions using out-of-band devices
CN108111497B (en) Mutual authentication method and device for camera and server
CN108347361B (en) Application program testing method and device, computer equipment and storage medium
CN113014444B (en) Internet of things equipment production test system and safety protection method
CN106372497B (en) Application programming interface API protection method and protection device
WO2016045504A1 (en) Method and system for transmitting information safely, receiving terminal and transmission terminal
CN113014539A (en) Internet of things equipment safety protection system and method
CN107368737A (en) A kind of processing method for preventing copy-attack, server and client
CN112564887A (en) Key protection processing method, device, equipment and storage medium
CN111901117A (en) Safety authentication method and system based on JTAG interface
CN110765470A (en) Method and device for realizing safety keyboard, computer equipment and storage medium
CN115859267A (en) Method for safely starting application program, storage control chip and electronic equipment
CN113630412B (en) Resource downloading method, resource downloading device, electronic equipment and storage medium
CN111585995A (en) Method and device for transmitting and processing safety wind control information, computer equipment and storage medium
CN117240625B (en) Tamper-resistant data processing method and device and electronic equipment
CN114139176A (en) Industrial internet core data protection method and system based on state secret
CN112987942B (en) Method, device and system for inputting information by keyboard, electronic equipment and storage medium
WO2021109668A1 (en) Security authentication method, apparatus, and electronic device
CN113127844A (en) Variable access method, device, system, equipment and medium
CN109246148A (en) Message processing method, device, system, equipment and computer readable storage medium
CN116305010B (en) ADB secure interaction method and device, electronic equipment and readable storage medium
JP2020515104A (en) Method and apparatus for performing secure backup and restore

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant