Total Pageviews

Saturday, 13 April 2024

Ruffle

A Flash Player emulator written in Rust.

ruffle.rs

website | demo | nightly builds | wiki

Ruffle is an Adobe Flash Player emulator written in the Rust programming language. Ruffle targets both the desktop and the web using WebAssembly.

Table of Contents

Project status

Ruffle supports ActionScript 1, 2 and 3 pretty well, but it's still not finished by any means. Please report any issues in the Issue Tracker.

Using Ruffle

The easiest way to try out Ruffle is to visit the web demo page, then click the "Select File" button to load a SWF file of your choice.

Nightly builds of Ruffle are available for desktop and web platforms.

For more detailed instructions, see our wiki page.

Building from source

Prerequisites

  • Latest stable channel of Rust
  • Java, available on your PATH as java (required for building the library containing the builtin Flash classes for ActionScript 3)

Linux prerequisites

The following are typical dependencies for Linux:

  • libasound2-dev
  • libxcb-shape0-dev
  • libxcb-xfixes0-dev
  • libgtk-3-dev
  • libssl-dev
  • libudev-dev
  • libxcb-xinput-dev
  • libxcb-xkb-dev
  • libxcb-cursor-dev
  • default-jre-headless
  • cmake
  • g++

Desktop

Build

Use the following command to build and run the desktop app:

cargo run --release --package=ruffle_desktop

To run a specific SWF file, pass the SWF path as an argument:

cargo run --release --package=ruffle_desktop -- test.swf

To build in debug mode, simply omit --release from the command.

macOS

Ruffle desktop can be built from our Homebrew Tap:

brew install --HEAD ruffle-rs/ruffle/ruffle

Note: because it is HEAD-only, you'll need to run brew upgrade --fetch-HEAD ruffle each time you want to update.

Web or Extension

Follow the instructions in the web directory for building either the web or browser extension version of Ruffle.

This project is tested with BrowserStack.

Android

Follow the instructions in the ruffle-android project for building the Android application of Ruffle.

Scanner

If you have a collection of "real world" SWFs to test against, the scanner may be used to benchmark ruffle's parsing capabilities. Provided with a folder and an output filename, it will attempt to read all of the Flash files and report on the success of such a task.

cargo run --release --package=ruffle_scanner -- folder/with/swfs/ results.csv

Exporter

If you have a SWF file and would like to capture an image of it, you may use the exporter tool. This currently requires hardware acceleration, but can be run headless (with no window).

  • cargo run --release --package=exporter -- path/to/file.swf
  • cargo run --release --package=exporter -- path/to/file.swf path/to/screenshots --frames 5

Structure

  • core - core emulator and common code
  • swf - SWF and ActionScript parser
  • desktop - desktop client (uses wgpu-rs)
  • web - web client and browser extension (uses wasm-bindgen)
  • render - various rendering backends for both desktop and web
  • video - video decoding backends
  • flv - Flash Video decoder
  • wstr - a Flash-compatible implementation of strings
  • scanner - a utility to bulk parse SWF files
  • exporter - a utility to generate PNG screenshots of a SWF file

Sponsors

You can support the development of Ruffle via GitHub Sponsors. Your sponsorship will help to ensure the accessibility of Flash content for the future. Thank you!

Sincere thanks to the diamond level sponsors of Ruffle:

Newgrounds.com CPMStar Sébastien Bénard Crazy Games Cool Math Games The New York Times Armor Games Onda Educa TwoPlayerGames.org wowgame.jp Matt Roszak Doll Divine Movavi Kongregate Bubble Shooter Neopets

from https://github.com/ruffle-rs/ruffle

-----


谷歌浏览器Chrome运行Flash:用Ruffle模拟运行Flash

Ruffle是一个用Rust编写的Flash Player模拟器
。Ruffle 在所有现代操作中原生运行 系统作为一个独立的应用程序,并通过使用WebAssembly在所有现代浏览器上。 利用现代浏览器沙箱的安全性和 Rust 的内存安全保证, 我们可以自信地避免Flash闻名的所有安全陷阱。 Ruffle将Flash放回了它所属的网络上 - 包括iOS和Android上的浏览器!

设计为易于使用和安装,用户或网站所有者可以安装网络版本 的 Ruffle 和现有的 Flash 内容将“正常工作”,无需额外配置。 Ruffle将检测网站上所有现有的Flash内容并自动“填充” 它变成了一个Ruffle播放器,允许无缝和透明地升级仍然 依赖闪存内容。

Ruffle是一个完全开源的项目,由志愿者维护。我们都充满激情 关于互联网历史的保存,我们被吸引到这个项目上工作以帮助 保留许多网站和大量内容,这些内容在以下情况下将无法再访问 用户无法再运行官方的Flash Player。如果您想帮助支持此 项目,我们欢迎任何形式的贡献 - 即使只是玩一些旧游戏 看看他们跑得有多好。
官网

 https://ruffle.rs/
https://ruffle.rs/downloads
https://github.com/ruffle-rs/ruffle/releases/download/nightly-2024-06-17/ruffle-nightly-2024_06_17-windows-x86_64.zip

Ruffle已经在各大浏览器的扩展商店中上架。
(Ruffle目前尚未在各大浏览器的扩展商店中上架,我们需要从官网下载它的压缩包手动安装。在Chrome中的流程是这样的,首先,开启Chrome的扩展程序管理页面,开启右上角的开发者模式开关。
在Chrome的扩展程序界面开启开发者模式
接着,解压Ruffle扩展的zip包到一个文件夹当中。
解压Ruffle的Zip包
在Chrome的扩展程序管理页面当中,点击“加载已解压的扩展程序”,然后开启广告Ruffle解压的文件夹,这样Ruffle就安装好了。重启Chrome浏览器,就可以使用Ruffle运行Flash了!)

Ruffle真的有用吗?来看看笔者的测试。在下面的动图中,可以看到Chrome中Flash的开关已经关闭,然后笔者开启了一个计算器的Flash Demo。点击运行后,这个Flash Demo的确可以运行如常,无论是界面还是交互都没有问题。对着这个Flash Demo点击右键,可以看到的确是Ruffle在运行。
Ruffle演示,可见的确在关闭了Flash的前提下,能运行Flash Demo

当然,Ruffle并非完美无缺。当前它并不能保证完美兼容所有的Flash组件,有时候还是会遇到出错的情况。不过考虑到当前Ruffle仍处于Beta阶段,日后它应该会有更加出色的表现。
总结

总的来说,业界弃用Flash是一件大好事,毕竟这个满布安全漏洞、效率低下的产品,已经非常不适应时代。如果你实在需要Flash,还习惯使用Chrome浏览器,不妨试试上文的方法,也希望仍使用Flash的网站尽快完成技术转型,拥抱更先进的HTML5等新一代Web技术吧。

 

No comments:

Post a Comment