CN108052319B - Method and device for script module to quote native resources and terminal equipment - Google Patents

Method and device for script module to quote native resources and terminal equipment Download PDF

Info

Publication number
CN108052319B
CN108052319B CN201610969248.8A CN201610969248A CN108052319B CN 108052319 B CN108052319 B CN 108052319B CN 201610969248 A CN201610969248 A CN 201610969248A CN 108052319 B CN108052319 B CN 108052319B
Authority
CN
China
Prior art keywords
native
native resource
resource
module
script
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
CN201610969248.8A
Other languages
Chinese (zh)
Other versions
CN108052319A (en
Inventor
赵振华
王领智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610969248.8A priority Critical patent/CN108052319B/en
Publication of CN108052319A publication Critical patent/CN108052319A/en
Application granted granted Critical
Publication of CN108052319B publication Critical patent/CN108052319B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a method and a device for a script module to refer to a native resource and a terminal device. A method applied to a hybrid application including a script module and a native application module, for the script module to reference a native resource, comprising: transforming the native resource name in the script module into a native resource ID; and the native application module acquires the corresponding native resource through the native resource ID. According to the scheme of the invention, the script module can refer to the resources through the native resource names, so that the system availability is improved.

Description

Method and device for script module to quote native resources and terminal equipment
Technical Field
The application relates to the technical field of information, in particular to a method and a device for a script module to quote a native resource and a terminal device.
Background
With the popularization and development of mobile networks, mobile applications are increasingly playing a vital role. Current mobile applications include three modes, native applications, script applications, and hybrid applications.
Native applications are specific to a certain mobile platform (such as iOS or android), and are developed using development tools and languages supported by the corresponding platform (for example, the iOS platform supports Xcode and Objective-C, and the android platform supports Eclipse and Java). Typically, native applications look (appearance) and run (performance) best, but native applications are expensive to develop and do not lend themselves to rapid development.
The script application uses standard Web technologies, typically HTML5, JavaScript, CSS, and the like. Such applications can be written once, run everywhere, but have some limitations, such as secure offline storage and access to native resource functions (camera, calendar, geographical location, etc.).
The hybrid application simultaneously comprises the script module and the native application module in the application, and integrates the advantages of the native application and the script application. The script module may be embedded in (run on) a native container (underlying script framework) through which native functionality is accessed. In this way, a script module such as a JS can interact with native applications, for example, referencing native resources such as pictures, audio, video, fonts, invoking cameras, address books, geographic locations and devices, etc., or implementing multi-touch, graphical operations, animation processing, etc.
Among the technologies that support script modules interacting with Native applications, Facebook's read Native framework is gaining increasing attention. The reach Native framework is mainly dedicated to bringing great power based on the reach programming model for mobile application development. Its goal is not to be a "write once, run everywhere" cross-platform tool, but "use a framework everywhere". For example, in the reach Native framework, the application logic may be written in JS, whereas the UI of the application may be entirely Native.
On the other hand, native resources are sometimes confused for security reasons and the like. However, when the script module references a Native resource, for example, JS references a picture in the fact Native, the script module generally searches under the Native resource package by the name of the Native resource. After the resources are obfuscated, the native resources are not found, resulting in erroneous information and possibly even application crashes.
Therefore, a method capable of finding a native resource after resource confusion is required.
The above information disclosed in this background section is only for enhancement of understanding of the background of the application and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
The application discloses a method for a script module to refer to a native resource, so that after the resource is confused, the script module can still find the native resource through the native resource name.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to one aspect of the invention, a method for a script module to reference a native resource is provided for a hybrid application comprising the script module and a native application module. The method comprises the following steps: transforming the native resource name in the script module into a native resource ID; and the native application module acquires the corresponding native resource through the native resource ID.
According to some embodiments, the script module includes a JS module.
According to some embodiments, the script module runs on the React Native framework.
According to some embodiments, transforming the native resource name in the script module to the native resource ID comprises: transforming the native resource name to an association ID; and obtaining the native resource ID through the corresponding relation between the association ID and the native resource ID.
According to some embodiments, transforming the native resource name in the script module to the native resource ID is performed by the script module, and the method further comprises: the script module sends the native resource ID to the native application module.
According to some embodiments, the method further comprises: the script module sends the native resource name to the native application module, and the native resource name in the script module is transformed into a native resource ID to be executed by the native application module.
According to some embodiments, transforming the native resource name to an association ID is performed by a script module; obtaining the native resource ID through the corresponding relation between the association ID and the native resource ID, and executing the native resource ID by the native application module; and the method further comprises: the script module sends the association ID to the native application module.
According to some embodiments, transforming the native resource name to an association ID comprises: and transforming the native resource name into the association ID through a hash algorithm, or obtaining the association ID through the corresponding relation between the native resource name and the association ID.
According to some embodiments, the association ID is a long integer value, an integer value, or a string value.
According to some embodiments, the transformation of the native resource name in the script module to the native resource ID comprises: and obtaining the native resource ID through the corresponding relation between the native resource name and the native resource ID.
According to some embodiments, obtaining the native resource ID by correspondence of the native resource name to the native resource ID is performed by the script module, and the method further comprises: the script module sends the native resource ID to the native application module.
According to some embodiments, the method further comprises: the script module sends the native resource name to the native application module, and the native resource ID obtained through the corresponding relation between the native resource name and the native resource ID is executed by the native application module.
According to another aspect of the present invention, there is provided an apparatus for a script module to reference a native resource, comprising a script module, a native application module, and a transformation module, wherein: the transformation module is used for transforming the native resource name in the script module into a native resource ID; and the native application module acquires the corresponding native resource through the native resource ID.
According to some embodiments, the script module runs on the React Native framework.
According to some embodiments, the transformation module comprises: a first transformation module for transforming the native resource name into an association ID; and the second transformation module is used for obtaining the original resource ID through the corresponding relation between the association ID and the original resource ID.
According to another aspect of the present invention, there is provided a terminal device adapted to run a hybrid application including a script module and a native application module, comprising: a processor; a memory storing instructions for the processor to control: transforming the native resource name in the script module into a native resource ID; and the native application module acquires the corresponding native resource through the native resource ID.
According to the embodiment of the invention, the native resource name in the script module is converted into the association ID, and the native application can obtain the corresponding native resource through the association ID, so that the script module can refer to the resource through the native resource name, and the system availability is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 illustrates a method for a script module to reference a native resource in accordance with an embodiment of the present invention;
FIG. 2 illustrates a method for a script module to reference a native resource in accordance with another embodiment of the present invention;
FIG. 3 is a timing diagram of a method of a script module referencing a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention;
FIG. 4 is a timing diagram of a method of a script module referencing a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention;
FIG. 5 is a timing diagram of a method of a script module referencing a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention;
FIG. 6 illustrates a method for a script module to reference a native resource in accordance with another embodiment of the present invention;
FIG. 7 is a timing diagram of a method for a script module to reference a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention;
FIG. 8 is a timing diagram of a method for a script module to reference a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention;
FIG. 9 is a block diagram illustrating an apparatus for a script module to reference a native resource in accordance with an embodiment of the present invention;
FIG. 10 is a block diagram illustrating an apparatus for a script module to reference a native resource in accordance with another embodiment of the present invention;
fig. 11 illustrates a terminal device according to an embodiment of the present invention.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
According to one aspect of the technical concept of the invention, the native resource name in the script module is converted into the association ID, and the native application can obtain the corresponding native resource through the association ID, so that the script module can refer to the resource through the native resource name, and the system availability is improved.
The method aims to solve the problem that after the resources are mixed up, the native resource names such as paths, file names and the like in the package can be modified, so that the script module cannot find the corresponding resources through the native resource names. According to the invention, the native resource name in the script module is converted into the native resource ID, so that after the resources are confused, the corresponding resources can still be found through the native resource name. The native resource ID herein refers to an ID that a resource corresponds to a resource name after obfuscation.
Fig. 1 illustrates a method of a script module referencing a native resource, which is applicable to a hybrid application including the script module and a native application module, in which the script module can reference the native resource through the native application module, according to an embodiment of the present invention.
As shown in fig. 1, at S110, the native resource name in the script module is transformed into a native resource ID. By transforming the native resource name into a resource obfuscated native resource ID, a corresponding native resource can be obtained by the native resource ID, as will be described later. Therefore, the problem that the resource cannot be found due to the fact that the name of the native resource is changed after confusion does not occur.
The transformation of the native resource name to the native resource ID may be accomplished in various ways. For example, the native resource ID may be directly obtained through a corresponding relationship between the native resource name and the native resource ID, or the native resource name may be transformed into the native resource ID through an intermediate association ID.
At S130, the native application module obtains the corresponding native resource through the native resource ID. After obtaining the native resource ID, the native application module may access the native platform, and obtain the corresponding native resource through the native resource ID.
The native application module searches the corresponding resource through the native resource ID obtained after the confusion, so that the problem that the resource cannot be found due to resource confusion is avoided.
According to some embodiments, the script module may comprise a JS module. According to some embodiments, the script module may run on a React Native framework (container). It will be readily appreciated that the invention is not limited to the examples given, and that the solution of the invention is obviously also applicable to other existing or future script modules and containers.
Fig. 2 illustrates a method of a script module referencing a native resource, which is applicable to a hybrid application including the script module and a native application module, in which the script module can reference the native resource through the native application module, according to another embodiment of the present invention.
As shown in FIG. 2, at S212, the native resource name is transformed into an associate ID.
According to the method of this embodiment, the native resource name is transformed into the native resource ID by using an intermediate association ID, i.e. the native resource name is transformed into the association ID, and then the native resource ID is obtained by the association ID as shown in S214.
According to some embodiments, the associate ID may be obtained by an association of the native resource name with the associate ID, although the invention is not limited thereto. After an association is established between the native resource name and the association ID, this association may be stored in a file. The file may be saved locally, for example packaged with the application. But the invention is not limited thereto. For example, the file can also be saved at the server and downloaded locally when needed. When establishing the association relationship, the unique association ID may be obtained from the native resource name by, for example, a hash algorithm, but the invention is not limited thereto.
According to other embodiments, the corresponding unique association ID can be directly obtained from the native resource name through a hash algorithm, so that the association relationship between the native resource name and the association ID does not need to be saved, and the efficiency is high, especially in the case of long path, file name and the like. The association ID may be a long integer value, an integer value, or a string value, as the case may be. Generally, the long integer value is selected to ensure the uniqueness of the hash result and also ensure the later faster searching speed from the association ID to the original resource ID.
At S214, the native resource ID is obtained by associating the ID with the native resource ID. After obtaining the association ID in S212, the native resource ID may be searched for by the correspondence between the association ID and the native resource ID. The correspondence of the associate ID to the native resource ID may be stored in a file, which may be generated after resource obfuscation. The file may be saved locally, for example packaged with the application. But the invention is not limited thereto. For example, the file may also be stored in the server, downloaded locally when needed, and the server may maintain the correspondence stored in the file.
In S230, the native application module obtains the corresponding native resource through the native resource ID, which is not described again.
FIG. 3 is a timing diagram of a method of a script module referencing a native resource illustrating the interaction of the script module with an original native application module, according to another embodiment of the invention.
Referring to fig. 3, according to the present embodiment, the transformation of the native resource name in the script module into the native resource ID is performed by the script module. As previously described, transforming the native resource name in the script module to a native resource ID may include: transforming the native resource name to an association ID; and obtaining the native resource ID through the corresponding relationship between the association ID and the native resource ID, which is not described herein again.
Then, the script module sends the native resource ID to the native application module, which can be accomplished through the support provided by the container (or script framework) in which the script module is embedded to run, and different containers can have different manners, which is well known to those skilled in the art and will not be described in detail.
After obtaining the native resource ID, the native application module may obtain the corresponding native resource through the native resource ID. Even if the resources are confused, corresponding native resources such as pictures, audio, video, fonts and the like can be accurately found.
FIG. 4 is a timing diagram of a method of a script module referencing a native resource illustrating the interaction of the script module with an original native application module, according to another embodiment of the invention.
Referring to FIG. 4, according to the present embodiment, the script module sends the native resource name to the native application module. As previously described, this may be accomplished through support provided by the container (or script framework) in which the script module is embedded to run, and different containers may have different ways.
Upon obtaining the native resource name, the native application module transforms the native resource name to an association ID, such as by the example methods described above. The native application module may then obtain the native resource ID by associating the ID with a correspondence of the native resource ID. In this way, the native application module may obtain the corresponding native resource via the native resource ID. Even if the resources are confused, corresponding native resources such as pictures, audio, video, fonts and the like can be accurately found.
FIG. 5 is a timing diagram of a method of a script module referencing a native resource illustrating the interaction of the script module with an original native application module, according to another embodiment of the invention.
Referring to FIG. 5, according to the present embodiment, the script module transforms the native resource name into an associate ID, such as by the example methods described above.
The script module then sends the association ID to the native application module. As previously described, this may be accomplished through support provided by the container (or script framework) in which the script module is embedded to run, and different containers may have different ways.
After obtaining the association ID, the native application module may obtain the native resource ID through a corresponding relationship between the association ID and the native resource ID. In this way, the native application module may obtain the corresponding native resource via the native resource ID. Even if the resources are confused, corresponding native resources such as pictures, audio, video, fonts and the like can be accurately found.
FIG. 6 illustrates a method for a script module to reference a native resource, according to another embodiment of the invention.
As shown in fig. 6, at S612, a native resource ID is obtained by the correspondence of the native resource name and the native resource ID. The correspondence of the native resource name and the native resource ID may be stored in a file, which may be generated after the resources are obfuscated. The file may be saved locally, for example packaged with the application, although the invention is not limited in this regard. For example, the file may also be stored in the server, downloaded locally when needed, and the server may maintain the correspondence stored in the file.
In S630, the native application module obtains the corresponding native resource through the native resource ID, which is not described again.
FIG. 7 is a timing diagram of a method of a script module referencing a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention.
Referring to FIG. 7, according to the present embodiment, the script module transforms the native resource name to a native resource ID, such as by the example methods described above.
The script module then sends the native resource ID to the native application module. As previously described, this may be accomplished through support provided by the container (or script framework) in which the script module is embedded to run, and different containers may have different ways.
After the native resource ID is obtained, the native application module may obtain the corresponding native resource through the native resource ID. Even if the resources are confused, corresponding native resources such as pictures, audio, video, fonts and the like can be accurately found.
FIG. 8 is a timing diagram of a method of a script module referencing a native resource showing the interaction of the script module with the native resource module, according to another embodiment of the invention.
Referring to FIG. 8, according to the present embodiment, the script module sends the native resource name to the native application module. As previously described, this may be accomplished through support provided by the container (or script framework) in which the script module is embedded to run, and different containers may have different ways.
After obtaining the native resource name, the native application module obtains the native resource ID through the correspondence between the native resource name and the native resource ID, for example, by the example method described above. In this way, the native application module may obtain the corresponding native resource via the native resource ID. Even if the resources are confused, corresponding native resources such as pictures, audio, video, fonts and the like can be accurately found.
FIG. 9 illustrates a block diagram of an apparatus for a script module to reference a native resource, in accordance with an embodiment of the present invention.
As shown in fig. 9, the apparatus 900 for a script module to refer to a native resource according to the present embodiment includes a script module 910, a native application module 930, and a transformation module 940, and the apparatus 900 may be adapted to implement the method described above. The script module 910 may run on a script framework (primitive container) 920, accessing native functions through the script framework 920. As previously described, the transformation module 940 may be used to transform the native resource name in the script module 910 to the native resource ID. In this way, native application module 930 may obtain the corresponding native resource via the native resource ID. The transformation module 940 may exist in a separate modality or be included in the script module 910 and/or the native application module 930, as the case may be.
FIG. 10 illustrates a block diagram of an apparatus for a script module to reference a native resource, in accordance with an embodiment of the present invention.
The apparatus shown in fig. 10 is substantially the same as that of fig. 9, except that there are two transform modules: a first transformation module 1042 and a second transformation module 1044. The first transformation module 1042 may be used to transform the native resource name into an association ID, and the second transformation module 1044 may be used to obtain the native resource ID by the correspondence of the association ID and the native resource ID, as described above. Other parts similar to those described above will not be described herein.
Fig. 11 illustrates a terminal device adapted to run a hybrid application including a script module and a native application module according to an embodiment of the present invention.
As shown in fig. 11, terminal apparatus 1100 can include a processor 1110, a memory 1120, a transmitter 1130, and a receiver 1140.
The memory 1120 may store instructions for the processor 1110 to control the processing of operations. The memory 1120 may include a volatile or non-volatile memory, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read Only Memory (EEPROM), an Erasable Programmable Read Only Memory (EPROM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), and the like, which are not limited thereto.
The processor 1110 may call instructions stored in the memory 1120 to control related operations. According to an embodiment, the memory 1120 stores instructions for the processor 1110 to control: transforming the native resource name in the script module into a native resource ID; and the native application module acquires the corresponding native resource through the native resource ID. It will be readily appreciated that the memory 1120 may also store instructions for the processor 1110 to control other operations according to embodiments of the present invention, which will not be described in detail herein.
The processor 1110 may also control the transmitter 1130 and the receiver 1140 to perform signal transceiving, etc.
Those skilled in the art will readily appreciate from the foregoing detailed description that the systems and methods according to embodiments of the present invention have one or more of the following advantages.
According to the embodiment of the invention, the native resource name in the script module is converted into the association ID, and the native application can obtain the corresponding native resource through the association ID, so that the script module can refer to the resource through the native resource name, and the system availability is improved.
According to some embodiments of the invention, transforming the native resource name into the association ID, and obtaining the native resource ID through the correspondence between the association ID and the native resource ID can provide system efficiency.
The present invention also provides, according to some embodiments, a non-transitory computer-readable storage medium, such as a memory, including instructions executable by a processor of an apparatus to perform the above-described method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The instructions in the storage medium, when executed by a processor of the terminal, enable the terminal to perform the method of: transforming the native resource name in the script module into a native resource ID; and the native application module acquires the corresponding native resource through the native resource ID.
It will be appreciated by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or flow charts in the drawings are not necessarily required to practice the present invention and are, therefore, not intended to limit the scope of the present invention.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Exemplary embodiments of the present invention are specifically illustrated and described above. It is to be understood that the invention is not to be limited to the disclosed embodiments, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (12)

1. The utility model provides a method for script module cites Native resource, is applied to the mixed application including script module and Native application module, script module includes the JS module and runs in reach Native frame, its characterized in that includes:
transforming the native resource name in the script module into a native resource ID; wherein the native resource ID is an ID corresponding to the native resource name after the resource is obfuscated;
the native application module obtains corresponding native resources from a native platform through the native resource ID obtained after confusion; wherein the native resources include one or more of audio, video, and fonts;
wherein transforming the native resource name in the script module to a native resource ID comprises:
transforming the native resource name into an association ID through a hash algorithm, or obtaining the association ID through the corresponding relation between the native resource name and the association ID; the association ID is a long integer value, an integer value, or a string value; wherein the corresponding relation is stored in a local file;
obtaining the native resource ID through the corresponding relation between the association ID and the native resource ID; wherein the correspondence of the associate ID to the native resource ID is generated after resource obfuscation.
2. The method of claim 1, wherein the transforming the native resource name in the script module to a native resource ID is performed by the script module,
and the method further comprises: the script module sends the native resource ID to the native application module.
3. The method of claim 1, further comprising:
the script module sends the native resource name to the native application module,
wherein the transforming the native resource name in the script module to a native resource ID is performed by the native application module.
4. The method of claim 1,
said transforming said native resource name to an association ID is performed by said script module;
the obtaining of the native resource ID by the correspondence of the associate ID and the native resource ID is performed by the native application module;
and the method further comprises: the script module sends the association ID to the native application module.
5. The method of claim 1, wherein transforming a native resource name in the script module to a native resource ID comprises:
and obtaining the native resource ID through the corresponding relation between the native resource name and the native resource ID.
6. The method of claim 5, wherein the obtaining the native resource ID via the correspondence of the native resource name to the native resource ID is performed by the script module,
and the method further comprises: the script module sends the native resource ID to the native application module.
7. The method of claim 5, further comprising: the script module sends the native resource name to the native application module,
and the obtaining of the native resource ID through the correspondence of the native resource name and the native resource ID is performed by the native application module.
8. The utility model provides a script module cites device of Native resource which characterized in that, includes script module, Native application module and transform module, script module includes the JS module and runs in reach Native frame, wherein:
the transformation module is used for transforming the native resource name in the script module into a native resource ID; wherein the native resource ID is an ID corresponding to the native resource name after the resource is obfuscated;
the native application module obtains corresponding native resources through the native resource ID obtained after confusion; wherein the native resources include one or more of pictures, audio, video, and fonts;
the transformation module comprises:
the first transformation module is used for transforming the native resource name into the association ID through a hash algorithm, or obtaining the association ID through the corresponding relation between the native resource name and the association ID; the association ID is a long integer value, an integer value, or a string value; wherein the corresponding relation is stored in a local file;
the second transformation module is used for obtaining the native resource ID through the corresponding relation between the association ID and the native resource ID; wherein the correspondence of the associate ID to the native resource ID is generated after resource obfuscation.
9. The apparatus of claim 8, wherein the script module runs on a real Native framework.
10. A terminal device adapted to run a hybrid application comprising a script module and a Native application module, wherein the script module comprises a JS module and runs in a read Native framework, comprising: a processor; a memory storing instructions for the processor to control: transforming the native resource name in the script module into a native resource ID; wherein the native resource ID is an ID corresponding to the native resource name after the resource is obfuscated; the native application module obtains corresponding native resources through the native resource ID obtained after confusion; wherein the native resources include one or more of pictures, audio, video, and fonts;
wherein transforming the native resource name in the script module to a native resource ID comprises:
transforming the native resource name into an association ID through a hash algorithm, or obtaining the association ID through the corresponding relation between the native resource name and the association ID; the association ID is a long integer value, an integer value, or a string value; wherein the corresponding relation is stored in a local file;
obtaining the native resource ID through the corresponding relation between the association ID and the native resource ID; wherein the correspondence of the associate ID to the native resource ID is generated after resource obfuscation.
11. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201610969248.8A 2016-10-27 2016-10-27 Method and device for script module to quote native resources and terminal equipment Active CN108052319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610969248.8A CN108052319B (en) 2016-10-27 2016-10-27 Method and device for script module to quote native resources and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610969248.8A CN108052319B (en) 2016-10-27 2016-10-27 Method and device for script module to quote native resources and terminal equipment

Publications (2)

Publication Number Publication Date
CN108052319A CN108052319A (en) 2018-05-18
CN108052319B true CN108052319B (en) 2021-05-25

Family

ID=62118510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610969248.8A Active CN108052319B (en) 2016-10-27 2016-10-27 Method and device for script module to quote native resources and terminal equipment

Country Status (1)

Country Link
CN (1) CN108052319B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6862683B1 (en) * 2000-03-24 2005-03-01 Novell, Inc. Method and system for protecting native libraries
CN103019864A (en) * 2012-12-28 2013-04-03 广东欧珀移动通信有限公司 Method and system for automatically distributing resource ID for mobile terminal
CN103279382B (en) * 2013-04-27 2016-12-28 北京微云即趣科技有限公司 Primary mode accesses the method for resource, Java end, primary end and system
CN105468369B (en) * 2015-11-19 2019-03-26 深圳联友科技有限公司 JavaScript calls the method and system of primary function on mobile platform

Also Published As

Publication number Publication date
CN108052319A (en) 2018-05-18

Similar Documents

Publication Publication Date Title
CN110019081B (en) Data persistence processing method, device and system and readable storage medium
CN108153551B (en) Method and device for displaying business process page
CN109388766B (en) Page loading method and device
CN110502222B (en) AAR method, apparatus, medium, and device for outbound dependency on internal base repository
US20140337414A1 (en) Dynamic rendering for software applications
CN106897251B (en) Rich text display method and device
CN107580013B (en) Method and device for requesting data in cross-domain mode
CN105824830B (en) Method, client and equipment for displaying page
CN110119294A (en) The generation method of menu page, apparatus and system
CN104461491A (en) Running method and system of Hybrid components
CN107885540A (en) A kind of method, apparatus and terminal of loading application programs static resource
CN107479868B (en) Interface loading method, device and equipment
US10565090B1 (en) Proxy for debugging transformed code
CN104423961A (en) Method and system for generating testing script
CN105335132A (en) Method, apparatus and system for user-defined application function
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
US20240103928A1 (en) Information processing method and apparatus for animation resource, device, medium and product
CN110928571A (en) Business program development method and device
EP3519964B1 (en) Electronic apparatus for recording debugging information and control method thereof
CN112579955A (en) Page access method, equipment, medium and electronic equipment
CN108052319B (en) Method and device for script module to quote native resources and terminal equipment
CN113835748B (en) Packaging method, system and readable medium for application program based on HTML5
CN104123140A (en) Method and device for managing application programs of mobile terminal
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN107423096A (en) A kind of method and device for realizing software installation

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