Skip to content

Instantly share code, notes, and snippets.

@rymawby
Created September 14, 2011 15:45
Show Gist options
  • Save rymawby/1216925 to your computer and use it in GitHub Desktop.
Save rymawby/1216925 to your computer and use it in GitHub Desktop.
Script to take a directory of swf files and create air files from them. These are not signed but will run on platforms such as set top boxes.
#!/bin/sh
mkdir packaged_air_files
for f in *.swf
do
echo "Processing $f"
mkdir packaged_air_files/dir$f
mkdir packaged_air_files/dir$f/META-INF
mkdir packaged_air_files/dir$f/META-INF/AIR
touch packaged_air_files/dir$f/META-INF/AIR/application.xml
echo "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?><application xmlns=\"http://ns.adobe.com/air/application/2.5\"><id>$f</id><filename>$f</filename><name>$f</name><versionNumber>1.0.0</versionNumber><initialWindow><content>$f</content><transparent>false</transparent><visible>true</visible><width>1280</width><height>720</height></initialWindow></application>" > packaged_air_files/dir$f/META-INF/AIR/application.xml
touch packaged_air_files/dir$f/META-INF/AIR/hash
echo ",á≠g∏4¯/DÎÜÆsd ‘.ò≈Ã˘∫4?Ÿ±%!" > packaged_air_files/dir$f/META-INF/AIR/hash
touch packaged_air_files/dir$f/mimetype
echo "application/vnd.adobe.air-application-installer-package+zip" > packaged_air_files/dir$f/mimetype
cp $f packaged_air_files/dir$f
cd packaged_air_files/dir$f
zip -Rm temp '*'
mv temp.zip ../${f%.*}.air
cd ../../
rmdir packaged_air_files/dir$f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment