Return the PCAPdroid version in get_status

This commit is contained in:
emanuele-f
2022-01-28 18:29:37 +01:00
parent 672e810bec
commit 9052bd8f5f
2 changed files with 30 additions and 19 deletions
+27 -19
View File
@@ -69,30 +69,38 @@ Applications interfacing with PCAPdroid should use the `startActivityForResult`
As shown above, the capture settings can be specified by using intent extras. The updated list of all the supported parameters is available in
[CaptureSettings.java](https://github.com/emanuele-f/PCAPdroid/blob/master/app/src/main/java/com/emanuelef/remote_capture/model/CaptureSettings.java).
| Parameter | Type | Value |
|-------------------------|--------|-------------------------------------------------------------------|
| pcap_dump_mode | string | none \| http_server \| udp_exporter \| pcap_file |
| app_filter | string | the package name of the app to capture |
| collector_ip_address | string | the IP address of the collector in udp_exporter mode |
| collector_port | int | the UDP port of the collector in udp_exporter mode |
| http_server_port | int | the HTTP server port in http_server mode |
| pcap_uri | string | the URI for the PCAP dump in pcap_file mode |
| tls_decryption_enabled | bool | true to enable the SOCKS5 proxy (e.g. for TLS decryption) |
| socks5_proxy_ip_address | string | the IP address of the SOCKS5 proxy |
| socks5_proxy_port | int | the TCP port of the SOCKS5 proxy |
| ipv6_enabled | bool | true to enable IPv6 support in non-root mode |
| root_capture | bool | true to capture packets in root mode, false to use the VPNService |
| pcapdroid_trailer | bool | true to enable the PCAPdroid trailer |
| capture_interface | string | @inet \| any \| ifname - network interface to use in root mode |
| snaplen | int | max size in bytes for each individual packet in the PCAP dump |
| max_pkts_per_flow | int | only dump the first max_pkts_per_flow packets per flow |
| max_dump_size | int | PCAP dump max bytes before the capture is automatically stopped |
| Parameter | Type | Ver | Value |
|-------------------------|--------|-----|--------------------------------------------------------------------|
| pcap_dump_mode | string | | none \| http_server \| udp_exporter \| pcap_file |
| app_filter | string | | the package name of the app to capture |
| collector_ip_address | string | | the IP address of the collector in udp_exporter mode |
| collector_port | int | | the UDP port of the collector in udp_exporter mode |
| http_server_port | int | | the HTTP server port in http_server mode |
| pcap_uri | string | | the URI for the PCAP dump in pcap_file mode |
| tls_decryption_enabled | bool | | true to enable the SOCKS5 proxy (e.g. for TLS decryption) |
| socks5_proxy_ip_address | string | | the IP address of the SOCKS5 proxy |
| socks5_proxy_port | int | | the TCP port of the SOCKS5 proxy |
| ipv6_enabled | bool | | true to enable IPv6 support in non-root mode |
| root_capture | bool | | true to capture packets in root mode, false to use the VPNService |
| pcapdroid_trailer | bool | | true to enable the PCAPdroid trailer |
| capture_interface | string | 42 | @inet \| any \| ifname - network interface to use in root mode |
| snaplen | int | 43 | max size in bytes for each individual packet in the PCAP dump |
| max_pkts_per_flow | int | 43 | only dump the first max_pkts_per_flow packets per flow |
| max_dump_size | int | 43 | PCAP dump max bytes before the capture is automatically stopped |
The `Ver` column indicates the minimum PCAPdroid version required to use the given parameter. The PCAPdroid version can be queried via the `get_status` action as explained below.
*NOTE*: due to [file storage restrictions](https://developer.android.com/about/versions/11/privacy/storage), the `pcap_uri` must point to an app internal directory, e.g. `file:///data/user/0/com.emanuelef.remote_capture/cache/dump.pcap`.
## Query the Capture Status
It is possible to check if the capture is currently running by sending an Intent with the `get_status` action. The response Intent contains the `running` extra, which is `true` if the capture is running.
It is possible to check if the capture is currently running by sending an Intent with the `get_status` action. The response Intent contains the following extras:
| Field | Type | Value |
|---------------------|--------|-------------------------------------------------------------------|
| version_name | string | the PCAPdroid versionName (e.g. "1.4.5") |
| version_code | int | the PCAPdroid versionCode, an incremental number for the release |
| running | bool | true if the capture is running |
Other than via the API, the capture may be manually stopped by the user from the PCAPdroid app. In order to be notified when the capture is stopped, you can create a `BroadcastReceiver` and subscribe to the `com.emanuelef.remote_capture.CaptureStatus` action. Here is an example: