appdata

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package appdata serves Android's per-app folders (Android/data) to the engine over SFTP on loopback.

Android hides those folders from every app but their owner, so the engine cannot open them itself. A second copy of the binary runs with more rights, as root or as the adb shell user, and the engine reaches it through an ordinary sftp remote.

Index

Constants

View Source
const RemoteName = "Android"

RemoteName is the target the app folders show up as.

View Source
const User = "arrowloop"

User is the login name the engine presents. The password is what keeps other apps on the phone out, since every app can reach loopback.

Variables

This section is empty.

Functions

func Link(addr, password string, seed []byte, knownHosts string) error

Link points the remote at a server on addr and pins its host key in knownHosts.

func PublicKey

func PublicKey(seed []byte) (ssh.PublicKey, error)

PublicKey is the host key a server started with seed presents.

func Serve

func Serve(o Options) error

Serve listens on o.Addr and answers SFTP sessions until the listener fails.

func Unlink() error

Unlink removes the remote if it is the one Link set up.

Types

type Options

type Options struct {
	// Addr is where to listen. It should be a loopback address.
	Addr string
	// Root is the folder served as "/", normally Android/data.
	Root string
	// Password is the one the engine has to give.
	Password string
	// HostKey is the ed25519 seed the server proves itself with, so the
	// engine can tell it from another app listening on the same port.
	HostKey []byte
	// ReadOnly refuses every change. The adb shell user has to run this way,
	// because what it writes into an app's folder belongs to the shell and
	// the app can no longer open it.
	ReadOnly bool
	// Adopt hands everything the server creates to the app whose folder it
	// is in. Only root can do that.
	Adopt bool
}

Options configures a server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址