Why it is important to monitor APK installation from unknown sources
Xiaomiβs MIUI-based smartphones allow users to install apps not only from the official Google Play store, but also from third-party sources called.apk files, a feature that can be useful for installing beta versions of programs or applications not available in your region, but carries serious risks, from the introduction of spyware to the complete loss of control over the device.
According to Kaspersky data for 2023, more than 30% of mobile threats are spread through fake ones. APK-files masquerading as popular games or utilities. MIUI 14 Xiaomi tightened security policies, but the ability to install from unknown sources is still available β and it is actively used by attackers.
In this guide, weβll look at all the ways to disable the feature, from standard settings to hidden developer settings, and how to check which apps already have access to APK installation, and what to do if the option is inactive due to device administrator policies.
Official method: through security settings
The easiest method is to use the built-in MIUI tools, which work on all current versions of the shell (from MIUI 12 to HyperOS) and does not require superuser rights. Importantly, once disabled, you will not be able to install applications from.apk files downloaded from sites or transmitted via Telegram/WhatsApp.
Step instructions:
- Open Settings (the gear icon on the home screen or in the app menu).
- Go to the Appendix section β Application management.
- Select Special Permissions (in some versions of MIUI, it is called Application Permissions).
- Slip on the line Install unknown applications.
- In the list, select the application (such as File Manager or Browser) for which you want to disable permission.
- Move the slider to the off position.
If there are several active resolution apps on the list, repeat step 6 for each. Please note that some system utilities (such as MIUI Package Installer) may not be on this menu, and their settings change through developer mode.
Open "Settings" β "Applications"
The section βSpecial Permitsβ was found
Checked all applications in the list βInstall unknown applicationsβ
The sliders are translated to the "off" position.
Rebooted smartphone to apply changes-->
Hidden settings: Developer mode
On devices with MIUI 13/14 and HyperOS, some of the security settings are hidden behind the developer mode, which is required if the standard method does not work or you want to completely block the installation of the APK from the side.
How to activate and use:
- Go to Settings. β The phone.
- Tap 7 times on the line MIUI version (you will be notified "You became a developer!").
- Return to the main settings menu and open a new section β For developers.
- Find the USB Debugging option and activate it (this is a must to access hidden options).
- Scroll down to the Security block and select Installation via USB.
- Turn off the slider Allow installation via USB.
After this, installing APKs via ADB or PC connection will be blocked, and it is important that this method does not cancel the permissions for file managers already installed β they must be disabled separately through standard settings.
Yeah, regularly.
Yeah, but only 1-2 times.
No, never.
I don't know what that is.-->
Problems and Solutions: Why the Option Is Inactive
Sometimes users are faced with a situation where the slider "Install unknown applications" is locked in the "On" position and does not respond to clicks.
- Device Administrator Policy: If the smartphone is managed via MDM (e.g., corporate phones), the Administrator can block the change to this setting.
- Virus software: Some Trojans (such as Triada or Ztorg) block access to security settings to remain undetected.
- System error: bugs in MIUI (especially in beta versions) can cause sliders to βhangβ
Solutions for each case:
| Problem. | Diagnostics | Decision |
|---|---|---|
| Administrator policy | In the settings there is a item "Device Administrators" with an unknown application | Contact the administrator or reset the phone to factory settings |
| Viral SO | Smartphone slows down, advertising appears, warms up for no reason | Scan your device through Malwarebytes or make a reset |
| Mistake MIUI | The problem arose after the system update | Clear the cache of settings or roll back to a stable version |
If none of the methods worked, check the device for root rights (if any, some security settings are turned off automatically).
How to check the availability of root rights without applications?
Additional Protection: Password Restriction
Even after permissions are disabled, an attacker with physical access to the phone can re-activate APK installation. To avoid this, MIUI has a password-locking feature for security settings, which is available on devices with MIUI 12.5 and later.
How to turn on:
- π Go to Settings. β Password and security.
- π± Choose Application Blocking (or Privacy Protection in New Versions).
- π Enable the option to protect security settings.
- π Install. PIN-code or pattern lock (do not use simple combinations like 1234 or 0000).
Now, when trying to change the settings of the installation of unknown applications, the system will require a password, which is especially useful if the phone is used by children or the device is often in the hands of third parties (for example, when selling or repairing).
π‘
If you forget the settings lock password, the only way to reset it is to completely clean the device through Fastboot (fastboot erase userdata command).
What to do after disconnection: check the system
Disabling the installation from unknown sources is only the first step to safety, and then it is recommended to perform a series of checks to make sure that the device has not been compromised before.
- π List of installed apps: Delete any suspicious programs (especially those with names like System Update, Flash Player, or Cleaner).
- π Traffic consumption: a sudden increase in mobile data consumption may indicate hidden malware activity.
- π Autoboot: Check which apps are running when you turn on your phone (Settings) β Annexes β Autoboot).
- π File system: scan the folders Download and DCIM For the presence of unknown.apk files.
For a deep diagnosis, use:
- Malwarebytes scans for viruses and spyware.
- 360 Security β Checks for system vulnerabilities and suspicious permissions.
- VirusTotal β Download suspicious content APK-Files for analysis (via browser).
If you find signs of infection, reset to factory settings via Settings β About Phone β Reset settings. Before you do, save important data to an external drive or to the cloud.
π‘
Even after a reset, some viruses may remain in the /sdcard/ folder. Format the memory card separately through the storage settings.
Alternative methods: for advanced users
If standard methods are not suitable (for example, on devices with custom firmware or root rights), alternative methods can be used, they require technical knowledge and can lead to unstable operation of the system if used incorrectly.
Method 1: through ADB (no root rights)
Connect your phone to your PC, activate Debugging over USB and execute the command:
adb shell settings put global install_non_market_apps 0This will globally disable the installation of unknown APKs for all applications. To return the settings, replace 0 with 1.
Method 2: Editing the platform.xml file (requires root)
Open /system/etc/permissions/platform.xml file in a text editor (e.g. Root Explorer) and find the line:
<permission name="android.permission.INSTALL_PACKAGES">Add the protectionLevel="signature" attribute to limit installation to system applications only.Caution: Incorrect editing of this file may make it impossible to install any applications, including system updates.
Method 3: Using the Xposed Framework
The DisableInstall module for Xposed allows you to manage installation permissions flexibly. Note that Xposed is not compatible with MIUI 14 or later, and these versions will require LSPosed.
π‘
Before using ADB or root methods, back up your system via TWRP or Mi Flash Tool to restore the system in the event of a crash.