The Cornerstone for Creative Christians
AlteredEgg.com
Home
Tutorial: Ant Tasks, SecureSWF and FDT on Mac the Easy Way

I splurged and bought secureSWF Pro 3.6 from Kindi. Some say it's top of the heap for protecting Flash files from decompiling. It seems to work okay for that purpose, but I found the documentation severely lacking for using it with Ant tasks on Mac. I hope some people will find this useful. I use FDT for coding (that's where the Ant task will run), but another Eclipse-based IDE should be able to use most of these instructions.

This tutorial is for mainly newbies who don't use Ant much. It is possible to use Ant to both compile your project and run secureSWF, but we're just doing the latter here.

1. Open SecureSWF and set up its options for your current job. Be sure to save the project file.

2. Copy the code below and save it as an XML file within your AS3 project folder. Let's call it "MyAntTask.xml" for now.

<project name="ProtectWithSecureSWF" default="protect" basedir=".">
<taskdef name="protect" classpath="/Applications/secureSWF_v3pro_osx/secureSWF.app/Contents/Resources/Java/secureSWF.jar " classname="secureSWF.ant.ProtectTask" />
<target name="protect"> <protect projectFile="/Users/joeblow/Documents/MySecureSwfProject.sspj " keyFilePath="/Applications/secureSWF_v3pro_osx/secureSWF.app/Contents/Resources/Java/key.data " useOutputMap="true" >
</protect>
</target>
</project>

3. See that "classPath" attribute in there? You could spend a long time looking for that on your Mac if you didn't look inside the application bundle. Right-click on your secureSWF.app file and select "Show Package Contents". You want to find your "secureSWF.jar" file which is buried in there. Put the complete path to that file in the classPath attribute.

Hint: to easily get the full file path, open a Terminal window and drag the file into the window. It will display the full path to the file for you to copy & paste.

Another very important hint: File paths with spaces in them are going to screw up your Ant task (this is a Java problem). If you can't rename your files and folders properly, you might be able to make a symlink in a higher directory that has no spaces in the names.

4. Get the complete path to your secureSWF project file, then use that in the projectFile attribute. 

5. Change the keyFilePath to where yours is (same folder as secureSWF.jar). Now you're ready to use this file in Ant.

6. Switch to FDT (or similar IDE). Make sure your project is open and select Window>Show View>Ant. You should now see a tabbed pane called "Ant".

7. Click the little "ant with the plus sign" icon at the top of that pane to add build files. Now you can find the XML file you created if it is in the AS3 project folder you are working on. Select it and click OK.

8. Now you should see the "ProtectWithSecureSWF" name in your Ant panel. Select it and then click the "Run" icon (green circle with white arrow).

9. It will either work now or the Console panel will tell you what went wrong.

This should get you going. Once you read all the secureSWF documentation you can learn how to set up the XML to override the settings you saved in the project file.





Digg!Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites!
Comments
Add New Search
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
Next >
[ Back ]

We want your stuff!
Follow us on Twitter:

@confidant_ca (business)
@alteredegg (fun)

Main Menu
Home
What is This Website?
Bookmarks
Send Us Your Stuff!
Why is Jesus So Important?
News, Commentary & Weird
Famous Christian Creatives
Contact Us
Site Map
Interesting Stuff For:
Actors
Animators & Filmmakers
Architects
Artists
Cartoonists
Clothing Designers
Dancers
Graphic Designers
Illustrators
Multimediacs
Musicians
Photographers
Poets
Preachers
Writers
Login Form





Lost Password?