CN107729022B - Method and device for unloading application program and mobile terminal - Google Patents
Method and device for unloading application program and mobile terminal Download PDFInfo
- Publication number
- CN107729022B CN107729022B CN201610659716.1A CN201610659716A CN107729022B CN 107729022 B CN107729022 B CN 107729022B CN 201610659716 A CN201610659716 A CN 201610659716A CN 107729022 B CN107729022 B CN 107729022B
- Authority
- CN
- China
- Prior art keywords
- preset file
- deleted
- state
- triggering
- preset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/62—Uninstallation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44594—Unloading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses a method and a device for uninstalling an application program and a mobile terminal. Wherein, the method comprises the following steps: judging whether a preset file is deleted or not, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation; and if so, clearing the process data corresponding to the same user identifier in the application program. The invention solves the technical problem that the abnormality generated in the unloading process cannot be avoided because the unloading application program can only be repaired when the abnormality occurs.
Description
Technical Field
The invention relates to the field of electronic technology application, in particular to a method and a device for uninstalling an application program and a mobile terminal.
Background
With the increase of the types of mobile terminals, how to ensure smooth uninstallation of an application program from the mobile terminal and avoid the problem that the application program leaves residual data in the uninstalling process become urgent to solve today.
The mobile terminal includes: the method comprises the steps that a smart phone, a tablet personal computer, an intelligent wearable device or a notebook computer and the like are taken as examples of the smart phone applying Android system Android, when an application program is unloaded on the Android phone, if the application program is reading and writing a file, a/data/package directory file residue occurs with probability, and then the uid of a file owner is reserved by a system. When the system of the Android mobile phone INSTALLs the application with the same package name next time, the exception of INSTALL _ FAILED _ UID _ CHANGED occurs, and then the installation fails. The mobile phone can not be installed with the application of the same package name any more below android5.0, and can be installed with the application of the same package name more than android 5.0.
In the related technology, after the exception of INSTALL _ FAILED _ UID _ CHANGED occurs, each repair scheme appears, namely, the mobile phone is required to be root, and the file is manually cleaned by the user; or, the mobile phone is restored to factory settings; however, both of the above methods are subsequent compensation methods after an exception occurs, and it is very likely to affect the use of other applications during the operation of cleaning or restoring factory settings.
In view of the above-mentioned problem that the uninstalled application program can only be repaired when it is abnormal, and the abnormality generated during the uninstalling process cannot be avoided, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a mobile terminal for unloading an application program, which at least solve the technical problem that the abnormal condition generated in the unloading process cannot be avoided because the abnormal condition of the unloaded application program can only be repaired.
According to an aspect of an embodiment of the present invention, there is provided a mobile terminal including: the data processor is used for monitoring whether the preset file is deleted through the communication bus and triggering and clearing process data corresponding to the same user identifier in the application program under the condition of monitoring that the preset file is deleted; and deleting the preset file to indicate that the operation of deleting the application program is uninstalling operation.
According to another aspect of the embodiments of the present invention, there is also provided a method for uninstalling an application, including: judging whether a preset file is deleted or not, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation; and if so, clearing the process data corresponding to the same user identifier in the application program.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for uninstalling an application, including: the judging module is used for judging whether the preset file is deleted or not, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation; and the clearing module is used for clearing the process data corresponding to the same user identifier in the application program under the condition that the judgment result is yes.
In the embodiment of the invention, whether the preset file is deleted is judged, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation; and if the judgment result is yes, clearing the process data corresponding to the same user identifier in the application program, so as to achieve the purpose of avoiding the abnormity generated in the unloading process, thereby realizing the cleaning of the data when the application is detected to be unloaded, avoiding the technical effect of unloading residue, and further solving the technical problem that the abnormity generated in the unloading process cannot be avoided because the abnormal application program can only be repaired when the application is unloaded.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a mobile terminal according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for uninstalling an application according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a method for uninstalling an application according to a first embodiment of the present invention;
FIG. 4 is a flowchart illustrating uninstallation detection in a method of uninstalling an application according to a first embodiment of the present invention;
FIG. 5 is a flow chart of self-cleaning in a method for uninstalling an application according to a first embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus for uninstalling an application according to a third embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The technical terms related to the embodiments of the present application are:
the application program comprises the following steps: software installed on the mobile terminal is used for improving the defects and individuation of the original system;
a first preset file: the method comprises the steps that whether a deleting operation exists or not is monitored, the first preset file is deleted in the process of data cleaning or file reconstruction, but the deletion of the first preset file does not represent that the current deleting operation is the operation of unloading an application program;
presetting a file: the method includes the steps that a directory is created when a system is installed, the directory links to/data/app/< package >/lib, the directory cannot be deleted except for uninstalling, when Android starts to uninstall, a first deleted file is/data/data/< package >/lib, namely, the preset file is not necessarily deleted under the condition that the first preset file is deleted, but when a second preset file is deleted, the application program is triggered to uninstall a process, according to the embodiment of the application, whether the preset file still exists or not is detected through deletion of the first preset file, and accordingly process data corresponding to the same user identifier in the application program are cleared in the process of uninstalling the application program;
and (4) process: the above operation activities on a certain data set in the program operation process are basic units for resource allocation and scheduling of the system, and are the basis of the operating system structure.
Example 1
There is also provided, in accordance with an embodiment of the present invention, an embodiment of a mobile terminal, to note that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The embodiment of the mobile terminal provided in the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking an example of the present invention running on a mobile terminal, fig. 1 is a block diagram of a hardware structure of the mobile terminal according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include: a data processor 12 and a communication bus 14, wherein,
the data processor 12 is configured to monitor whether the preset file is deleted through the communication bus 14, and trigger to clear process data corresponding to the same user identifier in the application program when the preset file is monitored to be deleted;
and deleting the preset file to indicate that the operation of deleting the application program is uninstalling operation.
The mobile terminal provided by the above embodiment of the present application may be: in the embodiment of the present application, since the Android mobile phone is usually used for unloading an application program, if the application program is reading and writing a file, a/data/< package > directory file residue occurs with a probability, and then the system can retain the uid of the file owner. When the system of the Android mobile phone INSTALLs the application program with the same package name next time, an exception of installation failure (INSTALL _ FAILED _ UID _ CHANGED) caused by the change of the UID occurs, and then the installation fails. The mobile phone can not be installed with the application of the same package name any more below android5.0, and can be installed with the application of the same package name more than android 5.0.
In the embodiment of the application, the Android mobile phone monitors whether the first preset file is deleted through the communication bus 14, whether the preset file is deleted is continuously detected under the condition that the deletion of the first preset file is monitored, and the process data corresponding to the same user identifier in the application program is triggered to be cleared under the condition that the preset file is deleted, so that the possibility that the UID of the file owner is reserved by the system due to reading operation in the unloading process in the related technology is avoided in the process of unloading the application program, and the exception of installation failure (INSTALL _ FAILED _ UID _ CHANGED) caused by the change of the UID when the application program with the same package name is installed next time in the system is avoided, so that the installation failure is caused.
Specifically, taking unloading "QQ music" as an example, the first preset file takes registering a file deletion listener through an orphan process to monitor a custom file under/data/data/< package > as an example, and the preset file takes lib file as an example, because the first preset file is deleted when a deletion operation occurs, for example, the first preset file is deleted when a user clears data; if monitoring whether the operation of unloading the QQ music exists, detecting whether the lib file is deleted or not, if the lib file is deleted, indicating that the process of unloading the QQ music is started, clearing the process directory of the same uid by traversing the process directory under the preset path where the QQ music is located, further clearing all files under the process directory, pushing out the process after the execution is finished, knowing that the QQ music is successfully deleted, and avoiding the generation of new files because the process directory of the same uid is deleted, further clearing all files under the process directory and completely unloading the QQ music.
The process directory under the preset path mentioned in the embodiment of the present application may be: process directory under/proc/; the process directory may be/data/data/< package >.
In the mobile terminal provided by the embodiment of the invention, whether the preset file is deleted is judged, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation; and if the preset file is deleted, the current deleting operation is the operation of unloading the application program, so that the purpose of avoiding the abnormality generated in the unloading process is achieved, the data of the application is cleaned when the application is detected to be unloaded, the technical effect of unloading the residual is avoided, and the technical problem that the abnormality generated in the unloading process cannot be avoided because only the abnormal application program can be repaired when the application is detected to be unloaded is solved.
Example 2
In the above operating environment, the present application provides a method of uninstalling an application as shown in fig. 2. Fig. 2 is a flowchart of a method for uninstalling an application according to a first embodiment of the present invention.
Step S202, judging whether a preset file is deleted or not, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation;
in the foregoing step S202 of the present application, the method for uninstalling an application program provided in this application embodiment may be applied to the mobile terminal in embodiment 1.
Specifically, the preset file in the embodiment of the application may be a lib directory, where the lib directory is a directory created by the Android system during installation, and is link to/data/app/< package >/lib, and in a case except for uninstallation, the lib directory is not deleted, and when the Android starts to uninstall, the first deleted file is/data/data/< package >/lib.
And step S204, clearing the process data corresponding to the same user identifier in the application program under the condition that the judgment result is yes.
Based on the detection of the preset file in step S202, in step S204, if the preset file is deleted, the process data corresponding to the same user identifier in the application program is triggered to be cleared.
Specifically, still taking unloading "QQ music" as an example, when a lib directory in the QQ music is deleted, all process data of the same uid under the lib directory are deleted, and then the effect of eliminating the generation of new files is achieved by cleaning the process.
In the method for uninstalling an application provided in the embodiment of the present invention, whether a preset file is deleted is determined, where the deletion of the preset file is used to indicate that an operation of deleting the application is an uninstalling operation; and if the judgment result is yes, clearing the process data corresponding to the same user identifier in the application program, so as to achieve the purpose of avoiding the abnormity generated in the unloading process, thereby realizing the cleaning of the data when the application is detected to be unloaded, avoiding the technical effect of unloading residue, and further solving the technical problem that the abnormity generated in the unloading process cannot be avoided because the abnormal application program can only be repaired when the application is unloaded.
Optionally, before determining whether the preset file is deleted in step S202, the method for uninstalling an application program provided in the embodiment of the present application further includes:
step S200, a first trigger process and a second trigger process are established;
in the foregoing step S200 of the present application, the method for uninstalling an application program according to the embodiment of the present application performs uninstalling detection in a line in the process of uninstalling an application program, and detects whether there is an uninstalling operation on the application program by creating two different processes.
Specifically, in this embodiment of the present application, the first triggering process may be a file monitoring process, and the second triggering process may be a process call.
Step S201, triggering the first triggering process and/or the second triggering process according to a preset sequence.
Based on the first trigger process and the second trigger process created in step S200, in step S201, any one of the first trigger process and the second trigger process is triggered.
Specifically, it should be noted that, as long as any one of the first triggering process and the second triggering process that is proposed in the embodiment of the present application completes the uninstallation detection, the self-cleaning operation may be triggered, that is, step S204 in the embodiment of the present application. The initial intention of setting the two types of trigger processes is that the two types of trigger processes are set in order to meet the requirements of different terminal devices because the trigger time of the first trigger process and the trigger time of the second trigger process on different terminal devices are different in sequence.
Further, optionally, the step S202 of determining whether the preset file is deleted includes:
step1, under the condition of triggering the first trigger process, creating a first preset file according to preset conditions, wherein the preset conditions are used for monitoring whether a deletion event occurs;
in Step1 of the above Step S202, a first preset file is created according to a preset condition when the first trigger process is triggered.
The first default file is created to first determine whether there is a deletion operation, and then further trigger step S202 to determine whether the default file is deleted.
Step2, monitoring whether a first preset file is deleted or not, wherein the deletion of the first preset file is used for indicating that a deletion operation exists in the current process;
in Step2 in Step S202, after the first preset file is created, monitoring whether the first preset file is deleted is performed.
Whether a deletion operation is generated is judged by monitoring whether the first preset file is deleted, namely, if the first preset file is deleted, the operation of deleting the application program in the current mobile terminal is indicated.
Specifically, for example, the "QQ music" is deleted, and for example, the smartphone suitable for the Android system is used, the Android system monitors whether the first preset file in the QQ music program is deleted.
Step3, when the first preset file is deleted, judging whether the preset file exists.
Specifically, under the condition that the first preset file is deleted, whether the preset file is deleted or not is detected, wherein the preset file is used for indicating that the deletion operation is the operation of uninstalling the application program.
Optionally, after determining whether the preset file is deleted in step S202, the method for uninstalling an application program provided in the embodiment of the present application further includes:
step S203, under the condition of detecting the existence of the preset file, creating a first preset file according to preset conditions;
in step S203 of the present application, after detecting that the preset file is not deleted, that is, in the embodiment of the present application, under the condition that it is detected that the preset file exists, the first preset file is created again.
Specifically, the preset file is not deleted, which indicates that the deletion action of the first preset file is deleted when the user clears the data, and is not in the unloading process. Because, the default file will be deleted once the uninstall process occurs.
Step S205, monitoring whether the created first preset file is deleted until detecting that the preset file is deleted, and triggering to clear the process data corresponding to the same user identifier in the application program.
Based on the first preset file recreated in step S203, in step S205 described above, the Android system listens again whether the first preset file is deleted until it is detected that the second preset file is deleted.
Optionally, the method for uninstalling an application provided in the embodiment of the present application further includes:
step1, under the condition of triggering a second triggering process, creating a second process according to the first process, wherein the second process is a sub-process of the first process;
step1 in Step S202 above is different from the first triggering process, and in the second triggering process, a child process is created according to a parent process, and pipeline communication between the parent process and the child process is performed, that is, the parent process is the first process in the embodiment of the present application, and the child process is the second process in the embodiment of the present application.
Step2, establishing pipeline communication between the first process and the second process;
based on the child process created at Step1, in the above Step2, a pipe communication is established between the parent process and the child process, which is used to determine whether there is time for uninstalling the application program by monitoring the communication state of the pipe, and Step3 is executed by monitoring the pipe communication.
Step3, monitoring whether the state of the pipe communication changes from a first state to a second state, wherein the first state is a blocking state, and the second state is a reading state.
Further, optionally, the step S202 of determining whether the preset file is deleted includes:
step1, deleting the first process or the second process when the state of the pipeline communication is monitored to be changed from the first state to the second state;
step2, detecting whether the second preset file is deleted through the second process under the condition that the first process is deleted;
step3, in the case of deleting the second process, detecting whether the second preset file is deleted through the first process.
In the above steps from Step1 to Step3, when unloading starts, one of the parent and child processes is killed first, then the pipeline is disconnected, the read operation of the still-alive process returns, and then the detection starts.
Optionally, after determining whether the preset file is deleted in step S202, the method for uninstalling an application program provided in the embodiment of the present application further includes:
step4, when the first process is deleted, if the second preset file exists, the first process is waken up.
Based on steps 1 to 3 in Step S202, if the first process is deleted and the second pre-stored file still exists, the first process is woken up by the second process.
Optionally, after determining whether the preset file is deleted in step S202, the method for uninstalling an application program provided in the embodiment of the present application further includes:
step 4', if the second process is deleted, if the second preset file exists, closing the pipeline communication;
step 5', creating a second process according to the first process, and establishing pipeline communication between the first process and the second process;
step 6', monitoring whether the state of the pipeline communication is changed from the first state to the second state or not until detecting that the second preset file is deleted, and triggering to clear the process data corresponding to the same user identifier.
In the above steps from Step4 'to Step 6', the difference is that in Step4, when the second process is deleted, the first process determines whether the second preset file exists, if so, the pipe communication is closed, the second process is created again, the pipe communication between the first process and the second process is created again, and then whether an unloading event exists is monitored again until the second preset file is deleted.
Here, in the embodiment of the present application, the pipeline communication mechanism of the first process and the second process is the same as the way of monitoring the first preset file in the first trigger process, and it is required to first determine whether a deletion operation exists, so as to further determine whether the second preset file (lib directory) exists.
Optionally, the step S204 of removing the process data corresponding to the same user identifier in the application program includes:
step1, traversing the process directory corresponding to the same user identifier under the preset path;
step2, judging whether the process directory is the directory corresponding to the application program;
step3, deleting the process directory if the judgment result is yes;
step4, the process directory is deleted to remove all data in the process directory.
In steps 1 to 4 of the above Step S206, the process is cleared: traverse/proc/process directory under. If the directory is judged to be the self-application directory, the self-application directory is killed. Because of being the same uid, own process can kill other own processes at will. Self-cleaning of files: and after the process cleaning is executed, all files below/data/data/< package > are cleaned after a new file is generated. Process suicide: after the above processing is completed, the process exits from the own process.
In summary, fig. 3 is a flowchart of a method for uninstalling an application according to an embodiment of the present invention, and as shown in fig. 3, the method for uninstalling an application provided in the embodiment of the present application includes the following specific steps:
the method mainly comprises two steps of unloading detection and self-cleaning.
Firstly, unloading detection: the system does not notify the uninstalled application itself whether it is uninstalled. We detect whether or not we are offloading itself through the following two trigger points.
On different devices, the two trigger points have a sequential trigger order, but the self-cleaning logic executed is the same regardless of which trigger is triggered.
Trigger point 1: file monitoring: and registering a file deletion listener through an orphan process to monitor a deletion event of the next custom file, wherein the deletion event of the next custom file is/data/data/< package >, the system deletes the file when unloading is started, and detection is started after the event is monitored.
Trigger point 2: and (3) process mutual calling: by opening a child process, the child process and the parent process establish pipeline communication, do reading operation with each other, and then block there. When unloading is started, one of the parent and child processes is killed, then the pipeline is disconnected, the read operation of the still-alive process returns, and then detection is started.
When the detection is triggered, whether the directory/data/data/< package >/lib exists is detected. If not, it is unloading. Since lib is a directory created by the system at the time of installation, it links to/data/app/< package >/lib/, it is not deleted except for the case of uninstallation, and when Android starts uninstalling, the first deleted file is/data/data/< package >/lib. As shown in fig. 4, fig. 4 is a flowchart of uninstallation detection in a method of uninstalling an application according to a first embodiment of the present invention.
Secondly, self-cleaning: when the previous step judges that the self is being unloaded, self-cleaning is started, and the self-cleaning is divided into the following 3 steps.
Process cleaning: traverse/proc/process directory under. If the directory is judged to be the self-application directory, the self-application directory is killed. Because of being the same uid, own process can kill other own processes at will.
Self-cleaning of files: and after the process cleaning is executed, all files below/data/data/< package > are cleaned after a new file is generated.
Process suicide: after the above processing is completed, the process exits from the own process. As shown in fig. 5, fig. 5 is a flowchart of self-cleaning in a method for uninstalling an application according to a first embodiment of the present invention.
After the two steps are completed, the generation of new files and the residue of the files in the unloading process are avoided. Therefore, the problem that INSTALL _ FAILED _ UID _ CHANGED appears in the next installation is solved.
The method for uninstalling the application program provided by the embodiment of the application program is used for detecting the uninstalled event of the application program by combining file event monitoring and process mutual calling, and simultaneously solving the problem of uninstalling residue by combining self-cleaning. By detecting the uninstalled operation of the application, when the application is detected to be uninstalled, the data of the application is cleaned, and uninstalling residue is avoided.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method for uninstalling an application according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation manner in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 3
According to the embodiment of the present application, an apparatus embodiment for implementing the above method embodiment is also provided, and the apparatus provided by the above embodiment of the present application may be run on a mobile terminal.
Fig. 6 is a schematic structural diagram of an apparatus for uninstalling an application according to a third embodiment of the present invention.
As shown in fig. 6, the apparatus for uninstalling an application may include: a decision block 62 and a purge block 64.
The judging module 62 is configured to judge whether the preset file is deleted, where deleting the preset file is used to indicate that the operation of deleting the application program is an uninstalling operation;
and the clearing module 64 is configured to clear the process data corresponding to the same user identifier in the application program if the determination result is yes.
In the device for uninstalling an application program, whether a preset file is deleted is judged, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an uninstalling operation; and if the judgment result is yes, clearing the process data corresponding to the same user identifier in the application program, so as to achieve the purpose of avoiding the abnormity generated in the unloading process, thereby realizing the cleaning of the data when the application is detected to be unloaded, avoiding the technical effect of unloading residue, and further solving the technical problem that the abnormity generated in the unloading process cannot be avoided because the abnormal application program can only be repaired when the application is unloaded.
It should be noted here that the determining module 62 and the clearing module 64 correspond to the step S202 and the step S204 in the second embodiment, and the two modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure of the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Optionally, the apparatus for uninstalling an application provided in the embodiment of the present application further includes: the system comprises a process creation module and a trigger module.
The process creation module is used for creating a first trigger process and a second trigger process before judging whether the preset file is deleted; and the triggering module is used for triggering the first triggering process and/or the second triggering process according to a preset sequence.
It should be noted here that the process creation module and the trigger module correspond to step S200 and step S201 in the second embodiment, and the two modules are the same as the example and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Further, optionally, the determining module 62 includes: the device comprises a file creating unit, a monitoring unit and a judging unit.
The file creating unit is used for creating a first preset file according to a preset condition under the condition of triggering a first triggering process, wherein the preset condition is used for monitoring whether a deletion event is generated or not; the monitoring unit is used for monitoring whether the first preset file is deleted or not, wherein the deletion of the first preset file is used for indicating that the current process has deletion operation; and the judging unit is used for judging whether the preset file exists or not under the condition that the first preset file is deleted.
It should be noted here that the file creating unit, the monitoring unit, and the determining unit correspond to steps 1 to Step3 in Step S202 in the second embodiment, and the three modules are the same as the corresponding steps in the implementation example and application scenarios, but are not limited to the disclosure in the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Optionally, the apparatus for uninstalling an application provided in the embodiment of the present application further includes: the device comprises a file creating module and a loop detection module.
The file creating module is used for creating a first preset file according to preset conditions under the condition of detecting the existence of a second preset file after judging whether the preset file is deleted or not; and the circulating detection module is used for monitoring whether the created first preset file is deleted or not until the second preset file is detected to be deleted, and triggering and clearing the process data corresponding to the same user identifier in the application program.
It should be noted here that the file creation module and the loop detection module correspond to step S203 and step S205 in the second embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Optionally, the apparatus for uninstalling an application provided in the embodiment of the present application includes: the device comprises a process creating unit, a communication unit and a monitoring unit.
The process creating unit is used for creating a second process according to the first process under the condition of triggering the second triggering process, wherein the second process is a sub-process of the first process; the communication unit is used for establishing pipeline communication between the first process and the second process; and the monitoring unit is used for monitoring whether the state of the pipeline communication is changed from a first state to a second state, wherein the first state is a blocking state, and the second state is a reading state.
It should be noted here that the process creating unit, the communication unit and the monitoring unit correspond to Step1 to Step3 in the second embodiment, and the three modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure in the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Further, optionally, the determining module 62 includes: the device comprises a process deleting unit, a first detecting unit and a second detecting unit.
The process deleting unit is used for deleting the first process or the second process when the state of the pipeline communication is monitored to be changed from the first state to the second state; the first detection unit is used for detecting whether the second preset file is deleted through the second process under the condition that the first process is deleted; and the second detection unit is used for detecting whether the second preset file is deleted through the first process under the condition that the second process is deleted.
It should be noted here that the process creating unit, the communication unit, and the first monitoring unit correspond to steps 1 to Step3 in Step S202 in the second embodiment, and the three modules are the same as the corresponding steps in the implementation example and application scenarios, but are not limited to the disclosure in the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Optionally, the apparatus for uninstalling an application provided in the embodiment of the present application further includes: and a wake-up unit.
And the awakening unit is used for awakening the first process if the second preset file exists after judging whether the preset file is deleted or not and under the condition of deleting the first process.
It should be noted here that the above wake-up unit corresponds to Step4 in Step S202 in the second embodiment, and the module is the same as the example and application scenario realized by the corresponding Step, but is not limited to the disclosure in the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Optionally, the method for uninstalling an application provided in the embodiment of the present application further includes: the communication control unit, the communication establishment unit and the circulation detection unit.
The communication control unit is used for closing the pipeline communication if a second preset file exists under the condition that a second process is deleted after whether the preset file is deleted is judged; the communication establishing unit is used for establishing a second process according to the first process and establishing pipeline communication between the first process and the second process; and the circulating detection unit is used for monitoring whether the state of the pipeline communication is changed from the first state to the second state or not until the second preset file is detected to be deleted, and triggering and clearing the process data corresponding to the same user identifier.
It should be noted here that the communication control unit, the communication establishment unit, and the loop detection unit correspond to steps 4 'to steps 6' in Step S202 in the second embodiment, and the three modules are the same as the corresponding steps in the implementation example and application scenarios, but are not limited to the disclosure in the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Optionally, the purge module 64 includes: the device comprises a traversing unit, a judging unit, a deleting unit and a clearing unit.
The traversal unit is used for traversing the process directory corresponding to the same user identifier under the preset path; the judging unit is used for judging whether the process directory is a directory corresponding to the application program; the deleting unit is used for deleting the process directory under the condition that the judgment result is yes; and the clearing unit is used for clearing all data in the process directory by deleting the process directory.
It should be noted here that the communication control unit, the communication establishment unit, and the loop detection unit correspond to steps 1 to Step4 in Step S204 in the second embodiment, and the four modules are the same as the corresponding steps in the implementation example and application scenarios, but are not limited to the disclosure in the second embodiment. It should be noted that the modules described above as a part of the apparatus may be run in the mobile terminal provided in the second embodiment, and may be implemented by software or hardware.
Example 4
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the method for uninstalling an application program provided in the first embodiment.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: judging whether a preset file is deleted or not, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation; and if so, clearing the process data corresponding to the same user identifier in the application program.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: creating a first trigger process and a second trigger process; and triggering the first triggering process and/or the second triggering process according to the preset sequence, and monitoring whether the first preset file is deleted.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: creating a first trigger process and a second trigger process; and triggering the first triggering process and/or the second triggering process according to a preset sequence.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: under the condition of triggering a first trigger process, creating a first preset file according to a preset condition, wherein the preset condition is used for monitoring whether a deletion event is generated or not; monitoring whether a first preset file is deleted or not, wherein the deletion of the first preset file is used for indicating that the current process has deletion operation; and under the condition that the first preset file is deleted, judging whether the preset file exists or not.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: under the condition that a preset file exists, a first preset file is created according to preset conditions; monitoring whether the created first preset file is deleted or not until the deletion of the preset file is detected, and triggering and clearing process data corresponding to the same user identifier in the application program.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: under the condition of triggering a second triggering process, creating a second process according to the first process, wherein the second process is a sub-process of the first process; establishing pipeline communication between a first process and a second process; and whether the state of monitoring the pipeline communication is changed from a first state to a second state, wherein the first state is a blocking state, and the second state is a reading state.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: deleting the first process or the second process under the condition that the state of the pipeline communication is monitored to be changed from the first state to the second state; under the condition of deleting the first process, detecting whether the preset file is deleted or not through a second process; and under the condition of deleting the second process, detecting whether the preset file is deleted or not through the first process.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and under the condition of deleting the first process, if the preset file exists, awakening the first process.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: under the condition of deleting the second process, if the preset file exists, closing the pipeline communication; establishing a second process according to the first process, and establishing pipeline communication between the first process and the second process; monitoring whether the state of the pipeline communication is changed from the first state to the second state or not until the deletion of the preset file is detected, and triggering and clearing the process data corresponding to the same user identification.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: traversing a process directory corresponding to the same user identifier under a preset path; judging whether the process directory is a directory corresponding to the application program; deleting the process directory under the condition that the judgment result is yes; and removing all data in the process directory by deleting the process directory.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (9)
1. A mobile terminal, comprising: a data processor and a communication bus, wherein,
the data processor is used for monitoring whether a preset file is deleted through the communication bus and triggering and clearing process data corresponding to the same user identifier in an application program under the condition of monitoring that the preset file is deleted;
deleting the preset file to indicate that the operation of deleting the application program is an uninstalling operation;
before judging whether the preset file is deleted or not, establishing a first trigger process and a second trigger process; triggering the first triggering process and/or the second triggering process according to a preset sequence;
under the condition of triggering the second triggering process, creating a second process according to a first process, wherein the second process is a sub-process of the first process; establishing pipe communication between the first process and the second process; and whether the state of monitoring the pipeline communication is changed from a first state to a second state, wherein the first state is a blocking state, and the second state is a reading state.
2. A method of uninstalling an application, comprising:
judging whether a preset file is deleted or not, wherein the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation;
if the judgment result is yes, clearing the process data corresponding to the same user identifier in the application program;
before the determining whether the preset file is deleted, the method further includes: creating a first trigger process and a second trigger process; triggering the first triggering process and/or the second triggering process according to a preset sequence;
under the condition of triggering the second triggering process, creating a second process according to a first process, wherein the second process is a sub-process of the first process; establishing pipe communication between the first process and the second process; and whether the state of monitoring the pipeline communication is changed from a first state to a second state, wherein the first state is a blocking state, and the second state is a reading state.
3. The method of claim 2, wherein the determining whether the preset file is deleted comprises:
under the condition of triggering the first triggering process, creating a first preset file according to a preset condition, wherein the preset condition is used for monitoring whether a deletion event is generated or not;
monitoring whether the first preset file is deleted or not, wherein the deletion of the first preset file is used for indicating that the current process has deletion operation;
and under the condition that the first preset file is deleted, judging whether the preset file exists or not.
4. The method of claim 3, wherein after determining whether the preset file is deleted, the method further comprises:
under the condition that the preset file exists, creating the first preset file according to the preset condition;
monitoring whether the first preset file after being created is deleted or not until the preset file is detected to be deleted, and triggering and clearing process data corresponding to the same user identification in the application program.
5. The method of claim 2, wherein the determining whether the preset file is deleted comprises:
deleting the first process or the second process when the state of the pipeline communication is monitored to be changed from a first state to a second state;
under the condition that the first process is deleted, whether the preset file is deleted or not is detected through the second process;
and under the condition of deleting the second process, detecting whether the preset file is deleted or not through the first process.
6. The method according to claim 5, wherein after determining whether the preset file is deleted, the method further comprises:
and under the condition of deleting the first process, if the preset file exists, awakening the first process.
7. The method according to claim 5, wherein after determining whether the preset file is deleted, the method further comprises:
under the condition that the second process is deleted, if the preset file exists, closing the pipeline communication;
creating a second process according to the first process, and establishing pipeline communication between the first process and the second process;
monitoring whether the state of the pipeline communication is changed from the first state to the second state or not until the preset file deletion is detected, and triggering and clearing the process data corresponding to the same user identification.
8. The method according to any one of claims 2 to 7, wherein the clearing process data corresponding to the same user identifier in the application program comprises:
traversing a process directory corresponding to the same user identifier under a preset path;
judging whether the process directory is a directory corresponding to an application program;
deleting the process directory under the condition that the judgment result is yes;
and removing all data under the process directory by deleting the process directory.
9. An apparatus for uninstalling an application, comprising:
the device comprises a judging module, a judging module and a judging module, wherein the judging module is used for judging whether a preset file is deleted, and the deletion of the preset file is used for indicating that the operation of deleting the application program is an unloading operation;
the clearing module is used for clearing the process data corresponding to the same user identifier in the application program under the condition that the judgment result is yes;
before judging whether the preset file is deleted or not, establishing a first trigger process and a second trigger process; triggering the first triggering process and/or the second triggering process according to a preset sequence;
under the condition of triggering the second triggering process, creating a second process according to a first process, wherein the second process is a sub-process of the first process; establishing pipe communication between the first process and the second process; and whether the state of monitoring the pipeline communication is changed from a first state to a second state, wherein the first state is a blocking state, and the second state is a reading state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610659716.1A CN107729022B (en) | 2016-08-11 | 2016-08-11 | Method and device for unloading application program and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610659716.1A CN107729022B (en) | 2016-08-11 | 2016-08-11 | Method and device for unloading application program and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107729022A CN107729022A (en) | 2018-02-23 |
CN107729022B true CN107729022B (en) | 2021-06-08 |
Family
ID=61200684
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610659716.1A Active CN107729022B (en) | 2016-08-11 | 2016-08-11 | Method and device for unloading application program and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107729022B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114780292A (en) * | 2022-04-19 | 2022-07-22 | 北京凝思软件股份有限公司 | Linux-based user identifier uniqueness realization method, device, equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591680A (en) * | 2011-12-19 | 2012-07-18 | 深圳桑菲消费通信有限公司 | Method for automatically deleting and unloading software related files |
CN103761178A (en) * | 2014-01-17 | 2014-04-30 | 北京奇虎科技有限公司 | Method for realizing application uninstalling surveys |
CN104102516A (en) * | 2014-07-21 | 2014-10-15 | 北京金山安全软件有限公司 | Application program unloading method and device |
CN105159710A (en) * | 2012-03-31 | 2015-12-16 | 北京奇虎科技有限公司 | Software uninstalling method and apparatus |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102109111B1 (en) * | 2013-02-21 | 2020-05-11 | 삼성전자주식회사 | Method for inputting for character in flexible display an electronic device thereof |
-
2016
- 2016-08-11 CN CN201610659716.1A patent/CN107729022B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591680A (en) * | 2011-12-19 | 2012-07-18 | 深圳桑菲消费通信有限公司 | Method for automatically deleting and unloading software related files |
CN105159710A (en) * | 2012-03-31 | 2015-12-16 | 北京奇虎科技有限公司 | Software uninstalling method and apparatus |
CN103761178A (en) * | 2014-01-17 | 2014-04-30 | 北京奇虎科技有限公司 | Method for realizing application uninstalling surveys |
CN104102516A (en) * | 2014-07-21 | 2014-10-15 | 北京金山安全软件有限公司 | Application program unloading method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107729022A (en) | 2018-02-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106997314B (en) | Exception handling method, device and system for distributed system | |
TWI628588B (en) | System, method and terminal for cleaning memory | |
CN109086079B (en) | Mounting management method and device for storage equipment | |
CN102799499B (en) | Method and vehicle-mounted Android equipment that vehicle-mounted Android device systems recovers | |
CN103927239A (en) | Method and device for restoring system of terminal equipment | |
CN103902437A (en) | Detecting method and server | |
CN107943501A (en) | Embedded device upgrade method, device, computer equipment and storage medium | |
CN105302711A (en) | Application repairing method and apparatus and terminal | |
CN108897646B (en) | Switching method of BIOS (basic input output System) chips and substrate management controller | |
CN112100027A (en) | Server maintenance method, device, equipment and machine readable storage medium | |
CN111258850A (en) | Method and device for updating software information based on Linux system | |
CN102722669B (en) | Completeness verification method of operating system | |
CN115794472A (en) | Chip error collection and processing method, device and storage medium | |
CN103984585A (en) | Method for upgrading Linux kernel in running process of kernel module capable of being plugged in thermal mode | |
CN107729022B (en) | Method and device for unloading application program and mobile terminal | |
CN114675998A (en) | Method, device, equipment and medium for monitoring timed snapshot task | |
CN107203417B (en) | Data cleaning method, related device and electronic equipment | |
CN108256311B (en) | Authorization authentication method and device and electronic equipment | |
CN105224416B (en) | Restorative procedure and related electronic device | |
CN109271270A (en) | The troubleshooting methodology, system and relevant apparatus of bottom hardware in storage system | |
CN111371642B (en) | Network card fault detection method, device, equipment and storage medium | |
CN110968456B (en) | Method and device for processing fault disk in distributed storage system | |
CN111130856A (en) | Server configuration method, system, equipment and computer readable storage medium | |
CN112925675B (en) | Recovery method and device for applet | |
CN106528248B (en) | Downloading method and system of mobile terminal based on software integrity |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |