How to completely prohibit the installation of applications from unknown sources on Xiaomi: instructions for MIUI

Installing applications from unknown sources (sideloading) is one of the most common causes of infection of Xiaomi smartphones with viruses, spyware and advertising software. APK-This feature opens the door to cyber threats, especially if the device is used by children or inexperienced users. In this article, we will discuss how to completely block the ability to install applications from the outside, as through system settings. MIUI, and with the help of additional security measures.

Itโ€™s important to understand that even if you donโ€™t manually install an APK, some applications (such as launchers or file managers) may request this permission automatically, weโ€™ll show you how to turn it off globally, and weโ€™ll also talk about hidden nuances that are often overlooked in standard instructions, such as why locking in security settings may not work on some models (Redmi Note 10 Pro, POCO X3 Pro) and what to do in such cases.

Why you should disable the installation from unknown sources

The main danger of manual APK installation is to bypass the built-in protection of Google Play Protect and MIUI scanning mechanisms. According to Kaspersky data for 2023, more than 60% of mobile viruses are spread through APK files disguised as:

  • ๐ŸŽฎ Game cheats (e.g. modified versions of Free Fire or Free Fire) PUBG Mobile)
  • ๐Ÿ“บ Pirate versions of streaming services (Netflix, Disney)+, Kinopoisk)
  • ๐Ÿ’ฐ Fake banking applications (cloned versions of Sberbank Online, Tinkoff)
  • ๐Ÿ”“ Hacked apps (Spotify Premium, YouTube Vanced)

Even if you download an APK from a โ€œreliableโ€ site (like APKMirror), thereโ€™s no guarantee that the file wasnโ€™t swapped on the server or modified when it was downloaded. MIUI 14 adds APK Integrity Check, but it only works for apps installed through Google Play.

โš ๏ธ Warning: On bootloader devices, malware can gain super-user rights (root) even without your knowledge, allowing viruses to masquerade as system processes (e.g. com.android.systemui) and go undetected for years.

๐Ÿ“Š Have you ever installed APK source?
Yeah, regularly.
Only 1-2 times.
No, never.
I don't know what it is.

Method 1: Blocking through MIUI security settings

The most obvious method is to disable the installation permit APK The security menu, however, depending on the version. MIUI The path to this adjustment may be different. Below is a universal algorithm for MIUI 12/13/14:

  1. Open Settings โ†’ Applications โ†’ Application Management.
  2. Click on the three dots in the top right corner and select Special Access.
  3. Slip on the item Install unknown applications.
  4. In the list, find all applications with permission to Allow from this source and turn off the slider for each.

Please note: on some models (Xiaomi 12T, Redmi K50), this item may be called Installation from unknown sources and be in Settings โ†’ Privacy.

โ˜‘๏ธ Checking the locking of the installation APK

Done: 0 / 4

After disabling, try installing any APK-The system must issue an error: "Installation locked. Enable installation permission from this source." If the error does not appear, the lock does not work (see the troubleshooting section).

Method 2: Use of Child Mode (Child Mode)

If you're using a smartphone by a child or an inexperienced user, the best option is to activate the For Kids mode, which not only blocks APK installation, but also limits:

  • ๐Ÿ•’ Time of use of the device
  • ๐Ÿ“ฑ Access to certain applications
  • ๐ŸŒ Web sites through a browser
  • ๐Ÿ’ณ Shopping on Google Play

To activate the regime:

  1. Go to Settings โ†’ Special Opportunities โ†’ Mode โ€œFor Childrenโ€.
  2. Click Start and follow the instructions for setting up PIN-code.
  3. In the Restrictions section, select Prohibit Application Installation.

โš ๏ธ Note: For Kids mode only works with active parental control through your Mi Account. If you log out or reset your settings, all restrictions will be lifted.

How to get around the regime "For children" (for parents)
If the child knows PIN-code, it can disable mode through Settings โ†’ Special opportunities. To avoid this, use complex ones. PIN (Not your date of birth! and change it periodically.

Method 3: Blocking through ADB (for advanced users)

If system settings donโ€™t work (for example, on custom firmware or root devices), you can block APK installation via Android Debug Bridge (ADB), a method that requires a PC connection and basic command line knowledge.

Instructions:

  1. Turn on USB Debugging in Settings โ†’ About Phone โ†’ MIUI version (tap 7 times, then go back to Additional โ†’ For Developers).
  2. Connect your smartphone to your PC and execute the command: adb shell settings put global install_non_market_apps 0
  3. Reset the device.

To return the ability to install APK, use the same command with 1 instead of 0.

Locking methodLevel of difficultyEfficiencyReversibility
MIUI security settingsโญ (simple)Medium (can be bypassed)Yes.
The "Children's" modeโญโญ (middle-of-the-road)High (requires PIN)Yes.
ADB-teamโญโญโญ (difficult)MaximumYes.
Getting root and removing PackageInstallerโญโญโญโญ (difficult)Absolute.Partially (requires flashing)

Method 4: Remove the APK system installer (root only)

This method irreversibly removes the possibility of installing any APK-Use it only if you are fully confident in your actions and are prepared for the consequences.

Implementation will require:

  • ๐Ÿ”“ Unlocked bootloader and root rights (e.g. via Magisk)
  • ๐Ÿ“ฑ File Manager with support for root (for example, Root Explorer or Root Explorer) FX File Explorer)
  • ๐Ÿ”„ Backup of the system (required!)

Instructions:

  1. Open the root explorer and go to /system/priv-app/PackageInstaller.
  2. Remove or rename the PackageInstaller folder (e.g., in the PackageInstaller_bak).
  3. Reset the device.

โš ๏ธ Note: After that, you will not be able to install any APK-files, including updates MIUI The only way to get back to functionality is to restore a folder from the backup or reflash the device.

๐Ÿ’ก

Before removing PackageInstaller, check if it is being used by critical system processes. To do this, run pm list packages -f | grep PackageInstaller in ADB.

What to do if the lock is not working

Sometimes even after all permissions are turned off, the system still allows you to install APKs.

Problem.Possible causeDecision
APK is installed despite the lockPackage Installer's cache not clearedClean the cache in Settings โ†’ Applications โ†’ Package Installer โ†’ Storage
Settings are reset after rebootingMistakes in MIUI OptimizationTurn off optimization in Settings โ†’ Additional โ†’ Special features โ†’ MIUI Optimization
No item "Installation of unknown applications"Outdated version of MIUI (below 10)Update the firmware or use it ADB-method
The lock works, but some APKs are installedThe application has system rights (e.g. Google Play Services)Check the list of system applications through ADB: adb shell pm list packages -s

If none of these methods worked, check your device for malware that could be a substitute for system settings.

  1. Install Malwarebytes or Dr.Web Light from Google Play.
  2. Run a deep scan.
  3. Pay attention to applications with rights android.permission.INSTALL_PACKAGES.

Additional security measures

In addition to blocking the APK installation, we recommend:

  • ๐Ÿ”’ Disable the installation from the browser: in Settings โ†’ Annexes โ†’ browser โ†’ Permits to deny access to storage.
  • ๐Ÿ“ฅ Lock down the loading. APK: In Google Chrome, go to Settings โ†’ Download and disable the option Request a Save Place for.apk files.
  • ๐Ÿ›ก๏ธ Enable Google Play Protect: Play Store โ†’ Menus. โ†’ Play Protect โ†’ Scan the device.
  • ๐Ÿ”„ Update regularly MIUI: In new versions, vulnerabilities are closed that allow to bypass the locks.

For corporate devices or smartphones issued to employees, consider using MDM-Mobile Device Management (Mi Enterprise Management) or Hexnode UEM. These services allow you to centrally manage permissions on all devices of the company.

๐Ÿ’ก

Even with the APK installation blocked, malware can penetrate vulnerabilities in the browser or messengers (such as phishing links on WhatsApp).

Troubleshooting and frequent errors

Letโ€™s look at typical situations where the APK installation lock is not working correctly:

Error 1: After disabling permissions in Special Access, some applications (such as File Manager) still offer to install APK.

Solution: These applications may have an integrated installer. Uninstall them or disable them via ADB:

adb shell pm disable-user --user 0 com.android.packageinstaller

Error 2: There is no Install Unknown Apps in Settings on POCO F3 or Redmi Note 11.

Solution: On these models, the path is different: Settings โ†’ Privacy โ†’ Additional โ†’ Installation from unknown sources.

Error 3: After the MIUI update, all settings reset.

Solution: This is a known version problem MIUI 13.0.4โ€“13.0.6. Update to the latest stable firmware or use ADB-method.

Error 4: When you try to install an APK, you will see a message that says โ€œApplication not installedโ€ but without asking for permission.

Solution: This means that the lock has worked at the system level. However, some malicious APKs can exploit the Dirty Pipe vulnerability (CVE-2022-0847) to bypass the restrictions.

adb shell su

If the command is executed without errors, you have root and it needs to be removed.

FAQ: Frequent questions

Can I block APK installation only for certain applications?
Yeah, in MIUI You can selectively disable permission Install unknown applications for individual programs (for example, only for Chrome or Telegram). โ†’ Annexes โ†’ Application management. Select the desired application (e.g. Browser). โ†’ Additionally. โ†’ Install unknown applications. Disable the slider. Other applications can install APK, If they have the appropriate permission.
What if your child knows the password for the โ€œChildrenโ€?
If the child found out PIN-code, reset it through your Mi Account: Go to account.xiaomi.com. Select your device under Device Management. โ†’ Lock and install a new one. PIN. You can also use third-party parental control apps, such as Kids Place or Norton Family, which block installation. APK launcher-level.
How to check if the APK installation is blocked?
Download any harmless APK (like Google Calendar from APKMirror) and try installing it. One of the messages should appear: "Installation blocked by administrator settings" - lock works. "Failed to analyze the package" - maybe corrupted file (try another APK). "Application not installed" without further explanation - lock at the system level (ADB or root). If the installation is error-free, the lock did not work. Check the settings again or use alternative methods from this article.
Can I block APK installation without root and ADB?
Alternative ways: Use an antivirus with a lock-in feature (e.g. Avast Mobile Security or Bitdefender), install an alternative launcher (e.g. Nova Launcher) and disable PackageInstaller. Activate guest mode in MIUI (restricts access to system functions), but these methods do not provide 100% guarantee, since an experienced user can bypass them.
Why does the APK installation lock disappear after resetting?
When hard reset (reset to factory settings), all user settings are reset, including permissions to install APK. To avoid this: Before reset, write down all permissions disabled (take screenshots). After reset, immediately reset the lock (see Method 1). Use Mi Cloud to back up security settings (in MIUI 14 this feature is available in Settings โ†’ Xiaomi Account โ†’ Mi Cloud โ†’ Backup). Some devices (for example, Xiaomi 13 Pro) may need to re-attach the Mi Account after reset.