Skip to content

Commit

Permalink
tools v6.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
apprenticealf committed Mar 7, 2015
1 parent cd2d746 commit a399d3b
Show file tree
Hide file tree
Showing 13 changed files with 305 additions and 26 deletions.
4 changes: 2 additions & 2 deletions DeDRM_Macintosh_Application/DeDRM.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<key>CFBundleExecutable</key>
<string>droplet</string>
<key>CFBundleGetInfoString</key>
<string>DeDRM AppleScript 6.0.4. Written 2010–2013 by Apprentice Alf and others.</string>
<string>DeDRM AppleScript 6.0.5. Written 2010–2013 by Apprentice Alf and others.</string>
<key>CFBundleIconFile</key>
<string>DeDRM</string>
<key>CFBundleIdentifier</key>
Expand All @@ -36,7 +36,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.0.4</string>
<string>6.0.5</string>
<key>CFBundleSignature</key>
<string>dplt</string>
<key>LSRequiresCarbon</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"""

PLUGIN_NAME = u"DeDRM"
PLUGIN_VERSION_TUPLE = (6, 0, 2)
PLUGIN_VERSION_TUPLE = (6, 0, 5)
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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__license__ = 'GPL v3'

# Standard Python modules.
import os, traceback
import os, traceback, json

# PyQT4 modules (part of calibre).
from PyQt4.Qt import (Qt, QWidget, QHBoxLayout, QVBoxLayout, QLabel, QLineEdit,
Expand Down Expand Up @@ -178,8 +178,8 @@ def __init__(self, parent, key_type_name, plugin_keys, create_key, keyfile_ext =
self.create_key = create_key
self.keyfile_ext = keyfile_ext
self.import_key = (keyfile_ext != u"")
self.binary_file = (keyfile_ext == u".der")
self.json_file = (keyfile_ext == u".k4i")
self.binary_file = (keyfile_ext == u"der")
self.json_file = (keyfile_ext == u"k4i")
self.wineprefix = wineprefix

self.setWindowTitle("{0} {1}: Manage {2}s".format(PLUGIN_NAME, PLUGIN_VERSION, self.key_type_name))
Expand Down Expand Up @@ -676,7 +676,7 @@ def __init__(self, parent=None,):
from calibre_plugins.dedrm.adobekey import adeptkeys

defaultkeys = adeptkeys()
else: # linux
else: # linux
from wineutils import WineGetKeys

scriptpath = os.path.join(parent.parent.alfdir,u"adobekey.py")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def unicode_argv():
argvencoding = sys.stdin.encoding
if argvencoding == None:
argvencoding = 'utf-8'
return [arg if (type(arg) == unicode) else unicode(arg,argvencoding) for arg in sys.argv]
return [arg if (type(arg) == unicode) else unicode(arg, argvencoding) for arg in sys.argv]

#global switch
debug = False
Expand All @@ -92,12 +92,12 @@ class DrmException(Exception):
def zipUpDir(myzip, tdir, localname):
currentdir = tdir
if localname != u"":
currentdir = os.path.join(currentdir,localname)
currentdir = os.path.join(currentdir, localname)
list = os.listdir(currentdir)
for file in list:
afilename = file
localfilePath = os.path.join(localname, afilename)
realfilePath = os.path.join(currentdir,file)
realfilePath = os.path.join(currentdir, file)
if os.path.isfile(realfilePath):
myzip.write(realfilePath, localfilePath)
elif os.path.isdir(realfilePath):
Expand All @@ -116,7 +116,7 @@ def bookReadEncodedNumber(fo):
data = ord(fo.read(1))
if data >= 0x80:
datax = (data & 0x7F)
while data >= 0x80 :
while data >= 0x80:
data = ord(fo.read(1))
datax = (datax <<7) + (data & 0x7F)
data = datax
Expand Down
3 changes: 2 additions & 1 deletion DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_app.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
# 6.0.2 - Fixed problem with spaces in paths and the bat file
# 6.0.3 - Fix for Windows non-ascii user names
# 6.0.4 - Fix for other potential unicode problems
# 6.0.5 - Fix typo

__version__ = '6.0.4'
__version__ = '6.0.5'

import sys
import os, os.path
Expand Down
9 changes: 6 additions & 3 deletions DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@
# Revision history:
# 6.0.0 - Initial release
# 6.0.1 - Bug Fixes for Windows App, Kindle for Mac and Windows Adobe Digital Editions
# 6.0.2 - Restored call to Wine to get Kindle for PC keys
# 6.0.2 - Restored call to Wine to get Kindle for PC keys, added for ADE
# 6.0.3 - Fixes for Kindle for Mac and Windows non-ascii user names
# 6.0.4 - Fixes for stand-alone scripts and applications
# and pdb files in plugin and initial conversion of prefs.

"""
Decrypt DRMed ebooks.
"""

PLUGIN_NAME = u"DeDRM"
PLUGIN_VERSION_TUPLE = (6, 0, 2)
PLUGIN_VERSION_TUPLE = (6, 0, 5)
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'
Expand Down Expand Up @@ -426,7 +429,7 @@ def eReaderDecrypt(self,path_to_ebook):
import calibre_plugins.dedrm.prefs as prefs
import calibre_plugins.dedrm.erdr2pml

dedrmrefs = prefs.DeDRM_Prefs()
dedrmprefs = prefs.DeDRM_Prefs()
# Attempt to decrypt epub with each encryption key (generated or provided).
for keyname, userkey in dedrmprefs['ereaderkeys'].items():
keyname_masked = u"".join((u'X' if (x.isdigit()) else x) for x in keyname)
Expand Down
8 changes: 4 additions & 4 deletions DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__license__ = 'GPL v3'

# Standard Python modules.
import os, traceback
import os, traceback, json

# PyQT4 modules (part of calibre).
from PyQt4.Qt import (Qt, QWidget, QHBoxLayout, QVBoxLayout, QLabel, QLineEdit,
Expand Down Expand Up @@ -178,8 +178,8 @@ def __init__(self, parent, key_type_name, plugin_keys, create_key, keyfile_ext =
self.create_key = create_key
self.keyfile_ext = keyfile_ext
self.import_key = (keyfile_ext != u"")
self.binary_file = (keyfile_ext == u".der")
self.json_file = (keyfile_ext == u".k4i")
self.binary_file = (keyfile_ext == u"der")
self.json_file = (keyfile_ext == u"k4i")
self.wineprefix = wineprefix

self.setWindowTitle("{0} {1}: Manage {2}s".format(PLUGIN_NAME, PLUGIN_VERSION, self.key_type_name))
Expand Down Expand Up @@ -676,7 +676,7 @@ def __init__(self, parent=None,):
from calibre_plugins.dedrm.adobekey import adeptkeys

defaultkeys = adeptkeys()
else: # linux
else: # linux
from wineutils import WineGetKeys

scriptpath = os.path.join(parent.parent.alfdir,u"adobekey.py")
Expand Down
Binary file modified DeDRM_calibre_plugin/DeDRM_plugin.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion DeDRM_calibre_plugin/DeDRM_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"""

PLUGIN_NAME = u"DeDRM"
PLUGIN_VERSION_TUPLE = (6, 0, 4)
PLUGIN_VERSION_TUPLE = (6, 0, 5)
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'
Expand Down
8 changes: 4 additions & 4 deletions DeDRM_calibre_plugin/DeDRM_plugin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__license__ = 'GPL v3'

# Standard Python modules.
import os, traceback
import os, traceback, json

# PyQT4 modules (part of calibre).
from PyQt4.Qt import (Qt, QWidget, QHBoxLayout, QVBoxLayout, QLabel, QLineEdit,
Expand Down Expand Up @@ -178,8 +178,8 @@ def __init__(self, parent, key_type_name, plugin_keys, create_key, keyfile_ext =
self.create_key = create_key
self.keyfile_ext = keyfile_ext
self.import_key = (keyfile_ext != u"")
self.binary_file = (keyfile_ext == u".der")
self.json_file = (keyfile_ext == u".k4i")
self.binary_file = (keyfile_ext == u"der")
self.json_file = (keyfile_ext == u"k4i")
self.wineprefix = wineprefix

self.setWindowTitle("{0} {1}: Manage {2}s".format(PLUGIN_NAME, PLUGIN_VERSION, self.key_type_name))
Expand Down Expand Up @@ -676,7 +676,7 @@ def __init__(self, parent=None,):
from calibre_plugins.dedrm.adobekey import adeptkeys

defaultkeys = adeptkeys()
else: # linux
else: # linux
from wineutils import WineGetKeys

scriptpath = os.path.join(parent.parent.alfdir,u"adobekey.py")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def convertprefs(always = False):
# Generate eReader user key from name and credit card number.
keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:])
keyvalue = getuser_key(name,cc).encode('hex')
userkeysappend([keyname,keyvalue])
userkeys.append([keyname,keyvalue])
except Exception, e:
traceback.print_exc()
print e.args[0]
Expand Down
Loading

0 comments on commit a399d3b

Please sign in to comment.