zhaoxuya520/reverse-skill / skills
reverse-skill-router
FlaggedRoutes reverse engineering, exploitation, penetration testing, malware, mobile, firmware, browser automation, documentation, and security tasks to the appropriate specialist skill. Use when a task spans modules or the correct reverse-skill entrypoint is unclear.
scripts/test-apk-decode-manifest.sh
View on GitHub#!/usr/bin/env bash
# Regression: the apk-reverse decode summary must work with the system grep.
# `grep -oP` is GNU-only; on BSD grep (macOS) it fails, and because decode.sh
# runs under `set -euo pipefail` the failing pipeline aborts the script before
# the summary block is printed at all.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
SCRATCH="$(mktemp -d)"
trap 'rm -rf "$SCRATCH"' EXIT
DECODE="$REPO_ROOT/skills/apk-reverse/scripts/decode.sh"
EXPECTED_PACKAGE="com.example.fixture"
echo "=== Testing APK Decode Manifest Summary ==="
# Fixture: an APK path plus the apktool output that decode.sh would summarize.
mkdir -p "$SCRATCH/fixture/apktool"
: > "$SCRATCH/fixture.apk"
cat > "$SCRATCH/fixture/apktool/AndroidManifest.xml" <<'MANIFEST'
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="34" package="com.example.fixture">
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="Fixture" />
</manifest>
MANIFEST
# Test 1: decode.sh reaches its summary (no abort from a portability failure)
echo "[Test 1] decode.sh completes when jadx/apktool are skipped"
if ! OUTPUT="$(bash "$DECODE" "$SCRATCH/fixture.apk" --skip-jadx --skip-apktool 2>&1)"; then
echo "FAIL: decode.sh exited non-zero"
printf '%s\n' "$OUTPUT"
exit 1
fi
# Test 2: the manifest package attribute is reported
echo "[Test 2] decode.sh reports the manifest package"
if ! printf '%s\n' "$OUTPUT" | grep -Fq "package=$EXPECTED_PACKAGE"; then
echo "FAIL: expected package=$EXPECTED_PACKAGE"
printf '%s\n' "$OUTPUT"
exit 1
fi
echo "TOTAL=2 PASS=2 FAIL=0"
echo "=== All APK Decode Manifest Tests Passed ==="
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |