Update standalone key downloader to include UUID in filename

This commit is contained in:
Florian Bach 2021-11-13 17:27:27 +01:00
parent 51a61114d8
commit c8f1081e44
1 changed files with 14 additions and 1 deletions

View File

@ -21,7 +21,7 @@ if sys.version_info[0] < 3:
exit(1)
from libadobe import VAR_HOBBES_VERSION, createDeviceKeyFile, update_account_path
from libadobeAccount import createDeviceFile, createUser, signIn, exportAccountEncryptionKeyDER
from libadobeAccount import createDeviceFile, createUser, signIn, exportAccountEncryptionKeyDER, getAccountUUID
# These are the only two variables you'll need to change
# The mail address and password of your Adobe account
@ -50,6 +50,8 @@ def main():
with tempfile.TemporaryDirectory() as temp_dir:
update_account_path(temp_dir)
print ("Preparing keys ...")
createDeviceKeyFile()
createDeviceFile(VAR_HOBBES_VERSION, True)
success, resp = createUser()
@ -57,11 +59,22 @@ def main():
print("Error, couldn't create user: %s" % resp)
exit(1)
print("Logging in ...")
success, resp = signIn(VAR_MAIL, VAR_PASS)
if (success is False):
print("Login unsuccessful: " + resp)
exit(1)
print("Exporting keys ...")
try:
account_uuid = getAccountUUID()
if (account_uuid is not None):
filename = "adobekey_" + VAR_MAIL + "_uuid_" + account_uuid + ".der"
except:
pass
success = exportAccountEncryptionKeyDER(filename)
if (success is False):
print("Couldn't export key.")