detectApk function
Detects if installed via Alpine APK by querying apk.
Implementation
Future<bool> detectApk() async {
if (!Platform.isLinux) return false;
final osRelease = await getOsRelease();
if (osRelease != null && !isDistroFamily(osRelease, ['alpine'])) return false;
final execPath = Platform.resolvedExecutable;
try {
final result = await Process.run('apk', ['info', '--who-owns', execPath]);
return result.exitCode == 0 && (result.stdout as String).isNotEmpty;
} catch (_) {
return false;
}
}