Device and method for preventing Android application from being uninstalled
By using the data partition generation, import and recovery module for non-uninstallable applications in the Android system, combined with user certificate signature verification, the problem of malicious or accidental uninstallation of smart POS terminal applications is solved, ensuring that the application cannot be uninstalled even after restoring the factory settings, thereby improving the security and stability of the terminal.
Patent Information
- Application Number
- CN202211530959.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-12-01
AI Technical Summary
Existing technical solutions cannot effectively prevent Android applications from being maliciously or accidentally uninstalled on smart POS terminals, especially since the applications may still be uninstalled after restoring factory settings, and lack flexibility and security.
Adopting the data partition generation module, import module and recovery module for non-uninstallable applications, and utilizing user certificate signature verification and data partition management, it ensures that key applications are installed and set as non-uninstallable in fastboot mode. It also makes judgments and prompts during the system uninstallation process, and non-uninstallable applications can still be installed when restoring factory settings.
It enables flexible management of non-uninstallable applications under user certificate verification, and can keep applications non-uninstallable after restoring factory settings, enhancing the security of smart terminals and the stability of applications, and avoiding data loss.
Smart Images

Figure CN115756522B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a device and method for preventing Android applications from being uninstalled. Background Art
[0002] Existing smart POS (Point of Sale) terminals widely use the Android system. To meet security requirements, specific Android applications must be installed to enable secure transactions. These applications are considered critical applications for POS terminals. Malicious or accidental uninstallation of these critical applications during POS use can directly impact the functionality of the smart POS. Furthermore, maliciously uninstalling a critical application and then replacing it with an unauthorized application containing a Trojan horse poses a significant threat. This solution provides a method and apparatus for preventing application uninstallation in the Android system, thereby preventing the malicious or accidental uninstallation of critical applications.
[0003] Based on the special value of some key applications in industry terminals, the anti-uninstall function has also emerged. Currently, the solutions to this problem on the market are generally the following:
[0004] a. Factory pre-installation: Use the system signature file to sign key applications. During the development process, the application is pre-installed in the system / app directory to become a system application, achieving the function of not being able to be uninstalled. However, this makes it impossible to guarantee that the application is compatible with products from all different manufacturers.
[0005] b. Applications that activate the device manager cannot be uninstalled directly. The device manager needs to be deactivated. When the user clicks to deactivate the device manager, the application can receive a deactivation notification and prohibit the deactivation of the device manager by preventing the program from returning normally, thereby achieving the anti-uninstall function.
[0006] c. Use the system manager to manage the list of non-uninstallable applications, intercept the uninstall message in the middle of the system uninstall process, determine the application as non-uninstallable, and prevent the uninstall action.
[0007] All existing solutions can implement the anti-uninstall function. The factory-preset solution is controlled by the manufacturer and has the highest security but is inflexible. Users cannot add new non-deletable applications after leaving the factory. Solutions b and c require the management of non-removable applications through the device manager, which is more flexible, but the control is in the hands of the device user. The anti-uninstall setting will become invalid after deleting user data. There is also a lack of a central management mechanism, resulting in insufficient security. Summary of the Invention
[0008] To solve the above problem, the present invention provides a device and method for preventing Android applications from being uninstalled.
[0009] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0010] A device for preventing Android applications from being uninstalled, comprising: a data partition generation module for non-uninstallable applications, and a non-uninstallable application import module;
[0011] The data partition generation module of the non-uninstallable application includes:
[0012] The configuration unit creates a data partition for storing non-uninstallable applications, marks the installation package file name and non-uninstallation information of the non-uninstallable application in the configuration file, and packages the data / preinstall partition containing the configuration file and the non-uninstallable application into a non-uninstallable data partition;
[0013] The signature unit uses the user certificate to sign the non-removable data partition. The device with the user certificate installed can download the corresponding non-removable data partition.
[0014] Non-removable application import modules include:
[0015] The download unit flashes the non-removable data partition to the device in fastboot mode. During the download process, the user certificate is used to verify the signature of the data partition. After the signature verification is passed, the non-removable applications and configuration files in the data partition are saved in the data / preinstall directory;
[0016] The installation unit, after downloading the non-removable data partition and the device is booted up, triggers the installation of the non-removable application and sets the application to be non-removable;
[0017] a judgment unit, for judging whether an application is non-uninstallable during a process of uninstalling an application by the system;
[0018] The prompting unit blocks the uninstallation action and prompts the user if the application is not uninstallable according to the judgment result of the judging unit.
[0019] Furthermore, the device for preventing Android applications from being uninstalled also includes a non-uninstallable application recovery module, which includes: an installation unit, a judgment unit and a prompt unit. Each unit is the same as the installation unit, judgment unit and prompt unit in the non-uninstallable import module. After the device is restored to factory settings, the installation unit will be triggered to execute, thereby realizing the function that key applications cannot be uninstalled even after restoring the factory settings.
[0020] The present invention also provides a method for preventing an Android application from being uninstalled, comprising the following steps:
[0021] 1) Unable to uninstall application data partition;
[0022] 2) Use the user certificate to sign the data partition containing the non-removable application;
[0023] 3) Switch the device to fastboot mode and download the signed data partition containing the non-removable application;
[0024] 4) After the data partition is successfully downloaded, install the non-removable application and set the application to be non-removable;
[0025] 5) Each time an application uninstallation operation occurs, determine whether the application is non-uninstallable in the system's application uninstallation process;
[0026] 6) According to the judgment result of the judgment unit, if the application is not uninstallable, the uninstallation action is blocked and the user is prompted.
[0027] Furthermore, step 1) creating a partition for non-removable application data includes the following steps:
[0028] Mark the installation package file name and non-uninstallation information of the non-uninstallable application in the configuration file, and package the data / preinstall partition containing the configuration file and the non-uninstallable application into a non-uninstallable data partition.
[0029] Furthermore, after the data partition is successfully downloaded in step 4), the device is restarted, and after the device is restarted, the non-uninstallable application is installed.
[0030] Furthermore, the method for preventing the Android application from being uninstalled further includes: after the device is restored to factory settings, installing the non-uninstallable application according to the non-uninstallable data partition, and setting the application to be non-uninstallable.
[0031] Based on the above, the present invention also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the above-mentioned method of preventing Android applications from being uninstalled.
[0032] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0033] 1) The solution designed by the present invention to prevent applications from being uninstalled uses user certificates to manage non-uninstallable applications. User data partitions containing non-uninstallable applications can only be downloaded and installed after verification with user certificates. This solves the problem that existing factory-preset solutions cannot be flexibly adapted to different manufacturers.
[0034] 2) The solution designed by the present invention to prevent applications from being uninstalled stores non-uninstallable applications in the data / preinstall partition of the data partition. Restoring the factory settings will not clear the partition. After the factory settings are restored, the applications in the partition will be reinstalled, which solves the problem of existing solutions b and c that applications will be uninstalled and cannot be restored after restoring the factory settings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 This is the installation flow chart for non-uninstallable applications;
[0037] Figure 2 A schematic diagram of a module for generating data partitions for non-uninstallable applications;
[0038] Figure 3 Schematic diagram of importing modules for non-uninstallable applications;
[0039] Figure 4 Schematic diagram of restoring modules for non-uninstallable applications. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention for which protection is sought, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] Refer to the attached Figure 1-4 As shown, this embodiment provides a device for preventing applications from being uninstalled in an Android system, including: a data partition generation module for non-uninstallable applications, a non-uninstallable application import module, and a non-uninstallable application recovery module;
[0042] The data partition generation module for non-uninstallable applications includes: a configuration unit, which creates a data partition for storing non-uninstallable applications, marks the installation package file name and non-uninstall information of the non-uninstallable application in the configuration file, and packages the data / preinstall partition containing the configuration file and the non-uninstallable application into a non-uninstallable data partition; a signing unit, which uses the user certificate to sign the non-uninstallable data partition, and the device with the user certificate installed can download the corresponding non-uninstallable data partition.
[0043] The non-uninstallable application import module includes: a download unit, which flashes the non-uninstallable data partition to the device in fastboot mode. The data partition will be signed and verified using the user certificate during the download process. After the signature verification is passed, the non-uninstallable applications and configuration files in the data partition will be saved in the data / preinstall directory; an installation unit, which triggers the installation of non-uninstallable applications after the non-uninstallable data partition is downloaded and the device is started up, and sets the application to be non-uninstallable; a judgment unit, which judges whether it is a non-uninstallable application in the process of uninstalling the application by the system; a prompt unit, which, based on the judgment result of the judgment unit, blocks the uninstall action and prompts the user if it is a non-uninstallable application.
[0044] The non-uninstallable application recovery module includes: an installation unit, a judgment unit, and a prompt unit. Each unit is the same as the installation, judgment, and prompt units in the non-uninstallable import module. After the device is restored to factory settings, the installation unit will be triggered to execute, realizing the function that key applications cannot be uninstalled even after restoring the factory settings.
[0045] This embodiment also provides a method for preventing an Android application from being uninstalled, comprising the following steps:
[0046] 1) Create a partition for non-removable application data; specifically, the following steps are included:
[0047] Mark the installation package file name and non-uninstallation information of the non-uninstallable application in the configuration file, and package the data / preinstall partition containing the configuration file and the non-uninstallable application into a non-uninstallable data partition.
[0048] 2) Use the user certificate to sign the data partition containing the non-removable application;
[0049] 3) Switch the device to fastboot mode and download the signed data partition containing the non-removable application;
[0050] 4) After the data partition is successfully downloaded and the device is restarted, install the non-removable application and set the application to be non-removable;
[0051] 5) Each time an application uninstallation operation occurs, determine whether the application is non-uninstallable in the system's application uninstallation process;
[0052] 6) According to the judgment result of the judgment unit, if the application is not uninstallable, the uninstallation action is blocked and the user is prompted.
[0053] 7) After the device is restored to factory settings, install the non-removable application according to the non-removable data partition and set the application to be non-removable.
[0054] The device and method for preventing Android applications from being uninstalled provided by the present invention allow customers to install non-uninstallable applications and manage them in a unified manner after the device leaves the factory, and non-uninstallable applications will not be lost after restoring the factory settings, preventing data loss caused by malicious or accidental uninstallation of key applications, thereby enhancing the security of smart terminals.
[0055] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0056] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0057] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A device for preventing an Android application from being uninstalled, characterized in that: include: Data partition generation module for non-uninstallable applications, and non-uninstallable application import module; The data partition generation module of the non-uninstallable application includes: The configuration unit creates a data partition for storing non-uninstallable applications, marks the installation package file name and non-uninstallation information of the non-uninstallable application in the configuration file, and packages the data / preinstall partition containing the configuration file and the non-uninstallable application into a non-uninstallable data partition; The signature unit uses the user certificate to sign the non-removable data partition. The device with the user certificate installed can download the corresponding non-removable data partition. Non-removable application import modules include: The download unit flashes the non-removable data partition to the device in fastboot mode. During the download process, the user certificate is used to verify the signature of the data partition. After the signature verification is passed, the non-removable applications and configuration files in the data partition are saved in the data / preinstall directory; The installation unit, after downloading the non-removable data partition and the device is booted up, triggers the installation of the non-removable application and sets the application to be non-removable; a judgment unit, for judging whether an application is non-uninstallable during a process of uninstalling an application by the system; The prompting unit blocks the uninstallation action and prompts the user if the application is not uninstallable according to the judgment result of the judging unit.
2. The device for preventing Android applications from being uninstalled according to claim 1, wherein: It also includes a non-uninstallable application recovery module, which includes: an installation unit, a judgment unit and a prompt unit. Each unit is the same as the installation unit, judgment unit and prompt unit in the non-uninstallable import module, and will trigger the execution of the installation unit after the device is restored to factory settings.
3. A method for preventing an Android application from being uninstalled, characterized in that: The method is applied to the device according to claim 1 or 2, and comprises the following steps: 1) Unable to uninstall application data partition; 2) Use the user certificate to sign the data partition containing the non-removable application; 3) Switch the device to fastboot mode and download the signed data partition containing the non-removable application; 4) After the data partition is successfully downloaded, install the non-removable application and set the application to be non-removable; 5) Every time an application is uninstalled, determine whether it is an un-uninstallable application in the system's application uninstallation process; 6) According to the judgment result of the judgment unit, if the application is not uninstallable, the uninstallation action is blocked and the user is prompted.
4. A method for preventing an Android application from being uninstalled according to claim 3, characterized in that: Step 1) Create a partition for non-removable application data, including the following steps: Mark the installation package file name and non-uninstallation information of the non-uninstallable application in the configuration file, and package the data / preinstall partition containing the configuration file and the non-uninstallable application into a non-uninstallable data partition.
5. A method for preventing an Android application from being uninstalled according to claim 3, characterized in that: In step 4), after the data partition is successfully downloaded, the device is restarted. After the device restarts, the non-removable application is installed.
6. A method for preventing an Android application from being uninstalled according to claim 3, characterized in that: Also includes: After the device is restored to factory settings, install the non-removable application based on the non-removable data partition and set the application to be non-removable.
7. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the method for preventing Android applications from being uninstalled as described in one of claims 3 to 6.
Citation Information
Patent Citations
Method and device for preventing application program in operating system from being uninstalled
CN103971056A
A mobile device safety management system
CN109460660A