Added python project; fixed spelling of folder

This commit is contained in:
2023-09-30 16:09:14 -05:00
parent 1f23cb73d1
commit 6bf66c5916
1075 changed files with 2165 additions and 0 deletions

View File

@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -0,0 +1,14 @@
### Description
<hr/>
This is a script that will take a bookmarks.html file from Firefox and output it to a better looking format complete with site snapshot images..
### Preparation
<hr/>
You will need to install lynx to be able to pull the links from the bookmarks file.
<br/>
<code> sudo apt-get install lynx </code>
### Setup/Usage
<hr/>
From firefox go to the bookmarks manager and select "Import and Backup".
Select "Export bookmars to html..." and save the file in the root of this program dir. Last, run the bookishScan.sh and wait for the scan to complete.
Keep the directory structure somewhere you wont delete it and then setup your browser to use the bookMarksHomePg.html as your home page.
Enjoy!

View File

@@ -0,0 +1,70 @@
#!/bin/bash
#
# By Maxim F. Stewart
# Contact: [maxim2131@gmail.com] OR [gamer1119@gmail.com]
#
# Copyright 2013 Maxim F. Stewart
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------------------------------#
# Possibly use in future releases
# wget http://www.google.com/s2/favicons?domain_url=${link} -O ./faveIcons/$i.png
main()
{
lynx -force_html -dump --listonly ./bookmarks.html | awk '/^ *[0-9]+\. / { print $2}' > ./links.txt
echo '<!doctype html>
<html lang="en">
<head>
<title>Bookish Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="./resources/css.css" type="text/css">
</head>
<body>
<div id="bg"><img src="./resources/imgs/matrix.gif"/></div>"
' > ./bookMarksHomePg.html
body;
}
body()
{
x=$(cat ./links.txt | wc -l) >> /dev/null ;
i="1"
while [ $i -le $x ]; do
line=$(sed -n "${i}p" ./links.txt);
link=$(echo "$line" | sed 's/*\///');
./resources/bin/wkhtmltoimage --crop-w 1280 \
--crop-h 900 \
--width 1920 \
--height 1080 \
--quality 75 \
--quiet ${link} \
./snapShots/$i.png
echo "<div class="\"section"\">
<a href="\"${link}"\">
<img src="\"./snapShots/$i.png"\">
<br>
"${link}"
</a>
</div>" >> bookMarksHomePg.html
i=$[$i++1] ;
done
echo '</body>
</html>' >> ./bookMarksHomePg.html
rm links.txt
}
main

Binary file not shown.

View File

@@ -0,0 +1,39 @@
#bg {
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
z-index: -1;
}
#bg img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.section {
overflow:auto;
display: block;
float: left;
width: 350;
height: 500;
text-align: center;
font-size: 100%;
padding-top: 1em;
margin: 1em;
background: rgba(19, 21, 21, .7);
color: rgba(0, 232, 255, .69); /*#00E8FF*/
border-style: solid;
border-width: .2em;
}
a {
color: yellow;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@@ -0,0 +1,3 @@
openfx
imagemagic
python

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,41 @@
This is the source code package of ConvertLIT 1.8
In this version, most of the outstanding bug reports should be resolved:
- Cope with buggy generators which write out truncated files
- Added dictionary support (disable with -d flag)
- Handle duplicated filenames
- Completely changed whitespace expansion
(Thanks to all the help from people who reported this problem)
- Fixed very rare LZX Decompression buffer overruns
- Should work on MAC OS/X and other big endian hardware
(If not, send a bug report)
- Better non-english filename support
DRM5 support is enhanced in this version
DRM5 support is now implemented through a "keys.txt" file which should
contain the private keys from your activation components. You create this
file once with "ReaderKeyRecoveryTool.exe" from the Windows binary package
and from then on you can use those keys under any environment.
Build changes:
This package now requires "LIBTOMMATH" from math.libtomcrypt.org
To build under Linux:
cd lib
make
cd ../clit16
make
To build under Windows, Visual C*.
cd lib
nmake -f win32.mak
cd ..\clit16
nmake -f win32.mak
Now that VC++ 7 is available for "free", supporting MINGW is left as an
exercise for the interested reader. Note that getting the free VC++ to the
point where it can compile ConvertLIT isn't trivial and no support
will be provided.

View File

@@ -0,0 +1,6 @@
convlit (1.8-1) unstable; urgency=low
* Initial release, closes: #472586.
* Added manpage clit(1).
-- Joe Nahmias <jello@debian.org> Thu, 29 May 2008 00:59:04 -0400

View File

@@ -0,0 +1,87 @@
This package was debianized by Joe Nahmias <jello@debian.org> on
Sun, 23 Mar 2008 23:55:42 -0400.
It was downloaded from <http://www.kyzer.me.uk/pack/convlit/>
Upstream Authors:
lib/des/*:
Richard Outerbridge
lib/newlzx/lzx.h, lib/newlzx/lxzd.c, lib/newlzx/mspack.h, lib/newlzx/system.h:
Stuart Caie <kyzer@4u.net>
lib/sha/*:
Steve Reid <steve@edmweb.com>
Aaron D. Gifford <agifford@infowest.com>
All others:
Dan A. Jackson <drs@convertlit.com>, <djs@jacko.demon.co.uk>
Copyright:
lib/des/*:
Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
lib/newlzx/lzx.h, lib/newlzx/lxzd.c, lib/newlzx/mspack.h, lib/newlzx/system.h:
Copyright (C) 2003-2004 Stuart Caie
lib/sha/*:
NO COPYRIGHT - THIS IS 100% IN THE PUBLIC DOMAIN
All others:
Copyright (C) 2004 Digital Rights Software
Copyright (C) 2002 - 2004 Dan A. Jackson
License:
clit18/hexdump.c:
Public Domain
lib/des/*:
THIS SOFTWARE PLACED IN THE PUBLIC DOMAIN BY THE AUTHOUR
920825 19:42 EDST
lib/newlzx/lzx.h, lib/newlzx/lxzd.c, lib/newlzx/mspack.h, lib/newlzx/system.h:
libmspack is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) version 2.1
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
lib/sha/*:
NO COPYRIGHT - THIS IS 100% IN THE PUBLIC DOMAIN
All others:
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
The Debian packaging is (C) 2008, Joe Nahmias <jello@debian.org> and
is licensed under the GPL, see above.

View File

@@ -0,0 +1,52 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH CLIT 1 "March 23, 2008"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
clit \- program to manipulate Microsoft Reader .LIT files
.SH SYNOPSIS
.RB "1. " clit
.RI [ options ] " litfile.lit" " " subdir/
.br
.RB "2. " clit
.RI [ options ] " oldfile.lit" " " newfile.lit
.br
.RB "3. " clit
.RI [ options ] " oldfile.lit" " " newfile.lit " " inscription
.SH DESCRIPTION
This manual page documents briefly the \fBclit\fP command.
.PP
\fBConvLIT\fP is a program to convert Microsoft Reader format eBooks
[\fILIT\fP] into an open format. \fBclit\fP supports three modes
of operation:
.IP 1.
\fBExplosion\fP: expanding a \fILIT\fP file into an OEBPS compliant package,
that is the original \fIXML\fP / \fIHTML\fP source.
.IP 2.
\fBDownconverting\fP: converts to \fIDRM1\fP format, also known as
\fBsealing\fP the \fILIT\fP file.
.IP 3.
\fBInscribing\fP: similar to #2, this adds a label, or \fIinscription\fP,
to the ebook to mark that it belongs to you.
.SH OPTIONS
A summary of options is included below.
For a complete description, run the program without any arguments.
.TP
.B \-d
Disable creating multiple subdirectories.
.TP
.B \-h
Show summary of options.
.TP
.B \-k " " \fI/path/to/keys.txt\fP
The \fIDRM5\fP key file is assumed to be called \fIkeys.txt\fP and located in
the current directory. If not, use this option to instruct \fBConvLIT\fP
where to find the key file.
.SH AUTHOR
\fBConvLIT\fP was written by Dan A. Jackson <drs@convertlit.com>.
.PP
This manual page was written by Joe Nahmias <jello@debian.org>,
for the Debian project (but may be used by others).

Binary file not shown.

View File

@@ -0,0 +1,41 @@
This is the source code package of ConvertLIT 1.8
In this version, most of the outstanding bug reports should be resolved:
- Cope with buggy generators which write out truncated files
- Added dictionary support (disable with -d flag)
- Handle duplicated filenames
- Completely changed whitespace expansion
(Thanks to all the help from people who reported this problem)
- Fixed very rare LZX Decompression buffer overruns
- Should work on MAC OS/X and other big endian hardware
(If not, send a bug report)
- Better non-english filename support
DRM5 support is enhanced in this version
DRM5 support is now implemented through a "keys.txt" file which should
contain the private keys from your activation components. You create this
file once with "ReaderKeyRecoveryTool.exe" from the Windows binary package
and from then on you can use those keys under any environment.
Build changes:
This package now requires "LIBTOMMATH" from math.libtomcrypt.org
To build under Linux:
cd lib
make
cd ../clit16
make
To build under Windows, Visual C*.
cd lib
nmake -f win32.mak
cd ..\clit16
nmake -f win32.mak
Now that VC++ 7 is available for "free", supporting MINGW is left as an
exercise for the interested reader. Note that getting the free VC++ to the
point where it can compile ConvertLIT isn't trivial and no support
will be provided.

View File

@@ -0,0 +1,6 @@
convlit (1.8-1) unstable; urgency=low
* Initial release, closes: #472586.
* Added manpage clit(1).
-- Joe Nahmias <jello@debian.org> Thu, 29 May 2008 00:59:04 -0400

View File

@@ -0,0 +1,87 @@
This package was debianized by Joe Nahmias <jello@debian.org> on
Sun, 23 Mar 2008 23:55:42 -0400.
It was downloaded from <http://www.kyzer.me.uk/pack/convlit/>
Upstream Authors:
lib/des/*:
Richard Outerbridge
lib/newlzx/lzx.h, lib/newlzx/lxzd.c, lib/newlzx/mspack.h, lib/newlzx/system.h:
Stuart Caie <kyzer@4u.net>
lib/sha/*:
Steve Reid <steve@edmweb.com>
Aaron D. Gifford <agifford@infowest.com>
All others:
Dan A. Jackson <drs@convertlit.com>, <djs@jacko.demon.co.uk>
Copyright:
lib/des/*:
Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
lib/newlzx/lzx.h, lib/newlzx/lxzd.c, lib/newlzx/mspack.h, lib/newlzx/system.h:
Copyright (C) 2003-2004 Stuart Caie
lib/sha/*:
NO COPYRIGHT - THIS IS 100% IN THE PUBLIC DOMAIN
All others:
Copyright (C) 2004 Digital Rights Software
Copyright (C) 2002 - 2004 Dan A. Jackson
License:
clit18/hexdump.c:
Public Domain
lib/des/*:
THIS SOFTWARE PLACED IN THE PUBLIC DOMAIN BY THE AUTHOUR
920825 19:42 EDST
lib/newlzx/lzx.h, lib/newlzx/lxzd.c, lib/newlzx/mspack.h, lib/newlzx/system.h:
libmspack is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) version 2.1
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
lib/sha/*:
NO COPYRIGHT - THIS IS 100% IN THE PUBLIC DOMAIN
All others:
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
The Debian packaging is (C) 2008, Joe Nahmias <jello@debian.org> and
is licensed under the GPL, see above.

View File

@@ -0,0 +1,52 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH CLIT 1 "March 23, 2008"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
clit \- program to manipulate Microsoft Reader .LIT files
.SH SYNOPSIS
.RB "1. " clit
.RI [ options ] " litfile.lit" " " subdir/
.br
.RB "2. " clit
.RI [ options ] " oldfile.lit" " " newfile.lit
.br
.RB "3. " clit
.RI [ options ] " oldfile.lit" " " newfile.lit " " inscription
.SH DESCRIPTION
This manual page documents briefly the \fBclit\fP command.
.PP
\fBConvLIT\fP is a program to convert Microsoft Reader format eBooks
[\fILIT\fP] into an open format. \fBclit\fP supports three modes
of operation:
.IP 1.
\fBExplosion\fP: expanding a \fILIT\fP file into an OEBPS compliant package,
that is the original \fIXML\fP / \fIHTML\fP source.
.IP 2.
\fBDownconverting\fP: converts to \fIDRM1\fP format, also known as
\fBsealing\fP the \fILIT\fP file.
.IP 3.
\fBInscribing\fP: similar to #2, this adds a label, or \fIinscription\fP,
to the ebook to mark that it belongs to you.
.SH OPTIONS
A summary of options is included below.
For a complete description, run the program without any arguments.
.TP
.B \-d
Disable creating multiple subdirectories.
.TP
.B \-h
Show summary of options.
.TP
.B \-k " " \fI/path/to/keys.txt\fP
The \fIDRM5\fP key file is assumed to be called \fIkeys.txt\fP and located in
the current directory. If not, use this option to instruct \fBConvLIT\fP
where to find the key file.
.SH AUTHOR
\fBConvLIT\fP was written by Dan A. Jackson <drs@convertlit.com>.
.PP
This manual page was written by Joe Nahmias <jello@debian.org>,
for the Debian project (but may be used by others).

View File

@@ -0,0 +1,115 @@
#!/usr/bin/python
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Author: Mariano Simone (http://marianosimone.com)
# Version: 1.0
# Name: epub-thumbnailer
# Description: An implementation of a cover thumbnailer for epub files
# Installation: see README
import os
import re
from io import BytesIO
import sys
from xml.dom import minidom
from StringIO import StringIO
import urllib
import zipfile
try:
from PIL import Image
except ImportError:
import Image
img_ext_regex = re.compile(r'^.*\.(jpg|jpeg|png)$', flags=re.IGNORECASE)
cover_regex = re.compile(r'.*cover.*\.(jpg|jpeg|png)', flags=re.IGNORECASE)
def get_cover_from_manifest(epub):
# open the main container
container = epub.open("META-INF/container.xml")
container_root = minidom.parseString(container.read())
# locate the rootfile
elem = container_root.getElementsByTagName("rootfile")[0]
rootfile_path = elem.getAttribute("full-path")
# open the rootfile
rootfile = epub.open(rootfile_path)
rootfile_root = minidom.parseString(rootfile.read())
# find possible cover in meta
cover_id = None
for meta in rootfile_root.getElementsByTagName("meta"):
if meta.getAttribute("name") == "cover":
cover_id = meta.getAttribute("content")
break
# find the manifest element
manifest = rootfile_root.getElementsByTagName("manifest")[0]
for item in manifest.getElementsByTagName("item"):
item_id = item.getAttribute("id")
item_href = item.getAttribute("href")
if (item_id == cover_id) or ("cover" in item_id and img_ext_regex.match(item_href.lower())):
return os.path.join(os.path.dirname(rootfile_path), item_href)
return None
def get_cover_by_filename(epub):
no_matching_images = []
for fileinfo in epub.filelist:
if cover_regex.match(fileinfo.filename):
return fileinfo.filename
if img_ext_regex.match(fileinfo.filename):
no_matching_images.append(fileinfo)
return _choose_best_image(no_matching_images)
def _choose_best_image(images):
if images:
return max(images, key=lambda f: f.file_size)
return None
def extract_cover(cover_path):
if cover_path:
cover = epub.open(cover_path)
im = Image.open(BytesIO(cover.read()))
im.thumbnail((size, size), Image.ANTIALIAS)
if im.mode == "CMYK":
im = im.convert("RGB")
im.save(output_file, "PNG")
return True
return False
# Which file are we working with?
input_file = sys.argv[1]
# Where do does the file have to be saved?
output_file = sys.argv[2]
# Required size?
size = int(sys.argv[3])
# An epub is just a zip
file_url = urllib.urlopen(input_file)
epub = zipfile.ZipFile(StringIO(file_url.read()), "r")
extraction_strategies = [get_cover_from_manifest, get_cover_by_filename]
for strategy in extraction_strategies:
try:
cover_path = strategy(epub)
if extract_cover(cover_path):
exit(0)
except Exception as ex:
print("Error getting cover using %s: " % strategy.__name__, ex)
exit(1)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
0.97-rc11-20100715-0959

View File

@@ -0,0 +1,5 @@
Manifest-Version: 1.0
ImplementationVersion: 3.1
Main-Class: com.simontuffs.onejar.Boot
One-Jar-Main-Class: nl.siegmann.epublib.viewer.Viewer

View File

@@ -0,0 +1,33 @@
/*
* One-JAR(TM) (http://www.simontuffs.com/one-jar). Copyright (c) 2004-2010,
* P. Simon Tuffs (simon@simontuffs.com). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of P. Simon Tuffs, nor the names of any contributors,
* nor the name One-JAR may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Including this file inside the built One-JAR file conforms with these terms.
*/

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com)
* All rights reserved.
*
* See the full license at http://one-jar.sourceforge.net/one-jar-license.html
* This license is also included in the distributions of this software
* under doc/one-jar-license.txt
*/
import java.util.Arrays;
import com.simontuffs.onejar.Boot;
/**
* One-JAR Jar files are intended to be executed using the following kind of command:
* <pre>
* java -jar <one-jar.jar> [args]
* </pre>
* This class allows a One-JAR jar-file to be executed using the alternative command:
* <pre>
* java -cp <one-jar.jar> OneJar [args]
* </pre>
* Its main role is in testing the behaviour of OneJar on platforms which mangle the classpath
* when running with the first kind of command, but it can also be a useful alternative
* execution mechanism.
* <p>Note: the same effect can be obtained by using the Boot class, albeit with more
* typing:
* <pre>
* java -cp <one-jar.jar> com.simontuffs.onejar.Boot [args]
* @author simon
*
*/
public class OneJar {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
System.out.println("OneJar" + Arrays.asList(args).toString().replace('[','(').replace(']',')'));
new OneJar().run(args);
}
public void run(String[] args) throws Exception {
Boot.run(args);
}
}

View File

@@ -0,0 +1,592 @@
/*
* Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com)
* All rights reserved.
*
* See the full license at http://one-jar.sourceforge.net/one-jar-license.html
* This license is also included in the distributions of this software
* under doc/one-jar-license.txt
*/
package com.simontuffs.onejar;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Properties;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
* Run a java application which requires multiple support jars from inside
* a single jar file.
*
* <p>
* Developer time JVM properties:
* <pre>
* -Done-jar.main.class={name} Use named class as main class to run.
* -Done-jar.record[=recording] Record loaded classes into "recording" directory.
* Flatten jar.names into directory tree suitable
* for use as a classpath.
* -Done-jar.jar.names Record loaded classes, preserve jar structure
* -Done-jar.verbose Run the JarClassLoader in verbose mode.
* </pre>
* @author simon@simontuffs.com (<a href="http://www.simontuffs.com">http://www.simontuffs.com</a>)
*/
public class Boot {
/**
* The name of the manifest attribute which controls which class
* to bootstrap from the jar file. The boot class can
* be in any of the contained jar files.
*/
public final static String BOOT_CLASS = "Boot-Class";
public final static String ONE_JAR_CLASSLOADER = "One-Jar-Class-Loader";
public final static String ONE_JAR_MAIN_CLASS = "One-Jar-Main-Class";
public final static String ONE_JAR_DEFAULT_MAIN_JAR = "One-Jar-Default-Main-Jar";
public final static String ONE_JAR_MAIN_ARGS = "One-Jar-Main-Args";
public final static String ONE_JAR_URL_FACTORY = "One-Jar-URL-Factory";
public final static String MANIFEST = "META-INF/MANIFEST.MF";
public final static String MAIN_JAR = "main/main.jar";
public final static String WRAP_CLASS_LOADER = "Wrap-Class-Loader";
public final static String WRAP_DIR = "wrap";
public final static String WRAP_JAR = "/" + WRAP_DIR + "/wraploader.jar";
// System properties.
public final static String PROPERTY_PREFIX = "one-jar.";
public final static String P_MAIN_CLASS = PROPERTY_PREFIX + "main.class";
public final static String P_MAIN_JAR = PROPERTY_PREFIX + "main.jar";
public final static String P_MAIN_APP = PROPERTY_PREFIX + "main.app";
public final static String P_RECORD = PROPERTY_PREFIX + "record";
public final static String P_JARNAMES = PROPERTY_PREFIX + "jar.names";
public final static String P_VERBOSE = PROPERTY_PREFIX + "verbose";
public final static String P_INFO = PROPERTY_PREFIX + "info";
public final static String P_STATISTICS = PROPERTY_PREFIX + "statistics";
public final static String P_SHOW_PROPERTIES = PROPERTY_PREFIX + "show.properties";
public final static String P_JARPATH = PROPERTY_PREFIX + "jar.path";
public final static String P_ONE_JAR_CLASS_PATH = PROPERTY_PREFIX + "class.path";
public final static String P_JAVA_CLASS_PATH = "java.class.path";
public final static String P_PATH_SEPARATOR = "|";
public final static String P_EXPAND_DIR = PROPERTY_PREFIX + "expand.dir";
// Command-line arguments
public final static String A_HELP = "--one-jar-help";
public final static String A_VERSION = "--one-jar-version";
public final static String[] HELP_PROPERTIES = {
P_MAIN_CLASS, "Specifies the name of the class which should be executed \n(via public static void main(String[])",
P_MAIN_APP, "Specifies the name of the main/<app>.jar to be executed",
P_RECORD, "true: Enables recording of the classes loaded by the application",
P_JARNAMES, "true: Recorded classes are kept in directories corresponding to their jar names.\n" +
"false: Recorded classes are flattened into a single directory. \nDuplicates are ignored (first wins)",
P_VERBOSE, "true: Print verbose classloading information",
P_INFO, "true: Print informative classloading information",
P_STATISTICS, "true: Shows statistics about the One-Jar Classloader",
P_JARPATH, "Full path of the one-jar file being executed. \nOnly needed if java.class.path does not contain the path to the jar, e.g. on Max OS/X.",
P_ONE_JAR_CLASS_PATH, "Extra classpaths to be added to the execution environment. \nUse platform independent path separator '" + P_PATH_SEPARATOR + "'",
P_EXPAND_DIR, "Directory to use for expanded files.",
P_SHOW_PROPERTIES, "true: Shows the JVM system properties.",
};
public final static String[] HELP_ARGUMENTS = {
A_HELP, "Shows this message, then exits.",
A_VERSION, "Shows the version of One-JAR, then exits.",
};
protected static String mainJar;
protected static boolean info, verbose, statistics;
protected static String myJarPath;
protected static long startTime = System.currentTimeMillis();
protected static long endTime = 0;
// Singleton loader. This must not be changed once it is set, otherwise all
// sorts of nasty class-cast exceptions will ensue. Hence we control
// access to it strongly.
private static JarClassLoader loader = null;
/**
* This method provides access to the bootstrap One-JAR classloader which
* is needed in the URL connection Handler when opening streams relative
* to classes.
* @return
*/
public synchronized static JarClassLoader getClassLoader() {
return loader;
}
/**
* This is the single point of entry for setting the "loader" member. It checks to
* make sure programming errors don't call it more than once.
* @param $loader
*/
public synchronized static void setClassLoader(JarClassLoader $loader) {
if (loader != null) throw new RuntimeException("Attempt to set a second Boot loader");
loader = $loader;
}
protected static void VERBOSE(String message) {
if (verbose) System.out.println("Boot: " + message);
}
protected static void WARNING(String message) {
System.err.println("Boot: Warning: " + message);
}
protected static void INFO(String message) {
if (info) System.out.println("Boot: Info: " + message);
}
protected static void PRINTLN(String message) {
System.out.println("Boot: " + message);
}
public static void main(String[] args) throws Exception {
run(args);
}
public static void run(String args[]) throws Exception {
args = processArgs(args);
// Is the main class specified on the command line? If so, boot it.
// Otherwise, read the main class out of the manifest.
String mainClass = null;
{
// Default properties are in resource 'one-jar.properties'.
Properties properties = new Properties();
String props = "one-jar.properties";
InputStream is = Boot.class.getResourceAsStream("/" + props);
if (is != null) {
INFO("loading properties from " + props);
properties.load(is);
}
// Merge in anything in a local file with the same name.
if (new File(props).exists()) {
is = new FileInputStream(props);
if (is != null) {
INFO("merging properties from " + props);
properties.load(is);
}
}
// Set system properties only if not already specified.
Enumeration _enum = properties.propertyNames();
while (_enum.hasMoreElements()) {
String name = (String)_enum.nextElement();
if (System.getProperty(name) == null) {
System.setProperty(name, properties.getProperty(name));
}
}
}
if (Boolean.valueOf(System.getProperty(P_SHOW_PROPERTIES, "false")).booleanValue()) {
// What are the system properties.
Properties props = System.getProperties();
String keys[] = (String[])props.keySet().toArray(new String[]{});
Arrays.sort(keys);
for (int i=0; i<keys.length; i++) {
String key = keys[i];
System.out.println(key + "=" + props.get(key));
}
}
// Process developer properties:
if (mainClass == null) {
mainClass = System.getProperty(P_MAIN_CLASS);
}
if (mainJar == null) {
String app = System.getProperty(P_MAIN_APP);
if (app != null) {
mainJar = "main/" + app + ".jar";
} else {
mainJar = System.getProperty(P_MAIN_JAR, MAIN_JAR);
}
}
// Pick some things out of the top-level JAR file.
String jar = getMyJarPath();
JarFile jarFile = new JarFile(jar);
Manifest manifest = jarFile.getManifest();
Attributes attributes = manifest.getMainAttributes();
String bootLoaderName = attributes.getValue(ONE_JAR_CLASSLOADER);
if (mainJar == null) {
mainJar = attributes.getValue(ONE_JAR_DEFAULT_MAIN_JAR);
}
String mainargs = attributes.getValue(ONE_JAR_MAIN_ARGS);
if (mainargs != null && args.length == 0) {
// Replace the args with built-in. Support escaped whitespace.
args = mainargs.split("[^\\\\]\\s");
for (int i=0; i<args.length; i++) {
args[i] = args[i].replaceAll("\\\\(\\s)", "$1");
}
}
// If no main-class specified, check the manifest of the main jar for
// a Boot-Class attribute.
if (mainClass == null) {
mainClass = attributes.getValue(ONE_JAR_MAIN_CLASS);
if (mainClass == null) {
mainClass = attributes.getValue(BOOT_CLASS);
if (mainClass != null) {
WARNING("The manifest attribute " + BOOT_CLASS + " is deprecated in favor of the attribute " + ONE_JAR_MAIN_CLASS);
}
}
}
if (mainClass == null) {
// Still don't have one (default). One final try: look for a jar file in a
// main directory. There should be only one, and it's manifest
// Main-Class attribute is the main class. The JarClassLoader will take
// care of finding it.
InputStream is = Boot.class.getResourceAsStream("/" + mainJar);
if (is != null) {
JarInputStream jis = new JarInputStream(is);
Manifest mainmanifest = jis.getManifest();
jis.close();
mainClass = mainmanifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);
} else {
// There is no main jar. Info unless mainJar is empty string.
// The load(mainClass) will scan for main jars anyway.
if (!"".equals(mainJar)){
INFO("Unable to locate main jar '" + mainJar + "' in the JAR file " + getMyJarPath());
}
}
}
// Do we need to create a wrapping classloader? Check for the
// presence of a "wrap" directory at the top of the jar file.
URL url = Boot.class.getResource(WRAP_JAR);
if (url != null) {
// Wrap class loaders.
final JarClassLoader bootLoader = getBootLoader(bootLoaderName);
bootLoader.load(null);
// Read the "Wrap-Class-Loader" property from the wraploader jar file.
// This is the class to use as a wrapping class-loader.
InputStream is = Boot.class.getResourceAsStream(WRAP_JAR);
if (is != null) {
JarInputStream jis = new JarInputStream(is);
final String wrapLoader = jis.getManifest().getMainAttributes().getValue(WRAP_CLASS_LOADER);
jis.close();
if (wrapLoader == null) {
WARNING(url + " did not contain a " + WRAP_CLASS_LOADER + " attribute, unable to load wrapping classloader");
} else {
INFO("using " + wrapLoader);
JarClassLoader wrapped = getWrapLoader(bootLoader, wrapLoader);
if (wrapped == null) {
WARNING("Unable to instantiate " + wrapLoader + " from " + WRAP_DIR + ": using default JarClassLoader");
wrapped = getBootLoader(null);
}
setClassLoader(wrapped);
}
}
} else {
setClassLoader(getBootLoader(bootLoaderName, Boot.class.getClassLoader()));
INFO("using JarClassLoader: " + getClassLoader().getClass().getName());
}
// Allow injection of the URL factory.
String urlfactory = attributes.getValue(ONE_JAR_URL_FACTORY);
if (urlfactory != null) {
loader.setURLFactory(urlfactory);
}
mainClass = loader.load(mainClass);
if (mainClass == null && !loader.isExpanded())
throw new Exception(getMyJarName() + " main class was not found (fix: add main/main.jar with a Main-Class manifest attribute, or specify -D" + P_MAIN_CLASS + "=<your.class.name>), or use " + ONE_JAR_MAIN_CLASS + " in the manifest");
if (mainClass != null) {
// Guard against the main.jar pointing back to this
// class, and causing an infinite recursion.
String bootClass = Boot.class.getName();
if (bootClass.equals(mainClass))
throw new Exception(getMyJarName() + " main class (" + mainClass + ") would cause infinite recursion: check main.jar/META-INF/MANIFEST.MF/Main-Class attribute: " + mainClass);
Class cls = loader.loadClass(mainClass);
endTime = System.currentTimeMillis();
showTime();
Method main = cls.getMethod("main", new Class[]{String[].class});
main.invoke(null, new Object[]{args});
}
}
public static void showTime() {
long endtime = System.currentTimeMillis();
if (statistics) {
PRINTLN("Elapsed time: " + (endtime - startTime) + "ms");
}
}
public static void setProperties(IProperties jarloader) {
INFO("setProperties(" + jarloader + ")");
if (getProperty(P_RECORD)) {
jarloader.setRecord(true);
jarloader.setRecording(System.getProperty(P_RECORD));
}
if (getProperty(P_JARNAMES)) {
jarloader.setRecord(true);
jarloader.setFlatten(false);
}
if (getProperty(P_VERBOSE)) {
jarloader.setVerbose(true);
jarloader.setInfo(true);
verbose = true;
}
if (getProperty(P_INFO)) {
jarloader.setInfo(true);
info = true;
}
statistics = getProperty(P_STATISTICS);
}
public static boolean getProperty(String key) {
return Boolean.valueOf(System.getProperty(key, "false")).booleanValue();
}
public static String getMyJarName() {
String name = getMyJarPath();
int last = name.lastIndexOf("/");
if (last >= 0) {
name = name.substring(last+1);
}
return name;
}
public static String getMyJarPath() {
if (myJarPath != null) {
return myJarPath;
}
myJarPath = System.getProperty(P_JARPATH);
if (myJarPath == null) {
try {
// Hack to obtain the name of this jar file.
String jarname = System.getProperty(P_JAVA_CLASS_PATH);
// Open each Jar file looking for this class name. This allows for
// JVM's that place more than the jar file on the classpath.
String jars[] =jarname.split(System.getProperty("path.separator"));
for (int i=0; i<jars.length; i++) {
jarname = jars[i];
VERBOSE("Checking " + jarname + " as One-Jar file");
// Allow for URL based paths, as well as file-based paths. File
InputStream is = null;
try {
is = new URL(jarname).openStream();
} catch (MalformedURLException mux) {
// Try a local file.
try {
is = new FileInputStream(jarname);
} catch (IOException iox) {
// Ignore..., but it isn't good to have bad entries on the classpath.
continue;
}
}
ZipEntry entry = findJarEntry(new JarInputStream(is), Boot.class.getName().replace('.', '/') + ".class");
if (entry != null) {
myJarPath = jarname;
break;
} else {
// One more try as a Zip file: supports launch4j on Windows.
entry = findZipEntry(new ZipFile(jarname), Boot.class.getName().replace('.', '/') + ".class");
if (entry != null) {
myJarPath = jarname;
break;
}
}
}
} catch (Exception x) {
x.printStackTrace();
WARNING("jar=" + myJarPath + " loaded from " + P_JAVA_CLASS_PATH + " (" + System.getProperty(P_JAVA_CLASS_PATH) + ")");
}
}
if (myJarPath == null) {
throw new IllegalArgumentException("Unable to locate " + Boot.class.getName() + " in the java.class.path: consider using -D" + P_JARPATH + " to specify the one-jar filename.");
}
// Normalize those annoying DOS backslashes.
myJarPath = myJarPath.replace('\\', '/');
return myJarPath;
}
public static JarEntry findJarEntry(JarInputStream jis, String name) throws IOException {
JarEntry entry;
while ((entry = jis.getNextJarEntry()) != null) {
if (entry.getName().equals(name)) {
return entry;
}
}
return null;
}
public static ZipEntry findZipEntry(ZipFile zip, String name) throws IOException {
Enumeration entries = zip.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
VERBOSE(("findZipEntry(): entry=" + entry.getName()));
if (entry.getName().equals(name))
return entry;
}
return null;
}
public static int firstWidth(String[] table) {
int width = 0;
for (int i=0; i<table.length; i+=2) {
if (table[i].length() > width) width = table[i].length();
}
return width;
}
public static String pad(String indent, String string, int width) {
StringBuffer buf = new StringBuffer();
buf.append(indent);
buf.append(string);
for (int i=0; i<width-string.length(); i++) {
buf.append(" ");
}
return buf.toString();
}
public static String wrap(String indent, String string, int width) {
String padding = pad(indent, "", width);
string = string.replaceAll("\n", "\n" + padding);
return string;
}
public static String[] processArgs(String args[]) throws Exception {
// Check for arguments which matter to us, and strip them.
VERBOSE("processArgs(" + Arrays.asList(args) + ")");
ArrayList list = new ArrayList();
for (int a=0; a<args.length; a++) {
String argument = args[a];
if (argument.startsWith(A_HELP)) {
int width = firstWidth(HELP_ARGUMENTS);
// Width of first column
System.out.println("One-Jar uses the following command-line arguments");
for (int i=0; i<HELP_ARGUMENTS.length; i++) {
System.out.print(pad(" ", HELP_ARGUMENTS[i++], width+1));
System.out.println(wrap(" ", HELP_ARGUMENTS[i], width+1));
}
System.out.println();
width = firstWidth(HELP_PROPERTIES);
System.out.println("One-Jar uses the following VM properties (-D<property>=<true|false|string>)");
for (int i=0; i<HELP_PROPERTIES.length; i++) {
System.out.print(pad(" ", HELP_PROPERTIES[i++], width+1));
System.out.println(wrap(" ", HELP_PROPERTIES[i], width+1));
}
System.out.println();
System.exit(0);
} else if (argument.startsWith(A_VERSION)) {
InputStream is = Boot.class.getResourceAsStream("/.version");
if (is != null) {
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String version = br.readLine();
br.close();
System.out.println("One-JAR version " + version);
} else {
System.out.println("Unable to determine One-JAR version (missing /.version resource in One-JAR archive)");
}
System.exit(0);
} else {
list.add(argument);
}
}
return (String[])list.toArray(new String[0]);
}
protected static JarClassLoader getBootLoader(final String loader) {
JarClassLoader bootLoader = (JarClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
if (loader != null) {
try {
Class cls = Class.forName(loader);
Constructor ctor = cls.getConstructor(new Class[]{String.class});
return ctor.newInstance(new Object[]{WRAP_DIR});
} catch (Exception x) {
WARNING("Unable to instantiate " + loader + ": " + x + " continuing using default " + JarClassLoader.class.getName());
}
}
return new JarClassLoader(WRAP_DIR);
}
}
);
return bootLoader;
}
protected static JarClassLoader getBootLoader(final String loader, ClassLoader parent) {
return (JarClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
if (loader != null) {
try {
Class cls = Class.forName(loader);
Constructor ctor = cls.getConstructor(new Class[]{ClassLoader.class});
return ctor.newInstance(new Object[]{Boot.class.getClassLoader()});
} catch (Exception x) {
WARNING("Unable to instantiate " + loader + ": " + x + " continuing using default " + JarClassLoader.class.getName());
}
}
return new JarClassLoader(Boot.class.getClassLoader());
}
}
);
}
protected static JarClassLoader getWrapLoader(final ClassLoader bootLoader, final String wrapLoader) {
return ((JarClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
try {
Class jarLoaderClass = bootLoader.loadClass(wrapLoader);
Constructor ctor = jarLoaderClass.getConstructor(new Class[]{ClassLoader.class});
return ctor.newInstance(new Object[]{bootLoader});
} catch (Throwable t) {
WARNING(t.toString());
}
return null;
}
}));
}
public static long getEndTime() {
return endTime;
}
public static long getStartTime() {
return startTime;
}
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com)
* All rights reserved.
*
* See the full license at http://one-jar.sourceforge.net/one-jar-license.html
* This license is also included in the distributions of this software
* under doc/one-jar-license.txt
*/
package com.simontuffs.onejar;
import java.io.IOException;
import java.io.InputStream;
import java.net.FileNameMap;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
/**
* @author simon@simontuffs.com
*
*/
public class Handler extends URLStreamHandler {
/**
* This protocol name must match the name of the package in which this class
* lives.
*/
public static String PROTOCOL = "onejar";
/**
* @see java.net.URLStreamHandler#openConnection(java.net.URL)
*/
protected URLConnection openConnection(final URL u) throws IOException {
final String resource = u.getPath();
return new URLConnection(u) {
public void connect() {
}
public String getContentType() {
FileNameMap fileNameMap = java.net.URLConnection.getFileNameMap();
String contentType = fileNameMap.getContentTypeFor(resource);
if (contentType == null)
contentType = "text/plain";
return contentType;
}
public InputStream getInputStream() throws IOException {
// Use the Boot classloader to get the resource. There
// is only one per one-jar.
JarClassLoader cl = Boot.getClassLoader();
InputStream is = cl.getByteStream(resource);
// sun.awt image loading does not like null input streams returned here.
// Throw IOException (probably better anyway).
if (is == null)
throw new IOException("cl.getByteStream() returned null for " + resource);
return is;
}
};
}
}

View File

@@ -0,0 +1,16 @@
package com.simontuffs.onejar;
/**
* Interface to the controlling properties for a JarClassLoader.
* @author simon
*
*/
public interface IProperties {
public void setVerbose(boolean verbose);
public void setInfo(boolean info);
public void setRecord(boolean record);
public void setFlatten(boolean flatten);
public void setRecording(String recording);
}

View File

@@ -0,0 +1,148 @@
/*
* Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com)
* All rights reserved.
*
* See the full license at http://one-jar.sourceforge.net/one-jar-license.html
* This license is also included in the distributions of this software
* under doc/one-jar-license.txt
*
* Many thanks to the following for their contributions to One-Jar:
* Contributor: sebastian : http://code.google.com/u/@WBZRRlBYBxZHXQl9/
* Original creator of the OneJarFile/OneJarUrlConnecion solution to resource location
* using jar protocols.
*
*/
package com.simontuffs.onejar;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.zip.ZipEntry;
public class OneJarFile extends JarFile {
protected final String jarFilename;
protected final String filename;
protected final JarEntry wrappedJarFile;
public OneJarFile(String myJarPath, String jarFilename, String filename) throws IOException {
super(myJarPath);
this.jarFilename = jarFilename;
this.filename = filename;
wrappedJarFile = super.getJarEntry(this.jarFilename);
}
public JarEntry getJarEntry(String name) {
String filename = name.substring(name.indexOf("!/") + 2);
if (filename.equals(MANIFEST_NAME)) {
// Synthesize a JarEntry.
return new JarEntry(filename) {
};
}
try {
JarInputStream is = new JarInputStream(super.getInputStream(wrappedJarFile));
try {
JarEntry entry;
while ((entry = is.getNextJarEntry()) != null) {
if (entry.getName().equals(filename)) {
return entry;
}
}
} finally {
is.close();
}
} catch (IOException e) {
throw new IllegalStateException("Undefined Error", e);
}
return null;
// throw new RuntimeException("Entry not found : " + name);
}
public Enumeration entries() {
try {
final JarInputStream is = new JarInputStream(super.getInputStream(wrappedJarFile));
return new Enumeration() {
protected JarEntry next;
public Object nextElement() {
if (next != null) {
JarEntry tmp = next;
next = null;
return tmp;
}
try {
return is.getNextJarEntry();
} catch (IOException e) {
throw new RuntimeException("Undefined Error", e);
}
}
public boolean hasMoreElements() {
if (next != null) {
return true;
}
try {
next = is.getNextJarEntry();
if (next == null) {
is.close();
}
} catch (IOException e) {
throw new RuntimeException("Undefined Error", e);
}
return next != null;
}
};
} catch (IOException e) {
throw new RuntimeException("Undefined Error", e);
}
}
public synchronized InputStream getInputStream(ZipEntry ze) throws IOException {
if (ze == null)
return null;
try {
JarInputStream is = new JarInputStream(super.getInputStream(wrappedJarFile));
if (filename.equals(MANIFEST_NAME)) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
is.getManifest().write(baos);
return new ByteArrayInputStream(baos.toByteArray());
}
try {
JarEntry entry;
while ((entry = is.getNextJarEntry()) != null) {
if (entry.getName().equals(ze.getName())) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
copy(is, baos);
return new ByteArrayInputStream(baos.toByteArray());
}
}
} finally {
is.close();
}
} catch (IOException e) {
throw new RuntimeException("Undefined Error", e);
}
throw new RuntimeException("Entry not found : " + ze.getName());
}
protected void copy(InputStream in, OutputStream out) throws IOException {
byte[] buf = new byte[1024];
while (true) {
int len = in.read(buf);
if (len < 0)
break;
out.write(buf, 0, len);
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com)
* All rights reserved.
*
* See the full license at http://one-jar.sourceforge.net/one-jar-license.html
* This license is also included in the distributions of this software
* under doc/one-jar-license.txt
*
* Contributor: sebastian : http://code.google.com/u/@WBZRRlBYBxZHXQl9/
* Original creator of the OneJarFile/OneJarUrlConnecion solution to resource location
* using jar protocols.
*
*/
package com.simontuffs.onejar;
import java.io.IOException;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.jar.JarFile;
public class OneJarURLConnection extends JarURLConnection {
private JarFile jarFile;
public OneJarURLConnection(URL url) throws MalformedURLException {
super(url);
}
public JarFile getJarFile() throws IOException {
return jarFile;
}
public void connect() throws IOException {
String jarWithContent = getEntryName();
int separator = jarWithContent.indexOf("!/");
// Handle the case where a URL points to the top-level jar file, i.e. no '!/' separator.
if (separator >= 0) {
String jarFilename = jarWithContent, filename = null;
jarFilename = jarWithContent.substring(0, separator++);
filename = jarWithContent.substring(++separator);
jarFile = new OneJarFile(Boot.getMyJarPath(), jarFilename, filename);
} else {
// Entry in the top-level One-JAR.
jarFile = new JarFile(Boot.getMyJarPath());
}
}
public InputStream getInputStream() throws IOException {
return jarFile.getInputStream(jarFile.getJarEntry(getEntryName()));
}
}

View File

@@ -0,0 +1,44 @@
.darkPane,
.root {
-fx-background-color: rgba(68,68,68, 0.8);/*#444444;*/
}
.toggle-button,
.button {
-fx-background-color:
#c3c4c4,
linear-gradient(#d6d6d6 50%, white 100%),
radial-gradient(center 50% -40%, radius 200%, #e6e6e6 45%, rgba(230,230,230,0) 50%);
-fx-background-radius: 30;
-fx-background-insets: 0,1,1;
-fx-text-fill: black;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 3, 0.0 , 0 , 1 );
}
.button:hover {
-fx-cursor: hand;
-fx-background-color:
linear-gradient(from 0% 93% to 0% 100%, #a34313 0%, #903b12 100%),
#9d4024,
#d86e3a,
radial-gradient(center 50% 50%, radius 100%, #ea7f4b, #c54e2c);
}
.toggle-button:hover {
-fx-cursor: hand;
}
.toggle-button:selected {
-fx-background-color:
linear-gradient(from 0% 93% to 0% 100%, #a34313 0%, #903b12 100%),
#9d4024,
#d86e3a,
radial-gradient(center 50% 50%, radius 100%, #ea7f4b, #c54e2c);
}
.toggle-button:selected:focused {
-fx-background-color:
linear-gradient(from 0% 93% to 0% 100%, #a34313 0%, #903b12 100%),
#9d4024,
#d86e3a,
radial-gradient(center 50% 50%, radius 100%, #ea7f4b, #c54e2c);
}

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.TilePane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0" styleClass="darkPane" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controller">
<children>
<ScrollPane fx:id="stackPane" layoutY="32.0" prefHeight="568.0" prefWidth="800.0" styleClass="darkPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="32.0">
<content>
<TilePane fx:id="tilePane" hgap="15.0" prefHeight="566.0" prefWidth="797.0" styleClass="darkPane" vgap="15.0">
<children>
<Label fx:id="dir" contentDisplay="CENTER" onMouseClicked="#setNewDir" prefHeight="566.0" prefWidth="798.0" text="Choose Dir" textAlignment="CENTER" textFill="#dfdfdf" textOverrun="CLIP" underline="false" wrapText="true">
<font>
<Font name="System Bold" size="32.0" />
</font>
</Label>
</children>
</TilePane>
</content>
</ScrollPane>
<HBox AnchorPane.bottomAnchor="568.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Button mnemonicParsing="false" onAction="#close" prefHeight="32.0" prefWidth="50.0" text="X" />
<ToggleButton mnemonicParsing="false" onAction="#setJarUse" prefHeight="32.0" prefWidth="140.0" text="Windows: Use Jars" />
<TextField fx:id="pathTxt" onKeyReleased="#Enter" prefHeight="32.0" prefWidth="442.0" promptText="File/Dir Path..." HBox.hgrow="ALWAYS" />
<Button fx:id="fileBttn" mnemonicParsing="false" onAction="#openFile" prefHeight="32.0" prefWidth="79.0" text="File" />
<Button fx:id="clearBttn" mnemonicParsing="false" onAction="#clearBttnClick" prefHeight="32.0" prefWidth="79.0" text="Clear" />
</children>
</HBox>
</children>
</AnchorPane>

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Some files were not shown because too many files have changed in this diff Show More