Add 4 security-related commands (#50)

master
Shen Lin 7 years ago committed by Zhuang Ma
parent f1ee103541
commit a30c0626e1
  1. 43
      README.en.md
  2. 37
      README.md

@ -91,11 +91,14 @@ Other languages: [:cn: Chinese](./README.md)
* [Detect whether the device is root](#detect-whether-the-device-is-root) * [Detect whether the device is root](#detect-whether-the-device-is-root)
* [Monkey use stress testing](#monkey-use-stress-testing) * [Monkey use stress testing](#monkey-use-stress-testing)
* [On / off WiFi](#on--off-wifi) * [On / off WiFi](#on--off-wifi)
* [Brush related commands](#brush-related-commands) * [Flashing-Phone related commands](#brush-related-commands)
* [Restart to Recovery mode](#restart-to-recovery-mode) * [Restart to Recovery mode](#restart-to-recovery-mode)
* [To restart from the Recovery Android](#to-restart-from-the-recovery-android) * [To restart from the Recovery Android](#to-restart-from-the-recovery-android)
* [Restart to Fastboot mode](#restart-to-fastboot-mode) * [Restart to Fastboot mode](#restart-to-fastboot-mode)
* [Through sideload system update](#through-sideload-system-update) * [Through sideload system update](#through-sideload-system-update)
* [Security related commands](#security-related-commands)
* [Enabled / Disable SELinux](#enabledisable-selinux)
* [Enabled / Disable dm_verity](#enabledisable-dmverity)
* [More adb shell command](#more-adb-shell-command) * [More adb shell command](#more-adb-shell-command)
* [See process](#see-process) * [See process](#see-process)
* [View real-time resource consumption](#view-real-time-resource-consumption) * [View real-time resource consumption](#view-real-time-resource-consumption)
@ -753,7 +756,7 @@ Dexopt state:
## Interact with Applications ## Interact with Applications
The most used syntax for interacting with applications is : The most used syntax for interacting with applications is :
```sh ```sh
am <command> am <command>
``` ```
@ -2086,7 +2089,7 @@ adb shell svc wifi disable
If successfully implemented, the output is empty; if not get root privileges to execute this command will fail, output `Killed`. If successfully implemented, the output is empty; if not get root privileges to execute this command will fail, output `Killed`.
## Brush related commands ## Flashing-Phone related commands
### Restart to Recovery mode ### Restart to Recovery mode
@ -2138,6 +2141,40 @@ Case in Recovery Mode Update:
adb sideload <path-to-update.zip> adb sideload <path-to-update.zip>
``` ```
## Security-related commands
### Enable / Disable SELinux
Enable SELinux
```sh
adb root
adb shell setenforce 1
```
Disable SELinux
```sh
adb root
adb shell setenforce 0
```
### Enable / Disable dm_verity
Enable dm_verity
```sh
adb root
adb enable-verity
```
Disable dm_verity
```sh
adb root
adb disable-verity
```
## More adb shell command ## More adb shell command
Android system is based on Linux kernel, so Linux where many commands in Android also has the same or similar implement, in `adb shell` where you can call. Part earlier in this document have been used in the `adb shell` command. Android system is based on Linux kernel, so Linux where many commands in Android also has the same or similar implement, in `adb shell` where you can call. Part earlier in this document have been used in the `adb shell` command.

@ -96,6 +96,9 @@ Other languages: [:gb: English](./README.en.md)
* [从 Recovery 重启到 Android](#从-recovery-重启到-android) * [从 Recovery 重启到 Android](#从-recovery-重启到-android)
* [重启到 Fastboot 模式](#重启到-fastboot-模式) * [重启到 Fastboot 模式](#重启到-fastboot-模式)
* [通过 sideload 更新系统](#通过-sideload-更新系统) * [通过 sideload 更新系统](#通过-sideload-更新系统)
* [安全相关命令](#安全相关命令)
* [启用/禁用 SELinux](#启用禁用-selinux)
* [启用/禁用 dm_verity](#启用禁用-dmverity)
* [更多 adb shell 命令](#更多-adb-shell-命令) * [更多 adb shell 命令](#更多-adb-shell-命令)
* [查看进程](#查看进程) * [查看进程](#查看进程)
* [查看实时资源占用情况](#查看实时资源占用情况) * [查看实时资源占用情况](#查看实时资源占用情况)
@ -2165,6 +2168,40 @@ adb reboot bootloader
adb sideload <path-to-update.zip> adb sideload <path-to-update.zip>
``` ```
## 安全相关命令
### 启用/禁用 SELinux
启用 SELinux
```sh
adb root
adb shell setenforce 1
```
禁用 SELinux
```sh
adb root
adb shell setenforce 0
```
### 启用/禁用 dm_verity
启用 dm_verity
```sh
adb root
adb enable-verity
```
禁用 dm_verity
```sh
adb root
adb disable-verity
```
## 更多 adb shell 命令 ## 更多 adb shell 命令
Android 系统是基于 Linux 内核的,所以 Linux 里的很多命令在 Android 里也有相同或类似的实现,在 `adb shell` 里可以调用。本文档前面的部分内容已经用到了 `adb shell` 命令。 Android 系统是基于 Linux 内核的,所以 Linux 里的很多命令在 Android 里也有相同或类似的实现,在 `adb shell` 里可以调用。本文档前面的部分内容已经用到了 `adb shell` 命令。

Loading…
Cancel
Save