Install binder
We need to install binder because Arknights depends on it to translate app messages to the Linux system.
Linux-zen is an alternative kernel available in the official Arch repos.
We can use pacman to install it:
|
|
If you use an NVIDIA GPU, you may need extra effort to make it work. Since I use an AMD GPU, I don’t really care about that.
After installing linux-zen, if you use GRUB, you should use the instructions below to update your config before rebooting.
|
|
If you use systemd-boot, it will update automatically, but you might need to check your loader entries in /boot/loader/entries to make sure linux-zen is selected.
You can use this command to check it:
|
|
Waydroid
We use Waydroid as the Android emulator for playing Arknights.
Use pacman to download Waydroid.
Run waydroid init to download the image. If installation fails due to network issues, you can use the archlinuxcn repo to install waydroid-image.
Then run waydroid init again.
Download the waydroid script
to install the Arm translation layer.
To improve translation performance, it is recommended to use libndk on AMD CPUs and libhoudini on Intel CPUs. However, some apps only support one specific translation layer, so if a game doesn’t work or has terrible performance, you might need to try both layers.
Requires a Python virtual environment.
Install libndk arm translation layer
|
|
Install libhoudini arm translation layer
|
|
Only
libhoudiniworks on my computer;libndkcauses a black screen.
If installation fails, it might be due to network issues. Export the ports:
|
|
Install via proxy:
|
|
Check Android version:
|
|
Setting Waydroid Resolution
I use hyprland and haven’t found a good way to make the interface adapt to tiled window sizes automatically. I can only add a floating property to this window.
Define custom rules for waydroid:
|
|
You can adjust the width, height, and DPI:
|
|
My advice is not to set these manually; let hyprland handle it.
Google Play
I originally wanted to set up Google Play, but there seems to be an issue on Google’s end, so I have to wait for a fix.
Discussion thread: Unable to register device in Google uncertified registration page .
BUG
Unknown Bug
This is likely due to the audio server dying … see Issue 576 and Issue 829 for details.
A workaround is to run:
|
|
You can make it permanent by creating a .conf file in /etc/sysctl.d/ and adding kernel.pid_max=65535 to it.
|
|
Hard to comment, hard to fix.
The cause hasn’t been located yet, and it’s not fixed. My guess is it’s an audio issue.
Docker Disables IP Forwarding
waydroid couldn’t connect to the internet (ping packet loss). Initially, I suspected it was a TUN mode issue, but after troubleshooting, it still couldn’t connect.
|
|
When investigating the IP issue, I was told it might be caused by a conflict between Docker and waydroid.
Docker changes the iptables forwarding policy to DROP by default:
|
|
Modify the forwarding policy:
|
|
Fix successful:
|
|
Save the rules after success:
|
|
Shortcuts
Use ydotool
|
|
Since I have dual monitors, the hyprland pixel coordinates and ydotool pixel coordinates are different. Testing this makes me want to puke 🤮. Put on hold for now.
Other Knowledge
waydroid shell is similar to adb shell, but since it’s a container, it’s faster than ADB and has higher privileges.
waydroid file paths are stored in .local/share/waydroid/data/media/0
Access requires root privileges:
|
|
You can install APKs via the terminal:
|
|
List installed apps:
|
|
Debug log information:
|
|
Besides using logcat, since the kernel is shared, you can also use dmesg to capture logs.
|
|
The Android configuration file is located at /var/lib/waydroid/waydroid_base.prop.
|
|
waydroid has two UI modes: Multi-Window and Full-UI.
Multi-window allows apps to become independent wayland windows.
Full-UI renders a complete Android desktop.