CN107145364B - Method and device for Flash cross-domain access data - Google Patents

Method and device for Flash cross-domain access data Download PDF

Info

Publication number
CN107145364B
CN107145364B CN201710172686.6A CN201710172686A CN107145364B CN 107145364 B CN107145364 B CN 107145364B CN 201710172686 A CN201710172686 A CN 201710172686A CN 107145364 B CN107145364 B CN 107145364B
Authority
CN
China
Prior art keywords
interface
downloading
class
animation file
target
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
CN201710172686.6A
Other languages
Chinese (zh)
Other versions
CN107145364A (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.)
Zhanjiang Lime Animation Technology Co.,Ltd.
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710172686.6A priority Critical patent/CN107145364B/en
Publication of CN107145364A publication Critical patent/CN107145364A/en
Application granted granted Critical
Publication of CN107145364B publication Critical patent/CN107145364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a method and a device for Flash cross-domain data access. The method provided by the embodiment of the invention comprises the following steps: writing a second animation file for loading the first animation file, searching a downloading component class and a corresponding downloading component interface of the first animation file, acquiring a target downloading component class for downloading the first animation file in the downloading component class, instantiating the target downloading component class as an instantiation object, calling the target downloading component interface corresponding to the instantiation object, and acquiring data in a third-party website. The embodiment of the invention realizes a method for acquiring data in a cross-domain manner, and improves the flexibility of a Flash program and the convenience of data access.

Description

Method and device for Flash cross-domain access data
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for Flash cross-domain data access.
Background
At present, Flash is widely used for webpage design, webpage animation production, webpage video playing and the like, Flash is adopted by most of video websites including live websites as a video player of the video websites, Flash is used by most of webpage applications such as webpage games and most of postboxes to develop some functions, the Flash is a specific file used by SWF (shock Wave Flash) file, and the Flash considers the safety problem of cross-domain (cross-domain refers to accessing data under a website domain name under another website domain name) from the safety perspective at the beginning of design. For some cross-domain access requirements, Flash provides a policy to set which domain names across which data can be accessed by configuring a policy file cross domain.
Disclosure of Invention
The embodiment of the invention provides a method and a device for Flash cross-domain data access, which realize a method for cross-domain data acquisition and improve the flexibility of a Flash program and the convenience of data access.
In a first aspect, the present application provides a method for Flash cross-domain access to data, where the method includes:
writing a second animation file loaded with a first animation file, wherein the first animation file is an animation file under a third-party website domain name;
searching a downloading component class and a corresponding downloading component interface of the first animation file;
acquiring a target downloading component class for downloading data in a third-party website in the downloading component class, and instantiating the target downloading component class into an instantiation object, wherein the instantiation object comprises a corresponding downloading component interface;
and calling a target downloading component interface corresponding to the instantiation object to acquire data in the third-party website.
Further, the step of writing a second animation file for loading the first animation file includes:
defining an animation file loading example;
registering a callback function after loading of the animation file;
creating an interface requesting a first animation file;
calling the interface to load the first animation file;
and writing the callback function.
Further, the step of searching for the download component class and the corresponding download component interface of the first animation file includes:
searching symbols used by the first animation file, wherein the symbols comprise all used package names, all class names, all function names and variable names;
reading the used symbol through a decompilation tool, and determining the download component class and the corresponding download component interface of the first animation file.
Further, the step of obtaining a target download component class for downloading data in a third-party website in the download component class and instantiating the target download component class as an instantiated object specifically includes:
calling a class judgment interface to judge whether the target downloading component class exists or not;
if yes, calling a class acquisition interface to acquire the target downloading component class;
and creating an instantiation object of the target downloading component class according to the target downloading component class, and determining a downloading component interface of the instantiation object.
Further, the step of calling a target download component interface corresponding to the instantiation object to obtain data in the third-party website specifically includes:
acquiring a target downloading component interface corresponding to the instantiation object, wherein the target downloading component interface is an interface for a user to acquire data in the third-party website;
and calling the target downloading component interface to acquire the data in the third-party website.
In a second aspect, the present application provides an apparatus for Flash cross-domain access to data, the apparatus including:
the compiling unit is used for compiling a second animation file loaded with a first animation file, wherein the first animation file is an animation file under a third-party website domain name;
the searching unit is used for searching the downloading component class and the corresponding downloading component interface of the first animation file;
the instantiation unit is used for acquiring a target download component class for downloading data in a third-party website in the download component class, instantiating the target download component class into an instantiation object, and enabling the instantiation object to comprise a corresponding download component interface;
and the calling unit is used for calling the target downloading component interface corresponding to the instantiation object to acquire the data in the third-party website.
Further, the writing unit is specifically configured to:
defining an animation file loading example;
registering a callback function after loading of the animation file;
creating an interface requesting a first animation file;
calling the interface to load the first animation file;
and writing the callback function.
Further, the search unit is specifically configured to:
searching symbols used by the first animation file, wherein the symbols comprise all used package names, all class names, all function names and variable names;
reading the used symbol through a decompilation tool, and determining the download component class and the corresponding download component interface of the first animation file.
Further, the instantiation unit is specifically configured to:
calling a class judgment interface to judge whether the target downloading component class exists or not;
if yes, calling a class acquisition interface to acquire the target downloading component class;
and creating an instantiation object of the target downloading component class according to the target downloading component class, and determining a downloading component interface of the instantiation object.
Further, the calling unit is specifically configured to:
acquiring a target downloading component interface corresponding to the instantiation object, wherein the target downloading component interface is an interface for a user to acquire data in the third-party website;
and calling the target downloading component interface to acquire the data in the third-party website.
According to the embodiment of the invention, a second animation file for loading a first animation file is compiled, a downloading component class and a corresponding downloading component interface of the first animation file are searched, a target downloading component class for downloading data in a third-party website is obtained from the downloading component class, the target downloading component class is instantiated into an instantiation object, and the target downloading component interface corresponding to the instantiation object is called to obtain the data in the third-party website. According to the embodiment of the invention, a Flash file is written to load the Flash file under the third-party website domain name, then the downloading component interface of the website is obtained through a reflection mechanism, and finally the interested content is obtained through the downloading component interface. Therefore, the Flash file under the website domain name is used for downloading the data of the website through the written Flash file, and the Flash file under the domain name is actually downloaded, so that the domain name detection and judgment are the same domain name, the method for acquiring the data in a cross-domain mode is realized, and the flexibility of a Flash program and the convenience of data access are improved.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a method for Flash cross-domain access to data in the embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of step S1 in the embodiment shown in FIG. 1;
FIG. 3 is a flowchart illustrating an embodiment of step S2 in the embodiment shown in FIG. 1;
FIG. 4 is a flowchart illustrating an embodiment of step S3 in the embodiment shown in FIG. 1;
FIG. 5 is a flowchart illustrating an embodiment of step S4 in the embodiment shown in FIG. 1;
FIG. 6 is a schematic diagram of an embodiment of a device for Flash cross-domain data access in the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, an embodiment of a method for Flash cross-domain access to data in an embodiment of the present invention includes:
s1, writing a second animation file loaded with the first animation file;
the first animation file is an animation file under a third-party website domain name; the first animation file and the second animation file may be SWF files.
S2, searching the downloading component class and the corresponding downloading component interface of the first animation file;
because the format of the animation file is public, taking the SWF file as an example, some ways can be adopted to search the SWF file, and it is known which classes the SWF file has, which function interfaces are protected, and the like.
S3, acquiring a target downloading component class for downloading data in the third-party website in the downloading component class, and instantiating the target downloading component class into an instantiation object;
wherein the instantiation object comprises a corresponding download component interface.
And S4, calling a target downloading component interface corresponding to the instantiation object, and acquiring data in the third-party website.
According to the embodiment of the invention, a second animation file for loading a first animation file is compiled, a downloading component class and a corresponding downloading component interface of the first animation file are searched, a target downloading component class for downloading data in a third-party website is obtained from the downloading component class, the target downloading component class is instantiated into an instantiation object, and the target downloading component interface corresponding to the instantiation object is called to obtain the data in the third-party website. According to the embodiment of the invention, a Flash file under the domain name of a third-party website is loaded by compiling the Flash file, then the downloading component interface of the website is obtained, and finally the interested content is obtained through the downloading component interface, so that the Flash file under the domain name of the website is used for downloading the data of the website through the compiled Flash file, and the Flash file under the domain name is actually downloaded, so that the domain name detection and judgment are the same domain name, thereby realizing the method for acquiring the data in a cross-domain manner, and improving the flexibility of a Flash program and the convenience of data access.
As shown in fig. 2, the step S1 may specifically include: newly creating a second animation file, and writing codes in the second animation file to realize the following steps:
s11, defining an animation file loading example;
specifically, still taking the SWF file as an example, a Loader instance of ActionScript may be defined first. And a Loader class is provided in the ActionScript to load SWF files, or files such as pictures JPG, GIF animations and the like. Therefore, an implementation of the SWF file loading example is defined as follows:
Var swfLoader:Loader=new Loader();
s12, registering a callback function after loading of the animation file;
still taking the SWF file as an example in this step, an interface of a Loader instance is provided in the ActionScript to register a load completion event, and when the Loader completes loading of the SWF file, the Loader calls back the registered function to tell it that the SWF file has been loaded completely. An addEventListener interface is provided in the Loader to register events.
The specific prototype of the interface is as follows:
addEventListener(type:String,
listener:Function,
useCapture:Boolean=false,
priority:int=0,
useWeakReference:Boolean=false)
string is used for representing the registered event type, corresponding to the event, COMPLETE is used for representing that the SWF loading is completed; function is used for representing the callback Function after the completion event of the registration is completed, and is used for triggering the callback Function to execute; int is a third parameter for indicating the priority of the event, and a default value of 0 is used; the fourth parameter useweikReference, Boolean, specifies whether the callback function is a weak application or a strong reference, using the default value false.
S13, creating an interface for requesting the first animation file;
still taking an SWF file as an example, an interface requesting an animation file is created, that is, an interface URLRequest requesting an SWF is created, and an interface is provided at ActionScript to request an SWF file from a network or locally, and the specific interfaces are as follows:
URLRequest(url:String=null)
string denotes the incoming URL address or local path.
S14, calling the interface to load the first animation file;
when the animation file is an SWF file, an interface of a Loader instance can be called to load the requested SWF file, and the specific interface is as follows:
load(request:URLRequest,context:LoaderContext=null)
wherein, the parameter request URLRequest is the loaded request object, and is the URLRequest object created in step S13.
And S15, writing the callback function.
Writing a callback function swfLoadCompleteHandler, wherein the function is the callback function which is called above and is completed by the registered load.
Further, as shown in fig. 3, the step S2 may specifically include:
s21, searching for the symbol used by the first animation file;
wherein the symbols include all used package names, all class names, all function names and variable names;
and S22, reading the used symbol through a decompilation tool, and determining the download component class and the corresponding download component interface of the first animation file.
Because the format of the SWF file is public, a decompilation tool of a third party can be easily found, the SWF file can be decompilated, the SWF file can store all used symbols, such as all package names, all class names, all function names and variable names, and the like, so that the names can be read through the decompilation tool, and the classes and function interfaces protected by the SWF file can be known, so that the classes and the interfaces can be obtained for the subsequent use of a reflection mechanism.
The download component interface has a method for downloading data from a website, and the method is generally implemented as follows:
1. a data download object is defined.
public varurlLoader:URLLoader=new URLLoader();
2. An interface for data download is defined.
public function download(url:String):void{
urlLoader.load(new URLRequest(url));
...}
String is the URL address of the website of the data to be downloaded. Any data that is desired to be obtained from the website can be obtained by entering the URL address from which the data is desired to be obtained. The urlLoader executes specific downloading logic, the data is stored in the urlLoader after being downloaded, and the downloaded data can be acquired by accessing the urlLoader. If the functional logic is found in the SWF of the website, which means that the SWF provides a download component, the download component can be used to download the desired data. Thus, the data download interface provided in one SWF file can be found through the steps.
Further, as shown in fig. 4, the step S3 may specifically include:
s31, calling a class judgment interface to judge whether a target downloading component class exists, if so, executing a step S32;
s32, calling a class acquisition interface to acquire a target downloading component class;
s33, according to the target downloading component class, creating an instantiation object of the target downloading component class, and determining a downloading component interface of the instantiation object.
Still taking the SWF file as an example, firstly, in S1, we load a SWF file of a third party through the Loader interface, and then through the decompilation in step S2, we can see which classes of the SWF contain the download component interface, and further can obtain the download component interface through the reflection mechanism to call. First example assume that SWF has a class name ClassDownload, and there is a method public function Download (url: String) in this class
urlLoader.load(newURLRequest(url));
}
The method is used for transmitting an address for downloading data and then calling loader to download the data. Then through the reflection mechanism, the object of classdown can be instantiated and the download component interface download of the downloaded data can be invoked. Then the specific calling method through the reflection mechanism is as follows:
(1) firstly, calling an interface of the Loader to judge whether the target downloading component class exists.
The third party SWF can be determined whether the third party SWF has the target class through the Loader interface hasDefinition (the above-mentioned class determination interface). The prototype is as follows:
hasDefinition(name:String):Boolean
string is the name of the fill-in class (the name of the target download component class), and the return value is True and not. The call is as follows:
var bDefine:Boolean=swfLoader.contentLoaderInfo.applicationDomain.hasDefinition("ClassDownload");
wherein swfLoader is the Loader instance added with SWF in step S1, and the parameter "ClassDownload" is the assumption that this class exists. The return value bDefine indicates whether this class exists.
(2) And calling the interface of the Loader to acquire the target downloading component class.
This class can then be acquired through Loader's interface getDefinition (the class acquisition interface described above). The prototype is as follows:
getDefinition(name:String):Object
string is the name of the class, and the return value is the target class.
var cClass:Class=swfLoader.contentLoaderInfo.applicationDomain.getDefinition("ClassDownload")as Class;
Wherein swfLoader is the Loader instance added with SWF in step S1, and the parameter "ClassDownload" assumes that the target download component class exists. The return value, cClass, is the corresponding ClassDownload target download component class.
(3) An object of the class is instantiated.
After the class cClass is obtained in the step (2), an instantiation object can be created through the class cClass, and an interface of the instantiation object is determined.
The method comprises the following specific steps:
Var obj:cClass=new cClass;
this creates an instance object obj of the class. By this step, it is achieved that an instantiated object of the target download component class is created by the reflection mechanism.
Further, as shown in fig. 5, the step S4 may specifically include:
s41, acquiring a target download component interface corresponding to the instantiation object;
the target downloading component interface is an interface through which a user needs to acquire data in the third-party website;
and S42, calling a target downloading component interface to acquire the data in the third-party website.
An instantiation object obj of a class is created by step S3 so that the method of its target download component interface can be directly called to download the required data. The method comprises the following specific steps:
assume that the class cClass has an interface download (URL: String) and the interface has a parameter URL for storing the URL address of the data to be acquired. It can be invoked directly through the obj object.
Var strURL, String; such as: http:// test/userinfo
obj.download(strURL);
After the data is downloaded, the data is stored in a member variable urlLoader in the class classdown, and the data which is directly read is the data which we want to obtain. Because the SWF file under the domain name of the third-party website is used for downloading the data of the website through the SWF file written by the third-party website, the actual downloading is performed by the SWF file under the domain name, and the domain name detection and judgment are the same domain name, so that the method for acquiring the data in a cross-domain manner is realized.
Therefore, the downloading component class acquired through the reflection mechanism and the interface of the downloading component class are called through the step, so that the SWF interface under the domain name of the third-party website can be called conveniently.
An embodiment of an apparatus for calling animation data according to an embodiment of the present invention is described below.
Referring to fig. 6, a schematic diagram of an embodiment of a device for Flash cross-domain data access according to an embodiment of the present invention is shown, in which the device for Flash cross-domain data access includes:
the compiling unit 601 is configured to compile a second animation file loaded with a first animation file, where the first animation file is an animation file under a third-party website domain name;
a searching unit 602, configured to search for a download component class and a corresponding download component interface of the first animation file;
an instantiation unit 603, configured to obtain a target download component class for downloading data in a third-party website from the download component class, and instantiate the target download component class as an instantiation object, where the instantiation object includes a corresponding download component interface;
a calling unit 604, configured to call a target download component interface corresponding to the instantiation object, to obtain data in the third-party website.
Further, the writing unit 601 is specifically configured to:
newly creating a second animation file, and writing codes in the second animation file to realize the following steps:
defining an animation file loading example;
registering a callback function after loading of the animation file;
creating an interface requesting a first animation file;
calling the interface to load the first animation file;
and writing the callback function.
Further, the search unit 602 is specifically configured to:
searching symbols used by the first animation file, wherein the symbols comprise all used package names, all class names, all function names and variable names;
reading the used symbol through a decompilation tool, and determining the download component class and the corresponding download component interface of the first animation file.
Further, the instantiation unit 603 is specifically configured to:
calling a class judgment interface to judge whether the target downloading component class exists or not;
if yes, calling a class acquisition interface to acquire the target downloading component class;
and creating an instantiation object of the target downloading component class according to the target downloading component class, and determining a downloading component interface of the instantiation object.
Further, the invoking unit 604 is specifically configured to:
acquiring a target downloading component interface corresponding to the instantiation object, wherein the target downloading component interface is an interface for a user to acquire the third-party website data;
and calling the target downloading component interface to acquire the data in the third-party website.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A method for Flash cross-domain access data is characterized by comprising the following steps:
writing a second animation file loaded with a first animation file, wherein the first animation file is an animation file under a third-party website domain name;
searching for a downloading component class and a corresponding downloading component interface of the first animation file, wherein the method for realizing the downloading component class comprises the following steps: defining a data download object; defining an interface for downloading data;
acquiring a target downloading component class for downloading data in a third-party website in the downloading component class, and instantiating the target downloading component class into an instantiation object, wherein the instantiation object comprises a corresponding downloading component interface;
calling a target downloading component interface corresponding to the instantiation object to acquire data in the third-party website;
the step of searching the downloading component class and the corresponding downloading component interface of the first animation file comprises the following steps:
searching symbols used by the first animation file, wherein the symbols comprise all used package names, all class names, all function names and variable names;
reading the used symbols through a decompilation tool, and determining whether the first animation file has a downloading component class, a downloading component class and a corresponding downloading component interface;
the step of obtaining a target download component class for downloading data in a third-party website in the download component class and instantiating the target download component class as an instantiation object specifically comprises the following steps:
calling a class judgment interface to judge whether the target downloading component class exists or not;
if yes, calling a class acquisition interface to acquire the target downloading component class;
and creating an instantiation object of the target downloading component class according to the target downloading component class, and determining a downloading component interface of the instantiation object.
2. The method of claim 1, wherein the step of composing a second animation file that loads the first animation file comprises:
defining an animation file loading example;
registering a callback function after loading of the animation file;
creating an interface requesting a first animation file;
calling the interface to load the first animation file;
and writing the callback function.
3. The method according to claim 1, wherein the step of calling the target download component interface corresponding to the instantiation object to obtain the data in the third-party website specifically comprises:
acquiring a target downloading component interface corresponding to the instantiation object, wherein the target downloading component interface is an interface for a user to acquire data in the third-party website;
and calling the target downloading component interface to acquire the data in the third-party website.
4. An apparatus for Flash cross-domain access to data, the apparatus comprising:
the compiling unit is used for compiling a second animation file loaded with a first animation file, wherein the first animation file is an animation file under a third-party website domain name;
the searching unit is used for searching the downloading component class and the corresponding downloading component interface of the first animation file, and the implementation method of the downloading component class is as follows: defining a data download object; defining an interface for downloading data;
the instantiation unit is used for acquiring a target download component class for downloading data in a third-party website in the download component class, instantiating the target download component class into an instantiation object, and enabling the instantiation object to comprise a corresponding download component interface;
the calling unit is used for calling a target downloading component interface corresponding to the instantiation object to acquire data in the third-party website;
the search unit is specifically configured to:
searching symbols used by the first animation file, wherein the symbols comprise all used package names, all class names, all function names and variable names;
reading the used symbols through a decompilation tool, and determining whether the first animation file has a downloading component class, a downloading component class and a corresponding downloading component interface;
the instantiation unit is specifically configured to:
calling a class judgment interface to judge whether the target downloading component class exists or not;
if yes, calling a class acquisition interface to acquire the target downloading component class;
and creating an instantiation object of the target downloading component class according to the target downloading component class, and determining a downloading component interface of the instantiation object.
5. The apparatus according to claim 4, wherein the authoring unit is specifically configured to:
defining an animation file loading example;
registering a callback function after loading of the animation file;
creating an interface requesting a first animation file;
calling the interface to load the first animation file;
and writing the callback function.
6. The apparatus according to claim 4, wherein the invoking unit is specifically configured to:
acquiring a target downloading component interface corresponding to the instantiation object, wherein the target downloading component interface is an interface for a user to acquire data in the third-party website;
and calling the target downloading component interface to acquire the data in the third-party website.
CN201710172686.6A 2017-03-21 2017-03-21 Method and device for Flash cross-domain access data Active CN107145364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710172686.6A CN107145364B (en) 2017-03-21 2017-03-21 Method and device for Flash cross-domain access data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710172686.6A CN107145364B (en) 2017-03-21 2017-03-21 Method and device for Flash cross-domain access data

Publications (2)

Publication Number Publication Date
CN107145364A CN107145364A (en) 2017-09-08
CN107145364B true CN107145364B (en) 2021-04-23

Family

ID=59783720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710172686.6A Active CN107145364B (en) 2017-03-21 2017-03-21 Method and device for Flash cross-domain access data

Country Status (1)

Country Link
CN (1) CN107145364B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571851A (en) * 2010-12-27 2012-07-11 阿里巴巴集团控股有限公司 Data communication method and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571851A (en) * 2010-12-27 2012-07-11 阿里巴巴集团控股有限公司 Data communication method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
flash/flex的程序跨域访问swf或者图片资源;plex;《https://www.xuebuyuan.com/zh-tw/1576101.html》;20130530;第1-4页 *
使用Loader/URLLoader/URLStream载入外部swf并获取类定义;voidcn;《http://www.voidcn.com/article/p-dqbjyxiq-k.html》;20140330;第1-5页 *

Also Published As

Publication number Publication date
CN107145364A (en) 2017-09-08

Similar Documents

Publication Publication Date Title
US9602347B2 (en) Method, system and program for browser to switch IE kernel
CN106569856B (en) A kind of loading method and device of application view resource file
CN108132814A (en) Page loading method, device, computer equipment and the storage medium of application program
CN106294372A (en) Application program page quick access method and apply its mobile terminal
CN104049986A (en) Plugin loading method and device
US20140208326A1 (en) File presenting method and apparatus for a smart terminal
CN106547580B (en) Method and device for hooking function, mobile terminal and storage medium
CN105653949B (en) A kind of malware detection methods and device
CN108416212A (en) Method for identifying application program and device
CN110007985B (en) Applet music player component calling method and equipment
CN103761241A (en) Method for uploading picture data and browser
CN107678741B (en) List view implementation method and device, readable storage medium and equipment
CN113536174A (en) Interface loading method, device and equipment
CN112882732A (en) Method and device for updating function codes in Software Development Kit (SDK)
CN106598662B (en) Android-based application loading method and device
CN109445770B (en) Error code processing method, device, medium and equipment
CN109190367B (en) Method and device for running application program installation package by utilizing sandbox
CN106815037B (en) Application function execution method and device
CN110020370B (en) Method and device for realizing animation in client application and framework of animation script
US20180341426A1 (en) Method and device for clearing data and electronic device
CN110083355B (en) APP page processing method and device
CN107145364B (en) Method and device for Flash cross-domain access data
CN109345063B (en) Data processing method and device for wind control system and storage medium
CN107066254B (en) Method and device for calling animation data
CN108268298B (en) Desktop icon generation method and device, storage medium and electronic equipment

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230615

Address after: 3F-03, Floor 3, Zhanjiang Science and Technology Business incubator Building (Military Police Yayuan Apartment Building), No. 18, Guangtian Road, Chikan District, Zhanjiang, Guangdong 524000

Patentee after: Zhanjiang Lime Animation Technology Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.