CN113330427B - Quick application installation package debugging method and device, electronic equipment and storage medium - Google Patents

Quick application installation package debugging method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113330427B
CN113330427B CN201980089698.XA CN201980089698A CN113330427B CN 113330427 B CN113330427 B CN 113330427B CN 201980089698 A CN201980089698 A CN 201980089698A CN 113330427 B CN113330427 B CN 113330427B
Authority
CN
China
Prior art keywords
installation package
quick application
application installation
file
resource file
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
CN201980089698.XA
Other languages
Chinese (zh)
Other versions
CN113330427A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai 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 Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN113330427A publication Critical patent/CN113330427A/en
Application granted granted Critical
Publication of CN113330427B publication Critical patent/CN113330427B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A fast application installation package debugging method, device, electronic equipment and storage medium. The quick application installation package debugging method is applied to a quick application installation package debugging device and comprises the following steps: and acquiring a quick application installation package from the appointed address (S110), unpacking the quick application installation package to obtain an unpacked resource file (S120), calling a quick application development tool hap-tool, and debugging the unpacked resource file (S130). The method can debug any packaged quick application installation package, and because the quick application installation package to be debugged is unpacked before the quick application development tool is dynamically called, the unpacked resource file is obtained, and the problem that the quick application development tool hap-tool can only directly debug the source code of the quick application installation package is solved.

Description

Quick application installation package debugging method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for debugging a quick application installation package, an electronic device, and a storage medium.
Background
A Quick App is a download-free, search-and-use application. Quick application programs are generally corresponding to a quick application installation package, and a debugging mode for the quick application installation package is relatively lacking at present.
Disclosure of Invention
In view of the above problems, the present application provides a method, an apparatus, an electronic device, and a storage medium for debugging a quick application installation package, so as to improve the above problems.
In a first aspect, the present application provides a method for debugging a quick application installation package, which is applied to a device for debugging a quick application installation package, and the method includes: acquiring a quick application installation package from a designated address; unpacking the quick application installation package to obtain unpacked resource files; and calling a quick application development tool hap-tool to debug the unpacked resource file.
In a second aspect, the present application provides a fast application installation package debugging device, the device comprising: an installation package acquisition unit for acquiring a quick application installation package from a specified address; the unpacking unit is used for unpacking the quick application installation package to obtain unpacked resource files; and the debugging unit is used for calling a quick application development tool hap-tool to debug the unpacked resource file.
In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors to implement the methods described above.
In a fourth aspect, the present application provides a computer readable storage medium having program code stored therein, wherein the program code, when executed by a processor, performs the method described above.
According to the quick application installation package debugging method, the device, the electronic equipment and the storage medium, after the quick application installation package is obtained from the appointed address, the quick application installation package is unpacked to obtain the unpacked resource file, and then the quick application development tool hap-tool is called to debug the unpacked resource file, so that any packaged quick application installation package can be debugged, and because the quick application installation package to be debugged is unpacked before the quick application development tool is dynamically called, the unpacked resource file is obtained, the problem that the quick application development tool can only directly debug the source code of the quick application installation package is solved, and the universality of the quick application installation package debugging is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a fast application architecture according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for debugging a quick application installation package according to an embodiment of the present application;
FIG. 3 is a schematic view of a browser interface for inputting a server address for debugging in a method for debugging a quick application installation package according to an embodiment of the present application;
FIG. 4 is a flow chart illustrating a method for debugging a quick application installation package according to still another embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a fast application installation package development project established in a fast application installation package debugging method according to still another embodiment of the present application;
FIG. 6 is a flowchart of a method for debugging a quick application installation package according to another embodiment of the present application;
FIG. 7 is a flowchart of a method for debugging a quick application installation package according to another embodiment of the present application;
FIG. 8 is a schematic diagram of a result file created in a method for debugging a quick application installation package according to another embodiment of the present application;
FIG. 9 is a block diagram illustrating a fast application installation package debugging device according to an embodiment of the present application;
FIG. 10 is a block diagram illustrating a fast application installation package debugging device according to still another embodiment of the present application;
FIG. 11 is a block diagram illustrating a fast application installation package debugging device according to another embodiment of the present application;
FIG. 12 is a block diagram illustrating a fast application installation package debugging device according to another embodiment of the present application;
FIG. 13 shows a block diagram of an electronic device for performing a quick application installation package debugging method in accordance with an embodiment of the present application in real time;
fig. 14 illustrates a storage unit for storing or carrying program code implementing a quick application installation package debugging method according to an embodiment of the present application in real time.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
With the development of mobile internet technology, mobile terminal developers are more expected to realize the same functions as the aforementioned clients through quick application, so as to improve the development efficiency of smart home functions and save the storage space of the mobile terminal at the same time.
The fast application is a novel application form based on a terminal equipment hardware platform, is used without installation, and has both original application experience (performance, system integration, interaction and the like). As shown in the structural schematic diagram of the fast application engine in fig. 4, the front end design of the fast application references and integrates the design thought of the main stream front end framework (Vue, practice, etc.): the application is constructed in a componentization mode, the MVVM design mode with the data binding as the core is adopted, the performance is improved in a V-DOM mode, and meanwhile, a concise and clear template of the class Vue is selected.
In the development process of the quick application, related development means are completed based on a hap-tool, wherein the hap-tool is a developer tool of the quick application, and helps a developer to assist in completing development work through a command line tool, and mainly comprises functions of template creation engineering, upgrading engineering, compiling, debugging and the like.
However, the inventor finds that the hap-tool is used as a quick application development tool in the research, so that the development and debugging process of source codes of quick applications can be successfully completed, but the hap-tool does not have the unpacking function of the packaged quick application installation package (rpk), and only can directly debug the source codes of the quick applications, but the debugging work of the conventional quick application installation package is complex and various, so that under the condition that a developer or a later operation and maintenance person needs to debug or modify codes of the packaged quick application installation package, the original source codes need to be called or searched again, and great inconvenience is brought to the developer or the later operation and maintenance person.
Therefore, the inventor provides that the implementation in the application can debug any packaged quick application installation package, and because the quick application installation package to be debugged is unpacked before the quick application development tool is called, the unpacked resource file is obtained, and further, the problem that the quick application development tool can only directly debug the source code of the quick application installation package is solved, and the universality of the quick application installation package debugging is improved.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, the method for debugging a quick application installation package provided by the embodiment of the application is applied to a quick application installation package debugging device, and the method comprises the following steps:
step S110: a fast application installation package is obtained from the specified address.
It will be appreciated that the quick application installation package for subsequent debugging will be stored in a device, where the quick application installation package may be stored locally or on another device in the network. Regardless of where the fast application installation package is stored, there is a corresponding storage address. Wherein the storage address corresponding to the quick application installation package stored locally may include a storage path, and the storage address corresponding to the quick application installation package stored on other devices in the network may include a network address of the storage device and the storage path. For example, the corresponding storage address for the locally stored fast application installation package may be D \ quickapp \a.rpk. And the corresponding storage address for the quick application installation package stored on other devices in the network may be 192.168.1.3\quick app \a.rpk.
In this way, the debugger can input the address and the name of the quick application installation package in the designated address input area, and further, when the quick application installation package debugging device acquires the address input by the user and the name of the quick application installation package, the acquired address is used as the designated address, and then the quick application installation package corresponding to the name input by the user is acquired from the designated address. For example, if the information input by the user and obtained by the fast application installation package debugging device is D: \ quickapp \b.rpk, the fast application installation package debugging device uses D: \ quickapp \as the designated address, and then searches the folder of the D disk quickapp for the fast application installation package of b.rpk.
Step S120: unpacking the quick application installation package to obtain the unpacked resource file.
Step S130: and calling a quick application development tool hap-tool to debug the unpacked resource file.
It should be noted that, in this embodiment, the fast application development tool hap-toolkit exists as a component of the fast application installation package debugging device, and then the fast application installation package debugging device may call based on a manner of calling the fast application development tool hap-toolkit between components. It will be appreciated that the manner in which the component call is made may be adapted differently if the development language of the quick application installation package debugging device itself is not available.
For example, if the quick application installation package debugging device is developed based on Python, the quick application installation package debugging device may call the quick application development tool hap-toolkit based on os.system () function during operation, or alternatively, the quick application installation package debugging device may call the quick application development tool hap-toolkit based on ShellExecute function.
In this embodiment, the unpacked resource file may be loaded into the fast application installation package debugging device, and then the fast application development tool hap-tool is called to debug the unpacked resource file loaded into the fast application installation package debugging device. In another way, the unpacked resource file can be loaded into the fast application development tool hap-toolkit, and then the fast application development tool hap-toolkit is triggered to debug the unpacked resource file loaded into the fast application development tool hap-toolkit.
In this manner, it should be noted that, in the fast application installation package debugging device in this embodiment, the fast application development tool hap-tool is operated in the form of a functional module, and in this mode, the fast application development tool hap-tool is a functional module in the fast application installation package debugging device in this embodiment, so that the resource file loaded into the fast application installation package in this embodiment can be debugged.
In this way, the fast application development tool hap-tool may be a functional module in the fast application installation package debugging device or may be an independently running application program. When the fast application development tool hap-toolkit is an independently operated application program, the fast application installation package debugging device can send the storage position of the unpacked resource file to the fast application development tool hap-toolkit based on an inter-process communication mode, so that the fast application development tool hap-toolkit can load the unpacked resource file, and further subsequent debugging is conducted.
In the debugging process shown in fig. 3, the fast application installation package debugging device opens a debugging port locally, and at this time, uses a local browser to open http:// localhost:8000, and simultaneously opens a fast application debugger in an Android mobile phone connected to the same WiFi as the electronic device in which the fast application installation package debugging device is located. The debugging may then begin based on the manner prompted in the fast application debugger. For example, if code scanning debugging is selected, the two-dimensional code in the local browser page is scanned, and debugging can be started.
According to the quick application installation package debugging method, after the quick application installation package is obtained from the appointed address, the quick application installation package is unpacked to obtain the unpacked resource file, and then the quick application development tool hap-tool is called to debug the unpacked resource file, so that any packaged quick application installation package can be debugged, and because the quick application installation package to be debugged is unpacked before the quick application development tool is called, the unpacked resource file is obtained, the problem that the quick application development tool can only directly debug the source code of the quick application installation package is solved, and the universality of quick application installation package debugging is improved.
Referring to fig. 4, the method for debugging a quick application installation package provided by the embodiment of the application is applied to a quick application installation package debugging device, and the method comprises the following steps:
step S210: a fast application installation package is obtained from the specified address.
Step S220: unpacking the quick application installation package to obtain the unpacked resource file.
Step S230: and establishing a new quick application installation package development project, wherein the new quick application installation package development project is configured with resource files of an initial quick application installation package.
As one way, the quick application installation package debugging device creates a quick application installation package development project after executing the instruction hapinit < ProjectName >. Wherein "ProjectName" characterizes the name of the new project. The new quick application installation package development project comprises a resource file as shown in fig. 5, wherein the resource file mainly comprises two resource folders of sign and src and a package file, wherein the sign mainly stores the resource file required by signature, and the src mainly comprises an index file for recording source codes and a manifest file for recording configuration information. It will be appreciated that the newly created quick application installation package development project includes the various resource files shown in fig. 5, except that the content of the resource files included in the newly created quick application installation package development project is the default initial content. For example, the initial content may be "hello quickapp" in the index. Ux file that records the source code, or the content may be empty in the resource file of some initial quick application installation packages.
Step S240: and replacing the resource file of the initial quick application installation package with the unpacked resource file.
It will be understood that, for the aforementioned unpacked resource file, various files shown in the figure may be included, but for the content in the unpacked resource file, the content is edited by the developer. And after the unpacked resource file is obtained, replacing the resource file of the initial quick application installation package with the unpacked resource file. For example, in this step, the index. Ux file in the unpacked resource file is replaced with the index. Ux file in the new quick application installation package development project, and the manifest. Json file in the unpacked resource file is also replaced with the manifest. Json file in the new quick application installation package development project.
Step S250: and calling a quick application development tool hap-tool to debug the newly-built quick application installation package development project so as to debug the unpacked resource file.
Step S260: calling a quick application development tool hap-tool to sign the debugged resource file based on a designated signature and package the debugged resource file into a quick application installation package, wherein the designated signature is different from the original signature of the quick application installation package obtained from the designated address.
It should be noted that, the signature of the quick application installation package is used to protect the integrity of the file, and the use principle of the signature is as follows: when compiling and packaging, firstly, carrying out SHA256 operation on each file in rpk packages, then carrying out signature operation on the SHA256 result by using a signature private key and a certificate, and finally packaging the result in a quick application installation package by using a file named as/META-INF/CERT. When the quick application installation package runs, checking the signed SHA256 value to see whether the signed SHA256 value is equal to the current file SHA256 value, if not, checking fails, and the fact that the file in the quick application installation package is modified is proved, so that the quick application installation package with the checking failure cannot be run normally.
If the code of the resource file is modified during the process of debugging the unpacked resource file, the quick application installation package debugging device will re-sign the debugged resource file based on the designated signature in order to avoid the above problem. The quick application installation package debugging device can find and delete the/META-INF/CERT file with the signature result stored in the unpacking folder, then use other legal signature private keys and certificates in the packing process (as a mode, the embodiment can directly use the debug signature provided by the authorities, and save the operation of regenerating a signature) to call the quick application development tool hap-tool to sign and pack the unpacking file directory, and generate a new/CERT file.
It should be noted that the above file names are only exemplary, as long as the corresponding stored contents are the same, which is within the protection scope of the present application.
In the packaging process, as a mode, a quick application development tool hap-tool is called to create an empty packaging project, packaging configuration information of the packaging project is updated to information of the debugged resource file, updated packaging configuration information is obtained, and the debugged resource file is signed and packaged into a quick application installation package based on the updated packaging configuration information and a designated signature.
Wherein, the optional packing engineering is webpack packing engineering. Wherein webpack can be regarded as a module packer: what it does is to analyze the project structure, find out the expansion language (Scss, TYPESCRIPT, etc.) that some other browsers cannot run directly, and convert and package it into a suitable format for the browser to use.
As a way, after signing and packaging the debugged resource file into a quick application installation package, the debugged resource file in the new quick application installation package development project can be replaced by the resource file of the initial quick application installation package.
Besides directly establishing a new quick application installation package development project in the quick application installation package debugging device, the quick application installation package can be obtained from a designated address, unpacking is carried out on the quick application installation package, after a unpacked resource file is obtained, a quick application development tool hap-toolkit is directly called, the quick application installation package development project is newly established in the called quick application development tool hap-toolkit, and the quick application installation package development project newly established in the quick application development tool hap-toolkit is identical to the initial resource file included in the new quick application installation package development project established in the quick application installation package debugging device.
In this embodiment, the contents of steps S210 to S250 in this embodiment may be executed again for the obtained quick application installation package packaged after the debugging, so that in this case, when there is a code modification in the debugging process, it may be immediately verified whether the code modification can be successfully executed. Wherein, as a way, the fast application installation package debugging device can provide a command line input interface so that a user can input corresponding instructions in the command line input interface to trigger the fast application installation package debugging device to execute certain steps in the corresponding embodiment.
For example, in the case where the "-d" command characterizes the start of debugging, when the command line input interface is detected to have the command "-d" input, execution of steps S210 to S260 is started. It is also possible to perform only steps S210 to S250 when a command "-d" input is detected, and then perform the contents of step S260 on the resource file after having been debugged when a command "-f" input is further detected in the command line input interface. In addition, the user may also input two or more commands simultaneously in the command line input interface, for example, after the fast application installation package debugging device executes to step S250 in response to the command "-d", the user may input the commands "-d" and "-f" simultaneously so that the fast application installation package debugging device may start executing the contents of steps 210 to S250 on the newly packaged fast application installation package again after packaging.
According to the quick application installation package debugging method, after the quick application installation package is obtained from the appointed address, the quick application installation package is unpacked to obtain the unpacked resource file, then a quick application installation package development project comprising the resource file of the initial quick application installation package can be newly built, the resource file of the initial quick application installation package is replaced by the unpacked resource file, and then the quick application development tool hap-tool is called to debug the newly built project, so that any packaged quick application installation package can be debugged, and because the quick application installation package to be debugged is unpacked before the quick application development tool is called, the unpacked resource file is obtained, the problem that the quick application development tool can only directly debug the source code of the quick application installation package is solved, and the universality of quick application installation package debugging is improved. Furthermore, since the debugging is performed on the development engineering of the quick application installation package, the debugging process of the hap-tool is not required to be modified, and the universality of the debugging process is further improved. And the configuration and the calling of the called hap-tool kit are also realized dynamically in the debugging process.
Referring to fig. 6, the method for debugging a quick application installation package provided by the embodiment of the application is applied to a quick application installation package debugging device, and the method comprises the following steps:
step S310: if the file input instruction is identified, the type of the input file is identified.
In the embodiment of the application, after the file input instruction is identified, the type of the file can be identified by identifying the suffix name of the input file. For example, if the suffix name of the file is rpk, the inputted file may be identified as a file of the quick application installation package type, and if the suffix name of the file is js, the type of the inputted file may be identified as js file type.
Step S320: and if the type of the input file is identified as the quick application installation package, acquiring the quick application installation package from the appointed address.
Step S330: unpacking the quick application installation package to obtain the unpacked resource file.
Step S340: and calling a quick application development tool hap-tool to debug the unpacked resource file.
Step S350: if the input file is identified as the JavaScript file, typesetting codes included in the JavaScript file according to a specified format so as to facilitate viewing.
As a way, restoring the deleted codes of the JavaScript file in the packaging process; typesetting the codes in the restored JavaScript file according to a specified format.
It should be noted that, if the JavaScript file is detected in the unpacked resource file, the code included in the JavaScript file in the unpacked resource file may be typeset according to the specified format. In order to facilitate the fast application installation package debugging device to distinguish the JavaScript files subjected to format adjustment, the fast application installation package debugging device can reestablish the content of one JavaScript file after format adjustment, and name a JavaScript file with format adjustment different from the content, so as to distinguish the JavaScript files with format adjustment.
The quick application installation package debugging method provided by the application can realize debugging on any packaged quick application installation package, and because the quick application installation package to be debugged is unpacked before the quick application development tool is called, the unpacked resource file is obtained, thereby simultaneously improving the problem that the quick application development tool can only directly debug the source code of the quick application installation package, and improving the universality of the quick application installation package debugging. In addition, in this embodiment, after identifying that the read file is a JavaScript file, format conversion may be performed on the JavaScript file, so as to further improve the reading experience of the user.
Referring to fig. 7, the method for debugging a quick application installation package provided by the embodiment of the application is applied to a quick application installation package debugging device, and the method comprises the following steps:
step S410: a fast application installation package is obtained from the specified address.
Step S420: unpacking the quick application installation package to obtain the unpacked resource file.
Step S430: and calling a quick application development tool hap-tool to debug the unpacked resource file.
Step S440: and acquiring a configuration file in the unpacked resource file, wherein codes in the configuration file comprise function interfaces called by the quick application installation package acquired from the appointed address.
It should be noted that, in order to make the developed quick application have a certain function, a certain pre-configured function interface is called in the development process, however, in the process of calling the function interface, a debugging error may occur in the whole quick application installation package due to an error of a calling code, so in order to facilitate a debugger to find out an error source in time, when it is identified that an error occurs in the process of debugging the unpacked resource file, a configuration file in the unpacked resource file may be obtained. In the embodiment of the application, various modes can be used for detecting whether errors occur in the debugging process.
As one way, whether an error occurs in the debugging process can be detected based on the image recognition. Specifically, when the code runs abnormally, a dialog box is popped up on the interface of the quick application development tool hap-tool kit, and when two application programs running independently of each other are arranged between the quick application installation package debugging device and the quick application development tool hap-tool kit, the quick application installation package debugging device cannot directly acquire specific error information, so that the quick application installation package debugging device can detect the interface of the quick application development tool hap-tool kit in real time based on an image recognition mode after the quick application development tool hap-tool kit starts to be debugged, and after the dialog box is popped up, the error in the debugging process can be judged. By the method, whether an error occurs in the debugging process can be detected even if the quick application installation package debugging device cannot acquire the debugging information output by the quick application development tool hap-tool kit.
In addition, as another way, in the way that the quick application installation package debugging device and the quick application development tool hap-tool are called based on the component way, the quick application installation package debugging device can directly detect an interface of the debugging output information after the quick application development tool hap-tool starts to debug, and when the fact that the designated text output exists is detected, the error in the debugging process can be judged.
Step S450: the read function interface scans the demand information.
Step S460: and scanning the configuration file based on the function interface scanning requirement information to obtain the function interface called by the quick application installation package acquired from the appointed address.
The configuration file is a manifest.
Step S470: and outputting the obtained functional interface to a result file.
As one way, the scan requirement information includes a target type of a required scan and an output pattern; the step of scanning the configuration file based on the function interface scanning requirement information comprises the following steps: scanning the type matched with the target type in the function interface included in the configuration file; the step of outputting the obtained functional interface to a result file comprises the following steps: and outputting the obtained functional interface to a result file according to the output style.
For example, as shown in fig. 8, a style of content is output for a result file. An explanation of the interface function is correspondingly configured for each of the searched functional interfaces in the result file shown in fig. 8. For example, "< vendor account service >", "< payment for the payment device >" "< network request >", etc.
It should be noted that, the quick application installation package debugging device in this embodiment may also identify how to call the quick application development tool hap-tool, and determine the display position of the final result file according to the identified calling mode, so as to facilitate the debugging personnel to check. Alternatively, if the fast application installation package debugging device identifies that the fast application development tool hap-toolkit is invoked based on the inter-process communication mode, the result file may be displayed in the form of a pop-up box in the fast application development tool hap-toolkit. It will be appreciated that the pop-up box displaying the results file is popped up by the quick application installation package debugging device, except that the display location coincides with the quick application development tool hap-tool kit. By the method, even if the quick application installation package debugging device cannot acquire the debugging information output by the quick application development tool hap-tool, the function interface file can be displayed timely, so that the user can refer to the function interface file during debugging.
The quick application installation package debugging method provided by the application can realize debugging on any packaged quick application installation package, and because the quick application installation package to be debugged is unpacked before the quick application development tool is called, the unpacked resource file is obtained, thereby simultaneously improving the problem that the quick application development tool can only directly debug the source code of the quick application installation package, and improving the universality of the quick application installation package debugging. Furthermore, in this embodiment, the configuration file in the resource file may be scanned, so that the function interface called in the decompressed quick application installation package may be output, so as to facilitate the user to view.
Referring to fig. 9, a fast application installation package debugging device 500 according to an embodiment of the present application is provided, where the device 500 includes:
an installation package obtaining unit 510 for obtaining a quick application installation package from a specified address.
And the unpacking unit 520 is configured to unpack the fast application installation package to obtain an unpacked resource file.
And the debugging unit 530 is configured to call a fast application development tool hap-tool to debug the unpacked resource file.
As shown in fig. 10, the debug unit 530 specifically includes:
The development project building subunit 531 is configured to create a new quick application installation package development project, where the new quick application installation package development project is configured with a resource file of an initial quick application installation package.
An information replacing subunit 532, configured to replace the resource file of the initial fast application installation package with the unpacked resource file.
And the debugging execution subunit 533 is configured to call a quick application development tool hap-tool to debug the newly-built quick application installation package development project, so as to debug the unpacked resource file.
Furthermore, as an aspect, the apparatus 500 further includes:
And a packaging unit 540, configured to invoke a quick application development tool hap-toolkit to sign the debugged resource file based on a specified signature and package the debugged resource file into a quick application installation package, where the specified signature is different from the original signature of the quick application installation package obtained from the specified address.
Optionally, the packing unit 540 is specifically configured to call a fast application development tool hap-tool to create an empty packing project; updating the packaging configuration information of the packaging project into the debugged information of the resource file to obtain updated packaging configuration information; and signing the debugged resource file based on the updated packaging configuration information and the appointed signature, and packaging the debugged resource file into a quick application installation package. Wherein, the packing engineering is webpack packing engineering.
In this way, the information replacing subunit 532 is further configured to replace the resource file after debugging in the new quick application installation package development project with the resource file of the initial quick application installation package.
As shown in fig. 11, the apparatus 500 further includes:
the file format identifying unit 550 is configured to identify the type of the input file if the file input instruction is identified. In this way, if the file format recognition unit 550 recognizes that the type of the input file is a quick application installation package, the installation package acquisition unit 510 performs the acquisition of the quick application installation package from the specified address.
And the file typesetting processing unit 560 is configured to typeset the codes included in the JavaScript file according to the specified format, so as to facilitate viewing if the file format identifying unit 550 identifies that the type of the input file is a JavaScript file.
As a way, the file typesetting processing unit 560 is specifically configured to restore the deleted code of the JavaScript file in the packaging process; typesetting the codes in the restored JavaScript file according to a specified format.
Further, as shown in fig. 12, the apparatus 500 further includes:
An interface processing unit 570 for reading the functional interface scan requirement information; scanning the configuration file based on the function interface scanning requirement information to obtain the function interface called by the quick application installation package acquired from the appointed address; and outputting the obtained functional interface to a result file.
As one way, the scan requirement information includes a target type of the required scan and an output pattern. In this manner, the interface processing unit 570 specifically configured to scan the configuration file based on the functional interface scan requirement information includes: scanning the type matched with the target type in the function interface included in the configuration file; the step of outputting the obtained functional interface to a result file comprises the following steps: and outputting the obtained functional interface to a result file according to the output style.
As a way, the interface processing unit 570 is configured to obtain a configuration file in the unpacked resource file when an error occurs in the debugging process of the unpacked resource file.
Optionally, the interface processing unit 570 is specifically configured to determine that an error occurs in the debugging process of the unpacked resource file when the specified misgraph prompt information occurs in the debugging interface is identified based on the image identification manner.
It should be noted that, in the present application, the device embodiment and the foregoing method embodiment correspond to each other, and specific principles in the device embodiment may refer to the content in the foregoing method embodiment, which is not described herein again.
An electronic device according to the present application will be described with reference to fig. 13.
Referring to fig. 13, based on the above-mentioned method and device for debugging a quick application installation package, another electronic device 100 capable of executing the foregoing method for debugging a quick application installation package is provided in the embodiment of the present application. The electronic device 100 includes one or more (only one shown) processors 102, memory 104, and a network module 106 coupled to one another. The memory 104 stores therein a program capable of executing the contents of the foregoing embodiments, and the processor 102 can execute the program stored in the memory 104.
Wherein the processor 102 may include one or more processing cores. The processor 102 utilizes various interfaces and lines to connect various portions of the overall electronic device 100, perform various functions of the electronic device 100, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and invoking data stored in the memory 104. Alternatively, the processor 102 may be implemented in hardware in at least one of digital signal Processing (DIGITAL SIGNAL Processing, DSP), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 102 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 102 and may be implemented solely by a single communication chip.
The Memory 104 may include random access Memory (Random Access Memory, RAM) or Read-Only Memory (ROM). Memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described below, etc. The storage data area may also store data created by the terminal 100 in use (such as phonebook, audio-video data, chat-record data), etc.
The network module 106 may include a radio frequency unit for receiving and transmitting electromagnetic waves, and for performing the interconversion of electromagnetic waves and electrical signals for communication with a communication network or other device, such as an audio playback device. Furthermore, the network module 106 may also include a network adapter (network card) to facilitate direct connection to a router or gateway ethernet via a wired connection for data interaction with a network.
The network module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and the like. The network module 106 may communicate with various networks such as the Internet, intranets, wireless networks, or other devices via wireless networks. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may interact with base stations.
Referring to fig. 14, a block diagram of a computer readable storage medium according to an embodiment of the present application is shown. The computer readable medium 800 has stored therein program code which can be invoked by a processor to perform the methods described in the method embodiments described above.
The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 comprises a non-volatile computer readable medium (non-transitory computer-readable storage medium). The computer readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 810 may be compressed, for example, in a suitable form.
In summary, the method, the device, the electronic device and the storage medium for debugging the quick application installation package provided by the application have the advantages that after the quick application installation package is obtained from the appointed address, the quick application installation package is unpacked to obtain the unpacked resource file, and then the quick application development tool hap-tool is called to debug the unpacked resource file, so that any packaged quick application installation package can be debugged, and because the quick application installation package to be debugged is unpacked before the quick application development tool is called, the unpacked resource file is obtained, and furthermore, the problem that the quick application development tool can only directly debug the source code of the quick application installation package is solved, and the universality of the quick application installation package is improved.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be appreciated 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 drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (19)

1. A method for debugging a quick application installation package, which is applied to a quick application installation package debugging device, the method comprising:
If the file input instruction is identified, identifying the type of the input file;
If the type of the input file is identified as a quick application installation package, executing the quick application installation package acquired from the appointed address;
unpacking the quick application installation package to obtain unpacked resource files;
and calling a quick application development tool hap-tool to debug the unpacked resource file.
2. The method of claim 1, wherein the step of calling a fast application development tool hap-tool to debug the unpackaged resource file comprises:
a new quick application installation package development project is built, and resource files of an initial quick application installation package are configured in the new quick application installation package development project;
replacing the resource file of the initial quick application installation package with the unpacked resource file;
and calling a quick application development tool hap-tool to debug the newly-built quick application installation package development project so as to debug the unpacked resource file.
3. The method of claim 2, wherein the step of creating a new quick application installation package development project is preceded by the step of:
Detecting whether an empty quick application installation package development project exists;
if the fact that no empty quick application installation package development project exists is detected, executing the new quick application installation package development project;
if the empty quick application installation package development project is detected, the empty quick application installation package development project is used as a new quick application installation package development project.
4. The method of claim 2, wherein the step of calling a fast application development tool hap-tool, and debugging the unpackaged resource file further comprises:
Calling a quick application development tool hap-tool to sign the debugged resource file based on a designated signature and package the debugged resource file into a quick application installation package, wherein the designated signature is different from the original signature of the quick application installation package obtained from the designated address.
5. The method of claim 4, wherein the step of calling a quick application development tool hap-tool to sign the debugged resource file based on the specified signature and package the signed resource file into a quick application installation package comprises:
Calling a quick application development tool hap-tool to create an empty packaging project;
Updating the packaging configuration information of the packaging project into the debugged information of the resource file to obtain updated packaging configuration information;
And signing the debugged resource file based on the updated packaging configuration information and the appointed signature, and packaging the debugged resource file into a quick application installation package.
6. The method of claim 5, wherein the packaging process is a webpack packaging process.
7. The method of claim 5, wherein the step of signing the debugged resource file based on the updated packaged configuration information and the specified signature and packaging the debugged resource file into a quick application install package further comprises, after:
and replacing the debugged resource file in the new quick application installation package development project with the resource file of the initial quick application installation package.
8. The method according to claim 1, wherein the method further comprises:
If the input file is identified as the JavaScript file, typesetting codes included in the JavaScript file according to a specified format so as to facilitate viewing.
9. The method of claim 8, wherein the step of typesetting the code included in the JavaScript file according to a specified format comprises:
Restoring the deleted codes of the JavaScript file in the packing process;
typesetting the codes in the restored JavaScript file according to a specified format.
10. The method according to any one of claims 1-9, wherein the method further comprises:
acquiring a configuration file in the unpacked resource file, wherein codes in the configuration file comprise function interfaces called by the quick application installation package acquired from a designated address;
Reading function interface scanning requirement information;
Scanning the configuration file based on the function interface scanning requirement information to obtain the function interface called by the quick application installation package acquired from the appointed address;
and outputting the obtained functional interface to a result file.
11. The method of claim 10, wherein the scan requirement information includes a target type of the required scan and an output pattern;
the step of scanning the configuration file based on the function interface scanning requirement information comprises the following steps:
scanning the type matched with the target type in the function interface included in the configuration file;
The step of outputting the obtained functional interface to a result file comprises the following steps:
And outputting the obtained functional interface to a result file according to the output style.
12. The method of claim 11, wherein the configuration file is a manifest.
13. The method of claim 10, wherein the step of obtaining the configuration file in the unpacked resource file comprises:
and when the error occurs in the debugging process of the unpacked resource file is identified, acquiring a configuration file in the unpacked resource file.
14. The method of claim 13, wherein the step of obtaining the configuration file in the unpacked resource file when the error occurs in the debugging process of the unpacked resource file is identified, comprises:
based on an image recognition mode, when the appointed misgraph prompt information appears in the debugging interface, judging that errors appear in the process of debugging the unpacked resource file, and acquiring the configuration file in the unpacked resource file.
15. A quick application installation package debugging apparatus, the apparatus comprising:
the installation package acquisition unit is used for identifying the type of the input file if the file input instruction is identified; if the type of the input file is identified as a quick application installation package, executing the quick application installation package acquired from the appointed address;
The unpacking unit is used for unpacking the quick application installation package to obtain unpacked resource files;
and the debugging unit is used for calling a quick application development tool hap-tool to debug the unpacked resource file.
16. The device according to claim 15, wherein the debug unit specifically comprises:
The development project building subunit is used for building a new quick application installation package development project, wherein the new quick application installation package development project is configured with resource files of an initial quick application installation package;
an information replacing subunit, configured to replace the resource file of the initial fast application installation package with the unpacked resource file;
and the debugging execution subunit is used for calling a quick application development tool hap-tool to debug the newly-built quick application installation package development project so as to debug the unpacked resource file.
17. The apparatus according to claim 15 or 16, characterized in that the apparatus further comprises:
And the packaging unit is used for calling a quick application development tool hap-tool to sign the debugged resource file based on a designated signature and packaging the debugged resource file into a quick application installation package, wherein the designated signature is different from the original signature of the quick application installation package obtained from the designated address.
18. An electronic device comprising one or more processors and memory;
one or more programs are stored in the memory and configured to be executed by the one or more processors to implement the methods of any of claims 1-14.
19. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code, wherein the program code, when being executed by a processor, performs the method of any of claims 1-14.
CN201980089698.XA 2019-04-16 2019-04-16 Quick application installation package debugging method and device, electronic equipment and storage medium Active CN113330427B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/082947 WO2020210994A1 (en) 2019-04-16 2019-04-16 Quick application installation package debugging method and apparatus, and electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113330427A CN113330427A (en) 2021-08-31
CN113330427B true CN113330427B (en) 2024-06-28

Family

ID=72836882

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980089698.XA Active CN113330427B (en) 2019-04-16 2019-04-16 Quick application installation package debugging method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113330427B (en)
WO (1) WO2020210994A1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650428A (en) * 2015-11-03 2017-05-10 阿里巴巴集团控股有限公司 Method and device for optimizing application codes

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912342A (en) * 2016-04-29 2016-08-31 乐视控股(北京)有限公司 APK (Android Package) development method and system based on overlay mechanism
CN106095504B (en) * 2016-06-13 2019-08-20 青岛海信移动通信技术股份有限公司 Preset application loading method and mobile terminal
CN107423216B (en) * 2017-06-21 2021-01-05 广州视源电子科技股份有限公司 Debugging tool configuration method, readable storage medium and debugging tool configuration device
CN109032606B (en) * 2018-07-10 2022-03-01 北京小米移动软件有限公司 Native application compiling method and device and terminal
CN109542463A (en) * 2018-10-26 2019-03-29 深圳壹账通智能科技有限公司 Compiling file packet transmission method, device, computer equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650428A (en) * 2015-11-03 2017-05-10 阿里巴巴集团控股有限公司 Method and device for optimizing application codes

Also Published As

Publication number Publication date
CN113330427A (en) 2021-08-31
WO2020210994A1 (en) 2020-10-22

Similar Documents

Publication Publication Date Title
CN107844421B (en) Interface testing method and device, computer equipment and storage medium
CN107133180B (en) Dynamic page testing method, testing device and storage medium
CN107193593B (en) Upgrading method of upgradable file, set top box and storage medium
CN107402792B (en) Integration method, device, equipment and storage medium of application software installation package
CN113268245A (en) Code analysis method, device and storage medium
CN110414218B (en) Kernel detection method and device, electronic equipment and storage medium
CN105765531A (en) Generic unpacking of program binaries
CN115658042A (en) Hybrid application component type development method, system, device and storage medium
CN113312577B (en) Webpage resource processing method and device, electronic equipment and storage medium
CN110889116A (en) Advertisement blocking method and device and electronic equipment
EP3519964B1 (en) Electronic apparatus for recording debugging information and control method thereof
CN113330427B (en) Quick application installation package debugging method and device, electronic equipment and storage medium
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN109460310B (en) Information collection system, method, equipment and storage medium based on WEB interface
CN113127329A (en) Script debugging method and device and computer storage medium
CN115456623A (en) Block chain transaction verification method and device, storage medium and electronic equipment
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN114282221A (en) Injection vulnerability detection method, system, terminal and storage medium
CN113836017A (en) Remote debugging method, system, computing device and storage medium
CN109324822B (en) PWA (public warning assistant) item detection method, computer-readable storage medium and terminal device
CN113467815A (en) Application repair method and device for hot update, terminal equipment and storage medium
CN112596751A (en) Compiling method, terminal, server and storage medium of application program installation package
CN112486497A (en) Compiling configuration file generation method and device, electronic equipment and storage medium
CN112541182B (en) Kernel VFS layer system repairing method, device, equipment and storage medium
CN111309410B (en) Program object determining method and device

Legal Events

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