Skip to content

Latest commit

ย 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงญ Thor Pathfinder

Latest release License: GPL-3.0 AYN Thor, Android 13+

Move apps between the AYN Thor's two screens, and put shortcuts on its buttons.

Pathfinder is a free, open-source companion for the AYN Thor. Hold Back and the apps on the top and bottom screens trade places. Double-press Select and the Thor's mouse mode turns on or off. Every shortcut can be changed, on seven of the Thor's buttons.

It's made in the spirit of Thor Wayfinder, which found the way first, and covers everything Wayfinder does. It's an independent project, not affiliated with Wayfinder or AYN.

AI disclosure: Thor Pathfinder was written with Claude, Anthropic's AI assistant, under the direction of its maintainer, who tested the changes on an AYN Thor.

๐Ÿ“ธ Screenshots

Setup Main menu
Setup's welcome screen, listing the default shortcuts Pathfinder's main menu
Button shortcuts Choosing a shortcut
The Back button's press, double-press and hold shortcuts Choosing what holding Back does
Settings Open-source licenses
The settings menu: close app(s), mouse mode, timing, update settings, run setup again The licenses of Pathfinder and everything it ships

โœจ Features

๐Ÿ”€ Swap screens

  • Swaps the apps on the two screens, or sends a lone app to the other screen.
  • Apps keep running while they move. Pathfinder hands the app's window to the other screen instead of restarting the app there.
  • When a lone app leaves a screen, that screen goes to its home screen rather than revealing whatever was underneath.
  • If one of the two apps is playing a video or music, it moves first, so playback stays smooth.

๐ŸŽฎ Button shortcuts on Back, Home, the AYN button, Select, Start, L3 and R3:

  • Back, Home and the AYN button: press, double-press and hold.
  • Select, Start, L3 and R3: double-press and hold. Games still receive every press of these buttons, so a plain press stays with the game.
  • Actions: swap screens, mouse mode on/off, back, home, recent apps, close app(s), notifications, quick settings, screenshot, screen record (testing), power menu, lock screen, or open an app.
  • Close app(s) closes every app, like Recents' Clear all, or just some: the background ones (all but what the two screens are showing), the focused app (on the screen you last used), the top screen's app, the bottom screen's app, or apps you pick by name.
  • Profiles: keep more than one set of shortcuts and switch between them from the oval under the title, or with a shortcut of its own.
  • Open an app on the top screen, the bottom one, or ask each time. Or open two at once, one on each screen.
  • Home can go to the top screen, the bottom one, or both at once. Pathfinder starts each screen's own home screen there rather than pressing Home, so AYN's "Enable Home and Back focus lock" setting cannot send the wrong screen home.
  • Close app(s) can spare the apps you choose: their window closes like any other, but they aren't force-stopped, so music or a download carries on. Background helpers like OdinTools, ClusterTune and Pulse are offered first.

๐Ÿ–ฑ๏ธ Mouse mode

Before: mouse mode was switched only with the Thor's own switch, and the right stick scrolled backwards. The stick drags an invisible finger across the screen, so pushing up moved the page down. The Thor can reverse that, but there's no button for it in its menus.

With Pathfinder:

  • Double-press Select, or any shortcut you pick, to turn mouse mode on or off. A short message says which.
  • One switch, under the cog's Mouse mode page, reverses the right stick, so pushing up scrolls up, like a mouse wheel. It takes effect after a restart, and Pathfinder offers a Restart now button.
  • Cursor speed and sensitivity stay in the Thor's own mouse mode settings.

๐Ÿ•น๏ธ Built for the Thor

  • A step-by-step setup that checks each requirement before moving on.
  • The cog at the top opens a settings menu: which apps keep running, mouse mode, the hold and double-press timings, updates, and running setup again.
  • When something needs attention, it says why. Android switches accessibility services off whenever their app updates, and Shizuku stops when the Thor restarts.
  • Works with the Thor's controller as well as touch. Every control shows a clear outline when it has focus.
  • Pathfinder looks for a newer release when it opens, and the button at the top says what it found. A new version brings up a notice you can dismiss, for now or for good.
  • If you turn it on, Pathfinder installs an update itself: it fetches the APK from the release here and installs it through Shizuku, with nothing to confirm. It starts off, and only ever installs a build signed with the same key as the copy you already have.

๐Ÿ”’ Private and light

  • The accessibility service receives button presses only. It cannot read the screen or anything you type.
  • It goes online only to ask GitHub for the newest release: when you open Pathfinder, which you can turn off, and when you tap the button. With automatic updates on it also downloads the APK from the release. Nothing about you or your Thor is sent.
  • The app is under 2 MB and runs no background work of its own.

๐Ÿ“ฆ Out of the box

Button Gesture Does
Back Press Back
Back Double-press Recent apps
Back Hold Swap screens
Select Double-press Mouse mode on/off

Everything else is left alone until you change it. Home and the AYN button keep their normal behaviour, with no delay, until you give them a shortcut.

โœ… Requirements

  • An AYN Thor on firmware 1.0.0.377 or newer (Android 13). Setup checks this, and offers the system update screen if the Thor needs updating. The AYN Thor Lite is supported too, and has been tested on one.
  • Shizuku, from Google Play or its GitHub releases, for swapping screens and for anything to do with mouse mode. Shizuku grants the extra access without rooting the Thor, and walks you through its own setup.

๐Ÿ“ฒ Install and set up

  1. Download the latest Thor-Pathfinder-*.apk from Releases and open it on the Thor to install it.
  2. Open Thor Pathfinder and follow the setup:
    1. Check your Thor: confirms the model and firmware.
    2. Thor Wayfinder (only if it's installed): both apps use the Back button, so uninstall Wayfinder or turn off its accessibility service.
    3. Accessibility: turn on Thor Pathfinder's service.
    4. Shizuku: install and start Shizuku if needed, then allow Pathfinder.

Tip

"Restricted setting"? Android blocks accessibility services for apps installed from outside the Play Store until you allow them. If you see this, open Pathfinder's app info, tap โ‹ฎ in the corner, choose Allow restricted settings, then turn the service on again.

Note

Every release is signed with the same key, so new versions install over old ones. The release notes list the key's fingerprint and the APK's checksum.

โš ๏ธ Known limitations

Important

Reverse scrolling needs a restart. The setting lives in AYN's own mouse mode configuration, which the Thor reads once at start-up. Pathfinder offers a Restart now button after you change it. Resetting the Thor's own mouse mode settings can turn it off again; if so, switch it back on in Pathfinder.

Note

Screen record is still being tested, and takes a few seconds. The recorder's options panel can only be opened from its Quick Settings tile, so the shortcut opens Quick Settings, finds the tile (on any page) and presses it for you. Keep the Screen record tile in Quick Settings for this to work.

๐Ÿ”ง How it works

Seeing the buttons. Android only shares button presses with accessibility services, so Pathfinder runs one. It hears about each press just before the app on screen does, and asks for nothing else: no screen contents and no typing. Every physical button also reports a hardware number, its scan code. That's how Pathfinder tells the Home button (102) from the AYN button (194), although Android calls both "Home". Presses that Android makes up itself, such as the back gesture on the screen, carry no scan code, so Pathfinder leaves them alone.

The AYN button isn't really a Home button, though: the Thor's own software catches it and opens AYN's menu on a press, or another panel on a long press. Nothing else can open those, so when a gesture on the AYN button is left on Normal, Pathfinder presses the real button again, through Shizuku, and lets that one press through to the Thor.

Only the real key opens those panels, so with Shizuku not running Pathfinder leaves the AYN button alone altogether: spotting a hold or a double-press means swallowing every press, and a plain press it swallowed could not be given back. The AYN menu keeps working, and shortcuts on the button start working again the moment Shizuku does. A press set to a shortcut of its own never has to be given back, so that one always works.

Back and Home work the same way when Shizuku is running. Android can perform a Back or a Home itself, but that stand-in comes from no real button, and apps that bind to the button itself, RetroArch for one, don't accept it. Pressing the real key means they see exactly what the button sends. Without Shizuku, Pathfinder uses Android's own Back and Home instead.

If the service stops working. Two different things can go wrong, and Pathfinder now tells them apart. Android may switch the service off โ€” it does that whenever the app is updated, and some devices do it at other times too. Or the switch stays on and Android never starts the service, in which case everything looks right and no shortcut works.

Both are fixed the same way: switch Thor Pathfinder off and on again in Android's accessibility list. With Shizuku connected, Pathfinder's setup screen offers a button that does it for you. Without Shizuku it can't, since only the shell user may change that setting โ€” so there is a script for that case, fix-accessibility.sh, attached to each release. Put it somewhere you can reach, such as Download, then open the Thor's own settings, choose Run script as Root and pick it. It adds Pathfinder back to the list, keeps every other accessibility service exactly as it was, and changes nothing else. It is worth reading before running; it is deliberately short.

If it keeps happening, the cog's Watchdog page turns on a small helper that Shizuku keeps running. Because it belongs to Shizuku rather than to Pathfinder, it carries on when something stops Pathfinder itself, and it puts the service back within a few seconds. It is off unless you turn it on, it only ever adds Pathfinder's own service, and it leaves the switch alone while Android's settings are open, so switching the service off yourself still works. It stops at a restart, since Shizuku does. The script is watchdog.sh in the source and it is worth reading.

The cog's Diagnostics page gathers everything that matters when reporting one of these: what the device reports itself as, whether Android has the service installed, switched on and started, and a history of every time the switch changed or the service stopped.

Moving apps between screens. Android keeps each open app in a task, and every task belongs to one screen. Pathfinder asks Android to hand the app's task to the other screen (am display move-stack), the same move Android makes itself, so the app keeps running instead of restarting. Asking for that takes more access than an app normally has, and that's what Shizuku provides: it runs the command with the same rights as a USB debugging connection, with no root needed.

Profiles. A profile is a whole set of shortcuts: every button and gesture, the keep-running list, the hold and double-press timings, and vibration. Whatever you had before profiles existed becomes your Main profile, untouched. The oval under the title says which profile is in use and switches between them; Create profile starts one with every shortcut at its default, and offers to copy the keep-running list across so you don't have to pick those apps again. Manage profiles, behind the cog, renames, adds and removes them.

Which profile is the main one is yours to choose, in Manage profiles. The main profile is the one an Enable shortcut goes back to on a second press, the one Pathfinder falls back to if the profile in use is deleted, and the one that can't be deleted itself. It starts out as the profile you already had, and moving it moves all three of those.

Mouse mode is deliberately not part of a profile. It isn't Pathfinder's to keep: mouse mode is the Thor's own setting and its own config file, shared by everything on the device, so it stays as it is whichever profile is in use.

Switching profiles draws the Thor on the top screen with a box beside every button that carries a shortcut in the profile you have just moved to, so you can see what you are holding without opening anything. It stays until you press Dismiss; a tap anywhere on it, or any button press, does the same. Turn it off with Show the buttons on switching in Manage profiles, and a switch just names the profile instead.

The Profile switcher action puts profiles on a button. It can cycle through them, enable one by name (pressing it again goes back to the main profile), or ask, which puts a list on the top screen to choose from. A shortcut set to enable a profile that has since been deleted cycles instead.

Closing all apps. Recents' "Clear all" button removes every task shown in Recents and stops those apps. Pathfinder's Close all apps does the same through Shizuku (am stack remove for each task, then am force-stop for each app), so the Recents screen never has to open. Home screens stay; even Pathfinder's own window is closed, so Recents ends up empty. Both screens then return to their home screens, as after Clear all.

Close background apps clears everything the two screens aren't showing. What's in front is the point of it, so neither screen is sent home and the apps on them keep running, other windows of theirs included; every task behind them goes, force-stop and all.

Close focused app does the same for one app: the one on the screen you last touched, which is the app Android itself treats as in front. Close top app and Close bottom app pick the app showing on that screen, the same way a swap decides what to move. Close specific apps closes the apps you chose, wherever they are, even with no window open. Home screens are never closed.

Apps on your keep-running list lose their window like any other, but skip the force-stop, whichever way they're closed. Removing a window ends what's on screen; force-stopping also ends an app's background work, which is what would cut off music, a download or a sync.

Screen record. The recorder's options panel is a dialog inside System UI that only its Quick Settings tile opens: its recording service isn't exported, the panel isn't an app screen, and Android's tile-click command only reaches third-party tiles. So the shortcut does what a finger would, through Shizuku: it opens Quick Settings, reads the panel with Android's uiautomator tool to find the tile on whichever page it is, and taps it. The tile's label comes from System UI's own resources, so it's found in any language. Pathfinder's accessibility service takes no part in this.

Mouse mode. The Thor's mouse mode is one system setting that AYN's input engine watches. Pathfinder flips it, through Shizuku, exactly as the Thor's own switch does.

Scroll direction. In mouse mode the right stick isn't a mouse wheel: it drags an invisible finger across the screen, which is why pushing up moves the page down. AYN's input engine can reverse that drag. The switch for it sits in the Thor's mouse mode settings file (AYN_Thor_Settings/global_mouse_mode_config.json) but has no button in the Thor's menus. Pathfinder changes only that one value, keeps a copy of the original next to it, and the Thor picks it up the next time it starts.

๐Ÿ› Reporting a problem

Please include your firmware version (shown in setup) and, if you can, a log:

adb logcat -s PathfinderSwap PathfinderShell PathfinderMouse

Each swap logs one line describing what Pathfinder saw on both screens and what it moved.

๐Ÿ› ๏ธ Building

You need JDK 17 and the Android SDK (platform 35).

./gradlew :app:testDebugUnitTest :app:assembleRelease

The APK is written to app/build/outputs/apk/release/app-release.apk. Without the project's signing key it is signed with your local debug key, so it installs fine but can't update a copy installed from Releases.

๐Ÿ“œ License

Thor Pathfinder is free software, released under the GNU General Public License v3.0.

It bundles the Shizuku API (MIT License) and AndroidX, Jetpack Compose and Kotlin libraries (Apache License 2.0). See THIRD_PARTY_NOTICES.md; the app shows the same licenses under About โ†’ Open-source licenses.

AYN and Thor are trademarks of their respective owners. Pathfinder is not affiliated with or endorsed by AYN, Thor Wayfinder or Shizuku.

About

Swap apps between the AYN Thor's two screens and put shortcuts on its buttons. Free and open source (GPL-3.0).

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages