CN117234623B - Page theme changing method and device of application program and electronic equipment - Google Patents

Page theme changing method and device of application program and electronic equipment Download PDF

Info

Publication number
CN117234623B
CN117234623B CN202311527624.4A CN202311527624A CN117234623B CN 117234623 B CN117234623 B CN 117234623B CN 202311527624 A CN202311527624 A CN 202311527624A CN 117234623 B CN117234623 B CN 117234623B
Authority
CN
China
Prior art keywords
theme
configuration file
new
target
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311527624.4A
Other languages
Chinese (zh)
Other versions
CN117234623A (en
Inventor
卢岩
朱根强
张劲涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shengwei Times Technology Co ltd
Original Assignee
Shengwei Times Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shengwei Times Technology Co ltd filed Critical Shengwei Times Technology Co ltd
Priority to CN202311527624.4A priority Critical patent/CN117234623B/en
Publication of CN117234623A publication Critical patent/CN117234623A/en
Application granted granted Critical
Publication of CN117234623B publication Critical patent/CN117234623B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a page theme changing method and device of an application program and electronic equipment, and relates to the technical field of computers. The method comprises the following steps: receiving input package name information, target theme color and target theme picture resources of an application program to be replaced, and replacing theme information configuration files and picture resource files corresponding to native pages of the application program based on the target theme color and the target theme picture resources to obtain new theme information configuration files and new picture resource files; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color and the target theme picture resource, the theme color and the theme picture resource in the theme resource configuration file corresponding to the application hypertext markup language page are replaced, so that the quick replacement of the page theme in the application is realized, and the development efficiency of the application is effectively improved.

Description

Page theme changing method and device of application program and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for replacing a page theme of an application program, and an electronic device.
Background
The mixed mode application is an application comprising both native pages and hypertext markup language (Hyper Text Markup Language, HTML) pages, which is one of the mainstream development modes of the application due to its low cost and cross-platform development advantages.
To meet the needs of different customers, mixed mode applications currently support page theme changes. In the prior art, the page theme in the mixed mode application program is replaced by manual work.
However, manual replacement mainly relies on a developer to manually process a large amount of complicated data in a native page and a hypertext markup language (HTML) page, and the problem that the application program style and content are replaced by changing the engineering file data by mistake may occur, so that the development efficiency of the application program is low.
Disclosure of Invention
The application program page theme replacing method, device and electronic equipment achieve quick replacement of page theme in the application program, and effectively improve development efficiency of the application program.
The application provides a page theme changing method of an application program, which can comprise the following steps:
receiving theme change information input by a target object, wherein the theme change information comprises package name information of an application program to be changed, a target theme color and a target theme picture resource;
Based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file;
packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page;
based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file;
and generating a new application program based on the installation package of the original page and the new theme resource configuration file.
According to the page theme changing method of the application program provided by the application program, when the package name information comprises the current package name information and the target package name information, the method further comprises the following steps:
Based on the target package name information, replacing the current package name information in the engineering configuration file corresponding to the original page to obtain a new engineering configuration file;
correspondingly, the packaging processing of the new theme information configuration file and the new picture resource file includes:
and packaging the new engineering configuration file, the new theme information configuration file and the new picture resource file.
According to the page theme changing method of the application program provided by the application program, the format of the engineering configuration file is json file format, and the changing of the current package name information in the engineering configuration file corresponding to the original page based on the target package name information comprises the following steps:
converting the format of the engineering configuration file to obtain an engineering configuration file in an extensible markup language format;
and replacing the current package name information in the engineering configuration file in the extensible markup language format based on the target package name information.
According to the page theme changing method of the application program provided by the application program, when the theme changing information further comprises a target storage position, the method further comprises the following steps:
Storing the installation package of the original page and the new theme resource configuration file in the target storage position;
correspondingly, the generating a new application program based on the installation package of the native page and the new theme resource configuration file includes:
and searching the installation package and the new theme resource configuration file from the target storage position, and generating a new application program based on the searched installation package and the new theme resource configuration file.
According to the method for replacing the page theme of the application program provided by the application program, the replacing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program based on the target theme color comprises the following steps:
changing the common theme colors in the theme resource configuration file based on the target theme colors;
and replacing the function theme colors in the theme resource configuration file based on the target theme colors.
According to the page theme changing method of the application program provided by the application program, the page theme changing method further comprises the following steps:
generating a new application program based on the installation package of the original page and a default theme resource configuration file under the condition that the new theme resource configuration file is monitored to be abnormal;
The default theme resource configuration file comprises default theme colors and default theme picture resources.
According to the page theme changing method of the application program provided by the application program, the page theme changing method further comprises the following steps:
generating corresponding log information under the condition that the new theme resource configuration file is monitored to be abnormal;
and reporting the log information, wherein the log information is used for positioning the reason of the abnormality of the new theme resource configuration file.
The application also provides a page theme changing device of the application program, which can comprise:
the input unit is used for receiving theme change information input by the target object, wherein the theme change information comprises package name information, target theme color and target theme picture resources of an application program to be changed;
the first processing unit is used for replacing the theme colors in the theme information configuration file corresponding to the original page of the application program based on the target theme colors to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file;
The second processing unit is used for packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page;
the third processing unit is used for replacing the theme colors in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program based on the target theme colors; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file;
and the fourth processing unit is used for generating a new application program based on the installation package of the original page and the new theme resource configuration file.
According to the page theme changing device of the application program, the device further comprises a fifth processing unit, wherein the fifth processing unit is used for:
based on the target package name information, replacing the current package name information in the engineering configuration file corresponding to the original page to obtain a new engineering configuration file;
correspondingly, the second processing unit is specifically configured to: and packaging the new engineering configuration file, the new theme information configuration file and the new picture resource file.
According to the page theme changing device for the application program provided by the application program, the format of the engineering configuration file is json file format, and the fifth processing unit is specifically configured to:
converting the format of the engineering configuration file to obtain an engineering configuration file in an extensible markup language format; and replacing the current package name information in the engineering configuration file in the extensible markup language format based on the target package name information.
According to the page theme changing device of the application program, when the theme changing information further comprises a target storage position, the device further comprises a sixth processing unit, wherein the sixth processing unit is used for:
storing the installation package of the original page and the new theme resource configuration file in the target storage position;
correspondingly, the fourth processing unit is specifically configured to: and searching the installation package and the new theme resource configuration file from the target storage position, and generating a new application program based on the searched installation package and the new theme resource configuration file.
According to the page theme changing device of the application program provided by the application program, the third processing unit is specifically configured to:
Changing the common theme colors in the theme resource configuration file based on the target theme colors; and replacing the function theme colors in the theme resource configuration file based on the target theme colors.
According to the page theme changing device of the application program, the device further comprises a seventh processing unit, wherein the seventh processing unit is used for:
generating a new application program based on the installation package of the original page and a default theme resource configuration file under the condition that the new theme resource configuration file is monitored to be abnormal; the default theme resource configuration file comprises default theme colors and default theme picture resources.
According to the page theme changing device of the application program, the device further comprises an eighth processing unit, wherein the eighth processing unit is used for:
generating corresponding log information under the condition that the new theme resource configuration file is monitored to be abnormal; and reporting the log information, wherein the log information is used for positioning the reason of the abnormality of the new theme resource configuration file.
The application also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the page theme changing method of any one of the application programs when executing the program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a page theme change method of an application as described in any one of the above.
The present application also provides a computer program product comprising a computer program which when executed by a processor implements a page theme change method for an application as described in any one of the above.
According to the page theme changing method, the page theme changing device and the electronic equipment of the application program, when the page theme of the mixed mode application program is changed, theme changing information input by a target object can be received, and the theme changing information comprises package name information, target theme color and target theme picture resources of the application program to be changed; based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; based on the installation package of the original page and the new theme resource configuration file, a new application program is generated. Therefore, the target object can automatically replace the resource package of the original page in the application program and the theme resource configuration file of the hypertext markup language (HTML) page by inputting the theme replacement information of the application program, so that a new application program is generated, the quick replacement of the page theme in the application program is realized, and the development efficiency of the application program is effectively improved.
Drawings
For a clearer description of the present application or of the prior art, the drawings that are used in the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for replacing a page theme of an application according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a page theme changing device of an application according to an embodiment of the present application;
fig. 3 is a schematic entity structure of an electronic device provided in the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural. In the text description of the present application, the character "/" generally indicates that the front-rear association object is an or relationship.
The technical scheme provided by the embodiment of the application program can be applied to the page theme changing scene of the mixed mode application program. Currently, the page theme in the mixed mode application program is replaced by manual work.
However, manual replacement mainly relies on a developer to manually process a large amount of complicated data in a native page and a hypertext markup language (HTML) page, and the problem that the application program style and content are replaced by changing the engineering file data by mistake may occur, so that the development efficiency of the application program is low.
In order to effectively improve the development efficiency of the mixed mode application program, the embodiment of the application program provides a page theme changing method of the application program, when changing the page theme of the mixed mode application program, theme changing information input by a target object can be received, wherein the theme changing information comprises package name information, target theme color and target theme picture resources of the application program to be changed; based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; based on the installation package of the original page and the new theme resource configuration file, a new application program is generated. Therefore, the target object can automatically replace the resource package of the original page in the application program and the theme resource configuration file of the hypertext markup language (HTML) page by inputting the theme replacement information of the application program, so that a new application program is generated, the quick replacement of the page theme in the application program is realized, and the development efficiency of the application program is effectively improved.
Hereinafter, a page theme changing method of the application program provided in the present application will be described in detail through the following several specific embodiments. It is to be understood that the following embodiments may be combined with each other and that some embodiments may not be repeated for the same or similar concepts or processes.
Fig. 1 is a flow chart of a method for replacing a page theme of an application according to an embodiment of the present application, where the method for replacing a page theme of the application may be executed by a software and/or hardware device. For example, referring to fig. 1, the page theme changing method of the application program may include:
and step 101, receiving theme change information input by a target object, wherein the theme change information comprises package name information of an application program to be changed, a target theme color and a target theme picture resource.
The target objects may be developers or clients, and specifically may be set according to actual needs, where each target object may correspond to a unique Identity (ID).
In the embodiment of the application, before replacing the page theme of the application program based on the theme replacement information input by the target object, the identity of the target object may be verified according to the identity ID of the target object, and after the identity verification is passed, the relevant steps of the page theme replacement method of the application program in the application may be executed based on the theme replacement information input by the target object, so that malicious replacement of the page theme of the application program by an illegal object may be avoided.
The package name information of the application program can be understood as the information for indicating the application program to be replaced; the target theme color of the page in the application program can be understood as the theme color of the new application program which is expected to be generated is the target theme color, and the target theme picture resource of the page can be understood as the theme picture resource of the new application program which is expected to be generated is the target theme picture resource.
For example, in the embodiment of the present application, when the target object inputs the theme change information, the theme change information may be input on a graphical interface, or may be input in other forms, and specifically may be set according to actual needs.
In this embodiment of the present application, when a target theme picture resource of a new application program that is expected to be generated is input, a target theme picture resource name corresponding to the target theme picture resource may be input in addition to the target theme picture resource being directly input, so after the input target theme picture resource name is received, the theme picture resource corresponding to the target theme picture resource name may be determined as the target theme picture resource based on a mapping relationship between the theme picture resource name and the theme picture resource corresponding to the target theme picture resource, so as to determine the target theme picture resource of the new application program that is expected to be generated.
For example, when the target subject picture resource name input by the target object is "animal", the subject picture resource with the target subject picture resource name of "animal" may be determined as the target subject picture resource; when the target theme picture resource name input by the target object is "plant", the theme picture resource named "plant" may be determined as the target theme picture resource.
In general, when a target theme color and a target theme picture resource of an application program change, a new application program is generated, in which case, package name information of the application program also changes accordingly, and the package name information of the target application program can also be modified adaptively.
In this case, the theme change information input by the target object may include, in addition to the current package name information of the application program, the target package name information that is desired to be changed, that is, the current package name information and the target package name information of the application program are included in the theme change information input by the target object, and the current package name information in the engineering configuration file corresponding to the native page may be changed based on the target package name information to obtain a new engineering configuration file, so that the package name information in the new engineering configuration file is the target package name information.
For example, in the embodiment of the present application, the engineering configuration file corresponding to the native page may be an engineering configuration file with a suffix name of xcodepro, and the package name information may be stored in a project. Pbxproj file under the xcodepro engineering configuration file, which may be specifically set according to actual needs.
For example, when the format of the engineering configuration file is json file format, and the current package name information in the engineering configuration file corresponding to the original page is replaced based on the target package name information, the format of the engineering configuration file can be converted first to obtain the engineering configuration file in extensible markup language xml format; and replacing the current package name information in the engineering configuration file in the extensible markup language xml format based on the target package name information, so that the package name information in the new engineering configuration file is targeted to include information.
After receiving the target theme color and the target theme picture resource input by the target object, the theme color and the theme picture resource in the native page of the application program can be replaced based on the target theme color and the target theme picture resource, that is, the following steps 102 and 103 are executed; and replacing the theme colors and theme picture resources in the hypertext markup language HTML page of the application based on the target theme colors and the target theme picture resources, i.e., performing step 104 described below.
102, replacing the theme colors in the theme information configuration file corresponding to the original page of the application program based on the target theme colors to obtain a new theme information configuration file; and replacing the theme picture resources in the picture resource file corresponding to the original page based on the target theme picture resources to obtain a new picture resource file.
For example, in the embodiment of the present application, the theme color corresponding to the native page may be stored in the theme information configuration file with the suffix name of. H; the theme picture resource corresponding to the original page can be stored in a picture resource file named as Assets.
For example, when the target theme color input by the target object is "red", the theme color in the theme information configuration file with the suffix name of. H may be replaced based on "red", so as to obtain a new theme color in the theme information configuration file with the suffix name of. H is "red"; when the target theme color input by the target object is 'red-green-alternate', the theme color in the theme information configuration file with the suffix name of h can be replaced based on the 'red-green-alternate', so that the new theme color in the theme information configuration file with the suffix name of h is 'red-green-alternate', and the like, and the theme color can be specifically set according to actual needs.
When the target theme picture resource input by the target object is the animal theme picture resource, the theme picture resource in the picture resource file named as the assems.xcossets can be replaced based on the animal theme picture resource, so that the new theme picture resource in the picture resource file named as the assems.xcossets is the animal theme picture resource; when the target theme color input by the target object is the "plant theme picture resource", the theme picture resource in the picture resource file named as the assems.xcossets can be replaced based on the "plant theme picture resource", so that the new theme picture resource in the picture resource file named as the assems.xcossets is the "plant theme picture resource", and the like, and the setting can be specifically performed according to actual needs.
For example, in the embodiment of the present application, when replacing the theme picture resource in the picture resource file corresponding to the native page based on the target theme picture resource, the image set imageset in the picture resource file may be parsed first to obtain the parsed imageset, and then the theme picture resource in the parsed imageset is replaced.
It can be understood that in the embodiment of the present application, when the theme colors in the theme information configuration file corresponding to the native page of the application program are changed, only the common theme colors or only the functional theme colors may be changed, and both the common theme colors and the functional theme colors may be changed at the same time, and specifically may be set according to actual needs.
Changing the theme colors in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; and based on the target theme picture resource, replacing the theme picture resource in the picture resource file corresponding to the original page to obtain a new picture resource file, and then executing the following step 103:
and 103, packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page.
After the new theme information configuration file and the new picture resource file are packaged, the obtained installation package of the original page comprises the following components: a new theme information profile and a new picture resource file.
It may be understood that, when the theme change information input by the target object further includes the current package name information and the target package name information of the application program, in combination with the description in the above step 101, the current package name information in the engineering configuration file corresponding to the native page may be changed based on the target package name information, so as to obtain a new engineering configuration file. In this case, the new engineering configuration file, the new theme information configuration file and the new picture resource file may be packaged together, where the installation package of the obtained native page includes: a new engineering configuration file, a new theme information configuration file, and a new picture resource file.
For example, in the embodiment of the present application, if the theme change information input by the target object further includes the target storage location, after the installation package of the native page is generated, the installation package of the native page may be stored in the target storage location. It may be understood that, if the theme change information input by the target object does not include the target storage location, after the installation package of the native page is generated, the installation package of the native page may be stored in the default storage location, and may specifically be set according to actual needs.
Combining the related descriptions of the step 102 and the step 103, the change of the theme colors and the theme picture resources in the native page of the application program can be realized based on the target theme colors and the target theme picture resources; next, the replacement of the theme colors and theme picture resources in the HTML page of the hypertext markup language of the application program will be implemented based on the target theme colors and the target theme picture resources through step 104 described below.
Step 104, replacing the theme colors in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program based on the target theme colors; and replacing the theme picture resources in the theme resource configuration file based on the target theme picture resources to obtain a new theme resource configuration file.
The theme resource configuration file may be understood as a resource file extracted from a resource file corresponding to the HTML page, and is dedicated to storing the theme colors and theme pictures of the HTML page.
Illustratively, in the embodiment of the present application, when the theme color in the theme resource configuration file corresponding to the HTML page of the hypertext markup language of the application program is changed based on the target theme color, the common theme color in the theme resource configuration file may be changed based on the target theme color; and changing the function theme colors in the theme resource configuration file based on the target theme colors, so that the theme colors in the theme resource configuration file corresponding to the HTML page are changed.
For example, the common theme colors in the theme resource configuration file may be stored in a common style file common. Css in the theme resource configuration file, and may specifically be set according to actual needs.
It can be understood that when the theme colors in the theme resource configuration file corresponding to the hypertext markup language HTML page of the application program are replaced based on the target theme colors, only the common theme colors or the functional theme colors can be replaced in addition to the common theme colors and the functional theme colors, and the setting can be specifically performed according to actual needs.
For example, when the target theme color input by the target object is "red", the common theme color in the common style file common. Css in the theme resource configuration file may be replaced based on "red", and the common theme color in the common style file common. Css in the new theme resource configuration file is "red"; when the target theme color input by the target object is 'red-green phase', the common theme color in the common style file common. Css in the theme resource configuration file can be replaced based on the 'red-green phase', the common theme color in the common style file common. Css in the obtained new theme resource configuration file is 'red-green phase', and the like, and the setting can be specifically performed according to actual needs.
For example, in the embodiment of the present application, there are many resource files corresponding to HTML pages, the theme resource configuration file is one of many resource files corresponding to HTML page settings, and before the page theme of the application program is replaced, the theme resource configuration file corresponding to the HTML page theme replacement may be extracted from the resource files corresponding to the HTML pages in the hypertext markup language in advance to create an independent resource file. Thus, when the HTML page of the application program is modified, the searching time of the theme resource configuration file corresponding to the HTML page of the hypertext markup language can be saved.
For example, in the embodiment of the present application, if the theme change information input by the target object further includes the target storage location, after generating the new theme resource configuration file of the HTML page, the theme resource configuration file corresponding to the HTML page may be stored in the target storage location.
It can be understood that, if the theme change information input by the target object does not include the target storage location, after the theme resource configuration file corresponding to the HTML page is generated, the theme resource configuration file corresponding to the HTML page may be stored in the default storage location, and may specifically be set according to actual needs.
It should be noted that, in the embodiment of the present application, there is no sequence between the steps 102 to 103 and the step 104, and the steps 102 to 103 may be executed first and then the step 104 may be executed. Step 104 may be performed first, and then steps 102 to 103 may be performed; of course, the steps 102-103 and 104 may be performed simultaneously, and may be specifically set according to actual needs, where the embodiment of the present application only uses the steps 102-103 and then the step 104 as an example for illustration, but the embodiment of the present application is not limited thereto.
After the installation package of the native page is generated based on the steps 102-103 and the new theme resource configuration file of the HTML page is generated based on the step 104, and the replacement of the theme colors and theme picture resources of the native page and the HTML page of the application is completed, the following step 105 may be executed:
step 105, generating a new application program based on the installation package of the original page and the new theme resource configuration file.
For example, in the embodiment of the present application, when generating a new application based on an installation package and a new theme resource configuration file of a native page, in a possible implementation manner, if the theme change information input by the target object further includes the target storage location, the installation package and the new theme resource configuration file may be searched from the target storage location first, and the new application may be generated based on the searched installation package and the new theme resource configuration file.
In another possible implementation manner, if the theme change information input by the target object does not include the target storage location, the installation package and the new theme resource configuration file may be searched from the default storage location, and a new application program may be generated based on the searched installation package and the new theme resource configuration file.
It can be seen that, in the embodiment of the present application, when a page theme of a mixed mode application is changed, theme change information input by a target object may be received, where the theme change information includes package name information, a target theme color, and a target theme picture resource of the application to be changed; based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; based on the installation package of the original page and the new theme resource configuration file, a new application program is generated. Therefore, the target object can automatically replace the resource package of the original page in the application program and the theme resource configuration file of the hypertext markup language (HTML) page by inputting the theme replacement information of the application program, so that a new application program is generated, the quick replacement of the page theme in the application program is realized, and the development efficiency of the application program is effectively improved.
Based on the embodiment shown in fig. 1, when the step 104 is executed to generate a new theme resource configuration file, the generating process of the new theme resource configuration file may be monitored, and if it is monitored that the new theme resource configuration file is abnormal, a new application program is generated based on the installation package of the native page and the default theme resource configuration file, so that normal display of the page may be effectively ensured; the default theme resource configuration file comprises default theme colors and default theme picture resources.
For example, in the embodiment of the present application, if an abnormal situation of the new topic resource configuration file is monitored, log information corresponding to the abnormal topic resource configuration file is generated and reported, where the log information is used to locate a cause of the abnormality of the new topic resource configuration file, so as to provide a basis for subsequent locating work.
For example, in the embodiment of the application, when a new application program is generated based on the installation package of the original page and the new theme resource configuration file, some cache engineering files may occupy memory, so that in order to maximize memory utilization, scripts may be called to clean the cache engineering files in the original page and the hypertext markup language HTML page, and the occupied space of the files is saved.
It can be understood that after the new application program is generated, the issuing command can be executed first to issue the new application program into the test environment, and if the test result of the new application program in the test environment does not exceed the error threshold range, the new application program can be sent to the user or other formal environments for use.
The description of the device for replacing the page theme of the application program provided by the application is provided below, and the device for replacing the page theme of the application program described below and the method for replacing the page theme of the application program described above can be correspondingly referred to each other.
Fig. 2 is a schematic structural diagram of a page theme changing apparatus 20 of an application provided in an embodiment of the present application, and as shown in fig. 2, for example, the page theme changing apparatus 20 of an application may include:
an input unit 201, configured to receive theme change information input by a target object, where the theme change information includes package name information of an application to be changed, a target theme color, and a target theme picture resource.
The first processing unit 202 is configured to replace a theme color in a theme information configuration file corresponding to a native page of the application program based on the target theme color, so as to obtain a new theme information configuration file; and replacing the theme picture resources in the picture resource file corresponding to the original page based on the target theme picture resources to obtain a new picture resource file.
And the second processing unit 203 is configured to perform packaging processing on the new theme information configuration file and the new picture resource file, so as to obtain an installation package of the native page.
A third processing unit 204, configured to replace a theme color in a theme resource configuration file corresponding to a hypertext markup language HTML page of the application program based on the target theme color; and replacing the theme picture resources in the theme resource configuration file based on the target theme picture resources to obtain a new theme resource configuration file.
The fourth processing unit 205 is configured to generate a new application program based on the installation package of the native page and the new theme resource configuration file.
Illustratively, in the embodiment of the present application, the page theme changing apparatus 20 of the application further includes a fifth processing unit configured to:
replacing current package name information in the engineering configuration file corresponding to the original page based on the target package name information to obtain a new engineering configuration file; correspondingly, the second processing unit 203 is specifically configured to: and packaging the new engineering configuration file, the new theme information configuration file and the new picture resource file.
Illustratively, in the embodiment of the present application, the format of the engineering configuration file is json file format, and the fifth processing unit is specifically configured to:
Converting the format of the engineering configuration file to obtain an engineering configuration file in an extensible markup language format; and replacing the current package name information in the engineering configuration file in the extensible markup language format based on the target package name information.
Illustratively, in the embodiment of the present application, in the case where the theme change information further includes the target storage location, the page theme change apparatus 20 of the application further includes a sixth processing unit configured to:
storing the installation package of the original page and the new theme resource configuration file in a target storage position; correspondingly, the fourth processing unit 205 is specifically configured to: and searching the installation package and the new theme resource configuration file from the target storage position, and generating a new application program based on the searched installation package and the new theme resource configuration file.
Illustratively, in the present embodiment, the third processing unit 204 is specifically configured to:
changing the common theme colors in the theme resource configuration file based on the target theme colors; and replacing the function theme colors in the theme resource configuration file based on the target theme colors.
Illustratively, in the embodiment of the present application, the page theme changing apparatus 20 of the application further includes a seventh processing unit, configured to:
Under the condition that the abnormality of the new theme resource configuration file is monitored, generating a new application program based on the installation package of the original page and the default theme resource configuration file; the default theme resource configuration file comprises default theme colors and default theme picture resources.
Illustratively, in the embodiment of the present application, the page theme changing apparatus 20 of the application further includes an eighth processing unit configured to:
under the condition that the abnormality of the new theme resource configuration file is monitored, corresponding log information is generated; and reporting log information, wherein the log information is used for positioning the reason of the abnormality of the new theme resource configuration file.
The device 20 for replacing the page theme of the application program according to the embodiment of the present application may execute the technical scheme of the method for replacing the page theme of the application program in any embodiment, and the implementation principle and the beneficial effects of the method for replacing the page theme of the application program are similar to those of the method for replacing the page theme of the application program, and may refer to the implementation principle and the beneficial effects of the method for replacing the page theme of the application program, which are not described herein.
Fig. 3 is a schematic physical structure diagram of an electronic device provided in the present application, and as shown in fig. 3, the electronic device may include: processor 310, communication interface (Communications Interface) 320, memory 330 and communication bus 340, wherein processor 310, communication interface 320, memory 330 accomplish communication with each other through communication bus 340. The processor 310 may invoke logic instructions in the memory 330 to perform a page theme change method for an application, the method comprising: receiving theme change information input by a target object, wherein the theme change information comprises package name information, target theme color and target theme picture resources of an application program to be changed; based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; based on the installation package of the original page and the new theme resource configuration file, a new application program is generated.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute a method for changing a page theme of an application program provided by the above methods, and the method includes: receiving theme change information input by a target object, wherein the theme change information comprises package name information, target theme color and target theme picture resources of an application program to be changed; based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; based on the installation package of the original page and the new theme resource configuration file, a new application program is generated.
In yet another aspect, the present application further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method for page theme change of an application provided by the above methods, the method comprising: receiving theme change information input by a target object, wherein the theme change information comprises package name information, target theme color and target theme picture resources of an application program to be changed; based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file; packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page; based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; based on the installation package of the original page and the new theme resource configuration file, a new application program is generated.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. A method for changing a page theme of an application program, comprising:
receiving theme change information input by a target object, wherein the theme change information comprises package name information of an application program to be changed, a target theme color and a target theme picture resource;
based on the target theme color, changing the theme color in the theme information configuration file corresponding to the original page of the application program to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file;
Packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page;
based on the target theme color, changing the theme color in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; the theme colors comprise public theme colors and/or functional theme colors;
and generating a new application program based on the installation package of the original page and the new theme resource configuration file.
2. The page theme changing method of an application according to claim 1, wherein in a case where the package name information includes current package name information and target package name information, the method further comprises:
based on the target package name information, replacing the current package name information in the engineering configuration file corresponding to the original page to obtain a new engineering configuration file;
correspondingly, the packaging processing of the new theme information configuration file and the new picture resource file includes:
And packaging the new engineering configuration file, the new theme information configuration file and the new picture resource file.
3. The method for replacing a page theme of an application program according to claim 2, wherein the format of the engineering configuration file is json file format, and the replacing the current package name information in the engineering configuration file corresponding to the native page based on the target package name information includes:
converting the format of the engineering configuration file to obtain an engineering configuration file in an extensible markup language format;
and replacing the current package name information in the engineering configuration file in the extensible markup language format based on the target package name information.
4. The page theme change method of an application according to claim 1 or 2, wherein in a case where the theme change information further includes a target storage location, the method further includes:
storing the installation package of the original page and the new theme resource configuration file in the target storage position;
correspondingly, the generating a new application program based on the installation package of the native page and the new theme resource configuration file includes:
And searching the installation package and the new theme resource configuration file from the target storage position, and generating a new application program based on the searched installation package and the new theme resource configuration file.
5. The method for changing a theme of a page of an application program according to claim 1 or 2, wherein the changing the theme color in the theme resource configuration file corresponding to the HTML page of the application program based on the target theme color includes:
changing the common theme colors in the theme resource configuration file based on the target theme colors;
and replacing the function theme colors in the theme resource configuration file based on the target theme colors.
6. The page theme changing method of an application program according to claim 1 or 2, characterized in that the method further comprises:
generating a new application program based on the installation package of the original page and a default theme resource configuration file under the condition that the new theme resource configuration file is monitored to be abnormal;
the default theme resource configuration file comprises default theme colors and default theme picture resources.
7. The method for page theme change of an application of claim 6, further comprising:
generating corresponding log information under the condition that the new theme resource configuration file is monitored to be abnormal;
and reporting the log information, wherein the log information is used for positioning the reason of the abnormality of the new theme resource configuration file.
8. A page theme changing apparatus of an application program, comprising:
the input unit is used for receiving theme change information input by the target object, wherein the theme change information comprises package name information, target theme color and target theme picture resources of an application program to be changed;
the first processing unit is used for replacing the theme colors in the theme information configuration file corresponding to the original page of the application program based on the target theme colors to obtain a new theme information configuration file; based on the target theme picture resource, replacing theme picture resources in a picture resource file corresponding to the original page to obtain a new picture resource file;
the second processing unit is used for packaging the new theme information configuration file and the new picture resource file to obtain an installation package of the original page;
The third processing unit is used for replacing the theme colors in the theme resource configuration file corresponding to the hypertext markup language (HTML) page of the application program based on the target theme colors; based on the target theme picture resource, replacing the theme picture resource in the theme resource configuration file to obtain a new theme resource configuration file; the theme colors comprise public theme colors and/or functional theme colors;
and the fourth processing unit is used for generating a new application program based on the installation package of the original page and the new theme resource configuration file.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the page theme change method of the application program according to any one of claims 1-7 when executing the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the page theme change method of an application program according to any one of claims 1-7.
CN202311527624.4A 2023-11-16 2023-11-16 Page theme changing method and device of application program and electronic equipment Active CN117234623B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311527624.4A CN117234623B (en) 2023-11-16 2023-11-16 Page theme changing method and device of application program and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311527624.4A CN117234623B (en) 2023-11-16 2023-11-16 Page theme changing method and device of application program and electronic equipment

Publications (2)

Publication Number Publication Date
CN117234623A CN117234623A (en) 2023-12-15
CN117234623B true CN117234623B (en) 2024-02-20

Family

ID=89084813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311527624.4A Active CN117234623B (en) 2023-11-16 2023-11-16 Page theme changing method and device of application program and electronic equipment

Country Status (1)

Country Link
CN (1) CN117234623B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077118A (en) * 2013-03-27 2014-10-01 腾讯科技(深圳)有限公司 Resource customization method and resource customization device of application program
CN106802794A (en) * 2016-12-20 2017-06-06 智车优行科技(北京)有限公司 Method for switching theme, device, vehicle and system
CN110347454A (en) * 2018-04-08 2019-10-18 珠海市魅族科技有限公司 Application program theme setting method, terminal equipment control method and device, terminal device and computer readable storage medium
CN111796896A (en) * 2020-06-29 2020-10-20 京东方科技集团股份有限公司 Theme switching method of application page and related equipment
CN112394933A (en) * 2020-11-27 2021-02-23 平安普惠企业管理有限公司 Method, device and equipment for replacing theme resources and readable storage medium
CN113157270A (en) * 2021-04-26 2021-07-23 北京京东拓先科技有限公司 Page adaptation method and device
CN114077423A (en) * 2021-10-18 2022-02-22 青岛民航凯亚系统集成有限公司 Airport APP development container architecture based on mobile cross-platform
CN114090925A (en) * 2021-11-22 2022-02-25 中国建设银行股份有限公司 Switching method and device of visual theme, electronic equipment and storage medium
CN115220847A (en) * 2022-07-30 2022-10-21 重庆长安汽车股份有限公司 Switching method of mobile application theme, mobile application system, equipment and medium
CN115495188A (en) * 2022-09-27 2022-12-20 重庆长安汽车股份有限公司 Theme color switching method, device, equipment and medium for hybrid development APP
CN115794285A (en) * 2022-11-28 2023-03-14 重庆长安汽车股份有限公司 Online theme switching method, device, equipment and medium
CN115858978A (en) * 2022-11-29 2023-03-28 中国建设银行股份有限公司 Page loading method and device based on updated resources

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077118A (en) * 2013-03-27 2014-10-01 腾讯科技(深圳)有限公司 Resource customization method and resource customization device of application program
CN106802794A (en) * 2016-12-20 2017-06-06 智车优行科技(北京)有限公司 Method for switching theme, device, vehicle and system
CN110347454A (en) * 2018-04-08 2019-10-18 珠海市魅族科技有限公司 Application program theme setting method, terminal equipment control method and device, terminal device and computer readable storage medium
CN111796896A (en) * 2020-06-29 2020-10-20 京东方科技集团股份有限公司 Theme switching method of application page and related equipment
CN112394933A (en) * 2020-11-27 2021-02-23 平安普惠企业管理有限公司 Method, device and equipment for replacing theme resources and readable storage medium
CN113157270A (en) * 2021-04-26 2021-07-23 北京京东拓先科技有限公司 Page adaptation method and device
CN114077423A (en) * 2021-10-18 2022-02-22 青岛民航凯亚系统集成有限公司 Airport APP development container architecture based on mobile cross-platform
CN114090925A (en) * 2021-11-22 2022-02-25 中国建设银行股份有限公司 Switching method and device of visual theme, electronic equipment and storage medium
CN115220847A (en) * 2022-07-30 2022-10-21 重庆长安汽车股份有限公司 Switching method of mobile application theme, mobile application system, equipment and medium
CN115495188A (en) * 2022-09-27 2022-12-20 重庆长安汽车股份有限公司 Theme color switching method, device, equipment and medium for hybrid development APP
CN115794285A (en) * 2022-11-28 2023-03-14 重庆长安汽车股份有限公司 Online theme switching method, device, equipment and medium
CN115858978A (en) * 2022-11-29 2023-03-28 中国建设银行股份有限公司 Page loading method and device based on updated resources

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Tracking Context Switches in Text Documents and Its Application to Sentiment Analysis;Srishti Sharma et al.;《IEEE Xplore》;全文 *
基于HTML5 PLUS的移动温控客户端开发;王刚 等;科学技术创新(第32期);全文 *
基于mui和H5+混合应用的菜篮子APP设计和实现;谭晖涛 等;信息通信(第05期);全文 *
智能手机个性化主题设计与开发;罗孟 等;大众科技(第09期);全文 *

Also Published As

Publication number Publication date
CN117234623A (en) 2023-12-15

Similar Documents

Publication Publication Date Title
US11216342B2 (en) Methods for improved auditing of web sites and devices thereof
CN107688538B (en) Script execution method and device and computing equipment
CN106598922B (en) Character string conversion method and system
US11726800B2 (en) Remote component loader
CN108459850B (en) Method, device and system for generating test script
CN110955409B (en) Method and device for creating resources on cloud platform
WO2021249356A1 (en) Form data verification method, system, server, and user terminal
CN113687858B (en) Configuration file checking method and device, electronic equipment and storage medium
US10599755B2 (en) System and method for automatically inserting correct escaping functions for field references in a multi-tenant computing environment
CN111177664A (en) Watermark information adding method, server and system
KR101596257B1 (en) System and method for developing of service based on software product line
CN111290996A (en) Document format conversion method, device, equipment and readable storage medium
US9542252B2 (en) Information processing technique for supporting data setting
CN117234623B (en) Page theme changing method and device of application program and electronic equipment
US20110246965A1 (en) Correcting document generation for policy compliance
US11762962B2 (en) Onboarding of monitoring tools
US10592388B1 (en) Methods for facilitating more efficient network message exchange and analysis and devices thereof
CN109783134B (en) Front-end page configuration method and device and electronic equipment
US9052906B2 (en) Modularized customization of a model in a model driven development environment
JP2005134995A (en) System, method and program for security management
CN115480745B (en) Code generation method and device based on configuration file
CN112667491A (en) Function test method and device of virtual machine
CN117235107B (en) Data access processing method and device, electronic equipment and storage medium
JP7477698B1 (en) Information processing device, information processing method, and program.
CN117331754B (en) Abnormality problem reduction method, abnormality problem reduction system, electronic device, and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant