from pprint import pprint from google.protobuf import text_format from googleplayapi.config import * from googleplayapi.googleplay import GooglePlayAPI if (len(sys.argv) < 2): print "Usage: %s packagename1 [packagename2 [...]]" % sys.argv[0] print "Display permissions required to install the specified app(s)." sys.exit(0) packagenames = sys.argv[1:] api = GooglePlayAPI(ANDROID_ID) api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN) # Only one app if (len(packagenames) == 1): response = api.details(packagenames[0]) print "\n".join(i.encode('utf8') for i in response.docV2.details.appDetails.permission) else: # More than one app response = api.bulkDetails(packagenames) for entry in response.entry: if (not not entry.ListFields()): # if the entry is not empty print entry.doc.docid + ":" print "\n".join(" "+i.encode('utf8') for i in entry.doc.details.appDetails.permission) print
print "If filename is not present, will write to packagename.apk." sys.exit(0) packagename = sys.argv[1] if (len(sys.argv) == 3): filename = sys.argv[2] else: filename = packagename + ".apk" # Connect api = GooglePlayAPI(androidId=ANDROID_ID, email=GOOGLE_LOGIN, password=GOOGLE_PASSWORD, authSubToken=AUTH_TOKEN) # login if necessary if not AUTH_TOKEN: # api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN) api.login() # Get the version code and the offer type from the app details m = api.details(packagename) doc = m.docV2 vc = doc.details.appDetails.versionCode ot = doc.offer[0].offerType # Download print "Downloading %s..." % sizeof_fmt(doc.details.appDetails.installationSize), data = api.download(packagename, vc, ot) open(filename, "wb").write(data) print "Done"
from google.protobuf import text_format from googleplayapi.config import * from googleplayapi.googleplay import GooglePlayAPI if (len(sys.argv) < 2): print "Usage: %s packagename1 [packagename2 [...]]" % sys.argv[0] print "Display permissions required to install the specified app(s)." sys.exit(0) packagenames = sys.argv[1:] api = GooglePlayAPI(ANDROID_ID) api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN) # Only one app if (len(packagenames) == 1): response = api.details(packagenames[0]) print "\n".join( i.encode('utf8') for i in response.docV2.details.appDetails.permission) else: # More than one app response = api.bulkDetails(packagenames) for entry in response.entry: if (not not entry.ListFields()): # if the entry is not empty print entry.doc.docid + ":" print "\n".join(" " + i.encode('utf8') for i in entry.doc.details.appDetails.permission) print