Skip to content

poll-poll134/android-blackbox-analysis-skill

android-app-blackbox-competitive-analysis

Verified

Use when users request Android competitor research, systematic feature or interface mapping, evidence screenshots, interaction coverage, comparison-ready product dossiers, or Android system-boundary verification without APK decompilation.

FileKindSize
SKILL.mdskill md3.2 KB
examples/sanitized-complete-example/README.en.mdmarkdown2.0 KB
examples/sanitized-complete-example/README.mdmarkdown1.8 KB
examples/sanitized-complete-example/analysis/capability-matrix.csvother1.3 KB
examples/sanitized-complete-example/analysis/system-interface-evidence.csvother1.2 KB
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0001_empty-home.mdmarkdown254 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0002_app-picker.mdmarkdown253 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0003_instance-created.mdmarkdown254 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0004_instance-menu.mdmarkdown249 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0005_permission-diagnostics.mdmarkdown463 B
examples/sanitized-complete-example/indexes/control_coverage.csvother1.7 KB
examples/sanitized-complete-example/indexes/coverage_gaps.csvother1.2 KB
examples/sanitized-complete-example/indexes/interface_index.csvother1.1 KB
examples/sanitized-complete-example/indexes/screenshot_index.csvother1.4 KB
examples/sanitized-complete-example/input/capture-plan.csvother638 B
examples/sanitized-complete-example/input/scope.en.mdmarkdown849 B
examples/sanitized-complete-example/input/scope.mdmarkdown760 B
examples/sanitized-complete-example/reports/final-report.en.mdmarkdown3.6 KB
examples/sanitized-complete-example/reports/final-report.mdmarkdown3.1 KB
references/analysis-guide.mdmarkdown2.0 KB
references/evidence-model.mdmarkdown1.9 KB
scripts/build_indexes.mjsexecutablescript6.8 KB
scripts/capture_evidence.shexecutablescript4.8 KB
scripts/image_info.pyexecutablescript1.3 KB
scripts/init_case.shexecutablescript1.3 KB
scripts/package_release.pyexecutablescript2.6 KB
scripts/redact_check.mjsexecutablescript3.1 KB
scripts/scroll_sweep.shexecutablescript2.5 KB
scripts/smoke_test.shexecutablescript1.8 KB
scripts/tap_ui.shexecutablescript1.3 KB
scripts/ui_pick.pyexecutablescript1.9 KB
scripts/validate_example.mjsexecutablescript12.2 KB
scripts/validate_skill.mjsexecutablescript2.6 KB
templates/capability-matrix.csvother126 B
templates/report-template.mdmarkdown1.2 KB
templates/system-interface-evidence.csvother120 B

scripts/capture_evidence.sh

View on GitHub
#!/usr/bin/env bash
set -euo pipefail

serial=''
case_root=''
evidence_id=''
slug=''
package_name=''
expected_size=''

while [[ $# -gt 0 ]]; do
  case "$1" in
    --serial) serial="${2:-}"; shift 2 ;;
    --case-root) case_root="${2:-}"; shift 2 ;;
    --id) evidence_id="${2:-}"; shift 2 ;;
    --slug) slug="${2:-}"; shift 2 ;;
    --package) package_name="${2:-}"; shift 2 ;;
    --expected-size) expected_size="${2:-}"; shift 2 ;;
    *) printf 'unknown argument: %s\n' "$1" >&2; exit 2 ;;
  esac
done

if [[ -z "${serial}" || -z "${case_root}" || -z "${evidence_id}" || -z "${slug}" ]]; then
  printf 'usage: %s --serial SERIAL --case-root DIR --id ID --slug SLUG [--package NAME] [--expected-size WIDTHxHEIGHT]\n' "${0##*/}" >&2
  exit 2
fi

if [[ ! "${evidence_id}" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ || ! "${slug}" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then
  printf 'id and slug may contain only letters, numbers, dot, underscore, and hyphen\n' >&2
  exit 2
fi

if [[ -n "${package_name}" && ! "${package_name}" =~ ^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)+$ ]]; then
  printf 'package must be a fully qualified Android package name\n' >&2
  exit 2
fi
if [[ -n "${expected_size}" && ! "${expected_size}" =~ ^[1-9][0-9]{0,4}x[1-9][0-9]{0,4}$ ]]; then
  printf 'expected size must be WIDTHxHEIGHT with positive dimensions up to five digits\n' >&2
  exit 2
fi
if [[ "${case_root}" == '/' || "${case_root}" == '.' || "${case_root}" == '..' || -L "${case_root}" ]]; then
  printf 'refusing unsafe or symlinked case root: %s\n' "${case_root}" >&2
  exit 2
fi

if [[ "$(adb -s "${serial}" get-state 2>/dev/null || true)" != 'device' ]]; then
  printf 'ADB target is not ready: %s\n' "${serial}" >&2
  exit 3
fi

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
base="${evidence_id}_${slug}"
shots="${case_root}/evidence/screenshots"
raw_shots="${case_root}/evidence/raw_screenshots"
trees="${case_root}/evidence/ui_tree"
runtime="${case_root}/evidence/runtime"
mkdir -p "${shots}" "${raw_shots}" "${trees}" "${runtime}"

temporary_dir="$(mktemp -d "${TMPDIR:-/tmp}/android-blackbox-capture.XXXXXX")"
trap 'rm -rf "${temporary_dir}"' EXIT
raw_capture="${temporary_dir}/screenshot.source"
ui_capture="${temporary_dir}/ui.xml"

captured=false
for _attempt in 1 2 3; do
  if adb -s "${serial}" exec-out screencap -p > "${raw_capture}" && [[ -s "${raw_capture}" ]]; then
    captured=true
    break
  fi
  sleep 1
done
if [[ "${captured}" != true ]]; then
  printf 'failed to capture screenshot after three attempts\n' >&2
  exit 4
fi

read -r source_format width height < <(python3 "${script_dir}/image_info.py" "${raw_capture}")
if [[ -n "${expected_size}" && "${width}x${height}" != "${expected_size}" ]]; then
  printf 'unexpected resolution: got %sx%s, expected %s\n' "${width}" "${height}" "${expected_size}" >&2
  exit 5
fi

if [[ "${source_format}" == 'PNG' ]]; then
  raw_path="${raw_shots}/${base}.png"
  shot_path="${shots}/${base}.png"
  cp "${raw_capture}" "${raw_path}"
  cp "${raw_capture}" "${shot_path}"
else
  raw_path="${raw_shots}/${base}.jpg"
  cp "${raw_capture}" "${raw_path}"
  if command -v magick >/dev/null 2>&1; then
    shot_path="${shots}/${base}.png"
    magick "${raw_capture}" "${shot_path}"
  elif command -v sips >/dev/null 2>&1; then
    shot_path="${shots}/${base}.png"
    sips -s format png "${raw_capture}" --out "${shot_path}" >/dev/null
  else
    shot_path="${shots}/${base}.jpg"
    cp "${raw_capture}" "${shot_path}"
    printf 'warning: JPEG preserved because no converter is available\n' >&2
  fi
fi

ui_status='incomplete'
for _attempt in 1 2 3; do
  adb -s "${serial}" exec-out uiautomator dump /dev/tty > "${ui_capture}" 2>/dev/null || true
  if grep -q '</hierarchy>' "${ui_capture}"; then
    ui_status='complete'
    break
  fi
  sleep 1
done

if [[ "${ui_status}" == 'complete' ]]; then
  ui_path="${trees}/${base}.xml"
else
  ui_path="${trees}/${base}.incomplete.xml"
fi
cp "${ui_capture}" "${ui_path}"

if [[ -n "${package_name}" ]]; then
  adb -s "${serial}" shell dumpsys package "${package_name}" > "${runtime}/${base}.package.txt" 2>&1 || true
  adb -s "${serial}" shell cmd appops get "${package_name}" > "${runtime}/${base}.appops.txt" 2>&1 || true
  adb -s "${serial}" shell dumpsys activity activities > "${runtime}/${base}.activities.txt" 2>&1 || true
fi

captured_at="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
metadata="${runtime}/${base}.meta.txt"
printf '%s\n' \
  "capture_id=${evidence_id}" \
  "slug=${slug}" \
  "captured_at=${captured_at}" \
  "serial=${serial}" \
  "package=${package_name}" \
  "source_format=${source_format}" \
  "resolution=${width}x${height}" \
  "ui_tree_status=${ui_status}" > "${metadata}"

printf 'screenshot=%s\n' "${shot_path}"
printf 'raw_screenshot=%s\n' "${raw_path}"
printf 'ui_tree=%s\n' "${ui_path}"
printf 'resolution=%sx%s\n' "${width}" "${height}"
printf 'ui_tree_status=%s\n' "${ui_status}"
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall