Theme replacement method, electronic equipment, medium and product

By leveraging the Android system's built-in theme service and hook mechanism, the synchronous switching of themes across multiple applications is achieved, solving the problem of high development and maintenance costs in existing technologies and enabling non-intrusive application skinning.

CN121029293APending Publication Date: 2025-11-28ZEBRED NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510956095.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

In existing technologies, changing application themes requires integrating a skinning framework into each application, resulting in high development and maintenance costs and intrusion into application code.

Method used

By leveraging the theme service built into the Android system and utilizing system processes and hook mechanisms, the synchronous switching of themes across multiple applications can be achieved, avoiding intrusion into application code.

Benefits of technology

It enables synchronized switching between multiple application themes, reducing development and maintenance costs without requiring modification of application code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029293A_ABST
    Figure CN121029293A_ABST
Patent Text Reader

Abstract

The invention discloses a theme changing method, an electronic device, a medium and a product, the method is applied to an Android system, the Android system is internally provided with theme services, and the method comprises the steps that if a switching instruction for switching an application theme from a current theme to a target theme is detected, the target theme is switched from the current theme to the target theme; calling a theme service to write the theme name of the target theme into the system attribute of the Android system; performing interface restarting on the N currently running target applications through the system process; in the interface restarting process of each target application in the N target applications, calling a hook mechanism of the Android system to intercept a theme resource loading request of each target application, and reading the theme name from the system attributes to obtain a target path of a resource bundle of the target theme; and based on the target path, determining a target theme resource corresponding to each target application from a resource bundle of the target theme, and replacing the theme resource loaded by each target application with the target theme resource corresponding to each target application. Synchronous switching of multiple application themes is achieved, and the application is not invaded.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a theme replacement method, an electronic device, a medium and a product. BACKGROUND

[0002] With the increasing demand of users for interface personalization, the application theme replacement function of the electronic device, that is, the skin replacement function, has become an important factor to improve the user experience. In the related art, the replacement of the application theme usually needs to integrate a skin replacement framework in the application. On the one hand, in order to realize the skin replacement of multiple applications, the skin replacement framework needs to be integrated in each application. On the other hand, the integration of the skin replacement framework in the application needs to invade the application code, and the development, adaptation and maintenance cost of the application is high. SUMMARY

[0003] The embodiments of the present application provide a theme replacement method, an electronic device, a medium and a product, which realize the skin replacement of multiple applications without invading the application.

[0004] In a first aspect, the embodiments of the present application provide a theme replacement method applied to an Android system, wherein the Android system is built-in with a theme service, and the method comprises the following steps:

[0005] If a switching instruction of switching an application theme from a current theme to a target theme is detected, the theme service is called to write a theme name of the target theme into a system attribute of the Android system;

[0006] An interface of N target applications currently running is restarted through a system process, wherein N is a positive integer;

[0007] In the interface restarting process of each target application in the N target applications, a hook mechanism of the Android system is called to intercept a theme resource loading request of each target application, and the theme name is read from the system attribute to obtain a target path of a resource package of the target theme;

[0008] Based on the target path, target theme resources corresponding to each target application are determined from the resource package of the target theme, and theme resources loaded by each target application are replaced by the target theme resources corresponding to each target application.

[0009] In some embodiments, the interface of the N target applications currently running is restarted through the system process, which comprises:

[0010] The runtime resource covering mechanism of the Android system is called through the system process to restart the interface of the N target applications.

[0011] In some embodiments, the reading of the theme name from the system attribute to obtain the target path of the resource package of the target theme comprises:

[0012] obtaining a preset parent directory storing theme resource packages, and reading the theme name from the system attribute;

[0013] splicing the preset parent directory and the theme name to obtain the target path of the resource package of the target theme.

[0014] In some embodiments, the resource package of the target theme comprises application identifiers of M applications installed in the Android system, and resource sets corresponding to the M application identifiers, M being an integer greater than or equal to N, and the determining of the target theme resource corresponding to each target application from the resource package of the target theme and the replacing of the theme resource loaded by each target application with the target theme resource corresponding to each target application comprise:

[0015] for each target application, determining the target resource set corresponding to the application identifier of the target application from the resource package of the target theme based on the application identifier of the target application;

[0016] for each target application, determining the target resource identifier of the replacement resource from the target resource set corresponding to the target application;

[0017] for each target application, replacing the resource identifier of the theme resource loaded by the target application with the target resource identifier corresponding to the target application based on the theme resource loading request of the target application.

[0018] In some embodiments, the method further comprises:

[0019] if a starting operation for a theme management application is detected, requesting a cloud end for providing theme resources to obtain a latest theme list, wherein the theme management application is installed in the Android system;

[0020] receiving the latest theme list fed back by the cloud end, and displaying the latest theme list in a first display area of the theme management application.

[0021] In some embodiments, a second display area of the theme management application displays a local theme list, and the resource packages of the themes contained in the local theme list are all stored locally, and the method further comprises:

[0022] if a switching operation for a first theme in the latest theme list or the local theme list is detected, taking the first theme as the target theme, and generating the switching instruction, wherein the first theme is different from the current theme.

[0023] In some embodiments, the method further comprises:

[0024] if a download operation for a second topic in the latest topic list is detected, initiating a resource package download request for the second topic to the cloud;

[0025] receiving the resource package of the second topic sent by the cloud, recording a storage path of the resource package of the second topic, and adding the second topic to the local topic list.

[0026] In some embodiments, the method further comprises:

[0027] if a deletion operation for a third topic in the local topic list is detected, deleting the resource package of the third topic based on a storage path of the resource package of the third topic, and deleting the third topic from the local topic list.

[0028] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the topic replacement method when executing the program.

[0029] In a third aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, wherein the program is executed by a processor to implement the steps in the topic replacement method.

[0030] In a fourth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program, wherein the computer program is executed by a processor to load and execute the steps in the topic replacement method.

[0031] The one or at least one technical solutions in the embodiments of the present application have at least the following technical effects:

[0032] The subject replacement scheme provided by the embodiment of the present specification is applied to an Android system, the Android system is built-in with a theme service, if a switching instruction of switching an application theme from a current theme to a target theme is detected, the theme service is called to write a theme name of the target theme into a system attribute of the Android system, an interface of N target applications currently running is restarted through a system process, N is a positive integer; in the interface restarting process of each target application in the N target applications, a hook mechanism of the Android system is called to intercept a theme resource loading request of each target application, a target path is read from the system attribute; based on the target path, target theme resources corresponding to each target application are determined from a resource package of the target theme, and theme resources loaded by each target application are replaced by the target theme resources corresponding to each target application. The scheme can realize synchronous switching of multi-application themes, and since the scheme realizes theme resource management through an Android system service, the code of each application does not need to be modified, and application skinning is realized without application invasion. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 A flowchart of a theme replacement method provided by the embodiment of the present specification;

[0034] Figure 2 An architecture schematic diagram of an Android system provided by the embodiment of the present specification;

[0035] Figure 3 A schematic diagram of an electronic device provided by the embodiment of the present specification. DETAILED DESCRIPTION

[0036] The technical scheme of the embodiment of the present application has the following general idea: if a switching instruction of switching an application theme from a current theme to a target theme is detected, the theme service is called to write a theme name of the target theme into a system attribute of the Android system; an interface of N target applications currently running is restarted through a system process, N is a positive integer; in the interface restarting process of each target application in the N target applications, the hook mechanism of the Android system is called to intercept a theme resource loading request of each target application, and the theme name is read from the system attribute to obtain a target path of a resource package of the target theme; based on the target path, target theme resources corresponding to each target application are determined from the resource package of the target theme, and theme resources loaded by each target application are replaced by the target theme resources corresponding to each target application.

[0037] In the embodiment of the present specification, synchronous switching of multi-application themes can be realized, and since the scheme of the present application realizes theme resource management through an Android system service, the code of each application does not need to be modified, and application skinning is realized without application invasion.

[0038] To better understand the above technical solutions, the technical solutions of the embodiments of this specification will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of this specification and the specific features in the embodiments are detailed descriptions of the technical solutions of the embodiments of this specification, rather than limitations on the technical solutions of this specification. Unless otherwise specified, the embodiments of this specification and the technical features in the embodiments can be combined with each other.

[0039] First, it should be clarified that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0040] like Figure 1 The diagram shown is a flowchart of a theme changing method provided in an embodiment of this specification. This method is applied to an Android system, which has a built-in theme service. The method includes the following steps:

[0041] Step S101: If a switching instruction to switch the application theme from the current theme to the target theme is detected, the theme service is invoked to write the theme name of the target theme into the system properties of the Android system;

[0042] Step S102: Restart the interface of the N currently running target applications through the system process, where N is a positive integer;

[0043] Step S103: During the interface restart process of each of the N target applications, the hook mechanism of the Android system is invoked to intercept the theme resource loading request of each target application, and the theme name is read from the system properties to obtain the target path of the resource package of the target theme.

[0044] Step S104: Based on the target path, determine the target theme resources corresponding to each target application from the resource package of the target theme, and replace the theme resources loaded by each target application with the target theme resources corresponding to each target application.

[0045] The methods provided in the embodiments of this specification can be applied to electronic devices, such as user terminal devices like mobile phones, tablets, and smartwatches, and can also be applied to in-vehicle systems. All of the above electronic devices operate on the Android system.

[0046] In the examples provided in this manual, the Android system may have a built-in theme service. Specifically, the theme service can be a service developed based on the Android system framework and built into the Android system. As a system-level service, the theme service can provide the ability to switch themes, including but not limited to theme resource management, theme resource loading, and theme status maintenance. In some embodiments, the theme service can run in the background for a long time, unaffected by the lifecycle of ordinary applications.

[0047] like Figure 2 The diagram shown is an architectural representation of an Android system provided in an embodiment of this specification. For ease of explanation, an in-vehicle infotainment system is used as an example. The in-vehicle infotainment system is an Android system, and it can interact with the cloud, which can provide various themed resources. Figure 2 As shown, the Android system may include a theme management application, a system framework layer, and N target applications installed, where N is a positive integer. The theme management application includes a theme management module (ThemeManager) used to coordinate the cloud, the theme management application, and the system framework layer. The theme management application serves as the entry point for user interaction with the vehicle's infotainment system themes, providing a graphical interface for browsing, downloading, switching, and deleting themes. When a user triggers a theme-related operation, these operation requests are forwarded to the ThemeManager for processing. In some embodiments, the theme management application may be a theme store app. In the embodiments described in this specification, the underlying implementation details are hidden during user interaction, enabling users to intuitively and conveniently manage the themes of the vehicle's infotainment system.

[0048] The system framework layer provides several services, including the ThemeService, as well as underlying technical support. It's worth noting that the ThemeService starts automatically when the Android system boots up, receiving theme-related instructions from the theme management application. For example... Figure 2 As shown, the system framework layer also includes a context, resources, and resources implementation classes (Resourceslmpl). Context represents the application's runtime environment, Resources manages various application resources, and Resourceslmpl provides concrete implementation classes for resource replacement; both resource searching and replacement can be implemented through Resourceslmpl.

[0049] The target application can be an application installed on the Android system, such as a navigation application, music player application, video player application, settings application, etc. The theme of the target application can be changed using the theme changing method provided in the embodiments of this specification. It should be noted that this solution is a global theme switch for the Android system; therefore, for each target application on the Android system, the theme changing method provided in the embodiments of this specification needs to be executed to ensure a consistent visual style across the Android system.

[0050] The following describes the method for changing the subject provided in the embodiments of this specification.

[0051] In step S101, the switching instruction can be triggered in various ways. In some embodiments, the switching instruction can be triggered by the user's operation on the theme management application. For example, the theme management application may display a theme list. When the user selects a target theme that is different from the current theme from the theme list, a theme switching request is generated. Furthermore, a switching instruction is generated in response to the theme switching request.

[0052] In other embodiments, the application's theme may include multiple modes, such as a day mode and a night mode, with day mode used from 6:00 to 23:00 and night mode used from 23:00 to 6:00. When the day / night mode changes, the system service will also restart the target application to load the theme resources corresponding to the current mode.

[0053] For ease of explanation, Figure 2 Taking the system architecture as an example, when a user selects the target theme to switch to through the theme management application, a theme switching request is triggered. After receiving the switching request, ThemeManager sends a switching instruction and the theme name of the target theme to ThemeService. ThemeService dynamically injects the theme name of the target theme into the system properties (SystemProperties) based on the switching instruction.

[0054] In some embodiments, the cloud can be responsible for storing, managing, and distributing all available theme resource packages. When a user selects a target theme, if the resource package for that target theme is not stored locally, the user can initiate a download request for the resource package from the cloud. Upon receiving the download request, the cloud transmits the resource package for the target theme to the electronic device (such as an in-vehicle infotainment system). The electronic device can then store the resource package for the target theme locally and record its storage path. It should be noted that the storage path for the resource package for the target theme can be pre-set or user-specified; this is not limited here.

[0055] Upon detecting a switching command, the target theme's theme name is sent to the theme service, which then writes the target theme's theme name into the system properties. The theme name can be used to obtain the target path of the target theme's resource package. Based on the theme name in the system properties, the global resource loading path can be set at the system level.

[0056] The solution in the embodiments of this specification can provide synchronous switching of themes for multiple applications. In step S102, after a switching instruction is detected, the interface of the currently running N target applications is restarted through system process control, where N is a positive integer.

[0057] It should be noted that, taking an electronic device as an example, a vehicle infotainment system can have multiple target applications installed. Some target applications are currently running, while others may not be running. For target applications that are currently running, the theme needs to be changed in real time after the user performs a theme switching operation. For target applications that are not running, the theme can be changed the next time they are launched.

[0058] In some embodiments, step S102 can be implemented by the following steps: The system process invokes the runtime resource overlay mechanism of the Android system to restart the interfaces of the N target applications. Specifically, the Android system provides an RRO (Runtime Resource Overlay) mechanism. After detecting a switching instruction, the system process can invoke the RRO mechanism to restart the Activity of each of the N target applications.

[0059] In step S103, during the interface restart process of each target application, the theme resources of the application are accessed through the Context. At this time, the hook mechanism of the Android system can be called to intercept the theme resource loading request of each target application and replace the theme resource loading path with the target path of the target theme's resource package, thereby loading the corresponding resources from the target theme's resource package.

[0060] In some embodiments, the target path of the resource package of the target theme can be obtained through the following steps: obtaining a preset parent directory for storing the theme resource package, and reading the theme name from the system properties; concatenating the preset parent directory with the theme name to obtain the target path of the resource package of the target theme.

[0061] Specifically, for theme resource packages downloaded from the cloud, their storage path can be fixed. That is, each time a theme resource package is downloaded from the cloud, it will be placed in the corresponding fixed path. In some embodiments, the path of each theme resource package is a fixed parent directory plus the theme name. The parent directory can be preset and can be set according to actual needs. There is no limitation here.

[0062] When a switching command for the target theme is detected, the theme name of the target theme is written into the system properties. When obtaining the path of the resource package of the target theme, it is only necessary to concatenate the fixed preset parent directory and the theme name read from the system properties to obtain the target path of the resource package of the target theme.

[0063] In step S104, the resource package of the target theme includes resources from multiple target applications. For example, if there are 3 target applications, the resource package of the target theme includes resources corresponding to the 3 target applications. For instance, if the 3 target applications are application 1, application 2, and application 3, and the target theme is a Christmas theme, then the resource package of the Christmas theme can include resources from application 1, application 2, and application 3. Specifically, the resources for target application 1 include image 1 and text 1 under the Christmas theme; the resources for target application 2 include image 2 and text 2 under the Christmas theme; and the resources for target application 3 include image 3 and text 3 under the Christmas theme. After the theme resource loading requests of N target applications are intercepted, the resource package of the target theme is determined through the target path. Then, for each target application, its respective resources are determined from the resource package of the target theme.

[0064] It should be noted that each theme resource pack can be set with a unique identifier, such as a theme ID and version number, which supports dynamic updates and version management.

[0065] In some embodiments, the resource package of the target theme includes application identifiers of M applications installed in the Android system, and resource sets corresponding to the M application identifiers. Then, step S104 can be implemented by the following steps: for each target application, based on the application identifier of the target application, determine the target resource set corresponding to the application identifier of the target application from the resource package of the target theme; for each target application, determine the target resource identifier for the replacement resource from the target resource set corresponding to the target application; for each target application, based on the theme resource loading request of the target application, replace the resource identifier of the theme resource loaded by the target application with the target resource identifier corresponding to the target application.

[0066] Specifically, taking an in-vehicle infotainment system as an example, to ensure a consistent theme across all applications within the system, the target theme's resource package can include resources from all applications within the system. If M applications are installed, the target theme's resource package should include application identifiers for each of those M applications, as well as a resource set corresponding to each application identifier. The application identifier can be the application's package name or other parameters; there are no restrictions here. Each resource set can include, but is not limited to, background images, text styles, and color schemes.

[0067] Since N target applications are currently running applications, the value of N is less than or equal to M. To better understand the theme resource replacement process of the target applications, we will use application 1 as the target application and Christmas theme as the target theme for explanation. Specifically, the application identifier of the target application can be represented by the application's package name. If the package name of application 1 is 'a', after intercepting the theme loading request of application 1 based on the Hook mechanism, the storage location of the Christmas theme's resource package is found through the target path. In some embodiments, the resource package of the target theme can be filtered by the theme name of the target theme. For example, if the name of the Christmas theme is "Christmas", the resource package of the Christmas theme is determined by "Christmas" under the target path. Furthermore, since the resource package contains resource sets of multiple target applications, the resource set under package name 'a' can be determined from the resource sets of multiple target applications using the identifier of application 1 as the target resource set. It should be noted that each resource has its own resource identifier. When switching themes, the resource identifier in the theme resource loading request of application 1 is replaced with the target resource identifier in the target resource set. In this way, the application theme switching is completed.

[0068] In this embodiment, the target path is obtained by writing the theme name of the target theme in the system properties, thus realizing a unified theme resource path setting. Based on Hooking at the system level, themes of multiple target applications can be switched synchronously. Theme resources are replaced without modifying the target application code, reducing development and maintenance costs.

[0069] To explain the application theme management in this manual, the following section provides further information on downloading, deleting, and switching application themes.

[0070] In some embodiments, if a launch operation for a theme management application is detected, a request is made to the cloud for providing theme resources to obtain the latest theme list, wherein the theme management application is installed in the Android system; the latest theme list is received from the cloud and displayed in the first display area of ​​the theme management application.

[0071] Continue Figure 2 In this architecture, when a user launches the theme management application, the application can send a request to the cloud for the latest theme list via ThemeManager. Upon receiving the request, the cloud returns the latest theme list to the theme management application, which can then display the latest theme list in the primary display area for the user to browse.

[0072] It should be noted that the first display area can be any area of ​​the theme management application interface. For example, the first display area can be located on the left side of the application interface or at the top of the application interface. There are no restrictions here.

[0073] In some embodiments, a local theme list is displayed in the second display area of ​​the theme management application. The resource packages of the themes included in the local theme list are all stored locally. If a switching operation is detected for the latest theme list or the first theme in the local theme list, the first theme is taken as the target theme, and the switching instruction is generated. The first theme is different from the current theme.

[0074] Specifically, the second display area can be any area of ​​the theme management application interface. For example, the theme management application interface includes a bottom navigation bar with multiple tabs, each corresponding to its own page. The tabs corresponding to the first and second display areas can be different. For example, the first display area might be labeled "Label 1," and the second display area might be labeled "Label 2." When the user selects "Label 2," the local theme list can be displayed in the second display area; when the user selects "Label 1," the latest theme list can be displayed in the first display area. The themes included in the local theme list are all themes whose resource packages have been downloaded locally.

[0075] When a user browses the local theme list or the latest theme list, if they select a first theme that is different from the current theme, they can use that first theme as the target theme to perform the theme switching process described above. In some embodiments, when the user selects the first theme, a prompt box can appear asking the user whether they want to switch the current theme to the first theme. The theme switching steps will only be performed after the user confirms the theme switching.

[0076] In some embodiments, if a download operation for a second topic in the latest topic list is detected, a resource package download request for the second topic is initiated to the cloud; the resource package for the second topic is received from the cloud, the storage path of the resource package for the second topic is recorded, and the second topic is added to the local topic list.

[0077] Specifically, when a user selects the second theme in the latest themes list, the download process for the second theme can be triggered directly. This second theme is one that is not saved locally. Alternatively, when a user selects the second theme in the latest themes list, a prompt can appear asking the user whether to download the second theme, and the download process will only proceed after the user confirms.

[0078] Continue Figure 2 In this architecture, upon detecting a download operation for a second theme, ThemeManager can send a download request for the resource package of that second theme to the cloud. Upon receiving the download request, the cloud transmits the resource package of the second theme to the electronic device (such as an in-vehicle infotainment system). After the resource package is downloaded, it is stored, and the storage path is recorded. The resource package can be stored in a local preset directory or a user-defined destination; there are no restrictions. Furthermore, the resource package can be encrypted before storage.

[0079] In some embodiments, if a deletion operation is detected for a third topic in the local topic list, the resource package of the third topic is deleted based on the storage path of the resource package of the third topic, and the third topic is removed from the local topic list.

[0080] Specifically, deleting a third theme can be implemented in several ways. For example, long-pressing a third theme in the local theme list can trigger the deletion. Alternatively, selecting a third theme in the local theme list can bring up a prompt asking the user if they want to delete the theme; if the user confirms, the deletion will proceed. When a deletion operation for a third theme is detected, the storage path of the third theme's resource package can be used to locate the locally stored resource package and delete it, freeing up storage space. After deleting the third theme's resource package, the local theme list is updated, removing the third theme from the list to ensure it is up-to-date.

[0081] To better understand the topic switching process in the embodiments of this specification, the following uses a vehicle-mounted system as an example. Figure 2The following explanation uses the system architecture as an example. When a user browses the latest theme list or the local theme list, they trigger a switching request by selecting a target theme different from the current theme. Upon receiving the switching request, ThemeManager sends a switching instruction and the target theme's resource information (including the theme name, the target path of the target theme's resource package, etc.) to ThemeService. ThemeService dynamically sets the target theme's resource path based on the switching instruction and the target theme's resource information. Further, it invokes the system's RRO mechanism to control the target application to restart its interface, accesses the target application's own Resources through Context, invokes the system's Hook mechanism to intercept the target application's resource loading process, replaces resource acquisition methods such as "getDrawable" and "getColor" with custom implementations, retrieves the theme name from system properties to obtain the target path of the target theme's resource package, and loads specific resource values ​​based on the target path, thereby completing the theme switching of the target application.

[0082] The solution in the embodiments of this specification, since the path setting and resource interception and replacement of the target theme's resource package are at the system level, can cover all applications within the target theme's resource package. Therefore, it can achieve synchronous theme switching of multiple applications and ensure that the visual style of the entire system remains consistent.

[0083] Based on the same inventive concept, embodiments of the present invention also provide an electronic device, such as... Figure 3 The device includes a memory 304, a processor 302, and a computer program stored in the memory 304 and executable on the processor 302. When the processor 302 executes the program, it implements any of the above-described methods for changing the subject. In some embodiments, the electronic device may be a vehicle-mounted system.

[0084] Among them, Figure 3 In this document, a bus architecture (represented by bus 300) is used. Bus 300 may include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 302 and memory represented by memory 304. Bus 300 may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 305 provides an interface between bus 300 and receiver 301 and transmitter 303. Receiver 301 and transmitter 303 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 302 is responsible for managing bus 300 and general processing, while memory 304 can be used to store data used by processor 302 during operation.

[0085] Based on the same inventive concept, embodiments of this specification provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described subject replacement method.

[0086] Based on the same inventive concept, embodiments of this specification provide a computer program product, which includes a computer program that, when executed by a processor, is used to load and execute the above-described subject replacement method steps.

[0087] The functions described herein can be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions can be stored as one or more instructions or codes on or transmitted via a computer-readable medium. Other examples and embodiments are within the scope and spirit of this invention and the appended claims. For example, due to the nature of software, the functions described above can be implemented using software executed by a processor, hardware, firmware, hardwired, or any combination thereof. Furthermore, the functional units can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit.

[0088] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0089] The units described as separate components may or may not be physically separate. Similarly, the components of the control device may or may not be physical units; they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0090] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0091] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A method for changing a theme, characterized in that, Applied to an Android system, which has a built-in theme service, the method includes: If a switching instruction to change the application theme from the current theme to the target theme is detected, the theme service is invoked to write the theme name of the target theme into the system properties of the Android system; The system process restarts the interface of N currently running target applications, where N is a positive integer; During the interface restart process of each of the N target applications, the hook mechanism of the Android system is invoked to intercept the theme resource loading request of each target application, and the theme name is read from the system properties to obtain the target path of the resource package of the target theme; Based on the target path, target theme resources corresponding to each target application are determined from the resource package of the target theme, and the theme resources loaded by each target application are replaced with the target theme resources corresponding to each target application.

2. The method as described in claim 1, characterized in that, The method of restarting the interface of N currently running target applications through system processes includes: The system process invokes the runtime resource overwrite mechanism of the Android system to restart the interfaces of the N target applications.

3. The method as described in claim 1, characterized in that, The step of reading the theme name from the system attributes to obtain the target path of the resource package for the target theme includes: Obtain the preset parent directory for storing theme resource packages, and read the theme name from the system properties; The target path of the resource package of the target theme is obtained by concatenating the preset parent directory with the theme name.

4. The method as described in claim 1, characterized in that, The resource package of the target theme includes application identifiers of M applications installed in the Android system, and resource sets corresponding to the M application identifiers, where M is an integer greater than or equal to N. The step of determining the target theme resource corresponding to each target application from the resource package of the target theme, and replacing the theme resource loaded by each target application with the target theme resource corresponding to each target application, includes: For each target application, based on the application identifier of the target application, a set of target resources corresponding to the application identifier of the target application is determined from the resource package of the target topic; For each target application, the target resource identifier for the replacement resource is determined from the target resource set corresponding to that target application; For each target application, based on the theme resource loading request of that target application, the resource identifier of the theme resource loaded by that target application is replaced with the target resource identifier corresponding to that target application.

5. The method as described in claim 1, characterized in that, The method further includes: If a startup operation for the theme management application is detected, a request is made to the cloud that provides theme resources to obtain the latest theme list, wherein the theme management application is installed in the Android system; Receive the latest topic list from the cloud and display the latest topic list in the first display area of ​​the topic management application.

6. The method as described in claim 5, characterized in that, The second display area of ​​the theme management application displays a list of local themes, and the resource packages of the themes included in the local theme list are all stored locally. The method further includes: If a switching operation is detected for the first topic in the latest topic list or the local topic list, the first topic is taken as the target topic, and the switching instruction is generated, wherein the first topic is different from the current topic.

7. The method as described in claim 6, characterized in that, The method further includes: If a download operation for the second topic in the latest topic list is detected, a resource package download request for the second topic is initiated to the cloud. The system receives the resource package of the second topic sent from the cloud, records the storage path of the resource package of the second topic, and adds the second topic to the local topic list.

8. The method as described in claim 6, characterized in that, The method further includes: If a deletion operation is detected for the third topic in the local topic list, the resource package of the third topic is deleted based on the storage path of the resource package of the third topic, and the third topic is removed from the local topic list.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-8.

11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, is used to load and perform the method as described in any one of claims 1-8.