port to androguard >= 4 and drop support for older than 3.3.3

This also makes androguard a hard requirement, which has been true for a
while anyway.  So the code that handles androguard as an optional
requirement is removed.  androguard from Debian/buster is new enough, so
this does not seem like it will cause any problems.
This commit is contained in:
Hans-Christoph Steiner 2024-04-01 11:42:23 +02:00
parent cdc7c98707
commit 7a144a4762
5 changed files with 30 additions and 35 deletions

View file

@ -8,7 +8,9 @@ echo_header() {
get_fdroid_apk_filename() {
if [ -z $aapt ]; then
python3 -c "from androguard.core.bytecodes.apk import APK; a=APK('$1'); print(a.package+'_'+a.get_androidversion_code()+'.apk')"
appid=$(androguard apkid "$1" | sed -En 's/ +"([a-z][^"]+)",$/\1/ip')
versionCode=$(androguard apkid "$1" | sed -En 's/ +"([0-9]+)",$/\1/p')
echo "${appid}_${versionCode}.apk"
else
$aapt dump badging "$1" | sed -n "s,^package: name='\(.*\)' versionCode='\([0-9][0-9]*\)' .*,\1_\2.apk,p"
fi