The Android 11.0 system system module enables and disables the adb push and adb pull file transfer functions.

1.Usage scenarios

  During the customized development of the 11.0 system, in some products, because some developed functions are more important to prevent technical points from being leaked in the shipped products, commands such as adb pull and
adb push are disabled to obtain the jar and apk under the system system. and other files, so these commands need to be disabled

2. Analysis of system module enabling and disabling adb push and adb pull file transfer functions

In the implementation of the function of enabling and disabling adb push and adb pull to transfer files
in the system module, I looked at the adb code in the system module source code. The source code of adb is under system/core/adb.
Next, let’s analyze the adb The core functions in the system module
(1) The essence of adb is socket communication, transmitting data and files through the socket, and then executing related functions by listening to relevant commands in the device (2)
adb transmission is based on each fixed The data sent in the format of the package is received on the device side and the relevant instructions are executed.

ADB (Android Debug Bridge) driver is a driver used to establish connection and communication between computers and Android devices. The main function of the ADB driver is to help developers and users perform a series of debugging, testing and management operations related to Android devices on the computer. Through adb, we can conveniently debug Android programs through DDMS in Eclipse. To put it bluntly, it is a debug tool.

3. The system module enables the code to disable the adb push and adb pull file transfer functions.

     system\core\adb\daemon\main.cpp
     system\core\adb\transport.cpp
     system\core\adb\daemon\services.cpp
     system\core\adb\daemon\file_sync_service.cpp</

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/132864594