CN108762771A - A kind of plug-in unit discharging method and electric terminal - Google Patents

A kind of plug-in unit discharging method and electric terminal Download PDF

Info

Publication number
CN108762771A
CN108762771A CN201810350271.8A CN201810350271A CN108762771A CN 108762771 A CN108762771 A CN 108762771A CN 201810350271 A CN201810350271 A CN 201810350271A CN 108762771 A CN108762771 A CN 108762771A
Authority
CN
China
Prior art keywords
plug
uninstallation
field information
uninstall
information
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.)
Granted
Application number
CN201810350271.8A
Other languages
Chinese (zh)
Other versions
CN108762771B (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

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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. Based on a user's unloading request of a plug-in in an application program, the current state of the plug-in is queried; if the current state of the plug-in is found to be running, a plug-in is added Unload field information. The uninstallation field information is used to indicate that the plug-in is in a state to be uninstalled, so if the uninstallation field information is read, it means that the plug-in needs to be uninstalled. Since the plug-in will be initialized at the next startup, that is, it will read all its own data for loading. Therefore, when the plug-in reads the uninstallation field information during the next startup process, it will delete the plug-in and its related files based on the uninstallation field information. Thus, the plug-in in the present invention can be uninstalled when the plug-in is started next time due to the addition of the uninstallation field information. The implementation of this method will not only affect the current use of the plug-in, but also avoid the problem that the plug-in must be closed to uninstall the plug-in. Plugins can be easily uninstalled.

Description

一种插件卸载方法及电子终端Plug-in uninstallation method and electronic terminal

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种插件卸载方法及电子终端。The invention relates to the field of communication technology, in particular to a plug-in unloading method and an electronic terminal.

背景技术Background technique

插件(Plug-in,又称addin、add-in、addon或add-on,又译外挂)是一种遵循一定规范的应用程序接口编写出来的程序。插件是指会随着IE浏览器的启动自动执行的程序,其只能运行在程序规定的系统平台下,可能同时支持多个平台,但不能脱离指定的平台单独运行。也就是说,插件必须依附于应用程序的启动才能够运行。插件的类型有无数种,例如有些插件程序能够帮助用户更方便浏览因特网或调用上网辅助功能,有的插件可以帮助用户网上支付等等。例如,在安装相关的插件后,浏览器能够直接调用插件程序,用于处理特定类型的文件。Plug-in (Plug-in, also known as addin, add-in, addon or add-on, also translated as plug-in) is a program written by an application program interface that follows certain specifications. A plug-in refers to a program that is automatically executed with the startup of the IE browser. It can only run on the system platform specified by the program, and may support multiple platforms at the same time, but it cannot run independently of the specified platform. In other words, the plug-in must be dependent on the startup of the application to be able to run. There are countless types of plug-ins. For example, some plug-ins can help users browse the Internet more conveniently or call auxiliary functions online, and some plug-ins can help users pay online and so on. For example, after installing a related plug-in, the browser can directly call the plug-in program to process a specific type of file.

鉴于插件的特殊性,Replugin插件化框架中的每个模块都以插件的形式存在并运行,若要移除Replugin插件化框架中的某个插件模块,就需要将该插件卸载掉。In view of the particularity of plug-ins, each module in the Replugin plug-in framework exists and runs as a plug-in. To remove a plug-in module in the Replugin plug-in framework, you need to uninstall the plug-in.

目前插件卸载一般是在插件不工作的情况下进行卸载,而在插件正常工作的过程中卸载,会提示用户“是否关闭该插件”进行卸载,故而影响当前运行插件的使用,导致出现当前运行插件存在卸载不易的问题。At present, plug-in uninstallation is generally performed when the plug-in is not working, and when the plug-in is uninstalled during normal operation, the user will be prompted to "whether to close the plug-in" to uninstall, thus affecting the use of the currently running plug-in, resulting in the current running plug-in There is a problem that it is not easy to uninstall.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的插件卸载方法及电子终端。In view of the above problems, the present invention is proposed to provide a plug-in uninstallation method and an electronic terminal that overcome the above problems or at least partially solve the above problems.

本发明的一个方面,提供了一种插件卸载方法,该方法包括:One aspect of the present invention provides a plug-in uninstallation method, the method comprising:

基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;Querying the current state of the plug-in based on a user's uninstall request to uninstall the plug-in in the application program;

若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;If it is found that the current state of the plug-in is running, add an uninstall field information to the plug-in, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled;

在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。During the next startup process of the plug-in, the plug-in and its related files are deleted based on the information in the uninstallation field.

优选的,所述查询所述插件的当前状态,具体包括:Preferably, the querying the current state of the plug-in specifically includes:

调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current state of the plug-in.

优选的,所述查询所述插件的当前状态之前,所述方法还包括:Preferably, before querying the current state of the plug-in, the method further includes:

获得所述插件的插件名称;Get the plugin name of said plugin;

基于所述插件的插件名称获得插件信息;obtaining plug-in information based on the plug-in name of the plug-in;

判断所述插件信息是否为空;Determine whether the plug-in information is empty;

若是,则表示所述插件未安装;If yes, it means that the plug-in is not installed;

若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。If not, it means that the plug-in information is a plug-in that has been installed but whose current running state is unknown.

优选的,所述查询所述插件的当前状态之后,所述方法还包括:Preferably, after querying the current state of the plug-in, the method further includes:

若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。If it is found that the current state of the plug-in is not running, then delete the plug-in and its related files.

优选的,所述在所述插件中添加一卸载字段信息,具体包括:Preferably, adding an uninstallation field information in the plug-in specifically includes:

将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。Add the uninstall field information delinfo to the p.l file of the application in Json format.

优选的,所述在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件,具体包括:Preferably, during the next startup of the plug-in, deleting the plug-in and its related files based on the uninstallation field information specifically includes:

在所述插件下次启动的过程中,加载所述插件的相关文件;During the next startup process of the plug-in, load the related files of the plug-in;

判断所述插件的相关文件中是否具有所述卸载字段信息;Judging whether the relevant file of the plug-in has the uninstallation field information;

若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;If there is the uninstall field information, then delete the plug-in and its related files based on the uninstall field information;

若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。If there is no information in the uninstallation field, the plug-in is loaded and started based on the related file of the plug-in.

优选的,所述基于所述卸载字段信息删除所述插件及其相关文件,具体包括:Preferably, the deletion of the plug-in and its related files based on the uninstallation field information specifically includes:

基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。Based on the system version number of the plug-in, delete the configuration file corresponding to the system version in the plug-in.

优选的,所述基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件之后,所述方法还包括:删除Native文件。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: deleting the Native file.

优选的,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:Preferably, after the plug-in and its related files are deleted based on the uninstallation field information, the method further includes:

将所述卸载字段信息进行记录;Recording the unloading field information;

删除所述卸载字段信息。Delete the uninstallation field information.

优选的,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:Preferably, after the plug-in and its related files are deleted based on the uninstallation field information, the method further includes:

向各进程发送广播通知,同步所述插件最新状态给各进程。Send a broadcast notification to each process, and synchronize the latest state of the plug-in to each process.

优选的,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:Preferably, after the plug-in and its related files are deleted based on the uninstallation field information, the method further includes:

更新所述插件所在进程的内存表信息。The memory table information of the process where the plug-in is located is updated.

本发明的另一个方面,公开了一种电子终端,包括:Another aspect of the present invention discloses an electronic terminal, including:

查询模块,用于基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;A query module, configured to query the current state of the plug-in based on a user's request to uninstall the plug-in in an application program;

添加模块,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;Adding a module, configured to add an uninstall field information to the plug-in if it is found that the current state of the plug-in is running, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled;

卸载模块,用于在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。An uninstall module, configured to delete the plug-in and its related files based on the uninstallation field information during the next startup of the plug-in.

优选的,所述查询所述插件的当前状态,具体包括:Preferably, the querying the current state of the plug-in specifically includes:

调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current state of the plug-in.

优选的,所述电子终端还包括:Preferably, the electronic terminal also includes:

第一获得模块,用于获得所述插件的插件名称;The first obtaining module is used to obtain the plug-in name of the plug-in;

第二获得模块,用于基于所述插件的插件名称获得插件信息;The second obtaining module is used to obtain plug-in information based on the plug-in name of the plug-in;

第一判断模块,用于判断所述插件信息是否为空;若是,则表示所述插件未安装;若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。The first judging module is used to judge whether the plug-in information is empty; if yes, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in that has been installed but the current running state is unknown.

优选的,所述电子终端还包括:Preferably, the electronic terminal also includes:

删除模块,用于若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。A deletion module, configured to delete the plug-in and its related files if it is found that the current state of the plug-in is not running.

优选的,所述添加模块,具体用于将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。Preferably, the adding module is specifically configured to add the uninstallation field information delinfo in Json format to the p.l file of the application.

优选的,所述卸载模块,具体包括:Preferably, the uninstallation module specifically includes:

第一加载模块,用于在所述插件下次启动的过程中,加载所述插件的相关文件;The first loading module is used to load related files of the plug-in during the next startup of the plug-in;

第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judging module is used to judge whether the relevant file of the plug-in has the uninstallation field information;

第一删除模块,用于若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;A first deletion module, configured to delete the plug-in and its related files based on the uninstallation field information if there is the uninstallation field information;

第二加载模块,用于若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。The second loading module is configured to load and start the plug-in based on the related file of the plug-in if there is no information in the uninstallation field.

优选的,所述卸载模块,具体用于基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。Preferably, the uninstallation module is specifically configured to delete the configuration file corresponding to the system version in the plug-in based on the system version number of the plug-in.

优选的,所述卸载模块,还用于删除Native文件。Preferably, the uninstall module is also used to delete Native files.

优选的,所述电子终端还包括:Preferably, the electronic terminal also includes:

记录模块,用于将所述卸载字段信息进行记录;A recording module, configured to record the unloading field information;

第二删除模块,用于删除所述卸载字段信息。The second deletion module is configured to delete the uninstallation field information.

优选的,所述电子终端还包括:同步模块,用于向各进程发送广播通知,同步所述插件最新状态给各进程。Preferably, the electronic terminal further includes: a synchronization module, configured to send a broadcast notification to each process, and synchronize the latest state of the plug-in to each process.

优选的,所述电子终端还包括:更新模块,用于更新所述插件所在进程的内存表信息。Preferably, the electronic terminal further includes: an update module, configured to update the memory table information of the process where the plug-in is located.

本发明的另一个方面,其上存储有计算机程序,该程序被处理器执行时实现上述方法的步骤。In another aspect of the present invention, a computer program is stored thereon, and when the program is executed by a processor, the steps of the above method are realized.

本发明的另一个方面,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法的步骤。Another aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, and the processor implements the steps of the above method when executing the program.

本申请实施例中提供的技术方案,至少具有如下技术效果或优点:The technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

本发明公开了一种插件卸载方法及电子终端,基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息。所述卸载字段信息用于标示所述插件处于待卸载状态,故而若读取到该卸载字段信息,就表示该插件需要被卸载。由于插件在下次启动时会进行初始化,也就是读取其本身所有的数据进行加载。故而所述插件在下次启动的过程中,当读取到该卸载字段信息,则会基于所述卸载字段信息删除所述插件及其相关文件。由此,本发明中的插件由于添加了卸载字段信息,能够在下次启动插件时进行卸载,该方法的实施不但不会影响插件当前的使用,还避免了必须关闭插件才能够卸载插件的问题,能够方便的卸载插件。The invention discloses a plug-in unloading method and an electronic terminal. Based on a user's unloading request of a plug-in in an application program, the current state of the plug-in is queried; An uninstallation field information is added to the plug-in. The uninstallation field information is used to indicate that the plug-in is in a state to be uninstalled, so if the uninstallation field information is read, it means that the plug-in needs to be uninstalled. Since the plug-in will be initialized at the next startup, that is, it will read all its own data for loading. Therefore, during the next startup process of the plug-in, when the uninstallation field information is read, the plug-in and its related files will be deleted based on the uninstallation field information. Thus, the plug-in in the present invention can be uninstalled when the plug-in is started next time due to the addition of the uninstallation field information. The implementation of this method will not only affect the current use of the plug-in, but also avoid the problem that the plug-in must be closed to uninstall the plug-in. Plugins can be easily uninstalled.

进一步的,现有的卸载插件的方式,实际上是采用“禁用”插件功能的方式进行卸载,导致大量“禁用插件”侵占系统内存,容易使系统运行速度变慢,出现卡顿现象。而本发明是直接采用了删除所述插件及其相关文件的方式,会将插件的所有相关信息都进行删除处理,故而内存占用较少,不会影响系统运行。Furthermore, the existing way of uninstalling plug-ins is actually to use the "disabled" plug-in function to uninstall, resulting in a large number of "disabled plug-ins" occupying the system memory, which is easy to slow down the system and cause a freeze phenomenon. However, the present invention directly adopts the method of deleting the plug-in and its related files, and all relevant information of the plug-in will be deleted, so the memory occupation is less and the system operation will not be affected.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of 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 embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的一种插件卸载方法;FIG. 1 shows a plug-in uninstallation method according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的一种电子终端的示意图。Fig. 2 shows a schematic diagram of an electronic terminal according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although 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 by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

本发明实施例提供了一种插件卸载方法,用以解决现有技术的当前运行插件存在卸载不易的问题。An embodiment of the present invention provides a method for uninstalling a plug-in, which is used to solve the problem of difficult uninstallation of currently running plug-ins in the prior art.

具体请参看图1,是本发明实施例中的插件卸载方法的实施过程图。Please refer to FIG. 1 for details, which is a diagram of the implementation process of the plug-in uninstallation method in the embodiment of the present invention.

步骤11,基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态。Step 11, based on the user's uninstallation request of a plug-in in an application program, query the current state of the plug-in.

在本发明实施例中,涉及的应用程序中的各功能模块都是以Replugin插件化框架存在。故而若移除应用程序中的某个功能,则相当于卸载相应的插件。而每个插件都有各自的当前状态,当前状态有:正在运行状态或者未运行状态等等。In the embodiment of the present invention, each functional module in the related application program exists in the Replugin plug-in framework. Therefore, if a function in the application is removed, it is equivalent to uninstalling the corresponding plug-in. And each plug-in has its own current state, the current state is: running state or not running state and so on.

而在查询所述插件的当前状态之前,基于用户的卸载一应用程序中的插件的卸载请求,首先会获得所述插件的插件名称,插件名不能为空。然后基于所述插件的插件名称获得插件信息。判断所述插件信息是否为空;若是,则表示所述插件未安装,不做处理直接返回即可。若不是,则表示所述插件信息表示已安装但当前运行状态未知的插件。Before querying the current state of the plug-in, based on the user's unloading request of a plug-in in an application program, the plug-in name of the plug-in will be obtained first, and the plug-in name cannot be empty. Plug-in information is then obtained based on the plug-in name of the plug-in. It is judged whether the plug-in information is empty; if it is, it means that the plug-in is not installed, and it can be returned without processing. If not, it means that the plug-in information indicates a plug-in that has been installed but whose current running state is unknown.

在具体的实施过程中,由于Replugin框架默认采用双进程架构。双进程架构就是同时运行两个进程,当常驻进程意外中断,可以启动备用进程保证插件的正常运行,不会因为常驻进程的意外中断造成运行中断,反之亦然。In the specific implementation process, the Replugin framework adopts a dual-process architecture by default. The dual-process architecture is to run two processes at the same time. When the resident process is interrupted unexpectedly, a backup process can be started to ensure the normal operation of the plug-in, and the operation will not be interrupted due to the unexpected interruption of the resident process, and vice versa.

本发明实施例的插件的卸载操作能够全部放在的常驻进程内,具体是通过插件管理器(PluginManagerServer类)来完成。而对于已安装插件的卸载大致分两种情况状态:插件正在运行状态和插件未运行状态。The unloading operation of the plug-in in the embodiment of the present invention can all be placed in the resident process, specifically through the plug-in manager (PluginManagerServer class). The uninstallation of the installed plug-in can be roughly divided into two states: the state of the plug-in running and the state of the plug-in not running.

而在查询插件的当前状态的过程中,可调用isPluginRunning接口查询所述插件的当前状态。In the process of querying the current state of the plug-in, the isPluginRunning interface may be called to query the current state of the plug-in.

步骤12,若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态。Step 12: If the current state of the plug-in is found to be running, add an uninstall field information to the plug-in, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled.

在具体的实施过程中,插件已安装且正在运行的情况,该情况下由于插件正在被使用(可能被用户或者其他插件使用),不能立即执行卸载操作,故而在所述插件中添加一卸载字段信息,用于标识所述插件处于待卸载状态,以便于插件在下次启动时进行卸载。In the specific implementation process, when the plug-in has been installed and is running, in this case, because the plug-in is being used (may be used by the user or other plug-ins), the uninstall operation cannot be performed immediately, so an uninstall field is added to the plug-in Information, used to identify that the plug-in is in a state to be uninstalled, so that the plug-in can be uninstalled when it is started next time.

进一步的,通过调用setPendingDelete接口,在插件信息对象(PluginInfo)内部维护一个待卸载插件信息的对象(也就是卸载字段信息),并且将所述卸载字段信息delinfo作为key值以Json格式添加到所述应用程序自身目录下的p.l文件中,记录下插件的待卸载状态,并且推迟到常驻进程重启时再次执行插件的卸载操作。Further, by calling the setPendingDelete interface, an object of plug-in information to be uninstalled (that is, the uninstallation field information) is maintained inside the plug-in information object (PluginInfo), and the uninstallation field information delinfo is added to the In the p.l file in the application program's own directory, the pending uninstallation status of the plug-in is recorded, and the unloading operation of the plug-in is postponed until the resident process is restarted.

而作为一种可选的实施例,若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。而在具体的实施过程中,插件在未运行状态时的处理过程,实际上和插件在加入卸载字段信息中,在下次启动时的处理过程类似,由于下述会具体介绍下次启动时具体的删除过程,故而在此本发明不再赘述插件未运行时的删除过程。As an optional embodiment, if it is found that the current state of the plug-in is not running, then delete the plug-in and its related files. In the specific implementation process, the processing process of the plug-in when it is not running is actually similar to the processing process when the plug-in is added to the uninstallation field information at the next startup. The deletion process, so the present invention does not repeat the deletion process when the plug-in is not running.

步骤13,在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。Step 13, during the next startup process of the plug-in, delete the plug-in and its related files based on the information in the uninstallation field.

在基于所述卸载字段信息删除所述插件及其相关文件的具体实施过程中,在所述插件下次启动的过程中,加载所述插件的相关文件;判断所述插件的相关文件中是否具有所述卸载字段信息;若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。In the specific implementation process of deleting the plug-in and its related files based on the uninstallation field information, in the process of starting the plug-in next time, load the related files of the plug-in; determine whether the related files of the plug-in have The uninstall field information; if there is the uninstall field information, delete the plug-in and its related files based on the uninstall field information; if there is no uninstall field information, load and start the plug-in based on the related files of the plug-in plugin.

具体来说,由于在每次常驻进程执行重启操作时,都会执行插件的初始化操作,其中就涉及插件的管理逻辑,上述步骤中提到的p.l文件中,该文件不仅记录有卸载字段信息,同样也记录了插件在安装时产生的插件信息。故而,会读取并依据该p.l文件内的插件信息来管理各插件,管理的含义包含插件版本升级和插件卸载等等。故而,如果当前插件包含卸载字段信息delinfo,则会通过调用getPendingDelete接口获得到卸载字段信息delinfo,由于插件卸载条件要优于插件的升级条件,则会首先判断该插件是否需要卸载,如果需要卸载,则直接删除所述插件及其相关文件,不再做更新操作。Specifically, since the initialization operation of the plug-in will be executed every time the resident process performs a restart operation, which involves the management logic of the plug-in, the p.l file mentioned in the above steps not only records the uninstallation field information, It also records the plug-in information generated by the plug-in when it is installed. Therefore, each plug-in will be read and managed according to the plug-in information in the p.l file. The meaning of management includes plug-in version upgrade and plug-in uninstallation, etc. Therefore, if the current plug-in contains the uninstallation field information delinfo, the uninstallation field information delinfo will be obtained by calling the getPendingDelete interface. Since the plug-in uninstallation condition is better than the plug-in upgrade condition, it will first determine whether the plug-in needs to be uninstalled. If it needs to be uninstalled, Then directly delete the plug-in and its related files, and no longer update it.

当然,如果插件处于未运行状态,则会直接删除插件及其相关文件。Of course, if the plug-in is not running, the plug-in and its related files will be deleted directly.

下面则具体介绍插件的删除过程。The following is a detailed introduction to the removal process of the plug-in.

在具体的删除过程中,会基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。例如,依次删除插件的APK文件、删除插件安装后释放的odex文件。删除插件的相关文件时会查询对应系统版本号,然后基于系统版本号删除对应的配置文件。During the specific deletion process, the configuration file corresponding to the system version in the plug-in will be deleted based on the system version number of the plug-in. For example, delete the APK file of the plug-in in sequence, and delete the odex file released after the plug-in is installed. When deleting the relevant files of the plug-in, the corresponding system version number will be queried, and then the corresponding configuration file will be deleted based on the system version number.

在具体的实施过程中,判断所述插件所在的系统版本是否高于第一预设级版本;In a specific implementation process, it is judged whether the system version of the plug-in is higher than the first preset level version;

若所述插件所在的系统版本高于所述第一预设级版本,则删除所述插件中和所述系统版本对应的配置文件;If the system version where the plug-in is located is higher than the first preset level version, then delete the configuration file corresponding to the system version in the plug-in;

若所述插件所在的系统版本低于所述第一预设级版本,进一步判断所述插件所在的系统版本是否低于第二预设级版本,若是,则删除所述插件中和所述系统版本对应的配置文件。If the system version where the plug-in is located is lower than the first preset level version, further determine whether the system version where the plug-in is located is lower than the second default level version, and if so, delete the plug-in and the system The configuration file corresponding to the version.

举例来说,如果是Android 8.0及以上系统,则还需删除插件安装后释放的vdex文件和**.jar.prof文件。For example, if it is Android 8.0 and above, you also need to delete the vdex file and **.jar.prof file released after the plug-in is installed.

如果是Android 4.0系统及以下还需要删除释放dex优化后所在的目录,如果有so库的话会删除Native文件。另外,还需要删除该插件所对应的进程锁文件,该进程所文件是在插件安装时创建的。至此,插件安装时所释放和生成的文件都已删除。If it is Android 4.0 system and below, you need to delete the directory where the dex optimization is released. If there is an so library, the Native file will be deleted. In addition, you also need to delete the process lock file corresponding to the plug-in, which is created when the plug-in is installed. At this point, the files released and generated by the plugin installation have been deleted.

进一步的,在基于所述卸载字段信息删除所述插件及其相关文件之后,还会将所述卸载字段信息进行记录;删除所述卸载字段信息。例如,删除p.l文件中的delinfo字段并保存。Further, after the plug-in and its related files are deleted based on the uninstallation field information, the uninstallation field information will also be recorded; and the uninstallation field information will be deleted. For example, delete the delinfo field in the p.l file and save it.

进一步的,由于插件的状态已经发生变化,故而需要将插件的最新状态及时的通知到各个进程。也即,基于所述卸载字段信息删除所述插件及其相关文件之后,会向各进程发送广播通知,同步所述插件最新状态给各进程,用于告知该插件已经被卸载移除。Furthermore, since the state of the plug-in has changed, it is necessary to notify each process of the latest state of the plug-in in a timely manner. That is, after the plug-in and its related files are deleted based on the uninstallation field information, a broadcast notification will be sent to each process to synchronize the latest status of the plug-in to each process to inform that the plug-in has been uninstalled and removed.

在具体的实施过程中,在基于所述卸载字段信息删除所述插件及其相关文件之后,还会更新所述插件所在进程的内存表信息。例如,更新常驻进程的内存表信息(常驻进程内部维护有所有插件的各种信息的缓冲表,包括插件信息、PackageInfo、Resources、ComponentList和DexClassLoader等缓冲对象):移除已卸载插件在保存有所有插件信息的HashMap中的缓冲数据、移除插件表快照、移除内存中卸载插件的PackageInfo、Resources、ComponentList和DexClassLoader缓存对象数据。In a specific implementation process, after the plug-in and its related files are deleted based on the uninstallation field information, the memory table information of the process where the plug-in is located will also be updated. For example, update the memory table information of the resident process (the resident process maintains a buffer table with various information of all plug-ins, including buffer objects such as plug-in information, PackageInfo, Resources, ComponentList, and DexClassLoader): remove uninstalled plug-ins in the save Buffer data in HashMap with all plugin information, remove plugin table snapshot, remove PackageInfo, Resources, ComponentList and DexClassLoader cache object data of unloaded plugin in memory.

基于统一发明构思,下面的实施例介绍一种电子终端。Based on the unified inventive concept, the following embodiments introduce an electronic terminal.

参看图2,该电子终端包括:Referring to Figure 2, the electronic terminal includes:

查询模块21,用于基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;The query module 21 is configured to query the current state of the plug-in based on the user's uninstall request of the plug-in in an application program;

添加模块22,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;The adding module 22 is used to add an uninstall field information in the plug-in if it is found that the current state of the plug-in is the running state, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled;

卸载模块23,用于在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。The uninstallation module 23 is configured to delete the plug-in and its related files based on the uninstallation field information during the next start-up of the plug-in.

作为一种可选的实施例,所述查询所述插件的当前状态,具体包括:As an optional embodiment, the querying the current state of the plug-in specifically includes:

调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current state of the plug-in.

作为一种可选的实施例,所述电子终端还包括:As an optional embodiment, the electronic terminal further includes:

第一获得模块,用于获得所述插件的插件名称;The first obtaining module is used to obtain the plug-in name of the plug-in;

第二获得模块,用于基于所述插件的插件名称获得插件信息;The second obtaining module is used to obtain plug-in information based on the plug-in name of the plug-in;

第一判断模块,用于判断所述插件信息是否为空;若是,则表示所述插件未安装;若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。The first judging module is used to judge whether the plug-in information is empty; if yes, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in that has been installed but the current running state is unknown.

作为一种可选的实施例,所述电子终端还包括:As an optional embodiment, the electronic terminal further includes:

删除模块,用于若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。A deletion module, configured to delete the plug-in and its related files if it is found that the current state of the plug-in is not running.

作为一种可选的实施例,所述添加模块22,具体用于将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。As an optional embodiment, the adding module 22 is specifically configured to add the uninstallation field information delinfo in Json format to the p.l file of the application.

作为一种可选的实施例,所述卸载模块23,具体包括:As an optional embodiment, the uninstallation module 23 specifically includes:

第一加载模块,用于在所述插件下次启动的过程中,加载所述插件的相关文件;The first loading module is used to load related files of the plug-in during the next startup of the plug-in;

第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judging module is used to judge whether the relevant file of the plug-in has the uninstallation field information;

第一删除模块,用于若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;A first deletion module, configured to delete the plug-in and its related files based on the uninstallation field information if there is the uninstallation field information;

第二加载模块,用于若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。The second loading module is configured to load and start the plug-in based on the related file of the plug-in if there is no information in the uninstallation field.

作为一种可选的实施例,所述卸载模块23,具体用于基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。As an optional embodiment, the uninstallation 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 of the plug-in.

作为一种可选的实施例,所述卸载模块23,还用于删除Native文件。As an optional embodiment, the uninstallation module 23 is also used to delete Native files.

作为一种可选的实施例,所述电子终端还包括:As an optional embodiment, the electronic terminal further includes:

记录模块,用于将所述卸载字段信息进行记录;A recording module, configured to record the unloading field information;

第二删除模块,用于删除所述卸载字段信息。The second deletion module is configured to delete the uninstallation field information.

作为一种可选的实施例,所述电子终端还包括:同步模块,用于向各进程发送广播通知,同步所述插件最新状态给各进程。As an optional embodiment, the electronic terminal further includes: a synchronization module, configured to send a broadcast notification to each process, and synchronize the latest state of the plug-in to each process.

作为一种可选的实施例,所述电子终端还包括:As an optional embodiment, the electronic terminal further includes:

更新模块,用于更新所述插件所在进程的内存表信息。The update module is used to update the memory table information of the process where the plug-in is located.

基于与前述实施例中同样的发明构思,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前文任一所述方法的步骤。Based on the same inventive concept as in the aforementioned embodiments, the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the aforementioned methods are implemented.

基于与前述实施例中同样的发明构思,本发明还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前文任一所述方法的步骤。Based on the same inventive concept as in the foregoing embodiments, the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the program Implement the steps of any one of the methods described above.

本申请实施例中提供的技术方案,至少具有如下技术效果或优点:The technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

本发明公开了一种插件卸载方法及电子终端,基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息。所述卸载字段信息用于标示所述插件处于待卸载状态,故而若读取到该卸载字段信息,就表示该插件需要被卸载。由于插件在下次启动时会进行初始化,也就是读取其本身所有的数据进行加载。故而所述插件在下次启动的过程中,当读取到该卸载字段信息,则会基于所述卸载字段信息删除所述插件及其相关文件。由此,本发明中的插件由于添加了卸载字段信息,能够在下次启动插件时进行卸载,该方法的实施不但不会影响插件当前的使用,还避免了必须关闭插件才能够卸载插件的问题,能够方便的卸载插件。The invention discloses a plug-in unloading method and an electronic terminal. Based on a user's unloading request of a plug-in in an application program, the current state of the plug-in is queried; An uninstallation field information is added to the plug-in. The uninstallation field information is used to indicate that the plug-in is in a state to be uninstalled, so if the uninstallation field information is read, it means that the plug-in needs to be uninstalled. Since the plug-in will be initialized at the next startup, that is, it will read all its own data for loading. Therefore, during the next startup process of the plug-in, when the uninstallation field information is read, the plug-in and its related files will be deleted based on the uninstallation field information. Thus, the plug-in in the present invention can be uninstalled when the plug-in is started next time due to the addition of the uninstallation field information. The implementation of this method will not only affect the current use of the plug-in, but also avoid the problem that the plug-in must be closed to uninstall the plug-in. Plugins can be easily uninstalled.

进一步的,现有的卸载插件的方式,实际上是采用“禁用”插件功能的方式进行卸载,导致大量“禁用插件”侵占系统内存,容易使系统运行速度变慢,出现卡顿现象。而本发明是直接采用了删除所述插件及其相关文件的方式,会将插件的所有相关信息都进行删除处理,故而内存占用较少,不会影响系统运行。Furthermore, the existing way of uninstalling plug-ins is actually to use the "disabled" plug-in function to uninstall, resulting in a large number of "disabled plug-ins" occupying the system memory, which is easy to slow down the system and cause a freeze phenomenon. However, the present invention directly adopts the method of deleting the plug-in and its related files, and all relevant information of the plug-in will be deleted, so the memory occupation is less and the system operation will not be affected.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood 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 the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention 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 can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including 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 understand that although some embodiments herein include some features included in other embodiments but not others, combinations of features from 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.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的网关、代理服务器、系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present 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 should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components in the gateway, proxy server, and system according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided 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 can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

本发明公开了,A1、一种插件卸载方法,其特征在于,所述方法包括:The invention discloses, A1, a plug-in unloading method, characterized in that the method includes:

基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;Querying the current state of the plug-in based on a user's uninstall request to uninstall the plug-in in the application program;

若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;If it is found that the current state of the plug-in is running, add an uninstall field information to the plug-in, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled;

在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。During the next startup process of the plug-in, the plug-in and its related files are deleted based on the information in the uninstallation field.

A2、如A1所述的方法,其特征在于,所述查询所述插件的当前状态,具体包括:A2. The method as described in A1, wherein the querying the current state of the plug-in specifically includes:

调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current state of the plug-in.

A3、如A1所述的方法,其特征在于,所述查询所述插件的当前状态之前,所述方法还包括:A3. The method as described in A1, wherein before the querying the current state of the plug-in, the method also includes:

获得所述插件的插件名称;Get the plugin name of said plugin;

基于所述插件的插件名称获得插件信息;obtaining plug-in information based on the plug-in name of the plug-in;

判断所述插件信息是否为空;Determine whether the plug-in information is empty;

若是,则表示所述插件未安装;If yes, it means that the plug-in is not installed;

若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。If not, it means that the plug-in information is a plug-in that has been installed but whose current running state is unknown.

A4、如A1所述的方法,其特征在于,所述查询所述插件的当前状态之后,所述方法还包括:A4, the method as described in A1, is characterized in that, after the current status of the plug-in is inquired, the method also includes:

若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。If it is found that the current state of the plug-in is not running, then delete the plug-in and its related files.

A5、如A1所述的方法,其特征在于,所述在所述插件中添加一卸载字段信息,具体包括:A5, the method as described in A1, is characterized in that, adding an uninstallation field information in the plug-in specifically includes:

将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。Add the uninstall field information delinfo to the p.l file of the application in Json format.

A6、如A1所述的方法,其特征在于,所述在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件,具体包括:A6. The method as described in A1, wherein, during the next startup of the plug-in, the plug-in and its related files are deleted based on the uninstallation field information, specifically including:

在所述插件下次启动的过程中,加载所述插件的相关文件;During the next startup process of the plug-in, load the related files of the plug-in;

判断所述插件的相关文件中是否具有所述卸载字段信息;Judging whether the relevant file of the plug-in has the uninstallation field information;

若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;If there is the uninstall field information, then delete the plug-in and its related files based on the uninstall field information;

若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。If there is no information in the uninstallation field, the plug-in is loaded and started based on the related file of the plug-in.

A7、如A1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件,具体包括:A7. The method as described in A1, wherein the deletion of the plug-in and its related files based on the uninstallation field information specifically includes:

基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。Based on the system version number of the plug-in, delete the configuration file corresponding to the system version in the plug-in.

A8、如A7所述的方法,其特征在于,所述基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件之后,所述方法还包括:删除Native文件。A8, the method as described in A7, is characterized in that, 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 also includes: deleting the Native file .

A9、如A1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:A9. The method as described in A1, characterized in that, after the plug-in and its related files are deleted based on the uninstallation field information, the method further includes:

将所述卸载字段信息进行记录;Recording the unloading field information;

删除所述卸载字段信息。Delete the uninstallation field information.

A10、如A1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:A10, the method as described in A1, characterized in that, after the plug-in and its related files are deleted based on the uninstallation field information, the method further includes:

向各进程发送广播通知,同步所述插件最新状态给各进程。Send a broadcast notification to each process, and synchronize the latest state of the plug-in to each process.

A11、如A1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:A11. The method as described in A1, wherein after deleting the plug-in and its related files based on the uninstallation field information, the method further includes:

更新所述插件所在进程的内存表信息。The memory table information of the process where the plug-in is located is updated.

B12、一种电子终端,其特征在于,包括:B12, an electronic terminal, is characterized in that, comprises:

查询模块,用于基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;A query module, configured to query the current state of the plug-in based on a user's request to uninstall the plug-in in an application program;

添加模块,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;Adding a module, configured to add an uninstall field information to the plug-in if it is found that the current state of the plug-in is running, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled;

卸载模块,用于在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。An uninstall module, configured to delete the plug-in and its related files based on the uninstallation field information during the next startup of the plug-in.

B13、如B12所述的电子终端,其特征在于,所述查询所述插件的当前状态,具体包括:B13, the electronic terminal as described in B12, is characterized in that, the current state of described inquiry described plug-in, specifically comprises:

调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current state of the plug-in.

B14、如B12所述的电子终端,其特征在于,所述电子终端还包括:B14, the electronic terminal as described in B12, is characterized in that, described electronic terminal also comprises:

第一获得模块,用于获得所述插件的插件名称;The first obtaining module is used to obtain the plug-in name of the plug-in;

第二获得模块,用于基于所述插件的插件名称获得插件信息;The second obtaining module is used to obtain plug-in information based on the plug-in name of the plug-in;

第一判断模块,用于判断所述插件信息是否为空;若是,则表示所述插件未安装;若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。The first judging module is used to judge whether the plug-in information is empty; if yes, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in that has been installed but the current running state is unknown.

B15、如B12所述的电子终端,其特征在于,所述电子终端还包括:B15, the electronic terminal as described in B12, is characterized in that, described electronic terminal also comprises:

删除模块,用于若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。A deletion module, configured to delete the plug-in and its related files if it is found that the current state of the plug-in is not running.

B16、如B12所述的电子终端,其特征在于,所述添加模块,具体用于将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。B16. The electronic terminal as described in B12, wherein the adding module is specifically configured to add the uninstallation field information delinfo to the p.l file of the application program in Json format.

B17、如B12所述的电子终端,其特征在于,所述卸载模块,具体包括:B17, the electronic terminal as described in B12, is characterized in that, described unloading module specifically comprises:

第一加载模块,用于在所述插件下次启动的过程中,加载所述插件的相关文件;The first loading module is used to load related files of the plug-in during the next startup of the plug-in;

第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judging module is used to judge whether the relevant file of the plug-in has the uninstallation field information;

第一删除模块,用于若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;A first deletion module, configured to delete the plug-in and its related files based on the uninstallation field information if there is the uninstallation field information;

第二加载模块,用于若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。The second loading module is configured to load and start the plug-in based on the related file of the plug-in if there is no information in the uninstallation field.

B18、如B12所述的电子终端,其特征在于,所述卸载模块,具体用于基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。B18. The electronic terminal as described in B12, wherein the uninstallation 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、如B18所述的电子终端,其特征在于,所述卸载模块,还用于删除Native文件。B19, the electronic terminal as described in B18, is characterized in that, described unloading module is also used for deleting Native file.

B20、如B12所述的电子终端,其特征在于,所述电子终端还包括:B20, the electronic terminal as described in B12, is characterized in that, described electronic terminal also comprises:

记录模块,用于将所述卸载字段信息进行记录;A recording module, configured to record the unloading field information;

第二删除模块,用于删除所述卸载字段信息。The second deletion module is configured to delete the uninstallation field information.

B21、如B12所述的电子终端,其特征在于,所述电子终端还包括:同步模块,用于向各进程发送广播通知,同步所述插件最新状态给各进程。B21. The electronic terminal as described in B12, characterized in that the electronic terminal further includes: a synchronization module, configured to send a broadcast notification to each process, and synchronize the latest status of the plug-in to each process.

B22、如B12所述的电子终端,其特征在于,所述电子终端还包括:B22, the electronic terminal as described in B12, is characterized in that, described electronic terminal also comprises:

更新模块,用于更新所述插件所在进程的内存表信息。The update module is used to update the memory table information of the process where the plug-in is located.

C23、一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求A1-A12任一项所述方法的步骤。C23. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the method described in any one of claims A1-A12 are implemented.

D24、一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求A1-A12任一项所述方法的步骤。D24. A computer device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, characterized in that, when the processor executes the program, any one of claims A1-A12 is realized The steps of the method.

Claims (10)

1.一种插件卸载方法,其特征在于,所述方法包括:1. A plug-in uninstallation method, characterized in that the method comprises: 基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;Querying the current state of the plug-in based on a user's uninstall request to uninstall the plug-in in the application program; 若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;If it is found that the current state of the plug-in is running, add an uninstall field information to the plug-in, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled; 在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。During the next startup process of the plug-in, the plug-in and its related files are deleted based on the information in the uninstallation field. 2.如权利要求1所述的方法,其特征在于,所述查询所述插件的当前状态,具体包括:2. The method according to claim 1, wherein the querying the current state of the plug-in specifically comprises: 调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current state of the plug-in. 3.如权利要求1所述的方法,其特征在于,所述查询所述插件的当前状态之前,所述方法还包括:3. The method according to claim 1, wherein before the querying the current state of the plug-in, the method further comprises: 获得所述插件的插件名称;Get the plugin name of said plugin; 基于所述插件的插件名称获得插件信息;obtaining plug-in information based on the plug-in name of the plug-in; 判断所述插件信息是否为空;Determine whether the plug-in information is empty; 若是,则表示所述插件未安装;If yes, it means that the plug-in is not installed; 若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。If not, it means that the plug-in information is a plug-in that has been installed but whose current running state is unknown. 4.如权利要求1所述的方法,其特征在于,所述查询所述插件的当前状态之后,所述方法还包括:4. The method according to claim 1, wherein after said querying the current state of said plug-in, said method further comprises: 若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。If it is found that the current state of the plug-in is not running, then delete the plug-in and its related files. 5.如权利要求1所述的方法,其特征在于,所述在所述插件中添加一卸载字段信息,具体包括:5. The method according to claim 1, wherein adding an uninstallation field information in the plug-in specifically includes: 将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。Add the uninstall field information delinfo to the p.l file of the application in Json format. 6.如权利要求1所述的方法,其特征在于,所述在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件,具体包括:6. The method according to claim 1, wherein, during the next startup of the plug-in, deleting the plug-in and its related files based on the uninstallation field information specifically includes: 在所述插件下次启动的过程中,加载所述插件的相关文件;During the next startup process of the plug-in, load the related files of the plug-in; 判断所述插件的相关文件中是否具有所述卸载字段信息;Judging whether the relevant file of the plug-in has the uninstallation field information; 若有所述卸载字段信息,则基于所述卸载字段信息删除所述插件及其相关文件;If there is the uninstall field information, then delete the plug-in and its related files based on the uninstall field information; 若没有所述卸载字段信息,则基于所述插件的相关文件加载启动所述插件。If there is no information in the uninstallation field, the plug-in is loaded and started based on the related files of the plug-in. 7.如权利要求1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件,具体包括:7. The method according to claim 1, wherein the deleting the plug-in and its related files based on the uninstallation field information specifically comprises: 基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。Based on the system version number of the plug-in, delete the configuration file corresponding to the system version in the plug-in. 8.一种电子终端,其特征在于,包括:8. An electronic terminal, characterized in that it comprises: 查询模块,用于基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;A query module, configured to query the current state of the plug-in based on a user's request to uninstall the plug-in in an application program; 添加模块,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;Adding a module, configured to add an uninstall field information to the plug-in if the current state of the plug-in is found to be running, and the uninstall field information is used to identify that the plug-in is in a state to be uninstalled; 卸载模块,用于在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。An uninstall module, configured to delete the plug-in and its related files based on the uninstallation field information during the next startup of the plug-in. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-7任一权项所述方法的步骤。9. A computer-readable storage medium, on which a computer program is stored, wherein, when the program is executed by a processor, the steps of the method according to any one of claims 1-7 are implemented. 10.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1-7任一权项所述方法的步骤。10. A computer device, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, characterized in that, when the processor executes the program, any one of claims 1-7 is realized. steps of the method described in the item.
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 true CN108762771A (en) 2018-11-06
CN108762771B 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)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0811942A2 (en) * 1996-06-07 1997-12-10 Cyber Media, Incorporated Automatic updating of diverse software products on multiple client computer system
CN103309699A (en) * 2012-03-16 2013-09-18 宇龙计算机通信科技(深圳)有限公司 Mobile terminal and application program installation method
CN105446785A (en) * 2015-12-31 2016-03-30 深圳市创想天空科技股份有限公司 Method and system for unloading application program
CN105516750A (en) * 2015-12-03 2016-04-20 深圳市茁壮网络股份有限公司 Plug-in unloading, deleting and updating method based on object label
CN105955770A (en) * 2016-04-27 2016-09-21 深圳市金立通信设备有限公司 Application program uninstalling method and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0811942A2 (en) * 1996-06-07 1997-12-10 Cyber Media, Incorporated Automatic updating of diverse software products on multiple client computer system
CN103309699A (en) * 2012-03-16 2013-09-18 宇龙计算机通信科技(深圳)有限公司 Mobile terminal and application program installation method
CN105516750A (en) * 2015-12-03 2016-04-20 深圳市茁壮网络股份有限公司 Plug-in unloading, deleting and updating 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
CN108762771B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN105867947B (en) Data processing method and device after preset application program is upgraded
CN105335187B (en) Applied processing method and device
CN103745158A (en) Method and device for repairing system bugs
CN102981880B (en) A kind of method and apparatus realizing the renewal of application program
CN103345411A (en) Method and device for uninstalling application program
CN109710324B (en) Processing method and device for blue screen display, storage medium and terminal
CN104699511A (en) Plug-in upgrading method and plug-in upgrading device
CN104346206A (en) Method and system for recovering installation of unloaded software
CN109002330A (en) A kind of method, device and equipment identifying UEFI OS startup item
CN107220074A (en) To the access of supporting layer software function, upgrade method and device
WO2019144621A1 (en) Method, apparatus, and server for acquiring uefi os startup item
CN106886437A (en) Application program update method and apparatus
CN108563472B (en) Method and device for loading service plug-in based on multi-open application
CN118760480A (en) Android-based application plug-in method, device, storage medium and electronic device
CN108681460A (en) A method for upgrading a plug-in and an electronic terminal
CN106201584B (en) Version upgrading method and terminal device
CN111736863A (en) A software upgrade method, device and electronic device
CN111562929A (en) Method, device and equipment for generating patch file and storage medium
CN107967192B (en) A system crash processing method and device for an intelligent terminal
US20150089486A1 (en) Method of Firmware Upgrade
CN108762771B (en) Plug-in unloading method and electronic terminal
CN107783837B (en) A method, device and electronic device for storage expansion
US10809996B2 (en) Method and device for creating images of different installation and download software units
CN106933604A (en) A kind of method for upgrading system and device
CN114047933B (en) Method, device, equipment and medium for multi-open Android application

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