jniserviceconfig

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package jniserviceconfig resolves the small, non-shell configuration used by the Android jniservice launchers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen string
	Port   string
}

Config contains the listener host and port.

Example: the default config binds to 127.0.0.1:50051.

func Load

func Load(path string, env map[string]string) (Config, error)

Load applies defaults, one optional config file, then nonempty environment overrides. Only an absent file is optional; read and parse failures are returned so the service cannot start with a different listener by mistake.

Example: Load("/data/adb/modules/jniservice/jniservice.env", map[string]string{"JNISERVICE_PORT": "50052"}) resolves the Magisk settings.

func Merge

func Merge(env map[string]string, file Config) Config

Merge applies the loopback defaults, then config-file values, then nonempty listener environment values.

Example: Merge(map[string]string{"JNISERVICE_PORT": "50053"}, Config{}) returns the default host with port 50053.

func Parse

func Parse(data []byte) (Config, error)

Parse reads listener values from KEY=VALUE lines. Unknown keys and comments are ignored. Values are data, never shell syntax: this parser does not expand or execute them.

Example: Parse([]byte("JNISERVICE_PORT=50052\n")) returns port 50052.

Jump to

Keyboard shortcuts

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