mobile.h(3)Bark

NAME

mobile.h - Native mobile AOT lifecycle C ABI (Android arm64-v8a & iOS arm64).

SYNOPSIS

Classes

struct bark_mobile_config

Configuration passed by the native mobile shell to bark_mobile_boot().

struct bark_mobile_status

Fixed-size 128-byte mobile runtime & attestation status snapshot.

Typedefs

typedef struct bark_mobile_config bark_mobile_config_t

Configuration passed by the native mobile shell to bark_mobile_boot().

typedef struct bark_mobile_status bark_mobile_status_t

Fixed-size 128-byte mobile runtime & attestation status snapshot.

Enumerations

enum bark_mobile_cfg_flags { BARK_MOBILE_CFG_REQUIRE_APK_CERT = 1u << 0, BARK_MOBILE_CFG_REQUIRE_NO_DEBUGGER = 1u << 1, BARK_MOBILE_CFG_ENABLE_ANTI_DEBUG = 1u << 2, BARK_MOBILE_CFG_REQUIRE_LEASE = 1u << 3 }

Feature/hardening flags for bark_mobile_config_t.

Functions

int bark_mobile_boot (const bark_mobile_config_t *cfg, uint64_t now_sec)

Initialize mobile session, hardware keychain, anti-tamper baseline, and app hooks.

int bark_mobile_step (uint64_t now_sec)

Advance one 60Hz native frame: check lease/integrity, poll, flush, and present.

void bark_mobile_pause (void)

Notify runtime that the mobile app entered background (pauses render & wipes volatile state).

int bark_mobile_resume (uint64_t now_sec)

Notify runtime that the mobile app returned to foreground and re-verify live code integrity.

int bark_mobile_apply_lease (const uint8_t *resp_bytes, size_t resp_len, uint64_t now_sec)

Verify and install an Ed25519-signed lease response blob and notify on_ticket().

void bark_mobile_revoke_lease (void)

Revoke/clear the active lease and wipe session DEK + ticket immediately.

int bark_mobile_build_heartbeat (const uint8_t chal_bytes[80], uint64_t now_sec, uint8_t out_resp[80])

Build an 80-byte keyed integrity heartbeat response for an 80-byte server challenge.

int bark_mobile_get_status (bark_mobile_status_t *out)

Copy the current 128-byte mobile runtime status snapshot into out.

int bark_mobile_get_device_pk (uint8_t out_pk[32])

Copy the hardware-bound 32-byte X25519 device public key into out_pk.

void bark_mobile_shutdown (void)

Destroy application state, wipe secrets, and close the hardware keychain.

Detailed Description

Native mobile AOT lifecycle C ABI (Android arm64-v8a & iOS arm64).

Used by the thin Android JNI and iOS Objective-C/Swift native shells to drive any Bark application compiled with -DBARK_MOBILE_AOT without WebView, WASM, or dynamic PROT_EXEC/MAP_JIT code loading.

Enumeration Type Documentation

enum bark_mobile_cfg_flags

Feature/hardening flags for bark_mobile_config_t.

Enumerator

BARK_MOBILE_CFG_REQUIRE_APK_CERT
Fail-closed if APK signing cert != expected_apk_cert_sha256.
BARK_MOBILE_CFG_REQUIRE_NO_DEBUGGER
Taint session if debugger/ptrace is attached.
BARK_MOBILE_CFG_ENABLE_ANTI_DEBUG
Activate OS anti-debug (PT_DENY_ATTACH / PR_SET_DUMPABLE=0).
BARK_MOBILE_CFG_REQUIRE_LEASE
Gate step() on active non-expired untainted lease (offline-brick).

Function Documentation

int bark_mobile_step (uint64_t now_sec)

Advance one 60Hz native frame: check lease/integrity, poll, flush, and present.

Returns

0 normal frame, 1 quit requested, -2 lease required/expired/tainted (offline-brick), -1 invalid.

Author

Generated automatically by Doxygen for Bark from the source code.