sprout-flashsdk icon indicating copy to clipboard operation
sprout-flashsdk copied to clipboard

Auto-configure trust location for projects

Open apinstein opened this issue 14 years ago • 3 comments

Similarly to how rake flashlog works, should auto-bootstrap security settings as needed.

Trust locations are done through text files, see http://blog.vizio360.co.uk/2009/08/flash-player-trust-file-mac-windows-and-linux/ so this should be easy to automate.

apinstein avatar Nov 29 '11 20:11 apinstein

This PDF has useful notes: http://www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flash_player_10_security.pdf

Look for "trust"

We might be able to do with without admin access and make it work for any platform, too.

apinstein avatar Nov 30 '11 15:11 apinstein

Here's how I do this in my own project's Rakefile:

desc "Set up local trust settings for this project"
task :setup_flash_trust do
  trust_dir = File.expand_path("~/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust")
  mkdir_p trust_dir unless File.exists? trust_dir

  # generate a unique filename for this app's trust file
  project_dir = File.dirname(__FILE__)
  dirname = File.basename(project_dir)

  require 'digest/md5'
  trust_file_name = dirname + Digest::MD5.hexdigest(project_dir) + ".trust.cfg"
  trust_file = trust_dir + "/" + trust_file_name
  if !File.exists? trust_file
    File.open(trust_file, 'w+') do |file|
      file.write("#{project_dir}\n")
    end
  end
end

apinstein avatar Nov 30 '11 15:11 apinstein

Hmm, there already seems to be some support for this here:

lib/flashplayer/trust.rb

I am not sure yet if that's just for when you run via flash player (we use our own html wrapper in our project) but it should be investigated. Also I am not sure how re-usable it is.

apinstein avatar Nov 30 '11 15:11 apinstein