CN109522174B - Method, device, terminal and storage medium for controlling adb enabling - Google Patents

Method, device, terminal and storage medium for controlling adb enabling Download PDF

Info

Publication number
CN109522174B
CN109522174B CN201811351753.1A CN201811351753A CN109522174B CN 109522174 B CN109522174 B CN 109522174B CN 201811351753 A CN201811351753 A CN 201811351753A CN 109522174 B CN109522174 B CN 109522174B
Authority
CN
China
Prior art keywords
adb
terminal
linking
mark file
factory
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
CN201811351753.1A
Other languages
Chinese (zh)
Other versions
CN109522174A (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.)
Xian Wingtech Electronic Technology Co Ltd
Original Assignee
Xian Wingtech Electronic 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 Xian Wingtech Electronic Technology Co Ltd filed Critical Xian Wingtech Electronic Technology Co Ltd
Priority to CN201811351753.1A priority Critical patent/CN109522174B/en
Publication of CN109522174A publication Critical patent/CN109522174A/en
Application granted granted Critical
Publication of CN109522174B publication Critical patent/CN109522174B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Factory Administration (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a method, a device, a terminal and a storage medium for controlling adb enabling, wherein the method comprises the following steps: after the terminal is started, checking whether a mark file for marking that the terminal is restored to factory settings exists in a buffer area; if the mark file does not exist, linking to a PC end through a USB device manager and a system UI control terminal adb; and if the mark file exists, linking the control terminal adb to the PC terminal according to the native logic. Therefore, manual opening of the adb through complicated steps can be avoided during production of the production line, the labor input is reduced, and the productivity is improved.

Description

Method, device, terminal and storage medium for controlling adb enabling
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method, a device, a terminal and a storage medium for controlling adb enabling.
Background
With the development of the Android system, other platforms except for a mobile phone, such as a vehicle-mounted platform, a tablet platform and a wearable device, carry Android, and the development demand of the Android is increasing day by day.
With the increase of development requirements and the increase of the number of android devices, the capacity problem of the android devices in production line production is increasingly highlighted. In a production line, an adb (Android debug bridge) is often required to be opened for some tests, debugging, series verification, basic information acquisition, verification and the like. However, since the android versions finally released to the hands of the terminal users are user versions, the android system of the user version closes the adb function by default. Therefore, for the user version, starting adb needs to be performed in multiple steps, and the specific operation steps are as follows: 1. opening the setting; 2. find "about cell phone/tablet" option; 3. finding out the software version number; 4. opening developer options after multiple quick clicks; 5. returning to the upper level menu, finding the developer option and entering; 6. find this option "allow USB debug"; 7. link PC and click authorization.
The process of linking the adb by the PC is completed through the steps, the step of opening the adb is complicated, and a large amount of manpower is consumed.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a terminal and a storage medium for controlling adb enabling, so as to achieve the purposes of reducing the labor input of a process of manually opening an adb on a production line and improving the productivity.
In a first aspect, an embodiment of the present invention provides a method for controlling adb enabling, where the method includes:
after the terminal is started, checking whether a mark file for marking that the terminal is restored to factory settings exists in a buffer area;
if the mark file does not exist, linking to a PC end through a USB device manager and a system UI control terminal adb;
and if the mark file exists, linking the control terminal adb to the PC terminal according to the native logic.
Optionally, the step of linking to the PC end through the USB device manager and the system UI control terminal adb includes:
starting an adb switch in the terminal through the USB equipment manager to enable the terminal to be in an adb link mode;
and authorizing the adb through the system UI.
Optionally, the step of authorizing the adb through the system UI includes:
and acquiring an instance of the USB management service through a system UI, authorizing the adb based on the instance, and closing the popped authorization box.
Optionally, after the adb switch in the terminal is started by the USB device manager, the method further includes:
and acquiring system factory-restoration attribute information after the adb switch is turned on, and judging whether adb authorization operation is performed or not according to the system factory-restoration attribute information.
Optionally, the method further includes:
and after the terminal finishes factory setting restoration operation, the mark file is constructed in a system buffer area.
In a second aspect, an embodiment of the present invention further provides an apparatus for controlling adb enabling, where the apparatus includes:
the judging module is used for checking whether a mark file for marking that the terminal is restored to factory settings exists in the buffer area after the terminal is started;
the first linking module is used for linking to the PC end through the USB equipment manager and the system UI control terminal adb if the mark file does not exist;
and the second linking module is used for linking the control terminal adb to the PC end according to the native logic if the mark file exists.
Optionally, the first linking module includes:
the starting unit is used for starting an adb switch in the terminal through the USB equipment manager so as to enable the terminal to be in an adb link mode;
and the authorization unit is used for authorizing the adb through the system UI.
Optionally, the authorization unit is specifically configured to:
and acquiring an instance of the USB management service through a system UI, authorizing the adb based on the instance, and closing the popped authorization box.
Optionally, the apparatus further comprises:
and the acquisition and judgment module is used for acquiring the system factory-restoration attribute information after the adb switch is turned on and judging whether adb authorization operation is performed or not according to the system factory-restoration attribute information.
Optionally, the apparatus further comprises:
and the construction module is used for constructing the mark file in a system buffer area after the terminal finishes factory setting restoration operation.
In a third aspect, an embodiment of the present invention further provides a terminal, including:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a control adb enabling method as in any embodiment of the invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the adb enabling method according to any embodiment of the present invention.
According to the method, the device, the terminal and the storage medium for controlling adb enabling, provided by the embodiment of the invention, whether a marker file exists in a buffer area is judged, if the marker file does not exist in the buffer area, the terminal adb is controlled to be automatically linked to a PC (personal computer) end through a USB (universal serial bus) equipment manager and a system UI (user interface), namely, the adb is linked to the PC end by default; if the mark file exists, the factory reset is indicated to be carried out, namely production line production is finished, and the mark file is linked to the PC end according to the native logic control terminal adb. Therefore, manual opening through complicated steps can be avoided, labor input is reduced, and productivity is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for controlling adb enablement according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for controlling adb enabling according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a control adb enabling apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for controlling adb enabling according to an embodiment of the present invention, where the embodiment is applicable to a situation where operations such as testing, debugging, obtaining basic information, and checking are performed on an adb opened in a production line, the method may be executed by a corresponding adb enabling device, and the adb enabling device may be implemented in a software and/or hardware manner and may be configured on a terminal.
As shown in fig. 1, the method for controlling adb enabling provided in the embodiment of the present invention may include:
s110, after the terminal is started, whether a mark file for marking that the terminal is restored to factory settings exists in the buffer area is checked.
The buffer area refers to an android system cache area, namely a cache area, and is mounted under a cache directory for storing data and application programs most frequently accessed by the system.
When the terminal is in production line production, after the terminal is brushed with software of a download user version through a production line, the adb link is usually required to be opened to be connected to the PC terminal for testing, debugging, obtaining basic information, checking and the like, and finally production line production is completed by restoring factory settings, wherein android equipment is preferred for the terminal. In order to improve the capacity of the production line, after the terminal is started, whether the operation of the production line down loader version software or the operation of factory reset is carried out in the last step of the terminal is judged, and different modes are selected to control the adb to be linked to the PC terminal according to different operation steps. The PC terminal refers to a computer device, such as a computer, for debugging the performance of the terminal.
And after the terminal finishes the factory setting restoration operation, constructing a flag file, wherein the factory setting restoration operation is finished by the factory setting restoration station. Further, in a specific embodiment, after the terminal leaves the factory, automatically adding/cache/recovery/last _ expect data in recovery to build a flag file in the buffer cache, where the flag file may be an empty file or may be built according to preset content. Therefore, after the terminal is turned on, by checking whether the buffer area has a flag file for identifying that the terminal has been restored to factory settings, the operation performed in the previous step of the terminal can be determined, and step S120 or S130 is selected to be performed based on the operation in the previous step.
And S120, if the flag file does not exist, linking to the PC side through the USB device manager and the system UI control terminal adb.
In this embodiment, if the buffer does not have a flag file, it indicates that the operation of flushing down load user version software on the production line is performed in the last step of the terminal, and since various tests, debugging, verification, and the like are subsequently performed, in order to improve the production line efficiency, the adb is automatically opened and the link permission is granted after the terminal is opened, so that the terminal adb is automatically linked to the PC end, and the whole link process does not require manual intervention, for example, the terminal adb can be controlled to be linked to the PC end through the combined action of a USB Device Manager (UDM) and a system UI.
S130, if the mark file exists, the terminal adb is linked to the PC end according to the native logic control.
In this embodiment, if the flag file exists in the buffer, it indicates that the last step of the terminal is a factory reset operation, and the terminal completes production line production, because a user usually rarely links the PC end with an adb, after starting the terminal, the default option of opening the adb is closed, and subsequently, if the adb link needs to be used, the adb link is controlled to the PC end according to native logic, where the native logic refers to that the terminal opens the adb and authorizes connection by detecting and recognizing the operation performed by the user on the terminal, that is, manually opens the terminal through each step.
In the embodiment of the invention, whether the buffer area has the mark file is judged, if not, the terminal adb is controlled to be automatically linked to the PC end through the USB device manager and the system UI, namely the terminal adb is automatically linked to the PC end by default; if the logical control terminal adb exists, the factory settings are restored, namely production line production is finished, and the logical control terminal adb is linked to the PC terminal according to Google. Therefore, manual opening through complicated steps can be avoided, labor input is reduced, and productivity is improved.
Example two
Fig. 2 is a flowchart illustrating a method for controlling adb enabling according to a second embodiment of the present invention. In this embodiment, optimization is performed based on the above embodiment, and as shown in fig. 2, the method for controlling adb enabling provided in the embodiment of the present invention includes:
s210, after the terminal is started, whether a mark file for marking that the terminal is restored to factory settings exists in the buffer area is checked.
S220, if the mark file does not exist, starting an adb switch in the terminal through the USB equipment manager to enable the terminal to be in an adb link mode; and authorizing the adb through the system UI.
In this embodiment, to ensure that the terminal adb can be automatically linked to the PC, the USB device manager sets a default link attribute in advance, for example, the USB device manager arbitrarily combines default parameters such as mtp (media transfer protocol), ptp (picture transfer protocol), and adb in advance to enable the terminal device to present various link modes, and selects one of the link modes as a default link mode, for example, mtp and adb as a default link mode.
And if the fact that the marker file does not exist in the buffer zone is detected, the USB device manager executes default link attributes, namely directly opening an adb switch in the terminal to enable the terminal to be in an adb link mode. And a system prop attribute is set while the adb switch is turned on, for example, a factory recovery attribute of the system is set, wherein the prop attribute refers to a configuration attribute set during the operation of the android system, so as to be used for adb authorization of the next step. When the authorization operation is specifically performed, factory-restoration attribute information (i.e. experience.sys.factor attribute) of the system is acquired from the system prop attribute, if the factory-restoration attribute value is judged to be false, it is determined that the last operation of the terminal is to flush the download user version software, and the adb needs to be further authorized without factory reset operation, so that after the adb switch is turned on, the system UI directly pops up the authorization box, while the system UI obtains an instance of the USB management SERVICE and authorizes the adb based on the instance, illustratively, obtains a USB _ SERVICE instance, by which to perform an allow USB debug (allowusbbdebug) function, the adb authorization can be realized, and the system UI automatically closes the popped authorization box while the authorization is completed, so that, the method can realize that the terminal adb is automatically linked to the PC section by default for the started terminal, and solves the problem that the user needs to carry out authorization through manual clicking after the adb is linked in the prior art.
And S230, if the mark file exists, the terminal adb is linked to the PC terminal according to the native logic control.
In the embodiment of the invention, if the buffer zone does not have the marker file, the adb switch is opened through the USB device manager, the adb is authorized through the system UI, the terminal adb is controlled to be automatically linked to the PC end through the two steps, namely the terminal adb is automatically linked to the PC end by default, so that manual opening through complicated steps on a production line can be avoided, the labor input is reduced, and the productivity is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an apparatus for controlling adb enabling according to a third embodiment of the present invention. As shown in fig. 3, the client includes:
a judging module 310, configured to check whether a flag file for identifying that the terminal has recovered factory settings exists in a buffer after the terminal is turned on;
a first linking module 320 for linking to the PC side through the USB device manager and the system UI control terminal adb if the flag file does not exist;
and the second linking module 330 is configured to link the control terminal adb to the PC terminal according to the native logic if the flag file exists.
In the embodiment of the invention, after the terminal is started, the judging module controls the terminal adb to be automatically linked to the PC end according to the judgment that the buffer area does not have the marker file, namely the terminal adb is automatically linked to the PC end by default; if the second link module exists, the factory reset is indicated to be carried out, namely production line production is finished, and the second link module is linked to the PC end according to the native logic control terminal adb of Google. Therefore, manual opening through complicated steps can be avoided, labor input is reduced, and productivity is improved.
On the basis of the above embodiments, the first linking module includes:
the starting unit is used for starting an adb switch in the terminal through a USB device manager so as to enable the terminal to be in an adb link mode;
and the authorization unit is used for authorizing the adb through the system UI.
Optionally, the authorization unit is specifically configured to:
and acquiring an instance of the USB management service through a system UI, authorizing the adb based on the instance, and closing the popped authorization box.
On the basis of the above embodiments, the apparatus further includes:
and the obtaining and judging module is used for obtaining the system factory-restoration attribute information after the adb switch is turned on and judging whether adb authorization operation is carried out or not according to the system factory-restoration attribute information.
On the basis of the above embodiments, the apparatus further includes:
and the building module is used for building the mark file in the system buffer area after the terminal finishes factory setting restoration operation.
The adb control enabling device provided by the embodiment of the invention can execute the adb control enabling method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the executing method.
Example four
Fig. 4 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary terminal 12 suitable for use in implementing embodiments of the present invention. The terminal 12 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the terminal 12 is embodied in the form of a general purpose computing device. The components of the terminal 12 may include, but are not limited to: one or more processors or processors 16, a system memory 28, and a bus 18 that connects the various system components (including the system memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Terminal 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by terminal 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The terminal 12 can further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be factory restored via one or more data media to be connected to bus 18. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The terminal 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the terminal 12, and/or any devices (e.g., network card, modem, etc.) that enable the terminal 12 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) restore factory 22. Also, the terminal 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the terminal 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the terminal 12, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing the method for controlling adb enabling provided by the embodiment of the present invention, including:
after the terminal is started, checking whether a mark file for marking that the terminal is restored to factory settings exists in a buffer area;
if the mark file does not exist, linking to a PC end through a USB device manager and a system UI control terminal adb;
and if the mark file exists, controlling the terminal adb to be linked to the PC terminal according to the native logic.
In one embodiment, the processor 16 implements the control adb enabling method by executing a program stored in the system memory 28, further comprising:
starting an adb switch in the terminal through the USB device manager to enable the terminal to be in an adb link mode;
and authorizing the adb through the system UI.
In one embodiment, the processor 16 implements a method of controlling adb enablement by executing a program stored in the system memory 28, further comprising:
and acquiring an instance of the USB management service through a system UI, authorizing the adb based on the instance, and closing the popped authorization box.
In one embodiment, the processor 16 implements a method of controlling adb enablement by executing a program stored in the system memory 28, further comprising:
and acquiring system factory-restoration attribute information after the adb switch is turned on, and judging whether adb authorization operation is performed or not according to the system factory-restoration attribute information.
In one embodiment, the processor 16 implements a method of controlling adb enablement by executing a program stored in the system memory 28, further comprising: and after the terminal finishes factory setting restoration operation, a mark file is constructed in a system buffer area.
EXAMPLE five
An embodiment of the present invention provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method of controlling adb enablement, the method comprising:
after the terminal is started, checking whether a mark file for marking that the terminal is restored to factory settings exists in a buffer area;
if the mark file does not exist, linking to a PC end through a USB device manager and a system UI control terminal adb;
and if the mark file exists, controlling the terminal adb to be linked to the PC terminal according to the native logic.
In one embodiment, the program when executed by the processor may further implement:
starting an adb switch in the terminal through the USB device manager to enable the terminal to be in an adb link mode;
and authorizing the adb through the system UI.
In one embodiment, the program when executed by the processor may further implement:
and acquiring an instance of the USB management service through a system UI, authorizing the adb based on the instance, and closing the popped authorization box.
In one embodiment, the program when executed by the processor may further implement:
and acquiring system factory-restoration attribute information after the adb switch is turned on, and judging whether adb authorization operation is performed or not according to the system factory-restoration attribute information.
In one embodiment, the program when executed by the processor may further implement:
and after the terminal finishes factory setting restoration operation, a mark file is constructed in a system buffer area.
Of course, the storage medium provided in the embodiments of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations applied to the method for controlling adb enablement provided in any embodiments of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having 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. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of controlling adb enablement, comprising:
after the terminal is started, checking whether a mark file for marking that the terminal is restored to factory settings exists in a buffer area;
if the mark file does not exist, linking to a PC end through a USB device manager and a system UI control terminal adb;
and if the mark file exists, linking the control terminal adb to the PC terminal according to the native logic.
2. The method according to claim 1, wherein the step of linking to the PC side through the USB device manager and the system UI control terminal adb comprises:
starting an adb switch in the terminal through the USB equipment manager to enable the terminal to be in an adb link mode;
and authorizing the adb through the system UI.
3. The method of claim 2, wherein the step of authorizing an adb via the system UI comprises:
and acquiring an instance of the USB management service through a system UI, authorizing the adb based on the instance, and closing the popped authorization box.
4. The method of claim 2, wherein after activating an adb switch in the terminal through a USB device manager, the method further comprises:
and acquiring system factory-restoration attribute information after the adb switch is turned on, and judging whether adb authorization operation is performed or not according to the system factory-restoration attribute information.
5. The method of claim 1, further comprising:
and after the terminal finishes factory setting restoration operation, the mark file is constructed in a system buffer area.
6. An apparatus for controlling adb enablement, comprising:
the judging module is used for checking whether a mark file for marking that the terminal is restored to factory settings exists in the buffer area after the terminal is started;
the first linking module is used for linking to the PC end through the USB equipment manager and the system UI control terminal adb if the mark file does not exist;
and the second linking module is used for linking the control terminal adb to the PC end according to the native logic if the mark file exists.
7. The apparatus of claim 6, wherein the first linking module comprises:
the starting unit is used for starting an adb switch in the terminal through the USB equipment manager so as to enable the terminal to be in an adb link mode;
and the authorization unit is used for authorizing the adb through the system UI.
8. The apparatus of claim 6, further comprising:
and the construction module is used for constructing the mark file in a system buffer area after the terminal finishes factory setting restoration operation.
9. A terminal, characterized in that the terminal comprises:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the control adb-enabled method of any of claims 1-5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the controlling adb enabling method according to any one of claims 1-5.
CN201811351753.1A 2018-11-14 2018-11-14 Method, device, terminal and storage medium for controlling adb enabling Active CN109522174B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811351753.1A CN109522174B (en) 2018-11-14 2018-11-14 Method, device, terminal and storage medium for controlling adb enabling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811351753.1A CN109522174B (en) 2018-11-14 2018-11-14 Method, device, terminal and storage medium for controlling adb enabling

Publications (2)

Publication Number Publication Date
CN109522174A CN109522174A (en) 2019-03-26
CN109522174B true CN109522174B (en) 2022-05-03

Family

ID=65776689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811351753.1A Active CN109522174B (en) 2018-11-14 2018-11-14 Method, device, terminal and storage medium for controlling adb enabling

Country Status (1)

Country Link
CN (1) CN109522174B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275807A (en) * 2019-06-21 2019-09-24 上海创功通讯技术有限公司 Detection method, system, equipment and the storage medium of smart machine
CN113742658A (en) * 2021-07-22 2021-12-03 深圳市智微智能科技股份有限公司 adb tool encryption method, system, terminal and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8065204B2 (en) * 2005-09-29 2011-11-22 Sony Corporation System and method for software integration and factory deployment
CN103246586B (en) * 2013-04-19 2014-12-10 福州瑞芯微电子有限公司 Method for utilizing USB (universal serial bus) storage equipment for ADB (android debug bridge) debugging on android platform
CN104572387A (en) * 2015-01-30 2015-04-29 青岛海信移动通信技术股份有限公司 Method and device for debugging terminal in engineering mode
CN104881283A (en) * 2015-05-20 2015-09-02 深圳市创维电器科技有限公司 Method and system for obtaining root privilege of terminal device based on android
CN104965776B (en) * 2015-07-29 2018-03-09 广东欧珀移动通信有限公司 Mobile terminal checks the method and system of daily record in recovery mode
US20180124150A1 (en) * 2016-10-28 2018-05-03 T-Mobile Usa, Inc. Remote access of cellular communication devices for software development and testing
CN107329865B (en) * 2017-06-29 2021-06-15 努比亚技术有限公司 Method for opening adb function of debugging bridge, mobile terminal and computer readable medium
CN108664349A (en) * 2018-05-18 2018-10-16 上海商米科技有限公司 Reconnection method and device, storage medium, the processor of double screen terminal
CN108804257B (en) * 2018-06-01 2021-12-24 Oppo广东移动通信有限公司 Terminal state detection method and device, terminal and storage medium

Also Published As

Publication number Publication date
CN109522174A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
CN106445630A (en) Android simulator and method for realizing Android simulator
US10228993B2 (en) Data dump for a memory in a data processing system
US7337359B2 (en) System and method for recovering a device state
US10503489B1 (en) Updating firmware via a remote utility
CN110875858A (en) Application test data capturing method, system, equipment and storage medium
US20170235945A1 (en) Malicious code analysis device and method based on external device connected via usb cable
CN109522174B (en) Method, device, terminal and storage medium for controlling adb enabling
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN109117153A (en) Processing method, device, terminal and the storage medium of application program
CN112241373A (en) Automatic test method, test device, processor and test system
CN111124627B (en) Method and device for determining call initiator of application program, terminal and storage medium
CN111385661B (en) Method, device, terminal and storage medium for voice control of full screen playing
US20150212866A1 (en) Management system for service of multiple operating environments, and methods thereof
WO2023060893A1 (en) Storage space management method and apparatus, and device and storage medium
CN109634690A (en) Data clearing method, device, terminal and storage medium based on WinPE system
US20180123915A1 (en) Electronic apparatus for recording debugging information and control method thereof
CN115185745A (en) Data processing method, system, electronic device and computer readable storage medium
CN114968644A (en) System software dump method and device, electronic equipment and readable storage medium
CN111596997B (en) UI information request method, device, terminal and storage medium
CN113778485A (en) System operation method and device of electronic chip, electronic chip and storage medium
CN104252587A (en) File pulling method, device and system
CN113760631A (en) Page loading duration determination method, device, equipment and storage medium
CN110968519A (en) Game testing method, device, server and storage medium
CN113590225B (en) Mapping detection method and device, electronic equipment and storage medium

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