Disabling Application Installation from Unknown Sources on Xiaomi: The Complete Guide

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:

  1. Open Settings (the gear icon on the home screen or in the app menu).
  2. Go to the Appendix section β†’ Application management.
  3. Select Special Permissions (in some versions of MIUI, it is called Application Permissions).
  4. Slip on the line Install unknown applications.
  5. In the list, select the application (such as File Manager or Browser) for which you want to disable permission.
  6. 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:

  1. Go to Settings. β†’ The phone.
  2. Tap 7 times on the line MIUI version (you will be notified "You became a developer!").
  3. Return to the main settings menu and open a new section β†’ For developers.
  4. Find the USB Debugging option and activate it (this is a must to access hidden options).
  5. Scroll down to the Security block and select Installation via USB.
  6. 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.

  1. Device Administrator Policy: If the smartphone is managed via MDM (e.g., corporate phones), the Administrator can block the change to this setting.
  2. Virus software: Some Trojans (such as Triada or Ztorg) block access to security settings to remain undetected.
  3. System error: bugs in MIUI (especially in beta versions) can cause sliders to β€œhang”

Solutions for each case:

Problem.DiagnosticsDecision
Administrator policyIn the settings there is a item "Device Administrators" with an unknown applicationContact the administrator or reset the phone to factory settings
Viral SOSmartphone slows down, advertising appears, warms up for no reasonScan your device through Malwarebytes or make a reset
Mistake MIUIThe problem arose after the system updateClear 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?
Open the terminal (e.g., via Termux) and type in the command: su If a request for permission appears, root is available. If the command is not recognized (su: not found), no rights.

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 0

This 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.

Frequent Questions (FAQ)

Can I temporarily disable the installation of unknown APKs and then turn it back on?
Yes, you can return permission at any time via Settings β†’ Applications β†’ Special Permissions. However, remember that changing this setting often increases the risk of accidental malware installation. If you need to temporarily install APKs (for example, for testing), use a sandbox – applications like Shelter or Island allow you to isolate insecure programs from the main system.
Why can I still install APK through some apps after I turn it off?
Some system utilities (e.g. MIUI Package Installer or Updater) have privileged access and can ignore user settings. To block the installation completely, disable the permission for all applications in the Install Unknown Applications list and use the method with ADB (described above). Also check if the Magisk device is installed - it can bypass system restrictions.
How do I know which app was the last to install APK on my Xiaomi?
MIUI does not have a built-in installation log, but you can use third-party tools: App Inspector (showns the installation date of each application), Package Name Viewer (displays full APK information, including the source). ADB command: adb shell dumpsys package | grep "install" (requires PC). If you suspect that the APK was installed without your knowledge, check the /data/app/ folder for suspicious packages (you need a root for this).
Will this method work on Xiaomi tablets (like Pad 6 or Pad 5)?
Yes, the instruction is fully applicable to Xiaomi tablets based on MIUI The only difference is that the path to settings may be slightly different: On Xiaomi Pad 6: Settings β†’ Annexes β†’ Permits β†’ Install unknown applications. on Xiaomi Pad 5 Pro: Settings β†’ Additionally. β†’ Confidentiality β†’ Special access. Also, tablets may not have a "Developers" section - it needs to be activated in the same way as on smartphones (7 taps according to the version). MIUI).
What if updates to system applications have stopped being installed after the shutdown?
System updates (e.g. for Mi Home or Mi Community) are installed through the official Xiaomi installer, which is not classified as "unknown sources." If updates stop coming: Check if it's disabled MIUI Package Installer is in the permission list. Update the firmware through Settings β†’ The phone. β†’ Update system. Clear the cache of the Google Play Store and Google Play Services. If the problem persists, reset the network settings (Settings) β†’ SIM-maps and networks β†’ Resetting network settings).