If you own a TV or other Xiaomi device (e.g. Mi Box, Mi) TV Stick or smartphone, sooner or later could face the term RSA-It's not just technical jargon, because without the key settings, some functions may not work properly or even be blocked, for example, you may not be able to install third-party applications through the key. ADB, connect to the device over the network for debugging or even update the firmware in an alternative way.
In this article, we will explain in detail what is RSA-Key in the context of Xiaomi technology, why it is important for security and how to properly generate, add or remove it. TV (Mi TV, Mi Box, where RSA-A key is often required to unlock advanced features, and we will also look at common errors that users make when working with keys, and give clear instructions on how to fix them.
What is it? RSA-Key and why you need it on Xiaomi
RSA (Rivest-Shamir-Adleman is a public-key cryptographic algorithm used for data encryption and authentication. In Xiaomi devices, it performs two key functions:
- π Secure connection by protocol ADB (Android Debug Bridge β no Android Debug Bridge RSA-The device will not allow the computer or other gadget to control it remotely.
- π¦ Install unsigned applications β for example, to manually update firmware or install.apk files from third-party sources.
- π Verification of updates β some firmware (especially custom) require authentication through RSA.
In practice, this means that without a properly configured key, you will not be able to:
- β Install Google Play Services on Mi TV without formal support.
- β Connect to the TV through ADB debugging or modifying the system.
- β Update the firmware through USB OTG, If the file is not signed with an official Xiaomi certificate.
It is important to understand that RSA-The key is not a universal password for all devices; it is generated individually for each connection and stored on both the Xiaomi device and the computer from which you access. If you reset your TV settings or reinstall the OS on your PC, the key will have to be reconfigured.
Where and when required RSA-key
Not all users are faced with the need to adjust RSA-It's only required in specific scenarios involving advanced device management:
| Script | Whether required RSA-key? | Examples of devices |
|---|---|---|
| Installation of applications through ADB | β Yes. | Mi TV 4/5, Mi Box S, Mi TV Stick |
| Update the firmware through USB OTG | β οΈ Sometimes (depending on the version of the software) | Mi TV Q1, Mi TV A2 |
| Connecting to a TV via Wi-Fi Direct for debugging | β Yes. | All models on Android TV |
| Use of custom launchers (e.g, ATV Launcher) | β Yes. | Mi Box, Mi TV Stick |
| Normal use (watching videos, surfing) | β No. | All devices. |
The question of the particular RSA-key-holder TV Stick and Mi Box, where the default is the Google Play Store, and you need to manually install it:
- Enable Developer Mode (clicking 7 times on the build number in the settings).
- Activate Debugging by ADB.
- Connect to the device through ADB confirm RSA-key.
Without the last step, the system will simply ignore commands from the computer, and installing applications will become impossible.
π‘
If you often work with ADB, Keep a backup copy of the folder ~/.Android on your computer β it stores all the confirmed RSA-This will eliminate the need to re-confirm access after reinstalling the OS.
How to generate and add RSA-key
The setup process RSA-The key consists of three steps: generating the key on the computer, confirming it on the Xiaomi device and checking the connection.
Preparation of the computer
The work will require:
- π» Computer with Windows, macOS or Linux.
- π Installed drivers ADB (For Windows - Official Instructions).
- π₯ Utility. ADB (is part of Android SDK Platform-Tools).
Download and unpack the platform-tools in any folder (for example, C:\adb). Then open the command line (Win). + R β cmd) and go to this folder:
cd C:\adb2. Connecting the Xiaomi device
On the Xiaomi device, follow the following steps:
Enable Developer Mode (7 times click on Build Number in Settings) β On TV).
Activate Debugging on ADB on the Developer Menu.
Connect the device to the computer by USB (for Mi TV Stick - through OTG-cable) or over Wi-Fi (in settings) ADB specify IP-address).
Run the adb device command on your computer β the device should appear in the list.
-->
When you first connect to the TV or console screen, a confirmation request will appear RSA-It's going to look something like this:
"Allow debugging by USB? RSA-print: 12:34:56:78:90:AB:CD:EF"
β Make sure to check the box "Always allow from this computer" and click "Allow" to save the key in the device memory and eliminate repeated requests.
3. Connection check
After confirming the key, check that the device is available for commands. ADB:
adb devicesThe answer should appear a line of the form:
192.168.1.100:5555 deviceIf you see unauthorized devices instead of unauthorized devices, then RSA-The key was not confirmed on the device. Repeat the step with debugging permission.
π‘
Connecting via Wi-Fi is more convenient than by USB, But you need a stable network. Use the adb connect command to do that. IP_address:5555 (For example, adb connect 192.168.1.100:5555).
Common mistakes when working with RSA-key and their solutions
Even experienced users sometimes face problems when setting up RSA-Here are the most common mistakes and how to fix them:
β οΈ Note: If you reset the settings of the Xiaomi TV to the factory, all saved RSA-The keys will be deleted. They'll have to be re-confirmed on every computer you've connected to before.
1. The device is not displayed in adb devices
Possible causes and solutions:
- π No connection at all. USB/Wi-Fi: Check the cable, port or network settings. TV Stick may be required. OTG-externally-powered adapter.
- π§ Drivers not installed: Download the latest version of Platform-Tools on Windows.
- π± Not included debugging ADB: Make sure the option is activated in the Developer Menu.
- π Failure of service ADB: Re-launch it with the command: adb kill-server adb start-server
2. Mistake "RSA key fingerprint mismatch"
This error occurs if:
- π₯οΈ I've switched computers. RSA-key (for example, after reinstalling OS).
- πΊ On the Xiaomi device was reset settings.
- π Someone else tried to connect to your device.
Decision:
- Remove the old key on your computer: rm ~/.android/adbkey* # for Linux/macOS del %USERPROFILE%\.android\adbkey* # Windows
- Reset it. ADB: adb kill-server adb start-server
- Connect the device again, and it will request confirmation of the new key.
3. "Device unauthorized" after the key is confirmed
If the device does not receive device status, try:
- π Restart the TV and the computer.
- π§ Manually specify the connection port (for Wi-Fi): adb tcpip 5555 adb connect IP_address:5555
- π Check if the access is blocked by antivirus or firewall.
What to do if you forgot to allow it RSA-key?
How to remove or reset RSA-keys to Xiaomi
Sometimes you need to remove the saved RSA-keys -- for example, if you're selling a device or you want to forget all the computers you've connected before -- you can do this in two ways:
1.Reset all keys on the device
The most radical method is a complete resetting of settings:
- Go to Settings β Additional β Reset and Recovery.
- Select Reset all settings.
- Confirm the action.
β οΈ It's not just going to delete. RSA-keys, but also all installed applications, accounts and personal data.
2. Deletion of a specific key (without resetting)
On Xiaomi devices with Android TV (For example, Mi Box S can be selectively removed:
- Open the Settings. β For developers.
- Find the item Revoke debugging permissions USB.
- Confirm the review β all previously confirmed keys will be deleted.
On the computer, the keys are stored in files:
- πͺ Windows: %USERPROFILE%\.android\adbkey and adbkey.pub
- π§ Linux/macOS: ~/.android/adbkey and ~/.android/adbkey.pub
Remove them if you want to βforgetβ all connected devices.
Safety: Risks and recommendations when working with RSA-key
RSA-Keys are safe, but if you handle them carelessly, they can become vulnerable:
β οΈ Warning: Never share adbkey or adbkey.pub files with outsiders. RSA-The key will be able to connect to the Xiaomi device without your knowledge and install malware.
What can be done with a hacked RSA-key?
- π΅οΈ Install spying applications for surveillance.
- π± Access to files and device settings.
- π Update the firmware to unofficial (possibly with backdoors).
- πΈ Substitute payment system details (if saved in the browser).
How do you defend yourself?
- π Store adbkey only on trusted computers.
- π« Turn off the debugging. ADB, when she's not needed.
- π Regularly check the list of allowed devices in Settings β For developers.
- π‘οΈ Use complex passwords for your Mi Account tied to your device.
If you suspect that your RSA-key compromised, immediately:
- Revoke all debugging permissions (see section above).
- Delete the adbkey files on your computer.
- Change the password from your Mi Account account.