Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/android-inspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Native storage inspector

on:
push:
paths:
- "android-inspector/**"
- "ib/**"
- "tests/**"
- "docs/storage-inspector.md"
- ".github/workflows/android-inspector.yml"
pull_request:
paths:
- "android-inspector/**"
- "ib/**"
- "tests/**"
- "docs/storage-inspector.md"
- ".github/workflows/android-inspector.yml"

permissions:
contents: read

jobs:
reference-contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Run storage/history tests
run: python -m unittest discover -s tests -v

android-native-inspector:
runs-on: ubuntu-latest
defaults:
run:
working-directory: android-inspector
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- uses: android-actions/setup-android@v3

- name: Install Android toolchain
run: |
sdkmanager "platforms;android-36" "build-tools;36.0.0" "ndk;29.0.14206865" "cmake;3.22.1"

- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "8.13"

- name: Build debug APK
run: gradle --no-daemon :app:assembleDebug

- uses: actions/upload-artifact@v4
with:
name: ib-native-inspector-apk
path: android-inspector/app/build/outputs/apk/debug/app-debug.apk
3 changes: 3 additions & 0 deletions android-inspector/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.gradle/
local.properties
**/build/
31 changes: 31 additions & 0 deletions android-inspector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Native storage inspector

This is a developer-only Android surface for the read-only storage contract in
`docs/storage-inspector.md`.

It is deliberately not a browser renderer and contains no WebView, Chromium,
JavaScript engine, Python runtime, or app Java/Kotlin code. The APK is a
`NativeActivity`; C performs rooted no-follow storage inspection and uses
Android's ordinary `ScrollView`/`TextView` widgets only to paint the resulting
debug text.

The inspector reads:

```text
<app internal files>/state/
```

It never creates or mutates that directory. Resume the app to refresh the view.

Current sections:

- overview totals and classification totals;
- bounded tab-manifest rows;
- bounded physical-file rows;
- bounded tail of canonical `visits.jsonl`, with byte offsets.

Build from this directory with:

```sh
gradle --no-daemon :app:assembleDebug
```
40 changes: 40 additions & 0 deletions android-inspector/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
plugins {
id("com.android.application")
}

android {
namespace = "org.isomorphisms.ib"
compileSdk = 36
ndkVersion = "29.0.14206865"

defaultConfig {
applicationId = "org.isomorphisms.ib"
minSdk = 26
targetSdk = 36
versionCode = 1
versionName = "0.1.0-inspector"

ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64")
}

externalNativeBuild {
cmake {
arguments += listOf("-DANDROID_STL=none")
}
}
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}

externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
}
22 changes: 22 additions & 0 deletions android-inspector/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="false"
android:hasCode="false"
android:label="IB Inspector"
android:supportsRtl="true"
android:theme="@android:style/Theme.Material.NoActionBar">
<activity
android:name="android.app.NativeActivity"
android:configChanges="orientation|screenSize|keyboardHidden|density"
android:exported="true">
<meta-data
android:name="android.app.lib_name"
android:value="ib_inspector" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
8 changes: 8 additions & 0 deletions android-inspector/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.22.1)
project(ib_inspector C)

add_library(ib_inspector SHARED inspector.c)
target_compile_features(ib_inspector PRIVATE c_std_11)
target_compile_options(ib_inspector PRIVATE -Wall -Wextra -Wpedantic)
target_link_options(ib_inspector PRIVATE -u ANativeActivity_onCreate)
target_link_libraries(ib_inspector android log)
Loading
Loading