You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
REPORT_FILE="${CWD}/NanoDroid_Report_${VERSION}"
|
|
|
|
|
|
|
|
create_report () {
|
|
|
|
|
|
|
|
CURDATE=$(date +%Y%m%d-%H.%M.%S)
|
|
|
|
|
|
|
|
echo "NanoDroid ${VERSION} package report [${CURDATE}]
|
|
|
|
==========================================================
|
|
|
|
" > ${REPORT_FILE}
|
|
|
|
|
|
|
|
for apk in ${apk_database[@]}; do
|
|
|
|
get_apk_info ${apk}
|
|
|
|
done
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
get_apk_info () {
|
|
|
|
|
|
|
|
IN=${CWD}/${1}
|
|
|
|
APK=${CWD}/_report.apk
|
|
|
|
|
|
|
|
gzip -dc ${IN} > ${CWD}/_report.apk
|
|
|
|
|
|
|
|
APK_FILE="$(basename ${IN}) [$(dirname ${1})]"
|
|
|
|
APK_NAME=$(aapt dump badging ${APK} 2>/dev/null | gawk -F \' '/^package: name/{print $2}')
|
|
|
|
APK_VERSION=$(aapt dump badging ${APK} 2>/dev/null | gawk -F \' '/^package: name/{print $6}')
|
|
|
|
APK_CODE=$(aapt dump badging ${APK} 2>/dev/null | gawk -F \' '/^package: name/{print $4}')
|
|
|
|
APK_PERM=$(aapt dump badging ${APK} 2>/dev/null | gawk -F \' '/^uses-permission:/{print $2}' | sort)
|
|
|
|
APK_SHA=($(sha256sum ${APK} | gawk '{print $1}'))
|
|
|
|
[[ ${APK} == *priv-app* ]] && APK_PRIV=Yes || APK_PRIV=No
|
|
|
|
|
|
|
|
echo "Android Package: ${APK_NAME}
|
|
|
|
| Filename: ${APK_FILE}
|
|
|
|
| Version: ${APK_VERSION}
|
|
|
|
| VersionCode: ${APK_CODE}
|
|
|
|
| SHA256: ${APK_SHA}
|
|
|
|
| Priviledged: ${APK_PRIV}
|
|
|
|
| Permissions:
|
|
|
|
$(printf "\t|- %s\n" ${APK_PERM})
|
|
|
|
" >> ${REPORT_FILE}
|
|
|
|
|
|
|
|
rm -f ${APK}
|
|
|
|
|
|
|
|
}
|