Created
August 6, 2025 09:57
-
-
Save JBlond/4f053246419d48d1f32665a6ca78e4f7 to your computer and use it in GitHub Desktop.
Check Android security
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "📱 Android Security Check startet..." | |
# Prüfen, ob Gerät verbunden ist | |
if ! adb devices | grep -w "device" > /dev/null; then | |
echo "❌ Kein Gerät verbunden. Bitte USB-Debugging aktivieren und Gerät anschließen." | |
exit 1 | |
fi | |
# USB-Debugging deaktivieren | |
echo "🔒 USB-Debugging wird deaktiviert..." | |
adb shell settings put global adb_enabled 0 | |
# Liste installierter Apps | |
echo "📦 Installierte Apps werden exportiert..." | |
adb shell pm list packages > _installed_apps.txt | |
echo "📱 Android Permission Audit startet..." | |
# Zielberechtigungen definieren | |
PERMISSIONS=("CAMERA" "RECORD_AUDIO" "ACCESS_FINE_LOCATION" "ACCESS_COARSE_LOCATION" "READ_CONTACTS" "WRITE_CONTACTS" "READ_EXTERNAL_STORAGE" "WRITE_EXTERNAL_STORAGE" "INTERNET" "READ_SMS" "SEND_SMS" "RECEIVE_SMS") | |
# Ergebnisdatei vorbereiten | |
REPORT_FILE="_sensitive_permissions_report.txt" | |
echo "📄 Sensible Berechtigungen (tatsächlich erteilt):" > "$REPORT_FILE" | |
# Nur User-Apps prüfen | |
for pkg in $(adb shell pm list packages -3 | sed 's/package://'); do | |
output=$(adb shell dumpsys package "$pkg" | grep "granted=true") | |
for perm in "${PERMISSIONS[@]}"; do | |
if echo "$output" | grep "$perm" > /dev/null; then | |
echo "$pkg: $perm" >> "$REPORT_FILE" | |
fi | |
done | |
done | |
echo "✅ Prüfung abgeschlossen. Ergebnisse in $REPORT_FILE gespeichert." | |
echo "✅ Sicherheitsprüfung abgeschlossen. Dateien erstellt:" | |
echo " - _installed_apps.txt" | |
echo " - _sensitive_permissions_report.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment