Application theme replacement method and device, electronic equipment and readable storage medium

By allowing users to provide theme resource file packages and compile them into installation package format, signature verification is bypassed, and flexible replacement of electronic device application themes is achieved, which solves the limitations of theme APK downloads in existing technologies and improves user experience and theme replacement efficiency.

CN120704682APending Publication Date: 2025-09-26GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510684583.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the prior art, changing the application theme of an electronic device requires downloading a specific theme APK from the official electronic mall, which lacks flexibility and is difficult to meet the personalized needs and unique aesthetics of users, especially the application of custom design elements.

Method used

Provides an application theme replacement method that allows users to provide their own theme resource file package, compile it into an installation package format through the extended Android resource packaging tool, bypass the signature verification process, and directly register with the overlay management service to replace the application theme.

Benefits of technology

Users can independently design personalized themes, simplify the operation process, reduce system memory and disk usage, improve the speed and flexibility of theme change, and meet users' unique aesthetic needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704682A_ABST
    Figure CN120704682A_ABST
Patent Text Reader

Abstract

The invention provides an application theme replacement method and device, electronic equipment and a computer readable storage medium, and relates to the field of electronic equipment.The method comprises the steps that in response to a theme replacement instruction of a target application, a first file package including a theme resource file is obtained; if the file format of the first file package is a preset format, the first file package is compiled into an installation package format, a second file package is obtained, and the preset format comprises formats except the installation package format; and replacing the theme of the target application by adopting the second file package. The theme of the application can be replaced according to the theme resource provided by the user, so that the user can design the theme of the application by himself / herself, and the use experience of the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic devices, and more particularly, to an application theme replacement method, device, electronic device, and computer-readable storage medium in the field of electronic devices. Background Art

[0002] Currently, when changing themes of applications installed on electronic devices, users are usually required to download specific theme APKs (Android Application Packages) from official e-commerce stores. This approach limits users' personalized choices and creative expression. This mechanism not only lacks flexibility, but also cannot meet the unique aesthetic needs or functional preferences of all users. Due to the limited number and styles of officially provided theme APKs, users often find it difficult to find a theme APK that fully meets their personal preferences or accurately reflects their personal style. In addition, for users who want to use custom design elements, color schemes, or patterns with special meaning (such as personal photos, artistic creations, etc.) as interface backgrounds, existing solutions are far from satisfactory. Therefore, how to achieve the replacement of application themes based on the theme resources provided by users has become an urgent problem that needs to be solved. Summary of the Invention

[0003] The embodiments of the present application provide an application theme changing method, device, electronic device and computer-readable storage medium. The embodiments of the present application can change the theme of the application based on the theme resources provided by the user, enabling users to design their own application themes, which is conducive to improving the user experience.

[0004] In a first aspect, a method for changing an application theme is provided, which includes: in response to a theme change instruction of a target application, obtaining a first file package including a theme resource file; if the file format of the first file package is a preset format, compiling the first file package into an installation package format to obtain a second file package, and the preset format includes formats other than the installation package format; and using the second file package to replace the theme of the target application.

[0005] This application can compile the file package provided by the user, including the theme resource file, into a file package in the installation package format, and then use the compiled file package in the installation package format to replace the theme of the application. From the user's perspective, the user can design themes for the application by himself, allowing the user to independently design and apply personalized themes without professional skills, so that the user can decide the theme of his own electronic device, which helps to improve the user experience.

[0006] In one possible implementation method, the first file package is compiled into an installation package format to obtain a second file package, including: obtaining the theme resource file in the first file package; loading the theme resource file into the memory, and compiling the theme resource file in the memory into a resource mapping file; constructing a third file package, the third file package has the data structure of the installation package; saving the resource mapping file to the designated directory of the third file package to obtain the second file package.

[0007] In one possible implementation, compiling the theme resource files in memory into a resource mapping file includes using an extended Android resource packaging tool to compile the theme resource files in memory into a resource mapping file. The resource mapping file dynamically generated by the extended Android resource packaging tool (i.e., the extended libaapt2_jni.so) is an independent file that does not rely on signature verification. This means that theme resources can be loaded dynamically without installing the entire theme APK, making it suitable for application scenarios that require frequent theme changes.

[0008] In one possible implementation, the application theme changing method also includes: displaying a first creation interface of the first file package, the first creation interface including an adding area for resource files; obtaining a theme resource file in response to a resource adding operation in the adding area, the file name of the theme resource file is the same as the file name of the resource file in the current theme installation package, and the current theme installation package is a theme installation package corresponding to the current application theme of the target application; generating an Android manifest file, the Android manifest file including a first priority of the first file package and an application name of the target application, the first priority being higher than the second priority of the current theme installation package; generating a first file package in a compressed file format based on the theme resource file and the Android manifest file.

[0009] For the above-mentioned method of creating the first file package, the user only needs to upload the theme resource file. The subsequent process of generating the first file package is fully automated and does not require the user to perform additional manual configuration. This creation method not only greatly simplifies the operation process and improves the degree of automation, but also reduces the requirements for user skills, making it convenient for ordinary users to quickly create new theme packages according to their preferences. It is especially suitable for scenarios where theme resource packages need to be created frequently.

[0010] In one possible implementation, the application theme changing method also includes: displaying a second creation interface of the first file package, the second creation interface including a resource file adding area, an Android manifest file configuration area, a first prompt message and a second prompt message, the first prompt message is used to prompt the user that the file name of the resource file added is consistent with the file name of the resource file in the current theme installation package, and the current theme installation package is the theme installation package corresponding to the current application theme of the target application, the second prompt message is used to prompt the user that the first priority of the first file package in the configured Android manifest file is higher than the second priority of the current theme installation package, and the application name to be set in the Android manifest file is consistent with the application name of the target application; in response to the resource adding operation in the adding area, a theme resource file is obtained; in response to the file name setting operation of the theme resource file, the file name of the theme resource file is set; in response to the file configuration operation in the configuration area, an Android manifest file is generated; based on the theme resource file and the Android manifest file, a first file package with a compressed file format is generated.

[0011] The above-mentioned method of creating the first file package is a method of guiding users to manually participate in the creation process. On the one hand, users can easily create new theme packages according to their actual needs in a visual interface, and the creation process is simple and easy to operate, which is particularly suitable for scenarios where theme resource packages need to be created frequently, and provides convenience for users to design their favorite themes. On the other hand, this creation method can effectively ensure that the generated first file package has higher accuracy and reliability by prompting users to set the file name of the theme resource file and the Android manifest file. If any abnormality occurs during the use of the first file package, it is also convenient for users to make manual adjustments and repairs in time.

[0012] In one possible implementation, after compiling the first file package into an installation package format to obtain the second file package, the application theme replacement method also includes: setting a file identifier for the second file package, the file identifier being used to indicate that the second file package is generated through the first file package; using the second file package to replace the theme of the target application includes: determining whether the second file package has a file identifier; if the second file package has a file identifier, registering the second file package to the overlay management service, so that the overlay management service replaces the theme of the target application based on the second file package.

[0013] Before using the second file package to replace the theme of the target application, determine whether the second file package has a file identifier. If the second file package has a file identifier, register the second file package to the overlay management service, so that the overlay management service can replace the theme of the target application based on the second file package. This solves the problem that when the installation process of the real theme APK is used to process the second file package that does not include a signature file, the second file package cannot pass the signature verification link, bypasses the signature verification link in the installation process of the real theme APK, and ensures that the second file package can successfully achieve the replacement of the application theme of the target application. By bypassing the signature verification link in the installation process of the real theme APK, the system can quickly apply the resources in the second file package, which not only reduces the system's memory usage, but also reduces disk space usage, and also reduces resource loading time, which is conducive to speeding up the switching speed of application themes.

[0014] In one possible implementation, after obtaining the first file package including the theme resource file, the application theme replacement method further includes: if the file format of the first file package is an installation package format, performing security verification on the first file package; if the security verification of the first file package passes, installing the first file package; when the first file package is installed, performing consistency verification on the signature of the first file package; if the consistency verification of the signature passes, registering the first file package to the overlay management service, so that the overlay management service replaces the theme of the target application based on the first file package. This not only supports replacing the application theme based on a file package with a preset file format and including a theme resource file, but also supports replacing the application theme based on a real theme APK, which not only improves the flexibility of application theme replacement, but also ensures the reliability of application theme replacement.

[0015] In a second aspect, a device for changing an application theme is provided, the device comprising:

[0016] An acquisition module, configured to acquire a first file package including a theme resource file in response to a theme change instruction of a target application;

[0017] a compiling module configured to compile the first file package into an installation package format to obtain a second file package if the file format of the first file package is a preset format, wherein the preset format includes a format other than the installation package format;

[0018] The theme replacement module is used to replace the theme of the target application using the second file package.

[0019] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is configured to store executable program code, and the processor is configured to retrieve and execute the executable program code from the memory, so that the electronic device executes the application theme replacement method described in the first aspect or any possible implementation of the first aspect.

[0020] In a fourth aspect, a computer program product is provided, which includes: computer program code, which, when running on a computer, enables the computer to execute the application theme replacement method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0021] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the application theme replacement method in the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 An exemplary schematic flow chart of a method for changing an application theme provided in an embodiment of the present application is shown;

[0023] Figure 2 A schematic diagram of creating a first file package provided in an embodiment of the present application is shown;

[0024] Figure 3 The following figure shows the construction flow chart of the ZIP package including the theme resource file and the real theme APK provided by this application;

[0025] Figure 4 Another exemplary schematic flow chart of a method for changing an application theme provided in an embodiment of the present application is shown;

[0026] Figure 5 A schematic diagram of the structure of an application theme replacement device provided in an embodiment of the present application is shown;

[0027] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0028] The following will clearly and thoroughly describe the technical solutions in this application in conjunction with the accompanying drawings. In the description of the embodiments of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more than two.

[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0030] With the continuous innovation and development of electronic devices, people have higher and higher requirements for the intelligence and user experience of electronic devices, and personalized requirements are gradually being reflected. The demand for personalized settings of device visual effects is becoming increasingly significant, which has promoted the vigorous development of application theme replacement functions in recent years. The application theme replacement function reflects personalized differences by changing the wallpaper, icons, and overall display style of the mobile device system. On the one hand, it reflects unique personality, and on the other hand, it can provide emotional value. It has been widely popular in the market in recent years. The application theme replacement solution of the Android system has undergone a long period of development, from the initial preset theme switching to the Android system supporting dynamic application theme replacement solutions. At present, the most popular application among various device manufacturers is the RRO (Runtime Resource Overlay) solution supported by the Android system.

[0031] The RRO solution can change the resource values ​​of the target software package while the system is running. It works by mapping the resources defined in the Overlay software package to the resources defined in the target software package. When the application tries to parse the value of the resource in the target software package, the system will return the value of the Overlay resource to which the target resource is mapped. The key steps include: first installing and registering the theme APK, then mapping the resources in the OMS (Overlay Manager Service), and dynamically replacing the resources when the target process resources are loaded. To achieve application theme replacement, the theme resources to be replaced need to be packaged and signed in the form of a regular APP (Application). Then, when the system applies the theme, the theme APK will be installed, the signature will be verified, and the priority of the theme APK will be set.

[0032] Currently, all major manufacturers have designers create theme resources, which are then stored in an agreed-upon directory format. Using manufacturer-provided tools, these resources are packaged into theme APKs corresponding to the package names of each module and signed. The theme APKs for each module are then combined and packaged into a compressed package, which is then listed on the Theme Store or other portals. Users can then select and apply them, achieving the effect of replacing themes for multiple modules on the device. The signature of this theme APK must be consistent with the signature of the app for the module to be replaced. Therefore, the theme APKs available for users to browse, download, and apply on the Theme Store are all signed and certified by the official device store channels and can only be used after being listed on the Theme Store.

[0033] It can be seen that if users need to change the theme of an application installed on an electronic device, they must download a specific theme APK from the official e-commerce store, which limits the user's personalized choices and creative expression. This mechanism not only lacks flexibility, but also cannot meet the unique aesthetic needs or functional preferences of all users. Due to the limited number and styles of theme APKs provided by the official, users often find it difficult to find a theme APK that fully meets their personal preferences or accurately reflects their personal style. In addition, for those users who want to use custom design elements, color schemes, or patterns with special meaning (such as personal photos, artistic creations, etc.) as application themes, the existing solutions are far from satisfactory. Therefore, the solution of downloading a specific theme APK from the official e-commerce store has certain limitations and it is difficult to meet the application theme change needs of each user.

[0034] Based on the above problems, the embodiments of the present application provide an application theme replacement method, apparatus, electronic device, and computer-readable storage medium. The application theme replacement method provided by the present application can achieve application theme replacement without downloading a specific theme APK from the official e-commerce store. Before changing the application theme, the user needs to provide a file package containing the theme resources of their preference. After the user triggers the application theme replacement operation, the system automatically compiles the file package containing the theme resources into a virtual theme APK. When processing the virtual theme APK, the system bypasses the installation process and signature verification process of the real theme APK, thereby directly registering the virtual theme APK with the overlay management service. The virtual theme APK is used to replace the application theme, achieving the change of the application theme based on the theme resources provided by the user. From the user's perspective, the user can design the theme for the application themselves, realizing the user's own electronic device theme, which is conducive to improving the user experience. In addition, because the application theme replacement method provided by the present application eliminates the installation process and signature verification process of the theme APK, for the system, it not only reduces the system's memory usage, but also reduces the disk space usage and reduces the resource loading time.

[0035] The following is an embodiment of a method for replacing an application theme provided in this application specification.

[0036] Figure 1 An example schematic flow chart of a method for changing an application theme provided by an embodiment of the present application is shown. Figure 1 As shown, the application theme replacement method provided in the embodiment of the present application is applied to electronic devices, which are devices with display screens, such as smart phones, laptops, tablet computers, smart interactive tablets, vehicle-mounted display devices (such as central control screens), etc.

[0037] The application theme replacement method provided by this application includes the following steps:

[0038] S110: In response to a theme change instruction of a target application, obtaining a first file package including a theme resource file.

[0039] Target applications are those that support app theme changes, including both system applications and non-system applications. Non-system applications include audio and video playback applications, chat applications, and so on. Replacing themes for system applications refers to changing the wallpaper, icons, and overall display style within the mobile device system. Replacing themes for non-system applications refers to adjusting visual elements within the application, such as interface colors, fonts, icons, control styles, and background resources.

[0040] In an exemplary embodiment, an electronic device stores multiple file packages including theme resource files. These file packages are used to replace application themes. These file packages include two categories, namely, first-category file packages and second-category file packages. The first-category file packages are in an installation package format; the second-category file packages are in a preset format. The preset formats include formats other than the installation package format, such as compressed file formats, multimedia file formats, and document file formats. Examples of compressed file formats include ZIP (Phil Katz's ZIP) and RAR (Roshal ARchive); examples of multimedia file formats include JPEG (Joint Photographic Experts Group) and PNG (Portable Network Graphics); and examples of document file formats include DOCX (Document Word Open Extensible Markup Language Format) and PDF (Portable Document Format).

[0041] Among them, the first category of file packages belongs to the real theme APK downloaded by users from the official e-commerce mall, and the second category of file packages belongs to the file packages provided by users themselves for changing application themes. For the second category of file packages, the file packages with compressed file formats refer to the file packages made by users themselves for changing application themes. For the second category of file packages, the file packages with non-compressed file formats (such as multimedia file formats, document file formats, etc.) include theme resource files uploaded by users in original file formats, and these theme resource files have not been processed in any way. Among them, the theme resource files in the second category of file packages belong to the resources preferred by users themselves. For example, the theme resource files in the second category of file packages include text, icons and application backgrounds. The text is excerpted by users from their favorite articles, the icons are designed by users themselves using design software, and the application backgrounds are photos taken by users themselves or pictures searched from the Internet.

[0042] If a user needs to change the theme of a certain application (i.e., the target application), they can select their preferred target theme name in the interface providing theme options, triggering the theme change instruction for the target application. The system responds to the theme change instruction, obtains the target theme name selected by the user by parsing the theme change instruction, and then determines the file package selected by the user from the multiple stored file packages based on the target theme name, i.e., obtains the first file package. For example, if the target theme name selected by the user is Name 1, and the multiple stored file packages include File Package 1, File Package 2, File Package 3, and File Package 4, and the theme name corresponding to File Package 2 is Name 1, then File Package 2 is the first file package.

[0043] In a possible implementation, the process of creating the first file package in a compressed file format includes the following steps:

[0044] Displaying a first creation interface for a first file package, the first creation interface including an area for adding resource files;

[0045] In response to the resource adding operation of adding the area, a theme resource file is obtained, the file name of the theme resource file is the same as the file name of the resource file in the current theme APK, and the current theme APK is the theme APK corresponding to the current application theme of the target application;

[0046] Generate an Android manifest file, the Android manifest file including a first priority of the first file package and an application name of the target application, wherein the first priority is higher than a second priority of the current theme APK;

[0047] A first file package in a compressed file format is generated according to the theme resource file and the Android manifest file.

[0048] For the first way to create the first file package, Figure 2 A schematic diagram of creating a first file package provided by an embodiment of the present application is shown. Figure 2 As shown in Figure A1, 201 in Figure A1 represents the first creation interface, and 2011 represents the resource file adding area in the first creation interface. The user can add the corresponding resource file after operating the adding area in the first creation interface.

[0049] This application provides users with a first creation interface for creating a first file package. After the user triggers the operation of opening the first creation interface, the first creation interface is displayed, and the user can create the first file package through the first creation interface. Specifically, after the user performs the resource addition operation in the add area of ​​the first creation interface, the user responds to the resource addition operation, thereby obtaining the file added by the user, that is, obtaining the theme resource file. After obtaining the theme resource file, the file name of the theme resource file is automatically set to be consistent with the file name of the resource file in the current theme APK, that is, the file name of the theme resource file is the same as the file name of the resource file in the current theme APK. For example, the theme resource file includes file 11, file 12 and file 13, and the resource files in the current theme APK are file 21, file 22 and file 23 respectively. File 11 is of the same type as file 21, file 12 is of the same type as file 22, and file 13 is of the same type as file 23. Then, the file name of file 21 is used as the file name of file 11, the file name of file 22 is used as the file name of file 12, and the file name of file 23 is used as the file name of file 13.

[0050] At the same time, an Android manifest file, namely AndroidManifest.xml, is automatically generated. The first priority of the first file package in the Android manifest file is set to be higher than the second priority of the current theme APK. The name of the application to be set in the Android manifest file is set to the application name of the target application. For example, if the application name of the target application is Application 1, the name of the application to be set is Application 1. The Android manifest file can be used to determine that the application used to replace the application theme in the second file package generated by the first file package is the target application, and the generated second file package is preferentially used to replace the application theme of the target application.

[0051] After obtaining the theme resource file and the Android manifest file, the theme resource file and the Android manifest file are compressed, thereby generating a first file package in a compressed file format.

[0052] For the first method of creating the first file package, users only need to upload the theme resource file. The subsequent process of generating the first file package is fully automated and does not require additional manual configuration by the user. This creation method not only greatly simplifies the operation process and improves the degree of automation, but also reduces the requirements for user skills, making it convenient for ordinary users to quickly create new theme packages according to their preferences. It is especially suitable for scenarios where theme resource packages need to be created frequently.

[0053] In a possible implementation, the process of creating the first file package in a compressed file format includes the following steps:

[0054] Display a second creation interface for the first file package, the second creation interface including a resource file adding area, an Android manifest file configuration area, a first prompt message, and a second prompt message, the first prompt message being used to prompt the user that the file name of the resource file added is consistent with the file name of the resource file in the current theme APK, and that the current theme APK is the theme APK corresponding to the current application theme of the target application; the second prompt message being used to prompt the user that the first priority of the first file package in the configured Android manifest file is higher than the second priority of the current theme APK, and that the name of the application to be set in the Android manifest file is consistent with the application name of the target application;

[0055] In response to the resource adding operation of adding the area, a theme resource file is obtained;

[0056] In response to the file name setting operation of the theme resource file, setting the file name of the theme resource file;

[0057] generating an Android manifest file in response to a file configuration operation in the configuration area;

[0058] A first file package in a compressed file format is generated according to the theme resource file and the Android manifest file.

[0059] For the second creation method of the first file package, such as Figure 2 As shown in Figure A2, 202 in Figure A2 represents the second creation interface, 2021 represents the resource file adding area in the second creation interface, and the user can add the corresponding resource file after operating the adding area in the first creation interface. 2022 represents the configuration area of ​​the Android manifest file, and the user can configure the Android manifest file after operating the configuration area. The first prompt information and the second prompt information are in Figure 2 Not shown in the figure.

[0060] This application provides users with a first creation interface for creating a first file package. After the user triggers the operation of opening the second creation interface, the second creation interface is displayed, and the user can create the first file package through the second creation interface. Specifically, after the user performs the resource addition operation in the add area of ​​the second creation interface, the user responds to the resource addition operation, thereby obtaining the file added by the user, that is, obtaining the theme resource file. After obtaining the theme resource file, the user can see the first prompt information displayed. The first prompt information prompts the user that the file name of the resource file added is consistent with the file name of the resource file in the current theme APK, and the current theme APK is the theme APK corresponding to the current application theme of the target application. After the user selects an application that the first file currently needs to be created will act on, the application selected by the user is the target application. After obtaining that the application selected by the user is the target application, the current application theme of the target application can be obtained, then the current theme APK corresponding to the current application theme can be obtained, and then the file name of the resource file in the current theme APK can be obtained.

[0061] For example, the theme resource files added by the user include file 11, file 12 and file 13. The resource files in the current theme APK are file 21, file 22 and file 23 respectively. File 11 is of the same type as file 21, file 12 is of the same type as file 22, and file 13 is of the same type as file 23. Then, the first prompt message prompts the user to set the file name of file 21 to the file name of file 11, the file name of file 22 to the file name of file 12, and the file name of file 23 to the file name of file 13.

[0062] After the user sets a file name for the added theme resource file according to the prompt of the first prompt information, the system responds to the file name setting operation of the theme resource file and updates the file name of the theme resource file to the file name set by the user.

[0063] After the user has finished setting the file name of the theme resource file, the user is prompted to configure the Android manifest file. The user can see the second prompt message displayed. The second prompt message prompts the user that the first priority of the first file package in the Android manifest file configured by the user is higher than the second priority of the current theme APK, and that the name of the application to be set in the Android manifest file is consistent with the application name of the target application. For example, the second prompt message will prompt the user what the specific value of the second priority of the current theme APK is, whether the first priority of the first file package in the Android manifest file configured by the user needs to be higher than the second priority of the current theme APK, and which values ​​the first priority of the first file package configured by the user can take. Or the second prompt message will prompt the user whether the first priority of the first file package configured by the user needs to be higher than the second priority of the current theme APK. If the user selects "Yes", the system automatically sets the first priority of the first file package, and the set first priority of the first file package is higher than the second priority of the current theme APK. Furthermore, the second prompt message will also prompt the user to ensure that the name of the application to be set in the Android manifest file is consistent with the application name of the target application. For example, if the application name of the target application is Application 1, the name of the application to be set in the Android manifest file should be filled in as Application 1. Alternatively, the second prompt message will also prompt the user to ensure that the name of the application to be set in the Android manifest file is consistent with the application name of the target application, and let the user select whether the name of the application to be set in the Android manifest file is consistent with the application name of the target application. If the user selects "Yes", the system will automatically set the name of the application to be set in the Android manifest file to the application name of the target application. The Android manifest file can be used to determine that the application used to replace the application theme in the second file package generated by the first file package is the target application, and the generated second file package is used first to replace the application theme of the target application.

[0064] The second method of creating the first file package is a method that guides users to manually participate in the creation process. On the one hand, users can easily create new theme packages based on their actual needs in a visual interface, and the creation process is simple and easy to operate. It is particularly suitable for scenarios where theme resource packages need to be created frequently, providing convenience for users to design their own favorite themes. On the other hand, this creation method can effectively ensure that the generated first file package has higher accuracy and reliability by prompting users to set the file name of the theme resource file and the Android manifest file. If any abnormality occurs during the use of the first file package, it is also convenient for users to make manual adjustments and repairs in a timely manner. Although the second creation method is more complicated than the first creation method, it can significantly improve the success rate and controllability of the first file package, and can also increase the user's sense of participation in the process of creating the first file package.

[0065] S120: If the file format of the first file package is a preset format, compile the first file package into an installation package format to obtain a second file package, where the preset format includes formats other than the installation package format;

[0066] This application builds an Overlay virtualization engine at the bottom layer of the system and expands the functionality of AAPT2 (Android Asset Packaging Tool 2, the second version of the Android asset packaging tool) to achieve dynamic resource compilation. AAPT2 is a key component in the Android development tool chain, primarily used to compile and package application resource files.

[0067] After obtaining the first file package, the file format of the first file package is identified. If the file format of the first file package is a preset format, it means that the file format of the first file package is not an installation package format and cannot be used to change the current theme of the target application. Then, AAPT2 in the Overlay virtualization engine is used to compile the first file package into an installation package format to obtain a second file package, that is, the file format of the second file package is an installation package format.

[0068] Among them, compiling the first file package into a second file package in the installation package format can be understood as dynamically generating a resource mapping file (i.e., resources.arsc, which is part of the Android application) based on the theme resource files in the first file package, that is, setting a resource ID (Identity) for each theme resource file in the first file package, and then establishing a mapping relationship between the resource ID and the theme resource file to obtain a source mapping file, that is, the resource mapping file includes each theme resource file in the first file package and the resource ID corresponding to each theme resource file. For example, the first file package includes N theme resource files, N is a positive integer greater than or equal to 1, and the content in the resource mapping file is shown in Table 1:

[0069] Table 1

[0070] Theme resource file name Resource ID Date-1 ID1 Date-2 ID2 Date-3 ID3 ... ...

[0071] After obtaining the resource mapping file, a virtual APK structure is constructed based on the resource mapping file to obtain a second file package in the installation package format. The virtual APK structure is identical to the real APK structure except that it does not include the signature file.

[0072] If the first file package is in a compressed file format, the first file package includes, in addition to the theme resource file, an Android manifest file. This Android manifest file indicates which application is used to replace the application theme in the second file package generated from the first file package, and the generated second file package is preferentially used to replace the application theme of the application indicated by the Android manifest file. When constructing a virtual APK structure based on the resource mapping file, there is no need to specifically set up a new Android manifest file; the Android manifest file in the first file package can be added to the virtual APK structure.

[0073] If the file format of the first file package is not a compressed file format, the first file package only includes the theme resource file. When building a virtual APK structure based on the resource mapping file, it is necessary to specifically set a new Android manifest file and then add the new Android manifest file to the virtual APK structure.

[0074] Since the virtual APK structure does not include a signature file, and the second file package does not include a signature file, but the second file package includes other files in the real APK, the second file package can be regarded as a virtual theme APK, that is, a virtual theme APK. Among them, in addition to not including the signature file, the second file package includes files such as a resource mapping file and an Android manifest file. The Android manifest file in the second file package indicates that the application used by the second file package to replace the application theme is the target application, and the second file package is used first to replace the application theme of the target application. When using the resource mapping file in the second file to replace the application theme, the system can obtain the resource ID by reading the resource mapping file, and can determine the resource mapping file corresponding to the resource ID through the read resource ID, and use the file content of the resource mapping file corresponding to the resource ID to overwrite the file content of the original theme resource file in the target application, thereby achieving the replacement of the application theme of the target application.

[0075] S130: Using the second file package to replace the theme of the target application.

[0076] After obtaining the second file package, the second file package is registered with the overlay management service. The overlay management service performs the application theme replacement operation, that is, reads the Android manifest file in the second file package. Through the Android manifest file, it can be determined that the object of the second file package is the target application, and the second file package is used preferentially to replace the current application theme of the target application, that is, the second file package is determined as the overlay APK of the target application, which can also be understood as a theme overlay package. Next, the overlay management service will check whether the second file package has been added to the activation registration list. If not, the second file package will be added to the activation registration list. The overlay management service then reads the resource mapping file in the second file package to obtain the resource ID. The resource mapping file corresponding to the resource ID is determined by the resource ID, and the file content of the resource mapping file corresponding to the resource ID is used to overwrite the file content of the original theme resource file in the target application, thereby achieving the replacement of the application theme of the target application, that is, replacing the current application theme of the target application with the application theme corresponding to the second file package.

[0077] This application can compile the file package provided by the user, including the theme resource file, into a file package in the installation package format, and then use the compiled file package in the installation package format to replace the theme of the application. From the user's perspective, the user can design themes for the application by himself, allowing the user to independently design and apply personalized themes without professional skills, so that the user can decide the theme of his own electronic device, which helps to improve the user experience.

[0078] In a possible implementation, compiling the first file package into the second file package includes the following steps:

[0079] Get the theme resource file in the first file package;

[0080] Load the theme resource file into the memory and compile the theme resource file in the memory into a resource mapping file;

[0081] Constructing a third file package, wherein the third file package has a data structure of the installation package;

[0082] The resource mapping file is saved in the specified directory of the third file package to obtain the second file package.

[0083] After obtaining the first file package, if the file format of the first file package is a compressed file format, the first file package is decompressed to obtain the theme resource file provided by the user. If the file format of the first file package is not a compressed file format, the theme resource file provided by the user can be obtained by directly reading the first file package. Next, the obtained theme resource file is loaded into the memory for subsequent processing. In the memory, the theme resource file will be compiled into a resource mapping file (belonging to the resources.arsc file). This step is to convert the theme resource file obtained in advance into a format that is more suitable for program use and management. Subsequently, a third file package is constructed. This third file package is a file container with an installation package data structure, but the third file package does not have a file directory for the signature file. Finally, the generated resource mapping file is saved to the specified directory (for example, the root directory) of the third file package. After the resource mapping file is saved, the third file package is converted into the second file package, that is, the second file package is actually a virtual theme APK containing a resource mapping file.

[0084] In a possible implementation, compiling the theme resource file in the memory into a resource mapping file includes the following steps:

[0085] The extended second version of the Android resource packaging tool is used to compile the theme resource files in memory into resource mapping files.

[0086] The libaapt2_jni.so in the second version of the extended Android resource packaging tool is used to compile the theme resource files in the memory into resource mapping files.

[0087] The process of dynamically generating resource mapping files by extending libaapt2_jni.so is actually an advanced operation for optimizing and compiling theme resource files.

[0088] libaapt2_jni.so is an extension module for the second version of the Android resource packaging tool. Using the extended libaapt2_jni.so module processes theme resource files in memory and compiles them into resource map files. This extension allows developers to flexibly adjust resource compilation methods based on actual needs.

[0089] After theme resource files (such as image resources and XML configuration files) are loaded into memory, the extended libaapt2_jni.so library decompresses the theme resource files in memory, parses them, and extracts their attribute information (such as name, type, and path). The optimized theme resource files are then processed. Extracting the attribute information from the theme resource files involves identifying the file type based on the file header information and, for resource files of different file types, using the parser corresponding to the file type to extract the attribute information. Optimizing the theme resource files involves, for example, compressing image resources or binarizing XML files to reduce resource usage and improve access efficiency. Next, libaapt2_jni.so constructs a resource mapping table based on the parsed resource files. This mapping table records the mapping between each resource file's unique identifier (i.e., the resource ID mentioned above) and its actual storage location. Ultimately, this mapping table is compiled into a binary file format called resources.arsc, resulting in the resource mapping file. The resource mapping file that can be dynamically generated by the extended libaapt2_jni.so is an optimized Resources.arsc file. This resource mapping file not only contains standard resource mapping information, but may also contain additional custom metadata to support specific theme switching logic.

[0090] The process of dynamically generating the Resources.arsc file by extending libaapt2_jni.so actually utilizes the enhanced resource packaging tool to efficiently compile and optimize theme resources. The resource mapping file dynamically generated by extending libaapt2_jni.so is independent and does not rely on signature verification. This means that theme resources can be loaded dynamically without installing the entire theme APK, making it suitable for applications that require frequent theme changes.

[0091] In a possible implementation, after compiling the first file package into an installation package format to obtain the second file package, the above-mentioned application theme replacement method further includes the following steps:

[0092] A file identifier is set for the second file package, where the file identifier is used to indicate that the second file package is generated through the first file package.

[0093] Because the second file package does not include a signature file, when the second file package is used to replace the theme of the target application, if the actual installation process is still the installation process of the real theme APK, the second file package will not pass the signature verification step, resulting in the inability to use the second file package to replace the theme of the target application. In order to solve the problem of the second file package failing the signature verification step, this application has added a method to the coverage management service for solving the problem of the second file package failing the signature verification step. Using this new method, the signature verification step for the second file package can be skipped.

[0094] Specifically, if the second file package is generated by the first file package whose file format is a preset format, then a file identifier is set for the second file package. This file identifier can be placed in the package name of the second file package, indicating that the second file package is generated by the first file package, and also indicating that the second file package is a virtual theme APK. In this way, when the second file package is used to replace the theme of the target application, if it is recognized that the second file package has a file identifier, the signature verification of the second file package will not be performed, ensuring that the second file package can successfully replace the theme of the target application.

[0095] The above-mentioned theme of replacing the target application using the second file package includes the following steps:

[0096] Determining whether the second file package has a file identifier;

[0097] In a case where the second file package has a file identifier, the second file package is registered with the overlay management service, so that the overlay management service replaces the theme of the target application based on the second file package.

[0098] Before using the second file package to replace the target application's theme, the overlay management service determines whether the second file package has a file identifier. If so, it indicates that the second file package is a virtual theme APK. Therefore, the second file package is directly registered with the overlay management service without signature verification. The overlay management service then performs an application theme replacement operation, namely, reading the Android manifest file in the second file package. The Android manifest file determines that the second file package is targeted at the target application and preferentially uses the second file package to replace the target application's current application theme, i.e., determining the second file package as the target application's overlay APK. Next, the overlay management service checks whether the second file package has been added to the activation registration list. If not, the second file package is added to the activation registration list. The overlay management service then reads the resource mapping file in the second file package to obtain a resource ID. Based on the resource ID, the service determines the resource mapping file corresponding to the resource ID. The content of the resource mapping file corresponding to the resource ID is used to overwrite the content of the original theme resource file in the target application, thereby replacing the target application's application theme. This replaces the target application's current application theme with the application theme corresponding to the second file package.

[0099] Before using the second file package to replace the theme of the target application, determine whether the second file package has a file identifier. If the second file package has a file identifier, register the second file package to the overlay management service, so that the overlay management service can replace the theme of the target application based on the second file package. This solves the problem that when the installation process of the real theme APK is used to process the second file package that does not include a signature file, the second file package cannot pass the signature verification link, bypasses the signature verification link in the installation process of the real theme APK, and ensures that the second file package can successfully achieve the replacement of the application theme of the target application. By bypassing the signature verification link in the installation process of the real theme APK, the system can quickly apply the resources in the second file package, which not only reduces the system's memory usage, but also reduces disk space usage, and also reduces resource loading time, which is conducive to speeding up the switching speed of application themes.

[0100] In a possible implementation, after obtaining the first file package including the theme resource file, the above-mentioned application theme replacement method further includes the following steps:

[0101] If the file format of the first file package is an installation package format, performing security verification on the first file package;

[0102] If the security verification of the first file package passes, installing the first file package;

[0103] When the first file package is installed, performing consistency verification on the signature of the first file package;

[0104] If the consistency verification of the signature passes, the first file package is registered with the overlay management service, so that the overlay management service replaces the theme of the target application based on the first file package.

[0105] The application theme replacement method provided in this application not only supports replacing application themes based on a file package in a preset format and including theme resource files, but also retains a solution for replacing application themes based on RRO. Specifically, after obtaining a first file package, the file format of the first file package is identified. If the file format of the first file package is an installation package format, it is determined that the first file package is a real theme APK. The application theme is then replaced according to the RRO application theme replacement process. Specifically, the first file package is first security-verified using the signature file in the first file package. If the security verification passes, the first file package is installed. After the first file package is installed, the signature of the first file package is consistency-verified. If the consistency verification passes, the first file package is registered with the overlay management service. The overlay management service then replaces the target application's theme based on the first file package. Specifically, the overlay management service performs the application theme replacement operation by reading the Android manifest file in the first file package. The Android manifest file determines that the first file package is targeted at the target application. The first file package is then preferentially used to replace the target application's current application theme, i.e., the first file package is determined to be the overlay APK of the target application. Next, the overlay management service will check whether the first file package has been added to the activation registration list. If not, the first file package will be added to the activation registration list. The overlay management service will then read the resource mapping file in the first file package to obtain the resource ID. The resource mapping file corresponding to the resource ID will be determined through the resource ID, and the file content of the resource mapping file corresponding to the resource ID will be used to overwrite the file content of the original theme resource file in the target application, thereby achieving the replacement of the application theme of the target application, that is, replacing the current application theme of the target application with the application theme corresponding to the first file package.

[0106] The following is another embodiment of a method for replacing an application theme provided in this application specification.

[0107] The application theme replacement method provided in the embodiments of this application is an extension of the traditional RRO solution, that is, an extended RRO solution. After the RRO solution is extended, the construction and output processes of the theme APK are changed. It is no longer limited to the construction and output of the traditional theme APK. It can also support the packaging of theme resources into a file package in a preset format (such as a ZIP package) and perform RRO application theme replacement based on the file package in the preset format. Compared with the traditional RRO solution, the improvements of this application include:

[0108] 1. Expand the Android Package Manager Service (PackageManagerService, PMS), add a processing entry for file packages in a preset format, generate a virtual theme APK based on the theme resource files in the file packages in the preset format, and inject the virtual theme APK into the overlay management service. The virtual theme APK includes an Android manifest file and a resource mapping file generated based on the theme resource files.

[0109] 2. Extend the AAPT2 interface to provide a virtual theme APK generation interface, dynamically compile the theme resources in the preset format file package to generate the corresponding resource mapping file, and thus generate a virtual theme APK.

[0110] 3. Add a new method in the Overlay Management Service to directly add a virtual theme APK generated from a pre-formatted file package to the activation list, bypassing the signature verification process and the certification process of the real theme APK. This bypasses the certification process of the theme store and directly adds the virtual theme APK to the activation list to achieve the change of application theme.

[0111] The following describes the construction of a ZIP package containing theme resource files and a real theme APK:

[0112] like Figure 3 As shown, Figure 3 The following flowchart shows the construction of a ZIP package including theme resource files and a real theme APK provided by this application. 3A shows the process of building a real theme APK, and 3B shows the process of building a ZIP package. The first two steps of the process shown in 3A and the process shown in 3B are the same, but the last step is different. The last step in the process shown in 3A is to package the APK and sign it, while the last step in the process shown in 3B is to directly compress it into a ZIP package. By executing the process shown in 3A, you can obtain the theme APK in the installation package format, that is, the real theme APK; by executing the process shown in 3B, you can obtain the ZIP package in the compressed file format.

[0113] Figure 4 Another exemplary schematic flow chart of a method for changing an application theme provided by an embodiment of the present application is shown. Figure 4 As shown, the application theme replacement method provided by this application includes the following steps:

[0114] S210: Responding to a theme change instruction of a target application, obtaining a first file package including a theme resource file;

[0115] S220: Identify the file format of the first file package. If the file format of the first file package is an installation package format, it means that the first file package is a real theme APK. Figure 4The process on the left side is to execute S230; if the file format of the first file package is a compressed file format, it means that the first file package is a ZIP package, execute Figure 4 The process on the right side of the middle is to execute S240;

[0116] S230: Perform security verification on the first file package. If the security verification of the first file package passes, install the first file package. After the installation of the first file package is completed, perform consistency verification on the signature of the first file package. If the consistency verification of the signature passes, register the first file package with the overlay management service so that the overlay management service can replace the theme of the target application based on the first file package. That is, the overlay management service will dynamically apply the theme resource content in the theme resource file of the first file package and refresh the interface to achieve the replacement of the theme of the target application.

[0117] S240: Compile the first file package into an installation package format to obtain a second file package, set a file identifier for the second file package, determine whether the second file package has a file identifier, and if the second file package has a file identifier, register the second file package with the overlay management service so that the overlay management service can replace the theme of the target application based on the second file package. The overlay management service will dynamically apply the theme resource content in the theme resource file of the second file package and refresh the interface to achieve the replacement of the theme of the target application.

[0118] The application theme replacement method provided by this application has the following technical effects:

[0119] 1. This application can compile a file package provided by the user, including theme resource files, into a file package in the installation package format, namely a virtual theme APK, and then use the virtual theme APK to replace the theme of the application. Because the virtual theme APK does not contain a signature file, before using the virtual theme APK to replace the theme of the target application, it is determined whether the virtual theme APK has a file identifier. If the virtual theme APK has a file identifier, the virtual theme APK is registered with the overlay management service, so that the overlay management service can replace the theme of the target application based on the virtual theme APK. This solves the problem of the virtual theme APK failing to pass the signature verification phase when processing a virtual theme APK that does not contain a signature file using the installation process of a real theme APK. This bypasses the signature verification phase during the installation process of the real theme APK, ensuring that the target application's application theme can be successfully replaced using the virtual theme APK. By bypassing the signature verification phase during the installation process of the real theme APK, this allows the system to quickly apply the resources in the virtual theme APK. Compared with traditional RRO solutions, for the system, this application not only reduces the system's memory usage, but also reduces disk space usage and resource loading time, which helps speed up the switching of application themes.

[0120] 2. The application theme replacement method provided in this application can be applied to the custom ROM (Read-Only Memory) of Android device manufacturers, providing users with a more personalized user experience. From the user's perspective, users only need to design theme resources according to the design specifications agreed upon by the manufacturer and store them in a directory to enable their own Android devices to use their own designed themes. In other words, users can design themes for their applications themselves, allowing users to independently design and apply personalized themes without professional skills, allowing users to decide the theme of their own electronic devices, which helps to improve the user experience.

[0121] 3. This application not only supports replacing application themes based on file packages that are in a preset format and include theme resource files, but also supports replacing application themes based on real theme APKs, which not only improves the flexibility of application theme replacement, but also ensures the reliability of application theme replacement.

[0122] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0123] Figure 5 A schematic diagram of the structure of an application theme replacement device provided in an embodiment of the present application is shown. Figure 5 As shown, the application theme changing device 500 includes:

[0124] An acquisition module 510 is configured to acquire a first file package including a theme resource file in response to a theme change instruction of a target application;

[0125] A compiling module 520 is configured to compile the first file package into an installation package format to obtain a second file package if the file format of the first file package is a preset format, where the preset format includes formats other than the installation package format;

[0126] The theme changing module 530 is configured to change the theme of the target application using the second file package.

[0127] In one possible implementation, the compiling module 520 includes:

[0128] A parsing unit, configured to obtain a theme resource file in the first file package;

[0129] The loading unit is used to load the theme resource file into the memory and compile the theme resource file in the memory into a resource mapping file;

[0130] A first creating unit is used to construct a third file package, where the third file package has a data structure of an installation package;

[0131] The storage unit is used to save the resource mapping file to a designated directory of the third file package to obtain a second file package.

[0132] In a possible implementation, the loading unit is specifically configured to compile the theme resource file in the memory into a resource mapping file using an extended Android resource packaging tool.

[0133] In a possible implementation, the application theme changing device 500 further includes:

[0134] The second creation unit is used to display a first creation interface of the first file package, the first creation interface includes an adding area for resource files; in response to the resource adding operation in the adding area, a theme resource file is obtained, the file name of the theme resource file is the same as the file name of the resource file in the current theme installation package, and the current theme installation package is the theme installation package corresponding to the current application theme of the target application; an Android manifest file is generated, the Android manifest file includes a first priority of the first file package and an application name of the target application, the first priority is higher than the second priority of the current theme installation package; based on the theme resource file and the Android manifest file, a first file package with a compressed file format is generated.

[0135] In a possible implementation, the application theme changing device 500 further includes:

[0136] The third creation unit is used to display the second creation interface of the first file package, the second creation interface includes a resource file adding area, an Android manifest file configuration area, a first prompt message and a second prompt message, the first prompt message is used to prompt the user that the file name of the resource file added is consistent with the file name of the resource file in the current theme installation package, and the current theme installation package is the theme installation package corresponding to the current application theme of the target application, the second prompt message is used to prompt the user that the first priority of the first file package in the configured Android manifest file is higher than the second priority of the current theme installation package, and the application name to be set in the Android manifest file is consistent with the application name of the target application; in response to the resource adding operation in the adding area, a theme resource file is obtained; in response to the file name setting operation of the theme resource file, the file name of the theme resource file is set; in response to the file configuration operation in the configuration area, an Android manifest file is generated; based on the theme resource file and the Android manifest file, a first file package with a compressed file format is generated.

[0137] In a possible implementation, the application theme changing device 500 further includes:

[0138] an identification setting unit, configured to set a file identification for the second file package, wherein the file identification is used to indicate that the second file package is generated from the first file package;

[0139] The theme changing module 530 is further configured to determine whether the second file package has a file identifier; if the second file package has a file identifier, register the second file package with the overlay management service so that the overlay management service changes the theme of the target application based on the second file package.

[0140] In one possible implementation, the theme replacement module 530 is also used to perform security verification on the first file package if the file format of the first file package is an installation package format; if the security verification of the first file package passes, install the first file package; after the installation of the first file package is completed, perform consistency verification on the signature of the first file package; if the consistency verification of the signature passes, register the first file package with the overlay management service, so that the overlay management service can replace the theme of the target application based on the first file package.

[0141] It should be noted that the application theme replacement device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the application theme replacement method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the application theme replacement device provided in the above embodiment and the application theme replacement method embodiment belong to the same concept. Therefore, for details not disclosed in the embodiment of the device of this application, please refer to the embodiment of the application theme replacement method of this application, which will not be repeated here.

[0142] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0143] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. Figure 6 As shown, the electronic device 600 includes: a memory 601 and a processor 602, wherein the memory 601 stores an executable program code 6011, and the processor 602 is used to call and execute the executable program code 6011 to perform an application theme changing method.

[0144] In this embodiment, the electronic device can be divided into functional modules according to the above-mentioned method example. For example, each functional module can be mapped to a specific function, or two or more functions can be integrated into a single processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and represents only a logical functional division. In actual implementation, other division methods may be used.

[0145] In the case of dividing each functional module into corresponding functional modules, the electronic device may include: an acquisition module, a compilation module, a theme changing module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0146] The electronic device provided in this embodiment is used to execute the above-mentioned application theme changing method, and thus can achieve the same effect as the above-mentioned implementation method.

[0147] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the operation of the electronic device, and the storage module may be used to support the electronic device in executing relevant program codes and data.

[0148] The processing module may be a processor or controller that implements or executes the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processing (DSP) and a microprocessor, and the storage module may be a memory.

[0149] This embodiment also provides a computer-readable storage medium, which stores computer program code. When the computer program code runs on a computer, the computer executes the above-mentioned related method steps to implement an application theme replacement method in the above-mentioned embodiment.

[0150] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement an application theme replacement method in the above-mentioned embodiment.

[0151] In addition, the electronic device provided in the embodiments of the present application can specifically be a chip, component or module, and the electronic device may include a connected processor and memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor can call and execute instructions to enable the chip to execute an application theme replacement method in the above embodiment.

[0152] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding application theme replacement method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding application theme replacement method provided above, and will not be repeated here.

[0153] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0154] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0155] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for changing an application theme, characterized in that: The application theme changing method includes: In response to a theme change instruction of a target application, obtaining a first file package including a theme resource file; If the file format of the first file package is a preset format, compile the first file package into an installation package format to obtain a second file package, where the preset format includes a format other than the installation package format; The second file package is used to replace the theme of the target application.

2. The method for changing the application theme according to claim 1, wherein: The step of compiling the first file package into an installation package format to obtain a second file package includes: Obtain the theme resource file in the first file package; Loading the theme resource file into the memory, and compiling the theme resource file in the memory into a resource mapping file; Constructing a third file package, wherein the third file package has a data structure of an installation package; The resource mapping file is saved in a designated directory of the third file package to obtain the second file package.

3. The method for changing the application theme according to claim 2, wherein: Compiling the theme resource file in the memory into a resource mapping file includes: An extended Android resource packaging tool is used to compile the theme resource file in the memory into the resource mapping file.

4. The method for changing the application theme according to claim 1, wherein: The application theme changing method further includes: Displaying a first creation interface of the first file package, wherein the first creation interface includes an area for adding resource files; In response to the resource adding operation in the adding area, the theme resource file is obtained, the file name of the theme resource file is the same as the file name of the resource file in the current theme installation package, and the current theme installation package is the theme installation package corresponding to the current application theme of the target application; Generate an Android manifest file, the Android manifest file including a first priority of the first file package and an application name of the target application, the first priority being higher than a second priority of the current theme installation package; The first file package in a compressed file format is generated according to the theme resource file and the Android manifest file.

5. The method for changing the application theme according to claim 1, wherein: The application theme changing method further includes: Displaying a second creation interface for the first file package, the second creation interface including a resource file adding area, an Android manifest file configuration area, a first prompt message, and a second prompt message, wherein the first prompt message is used to prompt the user to ensure that the file name of the resource file added is consistent with the file name of the resource file in the current theme installation package, and that the current theme installation package is a theme installation package corresponding to the current application theme of the target application; the second prompt message is used to prompt the user to ensure that the first priority of the first file package in the Android manifest file configured is higher than the second priority of the current theme installation package, and that the name of the application to be set in the Android manifest file is consistent with the application name of the target application; In response to the resource adding operation of the adding area, obtaining the theme resource file; In response to the file name setting operation of the theme resource file, setting the file name of the theme resource file; generating the Android manifest file in response to the file configuration operation of the configuration area; The first file package in a compressed file format is generated according to the theme resource file and the Android manifest file.

6. The method for changing the application theme according to claim 1, wherein: After compiling the first file package into an installation package format to obtain a second file package, the application theme changing method further includes: Setting a file identifier for the second file package, where the file identifier is used to indicate that the second file package is generated from the first file package; The subject of replacing the target application with the second file package includes: Determining whether the second file package has the file identifier; In a case where the second file package has the file identifier, the second file package is registered with an overlay management service, so that the overlay management service replaces the theme of the target application based on the second file package.

7. The method for changing the application theme according to claim 1, wherein: After obtaining the first file package including the theme resource file, the application theme replacement method further includes: If the file format of the first file package is the installation package format, performing security verification on the first file package; If the security verification of the first file package passes, installing the first file package; When the installation of the first file package is complete, performing consistency verification on the signature of the first file package; If the consistency verification of the signature passes, the first file package is registered with the overlay management service, so that the overlay management service replaces the theme of the target application based on the first file package.

8. An application theme changing device, characterized in that: The application theme changing device includes: An acquisition module, configured to acquire a first file package including a theme resource file in response to a theme change instruction of a target application; a compiling module configured to compile the first file package into an installation package format to obtain a second file package if the file format of the first file package is a preset format, wherein the preset format includes a format other than the installation package format; A theme changing module is used to change the theme of the target application using the second file package.

9. An electronic device, characterized in that: The electronic device comprises: a memory for storing executable program code; A processor is configured to call and run the executable program code from the memory, so that the electronic device executes the application theme changing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the application theme changing method according to any one of claims 1 to 7 is implemented.