开发者

Mxmlc generates different binary on same source

I'm compiling a single .as file into swf using mxmlc.

Whenever I run mxmlc, results are different in size even when the source code is not changed.

For example,

// Test.as
package
{
    public class Test
    {
    开发者_Go百科}
}

And generates .swf using mxmlc :

mxmlc Test.as

and result size differs from 461 to 465 bytes.

I suppose that it's because of timestamp-like things in compiler, but I could not find how to fix or disable that. Any ideas on generating "same binary from same source" ? Thanks!


Finally, I found that metadata tag (Tag Type = 77) and undocumented 'product info' tag (Tag Type = 41) both contains compliation time.

I succeeded to remove timestamps by following steps :

1. open swf and un-zlib
2. clear timestamps in metadata tag and product info tag
3. re-zlib and make new .SWF

But I'm not happy with that, thus this needs extra work on SWF file. I want to find the easier way. there may be 'bypass product info' option on mxmlc..

You can find more information on SWF File structure and metadata tag on http://www.adobe.com/devnet/swf.html and product info on http://wahlers.com.br/claus/blog/undocumented-swf-tags-written-by-mxmlc/


You need to override the metadata the compiler is writing into the resulting swf file. You can do this with the -raw-metadata compiler aguement.

Usage:

mxmlc -raw-metadata <XML_String> Test.as

Example:

mxmlc -raw-metadata '' Test.as

(Resulting swf is always 190 bytes).


1 : date in metadata:

mxmlc:

 <metadata date=" " />
 <raw-metadata></raw-metadata>

2 : timestamp in ProductInfo

download sdk source code,and modify the ProductInfo.java,let the timestamp keep same.and then update the ProductInfo.class in your_sdk_dir\lib\swfutils.jar

However,when i have done,Mxmlc also generates different binary on same source.

I think i can't change the compiler link order.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜