CN108762771B - Plug-in unloading method and electronic terminal - Google Patents

Plug-in unloading method and electronic terminal Download PDF

Info

Publication number
CN108762771B
CN108762771B CN201810350271.8A CN201810350271A CN108762771B CN 108762771 B CN108762771 B CN 108762771B CN 201810350271 A CN201810350271 A CN 201810350271A CN 108762771 B CN108762771 B CN 108762771B
Authority
CN
China
Prior art keywords
plug
field information
deleting
module
electronic terminal
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
Application number
CN201810350271.8A
Other languages
Chinese (zh)
Other versions
CN108762771A (en
Inventor
刘存栋
刘志伟
卜云涛
董涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810350271.8A priority Critical patent/CN108762771B/en
Publication of CN108762771A publication Critical patent/CN108762771A/en
Application granted granted Critical
Publication of CN108762771B publication Critical patent/CN108762771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a plug-in unloading method and an electronic terminal, wherein the current state of a plug-in is inquired based on an unloading request of a user for unloading the plug-in an application program; and if the current state of the plug-in is the running state, adding uninstalling field information in the plug-in. The unloading field information is used for indicating that the plug-in is in the state of waiting to be unloaded, so that if the unloading field information is read, the plug-in needs to be unloaded. The plug-in unit is initialized at the next starting, namely all data of the plug-in unit is read for loading. Therefore, in the process of starting the plug-in next time, when the uninstalling field information is read, the plug-in and the related files thereof are deleted based on the uninstalling field information. Therefore, the plug-in can be unloaded when the plug-in is started next time due to the addition of the unloading field information, the implementation of the method does not influence the current use of the plug-in, the problem that the plug-in can be unloaded only when the plug-in needs to be closed is avoided, and the plug-in can be conveniently unloaded.

Description

Plug-in unloading method and electronic terminal
Technical Field
The invention relates to the technical field of communication, in particular to a plug-in unloading method and an electronic terminal.
Background
Plug-ins (also known as addins, add-ins, addons, or add-ons, and also add-ins) are programs written in accordance with a standard application program interface. The plug-in refers to a program which can be automatically executed along with the start of the IE browser, can only run under a system platform specified by the program, can simultaneously support a plurality of platforms, and cannot run independently from the specified platform. That is, the plug-in must be attached to the launch of the application to be able to run. There are numerous types of plug-ins, for example, some plug-ins can help users to browse the internet or invoke web-assisted functions more conveniently, some plug-ins can help users to pay online, and so on. For example, after installing the relevant plug-in, the browser can directly call the plug-in for processing a particular type of file.
In view of the specificity of the plug-in, each module in the Replugin plug-in framework exists and runs in the form of a plug-in, and if a certain plug-in module in the Replugin plug-in framework needs to be removed, the plug-in needs to be unloaded.
At present, the unloading of the plug-in is generally carried out under the condition that the plug-in does not work, and the unloading in the normal working process of the plug-in can prompt a user whether to close the plug-in or not for unloading, so that the use of the currently running plug-in is influenced, and the problem that the unloading of the currently running plug-in is difficult occurs.
Disclosure of Invention
In view of the above, the present invention is proposed to provide a plug-in uninstalling method and an electronic terminal that overcome or at least partially solve the above problems.
In one aspect of the present invention, a method for uninstalling a plug-in is provided, the method including:
based on an uninstalling request of a user for uninstalling a plug-in an application program, inquiring the current state of the plug-in;
if the current state of the plug-in is the running state, adding unloading field information in the plug-in, wherein the unloading field information is used for identifying that the plug-in is in a state to be unloaded;
and deleting the plug-in and the related files thereof based on the uninstalling field information in the process of starting the plug-in next time.
Preferably, the querying a current state of the plug-in specifically includes:
calling the ispluginning interface to inquire the current state of the plug-in.
Preferably, before the querying the current state of the plug-in, the method further includes:
obtaining the plug-in name of the plug-in;
obtaining plug-in information based on the plug-in name of the plug-in;
judging whether the plug-in information is empty or not;
if yes, indicating that the plug-in is not installed;
If not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
Preferably, after the querying the current state of the plug-in, the method further comprises:
and if the current state of the plug-in is the non-running state, deleting the plug-in and the related files thereof.
Preferably, the adding of an uninstall field information in the plug-in specifically includes:
the uninstall field information delinfo is added to the p.l file of the application in the Json format.
Preferably, in the process of next starting of the plugin, deleting the plugin and the related files thereof based on the uninstall field information specifically includes:
loading a related file of the plug-in the next starting process of the plug-in;
judging whether the unloading field information exists in the related file of the plug-in;
if the uninstalled field information exists, deleting the plug-in and the related files thereof based on the uninstalled field information;
and if the unloading field information does not exist, loading and starting the plug-in based on the related file of the plug-in.
Preferably, the deleting the plug-in and the related file thereof based on the uninstall field information specifically includes:
And deleting the configuration file corresponding to the system version in the plug-in based on the system version number of the plug-in.
Preferably, after deleting the configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located, the method further includes: and deleting the Native file.
Preferably, after the plug-in and its related files are deleted based on the uninstall field information, the method further includes:
recording the uninstalling field information;
and deleting the uninstalling field information.
Preferably, after the plug-in and its related files are deleted based on the uninstall field information, the method further includes:
and sending a broadcast notice to each process, and synchronizing the latest state of the plug-in to each process.
Preferably, after the plug-in and its related files are deleted based on the uninstall field information, the method further includes:
and updating the memory table information of the process of the plug-in.
In another aspect of the present invention, an electronic terminal is disclosed, which includes:
the query module is used for querying the current state of the plug-in based on an uninstalling request of the plug-in of an uninstalling application program of a user;
The adding module is used for adding uninstalling field information into the plug-in if the current state of the plug-in is the running state, wherein the uninstalling field information is used for identifying that the plug-in is in a state to be uninstalled;
and the uninstalling module is used for deleting the plug-in and the related files thereof based on the uninstalling field information in the next starting process of the plug-in.
Preferably, the querying a current state of the plug-in specifically includes:
calling the ispluginning interface to inquire the current state of the plug-in.
Preferably, the electronic terminal further includes:
the first obtaining module is used for obtaining the plug-in name of the plug-in;
the second obtaining module is used for obtaining the plug-in information based on the plug-in name of the plug-in;
the first judgment module is used for judging whether the plug-in information is empty or not; if yes, the plug-in is not installed; if not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
Preferably, the electronic terminal further includes:
and the deleting module is used for deleting the plug-in and the related files thereof if the current state of the plug-in is inquired to be the non-running state.
Preferably, the adding module is specifically configured to add the uninstall field information delinfo to the p.l file of the application program in a Json format.
Preferably, the unloading module specifically includes:
the first loading module is used for loading the relevant file of the plug-in the next starting process of the plug-in;
the second judgment module is used for judging whether the unloading field information exists in the related file of the plug-in;
the first deleting module is used for deleting the plug-in and the related files thereof based on the uninstalled field information if the uninstalled field information exists;
and the second loading module is used for loading and starting the plug-in based on the relevant file of the plug-in if the unloading field information does not exist.
Preferably, the uninstalling module is specifically configured to delete the configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located.
Preferably, the uninstalling module is further configured to delete a Native file.
Preferably, the electronic terminal further includes:
the recording module is used for recording the uninstalling field information;
and the second deleting module is used for deleting the uninstalling field information.
Preferably, the electronic terminal further includes: and the synchronization module is used for sending broadcast notification to each process and synchronizing the latest state of the plug-in to each process.
Preferably, the electronic terminal further includes: and the updating module is used for updating the memory table information of the process where the plug-in is located.
In another aspect of the invention, a computer program is stored thereon, which when executed by a processor, performs the steps of the above-described method.
In another aspect of the invention, a computer device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the program.
The technical scheme provided in the embodiment of the application has at least the following technical effects or advantages:
the invention discloses a plug-in unloading method and an electronic terminal, wherein the current state of a plug-in is inquired based on an unloading request of a user for unloading the plug-in an application program; and if the current state of the plug-in is the running state, adding uninstalling field information in the plug-in. The unloading field information is used for indicating that the plug-in is in a state to be unloaded, so that if the unloading field information is read, the plug-in needs to be unloaded. Since the plug-in will initialize at the next start-up, i.e. read all its own data for loading. Therefore, in the process of starting the plugin next time, when the uninstall field information is read, the plugin and the relevant files thereof are deleted based on the uninstall field information. Therefore, the plug-in can be unloaded when the plug-in is started next time due to the addition of the unloading field information, the implementation of the method does not influence the current use of the plug-in, the problem that the plug-in can be unloaded only when the plug-in needs to be closed is avoided, and the plug-in can be conveniently unloaded.
Further, the existing plug-in unloading mode actually adopts a mode of 'forbidden' plug-in function to unload, so that a large number of 'forbidden' plug-ins encroach on the system memory, the system operation speed is easily slowed down, and the phenomenon of blocking occurs. The invention directly adopts the mode of deleting the plug-in and the related files thereof, and can delete all the related information of the plug-in, thereby occupying less memory and not influencing the operation of the system.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a method of plug-in uninstallation according to an embodiment of the present invention;
fig. 2 shows a schematic view of an electronic terminal according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a plug-in unloading method, which is used for solving the problem that the current running plug-in the prior art is not easy to unload.
Referring to fig. 1, a process diagram of the method for unloading the plug-in the embodiment of the present invention is shown.
Step 11, inquiring the current state of the plug-in based on the uninstalling request of the plug-in of the uninstalling application program of the user.
In the embodiment of the invention, all the functional modules in the related application program exist in a Replugin plug-in framework. Therefore, if a certain function in the application program is removed, the corresponding plug-in is unloaded. Each plug-in has its own current state, which includes: an active state or an inactive state, etc.
Before inquiring the current state of the plug-in, based on the uninstalling request of the user for uninstalling the plug-in an application program, the plug-in name of the plug-in is obtained first, and the plug-in name cannot be null. Plug-in information is then obtained based on the plug-in name of the plug-in. Judging whether the plug-in information is empty or not; if yes, the plug-in is not installed, and the plug-in is directly returned without processing. If not, the plug-in information represents the plug-in which is installed but the current operation state is unknown.
In a specific implementation process, a dual-process architecture is adopted by default for the Replugin framework. The dual-process architecture is that two processes are simultaneously operated, when the resident process is interrupted unexpectedly, the standby process can be started to ensure the normal operation of the plug-in, the operation interruption caused by the accidental interruption of the resident process can be avoided, and vice versa.
The uninstalling operation of the plug-in of the embodiment of the invention can be completely placed in the resident process, and is specifically completed by a plug-in manager (PluginManagerServer class). While the unloading of installed cards is roughly divided into two situations: a plug-in running state and a plug-in not running state.
And in the process of inquiring the current state of the plug-in, the current state of the plug-in can be inquired by calling the ispluginning interface.
And step 12, if the current state of the plug-in is the running state, adding uninstalling field information in the plug-in, wherein the uninstalling field information is used for identifying that the plug-in is in a state to be uninstalled.
In a specific implementation process, in a case where a plug-in is installed and running, in this case, since the plug-in is being used (possibly by a user or other plug-ins), an uninstall operation cannot be immediately performed, an uninstall field information is added to the plug-in to identify that the plug-in is in an uninstalled state, so that the plug-in is uninstalled when being started next time.
Further, by calling the setPendingDelete interface, an object of the plugin information to be uninstalled (i.e. uninstall field information) is maintained inside the plugin information object (plugin info), and the uninstall field information delinfo is added as a key value to the p.l file under the application program's own directory in Json format, the state of the plugin to be uninstalled is recorded, and the uninstalling operation of the plugin is performed again until the resident process is restarted.
As an alternative embodiment, if the current state of the plugin is found to be the non-running state, the plugin and the related files thereof are deleted. In the specific implementation process, the processing procedure of the plug-in the non-running state is actually similar to the processing procedure of the plug-in when the plug-in is added to the uninstalling field information and is started next time, and the specific deletion procedure of the plug-in when the plug-in is started next time is specifically described below, so that the deletion procedure of the plug-in when the plug-in is not run is not described again in the present invention.
And step 13, deleting the plug-in and the related files thereof based on the uninstalling field information in the process of starting the plug-in next time.
In the specific implementation process of deleting the plug-in and the related files thereof based on the unloading field information, loading the related files of the plug-in the next starting process of the plug-in; judging whether the unloading field information exists in the related file of the plug-in; if the uninstalled field information exists, deleting the plug-in and the related files thereof based on the uninstalled field information; and if the unloading field information does not exist, loading and starting the plug-in based on the related file of the plug-in.
Specifically, since the initialization operation of the plug-in is performed each time the resident process performs the restart operation, which involves the management logic of the plug-in, p.l file mentioned in the above step records not only the uninstall field information but also the plug-in information generated at the time of installation of the plug-in. Therefore, each plug-in is read and managed according to the plug-in information in the p.l file, and the management meaning comprises plug-in version upgrade, plug-in uninstall and the like. Therefore, if the current plug-in includes the uninstalling field information delinfo, the uninstalling field information delinfo is obtained by calling a getpingdelete interface, and because the uninstalling condition of the plug-in is superior to the upgrading condition of the plug-in, whether the plug-in needs to be uninstalled or not is judged first, and if the plug-in needs to be uninstalled, the plug-in and the related files thereof are directly deleted without updating.
Of course, if the plug-in is in the non-running state, the plug-in and its related files are directly deleted.
The deletion process of the plug-in is described in detail below.
In a specific deleting process, based on the system version number of the plug-in, deleting the configuration file corresponding to the system version in the plug-in. For example, the APK file of the plug-in and the odex file released after the plug-in is installed are deleted in sequence. When the related file of the plug-in is deleted, the corresponding system version number is inquired, and then the corresponding configuration file is deleted based on the system version number.
In a specific implementation process, judging whether a system version of the plug-in is higher than a first preset level version;
if the system version of the plug-in is higher than the first preset level version, deleting the configuration file corresponding to the system version in the plug-in;
if the system version of the plug-in is lower than the first preset level version, further judging whether the system version of the plug-in is lower than a second preset level version, and if so, deleting the configuration file corresponding to the system version in the plug-in.
For example, in the case of the Android 8.0 and above systems, vdex files and x, jar, prof files released after the plug-in is installed are also deleted.
If the directory is in the Android 4.0 system and below, the directory where the dex is released after optimization is required to be deleted, and if a so library exists, a Native file is deleted. In addition, the process lock file corresponding to the plug-in needs to be deleted, and the process lock file is created when the plug-in is installed. So far, both the files released and generated at the time of plug-in installation have been deleted.
Further, after the plug-in and the related file thereof are deleted based on the uninstalling field information, the uninstalling field information is recorded; and deleting the uninstalling field information. For example, the delinfo field in the p.l file is deleted and saved.
Further, since the state of the plug-in has changed, it is necessary to notify the latest state of the plug-in to each process in time. That is, after the plug-in and its related files are deleted based on the uninstall field information, a broadcast notification is sent to each process, and the latest state of the plug-in is synchronized to each process to notify that the plug-in has been uninstalled and removed.
In a specific implementation process, after the plug-in and the related file thereof are deleted based on the uninstall field information, the memory table information of the process where the plug-in is located is also updated. For example, the resident process's memory table information (the resident process maintains a buffer table of various information of all plug-ins, including buffer objects such as plug-in information, PackageInfo, Resources, ComponentList, and dexcallassloader) is updated: removing the buffer data of the unloaded plug-in the HashMap storing all the plug-in information, removing the snapshot of the plug-in table, removing the PackageInfo, Resources, ComponentList and DexClassLoader buffer object data of the unloaded plug-in the memory.
The following embodiments describe an electronic terminal based on a unified inventive concept.
Referring to fig. 2, the electronic terminal includes:
the query module 21 is configured to query a current state of a plug-in based on an uninstalling request of the user for uninstalling the plug-in an application;
the adding module 22 is configured to add uninstall field information to the plugin if the current state of the plugin is the running state, where the uninstall field information is used to identify that the plugin is in the state to be uninstalled;
and the uninstalling module 23 is configured to delete the plugin and the related files thereof based on the uninstalling field information in a process of starting the plugin next time.
As an optional embodiment, the querying a current state of the plug-in specifically includes:
calling the ispluginning interface to inquire the current state of the plug-in.
As an optional embodiment, the electronic terminal further includes:
the first obtaining module is used for obtaining the plug-in name of the plug-in;
the second obtaining module is used for obtaining the plug-in information based on the plug-in name of the plug-in;
the first judgment module is used for judging whether the plug-in information is empty or not; if yes, indicating that the plug-in is not installed; if not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
As an optional embodiment, the electronic terminal further includes:
and the deleting module is used for deleting the plug-in and the related files thereof if the current state of the plug-in is inquired to be the non-running state.
As an optional embodiment, the adding module 22 is specifically configured to add the uninstall field information delinfo to the p.l file of the application program in a Json format.
As an optional embodiment, the unloading module 23 specifically includes:
the first loading module is used for loading the relevant files of the plug-in the next starting process of the plug-in;
the second judgment module is used for judging whether the unloading field information exists in the related file of the plug-in;
the first deleting module is used for deleting the plug-in and the related files thereof based on the uninstalled field information if the uninstalled field information exists;
and the second loading module is used for loading and starting the plug-in based on the relevant file of the plug-in if the unloading field information does not exist.
As an optional embodiment, the uninstalling module 23 is specifically configured to delete the configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located.
As an alternative embodiment, the uninstalling module 23 is further configured to delete a Native file.
As an optional embodiment, the electronic terminal further includes:
the recording module is used for recording the uninstalling field information;
and the second deleting module is used for deleting the uninstalling field information.
As an optional embodiment, the electronic terminal further includes: and the synchronization module is used for sending broadcast notification to each process and synchronizing the latest state of the plug-in to each process.
As an optional embodiment, the electronic terminal further includes:
and the updating module is used for updating the memory table information of the process where the plug-in is located.
Based on the same inventive concept as in the previous embodiments, the present invention also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any of the methods described above.
Based on the same inventive concept as in the previous embodiments, the present invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the methods described above when executing the program.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
the invention discloses a plug-in unloading method and an electronic terminal, wherein the current state of a plug-in is inquired based on an unloading request of a user for unloading the plug-in an application program; and if the current state of the plug-in is the running state, adding uninstalling field information in the plug-in. The unloading field information is used for indicating that the plug-in is in a state to be unloaded, so that if the unloading field information is read, the plug-in needs to be unloaded. Since the plug-in will initialize at the next boot, i.e. read all its own data for loading. Therefore, in the process of starting the plugin next time, when the uninstall field information is read, the plugin and the relevant files thereof are deleted based on the uninstall field information. Therefore, the plug-in can be unloaded when the plug-in is started next time due to the addition of the unloading field information, the implementation of the method does not influence the current use of the plug-in, the problem that the plug-in can be unloaded only when the plug-in needs to be closed is avoided, and the plug-in can be conveniently unloaded.
Further, the existing plug-in unloading mode is actually unloading in a mode of 'forbidden' plug-in function, so that a large number of 'forbidden' plug-ins encroach on the memory of the system, the running speed of the system is easily slowed, and the phenomenon of blocking occurs. The invention directly adopts the mode of deleting the plug-in and the related files thereof, and can delete all the related information of the plug-in, so that the memory occupation is less, and the system operation is not influenced.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses an A1 plug-in unloading method, which is characterized by comprising the following steps:
based on an uninstalling request of a user for uninstalling a plug-in an application program, inquiring the current state of the plug-in;
if the current state of the plug-in is the running state, adding unloading field information in the plug-in, wherein the unloading field information is used for identifying that the plug-in is in a state to be unloaded;
And deleting the plug-in and the related files thereof based on the uninstalling field information in the next starting process of the plug-in.
A2, the method as claimed in a1, wherein the querying the current state of the plug-in specifically includes:
and calling an ispluginning interface to inquire the current state of the plug-in.
A3, the method as in A1, wherein before the querying the current state of the plug-in, the method further comprises:
obtaining the plug-in name of the plug-in;
obtaining plug-in information based on the plug-in name of the plug-in;
judging whether the plug-in information is empty or not;
if yes, indicating that the plug-in is not installed;
if not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
A4, the method as in A1, wherein after the querying the current state of the plug-in, the method further comprises:
and if the current state of the plug-in is the non-running state, deleting the plug-in and the related files thereof.
A5, the method as in a1, wherein the adding an uninstall field information in the plugin specifically includes:
the uninstall field information delinfo is added to the p.l file of the application in Json format.
A6, the method as recited in a1, wherein the deleting the plug-in and its related files based on the uninstall field information during the next startup of the plug-in includes:
loading the relevant file of the plug-in the next starting process of the plug-in;
judging whether the unloading field information exists in the related file of the plug-in;
if the uninstalling field information exists, deleting the plug-in and the related files thereof based on the uninstalling field information;
and if the uninstalling field information does not exist, loading and starting the plug-in based on the related file of the plug-in.
A7, the method as in a1, wherein the deleting the plug-in and its related files based on the uninstall field information specifically includes:
and deleting the configuration file corresponding to the system version in the plug-in based on the system version number of the plug-in.
A8, the method as recited in a7, wherein after deleting the configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located, the method further comprises: and deleting the Native file.
A9, the method as in A1, wherein after deleting the plug-in and its related files based on the uninstall field information, the method further comprises:
Recording the uninstalling field information;
and deleting the uninstalling field information.
A10, the method as in A1, wherein after deleting the plug-in and its related files based on the uninstall field information, the method further comprises:
and sending a broadcast notice to each process, and synchronizing the latest state of the plug-in to each process.
A11, the method as in A1, wherein after deleting the plug-in and its related files based on the uninstall field information, the method further comprises:
and updating the memory table information of the process of the plug-in.
B12, an electronic terminal, comprising:
the query module is used for querying the current state of the plug-in based on an uninstalling request of the plug-in of an uninstalling application program of a user;
the adding module is used for adding unloading field information into the plug-in if the current state of the plug-in is the running state, wherein the unloading field information is used for identifying that the plug-in is in a state to be unloaded;
and the unloading module is used for deleting the plug-in and the related files thereof based on the unloading field information in the process of starting the plug-in next time.
B13, the electronic terminal of B12, wherein the querying the current status of the plugin specifically includes:
and calling an ispluginning interface to inquire the current state of the plug-in.
B14, the electronic terminal according to B12, characterized in that the electronic terminal further comprises:
the first obtaining module is used for obtaining the plug-in name of the plug-in;
the second obtaining module is used for obtaining the plug-in information based on the plug-in name of the plug-in;
the first judgment module is used for judging whether the plug-in information is empty or not; if yes, the plug-in is not installed; if not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
B15, the electronic terminal according to B12, characterized in that the electronic terminal further comprises:
and the deleting module is used for deleting the plug-in and the related files thereof if the current state of the plug-in is inquired to be the non-running state.
B16, the electronic terminal according to B12, wherein the adding module is specifically configured to add the uninstall field information delinfo to the p.l file of the application program in a Json format.
B17, the electronic terminal as claimed in B12, wherein the uninstall module specifically includes:
The first loading module is used for loading the relevant file of the plug-in the next starting process of the plug-in;
the second judgment module is used for judging whether the unloading field information exists in the related file of the plug-in;
the first deleting module is used for deleting the plug-in and the related files thereof based on the uninstalled field information if the uninstalled field information exists;
and the second loading module is used for loading and starting the plug-in based on the relevant file of the plug-in if the unloading field information does not exist.
The electronic terminal of B18, as stated in B12, is characterized in that the uninstall module is specifically configured to delete the configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located.
B19, the electronic terminal according to B18, wherein the uninstall module is further configured to delete a Native file.
B20, the electronic terminal according to B12, characterized in that the electronic terminal further comprises:
the recording module is used for recording the uninstalling field information;
and the second deleting module is used for deleting the uninstalling field information.
B21, the electronic terminal according to B12, characterized in that the electronic terminal further comprises: and the synchronization module is used for sending broadcast notification to each process and synchronizing the latest state of the plug-in to each process.
B22, the electronic terminal according to B12, characterized in that the electronic terminal further comprises:
and the updating module is used for updating the memory table information of the process where the plug-in is located.
C23, a computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, carries out the steps of the method according to any one of claims a1-a 12.
D24, a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims a1-a12 are implemented when the program is executed by the processor.

Claims (24)

1. A method of plug-in offload, the method comprising:
based on an uninstalling request of a user for uninstalling a plug-in an application program, inquiring the current state of the plug-in;
if the current state of the plug-in is the running state, adding unloading field information in the plug-in, wherein the unloading field information is used for identifying that the plug-in is in a state to be unloaded;
and deleting the plug-in and the related files thereof based on the uninstalling field information in the process of starting the plug-in next time.
2. The method of claim 1, wherein the querying the current state of the plug-in specifically comprises:
calling the ispluginning interface to inquire the current state of the plug-in.
3. The method of claim 1, wherein prior to said querying a current state of the plug-in, the method further comprises:
obtaining the plug-in name of the plug-in;
obtaining plug-in information based on the plug-in name of the plug-in;
judging whether the plug-in information is empty or not;
if yes, indicating that the plug-in is not installed;
if not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
4. The method of claim 1, wherein after said querying the current state of the plug-in, the method further comprises:
and if the current state of the plug-in is the non-running state, deleting the plug-in and the related files thereof.
5. The method of claim 1, wherein adding an offload field information in the plug-in specifically comprises:
the uninstall field information delinfo is added to the p.l file of the application in the Json format.
6. The method according to claim 1, wherein deleting the plug-in and its related files based on the uninstall field information in a process of next startup of the plug-in specifically includes:
Loading a related file of the plug-in the next starting process of the plug-in;
judging whether the unloading field information exists in the related file of the plug-in;
if the uninstalled field information exists, deleting the plug-in and the related files thereof based on the uninstalled field information;
and if the unloading field information does not exist, loading and starting the plug-in based on the related file of the plug-in.
7. The method according to claim 1, wherein the deleting the plug-in and its related files based on the uninstall field information specifically includes:
and deleting the configuration file corresponding to the system version in the plug-in based on the system version number of the plug-in.
8. The method of claim 7, wherein after deleting the configuration file corresponding to the system version in the plug-in based on the system version number in which the plug-in is located, the method further comprises: and deleting the Native file.
9. The method of claim 1, wherein after deleting the plug-in and its associated files based on the uninstall field information, the method further comprises:
recording the uninstalling field information;
And deleting the uninstalling field information.
10. The method of claim 1, wherein after deleting the plug-in and its associated files based on the uninstall field information, the method further comprises:
and sending a broadcast notice to each process, and synchronizing the latest state of the plug-in to each process.
11. The method of claim 1, wherein after the removing the plug-in and its associated files based on the uninstall field information, the method further comprises:
and updating the memory table information of the process of the plug-in.
12. An electronic terminal, comprising:
the query module is used for querying the current state of the plug-in based on an uninstalling request of the plug-in an uninstalling application program of a user;
the adding module is used for adding unloading field information into the plug-in if the current state of the plug-in is the running state, wherein the unloading field information is used for identifying that the plug-in is in a state to be unloaded;
and the unloading module is used for deleting the plug-in and the related files thereof based on the unloading field information in the process of starting the plug-in next time.
13. The electronic terminal of claim 12, wherein the querying the current state of the plug-in specifically comprises:
And calling an ispluginning interface to inquire the current state of the plug-in.
14. The electronic terminal of claim 12, wherein the electronic terminal further comprises:
the first obtaining module is used for obtaining the plug-in name of the plug-in;
the second obtaining module is used for obtaining the plug-in information based on the plug-in name of the plug-in;
the first judgment module is used for judging whether the plug-in information is empty or not; if yes, indicating that the plug-in is not installed; if not, the plug-in information is the plug-in which is installed but the current operation state is unknown.
15. The electronic terminal of claim 12, wherein the electronic terminal further comprises:
and the deleting module is used for deleting the plug-in and the related files thereof if the current state of the plug-in is inquired to be the non-running state.
16. The electronic terminal according to claim 12, characterized in that said adding module is specifically configured to add said uninstall field information delinfo in Json format to an p.l file of said application.
17. The electronic terminal according to claim 12, wherein the offload module specifically comprises:
the first loading module is used for loading the relevant file of the plug-in the next starting process of the plug-in;
The second judging module is used for judging whether the unloading field information exists in the related file of the plug-in;
the first deleting module is used for deleting the plug-in and the related files thereof based on the uninstalled field information if the uninstalled field information exists;
and the second loading module is used for loading and starting the plug-in based on the relevant file of the plug-in if the unloading field information does not exist.
18. The electronic terminal according to claim 12, wherein the uninstall module is specifically configured to delete the configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located.
19. The electronic terminal of claim 18, wherein the uninstall module is further configured to delete a Native file.
20. The electronic terminal of claim 12, wherein the electronic terminal further comprises:
the recording module is used for recording the uninstalling field information;
and the second deleting module is used for deleting the uninstalling field information.
21. The electronic terminal of claim 12, wherein the electronic terminal further comprises: and the synchronization module is used for sending broadcast notification to each process and synchronizing the latest state of the plug-in to each process.
22. The electronic terminal of claim 12, wherein the electronic terminal further comprises:
and the updating module is used for updating the memory table information of the process where the plug-in is located.
23. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 11.
24. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of claims 1-11 are performed when the program is executed by the processor.
CN201810350271.8A 2018-04-18 2018-04-18 Plug-in unloading method and electronic terminal Active CN108762771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810350271.8A CN108762771B (en) 2018-04-18 2018-04-18 Plug-in unloading method and electronic terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810350271.8A CN108762771B (en) 2018-04-18 2018-04-18 Plug-in unloading method and electronic terminal

Publications (2)

Publication Number Publication Date
CN108762771A CN108762771A (en) 2018-11-06
CN108762771B true CN108762771B (en) 2022-06-10

Family

ID=64011033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810350271.8A Active CN108762771B (en) 2018-04-18 2018-04-18 Plug-in unloading method and electronic terminal

Country Status (1)

Country Link
CN (1) CN108762771B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6151643A (en) * 1996-06-07 2000-11-21 Networks Associates, Inc. Automatic updating of diverse software products on multiple client computer systems by downloading scanning application to client computer and generating software list on client computer
CN103309699B (en) * 2012-03-16 2017-05-17 宇龙计算机通信科技(深圳)有限公司 Mobile terminal and application program installation method
CN105516750B (en) * 2015-12-03 2019-04-30 深圳市茁壮网络股份有限公司 A kind of plug-in unit unloading and deletion and update method based on object label
CN105446785A (en) * 2015-12-31 2016-03-30 深圳市创想天空科技股份有限公司 Method and system for unloading application program
CN105955770A (en) * 2016-04-27 2016-09-21 深圳市金立通信设备有限公司 Application program uninstalling method and terminal

Also Published As

Publication number Publication date
CN108762771A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN102521031B (en) Management method of preset application programs of mobile terminal and mobile terminal
CN107220074B (en) Method and device for accessing and upgrading supporting layer software function
US20230393840A1 (en) File update method and apparatus, device and storage medium
CN105373396A (en) Method and device for updating plug-in in plug-in platform
CN110750286B (en) Management method, device, system, equipment and medium for upgrading Mbn through OTA
CN110225078B (en) Application service updating method, system and terminal equipment
CN109710324B (en) Processing method and device for blue screen display, storage medium and terminal
CN111782339A (en) Container creation method and device, electronic equipment and storage medium
CN108563472B (en) Service plug-in loading method and device based on multi-open application
CN106886422A (en) Method for upgrading software and device, electronic equipment
CN110750280A (en) Application upgrading method and system based on Android platform and storage medium
WO2019144621A1 (en) Method, apparatus, and server for acquiring uefi os startup item
CN112615747A (en) Method and device for automatically deploying and configuring network equipment
US20070028228A1 (en) Software upgrades with user advisement
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN113805965A (en) Method, device and equipment for installing external plug-in and readable medium
CN108762771B (en) Plug-in unloading method and electronic terminal
CN106933604B (en) System upgrading method and device
CN110990033B (en) Remote upgrading method and system
US10809996B2 (en) Method and device for creating images of different installation and download software units
CN104461612A (en) Data processing method and device
CN107783837B (en) Method and device for performing storage expansion and electronic equipment
KR101461319B1 (en) Methods and device for upgrading firmware of set-top box
CN114880073A (en) Cloud application engine deployment method, device, equipment and storage medium for shielding Web framework for user
CN109800567B (en) Method and device for monitoring foreground application starting and terminal equipment

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