|
| 1 | +#!/bin/bash |
| 2 | +# setup.sh -- One-command Android hardening and tweaking |
| 3 | +# Sets up the toolkit, configures ADB, and applies baseline privacy settings |
| 4 | +set -e |
| 5 | + |
| 6 | +echo "π§ Android Tweaks Toolkit Setup" |
| 7 | +echo "================================" |
| 8 | + |
| 9 | +# Check ADB |
| 10 | +if ! command -v adb &> /dev/null; then |
| 11 | + echo "β ADB not found. Install Android SDK Platform Tools first." |
| 12 | + echo " macOS: brew install android-platform-tools" |
| 13 | + echo " Linux: sudo apt install adb" |
| 14 | + exit 1 |
| 15 | +fi |
| 16 | + |
| 17 | +# Check device |
| 18 | +if ! adb devices | grep -q "device$"; then |
| 19 | + echo "β No Android device connected. Enable USB Debugging and try again." |
| 20 | + exit 1 |
| 21 | +fi |
| 22 | + |
| 23 | +DEVICE=$(adb get-serialno) |
| 24 | +MODEL=$(adb shell getprop ro.product.model) |
| 25 | +echo "β Connected: $MODEL ($DEVICE)" |
| 26 | + |
| 27 | +# Install Python dependencies |
| 28 | +echo "β Installing Python dependencies..." |
| 29 | +pip install rich -q || pip3 install rich -q |
| 30 | + |
| 31 | +# Make scripts executable |
| 32 | +chmod +x scripts/*.py scripts/*.sh *.py *.sh 2>/dev/null || true |
| 33 | + |
| 34 | +# Run baseline privacy check |
| 35 | +echo "" |
| 36 | +echo "π Checking current privacy status..." |
| 37 | +python3 android-privacy-hardener/check.py 2>/dev/null || echo " (Privacy checker unavailable)" |
| 38 | + |
| 39 | +echo "" |
| 40 | +read -rp "Apply Level 2 privacy hardening? (y/N): " APPLY |
| 41 | +if [[ "$APPLY" == "y" ]]; then |
| 42 | + python3 android-privacy-hardener/harden.py --level 2 |
| 43 | +fi |
| 44 | + |
| 45 | +echo "" |
| 46 | +echo "β
Setup complete!" |
| 47 | +echo "" |
| 48 | +echo "Available tools:" |
| 49 | +ls -1 scripts/*.py 2>/dev/null | xargs -I {} basename {} | sed 's/^/ - /' |
| 50 | +echo "" |
| 51 | +echo "Get started:" |
| 52 | +echo " python3 android-toolkit-scripts/device_info.py" |
| 53 | +echo " python3 android-toolkit-scripts/permission_audit.py" |
| 54 | +echo " python3 android-toolkit-scripts/network_monitor.py" |
0 commit comments