[英]Is there a way to inspect a SWF to see what RSLs it uses?
我正在调查一个Flex应用程序的问题,该应用程序试图从意外URL下载(至少)一个Flex框架RSL。 我无法重现该问题,但是对于我的mxmlc
构建配置中的RSL规范的某些方面,我也不确定。
考虑到所有这些,能够检查列出RSL依赖项的SWF文件以准确查看存在哪些依赖项以及与之相关联的URL将很有帮助。
有没有这样做的方法? 我已经尝试过Adobe的SWF调查器,但没有发现明显的地方可以找到这种依赖关系。 (我猜它们是由mxmlc
生成的代码处理的,而不是由Flash Player本地生成的,因此它们没有列为SWF的属性吗?)
该应用程序是使用/针对Flex 4.6,FWIW构建的。
我尚未找到以自动化方式执行此操作的工具,但是我发现通过研究SWF的反汇编版本(使用Adobe的SWF Investigator工具可以找到)来查找信息非常容易。
为此,请将指定RSL依赖关系的SWF加载到SWF Investigator中,然后在“ SWF Disassembler”选项卡上查看反汇编的代码(最简单的方法是使用“ Open with text view ...”按钮来弹出外部编辑器)。
RSL依赖关系在SWF的info()
函数的定义中指定,该块以类似以下内容的开头:
function info():Object /* disp_id=0 method_id=57 nameIndex = 75 */
跨域RSL依赖关系在cdRsls
属性中列出,其他在rsls
属性中列出。 这些列表中填充了许多RSLData
对象,很容易看到将RSLData构造函数的参数压入堆栈。 例如,以下部分添加了两个可能的URL来检索Flex 4.6“框架”库:
13 findpropstrict mx.core::RSLData //nameIndex = 6
15 pushstring "http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz"
18 pushstring "http://fpdownload.adobe.com/pub/swz/crossdomain.xml"
21 pushstring "abd49354324081cebb8f60184cf5fee81f0f9298e64dbec968c96d68fe16c437"
24 pushstring "SHA-256"
27 pushtrue
28 pushtrue
29 pushstring "default"
31 constructprop mx.core::RSLData (7) //nameIndex = 6
34 findpropstrict mx.core::RSLData //nameIndex = 6
36 pushstring "framework_4.6.0.23201.swz"
39 pushstring ""
41 pushstring "abd49354324081cebb8f60184cf5fee81f0f9298e64dbec968c96d68fe16c437"
44 pushstring "SHA-256"
47 pushtrue
48 pushtrue
49 pushstring "default"
51 constructprop mx.core::RSLData (7) //nameIndex = 6
54 newarray [2]
底部的newarray [2]
行似乎表明它们代表同一文件的两个可能位置(即备用URL)。 如果提供了单个URL,则将创建一个RSLData对象,并在newarray [1]
行中添加。
该代码对应于Flex SDK随附的标准flex-config.xml文件中的以下定义:
<!-- Framework SWC -->
<runtime-shared-library-path>
<path-element>libs/framework.swc</path-element>
<rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz</rsl-url>
<policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
<rsl-url>framework_4.6.0.23201.swz</rsl-url>
<policy-file-url></policy-file-url>
</runtime-shared-library-path>
最后,作为参考,这是RSLData类的构造函数的签名,以查看值对应于哪些参数:
public function RSLData(rslURL:String = null,
policyFileURL:String = null,
digest:String = null,
hashType:String = null,
isSigned:Boolean = false,
verifyDigest:Boolean = false,
applicationDomainTarget:String = "default")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.