Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IRK instructions for android #37117

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Conversation

smhc
Copy link
Contributor

@smhc smhc commented Jan 25, 2025

Proposed change

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

  • Link to parent pull request in the codebase:
  • Link to parent pull request in the Brands repository:
  • This PR fixes or closes issue: fixes #

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • Documentation
    • Added a new section for obtaining Identity Resolving Key (IRK) on Windows and Android platforms.
    • Provided detailed instructions for retrieving IRK from rooted Android devices and using Wireshark.
    • Enhanced guidance to support a broader range of device configurations.

@smhc smhc requested a review from Jc2k as a code owner January 25, 2025 22:00
@home-assistant home-assistant bot added the current This PR goes into the current branch label Jan 25, 2025
Copy link

netlify bot commented Jan 25, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 588c76c
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/67a51ea07648490008855567
😎 Deploy Preview https://deploy-preview-37117--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

coderabbitai bot commented Jan 25, 2025

📝 Walkthrough

Walkthrough

The pull request introduces a new section titled "On Windows / For Android" to the documentation for integrating private BLE devices into Home Assistant. This section provides instructions on obtaining the Identity Resolving Key (IRK) from rooted Android devices and using Wireshark. It details two methods: one for accessing a configuration file on a rooted Android device and another for capturing Bluetooth logs with Wireshark, thus expanding the guidance for users across different platforms.

Changes

File Change Summary
source/_integrations/private_ble_device.markdown Added new "On Windows / For Android" section with detailed instructions for obtaining Identity Resolving Key (IRK) through two methods: rooted Android device configuration file and Wireshark log analysis

Sequence Diagram

Loading
sequenceDiagram
    participant User
    participant AndroidDevice
    participant Wireshark
    participant HomeAssistant

    alt Method 1: Rooted Android Device
        User->>AndroidDevice: Access configuration file
        AndroidDevice-->>User: Retrieve IRK
    else Method 2: Wireshark Log Analysis
        User->>AndroidDevice: Enable Bluetooth debugging
        User->>AndroidDevice: Re-pair device
        User->>Wireshark: Capture Bluetooth logs
        Wireshark-->>User: Extract IRK
    end

    User->>HomeAssistant: Configure Private BLE Device with IRK

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a4bb40 and 588c76c.

📒 Files selected for processing (1)
  • source/_integrations/private_ble_device.markdown (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • source/_integrations/private_ble_device.markdown

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
source/_integrations/private_ble_device.markdown (1)

55-58: Fix formatting and enhance clarity.

  1. Add periods to the abbreviation
  2. Consider adding a note about the importance of byte order conversion

Apply these changes:

 6. In the generated `scanwatch.zip` file, locate and extract `FS\data\misc\bluetooth\logs\btsnoop_hci.log`
 7. Open `btsnoop_hci.log` in [Wireshark](https://www.wireshark.org/download.html) and search for `btsmp.id_resolving_key`
 8. Select one of the frames and expand the "Bluetooth Security Manager Protocol". Either the sending or receiving device IRK will be visible in the hex dump.
-9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e2320544e`, the IRK to use would be: `4e5420238e1562c2d64ad9f7c7f63a76`
+9. Reverse the value displayed. e.g., if it is `763af6c7f7d94ad6c262158e2320544e`, the IRK to use would be: `4e5420238e1562c2d64ad9f7c7f63a76`. This byte order conversion is crucial for the IRK to work correctly.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~57-~57: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...x dump. 9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e23205...

(E_G)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2531e40 and 702e4de.

📒 Files selected for processing (1)
  • source/_integrations/private_ble_device.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/private_ble_device.markdown

[uncategorized] ~50-~50: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...s. 2. Ensure a second bluetooth device (e.g smart watch or earbuds) is unpaired 3. ...

(E_G)


[grammar] ~50-~50: This is normally spelled as one word.
Context: .... Ensure a second bluetooth device (e.g smart watch or earbuds) is unpaired 3. Disable and ...

(SMART_COMPOUNDS)


[uncategorized] ~57-~57: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...x dump. 9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e23205...

(E_G)

🪛 GitHub Actions: home-assistant.io Test
source/_integrations/private_ble_device.markdown

[error] 50-50: Incorrect usage of the term: "bluetooth", use "Bluetooth" instead


[error] 51-51: Incorrect usage of the term: "bluetooth", use "Bluetooth" instead

🔇 Additional comments (1)
source/_integrations/private_ble_device.markdown (1)

43-46: LGTM! Clear and accurate instructions for rooted Android devices.

The explanation of IRK location and the byte order conversion is well-documented with a helpful example.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
source/_integrations/private_ble_device.markdown (4)

43-44: Update section title to accurately reflect content.

The section title mentions Windows but only contains Android-specific instructions. Consider renaming to "On Android" or "For Android Devices" for clarity.

-### On Windows / For Android
+### For Android Devices

45-45: Enhance rooted Android instructions with additional context.

Consider the following improvements:

  1. Add a security warning about device rooting
  2. Format the file path as inline code
  3. Add explanatory links for technical terms (IRK, LTK)
-If you have a rooted Android phone, the IRK (and LTKs) can be viewed in the file `/data/misc/bluedroid/bt_config.conf`.
+{% details "Using a rooted Android device (Advanced)" %}
+
+**Warning**: Rooting your Android device can compromise its security and void your warranty. Proceed with caution.
+
+On a rooted Android phone, the IRK (Identity Resolving Key) and LTKs (Long Term Keys) can be viewed in the file `\`/data/misc/bluedroid/bt_config.conf\``.
+{% enddetails %}

57-57: Fix abbreviation formatting.

Add missing period in the abbreviation.

-9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e2320544e`
+9. Reverse the value displayed. e.g., if it is `763af6c7f7d94ad6c262158e2320544e`
🧰 Tools
🪛 LanguageTool

[uncategorized] ~57-~57: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...x dump. 9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e23205...

(E_G)


47-58: Enhance Wireshark instructions with additional context.

The instructions are technically accurate but could benefit from:

  1. A note about potential exposure of sensitive Bluetooth data in bug reports
  2. Clarification that this method works for both rooted and non-rooted devices
  3. An explanation of why byte order reversal is necessary
 Alternatively, the IRK of an Android phone and/or secondary device can be obtained using Wireshark:
+
+{% note %}
+This method works for both rooted and non-rooted Android devices but requires enabling USB debugging. Be aware that the generated bug report may contain sensitive information.
+{% endnote %}

 1. On the Android phone, enable "USB Debugging" and "Enable Bluetooth HCI snoop log" options in developer settings.
🧰 Tools
🪛 LanguageTool

[grammar] ~50-~50: This is normally spelled as one word.
Context: ...Ensure a second Bluetooth device (e.g., smart watch or earbuds) is unpaired 3. Disable and ...

(SMART_COMPOUNDS)


[uncategorized] ~57-~57: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...x dump. 9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e23205...

(E_G)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 702e4de and 2a4bb40.

📒 Files selected for processing (1)
  • source/_integrations/private_ble_device.markdown (1 hunks)
🧰 Additional context used
🪛 LanguageTool
source/_integrations/private_ble_device.markdown

[grammar] ~50-~50: This is normally spelled as one word.
Context: ...Ensure a second Bluetooth device (e.g., smart watch or earbuds) is unpaired 3. Disable and ...

(SMART_COMPOUNDS)


[uncategorized] ~57-~57: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...x dump. 9. Reverse the value displayed. e.g if it is `763af6c7f7d94ad6c262158e23205...

(E_G)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @smhc 👍

../Frenck

@frenck frenck merged commit 6fccf73 into home-assistant:current Feb 6, 2025
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
current This PR goes into the current branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants