[go: up one dir, main page]

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
uninstall
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 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, 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 uninstall method and electronic terminal

技术领域technical field

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

背景技术Background technique

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

鉴于插件的特殊性,Replugin插件化框架中的每个模块都以插件的形式存在并运行,若要移除Replugin插件化框架中的某个插件模块,就需要将该插件卸载掉。Due to 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, the plug-in needs to be uninstalled.

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

发明内容SUMMARY 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 method for uninstalling a plug-in, the method comprising:

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

若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;If it is found that the current state of the plug-in is the running state, 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 of the plug-in, the plug-in and its related files are deleted based on the uninstall field information.

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

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

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

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

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

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

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

若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。If not, it means that the plug-in information is an installed plug-in 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, the plug-in and its related files are deleted.

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

将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。The unloading field information delinfo is added 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 uninstall field information specifically includes:

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

判断所述插件的相关文件中是否具有所述卸载字段信息;Determine whether the relevant file of the plug-in has 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 unload field information, the plug-in is loaded and started based on the relevant file of the plug-in.

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

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

优选的,所述基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件之后,所述方法还包括:删除Native文件。Preferably, after the configuration file corresponding to the system version in the plug-in is deleted based on the system version number where the plug-in is located, the method further includes: deleting the Native file.

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

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

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

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

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

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

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

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

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

添加模块,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;The adding module is configured to add an uninstall field information to the plug-in if the current state of the plug-in is found to be the running state, where 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 uninstall 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 status of the plug-in.

优选的,所述电子终端还包括:Preferably, 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 judgment module is used for judging whether the plug-in information is empty; if so, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in whose current running state is unknown.

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

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

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

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

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

第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judgment module is used for judging whether the relevant file of the plug-in has the uninstall 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 relevant file of the plug-in if there is no unload field information.

优选的,所述卸载模块,具体用于基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。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 where the plug-in is located.

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

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

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

第二删除模块,用于删除所述卸载字段信息。The second deletion module is used to delete the uninstall 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 comprises: an update module for updating 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 the program implements the steps of the above method when executed by a processor.

本发明的另一个方面,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法的步骤。Another aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing 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 uninstalling method and an electronic terminal. Based on a user's uninstall request for uninstalling 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 the running state, the An uninstall field information is added to the plug-in. The uninstall field information is used to indicate that the plug-in is in a state to be uninstalled, so if the uninstall field information is read, it means that the plug-in needs to be uninstalled. Because the plugin will be initialized the next time it starts, that is, read all its own data for loading. Therefore, during the next startup of the plug-in, when the uninstall field information is read, the plug-in and its related files will be deleted based on the uninstall field information. Therefore, the plugin in the present invention can be uninstalled when the plugin is started next time due to the addition of uninstall field information. The implementation of this method not only does not affect the current use of the plugin, but also avoids the problem that the plugin must be closed to uninstall the plugin. Plugins can be easily uninstalled.

进一步的,现有的卸载插件的方式,实际上是采用“禁用”插件功能的方式进行卸载,导致大量“禁用插件”侵占系统内存,容易使系统运行速度变慢,出现卡顿现象。而本发明是直接采用了删除所述插件及其相关文件的方式,会将插件的所有相关信息都进行删除处理,故而内存占用较少,不会影响系统运行。Further, the existing method of uninstalling a plug-in actually uses the method of "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 running speed and cause a freeze phenomenon. In the present invention, the method of deleting the plug-in and its related files is directly adopted, and all relevant information of the plug-in is deleted, so that the memory occupies less and the system operation is not affected.

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

附图说明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 embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered limiting of the invention. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:

图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. 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 by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.

本发明实施例提供了一种插件卸载方法,用以解决现有技术的当前运行插件存在卸载不易的问题。The embodiment of the present invention provides a method for uninstalling a plug-in, so as to solve the problem that the current running plug-in is not easy to uninstall in the prior art.

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

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

在本发明实施例中,涉及的应用程序中的各功能模块都是以Replugin插件化框架存在。故而若移除应用程序中的某个功能,则相当于卸载相应的插件。而每个插件都有各自的当前状态,当前状态有:正在运行状态或者未运行状态等等。In the embodiment of the present invention, each functional module in the involved application program exists in the Replugin plug-in framework. Therefore, removing a function in an application 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 uninstall request to uninstall the plug-in in an application, the plug-in name of the plug-in is 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 can be returned directly without processing. If not, it means that the plug-in information represents a plug-in that has been installed but whose current running state is unknown.

在具体的实施过程中,由于Replugin框架默认采用双进程架构。双进程架构就是同时运行两个进程,当常驻进程意外中断,可以启动备用进程保证插件的正常运行,不会因为常驻进程的意外中断造成运行中断,反之亦然。In the specific implementation process, because 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 operations of the plug-ins in the embodiments of the present invention can all be placed in the resident process, and are specifically completed by a plug-in manager (PluginManagerServer class). For the uninstallation of installed plug-ins, there are roughly two states: the plug-in is running and the plug-in is not running.

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

步骤12,若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态。Step 12: If it is found that the current state of the plug-in is the running state, add uninstall field information to the plug-in, where 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, since 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 The information is used to identify that the plug-in is in a state to be uninstalled, so that the plug-in can be uninstalled at the next startup.

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

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

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

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

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

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

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

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

在具体的实施过程中,判断所述插件所在的系统版本是否高于第一预设级版本;In the specific implementation process, determine whether the system version where the plug-in is located 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, 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 preset 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 the system is Android 8.0 and above, you also need to delete the vdex file and **.jar.prof file released after the plugin is installed.

如果是Android 4.0系统及以下还需要删除释放dex优化后所在的目录,如果有so库的话会删除Native文件。另外,还需要删除该插件所对应的进程锁文件,该进程所文件是在插件安装时创建的。至此,插件安装时所释放和生成的文件都已删除。If it is an Android 4.0 system and below, you need to delete the directory where the dex optimization is released. If there is a so library, the Native file will be deleted. In addition, it is also necessary 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 when the plugin is installed have been deleted.

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

进一步的,由于插件的状态已经发生变化,故而需要将插件的最新状态及时的通知到各个进程。也即,基于所述卸载字段信息删除所述插件及其相关文件之后,会向各进程发送广播通知,同步所述插件最新状态给各进程,用于告知该插件已经被卸载移除。Further, 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 time. That is, after the plug-in and its related files are deleted based on the uninstall field information, a broadcast notification will be sent to each process to synchronize the latest status of the plug-in to each process, so as to inform each process 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 uninstall 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 of various information of all plug-ins, including buffer objects such as plug-in information, PackageInfo, Resources, ComponentList, and DexClassLoader): remove the uninstalled plug-in and save it Buffer data in HashMap with all plugin information, remove plugin table snapshot, remove PackageInfo, Resources, ComponentList and DexClassLoader cache object data of unloaded plugins 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,用于基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;a query module 21, configured to query the current state of the plug-in based on a user's uninstall request for uninstalling a plug-in in an application;

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

卸载模块23,用于在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件。The uninstall module 23 is configured to delete the plug-in and its related files based on the uninstall field information during the next startup 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 status 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 judgment module is used for judging whether the plug-in information is empty; if so, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in whose 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 the current state of the plug-in is found to be a non-running state.

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

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

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

第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judgment module is used for judging whether the relevant file of the plug-in has the uninstall 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 relevant file of the plug-in if there is no unload field information.

作为一种可选的实施例,所述卸载模块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 where the plug-in is located.

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

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

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

第二删除模块,用于删除所述卸载字段信息。The second deletion module is used to delete the uninstall 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 foregoing embodiments, the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the steps of any of the foregoing methods.

基于与前述实施例中同样的发明构思,本发明还提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前文任一所述方法的步骤。Based on the same inventive concept as in the foregoing embodiments, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the program Implement the steps of any 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 uninstalling method and an electronic terminal. Based on a user's uninstall request for uninstalling 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 the running state, the An uninstall field information is added to the plug-in. The uninstall field information is used to indicate that the plug-in is in a state to be uninstalled, so if the uninstall field information is read, it means that the plug-in needs to be uninstalled. Because the plugin will be initialized the next time it starts, that is, read all its own data for loading. Therefore, during the next startup of the plug-in, when the uninstall field information is read, the plug-in and its related files will be deleted based on the uninstall field information. Therefore, the plugin in the present invention can be uninstalled when the plugin is started next time due to the addition of uninstall field information. The implementation of this method not only does not affect the current use of the plugin, but also avoids the problem that the plugin must be closed to uninstall the plugin. Plugins can be easily uninstalled.

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

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

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. It will be 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 is to be understood that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or its description. This disclosure, however, should not be construed as reflecting an intention 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 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. The modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination unless at least some of such features and/or procedures or elements 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, it will be understood by those skilled in the art that although some of the embodiments herein include certain features, but not others, included in other embodiments, that combinations of features of the different embodiments are intended 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)来实现根据本发明实施例的网关、代理服务器、系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。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) may be used in practice to implement some or all functions of some or all of the gateways, proxy servers, and systems according to embodiments of the present invention. The present invention can also be implemented as apparatus or apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from Internet sites, or provided on carrier signals, or in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by those skilled in the art 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 different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.

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

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

若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;If it is found that the current state of the plug-in is the running state, 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 of the plug-in, the plug-in and its related files are deleted based on the uninstall field information.

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

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

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

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

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

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

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

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

A4、如A1所述的方法,其特征在于,所述查询所述插件的当前状态之后,所述方法还包括:A4. The method according to A1, wherein 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, the plug-in and its related files are deleted.

A5、如A1所述的方法,其特征在于,所述在所述插件中添加一卸载字段信息,具体包括:A5. The method according to A1, wherein the adding an uninstall field information to the plug-in specifically includes:

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

A6、如A1所述的方法,其特征在于,所述在所述插件下次启动的过程中,基于所述卸载字段信息删除所述插件及其相关文件,具体包括:A6. The method according to A1, characterized in that, in the process of next startup of the plug-in, deleting the plug-in and its related files based on the uninstall field information specifically includes:

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

判断所述插件的相关文件中是否具有所述卸载字段信息;Determine whether the relevant file of the plug-in has 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 unload field information, the plug-in is loaded and started based on the relevant file of the plug-in.

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

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

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

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

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

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

A10、如A1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:A10. The method according to A1, wherein after the plugin and its related files are deleted based on the uninstall field information, the method further includes:

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

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

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

B12、一种电子终端,其特征在于,包括:B12. An electronic terminal, characterized in that it includes:

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

添加模块,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;The adding module is configured to add an uninstall field information to the plug-in if the current state of the plug-in is found to be the running state, where 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 uninstall field information during the next startup of the plug-in.

B13、如B12所述的电子终端,其特征在于,所述查询所述插件的当前状态,具体包括:B13. The electronic terminal according to B12, wherein the querying the current state of the plug-in specifically includes:

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

B14、如B12所述的电子终端,其特征在于,所述电子终端还包括:B14. The electronic terminal according to B12, wherein the electronic terminal further 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 judgment module is used for judging whether the plug-in information is empty; if so, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in whose current running state is unknown.

B15、如B12所述的电子终端,其特征在于,所述电子终端还包括:B15. The electronic terminal according to B12, wherein the electronic terminal further comprises:

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

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

B17、如B12所述的电子终端,其特征在于,所述卸载模块,具体包括:B17. The electronic terminal according to B12, wherein the unloading module specifically includes:

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

第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judgment module is used for judging whether the relevant file of the plug-in has the uninstall 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 relevant file of the plug-in if there is no unload field information.

B18、如B12所述的电子终端,其特征在于,所述卸载模块,具体用于基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。B18. The electronic terminal according to 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 according to B18, wherein the uninstallation module is further configured to delete the Native file.

B20、如B12所述的电子终端,其特征在于,所述电子终端还包括:B20. The electronic terminal according to B12, wherein the electronic terminal further comprises:

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

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

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

B22、如B12所述的电子终端,其特征在于,所述电子终端还包括:B22. The electronic terminal according to B12, wherein the electronic terminal further 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 according to 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 running on the processor, characterized in that, when the processor executes the program, any one of claims A1-A12 is implemented the steps of the method.

Claims (24)

1.一种插件卸载方法,其特征在于,所述方法包括:1. a plug-in unloading method, is characterized in that, described method comprises: 基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;querying the current state of the plug-in based on a user's uninstall request for uninstalling a plug-in in an application; 若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;If it is found that the current state of the plug-in is the running state, 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 of the plug-in, the plug-in and its related files are deleted based on the uninstall field information. 2.如权利要求1所述的方法,其特征在于,所述查询所述插件的当前状态,具体包括:2. The method of claim 1, wherein the querying the current state of the plug-in specifically comprises: 调用isPluginRunning接口查询所述插件的当前状态。Call the isPluginRunning interface to query the current status of the plug-in. 3.如权利要求1所述的方法,其特征在于,所述查询所述插件的当前状态之前,所述方法还包括:3. The method of claim 1, wherein before the querying the current state of the plug-in, the method further comprises: 获得所述插件的插件名称;Get the plugin name of the plugin; 基于所述插件的插件名称获得插件信息;obtaining plug-in information based on the plug-in name of the plug-in; 判断所述插件信息是否为空;Determine whether the plug-in information is empty; 若是,则表示所述插件未安装;If so, it means that the plug-in is not installed; 若不是,则表示所述插件信息为已安装但当前运行状态未知的插件。If not, it means that the plug-in information is an installed plug-in whose current running state is unknown. 4.如权利要求1所述的方法,其特征在于,所述查询所述插件的当前状态之后,所述方法还包括:4. The method of claim 1, wherein after the querying the current state of the plug-in, the method further comprises: 若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。If it is found that the current state of the plug-in is not running, the plug-in and its related files are deleted. 5.如权利要求1所述的方法,其特征在于,所述在所述插件中添加一卸载字段信息,具体包括:5. The method of claim 1, wherein the adding an uninstall field information in the plug-in specifically comprises: 将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。The unloading field information delinfo is added 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 uninstall field information, specifically comprising: 在所述插件下次启动的过程中,加载所述插件的相关文件;During the next startup of the plug-in, load the relevant files of the plug-in; 判断所述插件的相关文件中是否具有所述卸载字段信息;Determine whether the relevant file of the plug-in has 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 unload field information, the plug-in is loaded and started based on the relevant file of the plug-in. 7.如权利要求1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件,具体包括:7. The method of claim 1, wherein the deleting the plug-in and its related files based on the uninstall field information specifically comprises: 基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。Based on the system version number where the plug-in is located, the configuration file corresponding to the system version in the plug-in is deleted. 8.如权利要求7所述的方法,其特征在于,所述基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件之后,所述方法还包括:删除Native文件。8. The method according to claim 7, 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: deleting Native file. 9.如权利要求1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:9. The method according to claim 1, wherein after the plugin and its related files are deleted based on the uninstall field information, the method further comprises: 将所述卸载字段信息进行记录;recording the unloading field information; 删除所述卸载字段信息。Delete the uninstall field information. 10.如权利要求1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:10. The method of claim 1, wherein after deleting the plug-in and its related files based on the uninstall field information, the method further comprises: 向各进程发送广播通知,同步所述插件最新状态给各进程。A broadcast notification is sent to each process, and the latest state of the plug-in is synchronized to each process. 11.如权利要求1所述的方法,其特征在于,所述基于所述卸载字段信息删除所述插件及其相关文件之后,所述方法还包括:11. The method of claim 1, wherein after deleting the plug-in and its related files based on the uninstall field information, the method further comprises: 更新所述插件所在进程的内存表信息。Update the memory table information of the process where the plug-in is located. 12.一种电子终端,其特征在于,包括:12. An electronic terminal, characterized in that, comprising: 查询模块,用于基于用户的卸载一应用程序中的插件的卸载请求,查询所述插件的当前状态;a query module, configured to query the current state of the plug-in based on a user's uninstall request for uninstalling a plug-in in an application; 添加模块,用于若查询到所述插件的当前状态为运行状态,则在所述插件中添加一卸载字段信息,所述卸载字段信息用于标识所述插件处于待卸载状态;An adding module, configured to add an uninstall field information to the plug-in if the current state of the plug-in is found to be the running state, where 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 uninstall field information during the next startup of the plug-in. 13.如权利要求12所述的电子终端,其特征在于,所述查询所述插件的当前状态,具体包括:13. The electronic terminal according to claim 12, 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. 14.如权利要求12所述的电子终端,其特征在于,所述电子终端还包括:14. The electronic terminal of claim 12, wherein the electronic terminal further 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 judgment module is used for judging whether the plug-in information is empty; if so, it means that the plug-in is not installed; if not, it means that the plug-in information is a plug-in whose current running state is unknown. 15.如权利要求12所述的电子终端,其特征在于,所述电子终端还包括:15. The electronic terminal of claim 12, wherein the electronic terminal further comprises: 删除模块,用于若查询到所述插件的当前状态为未运行状态,则删除所述插件及其相关文件。A deletion module, configured to delete the plug-in and its related files if the current state of the plug-in is found to be a non-running state. 16.如权利要求12所述的电子终端,其特征在于,所述添加模块,具体用于将所述卸载字段信息delinfo以Json格式添加到所述应用程序的p.l文件中。16. The electronic terminal according to claim 12, wherein the adding module is specifically configured to add the unloading field information delinfo to the p.l file of the application in Json format. 17.如权利要求12所述的电子终端,其特征在于,所述卸载模块,具体包括:17. The electronic terminal according to claim 12, wherein the unloading module specifically comprises: 第一加载模块,用于在所述插件下次启动的过程中,加载所述插件的相关文件;a first loading module, used for loading the relevant files of the plug-in during the next startup of the plug-in; 第二判断模块,用于判断所述插件的相关文件中是否具有所述卸载字段信息;The second judgment module is used for judging whether the relevant file of the plug-in has the uninstall 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 relevant file of the plug-in if there is no unload field information. 18.如权利要求12所述的电子终端,其特征在于,所述卸载模块,具体用于基于所述插件所在的系统版本号,删除所述插件中和所述系统版本对应的配置文件。18 . The electronic terminal according to claim 12 , wherein the uninstallation module is specifically configured to delete a configuration file corresponding to the system version in the plug-in based on the system version number where the plug-in is located. 19 . 19.如权利要求18所述的电子终端,其特征在于,所述卸载模块,还用于删除Native文件。19. The electronic terminal according to claim 18, wherein the uninstallation module is further configured to delete Native files. 20.如权利要求12所述的电子终端,其特征在于,所述电子终端还包括:20. The electronic terminal of claim 12, wherein the electronic terminal further comprises: 记录模块,用于将所述卸载字段信息进行记录;a recording module for recording the unloading field information; 第二删除模块,用于删除所述卸载字段信息。The second deletion module is configured to delete the uninstall field information. 21.如权利要求12所述的电子终端,其特征在于,所述电子终端还包括:同步模块,用于向各进程发送广播通知,同步所述插件最新状态给各进程。21. The electronic terminal according to claim 12, wherein the electronic terminal further comprises: a synchronization module, configured to send a broadcast notification to each process, and synchronize the latest state of the plug-in to each process. 22.如权利要求12所述的电子终端,其特征在于,所述电子终端还包括:22. The electronic terminal of claim 12, wherein the electronic terminal further comprises: 更新模块,用于更新所述插件所在进程的内存表信息。An update module, configured to update the memory table information of the process where the plug-in is located. 23.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-11 任一权项所述方法的步骤。23. 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 according to any one of claims 1-11 are implemented. 24.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1-11 任一权项所述方法的步骤。24. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements any one of claims 1-11 when executing the program the steps of the method described in 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 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
CN104346206B (en) A kind of method and system of unloaded software rejuvenation installation
CN109710324B (en) Processing method and device for blue screen display, storage medium and terminal
CN103345411A (en) Method and device for uninstalling application program
CN103745158A (en) Method and device for repairing system bugs
CN103793248B (en) Method and device for upgrading application program
CN111782339A (en) Container creation method and device, electronic equipment and storage medium
CN107656776A (en) A kind of firmware update, device and the medium of FPGA accelerator cards
CN104699511A (en) Plug-in upgrading method and plug-in upgrading device
CN103186387A (en) Electronic device and method for updating its operating system
WO2021040843A1 (en) Hydration of applications
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
CN119376819B (en) Method and device for optimizing cloud application startup speed
CN108681460A (en) A method for upgrading a plug-in and an electronic terminal
CN109901849B (en) Application installation method, device, electronic device and storage medium
CN107967192B (en) A system crash processing method and device for an intelligent terminal
CN108762771B (en) Plug-in unloading method and electronic terminal
US20150089486A1 (en) Method of Firmware Upgrade
US10809996B2 (en) Method and device for creating images of different installation and download software units
CN117591163A (en) Kernel upgrading method, device, medium, chip and electronic equipment
CN106933604A (en) A kind of method for upgrading system and device
CN114047933B (en) Method, device, equipment and medium for multi-open Android application
CN114816482A (en) Upgrading method, device, computer equipment and storage medium for block storage service
CN104778091A (en) Application program operation method and device

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