diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py index bff7a1a..9744bce 100644 --- a/calibre-plugin/config.py +++ b/calibre-plugin/config.py @@ -215,6 +215,8 @@ class ConfigWidget(QWidget): self.button_export_key.setEnabled(activated) self.button_export_activation.setEnabled(activated) + self.resize(self.sizeHint()) + info_dialog(None, "Done", "Successfully imported authorization for " + ade_mail, show=True, show_copy_button=False) @@ -270,6 +272,8 @@ class ConfigWidget(QWidget): self.button_export_key.setEnabled(True) self.button_export_activation.setEnabled(True) + self.resize(self.sizeHint()) + info_dialog(None, "Done", "Authorized to account " + mail, show=True, show_copy_button=False) @@ -293,7 +297,8 @@ class ConfigWidget(QWidget): filters = [("DER Files", ["der"])] - filename = choose_save_file(self, "Export ADE keys", _("Export ADE keys"), filters, all_files=False) + filename = choose_save_file(self, "Export ADE keys", _("Export ADE keys"), filters, + all_files=False, initial_filename="adobe_encryption_key.der") if (filename is None): return diff --git a/calibre-plugin/libadobe.py b/calibre-plugin/libadobe.py index f0a2eeb..2caaf84 100644 --- a/calibre-plugin/libadobe.py +++ b/calibre-plugin/libadobe.py @@ -212,7 +212,7 @@ def sendPOSTHTTPRequest(URL: str, document: bytes, type: str, returnRC = False): if returnRC: return ret_code, content - + return content @@ -274,15 +274,13 @@ def addNonce(): usec = dt.microsecond sec = (dt - datetime(1970,1,1)).total_seconds() - nonce320 = int(0x6f046000) - nonce321 = int(0x388a) - bigtime = int(sec * 1000) - nonce320 += int((bigtime & 0xFFFFFFFF) + usec/1000) - nonce321 += int(((bigtime >> 32) & 0xFFFFFFFF)) + Ntime = int(int(sec * 1000) + usec/1000) - final = bytearray(nonce320.to_bytes(4, 'little')) - final.extend(nonce321.to_bytes(4, 'little')) + # Unixtime to gregorian timestamp + Ntime += 62167219200000 + + final = bytearray(Ntime.to_bytes(8, 'little')) tmp = 0 final.extend(tmp.to_bytes(4, 'little')) diff --git a/calibre-plugin/libadobeFulfill.py b/calibre-plugin/libadobeFulfill.py index f2e4676..4b5d9b7 100644 --- a/calibre-plugin/libadobeFulfill.py +++ b/calibre-plugin/libadobeFulfill.py @@ -547,7 +547,7 @@ def performFulfillmentNotification(fulfillmentResultToken, forceOptional = False critical = True if element.get("critical", "yes") == "no": - critial = False + critical = False print("Notifying optional server %s" % (url)) else: print("Notifying server %s" % (url))