gplaycli: add pyaxmlparser optional flag

This commit is contained in:
blshkv 2018-05-11 10:51:47 +08:00
parent bc1fe61589
commit a6ec59c401
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,42 @@
reverted:
--- b/gplaycli/gplaycli.py
+++ a/gplaycli/gplaycli.py
@@ -32,7 +32,7 @@
from gpapi.googleplay import RequestError
from google.protobuf.message import DecodeError
from pkg_resources import get_distribution, DistributionNotFound
+from pyaxmlparser import APK
-from androguard.core.bytecodes.apk import APK
from clint.textui import progress
@@ -494,7 +494,7 @@
apk = APK(filepath)
packagename = apk.package
package_bunch.append(packagename)
+ version_codes.append(util.vcode(apk.version_code))
- version_codes.append(util.vcode(apk.get_androidversion_code()))
# BulkDetails requires only one HTTP request
# Get APK info from store
reverted:
--- b/requirements.txt
+++ a/requirements.txt
@@ -1,4 +1,4 @@
protobuf
gpapi
+pyaxmlparser
-androguard
clint
reverted:
--- b/setup.py
+++ a/setup.py
@@ -33,7 +33,7 @@
install_requires=[
'protobuf',
'gpapi == 0.4.2',
+ 'pyaxmlparser',
- 'androguard',
'clint',
],
)

View file

@ -0,0 +1,37 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_{5,6} )
inherit distutils-r1
DESCRIPTION="Google Play Downloader via Command line"
HOMEPAGE="https://github.com/matlink/gplaycli"
SRC_URI="https://github.com/matlink/gplaycli/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="pyaxmlparser"
#https://github.com/matlink/gplaycli/issues/182
change_deps() {
PATCHES=( "${FILESDIR}/pyaxmlparser.patch" )
}
RDEPEND="dev-python/protobuf-python[${PYTHON_USEDEP}]
>=dev-python/gpapi-0.4.2[${PYTHON_USEDEP}]
pyaxmlparser? ( dev-python/pyaxmlparser[${PYTHON_USEDEP}] )
!pyaxmlparser? ( dev-python/androguard[${PYTHON_USEDEP}] )
dev-python/clint[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]"
python_prepare_all() {
use pyaxmlparser && change_deps
# disarm pycrypto dep to allow || ( pycryptodome pycrypto )
sed -i -e "s|os.path.expanduser('~')+'/.config/|'/etc/|" setup.py || die
distutils-r1_python_prepare_all
}