Skip to content

Instantly share code, notes, and snippets.

@jehuamanna
Created December 23, 2025 08:55
Show Gist options
  • Select an option

  • Save jehuamanna/b81834ad2af5fbe14738550aa44509d9 to your computer and use it in GitHub Desktop.

Select an option

Save jehuamanna/b81834ad2af5fbe14738550aa44509d9 to your computer and use it in GitHub Desktop.
import 'dart:convert';
import 'dart:async';
/// ---------------- MOCK API ----------------
Future<String> mockApiResponse() async {
await Future.delayed(const Duration(milliseconds: 500));
return jsonEncode({
"meta": {"v": "1.2", "ts": "2025-12-23T14:20:00Z"},
"system": {
"chains": [
{
"name": "boot_chain",
"flow": {
"stage": "spl",
"next": {
"stage": "bl31",
"secure": true,
"next": {
"stage": "kernel",
"handoff": {
"init": {
"root": {
"type": "block",
"paths": {
"primary": "/dev/mmcblk0p5",
"fallback": ["/dev/mmcblk1p5", "/dev/mmcblk2p5"],
},
},
},
},
},
},
},
},
{
"name": "recovery_chain",
"flow": {
"stage": "spl",
"next": {
"stage": "bl31",
"secure": true,
"next": {
"stage": "recovery",
"handoff": {
"init": {
"root": {
"type": "block",
"paths": {
"primary": "/dev/mmcblk0p6",
"fallback": ["/dev/mmcblk1p6", "/dev/mmcblk2p6"],
},
},
},
},
},
},
},
},
],
},
});
}
/// Extract and print:
/// Chain Name -> Primary Root Device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment