Crowbar17

Running after-death Flash on Linux

Oct 31st, 2020 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

Running the game on Linux after Flash dies

[This tutorial was written with "Pirates: Tides of Fortune" in mind, but it should work for all Flash content]

As we all know, Flash will die on 31st December 2020. Sadly, Plarium dropped the ball on this one and, instead of using these past few years to take the HTML5 route, they opted to insist on a Flash client, with their patch for the Flash's death problem being a standalone app that is basically a Flash wrapper. This app exists for Win and Mac, but not for Linux.

Linux users have an obvious solutions: VirtualBox or another VM, running either Win or Mac with Plarium's app, or your favourite Linux distro with never-to-be-updated browser.

Personally, I feel that a full blown VM running its own OS is an overkill. Also, one might want to have several browser windows, which are a bit clumsy to manipulate if they are contained in the VM's window.

The solution that I'm proposing here is a separate, never-to-be-updated browser, as a part of your own system. This means you'll have two different version of Chrome: one for the game and one for normal everyday use, and you'll be able to run them together, at the same time.

The main issue with this is that if you run Chrome while already running its instance, you're just opening a new window of the running one, even if the two Chromes are different versions. To work around that, your "Flash Chrome" should be run under a different user.

Here is a step by step guide on how to achieve that (I work on Fedora, but it should be quite similar for other distros).

  1. Create a new user. Being a highly imaginative guy, I've called mine flash.

  2. Download Chrome as a tarball, for example here.

  3. Unpack that somewhere in the user flash's directory and make sure you can run it there (as flash).

  4. To preserve your Chrome profiles, copy them from your default user, by su-ing as a root, rsync-ing Chrome's config dir, and changing the files' ownership:

    su -
    cd /home/flash/.config
    rsync -av /home/{default_user}/.config/google-chrome .
    chown -R flash:flash google-chrome/

    [do replace {default_user} with your actual username!]

  5. Make a script in your default user's bin directory to run Chrome as the user flash. This script needs to allow flash to access your X session and then sudo-run the browser. For me, the script looks like this:

    xhost +SI:localuser:flash && sudo -u flash /home/flash/chrome/opt/google/chrome/google-chrome --ppapi-flash-path="/home/flash/.config/google-chrome/PepperFlash/32.0.0.445/libpepflashplayer.so"

    The Flash version might be different for you. You can check which one you have either in about://components (of flash's Chrome!) or by simply listing the contents of /home/flash/.config/google-chrome/PepperFlash/.
    Also, don't forget to chmod +x your newly created script.

Now, this will do pretty much what I promised above, with one annoying detail: sudoing will require your password. To work around that, be root (or use sudo) to create a file in /etc/sudoers.d/ containing this:

{default_user}  ALL=(flash) NOPASSWD: /home/flash/chrome/opt/google/chrome/google-chrome

Please, remember that conflicting sudoers instructions overwrite each other, meaning that the last one is used. So, if you have something like

{default_user}  ALL=(ALL)   ALL

running after the NOPASSWD one, you will still be prompted for a password.

If making an icon on your desktop, in a panel, or in your system menu, just make it run the script from step 5.

All of this allows the default user to run Chrome as the user flash. Note that this means that the browser have access to the same directories as the user flash (so maybe not your own home!) and the files you save under it will be owned by flash, not you. This shouldn't be a problem if you're using this browser only to play game(s), and you can still run your system's Chrome under your own user, at the same time as flash's Chrome.

Addendum 1: Flash kill switch

I was made aware that Flash itself has a kill switch that would render the above approach useless. To (try to) work around that, look your packages repository (dnf on Fedora, apt on Debian and Ubuntu,...) for a neat little program called faketime. Install it and modify the startup script like this:

xhost +SI:localuser:flash && sudo -u flash faketime -f "-3y" /home/flash/chrome/opt/google/chrome/google-chrome --ppapi-flash-path="/home/flash/.config/google-chrome/PepperFlash/32.0.0.445/libpepflashplayer.so"

This will give Flash 3 years older time than it actually is.

Of course, if Flash is fetching its time from the internet, this won't help.

Add Comment
Please, Sign In to add comment