summaryrefslogtreecommitdiffstats
path: root/DeDRM_calibre_plugin
diff options
context:
space:
mode:
authorapprenticeharper <[email protected]>2015-09-03 07:51:10 +0100
committerapprenticeharper <[email protected]>2015-09-03 07:51:10 +0100
commite5e269fbae85c59c7faf61fbbf05b610a35aaf67 (patch)
treec238d56b8e8aac8bf1cb7f9ff4490819c0600b8a /DeDRM_calibre_plugin
parentd54dc38c2d3083eb802557aa363498cf27f25f39 (diff)
Fixes for android key extraction
Diffstat (limited to 'DeDRM_calibre_plugin')
-rw-r--r--DeDRM_calibre_plugin/DeDRM_plugin.zipbin353297 -> 353415 bytes
-rw-r--r--DeDRM_calibre_plugin/DeDRM_plugin/__init__.py5
-rw-r--r--DeDRM_calibre_plugin/DeDRM_plugin/androidkindlekey.py31
3 files changed, 24 insertions, 12 deletions
diff --git a/DeDRM_calibre_plugin/DeDRM_plugin.zip b/DeDRM_calibre_plugin/DeDRM_plugin.zip
index 082e508..a64da23 100644
--- a/DeDRM_calibre_plugin/DeDRM_plugin.zip
+++ b/DeDRM_calibre_plugin/DeDRM_plugin.zip
Binary files differ
diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py b/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py
index 1f34cfe..53b1200 100644
--- a/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py
+++ b/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py
@@ -45,6 +45,7 @@ __docformat__ = 'restructuredtext en'
# 6.3.1 - Version number bump for clarity
# 6.3.2 - Fixed Kindle for Android help file
# 6.3.3 - Bug fix for Kindle for PC support
+# 6.3.4 - Fixes for Kindle for Android, Linux, and Kobo 3.17
"""
@@ -52,7 +53,7 @@ Decrypt DRMed ebooks.
"""
PLUGIN_NAME = u"DeDRM"
-PLUGIN_VERSION_TUPLE = (6, 3, 3)
+PLUGIN_VERSION_TUPLE = (6, 3, 4)
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
# Include an html helpfile in the plugin's zipfile with the following name.
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
@@ -148,7 +149,7 @@ class DeDRM(FileTypePlugin):
try:
open(file_path,'wb').write(data)
except:
- print u"{0} v{1}: Exception when copying needed library files after {2:.1f} seconds".format(PLUGIN_NAME, PLUGIN_VERSION, time.time()-self.starttime)
+ print u"{0} v{1}: Exception when copying needed library files".format(PLUGIN_NAME, PLUGIN_VERSION)
traceback.print_exc()
pass
diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/androidkindlekey.py b/DeDRM_calibre_plugin/DeDRM_plugin/androidkindlekey.py
index 2c539ee..ff8d1ee 100644
--- a/DeDRM_calibre_plugin/DeDRM_plugin/androidkindlekey.py
+++ b/DeDRM_calibre_plugin/DeDRM_plugin/androidkindlekey.py
@@ -16,16 +16,18 @@ from __future__ import with_statement
# - and added in unicode command line support
# 1.3 - added in TkInter interface, output to a file
# 1.4 - Fix some problems identified by Aldo Bleeker
+# 1.5 - Fix another problem identified by Aldo Bleeker
"""
Retrieve Kindle for Android Serial Number.
"""
__license__ = 'GPL v3'
-__version__ = '1.4'
+__version__ = '1.5'
import os
import sys
+import traceback
import getopt
import tempfile
import zlib
@@ -220,20 +222,30 @@ def get_serials2(path=STORAGE2):
userdata_keys = cursor.fetchall()
dsns = []
for userdata_row in userdata_keys:
- if userdata_row:
- userdata_utf8 = userdata_row[0].encode('utf8')
- if len(userdata_utf8) > 0:
- dsns.append(userdata_utf8)
+ try:
+ if userdata_row and userdata_row[0]:
+ userdata_utf8 = userdata_row[0].encode('utf8')
+ if len(userdata_utf8) > 0:
+ dsns.append(userdata_utf8)
+ except:
+ print "Error getting one of the device serial name keys"
+ traceback.print_exc()
+ pass
dsns = list(set(dsns))
cursor.execute('''select userdata_value from userdata where userdata_key like '%/%kindle.account.tokens%' ''')
userdata_keys = cursor.fetchall()
tokens = []
for userdata_row in userdata_keys:
- if userdata_row:
- userdata_utf8 = userdata_row[0].encode('utf8')
- if len(userdata_utf8) > 0:
- tokens.append(userdata_utf8)
+ try:
+ if userdata_row and userdata_row[0]:
+ userdata_utf8 = userdata_row[0].encode('utf8')
+ if len(userdata_utf8) > 0:
+ tokens.append(userdata_utf8)
+ except:
+ print "Error getting one of the account token keys"
+ traceback.print_exc()
+ pass
tokens = list(set(tokens))
serials = []
@@ -377,7 +389,6 @@ def gui_main():
import Tkconstants
import tkMessageBox
import tkFileDialog
- import traceback
except:
print "Tkinter not installed"
return cli_main()