An Android application for ruffle.rs

Overview

This is a native Android application for Ruffle.

It is in a very early stage.

Prebuilt APKs

The latest (successful) Actions run (here) should have a debug and a release .apk uploaded as artifacts.

You can try this app by downloading and installing one of those.

Build Prerequisites

Install Android Sudio with at least the Platform SDK (e.g. 28) and the NDK Tools (at least r24 needed due to rust-windowing/android-ndk-rs#255).

Also:

cargo install cargo-apk

rustup target add aarch64-linux-android armv7-linux-androideabi

Build Steps

NOTE: First a sacrificial APK is built, then the native library it produces is used to build the proper APK.

Substitute the appropriate locations and NDK version in the variables set for the cargo-apk command.

cd native
# don't specify a `--target` here, as that changes the directory structure
ANDROID_SDK_ROOT=$HOME/Android/Sdk/ ANDROID_NDK_ROOT=$HOME/Android/Sdk/ndk/24.0.8215888/ cargo apk build --release

mkdir ../app/ruffle/src/main/jniLibs
cp -r target/release/apk/lib/* ../app/ruffle/src/main/jniLibs/

cd ../app
./gradlew assembleDebug # the "release" version requires a keyfile

The final APK should be at:

app/ruffle/build/outputs/apk/debug/ruffle-debug.apk

After the first step, simply opening the app project in Android Studio for development also works.


TODO

In no particular order:

  • Ability to show the built-in virtual keyboard (softinput), for keyboard input
  • Controller/Gamepad input?
    • Mapped to key presses and/or virtual mouse pointer
  • Own custom keyboard overlay, maybe even per-content configs
  • Navigator backend (fetch, open browser)
  • Error/panic handling
  • Logging?
  • Ui backend (context menu)
  • Proper storage backend?
  • Cross-platform build instructions?
  • Resolve design glitches/styling/theming (immersive mode, window insets for holes/notches/corners)
  • Unglitchify audio volume (buttons unresponsive?)
  • Ask CPAL/Oboe to open a "media" type output stream instead of a "call" one
    • so the right volume slider controls it, and it uses the loud(er)speaker
  • Support for x86(_64) tablets?
  • Publish to various app stores, maybe automatically?
  • Consider not building the intermediate .apk just for the shared libraries
  • Simplify build process (hook cargo-apk into gradle, drop cargo-apk?)
  • Bundle demo animations/games
  • Add ability to load content from well known online collections? (well maybe not z0r... unless?)
  • History, favorites, other flair...?
  • Clean up ~everything

DONE:

  • Touch/mouse input
  • Keyboard input: only with physical keyboard connected or through scrcpy
  • Split into a separate repo
  • Add ability to Open SWF by entered/pasted URL (or even directly from clipboard)
    • No direct clipboard open, but easy to paste into the text field...
  • Unglitchify rendering: scale, center and letterbox the content properly
  • Add building this to CI, at least to the release workflow
    • This repo has its own CI setup, which builds APKs
  • Somehow filter files to be picked to .swf
    • How well this works depends on the file picker, but it "should work most of the time"
  • Register Ruffle to open .swf files
    • How well this works depends on the application opening the file, but it "should work most of the time"
  • Figure out why videos are not playing (could be a seeking issue)
    • The video decoder features weren't enabled on ruffle_core...
  • Sign the APK
    • Using a very simple key for now, with just my name in it
  • Support for 32-bit ARM phones
    • Untested, but should work in theory
  • Unbreak the regular build on CI
    • No longer relevant after the repo split
  • Clean up commit history of the branch
    • No longer relevant after the repo split
Comments
  • Build Problem

    Build Problem

    Hey, I've been trying to get Flash running on android for a while through ruffle. I had a bit of luck getting the js version working through webview, but I'm not happy with some things. Then I ran into your project and it seems to be a much better version since it looks like you're running ruffle natively. I wanted to try it out for myself and started following your steps for the build process. Side-note I'm on Windows 10.

    Here's what I've done so far: I made sure I had the proper SDK and NDK in android studio. I installed rust. I then ran your first two commands cargo install cargo-apk and rustup target add aarch64-linux-android. The first command failed giving an error said link.exe failed or something like that. Turns out rust by default points to 32-bit binaries and running rustup default stable-x86_64-pc-windows-gnu fixes that. Then I set up the environment variables for ANDROID_SDK_ROOT and ANDROID_NDK_ROOT then I ran cargo apk build --release. I got an error which I noticed said something about armv7 so I switched up the target by using cargo apk build --release --target aarch64-linux-android. I got a different error this time looking for java. I downloaded OpenJDK 18 and point JAVA_HOME to it. This time it built and I got the two .so files and copied them over. I now ran ./gradlew build but then ran into the error unsupported class file major version 62. I thought maybe using an older version of java might help fix that since some answers were saying upgrade gradle. So I got OpenJDK 17 and redid the build and deleted the old .so files and copied the new ones. This time I ran ./gradlew build and it looked like it was working until I ran into another error.

    > Task :ruffle:packageRelease FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem was found with the configuration of task ':ruffle:packageRelease' (type 'PackageApplication').
      - In plugin 'com.android.internal.version-check' type 'com.android.build.gradle.tasks.PackageApplication' property 'signingConfigData.signingConfigData.storeFile' specifies file 'C:\Users\oxter\Projects\AndroidStudio\ruffle-android\app\ruffle\androidkey.jks' which doesn't exist.
    

    I'm not entirely sure what to do from here, I've opened the project now in android studio to try and mess around. I wanted to see if I could just generate my own key but couldn't find the option or at least not yet. I'll report back if I figure it out, but also any help/guidance would be appreciated. Thanks

    opened by oxters168 10
  • control methods

    control methods

    remove title bar ruffle, i know what's it

    some games only require the mouse, so there is no need to display the virtual keyboard at this time

    you need this option to play landscape horizontal typing games or some portrait vertical games because the screen game has been covered by the keyboard Virtual Keyboard Transparency { { "0%", NULL }, { "25%", NULL }, { "50%", NULL }, { "75%", NULL }, { "100%", NULL }, { NULL, NULL }, }, "25%"

    image82

    opened by soundsnow 6
  • Magic DosBox mouse and keyboard solutions

    Magic DosBox mouse and keyboard solutions

    opened by soundsnow 1
  • warning

    warning

    The Ruffle emulator does not yet support ActionScript 3, required by this content. If you choose to run it anyway, interactivity will be missing or limited. More info|Run anyway

    opened by soundsnow 1
  • Better Touch

    Better Touch

    I improved the mouse behaviour for touch. Now when the user touches the screen it moves the mouse to the position then sends the mouse down event. Once they let go it sends the mouse up event. And when they drag it sends a mouse move event. I did this on the rust side. Oh and I hid the action bar, I think it looks nicer this way.

    opened by oxters168 1
  • improvements like these apps

    improvements like these apps

    download Download.zip uncompress and install

    Xemu65 Fullscreen Keyboard File Browser Transparency

    Super Pico Player Load File(s) (File Browser) Reload File(s) Rotate Resize Canvas (Portrait or Landscape) Map Controls Reset Pause Sound (On or Off)

    Screenshot_20221001-202518_Trebuchet

    Screenshot_20221001-193942_Trebuchet Screenshot_20221001-193951_Trebuchet Screenshot_20221001-194106_Trebuchet Screenshot_20221001-194145_Trebuchet Screenshot_20221001-194153_Trebuchet Screenshot_20221001-194516_Trebuchet Screenshot_20221001-194540_Trebuchet Screenshot_20221001-194556_Trebuchet Screenshot_20221001-194613_Trebuchet

    opened by soundsnow 0
  • [Feature request]: P1/P2 custom keyboard

    [Feature request]: P1/P2 custom keyboard

    Describe the feature

    Hide uncustomized keys and show customized keys

    Here are a few scenarios I envision, and these will solve most games For example, the following are all homebrew games that I have not released

    Left: Move Center: Pause, Continue, Cancel, Confirm, Restart Right: Actions

    why 2 players? Fireboy and Watergirl

    Taito had released an arcade game Front Line Left side control character movement Right side two buttons The firing button control can also adjust the shooting angle The button next to the shot is the bomb I can change the shooting angle by pressing key 12346789, 5 shooting, 0 bomb

    MSX and ColecoVision have a similar game Aquattack Left side move, 8- way shoot

    Why are there 9 custom keys on the left side? Some games are designed for left-handed people This kind of game left and right side keys are the same role Some rookies who develop games don't know how to combine 2 keys, no need to press two keys when moving

    Large machines usually have left and right levers I haven't seen a real excavator or plane, so I'm not sure There is a button on both levers For Example Left side 9 keys: qweasdzxc, iopjklbnm 4 keys: wasd, ijkl, up left down right

    Computer games allow two people to play The 16 buttons on the right side should be enough Fighting Games: LP, LK, MP, MK, HP, HK, Special 1, Special 2 8 × 2 = 16 Keys

    Another example Simulation, role-playing, strategy games, etc. The game contains a trading system 10 item slots 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Purchase: Yes, No Attack, Character, Item, Escape 16 Keys The two keys in the middle, Menu and Back

    Add screenshots

    1 Player 22 Keys 1 Player 22 Keys 1 Player 27 Keys 1 Player 27 Keys 2 Players 26 Keys 2 Players 26 Keys 2 Players 36 Keys 2 Players 36 Keys

    opened by soundsnow 0
  • flash game save files

    flash game save files

    I don't know what it's called cache? The files used to save the game data

    I know this game is not playable now For example Nitrome Must Die It takes a lot of time to complete 1 to 10 levels I can't have that long to finish all 101 levels in one day Close the game after completing 10 levels Close the game Next time open the game from 11 levels to continue

    opened by soundsnow 0
  • recent played list

    recent played list

    • Recent Played

    Game 1 Game 2 Game 3 Game 4 Game 5 Game 6 Game 7 Game 8 Game 9 Game 10 Clear List

    The number of files appearing in the list is less than or equal to 10 Reduced memory usage The next option of the tenth file name clears the current list

    opened by soundsnow 0
  • Crashed and  bugs overlay

    Crashed and bugs overlay

    Testing the app, I found that the virtual buttons and mouse option did not appear in the upper left corner of the phone, the audio is not working properly in some games and the game Super Mario 63 crashed when entering the princess castle,

    opened by leonSDG 2
  • Android overlay

    Android overlay

    Hi, recently I was looking for a solution to play flash games on Android, I found that there was a solution for PC that was very good, but unfortunately it had no options for Android, I was looking everywhere and then discovering your wonderful ruffle project unofficial, being able to play childhood games on mobile and with very good performance is perfect, I really hope you continue with this fantastic project. After that I came to research how the app works,

    Testing the app, I found that the option for virtual buttons and mouse did not appear in the upper left corner and games like Super Mario 63 crashed when entering the princess castle, I would like to know if there is any solution for this specific game

    opened by leonSDG 1
  • Error parsing the package on Shield TV, with old firmware

    Error parsing the package on Shield TV, with old firmware

    I'm stuck on an old Android version 7.0.0 Nougat because there is no way I am risking a bricked device from what I heard of a recent OTA upgrade, and not touching updates involving Scoped Storage at all. So, on my Shield TV I get a parsing package error instead of being able to install the apk. The native Flash Player plugin used to work a long time ago until it started crashing, ironically after doing an update, spoiling everything.

    The to-do list says this app now supports the (very old) 32bit arm hardware with it done and checked off (a good reason for why the app should supposedly just work and install successfully on an armv8 64bit device with an outdated Android version) so I am assuming there might be something wrong with the latest artifact build apk, as I can't install it due to that pesky parsing error.

    Is there an older artifact still present for a previous version that could more likely succeed at installing? Such a huge waste if several devices with outdated Android versions can't install an unrestricted/non-PlayStore app. Hoping there is a solution for this to get it up and running.

    opened by retrobenny 3
  • It's not good to play Nitrome games

    It's not good to play Nitrome games

    EYEZMAZE(a Japanese flash game developer) games almost good but Nitrome, Flipline and more games white screen, videos(not a real game), loading 0% No custom keyboard, mouse settings sorry, my English not good

    Complete collection of all URL lock removed (unlocked) Nitrome Flash games https://archive.org/download/all_nitrome_games other swf games uploaded by Mystery Snow Drift Fan https://archive.org/details/@mystery_snow_drift_fan

    opened by AngelofMe 0
Owner
TÖRÖK Attila
TÖRÖK Attila
Android / iOS app with shared Rust logic

Rust core for native Android and iOS apps [TODO iOS badge] This is an example that shows how to use a shared Rust core in native Android and iOS apps.

Ivan Schütz 193 Dec 5, 2022
Cross-platform GUI written in Rust using ADB to debloat non-rooted android devices. Improve your privacy, the security and battery life of your device.

Universal Android Debloater GUI DISCLAIMER: Use it at your own risk. I am not responsible for anything that could happen to your phone. This software

w1nst0n 7k Jan 7, 2023
Android-related tools for building and developing applications 🛠

Rust Android Tools Android-related tools for building and developing applications: Name Description Status aapt2 Android Asset Packaging Tool ✅ bundle

DodoRare 6 Dec 31, 2022
android-pathfinding

android-pathfinding Android pathfinding dependencies { implementation 'com.github.planet0104:android-pathfinding:1.0.0' } int[][] grid = new i

Jia Ye 1 Dec 17, 2021
🤖🦀 A rust native replacement for Android's `sdkmanager`

???? A rust native replacement for Android's `sdkmanager`

Traverse Research 13 Dec 13, 2022
Android resource file parsing & writing

arsc arsc is a Rust library that provides the ability to parse and write Android resource file (arsc) [dependencies] arsc = "0.1" Compiler support: ru

Yaxin Cheng 7 Dec 25, 2022
Android / iOS app with shared Rust logic

Rust core for native Android and iOS apps [TODO iOS badge] This is an example that shows how to use a shared Rust core in native Android and iOS apps.

null 193 Dec 5, 2022
Run all your Linux graphical apps on Android 💖✨✨✨

Waylovely Run all your Linux graphical apps on Android ?? ✨ ✨ ✨ The Android windowing system is different than those in desktop operating systems. In

Waylovely Project 14 Nov 23, 2022
Tokio based client library for the Android Debug Bridge (adb) based on mozdevice

forensic-adb Tokio based client library for the Android Debug Bridge (adb) based on mozdevice for Rust. Documentation This code has been extracted fro

null 6 Mar 31, 2023
Rust implementation of NearbyShare/QuickShare from Android for Linux.

rquickshare NearbyShare/QuickShare for Linux (WIP) How to use rquickshare offers two options for using its file sharing capabilities: command line (CM

Martin André 3 Feb 28, 2024
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
A simple GUI rust application that keeps track of how much time you spend on each application.

TimeSpent A simple GUI rust application that keeps track of how much time you spend on each application. Installation Click here to download the Setup

Slacked Lime 4 Sep 23, 2022
Glue between Rust and Android

deprecated in favor of https://github.com/rust-windowing/android-ndk-rs which works with winit master Android Glue Usage With Docker The easiest way t

Rust Windowing 898 Dec 15, 2022
Android / iOS app with shared Rust logic

Rust core for native Android and iOS apps [TODO iOS badge] This is an example that shows how to use a shared Rust core in native Android and iOS apps.

Ivan Schütz 193 Dec 5, 2022
File system enumerator and monitor for Android.

File system enumerator and file monitor for Android. Built to be compatible with other command line utilties! This tool was created to somewhat automa

Kyle Benac 15 Aug 23, 2022
Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, ...

LibAFL, the fuzzer library. Advanced Fuzzing Library - Slot your own fuzzers together and extend their features using Rust. LibAFL is written and main

Advanced Fuzzing League ++ 1.2k Dec 29, 2022
Rudroid - Writing the World's worst Android Emulator in Rust 🦀

Rudroid - Writing the World's worst Android Emulator in Rust ?? Introduction Rudroid - this might arguably be one of the worst Android emulators possi

Chaithu 102 Dec 23, 2022
A simple library for use one Rust code in multi platforms such as WebAssembly, Android and iOS

chameleon chameleon is a simple library for use one Rust code in multi platforms such as WebAssembly, Android and iOS. Key Features TBA Quick Start TB

Chris Ohk 3 Oct 18, 2021
Android Device Pool - A tool to run device tests against a pool of devices.

adp (Android Device Pool) What is this? A tool to run device tests against a pool of devices. It will 'checkout' a device to run your tests against an

Evan Tatarka 1 Oct 21, 2021
Cross-platform GUI written in Rust using ADB to debloat non-rooted android devices. Improve your privacy, the security and battery life of your device.

Universal Android Debloater GUI DISCLAIMER: Use it at your own risk. I am not responsible for anything that could happen to your phone. This software

w1nst0n 7k Jan 7, 2023