Add Android APK fleet nodes with Crucible UI integration and tests.
APK wrapper registers platform=android via AETHERFORGE_PLATFORM; fleet UI shows robot icons, Android Access Depth probes, and a shortened mining onion timeline.
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"crypto-miner-agent/config"
|
||||
)
|
||||
|
||||
// EnvironmentProbes captures host capabilities that drive tier selection.
|
||||
@@ -14,8 +16,11 @@ type EnvironmentProbes struct {
|
||||
PowerShell bool `json:"pwsh"`
|
||||
DotNet bool `json:"dotnet"`
|
||||
GPU bool `json:"gpu"`
|
||||
AVBlocksExe bool `json:"av_blocks_exe"`
|
||||
WebView2 bool `json:"webview2"`
|
||||
AVBlocksExe bool `json:"av_blocks_exe"`
|
||||
WebView2 bool `json:"webview2"`
|
||||
Wifi bool `json:"wifi,omitempty"`
|
||||
Battery bool `json:"battery,omitempty"`
|
||||
ForegroundService bool `json:"foreground_service,omitempty"`
|
||||
}
|
||||
|
||||
// probeExecCommand is exec.Command; tests override via SetProbeExecCommand.
|
||||
@@ -56,6 +61,12 @@ func ProbeEnvironment(runtimeFn func() ContainerRuntimeInfo) EnvironmentProbes {
|
||||
Docker: rt.Available,
|
||||
GPU: gpuProbeFn(),
|
||||
}
|
||||
if config.IsAndroidPlatform() {
|
||||
p.Wifi = envTruthy("AETHERFORGE_WIFI_CONNECTED")
|
||||
p.Battery = envTruthy("AETHERFORGE_BATTERY_OK")
|
||||
p.ForegroundService = envTruthy("AETHERFORGE_FOREGROUND_SERVICE")
|
||||
return p
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
wsl := WSLDetector()
|
||||
p.WSL = wsl.Available
|
||||
@@ -70,6 +81,11 @@ func ProbeEnvironment(runtimeFn func() ContainerRuntimeInfo) EnvironmentProbes {
|
||||
return p
|
||||
}
|
||||
|
||||
func envTruthy(key string) bool {
|
||||
v := strings.TrimSpace(os.Getenv(key))
|
||||
return v == "1" || strings.EqualFold(v, "true")
|
||||
}
|
||||
|
||||
func inferAVBlocksExe() bool {
|
||||
if v := strings.TrimSpace(os.Getenv("AETHERFORGE_AV_BLOCKS_EXE")); v == "1" || strings.EqualFold(v, "true") {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user