Merge pull request #290 from ThexXTURBOXx/master
[Draft] Migrate to Maven and fix Code Style
This commit is contained in:
commit
c4d58fcc36
241 changed files with 8225 additions and 16022 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -8,3 +8,6 @@
|
|||
.DS_Store
|
||||
*.iml
|
||||
/out/
|
||||
/target/
|
||||
|
||||
dependency-reduced-pom.xml
|
||||
|
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "libs/byte-engineer"]
|
||||
path = libs/byte-engineer
|
||||
url = https://bitbucket.org/ThexXTURBOXx/byte-engineer
|
|
@ -29,4 +29,6 @@
|
|||
* samczsun
|
||||
* ItzSomebody
|
||||
* DreamSworK
|
||||
* BitScorpio
|
||||
* HyperSpeeed
|
||||
* If I missed you, please feel free to contact me @Konloch or konloch@gmail.com
|
24
README.md
24
README.md
|
@ -3,14 +3,10 @@
|
|||
Bytecode Viewer - a lightweight user friendly Java Bytecode Viewer.
|
||||
|
||||
#### New Features
|
||||
* WAR & JSP Loading
|
||||
* JADX-Core Decompiler
|
||||
* Fixed APK & dex loading
|
||||
* Fixed Java 10+ classfiles
|
||||
* Better visual feedback due to the new busy icon system
|
||||
* Synchronized viewing pane option & quick method selection
|
||||
* Updated most libraries to their 2019 version
|
||||
* Tons of bug fixes and general improvements
|
||||
* Updated nearly all dependencies (incl. decompilers like CFR, JD-GUI etc.)
|
||||
* Updated ASM library to version 9.1
|
||||
* Added support to Java files compiled using JDK > 13
|
||||
* Migrated to Maven
|
||||
|
||||
|
||||
#### Links
|
||||
|
@ -66,3 +62,15 @@ All you have to do is add a jar, class or APK file into the workspace. Then sele
|
|||
|
||||
##### Are you a Java Reverse Engineer? Do you want to learn?
|
||||
Join The Bytecode Club Today! - https://the.bytecode.club
|
||||
|
||||
## Instructions to compile
|
||||
|
||||
Just clone this repo, **!INITIALIZE THE SUBMODULES!** and run ``mvn package``. It's that simple!
|
||||
|
||||
## Working on the source
|
||||
|
||||
Open the Maven project (e.g. in IntelliJ, open the ``pom.xml`` as a project file) and add the following folders as source roots:
|
||||
```
|
||||
libs/byte-engineer/byteanalysis/src/main/java
|
||||
libs/byte-engineer/byteio/src/main/java
|
||||
```
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,210 +0,0 @@
|
|||
Sub projects brut.apktool, brut.j.common, brut.dir and brut.j.util are
|
||||
released under the following license:
|
||||
|
||||
*******************************************************************************
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*******************************************************************************
|
||||
|
||||
The sub project (brut.apktool.smali) is a clone of the smali project. Its
|
||||
license can be found at brut.apktool.smali/NOTICE-SMALI
|
BIN
libs/asm-7.1.jar
BIN
libs/asm-7.1.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
NONE WHAT THE FUCK BIBL > https://github.com/TheBiblMan/Byte-Engineer-2
|
Binary file not shown.
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2019 Lee Benfield - https://www.benf.org/other/cfr
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,11 +0,0 @@
|
|||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -1,11 +0,0 @@
|
|||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
BIN
libs/dx-1.16.jar
BIN
libs/dx-1.16.jar
Binary file not shown.
|
@ -1,202 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
Binary file not shown.
Binary file not shown.
|
@ -1,11 +0,0 @@
|
|||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
Binary file not shown.
Binary file not shown.
|
@ -1,202 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
http://opensource.org/licenses/BSD-3-Clause
|
BIN
libs/janino.jar
BIN
libs/janino.jar
Binary file not shown.
Binary file not shown.
BIN
libs/jd-gui-1.6.6.jar
Normal file
BIN
libs/jd-gui-1.6.6.jar
Normal file
Binary file not shown.
|
@ -1,676 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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
|
||||
them 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 prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey 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;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If 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 convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
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
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
JD-GUI, a standalone graphical utility that displays Java sources from
|
||||
CLASS files
|
||||
Copyright (C) 2008-2015 Emmanuel Dupuy
|
||||
|
||||
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/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
JD-GUI Copyright (C) 2008-2015 Emmanuel Dupuy
|
||||
This program 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, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU 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. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@ -1,24 +0,0 @@
|
|||
Copyright (c) 2001-2014, JGraph Ltd
|
||||
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 the JGraph nor the
|
||||
names of its contributors 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 JGRAPH 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.
|
BIN
libs/jgraphx.jar
BIN
libs/jgraphx.jar
Binary file not shown.
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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
|
||||
them 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 prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey 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;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If 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 convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
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
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program 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, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU 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. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
Binary file not shown.
Binary file not shown.
|
@ -1,55 +0,0 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
@ -1,24 +0,0 @@
|
|||
Copyright (c) 2012, Robert Futrell
|
||||
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 the author nor the names of its contributors 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 <COPYRIGHT HOLDER> 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.
|
Binary file not shown.
Binary file not shown.
297
pom.xml
Normal file
297
pom.xml
Normal file
|
@ -0,0 +1,297 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>club.bytecode.the</groupId>
|
||||
<artifactId>bytecodeviewer</artifactId>
|
||||
<version>2.10.0</version>
|
||||
|
||||
<properties>
|
||||
<java.version>8</java.version>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<repository>
|
||||
<id>libs</id>
|
||||
<name>libs</name>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
<checksumPolicy>ignore</checksumPolicy>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
<url>file://${project.basedir}/libs</url>
|
||||
</repository>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.android</groupId>
|
||||
<artifactId>android-lib</artifactId>
|
||||
<version>5.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/android-5.1.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>20.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apktool</groupId>
|
||||
<artifactId>apktool</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/apktool_2.3.0.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm-analysis</artifactId>
|
||||
<version>9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm-commons</artifactId>
|
||||
<version>9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm-tree</artifactId>
|
||||
<version>9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm-util</artifactId>
|
||||
<version>9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.benf</groupId>
|
||||
<artifactId>cfr</artifactId>
|
||||
<version>0.151</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>uk.com.robust-it</groupId>
|
||||
<artifactId>cloning</artifactId>
|
||||
<version>1.9.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.janino</groupId>
|
||||
<artifactId>commons-compiler</artifactId>
|
||||
<version>3.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>1.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pxb1988</groupId>
|
||||
<artifactId>d2jar-lib-obf</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/d2jar-lib-obf.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rover12421.android</groupId>
|
||||
<artifactId>dx</artifactId>
|
||||
<version>1.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.windup.decompiler</groupId>
|
||||
<artifactId>decompiler-fernflower</artifactId>
|
||||
<version>5.1.3.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.1.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.imgscalr</groupId>
|
||||
<artifactId>imgscalr-lib</artifactId>
|
||||
<version>4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.skylot.jadx</groupId>
|
||||
<artifactId>jadx-core</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.janino</groupId>
|
||||
<artifactId>janino</artifactId>
|
||||
<version>3.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jd</groupId>
|
||||
<artifactId>jd-gui</artifactId>
|
||||
<version>1.6.6</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/jd-gui-1.6.6.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.bibl.banalysis</groupId>
|
||||
<artifactId>byteanalysis</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/byteanalysis-1.0.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.tinyjee.jgraphx</groupId>
|
||||
<artifactId>jgraphx</artifactId>
|
||||
<version>3.4.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.objenesis</groupId>
|
||||
<artifactId>objenesis</artifactId>
|
||||
<version>3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.mstrobel</groupId>
|
||||
<artifactId>procyon-core</artifactId>
|
||||
<version>0.5.36</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.mstrobel</groupId>
|
||||
<artifactId>procyon-expressions</artifactId>
|
||||
<version>0.5.36</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.mstrobel</groupId>
|
||||
<artifactId>procyon-reflection</artifactId>
|
||||
<version>0.5.36</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bitbucket.mstrobel</groupId>
|
||||
<artifactId>procyon-compilertools</artifactId>
|
||||
<version>0.5.36</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fifesoft</groupId>
|
||||
<artifactId>rsyntaxtextarea</artifactId>
|
||||
<version>3.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.smali</groupId>
|
||||
<artifactId>smali</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>1.28</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xpp3</groupId>
|
||||
<artifactId>xpp3</artifactId>
|
||||
<version>1.1.4c</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>the.bytecode.club.bytecodeviewer.BytecodeViewer</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,140 +0,0 @@
|
|||
package jd.cli.util;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import jd.core.CoreConstants;
|
||||
import jd.core.model.classfile.constant.Constant;
|
||||
import jd.core.model.classfile.constant.ConstantClass;
|
||||
import jd.core.model.classfile.constant.ConstantConstant;
|
||||
import jd.core.model.classfile.constant.ConstantUtf8;
|
||||
import jd.core.process.deserializer.ClassFormatException;
|
||||
import jd.core.util.StringConstants;
|
||||
|
||||
|
||||
public class ClassFileUtil {
|
||||
/*
|
||||
* Lecture rapide de la structure de la classe et extraction du nom du
|
||||
* repoertoire de base.
|
||||
*/
|
||||
public static String ExtractDirectoryPath(String pathToClass) {
|
||||
DataInputStream dis = null;
|
||||
String directoryPath = null;
|
||||
|
||||
try {
|
||||
dis = new DataInputStream(
|
||||
new BufferedInputStream(
|
||||
new FileInputStream(pathToClass)));
|
||||
|
||||
int magic = dis.readInt();
|
||||
if (magic != CoreConstants.JAVA_MAGIC_NUMBER)
|
||||
throw new ClassFormatException("Invalid Java .class file");
|
||||
|
||||
/* int minor_version = */
|
||||
dis.readUnsignedShort();
|
||||
/* int major_version = */
|
||||
dis.readUnsignedShort();
|
||||
|
||||
Constant[] constants = DeserializeConstants(dis);
|
||||
|
||||
/* int access_flags = */
|
||||
dis.readUnsignedShort();
|
||||
int this_class = dis.readUnsignedShort();
|
||||
|
||||
Constant c = constants[this_class];
|
||||
if ((c == null) || (c.tag != ConstantConstant.CONSTANT_Class))
|
||||
throw new ClassFormatException("Invalid contant pool");
|
||||
|
||||
c = constants[((ConstantClass) c).name_index];
|
||||
if ((c == null) || (c.tag != ConstantConstant.CONSTANT_Utf8))
|
||||
throw new ClassFormatException("Invalid contant pool");
|
||||
|
||||
String internalClassName = ((ConstantUtf8) c).bytes;
|
||||
String pathSuffix = internalClassName.replace(
|
||||
StringConstants.INTERNAL_PACKAGE_SEPARATOR, File.separatorChar) +
|
||||
StringConstants.CLASS_FILE_SUFFIX;
|
||||
|
||||
int index = pathToClass.indexOf(pathSuffix);
|
||||
|
||||
if (index < 0)
|
||||
throw new ClassFormatException("Invalid internal class name");
|
||||
|
||||
directoryPath = pathToClass.substring(0, index);
|
||||
} catch (FileNotFoundException e) {
|
||||
directoryPath = null;
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
directoryPath = null;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (dis != null)
|
||||
try {
|
||||
dis.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
|
||||
return directoryPath;
|
||||
}
|
||||
|
||||
public static String ExtractInternalPath(
|
||||
String directoryPath, String pathToClass) {
|
||||
if ((directoryPath == null) || (pathToClass == null) ||
|
||||
!pathToClass.startsWith(directoryPath))
|
||||
return null;
|
||||
|
||||
String s = pathToClass.substring(directoryPath.length());
|
||||
|
||||
return s.replace(File.separatorChar, StringConstants.INTERNAL_PACKAGE_SEPARATOR);
|
||||
}
|
||||
|
||||
private static Constant[] DeserializeConstants(DataInputStream dis)
|
||||
throws IOException {
|
||||
int count = dis.readUnsignedShort();
|
||||
if (count == 0)
|
||||
return null;
|
||||
|
||||
Constant[] constants = new Constant[count];
|
||||
|
||||
for (int i = 1; i < count; i++) {
|
||||
byte tag = dis.readByte();
|
||||
|
||||
switch (tag) {
|
||||
case ConstantConstant.CONSTANT_Class:
|
||||
constants[i] = new ConstantClass(tag, dis.readUnsignedShort());
|
||||
break;
|
||||
case ConstantConstant.CONSTANT_Utf8:
|
||||
constants[i] = new ConstantUtf8(tag, dis.readUTF());
|
||||
break;
|
||||
case ConstantConstant.CONSTANT_Long:
|
||||
case ConstantConstant.CONSTANT_Double:
|
||||
dis.read();
|
||||
dis.read();
|
||||
dis.read();
|
||||
dis.read();
|
||||
i++;
|
||||
case ConstantConstant.CONSTANT_Fieldref:
|
||||
case ConstantConstant.CONSTANT_Methodref:
|
||||
case ConstantConstant.CONSTANT_InterfaceMethodref:
|
||||
case ConstantConstant.CONSTANT_NameAndType:
|
||||
case ConstantConstant.CONSTANT_Integer:
|
||||
case ConstantConstant.CONSTANT_Float:
|
||||
dis.read();
|
||||
dis.read();
|
||||
case ConstantConstant.CONSTANT_String:
|
||||
dis.read();
|
||||
dis.read();
|
||||
break;
|
||||
default:
|
||||
//throw new ClassFormatException("Invalid constant pool entry");
|
||||
return constants;
|
||||
}
|
||||
}
|
||||
|
||||
return constants;
|
||||
}
|
||||
}
|
|
@ -634,7 +634,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||
|
||||
JD-GUI, a standalone graphical utility that displays Java sources from
|
||||
CLASS files
|
||||
Copyright (C) 2008-2015 Emmanuel Dupuy
|
||||
Copyright (C) 2008-2019 Emmanuel Dupuy
|
||||
|
||||
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
|
||||
|
@ -654,7 +654,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
JD-GUI Copyright (C) 2008-2015 Emmanuel Dupuy
|
||||
JD-GUI Copyright (C) 2008-2019 Emmanuel Dupuy
|
||||
This program 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.
|
|
@ -1,8 +1,21 @@
|
|||
package com.jhe.hexed;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.AdjustmentEvent;
|
||||
import java.awt.event.AdjustmentListener;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.MouseWheelListener;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollBar;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA. User: laullon Date: 08-abr-2003 Time: 13:21:09
|
||||
|
@ -12,11 +25,10 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
private static final long serialVersionUID = 2289328616534802372L;
|
||||
byte[] buff;
|
||||
public int cursor;
|
||||
protected static Font font = new Font("Monospaced", 0, 12);
|
||||
protected static Font font = new Font("Monospaced", Font.PLAIN, 12);
|
||||
protected int border = 2;
|
||||
public boolean DEBUG = false;
|
||||
private JPanel panel;
|
||||
private JScrollBar sb;
|
||||
private final JScrollBar sb;
|
||||
private int inicio = 0;
|
||||
private int lineas = 10;
|
||||
|
||||
|
@ -48,7 +60,7 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
p3.add(new JHexEditorASCII(this), BorderLayout.CENTER);
|
||||
p3.add(new Caja(), BorderLayout.NORTH);
|
||||
|
||||
panel = new JPanel();
|
||||
JPanel panel = new JPanel();
|
||||
panel.setLayout(new BorderLayout(1, 1));
|
||||
panel.add(p1, BorderLayout.CENTER);
|
||||
panel.add(p2, BorderLayout.WEST);
|
||||
|
@ -58,6 +70,7 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
this.add(panel, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
FontMetrics fn = getFontMetrics(font);
|
||||
Rectangle rec = this.getBounds();
|
||||
|
@ -73,23 +86,6 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
super.paint(g);
|
||||
}
|
||||
|
||||
protected void actualizaCursor() {
|
||||
int n = (cursor / 16);
|
||||
|
||||
System.out.print("- " + inicio + "<" + n + "<" + (lineas + inicio)
|
||||
+ "(" + lineas + ")");
|
||||
|
||||
if (n < inicio)
|
||||
inicio = n;
|
||||
else if (n >= inicio + lineas)
|
||||
inicio = n - (lineas - 1);
|
||||
|
||||
System.out.println(" - " + inicio + "<" + n + "<" + (lineas + inicio)
|
||||
+ "(" + lineas + ")");
|
||||
|
||||
repaint();
|
||||
}
|
||||
|
||||
protected int getInicio() {
|
||||
return inicio;
|
||||
}
|
||||
|
@ -118,14 +114,17 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
((fn.getHeight() * (y + 1)) - fn.getMaxDescent()) + border);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
inicio = e.getValue();
|
||||
if (inicio < 0)
|
||||
|
@ -133,6 +132,7 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseWheelMoved(MouseWheelEvent e) {
|
||||
inicio += (e.getUnitsToScroll());
|
||||
if ((inicio + lineas) >= buff.length / 16)
|
||||
|
@ -164,10 +164,12 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
this.setLayout(new BorderLayout(1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
Dimension d = new Dimension();
|
||||
FontMetrics fn = getFontMetrics(font);
|
||||
|
@ -178,6 +180,7 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
return d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
Dimension d = getMinimumSize();
|
||||
g.setColor(Color.white);
|
||||
|
@ -198,10 +201,12 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
private class Caja extends JPanel {
|
||||
private static final long serialVersionUID = -6124062720565016834L;
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
Dimension d = new Dimension();
|
||||
FontMetrics fn = getFontMetrics(font);
|
||||
|
@ -220,10 +225,12 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
this.setLayout(new BorderLayout(1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
Dimension d = new Dimension();
|
||||
FontMetrics fn = getFontMetrics(font);
|
||||
|
@ -234,6 +241,7 @@ public class JHexEditor extends JPanel implements FocusListener,
|
|||
return d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
Dimension d = getMinimumSize();
|
||||
g.setColor(Color.white);
|
|
@ -1,8 +1,14 @@
|
|||
package com.jhe.hexed;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA. User: laullon Date: 09-abr-2003 Time: 12:47:18
|
||||
|
@ -10,7 +16,7 @@ import java.awt.event.*;
|
|||
public class JHexEditorASCII extends JComponent implements MouseListener,
|
||||
KeyListener {
|
||||
private static final long serialVersionUID = 5505374841731053461L;
|
||||
private JHexEditor he;
|
||||
private final JHexEditor he;
|
||||
|
||||
public JHexEditorASCII(JHexEditor he) {
|
||||
this.he = he;
|
||||
|
@ -19,11 +25,13 @@ public class JHexEditorASCII extends JComponent implements MouseListener,
|
|||
addFocusListener(he);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
debug("getPreferredSize()");
|
||||
return getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
debug("getMinimumSize()");
|
||||
|
||||
|
@ -36,6 +44,7 @@ public class JHexEditorASCII extends JComponent implements MouseListener,
|
|||
return d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
debug("paint(" + g + ")");
|
||||
debug("cursor=" + he.cursor + " buff.length=" + he.buff.length);
|
||||
|
@ -96,6 +105,7 @@ public class JHexEditorASCII extends JComponent implements MouseListener,
|
|||
}
|
||||
|
||||
// mouselistener
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
debug("mouseClicked(" + e + ")");
|
||||
he.cursor = calcularPosicionRaton(e.getX(), e.getY());
|
||||
|
@ -103,19 +113,24 @@ public class JHexEditorASCII extends JComponent implements MouseListener,
|
|||
he.repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
}
|
||||
|
||||
// KeyListener
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e) {
|
||||
/*
|
||||
* debug("keyTyped("+e+")");
|
||||
|
@ -126,16 +141,25 @@ public class JHexEditorASCII extends JComponent implements MouseListener,
|
|||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
debug("keyPressed(" + e + ")");
|
||||
he.keyPressed(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
debug("keyReleased(" + e + ")");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean isFocusTraversable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusable() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,8 +1,14 @@
|
|||
package com.jhe.hexed;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA. User: laullon Date: 09-abr-2003 Time: 12:47:32
|
||||
|
@ -10,8 +16,7 @@ import java.awt.event.*;
|
|||
public class JHexEditorHEX extends JComponent implements MouseListener,
|
||||
KeyListener {
|
||||
private static final long serialVersionUID = 1481995655372014571L;
|
||||
private JHexEditor he;
|
||||
private int cursor = 0;
|
||||
private final JHexEditor he;
|
||||
|
||||
public JHexEditorHEX(JHexEditor he) {
|
||||
this.he = he;
|
||||
|
@ -25,6 +30,7 @@ public class JHexEditorHEX extends JComponent implements MouseListener,
|
|||
* getMinimumSize(); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
debug("getMaximumSize()");
|
||||
return getMinimumSize();
|
||||
|
@ -39,6 +45,7 @@ public class JHexEditorHEX extends JComponent implements MouseListener,
|
|||
* )*+((16*3)-1))+(he.border*2)+1,h*nl+(he.border*2)+1); return d; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
debug("paint(" + g + ")");
|
||||
debug("cursor=" + he.cursor + " buff.length=" + he.buff.length);
|
||||
|
@ -63,6 +70,7 @@ public class JHexEditorHEX extends JComponent implements MouseListener,
|
|||
g.setColor(Color.black);
|
||||
he.fondo(g, (x * 3), y, 2);
|
||||
g.setColor(Color.blue);
|
||||
int cursor = 0;
|
||||
he.fondo(g, (x * 3) + cursor, y, 1);
|
||||
} else {
|
||||
g.setColor(Color.blue);
|
||||
|
@ -102,6 +110,7 @@ public class JHexEditorHEX extends JComponent implements MouseListener,
|
|||
}
|
||||
|
||||
// mouselistener
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
debug("mouseClicked(" + e + ")");
|
||||
he.cursor = calcularPosicionRaton(e.getX(), e.getY());
|
||||
|
@ -109,19 +118,24 @@ public class JHexEditorHEX extends JComponent implements MouseListener,
|
|||
he.repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
}
|
||||
|
||||
// KeyListener
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e) {
|
||||
debug("keyTyped(" + e + ")");
|
||||
|
||||
|
@ -139,16 +153,25 @@ public class JHexEditorHEX extends JComponent implements MouseListener,
|
|||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
debug("keyPressed(" + e + ")");
|
||||
he.keyPressed(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
debug("keyReleased(" + e + ")");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean isFocusTraversable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocusable() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -2,13 +2,13 @@ package jd.cli;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import java.util.ServiceLoader;
|
||||
import jd.cli.loader.DirectoryLoader;
|
||||
import jd.cli.preferences.CommonPreferences;
|
||||
import jd.cli.printer.text.PlainTextPrinter;
|
||||
import jd.cli.util.ClassFileUtil;
|
||||
import jd.core.Decompiler;
|
||||
import jd.core.process.DecompilerImpl;
|
||||
import org.jd.core.v1.ClassFileToJavaSourceDecompiler;
|
||||
import org.jd.core.v1.api.Decompiler;
|
||||
|
||||
|
||||
public class Main {
|
||||
|
@ -40,8 +40,8 @@ public class Main {
|
|||
PrintStream ps = new PrintStream("test.txt");
|
||||
PlainTextPrinter printer = new PlainTextPrinter(preferences, ps);
|
||||
|
||||
Decompiler decompiler = new DecompilerImpl();
|
||||
decompiler.decompile(preferences, loader, printer, internalPath);
|
||||
Decompiler decompiler = new ClassFileToJavaSourceDecompiler();
|
||||
decompiler.decompile(loader, printer, internalPath, preferences.getPreferences());
|
||||
|
||||
System.out.println("done.");
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
package jd.cli.loader;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import jd.core.loader.Loader;
|
||||
import org.jd.core.v1.api.loader.Loader;
|
||||
|
||||
public abstract class BaseLoader implements Loader {
|
||||
protected String codebase;
|
|
@ -1,12 +1,11 @@
|
|||
package jd.cli.loader;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import jd.core.loader.LoaderException;
|
||||
import java.io.IOException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jd.core.v1.api.loader.LoaderException;
|
||||
|
||||
|
||||
public class DirectoryLoader extends BaseLoader {
|
||||
|
@ -17,19 +16,21 @@ public class DirectoryLoader extends BaseLoader {
|
|||
throw new LoaderException("'" + codebase + "' is not a directory");
|
||||
}
|
||||
|
||||
public DataInputStream load(String internalPath)
|
||||
@Override
|
||||
public byte[] load(String internalPath)
|
||||
throws LoaderException {
|
||||
File file = new File(this.codebase, internalPath);
|
||||
|
||||
try {
|
||||
return new DataInputStream(
|
||||
return IOUtils.toByteArray(
|
||||
new BufferedInputStream(new FileInputStream(file)));
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (IOException e) {
|
||||
throw new LoaderException(
|
||||
"'" + file.getAbsolutePath() + "' not found.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canLoad(String internalPath) {
|
||||
File file = new File(this.codebase, internalPath);
|
||||
return file.exists() && file.isFile();
|
|
@ -1,16 +1,15 @@
|
|||
package jd.cli.loader;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
import jd.core.loader.LoaderException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jd.core.v1.api.loader.LoaderException;
|
||||
|
||||
|
||||
public class JarLoader extends BaseLoader {
|
||||
private ZipFile zipFile;
|
||||
private final ZipFile zipFile;
|
||||
|
||||
public JarLoader(File file) throws LoaderException {
|
||||
super(file);
|
||||
|
@ -26,7 +25,8 @@ public class JarLoader extends BaseLoader {
|
|||
}
|
||||
}
|
||||
|
||||
public DataInputStream load(String internalPath)
|
||||
@Override
|
||||
public byte[] load(String internalPath)
|
||||
throws LoaderException {
|
||||
ZipEntry zipEntry = this.zipFile.getEntry(internalPath);
|
||||
|
||||
|
@ -35,12 +35,13 @@ public class JarLoader extends BaseLoader {
|
|||
}
|
||||
|
||||
try {
|
||||
return new DataInputStream(this.zipFile.getInputStream(zipEntry));
|
||||
return IOUtils.toByteArray(this.zipFile.getInputStream(zipEntry));
|
||||
} catch (IOException e) {
|
||||
throw new LoaderException("Error reading '" + internalPath + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canLoad(String internalPath) {
|
||||
return this.zipFile.getEntry(internalPath) != null;
|
||||
}
|
|
@ -3,8 +3,7 @@ package jd.cli.loader;
|
|||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import jd.core.loader.LoaderException;
|
||||
import org.jd.core.v1.api.loader.LoaderException;
|
||||
|
||||
public class LoaderManager {
|
||||
protected final static String JAR_SUFFIX = ".jar";
|
||||
|
@ -13,7 +12,7 @@ public class LoaderManager {
|
|||
protected Map<String, BaseLoader> map;
|
||||
|
||||
public LoaderManager() {
|
||||
this.map = new ConcurrentHashMap<String, BaseLoader>();
|
||||
this.map = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
public BaseLoader getLoader(String codebase) throws LoaderException {
|
|
@ -1,8 +1,12 @@
|
|||
package jd.cli.preferences;
|
||||
|
||||
import jd.core.preferences.Preferences;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CommonPreferences extends Preferences {
|
||||
public class CommonPreferences {
|
||||
private Map<String, Object> preferences;
|
||||
protected boolean showDefaultConstructor;
|
||||
protected boolean realignmentLineNumber;
|
||||
protected boolean showPrefixThis;
|
||||
protected boolean mergeEmptyLines;
|
||||
protected boolean unicodeEscape;
|
||||
|
@ -13,17 +17,28 @@ public class CommonPreferences extends Preferences {
|
|||
this.mergeEmptyLines = false;
|
||||
this.unicodeEscape = false;
|
||||
this.showLineNumbers = true;
|
||||
this.preferences = new HashMap<>();
|
||||
}
|
||||
|
||||
public CommonPreferences(
|
||||
boolean showDefaultConstructor, boolean realignmentLineNumber,
|
||||
boolean showPrefixThis, boolean mergeEmptyLines,
|
||||
boolean unicodeEscape, boolean showLineNumbers) {
|
||||
super(showDefaultConstructor, realignmentLineNumber);
|
||||
this.showDefaultConstructor = showDefaultConstructor;
|
||||
this.realignmentLineNumber = realignmentLineNumber;
|
||||
this.showPrefixThis = showPrefixThis;
|
||||
this.mergeEmptyLines = mergeEmptyLines;
|
||||
this.unicodeEscape = unicodeEscape;
|
||||
this.showLineNumbers = showLineNumbers;
|
||||
this.preferences = new HashMap<>();
|
||||
}
|
||||
|
||||
public boolean isShowDefaultConstructor() {
|
||||
return showDefaultConstructor;
|
||||
}
|
||||
|
||||
public boolean isRealignmentLineNumber() {
|
||||
return realignmentLineNumber;
|
||||
}
|
||||
|
||||
public boolean isShowPrefixThis() {
|
||||
|
@ -41,4 +56,8 @@ public class CommonPreferences extends Preferences {
|
|||
public boolean isShowLineNumbers() {
|
||||
return showLineNumbers;
|
||||
}
|
||||
|
||||
public Map<String, Object> getPreferences() {
|
||||
return preferences;
|
||||
}
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
package jd.cli.printer.html;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
import jd.cli.util.VersionUtil;
|
||||
import jd.core.CoreConstants;
|
||||
import jd.core.printer.Printer;
|
||||
import org.jd.core.v1.api.printer.Printer;
|
||||
|
||||
/*
|
||||
* CSS
|
||||
|
@ -32,9 +30,9 @@ import jd.core.printer.Printer;
|
|||
public class HtmlPrinter implements Printer {
|
||||
private final static boolean DEBUG = true;
|
||||
|
||||
private PrintStream printStream;
|
||||
private StringBuffer sbLineNumber;
|
||||
private StringBuffer sbCode;
|
||||
private final PrintStream printStream;
|
||||
private final StringBuffer sbLineNumber;
|
||||
private final StringBuffer sbCode;
|
||||
private int maxLineNumber;
|
||||
private int majorVersion;
|
||||
private int minorVersion;
|
||||
|
@ -51,58 +49,7 @@ public class HtmlPrinter implements Printer {
|
|||
this.sbCode = new StringBuffer(30 * 1024);
|
||||
}
|
||||
|
||||
public void print(byte b) {
|
||||
this.sbCode.append(String.valueOf(b));
|
||||
}
|
||||
|
||||
public void print(char c) {
|
||||
switch (c) {
|
||||
case '<':
|
||||
this.sbCode.append("<");
|
||||
break;
|
||||
case '>':
|
||||
this.sbCode.append(">");
|
||||
break;
|
||||
default:
|
||||
this.sbCode.append(String.valueOf(c));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void print(int i) {
|
||||
this.sbCode.append(String.valueOf(i));
|
||||
}
|
||||
|
||||
public void print(String s) {
|
||||
this.sbCode.append(s);
|
||||
}
|
||||
|
||||
public void printNumeric(String s) {
|
||||
this.sbCode.append("<u>");
|
||||
this.sbCode.append(s);
|
||||
this.sbCode.append("</u>");
|
||||
}
|
||||
|
||||
public void printString(String s, String scopeInternalName) {
|
||||
this.sbCode.append("<u>");
|
||||
|
||||
// Replace '<' by '<'
|
||||
int length = s.length();
|
||||
|
||||
if (length > 0) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
char c = s.charAt(i);
|
||||
|
||||
if (c == '<')
|
||||
this.sbCode.append("<");
|
||||
else
|
||||
this.sbCode.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
this.sbCode.append("</u>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printKeyword(String s) {
|
||||
if (this.commentJavadocErrorDepth == 0) {
|
||||
this.sbCode.append("<b>");
|
||||
|
@ -113,90 +60,15 @@ public class HtmlPrinter implements Printer {
|
|||
}
|
||||
}
|
||||
|
||||
public void printJavaWord(String s) {
|
||||
printKeyword(s);
|
||||
@Override
|
||||
public void printDeclaration(int i, String s, String s1, String s2) {
|
||||
}
|
||||
|
||||
public void printType(String internalName, String name, String scopeInternalName) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printTypeDeclaration(String internalName, String name) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printTypeImport(String internalName, String name) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printField(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printFieldDeclaration(internalName, name, descriptor);
|
||||
}
|
||||
|
||||
public void printFieldDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
this.sbCode.append("<var>");
|
||||
this.sbCode.append(name);
|
||||
this.sbCode.append("</var>");
|
||||
}
|
||||
|
||||
public void printStaticField(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printStaticFieldDeclaration(internalName, name, descriptor);
|
||||
}
|
||||
|
||||
public void printStaticFieldDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
this.sbCode.append("<em>");
|
||||
this.sbCode.append(name);
|
||||
this.sbCode.append("</em>");
|
||||
}
|
||||
|
||||
public void printConstructor(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printConstructorDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printStaticConstructorDeclaration(
|
||||
String internalName, String name) {
|
||||
this.sbCode.append("<samp>");
|
||||
this.sbCode.append(name);
|
||||
this.sbCode.append("</samp>");
|
||||
}
|
||||
|
||||
public void printMethod(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printMethodDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
this.sbCode.append(name);
|
||||
}
|
||||
|
||||
public void printStaticMethod(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printStaticMethodDeclaration(internalName, name, descriptor);
|
||||
}
|
||||
|
||||
public void printStaticMethodDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
this.sbCode.append("<samp>");
|
||||
this.sbCode.append(name);
|
||||
this.sbCode.append("</samp>");
|
||||
@Override
|
||||
public void printReference(int i, String s, String s1, String s2, String s3) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(int maxLineNumber, int majorVersion, int minorVersion) {
|
||||
this.maxLineNumber = maxLineNumber;
|
||||
this.majorVersion = majorVersion;
|
||||
|
@ -217,7 +89,7 @@ public class HtmlPrinter implements Printer {
|
|||
this.lineNumberFormatPrefix = "%" + digitCount + "d<br>";
|
||||
|
||||
StringBuilder sb = new StringBuilder(digitCount + 7);
|
||||
sb.append("%" + (digitCount + 1) + "d:");
|
||||
sb.append("%").append(digitCount + 1).append("d:");
|
||||
for (int i = 0; i < digitCount; i++) sb.append(' ');
|
||||
sb.append("<br>");
|
||||
this.unknownLineNumberPrefix = sb.toString();
|
||||
|
@ -228,9 +100,11 @@ public class HtmlPrinter implements Printer {
|
|||
"body,html{font-family:Lucida Grande,Lucida Sans Unicode,Arial,sans-serif;font-size:90%}" +
|
||||
|
||||
"#demo .out{background-color:#FFFFFF}" +
|
||||
"#demo .out .content{padding:0px;font-size:12px;font-family:courier new,courier;white-space:pre;border-radius:0 0 10px 10px}" +
|
||||
"#demo .out .content{padding:0px;font-size:12px;font-family:courier new,courier;"
|
||||
+ "white-space:pre;border-radius:0 0 10px 10px}" +
|
||||
"#demo .out .content .e{color:#FF0000;margin:10px}" +
|
||||
"#linenumber{float:left;margin:0;padding:1px 8px 5px 1px;border-style:solid;border-color:#888888;border-width:0 1px 0 0;color:#888888}" +
|
||||
"#linenumber{float:left;margin:0;padding:1px 8px 5px 1px;border-style:solid;"
|
||||
+ "border-color:#888888;border-width:0 1px 0 0;color:#888888}" +
|
||||
"#linenumber s{text-decoration:none}" +
|
||||
"#linenumber span{color:#FF0000;font-style:normal}" +
|
||||
"#javacode{padding:0 0 5px 0;margin:1px 5px 1px 5px;color:black}" +
|
||||
|
@ -248,13 +122,19 @@ public class HtmlPrinter implements Printer {
|
|||
"#javacode em{color:#0000c0;font-style:italic;line-height:1}" +
|
||||
"#javacode samp{font-style:italic;line-height:1}" +
|
||||
"#javacode .debuglayoutblock{color:#000000;background-color:#ccffff;border:1px solid #99eeee}" +
|
||||
"#javacode .debugseparatorlayoutblock{color:#000000;background-color:#ccffcc;border:1px solid #99ee99}" +
|
||||
"#javacode .debugstatementblocklayoutblock{color:#000000;background-color:#ffcccc;border:1px solid #ee9999}" +
|
||||
"#javacode .debugenumblocklayoutblock{color:#000000;background-color:#ffffcc;border:1px solid #eeee99}" +
|
||||
"#javacode .debugcommentdeprecatedlayoutblock{color:#000000;background-color:#fefefe;border:1px solid #e9e9e9}" +
|
||||
"#javacode .debugseparatorlayoutblock{color:#000000;background-color:#ccffcc;border:1px solid"
|
||||
+ " #99ee99}" +
|
||||
"#javacode .debugstatementblocklayoutblock{color:#000000;background-color:#ffcccc;border:1px "
|
||||
+ "solid #ee9999}" +
|
||||
"#javacode .debugenumblocklayoutblock{color:#000000;background-color:#ffffcc;border:1px solid"
|
||||
+ " #eeee99}" +
|
||||
"#javacode .debugcommentdeprecatedlayoutblock{color:#000000;background-color:#fefefe;"
|
||||
+ "border:1px solid #e9e9e9}" +
|
||||
"#javacode .debugmarker{color:#000000;background-color:#ffd2ff;border:1px solid #cfb2cf}" +
|
||||
"#javacode .debugcaseblocklayoutblock{color:#000000;background-color:#ffde66;border:1px solid #ff9a11}" +
|
||||
"#metadata{padding:5px;color:#444444;background-color:#EEEEEE;border-radius:0 0 10px 10px;font-size:11px}" +
|
||||
"#javacode .debugcaseblocklayoutblock{color:#000000;background-color:#ffde66;border:1px solid"
|
||||
+ " #ff9a11}" +
|
||||
"#metadata{padding:5px;color:#444444;background-color:#EEEEEE;border-radius:0 0 10px 10px;"
|
||||
+ "font-size:11px}" +
|
||||
|
||||
"</style>" +
|
||||
"</head><body>" +
|
||||
|
@ -262,36 +142,75 @@ public class HtmlPrinter implements Printer {
|
|||
"<div id='demo'><div class='out'><div class='content'>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end() {
|
||||
if (this.maxLineNumber > 0) {
|
||||
this.printStream.print("<div id='linenumber'>");
|
||||
this.printStream.print(this.sbLineNumber.toString());
|
||||
this.printStream.print(this.sbLineNumber);
|
||||
this.printStream.print("</div>");
|
||||
}
|
||||
|
||||
this.printStream.print("<div id='javacode'>");
|
||||
this.printStream.print(this.sbCode.toString());
|
||||
this.printStream.print(this.sbCode);
|
||||
this.printStream.print("</div>");
|
||||
|
||||
this.printStream.print("<div id='metadata'>");
|
||||
this.printStream.print("Java Class Version: " + VersionUtil.getJDKVersion(this.majorVersion, this.minorVersion) + "<br>");
|
||||
this.printStream.print("Java Class Version: " + VersionUtil.getJDKVersion(this.majorVersion,
|
||||
this.minorVersion) + "<br>");
|
||||
this.printStream.print("JD-CL Version: " + "0.1.0" + "<br>");
|
||||
this.printStream.print("JD-Core Version: " + CoreConstants.JD_CORE_VERSION);
|
||||
// TODO: Where can I find this dynamically?
|
||||
this.printStream.print("JD-Core Version: " + "1.6.6");
|
||||
this.printStream.print("</div>");
|
||||
|
||||
this.printStream.print("</div></div></div></body></html>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printText(String s) {
|
||||
this.sbCode.append(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printNumericConstant(String s) {
|
||||
this.sbCode.append("<u>");
|
||||
this.sbCode.append(s);
|
||||
this.sbCode.append("</u>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStringConstant(String s, String s1) {
|
||||
this.sbCode.append("<u>");
|
||||
|
||||
// Replace '<' by '<'
|
||||
int length = s.length();
|
||||
|
||||
if (length > 0) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
char c = s.charAt(i);
|
||||
|
||||
if (c == '<')
|
||||
this.sbCode.append("<");
|
||||
else
|
||||
this.sbCode.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
this.sbCode.append("</u>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void indent() {
|
||||
this.indentationCount++;
|
||||
}
|
||||
|
||||
public void desindent() {
|
||||
@Override
|
||||
public void unindent() {
|
||||
if (this.indentationCount > 0)
|
||||
this.indentationCount--;
|
||||
}
|
||||
|
||||
public void startOfLine(int lineNumber) {
|
||||
@Override
|
||||
public void startLine(int lineNumber) {
|
||||
this.realLineNumber++;
|
||||
|
||||
if (this.maxLineNumber > 0) {
|
||||
|
@ -318,10 +237,12 @@ public class HtmlPrinter implements Printer {
|
|||
this.sbCode.append(" ");
|
||||
}
|
||||
|
||||
public void endOfLine() {
|
||||
@Override
|
||||
public void endLine() {
|
||||
this.sbCode.append("<br>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extraLine(int count) {
|
||||
if (this.maxLineNumber > 0) {
|
||||
this.sbLineNumber.append("<s>");
|
||||
|
@ -345,159 +266,12 @@ public class HtmlPrinter implements Printer {
|
|||
this.sbCode.append("</s>");
|
||||
}
|
||||
|
||||
public void startOfComment() {
|
||||
this.sbCode.append("<cite>");
|
||||
this.commentJavadocErrorDepth++;
|
||||
@Override
|
||||
public void startMarker(int i) {
|
||||
}
|
||||
|
||||
public void endOfComment() {
|
||||
this.sbCode.append("</cite>");
|
||||
this.commentJavadocErrorDepth--;
|
||||
@Override
|
||||
public void endMarker(int i) {
|
||||
}
|
||||
|
||||
public void startOfJavadoc() {
|
||||
this.sbCode.append("<dfn>");
|
||||
this.commentJavadocErrorDepth++;
|
||||
}
|
||||
|
||||
public void endOfJavadoc() {
|
||||
this.sbCode.append("</dfn>");
|
||||
this.commentJavadocErrorDepth--;
|
||||
}
|
||||
|
||||
public void startOfXdoclet() {
|
||||
this.sbCode.append("<b>");
|
||||
}
|
||||
|
||||
public void endOfXdoclet() {
|
||||
this.sbCode.append("</b>");
|
||||
}
|
||||
|
||||
public void startOfError() {
|
||||
this.sbCode.append("<span>");
|
||||
this.commentJavadocErrorDepth++;
|
||||
}
|
||||
|
||||
public void endOfError() {
|
||||
this.sbCode.append("</span>");
|
||||
this.commentJavadocErrorDepth--;
|
||||
}
|
||||
|
||||
public void startOfImportStatements() {
|
||||
}
|
||||
|
||||
public void endOfImportStatements() {
|
||||
}
|
||||
|
||||
public void startOfTypeDeclaration(String internalPath) {
|
||||
}
|
||||
|
||||
public void endOfTypeDeclaration() {
|
||||
}
|
||||
|
||||
public void startOfAnnotationName() {
|
||||
this.sbCode.append("<del>");
|
||||
}
|
||||
|
||||
public void endOfAnnotationName() {
|
||||
this.sbCode.append("</del>");
|
||||
}
|
||||
|
||||
public void startOfOptionalPrefix() {
|
||||
this.sbCode.append("<kbd>");
|
||||
}
|
||||
|
||||
public void endOfOptionalPrefix() {
|
||||
this.sbCode.append("</kbd>");
|
||||
}
|
||||
|
||||
public void debugStartOfLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("<span class='debuglayoutblock' alt='block'>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugEndOfLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("</span>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugStartOfSeparatorLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("<span class='debugseparatorlayoutblock' alr='separator'>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugEndOfSeparatorLayoutBlock(int min, int value, int max) {
|
||||
if (DEBUG) {
|
||||
// DEBUG // this.sb.append(min);
|
||||
// DEBUG // this.sb.append("<=");
|
||||
// DEBUG // this.sb.append(value);
|
||||
// DEBUG // this.sb.append("<=");
|
||||
// DEBUG // this.sb.append(max);
|
||||
this.sbCode.append("</span>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugStartOfStatementsBlockLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("<span class='debugstatementblocklayoutblock' alt='statement'>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugEndOfStatementsBlockLayoutBlock(int min, int value, int max) {
|
||||
if (DEBUG) {
|
||||
// DEBUG // this.sb.append(min);
|
||||
// DEBUG // this.sb.append("<=");
|
||||
// DEBUG // this.sb.append(value);
|
||||
// DEBUG // this.sb.append("<=");
|
||||
// DEBUG // this.sb.append(max);
|
||||
this.sbCode.append("</span>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugStartOfInstructionBlockLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("<span class='debugenumblocklayoutblock' alt='numeric block'>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugEndOfInstructionBlockLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("</span>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugStartOfCommentDeprecatedLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("<span class='debugcommentdeprecatedlayoutblock' alt='comment deprecated'>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugEndOfCommentDeprecatedLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("</span>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugMarker(String marker) {
|
||||
if (DEBUG) {
|
||||
// DEBUG // this.sb.append("<span class='debugmarker'>");
|
||||
// DEBUG // this.sb.append(marker);
|
||||
// DEBUG // this.sb.append("</span>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugStartOfCaseBlockLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("<span class='debugcaseblocklayoutblock' alt='case block'>");
|
||||
}
|
||||
}
|
||||
|
||||
public void debugEndOfCaseBlockLayoutBlock() {
|
||||
if (DEBUG) {
|
||||
this.sbCode.append("</span>");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
package jd.cli.printer.text;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
import jd.cli.preferences.CommonPreferences;
|
||||
import jd.core.model.instruction.bytecode.instruction.Instruction;
|
||||
import jd.core.printer.Printer;
|
||||
import org.jd.core.v1.api.printer.Printer;
|
||||
|
||||
public class PlainTextPrinter implements Printer {
|
||||
protected static final String TAB = " ";
|
||||
|
@ -42,114 +40,24 @@ public class PlainTextPrinter implements Printer {
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
||||
|
||||
public void print(byte b) {
|
||||
this.printStream.append(String.valueOf(b));
|
||||
}
|
||||
|
||||
public void print(int i) {
|
||||
this.printStream.append(String.valueOf(i));
|
||||
}
|
||||
|
||||
public void print(char c) {
|
||||
if (this.display)
|
||||
this.printStream.append(String.valueOf(c));
|
||||
}
|
||||
|
||||
public void print(String s) {
|
||||
if (this.display)
|
||||
printEscape(s);
|
||||
}
|
||||
|
||||
public void printNumeric(String s) {
|
||||
this.printStream.append(s);
|
||||
}
|
||||
|
||||
public void printString(String s, String scopeInternalName) {
|
||||
this.printStream.append(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printKeyword(String s) {
|
||||
if (this.display)
|
||||
this.printStream.append(s);
|
||||
}
|
||||
|
||||
public void printJavaWord(String s) {
|
||||
this.printStream.append(s);
|
||||
}
|
||||
|
||||
public void printType(String internalName, String name, String scopeInternalName) {
|
||||
if (this.display)
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printTypeDeclaration(String internalName, String name) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printTypeImport(String internalName, String name) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printField(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printFieldDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printStaticField(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printStaticFieldDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printConstructor(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printConstructorDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printStaticConstructorDeclaration(
|
||||
String internalName, String name) {
|
||||
@Override
|
||||
public void printDeclaration(int type, String internalTypeName, String name, String descriptor) {
|
||||
this.printStream.append(name);
|
||||
}
|
||||
|
||||
public void printMethod(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printMethodDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printStaticMethod(
|
||||
String internalName, String name,
|
||||
String descriptor, String scopeInternalName) {
|
||||
printEscape(name);
|
||||
}
|
||||
|
||||
public void printStaticMethodDeclaration(
|
||||
String internalName, String name, String descriptor) {
|
||||
printEscape(name);
|
||||
@Override
|
||||
public void printReference(int type, String internalTypeName, String name, String descriptor,
|
||||
String ownerInternalName) {
|
||||
this.printStream.append(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(int maxLineNumber, int majorVersion, int minorVersion) {
|
||||
this.majorVersion = majorVersion;
|
||||
this.minorVersion = minorVersion;
|
||||
|
@ -161,15 +69,16 @@ public class PlainTextPrinter implements Printer {
|
|||
|
||||
if (maxLineNumber > 0) {
|
||||
this.digitCount = 1;
|
||||
this.unknownLineNumberPrefix = " ";
|
||||
StringBuilder unknownLineNumberPrefixBuilder = new StringBuilder(" ");
|
||||
int maximum = 9;
|
||||
|
||||
while (maximum < maxLineNumber) {
|
||||
this.digitCount++;
|
||||
this.unknownLineNumberPrefix += ' ';
|
||||
unknownLineNumberPrefixBuilder.append(' ');
|
||||
maximum = maximum * 10 + 9;
|
||||
}
|
||||
|
||||
this.unknownLineNumberPrefix = unknownLineNumberPrefixBuilder.toString();
|
||||
this.lineNumberBeginPrefix = "/* ";
|
||||
this.lineNumberEndPrefix = " */ ";
|
||||
} else {
|
||||
|
@ -185,23 +94,43 @@ public class PlainTextPrinter implements Printer {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printText(String s) {
|
||||
if (this.display)
|
||||
printEscape(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printNumericConstant(String s) {
|
||||
this.printStream.append(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStringConstant(String s, String s1) {
|
||||
this.printStream.append(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void indent() {
|
||||
this.indentationCount++;
|
||||
}
|
||||
|
||||
public void desindent() {
|
||||
@Override
|
||||
public void unindent() {
|
||||
if (this.indentationCount > 0)
|
||||
this.indentationCount--;
|
||||
}
|
||||
|
||||
public void startOfLine(int lineNumber) {
|
||||
@Override
|
||||
public void startLine(int lineNumber) {
|
||||
if (this.maxLineNumber > 0) {
|
||||
this.printStream.append(this.lineNumberBeginPrefix);
|
||||
|
||||
if (lineNumber == Instruction.UNKNOWN_LINE_NUMBER) {
|
||||
if (lineNumber == UNKNOWN_LINE_NUMBER) {
|
||||
this.printStream.append(this.unknownLineNumberPrefix);
|
||||
} else {
|
||||
int left = 0;
|
||||
|
@ -220,12 +149,14 @@ public class PlainTextPrinter implements Printer {
|
|||
this.printStream.append(TAB);
|
||||
}
|
||||
|
||||
public void endOfLine() {
|
||||
@Override
|
||||
public void endLine() {
|
||||
this.printStream.append(NEWLINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extraLine(int count) {
|
||||
if (this.preferences.isMergeEmptyLines() == false) {
|
||||
if (!this.preferences.isMergeEmptyLines()) {
|
||||
while (count-- > 0) {
|
||||
if (this.maxLineNumber > 0) {
|
||||
this.printStream.append(this.lineNumberBeginPrefix);
|
||||
|
@ -238,96 +169,12 @@ public class PlainTextPrinter implements Printer {
|
|||
}
|
||||
}
|
||||
|
||||
public void startOfComment() {
|
||||
@Override
|
||||
public void startMarker(int i) {
|
||||
}
|
||||
|
||||
public void endOfComment() {
|
||||
}
|
||||
|
||||
public void startOfJavadoc() {
|
||||
}
|
||||
|
||||
public void endOfJavadoc() {
|
||||
}
|
||||
|
||||
public void startOfXdoclet() {
|
||||
}
|
||||
|
||||
public void endOfXdoclet() {
|
||||
}
|
||||
|
||||
public void startOfError() {
|
||||
}
|
||||
|
||||
public void endOfError() {
|
||||
}
|
||||
|
||||
public void startOfImportStatements() {
|
||||
}
|
||||
|
||||
public void endOfImportStatements() {
|
||||
}
|
||||
|
||||
public void startOfTypeDeclaration(String internalPath) {
|
||||
}
|
||||
|
||||
public void endOfTypeDeclaration() {
|
||||
}
|
||||
|
||||
public void startOfAnnotationName() {
|
||||
}
|
||||
|
||||
public void endOfAnnotationName() {
|
||||
}
|
||||
|
||||
public void startOfOptionalPrefix() {
|
||||
if (this.preferences.isShowPrefixThis() == false)
|
||||
this.display = false;
|
||||
}
|
||||
|
||||
public void endOfOptionalPrefix() {
|
||||
this.display = true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
||||
|
||||
public void debugStartOfLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugEndOfLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugStartOfSeparatorLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugEndOfSeparatorLayoutBlock(int min, int value, int max) {
|
||||
}
|
||||
|
||||
public void debugStartOfStatementsBlockLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugEndOfStatementsBlockLayoutBlock(int min, int value, int max) {
|
||||
}
|
||||
|
||||
public void debugStartOfInstructionBlockLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugEndOfInstructionBlockLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugStartOfCommentDeprecatedLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugEndOfCommentDeprecatedLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugMarker(String marker) {
|
||||
}
|
||||
|
||||
public void debugStartOfCaseBlockLayoutBlock() {
|
||||
}
|
||||
|
||||
public void debugEndOfCaseBlockLayoutBlock() {
|
||||
@Override
|
||||
public void endMarker(int i) {
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
|
||||
|
@ -340,7 +187,7 @@ public class PlainTextPrinter implements Printer {
|
|||
char c = s.charAt(i);
|
||||
|
||||
if (c == '\t') {
|
||||
this.printStream.append(c);
|
||||
this.printStream.append('\t');
|
||||
} else if (c < 32) {
|
||||
// Write octal format
|
||||
this.printStream.append("\\0");
|
140
src/main/java/jd/cli/util/ClassFileUtil.java
Normal file
140
src/main/java/jd/cli/util/ClassFileUtil.java
Normal file
|
@ -0,0 +1,140 @@
|
|||
package jd.cli.util;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import org.jd.core.v1.model.classfile.constant.Constant;
|
||||
import org.jd.core.v1.model.classfile.constant.ConstantClass;
|
||||
import org.jd.core.v1.model.classfile.constant.ConstantUtf8;
|
||||
import org.jd.core.v1.service.deserializer.classfile.ClassFileFormatException;
|
||||
import org.jd.core.v1.service.deserializer.classfile.ClassFileReader;
|
||||
|
||||
|
||||
public class ClassFileUtil {
|
||||
public static final char INTERNAL_PACKAGE_SEPARATOR = '/';
|
||||
public static final String CLASS_FILE_SUFFIX = ".class";
|
||||
|
||||
/*
|
||||
* Lecture rapide de la structure de la classe et extraction du nom du
|
||||
* repoertoire de base.
|
||||
*/
|
||||
public static String ExtractDirectoryPath(String pathToClass) {
|
||||
DataInputStream dis = null;
|
||||
String directoryPath;
|
||||
|
||||
try {
|
||||
dis = new DataInputStream(
|
||||
new BufferedInputStream(
|
||||
new FileInputStream(pathToClass)));
|
||||
|
||||
int magic = dis.readInt();
|
||||
if (magic != ClassFileReader.JAVA_MAGIC_NUMBER)
|
||||
throw new ClassFileFormatException("Invalid Java .class file");
|
||||
|
||||
/* int minor_version = */
|
||||
dis.readUnsignedShort();
|
||||
/* int major_version = */
|
||||
dis.readUnsignedShort();
|
||||
|
||||
Constant[] constants = DeserializeConstants(dis);
|
||||
|
||||
/* int access_flags = */
|
||||
dis.readUnsignedShort();
|
||||
int this_class = dis.readUnsignedShort();
|
||||
|
||||
if (this_class > Objects.requireNonNull(constants).length) {
|
||||
throw new ClassFileFormatException("Unknown Java structure");
|
||||
}
|
||||
Constant c = constants[this_class];
|
||||
if ((c == null) || (c.getTag() != Constant.CONSTANT_Class))
|
||||
throw new ClassFileFormatException("Invalid constant pool");
|
||||
|
||||
c = constants[((ConstantClass) c).getNameIndex()];
|
||||
if ((c == null) || (c.getTag() != Constant.CONSTANT_Utf8))
|
||||
throw new ClassFileFormatException("Invalid constant pool");
|
||||
|
||||
String internalClassName = ((ConstantUtf8) c).getValue();
|
||||
String pathSuffix = internalClassName.replace(
|
||||
INTERNAL_PACKAGE_SEPARATOR, File.separatorChar) +
|
||||
CLASS_FILE_SUFFIX;
|
||||
|
||||
int index = pathToClass.indexOf(pathSuffix);
|
||||
|
||||
if (index < 0)
|
||||
throw new ClassFileFormatException("Invalid internal class name");
|
||||
|
||||
directoryPath = pathToClass.substring(0, index);
|
||||
} catch (IOException e) {
|
||||
directoryPath = null;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (dis != null)
|
||||
try {
|
||||
dis.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
return directoryPath;
|
||||
}
|
||||
|
||||
public static String ExtractInternalPath(
|
||||
String directoryPath, String pathToClass) {
|
||||
if ((directoryPath == null) || (pathToClass == null) ||
|
||||
!pathToClass.startsWith(directoryPath))
|
||||
return null;
|
||||
|
||||
String s = pathToClass.substring(directoryPath.length());
|
||||
|
||||
return s.replace(File.separatorChar, INTERNAL_PACKAGE_SEPARATOR);
|
||||
}
|
||||
|
||||
private static Constant[] DeserializeConstants(DataInputStream dis)
|
||||
throws IOException {
|
||||
int count = dis.readUnsignedShort();
|
||||
if (count == 0)
|
||||
return null;
|
||||
|
||||
Constant[] constants = new Constant[count];
|
||||
|
||||
for (int i = 1; i < count; i++) {
|
||||
byte tag = dis.readByte();
|
||||
|
||||
switch (tag) {
|
||||
case Constant.CONSTANT_Class:
|
||||
constants[i] = new ConstantClass(dis.readUnsignedShort());
|
||||
break;
|
||||
case Constant.CONSTANT_Utf8:
|
||||
constants[i] = new ConstantUtf8(dis.readUTF());
|
||||
break;
|
||||
case Constant.CONSTANT_Long:
|
||||
case Constant.CONSTANT_Double:
|
||||
dis.read();
|
||||
dis.read();
|
||||
dis.read();
|
||||
dis.read();
|
||||
i++;
|
||||
case Constant.CONSTANT_FieldRef:
|
||||
case Constant.CONSTANT_MethodRef:
|
||||
case Constant.CONSTANT_InterfaceMethodRef:
|
||||
case Constant.CONSTANT_NameAndType:
|
||||
case Constant.CONSTANT_Integer:
|
||||
case Constant.CONSTANT_Float:
|
||||
dis.read();
|
||||
dis.read();
|
||||
case Constant.CONSTANT_String:
|
||||
dis.read();
|
||||
dis.read();
|
||||
break;
|
||||
default:
|
||||
//throw new ClassFormatException("Invalid constant pool entry");
|
||||
return constants;
|
||||
}
|
||||
}
|
||||
|
||||
return constants;
|
||||
}
|
||||
}
|
|
@ -1,10 +1,12 @@
|
|||
package jd.cli.util;
|
||||
|
||||
import jd.core.util.TypeNameUtil;
|
||||
|
||||
public class CommonTypeNameUtil {
|
||||
public static String InternalPathToQualifiedTypeName(String internalPath) {
|
||||
String internalTypeName = internalPath.substring(0, internalPath.length() - 6);
|
||||
return TypeNameUtil.InternalTypeNameToQualifiedTypeName(internalTypeName);
|
||||
return InternalTypeNameToQualifiedTypeName(internalTypeName);
|
||||
}
|
||||
|
||||
public static String InternalTypeNameToQualifiedTypeName(String path) {
|
||||
return path.replace('/', '.').replace('$', '.');
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@ package jd.cli.util;
|
|||
|
||||
public class VersionUtil {
|
||||
public static String getJDKVersion(int majorVersion, int minorVersion) {
|
||||
StringBuffer sb = new StringBuffer(20);
|
||||
StringBuilder sb = new StringBuilder(20);
|
||||
|
||||
if (majorVersion >= 49) {
|
||||
sb.append(majorVersion - (49 - 5));
|
|
@ -1,13 +1,12 @@
|
|||
package me.konloch.kontainer.io;
|
||||
|
||||
import the.bytecode.club.bytecodeviewer.util.EncodeUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
import the.bytecode.club.bytecodeviewer.util.EncodeUtils;
|
||||
|
||||
/**
|
||||
* Used to load from the disk, optional caching
|
||||
|
@ -18,14 +17,14 @@ import java.util.Random;
|
|||
public class DiskReader {
|
||||
|
||||
public static Random random = new Random();
|
||||
public static HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();
|
||||
public static HashMap<String, ArrayList<String>> map = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Used to load from file, allows caching
|
||||
*/
|
||||
public synchronized static ArrayList<String> loadArrayList(String fileName,
|
||||
boolean cache) {
|
||||
ArrayList<String> array = new ArrayList<String>();
|
||||
ArrayList<String> array = new ArrayList<>();
|
||||
if (!map.containsKey(fileName)) {
|
||||
try {
|
||||
File file = new File(fileName);
|
||||
|
@ -59,7 +58,7 @@ public class DiskReader {
|
|||
public synchronized static String loadAsString(String fileName) throws Exception {
|
||||
StringBuilder s = new StringBuilder();
|
||||
|
||||
BufferedReader reader = new BufferedReader(new FileReader(new File(fileName)));
|
||||
BufferedReader reader = new BufferedReader(new FileReader(fileName));
|
||||
|
||||
for (String add = reader.readLine(); add != null; add = reader.readLine()) {
|
||||
s.append(EncodeUtils.unicodeToString(add)).append(System.getProperty("line.separator"));
|
||||
|
@ -78,7 +77,7 @@ public class DiskReader {
|
|||
|
||||
ArrayList<String> array;
|
||||
if (!map.containsKey(fileName)) {
|
||||
array = new ArrayList<String>();
|
||||
array = new ArrayList<>();
|
||||
File file = new File(fileName);
|
||||
|
||||
BufferedReader reader = new BufferedReader(new FileReader(file));
|
|
@ -4,6 +4,7 @@ import java.io.BufferedWriter;
|
|||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* This method will save to disk
|
||||
|
@ -19,24 +20,24 @@ public class DiskWriter {
|
|||
* @param fileName The file name
|
||||
* @param difference Normally an integer
|
||||
* @return The filename with the difference inserted and the file extension
|
||||
* preserved
|
||||
* preserved
|
||||
*/
|
||||
public static String insertFileName(String fileName, String difference) {
|
||||
String[] babe = fileName.split("\\.");
|
||||
int count = 0;
|
||||
int math = babe.length;
|
||||
String m = "";
|
||||
StringBuilder m = new StringBuilder();
|
||||
|
||||
for (String s2 : babe) {
|
||||
m += s2;
|
||||
m.append(s2);
|
||||
if (math - 2 == count)
|
||||
m += difference + ".";
|
||||
m.append(difference).append(".");
|
||||
else if (math - 1 != count)
|
||||
m += ".";
|
||||
m.append(".");
|
||||
count++;
|
||||
}
|
||||
|
||||
return m;
|
||||
return m.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,7 +59,7 @@ public class DiskWriter {
|
|||
try {
|
||||
writer = new PrintWriter(new BufferedWriter(new FileWriter(
|
||||
filename, true)));
|
||||
writer.println(fileContents);
|
||||
writer.println(Arrays.toString(fileContents));
|
||||
if (debug)
|
||||
System.out.println("Saved " + filename + " to disk");
|
||||
saved = true;
|
||||
|
@ -135,7 +136,7 @@ public class DiskWriter {
|
|||
try {
|
||||
writer = new PrintWriter(new BufferedWriter(new FileWriter(
|
||||
filename, true)));
|
||||
writer.println(fileContents);
|
||||
writer.println(Arrays.toString(fileContents));
|
||||
if (debug)
|
||||
System.out.println("Saved " + filename + " to disk");
|
||||
saved = true;
|
|
@ -141,7 +141,7 @@ public class HTTPRequest {
|
|||
try {
|
||||
setup();
|
||||
|
||||
st = new ArrayList<String>();
|
||||
st = new ArrayList<>();
|
||||
String s;
|
||||
while ((s = reader.readLine()) != null)
|
||||
st.add(s);
|
||||
|
@ -154,7 +154,7 @@ public class HTTPRequest {
|
|||
cleanup();
|
||||
}
|
||||
|
||||
return st.toArray(new String[st.size()]);
|
||||
return st.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,7 +170,7 @@ public class HTTPRequest {
|
|||
try {
|
||||
setup();
|
||||
|
||||
st = new ArrayList<String>();
|
||||
st = new ArrayList<>();
|
||||
for (int i = 0; i < linesToRead; i++) {
|
||||
String s = reader.readLine();
|
||||
if (s != null)
|
||||
|
@ -185,7 +185,7 @@ public class HTTPRequest {
|
|||
cleanup();
|
||||
}
|
||||
|
||||
return st.toArray(new String[st.size()]);
|
||||
return st.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,15 +248,15 @@ public class HTTPRequest {
|
|||
private void cleanup() {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
try {
|
||||
writer.close();
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
try {
|
||||
connection.disconnect();
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
reader = null;
|
||||
writer = null;
|
|
@ -2,7 +2,6 @@ package the.bytecode.club.bootloader;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import the.bytecode.club.bootloader.resource.ExternalResource;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -30,7 +29,7 @@ import the.bytecode.club.bootloader.resource.ExternalResource;
|
|||
public final class AbstractLoaderFactory {
|
||||
|
||||
private static final String DEFAULT_KEY = "default-factory";
|
||||
private static final Map<String, LoaderFactory<?>> FACTORYCACHE = new HashMap<String, LoaderFactory<?>>();
|
||||
private static final Map<String, LoaderFactory<?>> FACTORY_CACHE = new HashMap<>();
|
||||
|
||||
public static void register(LoaderFactory<?> factory) {
|
||||
register(DEFAULT_KEY, factory);
|
||||
|
@ -41,11 +40,11 @@ public final class AbstractLoaderFactory {
|
|||
throw new IllegalArgumentException("null key or factory");
|
||||
}
|
||||
|
||||
if (FACTORYCACHE.containsKey(key)) {
|
||||
if (FACTORY_CACHE.containsKey(key)) {
|
||||
throw new IllegalArgumentException("factory already registered with key: " + key);
|
||||
}
|
||||
|
||||
FACTORYCACHE.put(key, factory);
|
||||
FACTORY_CACHE.put(key, factory);
|
||||
}
|
||||
|
||||
public static void unregister(String key) {
|
||||
|
@ -53,11 +52,11 @@ public final class AbstractLoaderFactory {
|
|||
throw new IllegalArgumentException("null key");
|
||||
}
|
||||
|
||||
if (!FACTORYCACHE.containsKey(key)) {
|
||||
if (!FACTORY_CACHE.containsKey(key)) {
|
||||
throw new IllegalArgumentException("factory doesn't key for key: " + key);
|
||||
}
|
||||
|
||||
FACTORYCACHE.remove(key);
|
||||
FACTORY_CACHE.remove(key);
|
||||
}
|
||||
|
||||
public static <T extends ExternalResource<?>> LoaderFactory<T> find() {
|
||||
|
@ -70,10 +69,10 @@ public final class AbstractLoaderFactory {
|
|||
throw new IllegalArgumentException("null key");
|
||||
}
|
||||
|
||||
if (!FACTORYCACHE.containsKey(key)) {
|
||||
if (!FACTORY_CACHE.containsKey(key)) {
|
||||
throw new IllegalArgumentException("factory doesn't key for key: " + key);
|
||||
}
|
||||
|
||||
return (LoaderFactory<T>) FACTORYCACHE.get(key);
|
||||
return (LoaderFactory<T>) FACTORY_CACHE.get(key);
|
||||
}
|
||||
}
|
|
@ -6,18 +6,16 @@ import java.io.InputStream;
|
|||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.Objects;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import me.konloch.kontainer.io.HTTPRequest;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import the.bytecode.club.bootloader.resource.EmptyExternalResource;
|
||||
import the.bytecode.club.bootloader.resource.ExternalResource;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.util.ZipUtils;
|
||||
import the.bytecode.club.bytecodeviewer.api.ExceptionUI;
|
||||
import the.bytecode.club.bytecodeviewer.util.ZipUtils;
|
||||
|
||||
/***************************************************************************
|
||||
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
|
||||
|
@ -50,9 +48,9 @@ public class Boot {
|
|||
public static boolean downloading = false;
|
||||
|
||||
private static InitialBootScreen screen;
|
||||
private static List<String> libsList = new ArrayList<String>();
|
||||
private static List<String> libsFileList = new ArrayList<String>();
|
||||
private static List<String> urlList = new ArrayList<String>();
|
||||
private static final List<String> libsList = new ArrayList<>();
|
||||
private static final List<String> libsFileList = new ArrayList<>();
|
||||
private static final List<String> urlList = new ArrayList<>();
|
||||
|
||||
static {
|
||||
try {
|
||||
|
@ -62,36 +60,20 @@ public class Boot {
|
|||
}
|
||||
}
|
||||
|
||||
public static void boot(String[] args, boolean CLI) throws Exception
|
||||
{
|
||||
public static void boot(String[] args, boolean CLI) throws Exception {
|
||||
bootstrap();
|
||||
ILoader<?> loader = findLoader();
|
||||
|
||||
if (!CLI)
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
screen.setVisible(true);
|
||||
}
|
||||
});
|
||||
SwingUtilities.invokeLater(() -> screen.setVisible(true));
|
||||
|
||||
create(loader, args.length > 0 ? Boolean.valueOf(args[0]) : true);
|
||||
create(loader, args.length <= 0 || Boolean.parseBoolean(args[0]));
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
screen.setVisible(false);
|
||||
}
|
||||
});
|
||||
SwingUtilities.invokeLater(() -> screen.setVisible(false));
|
||||
}
|
||||
|
||||
public static void hide() {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
screen.setVisible(false);
|
||||
}
|
||||
});
|
||||
SwingUtilities.invokeLater(() -> screen.setVisible(false));
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
|
@ -108,7 +90,9 @@ public class Boot {
|
|||
}
|
||||
|
||||
if (urlList.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(null, "Bytecode Viewer ran into an issue, for some reason github is not returning what we're expecting. Please try rebooting, if this issue persists please contact @Konloch.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
JOptionPane.showMessageDialog(null, "Bytecode Viewer ran into an issue, for some reason github is not "
|
||||
+ "returning what we're expecting. Please try rebooting, if this issue persists please contact "
|
||||
+ "@Konloch.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -125,7 +109,8 @@ public class Boot {
|
|||
int completedCheck = 0;
|
||||
|
||||
for (String s : urlList) {
|
||||
String fileName = s.substring("https://github.com/Konloch/bytecode-viewer/blob/master/libs/".length(), s.length());
|
||||
String fileName = s.substring("https://github.com/Konloch/bytecode-viewer/blob/master/libs/".length()
|
||||
);
|
||||
File file = new File(libsDirectory, fileName);
|
||||
|
||||
boolean passed = false;
|
||||
|
@ -177,9 +162,8 @@ public class Boot {
|
|||
System.out.println("Verifying " + fileName + "...");
|
||||
|
||||
File f = new File(BytecodeViewer.tempDirectory, "temp");
|
||||
if(!f.exists())
|
||||
{
|
||||
f.getParentFile().mkdirs();
|
||||
if (!f.exists()) {
|
||||
f.getParentFile().mkdirs();
|
||||
}
|
||||
ZipUtils.zipFile(file, f);
|
||||
f.delete();
|
||||
|
@ -223,7 +207,9 @@ public class Boot {
|
|||
File f = new File(s);
|
||||
boolean delete = true;
|
||||
for (String urlS : urlList) {
|
||||
String fileName = urlS.substring("https://github.com/Konloch/bytecode-viewer/blob/master/libs/".length(), urlS.length());
|
||||
String fileName =
|
||||
urlS.substring("https://github.com/Konloch/bytecode-viewer/blob/master/libs/".length()
|
||||
);
|
||||
if (fileName.equals(f.getName()))
|
||||
delete = false;
|
||||
}
|
||||
|
@ -244,13 +230,14 @@ public class Boot {
|
|||
System.out.println("Loading library " + f.getName());
|
||||
|
||||
try {
|
||||
ExternalResource res = new EmptyExternalResource<Object>(f.toURI().toURL());
|
||||
ExternalResource res = new EmptyExternalResource<>(f.toURI().toURL());
|
||||
loader.bind(res);
|
||||
System.out.println("Succesfully loaded " + f.getName());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
f.delete();
|
||||
JOptionPane.showMessageDialog(null, "Error, Library " + f.getName() + " is corrupt, please restart to redownload it.",
|
||||
JOptionPane.showMessageDialog(null, "Error, Library " + f.getName() + " is corrupt, please "
|
||||
+ "restart to redownload it.",
|
||||
"Error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
@ -293,12 +280,7 @@ public class Boot {
|
|||
}
|
||||
|
||||
private static void bootstrap() {
|
||||
AbstractLoaderFactory.register(new LoaderFactory<Object>() {
|
||||
@Override
|
||||
public ILoader<Object> spawnLoader() {
|
||||
return new ClassPathLoader();
|
||||
}
|
||||
});
|
||||
AbstractLoaderFactory.register(ClassPathLoader::new);
|
||||
}
|
||||
|
||||
public static void populateUrlList() throws Exception {
|
||||
|
@ -311,38 +293,38 @@ public class Boot {
|
|||
}
|
||||
|
||||
public static void populateLibsDirectory() {
|
||||
if (libsDir() != null && libsDir().exists())
|
||||
for (File f : libsDir().listFiles()) {
|
||||
File libsDir = libsDir();
|
||||
if (libsDir.exists())
|
||||
for (File f : Objects.requireNonNull(libsDir.listFiles())) {
|
||||
libsList.add(f.getName());
|
||||
libsFileList.add(f.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
public static void dropKrakatau()
|
||||
{
|
||||
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion + ".zip");
|
||||
public static void dropKrakatau() {
|
||||
File temp =
|
||||
new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion + ".zip");
|
||||
File krakatauDirectory = new File(BytecodeViewer.krakatauWorkingDirectory);
|
||||
BytecodeViewer.krakatauWorkingDirectory = BytecodeViewer.krakatauWorkingDirectory + BytecodeViewer.fs + "Krakatau-master";
|
||||
if (!krakatauDirectory.exists() || temp.exists())
|
||||
{
|
||||
if(temp.exists())
|
||||
BytecodeViewer.krakatauWorkingDirectory = BytecodeViewer.krakatauWorkingDirectory + BytecodeViewer.fs +
|
||||
"Krakatau-master";
|
||||
if (!krakatauDirectory.exists() || temp.exists()) {
|
||||
if (temp.exists())
|
||||
temp.delete();
|
||||
|
||||
setState("Bytecode Viewer Boot Screen - Extracting Krakatau");
|
||||
System.out.println("Extracting Krakatau");
|
||||
try
|
||||
{
|
||||
try {
|
||||
|
||||
while (temp.exists())
|
||||
temp.delete();
|
||||
|
||||
InputStream is = BytecodeViewer.class.getClassLoader().getResourceAsStream("Krakatau-" + BytecodeViewer.krakatauVersion + ".zip");
|
||||
InputStream is =
|
||||
BytecodeViewer.class.getClassLoader().getResourceAsStream("Krakatau-" + BytecodeViewer.krakatauVersion + ".zip");
|
||||
FileOutputStream baos = new FileOutputStream(temp);
|
||||
|
||||
int r = 0;
|
||||
int r;
|
||||
byte[] buffer = new byte[8192];
|
||||
while ((r = is.read(buffer)) >= 0)
|
||||
{
|
||||
while ((r = Objects.requireNonNull(is).read(buffer)) >= 0) {
|
||||
baos.write(buffer, 0, r);
|
||||
}
|
||||
|
||||
|
@ -350,39 +332,36 @@ public class Boot {
|
|||
ZipUtils.unzipFilesToPath(temp.getAbsolutePath(), krakatauDirectory.getAbsolutePath());
|
||||
temp.delete();
|
||||
System.out.println("Succesfully extracted Krakatau");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
setState("Bytecode Viewer Boot Screen - ERROR, please contact @Konloch with your stacktrace.");
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void dropEnjarify()
|
||||
{
|
||||
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify" + BytecodeViewer.enjarifyVersion + ".zip");
|
||||
public static void dropEnjarify() {
|
||||
File temp =
|
||||
new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify" + BytecodeViewer.enjarifyVersion + ".zip");
|
||||
File enjarifyDirectory = new File(BytecodeViewer.enjarifyWorkingDirectory);
|
||||
BytecodeViewer.enjarifyWorkingDirectory = BytecodeViewer.enjarifyWorkingDirectory + BytecodeViewer.fs + "enjarify-master";
|
||||
if (!enjarifyDirectory.exists() || temp.exists())
|
||||
{
|
||||
if(temp.exists())
|
||||
BytecodeViewer.enjarifyWorkingDirectory = BytecodeViewer.enjarifyWorkingDirectory + BytecodeViewer.fs +
|
||||
"enjarify-master";
|
||||
if (!enjarifyDirectory.exists() || temp.exists()) {
|
||||
if (temp.exists())
|
||||
temp.delete();
|
||||
setState("Bytecode Viewer Boot Screen - Extracting Enjarify");
|
||||
System.out.println("Extracting Enjarify");
|
||||
try
|
||||
{
|
||||
try {
|
||||
|
||||
while (temp.exists())
|
||||
temp.delete();
|
||||
|
||||
InputStream is = BytecodeViewer.class.getClassLoader().getResourceAsStream("enjarify-" + BytecodeViewer.enjarifyVersion + ".zip");
|
||||
InputStream is =
|
||||
BytecodeViewer.class.getClassLoader().getResourceAsStream("enjarify-" + BytecodeViewer.enjarifyVersion + ".zip");
|
||||
FileOutputStream baos = new FileOutputStream(temp);
|
||||
|
||||
int r = 0;
|
||||
int r;
|
||||
byte[] buffer = new byte[8192];
|
||||
while ((r = is.read(buffer)) >= 0)
|
||||
{
|
||||
while ((r = Objects.requireNonNull(is).read(buffer)) >= 0) {
|
||||
baos.write(buffer, 0, r);
|
||||
}
|
||||
|
||||
|
@ -390,9 +369,7 @@ public class Boot {
|
|||
ZipUtils.unzipFilesToPath(temp.getAbsolutePath(), enjarifyDirectory.getAbsolutePath());
|
||||
temp.delete();
|
||||
System.out.println("Succesfully extracted Enjarify");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
setState("Bytecode Viewer Boot Screen - ERROR, please contact @Konloch with your stacktrace.");
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
}
|
||||
|
@ -401,7 +378,8 @@ public class Boot {
|
|||
|
||||
public static void downloadZipsOnly() throws Exception {
|
||||
for (String s : urlList) {
|
||||
String fileName = s.substring("https://github.com/Konloch/bytecode-viewer/blob/master/libs/".length(), s.length());
|
||||
String fileName = s.substring("https://github.com/Konloch/bytecode-viewer/blob/master/libs/".length()
|
||||
);
|
||||
File file = new File(libsDir(), fileName);
|
||||
|
||||
boolean passed = false;
|
||||
|
@ -476,14 +454,14 @@ public class Boot {
|
|||
setState("Bytecode Viewer Boot Screen - Checking Enjarify...");
|
||||
System.out.println("Checking enjarify");
|
||||
File enjarifyZip = null;
|
||||
for (File f : new File(BytecodeViewer.libsDirectory).listFiles()) {
|
||||
for (File f : Objects.requireNonNull(new File(BytecodeViewer.libsDirectory).listFiles())) {
|
||||
if (f.getName().toLowerCase().startsWith("enjarify-")) {
|
||||
BytecodeViewer.enjarifyVersion = f.getName().split("-")[1].split("\\.")[0];
|
||||
enjarifyZip = f;
|
||||
}
|
||||
}
|
||||
|
||||
for (File f : new File(BytecodeViewer.getBCVDirectory()).listFiles()) {
|
||||
for (File f : Objects.requireNonNull(new File(BytecodeViewer.getBCVDirectory()).listFiles())) {
|
||||
if (f.getName().toLowerCase().startsWith("enjarify_") && !f.getName().split("_")[1].split("\\.")[0].equals(BytecodeViewer.enjarifyVersion)) {
|
||||
setState("Bytecode Viewer Boot Screen - Removing Outdated " + f.getName() + "...");
|
||||
System.out.println("Removing oudated " + f.getName());
|
||||
|
@ -495,18 +473,22 @@ public class Boot {
|
|||
}
|
||||
}
|
||||
|
||||
BytecodeViewer.enjarifyWorkingDirectory = BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify_" + BytecodeViewer.enjarifyVersion + BytecodeViewer.fs + "enjarify-master";
|
||||
File enjarifyDirectory = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify_" + BytecodeViewer.enjarifyVersion);
|
||||
BytecodeViewer.enjarifyWorkingDirectory =
|
||||
BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify_" + BytecodeViewer.enjarifyVersion + BytecodeViewer.fs + "enjarify-master";
|
||||
File enjarifyDirectory =
|
||||
new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify_" + BytecodeViewer.enjarifyVersion);
|
||||
if (!enjarifyDirectory.exists()) {
|
||||
try {
|
||||
setState("Bytecode Viewer Boot Screen - Updating to " + enjarifyDirectory.getName() + "...");
|
||||
ZipUtils.unzipFilesToPath(enjarifyZip.getAbsolutePath(), enjarifyDirectory.getAbsolutePath());
|
||||
ZipUtils.unzipFilesToPath(Objects.requireNonNull(enjarifyZip).getAbsolutePath(),
|
||||
enjarifyDirectory.getAbsolutePath());
|
||||
System.out.println("Updated to enjarify v" + BytecodeViewer.enjarifyVersion);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.showMessage("ERROR: There was an issue unzipping enjarify (possibly corrupt). Restart BCV." + BytecodeViewer.nl +
|
||||
BytecodeViewer.showMessage("ERROR: There was an issue unzipping enjarify (possibly corrupt). Restart "
|
||||
+ "BCV." + BytecodeViewer.nl +
|
||||
"If the error persists contact @Konloch.");
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
enjarifyZip.delete();
|
||||
Objects.requireNonNull(enjarifyZip).delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -517,7 +499,7 @@ public class Boot {
|
|||
System.out.println("Checking krakatau");
|
||||
|
||||
File krakatauZip = null;
|
||||
for (File f : new File(BytecodeViewer.libsDirectory).listFiles()) {
|
||||
for (File f : Objects.requireNonNull(new File(BytecodeViewer.libsDirectory).listFiles())) {
|
||||
if (f.getName().toLowerCase().startsWith("krakatau-")) {
|
||||
//System.out.println(f.getName());
|
||||
BytecodeViewer.krakatauVersion = f.getName().split("-")[1].split("\\.")[0];
|
||||
|
@ -525,7 +507,7 @@ public class Boot {
|
|||
}
|
||||
}
|
||||
|
||||
for (File f : new File(BytecodeViewer.getBCVDirectory()).listFiles()) {
|
||||
for (File f : Objects.requireNonNull(new File(BytecodeViewer.getBCVDirectory()).listFiles())) {
|
||||
if (f.getName().toLowerCase().startsWith("krakatau_") && !f.getName().split("_")[1].split("\\.")[0].equals(BytecodeViewer.krakatauVersion)) {
|
||||
setState("Bytecode Viewer Boot Screen - Removing Outdated " + f.getName() + "...");
|
||||
System.out.println("Removing oudated " + f.getName());
|
||||
|
@ -540,17 +522,20 @@ public class Boot {
|
|||
BytecodeViewer.krakatauWorkingDirectory = BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" +
|
||||
BytecodeViewer.krakatauVersion + BytecodeViewer.fs + "Krakatau-master";
|
||||
|
||||
File krakatauDirectory = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion);
|
||||
File krakatauDirectory =
|
||||
new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion);
|
||||
if (!krakatauDirectory.exists()) {
|
||||
try {
|
||||
setState("Bytecode Viewer Boot Screen - Updating to " + krakatauDirectory.getName() + "...");
|
||||
ZipUtils.unzipFilesToPath(krakatauZip.getAbsolutePath(), krakatauDirectory.getAbsolutePath());
|
||||
ZipUtils.unzipFilesToPath(Objects.requireNonNull(krakatauZip).getAbsolutePath(),
|
||||
krakatauDirectory.getAbsolutePath());
|
||||
System.out.println("Updated to krakatau v" + BytecodeViewer.krakatauVersion);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.showMessage("ERROR: There was an issue unzipping Krakatau decompiler (possibly corrupt). Restart BCV." + BytecodeViewer.nl +
|
||||
BytecodeViewer.showMessage("ERROR: There was an issue unzipping Krakatau decompiler (possibly "
|
||||
+ "corrupt). Restart BCV." + BytecodeViewer.nl +
|
||||
"If the error persists contact @Konloch.");
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
krakatauZip.delete();
|
||||
Objects.requireNonNull(krakatauZip).delete();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,6 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import the.bytecode.club.bootloader.resource.ExternalResource;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -31,13 +30,14 @@ import the.bytecode.club.bootloader.resource.ExternalResource;
|
|||
*/
|
||||
public class ClassPathLoader implements ILoader<Object> {
|
||||
|
||||
void extendClassPath(URL url) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException,
|
||||
void extendClassPath(URL url) throws NoSuchMethodException, SecurityException, IllegalAccessException,
|
||||
IllegalArgumentException,
|
||||
InvocationTargetException {
|
||||
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
|
||||
Class<URLClassLoader> urlClass = URLClassLoader.class;
|
||||
Method method = urlClass.getDeclaredMethod("addURL", new Class[]{URL.class});
|
||||
Method method = urlClass.getDeclaredMethod("addURL", URL.class);
|
||||
method.setAccessible(true);
|
||||
method.invoke(urlClassLoader, new Object[]{url});
|
||||
method.invoke(urlClassLoader, url);
|
||||
}
|
||||
|
||||
/*
|
|
@ -24,11 +24,11 @@ import the.bytecode.club.bootloader.resource.ExternalResource;
|
|||
* @author Bibl (don't ban me pls)
|
||||
* @created 19 Jul 2015 02:29:43
|
||||
*/
|
||||
public abstract interface ILoader<T> {
|
||||
public interface ILoader<T> {
|
||||
|
||||
public abstract void bind(ExternalResource<T> resource);
|
||||
void bind(ExternalResource<T> resource);
|
||||
|
||||
abstract Class<?> findClass(String name) throws ClassNotFoundException, NoClassDefFoundError;
|
||||
Class<?> findClass(String name) throws ClassNotFoundException, NoClassDefFoundError;
|
||||
|
||||
public abstract Class<?> loadClass(String name) throws ClassNotFoundException, NoClassDefFoundError;
|
||||
Class<?> loadClass(String name) throws ClassNotFoundException, NoClassDefFoundError;
|
||||
}
|
|
@ -7,15 +7,12 @@ import java.awt.Insets;
|
|||
import java.awt.Toolkit;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JProgressBar;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.Resources;
|
||||
|
||||
|
@ -45,7 +42,7 @@ import the.bytecode.club.bytecodeviewer.Resources;
|
|||
public class InitialBootScreen extends JFrame {
|
||||
private static final long serialVersionUID = -1098467609722393444L;
|
||||
|
||||
private JProgressBar progressBar = new JProgressBar();
|
||||
private final JProgressBar progressBar = new JProgressBar();
|
||||
|
||||
public InitialBootScreen() throws IOException {
|
||||
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
|
@ -71,9 +68,11 @@ public class InitialBootScreen extends JFrame {
|
|||
setTitle("Bytecode Viewer Boot Screen - Starting Up");
|
||||
GridBagLayout gridBagLayout = new GridBagLayout();
|
||||
gridBagLayout.columnWidths = new int[]{0, 0};
|
||||
gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0};
|
||||
gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
|
||||
gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
||||
gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
||||
getContentPane().setLayout(gridBagLayout);
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane();
|
||||
|
@ -88,7 +87,8 @@ public class InitialBootScreen extends JFrame {
|
|||
JEditorPane editorPane = new JEditorPane();
|
||||
editorPane.setEditorKit(new HTMLEditorKit());
|
||||
|
||||
editorPane.setText(convertStreamToString(InitialBootScreen.class.getClassLoader().getResourceAsStream("resources/intro.html")));
|
||||
editorPane.setText(convertStreamToString(InitialBootScreen.class.getClassLoader().getResourceAsStream("intro"
|
||||
+ ".html")));
|
||||
|
||||
scrollPane.setViewportView(editorPane);
|
||||
|
|
@ -6,11 +6,9 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
import the.bytecode.club.bootloader.resource.ExternalResource;
|
||||
import the.bytecode.club.bootloader.resource.JarContents;
|
||||
import the.bytecode.club.bootloader.util.ClassTree;
|
||||
|
@ -36,8 +34,8 @@ import the.bytecode.club.bootloader.util.ClassTree;
|
|||
/**
|
||||
* @author Bibl (don't ban me pls)
|
||||
* @created 19 Jul 2015 02:48:41
|
||||
* <p>
|
||||
* TODO: Resource loading
|
||||
* <p>
|
||||
* TODO: Resource loading
|
||||
*/
|
||||
@Deprecated
|
||||
public class LibraryClassLoader extends ClassLoader implements ILoader<JarContents<ClassNode>> {
|
||||
|
@ -47,13 +45,14 @@ public class LibraryClassLoader extends ClassLoader implements ILoader<JarConten
|
|||
private final ClassTree tree;
|
||||
|
||||
public LibraryClassLoader() {
|
||||
binded = new HashSet<JarContents<ClassNode>>();
|
||||
classCache = new HashMap<String, Class<?>>();
|
||||
binded = new HashSet<>();
|
||||
classCache = new HashMap<>();
|
||||
tree = new ClassTree();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see the.bytecode.club.bytecodeviewer.loadermodel.ILoader#bind(the.bytecode.club.bytecodeviewer.loadermodel.ExternalResource)
|
||||
* @see the.bytecode.club.bytecodeviewer.loadermodel.ILoader#bind(the.bytecode.club.bytecodeviewer.loadermodel
|
||||
* .ExternalResource)
|
||||
*/
|
||||
@Override
|
||||
public void bind(ExternalResource<JarContents<ClassNode>> resource) {
|
||||
|
@ -104,7 +103,7 @@ public class LibraryClassLoader extends ClassLoader implements ILoader<JarConten
|
|||
return defineClass(bytes, 0, bytes.length);
|
||||
}
|
||||
|
||||
public class ResolvingClassWriter extends ClassWriter {
|
||||
public static class ResolvingClassWriter extends ClassWriter {
|
||||
|
||||
private final ClassTree classTree;
|
||||
|
|
@ -22,7 +22,7 @@ package the.bytecode.club.bootloader;
|
|||
* @author Bibl (don't ban me pls)
|
||||
* @created 21 Jul 2015 00:14:53
|
||||
*/
|
||||
public abstract interface LoaderFactory<T> {
|
||||
public interface LoaderFactory<T> {
|
||||
|
||||
public abstract ILoader<T> spawnLoader();
|
||||
ILoader<T> spawnLoader();
|
||||
}
|
|
@ -9,7 +9,6 @@ import java.net.URL;
|
|||
import java.util.Enumeration;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
|
@ -82,7 +81,7 @@ public class ExternalLibrary extends ExternalResource<JarContents<ClassNode>> {
|
|||
*/
|
||||
@Override
|
||||
public JarContents<ClassNode> load() throws IOException {
|
||||
JarContents<ClassNode> contents = new JarContents<ClassNode>();
|
||||
JarContents<ClassNode> contents = new JarContents<>();
|
||||
|
||||
JarURLConnection con = (JarURLConnection) getLocation().openConnection();
|
||||
JarFile jar = con.getJarFile();
|
|
@ -45,7 +45,7 @@ public abstract class ExternalResource<T> {
|
|||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((location == null) ? 0 : location.hashCode());
|
||||
result = prime * result + location.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -58,12 +58,7 @@ public abstract class ExternalResource<T> {
|
|||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ExternalResource<?> other = (ExternalResource<?>) obj;
|
||||
if (location == null) {
|
||||
if (other.location != null)
|
||||
return false;
|
||||
} else if (!location.equals(other.location))
|
||||
return false;
|
||||
return true;
|
||||
return location.equals(other.location);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -6,7 +6,6 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -37,12 +36,12 @@ public class JarContents<C extends ClassNode> {
|
|||
private final DataContainer<JarResource> resourceContents;
|
||||
|
||||
public JarContents() {
|
||||
classContents = new ClassNodeContainer<C>();
|
||||
classContents = new ClassNodeContainer<>();
|
||||
resourceContents = new ResourceContainer();
|
||||
}
|
||||
|
||||
public JarContents(DataContainer<C> classContents, DataContainer<JarResource> resourceContents) {
|
||||
this.classContents = classContents == null ? new ClassNodeContainer<C>() : classContents;
|
||||
this.classContents = classContents == null ? new ClassNodeContainer<>() : classContents;
|
||||
this.resourceContents = resourceContents == null ? new ResourceContainer() : resourceContents;
|
||||
}
|
||||
|
||||
|
@ -66,21 +65,21 @@ public class JarContents<C extends ClassNode> {
|
|||
List<JarResource> r1 = resourceContents;
|
||||
List<JarResource> r2 = contents.resourceContents;
|
||||
|
||||
List<C> c3 = new ArrayList<C>(c1.size() + c2.size());
|
||||
List<C> c3 = new ArrayList<>(c1.size() + c2.size());
|
||||
c3.addAll(c1);
|
||||
c3.addAll(c2);
|
||||
|
||||
List<JarResource> r3 = new ArrayList<JarResource>(r1.size() + r2.size());
|
||||
List<JarResource> r3 = new ArrayList<>(r1.size() + r2.size());
|
||||
r3.addAll(r1);
|
||||
r3.addAll(r2);
|
||||
|
||||
return new JarContents<C>(new ClassNodeContainer<>(c3), new ResourceContainer(r3));
|
||||
return new JarContents<>(new ClassNodeContainer<>(c3), new ResourceContainer(r3));
|
||||
}
|
||||
|
||||
public static class ClassNodeContainer<C extends ClassNode> extends DataContainer<C> {
|
||||
private static final long serialVersionUID = -6169578803641192235L;
|
||||
|
||||
private Map<String, C> lastMap = new HashMap<String, C>();
|
||||
private Map<String, C> lastMap = new HashMap<>();
|
||||
private boolean invalidated;
|
||||
|
||||
public ClassNodeContainer() {
|
||||
|
@ -117,7 +116,7 @@ public class JarContents<C extends ClassNode> {
|
|||
public Map<String, C> namedMap() {
|
||||
if (invalidated) {
|
||||
invalidated = false;
|
||||
Map<String, C> nodeMap = new HashMap<String, C>();
|
||||
Map<String, C> nodeMap = new HashMap<>();
|
||||
Iterator<C> it = iterator();
|
||||
while (it.hasNext()) {
|
||||
C cn = it.next();
|
||||
|
@ -150,7 +149,7 @@ public class JarContents<C extends ClassNode> {
|
|||
|
||||
@Override
|
||||
public Map<String, JarResource> namedMap() {
|
||||
Map<String, JarResource> map = new HashMap<String, JarResource>();
|
||||
Map<String, JarResource> map = new HashMap<>();
|
||||
for (JarResource resource : this) {
|
||||
map.put(resource.getName(), resource);
|
||||
}
|
|
@ -114,8 +114,6 @@ public class JarInfo {
|
|||
return false;
|
||||
} else if (!path.equals(other.path))
|
||||
return false;
|
||||
if (type != other.type)
|
||||
return false;
|
||||
return true;
|
||||
return type == other.type;
|
||||
}
|
||||
}
|
|
@ -63,10 +63,7 @@ public class JarResource {
|
|||
if (!Arrays.equals(data, other.data))
|
||||
return false;
|
||||
if (name == null) {
|
||||
if (other.name != null)
|
||||
return false;
|
||||
} else if (!name.equals(other.name))
|
||||
return false;
|
||||
return true;
|
||||
return other.name == null;
|
||||
} else return name.equals(other.name);
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ public enum JarType {
|
|||
|
||||
private final String prefix;
|
||||
|
||||
private JarType(String prefix) {
|
||||
JarType(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package the.bytecode.club.bootloader.resource;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -35,7 +34,8 @@ public class LocateableJarContents<C extends ClassNode> extends JarContents<C> {
|
|||
this.jarUrls = jarUrls;
|
||||
}
|
||||
|
||||
public LocateableJarContents(DataContainer<C> classContents, DataContainer<JarResource> resourceContents, URL... jarUrls) {
|
||||
public LocateableJarContents(DataContainer<C> classContents, DataContainer<JarResource> resourceContents,
|
||||
URL... jarUrls) {
|
||||
super(classContents, resourceContents);
|
||||
this.jarUrls = jarUrls;
|
||||
}
|
|
@ -1,25 +1,28 @@
|
|||
package the.bytecode.club.bootloader.util;
|
||||
|
||||
import java.io.FilterOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Base64 {
|
||||
|
||||
private Base64() {}
|
||||
private Base64() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Encoder} that encodes using the
|
||||
* <a href="#basic">Basic</a> type base64 encoding scheme.
|
||||
*
|
||||
* @return A Base64 encoder.
|
||||
* @return A Base64 encoder.
|
||||
*/
|
||||
public static Encoder getEncoder() {
|
||||
return Encoder.RFC4648;
|
||||
return Encoder.RFC4648;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,17 +30,17 @@ public class Base64 {
|
|||
* <a href="#url">URL and Filename safe</a> type base64
|
||||
* encoding scheme.
|
||||
*
|
||||
* @return A Base64 encoder.
|
||||
* @return A Base64 encoder.
|
||||
*/
|
||||
public static Encoder getUrlEncoder() {
|
||||
return Encoder.RFC4648_URLSAFE;
|
||||
return Encoder.RFC4648_URLSAFE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Encoder} that encodes using the
|
||||
* <a href="#mime">MIME</a> type base64 encoding scheme.
|
||||
*
|
||||
* @return A Base64 encoder.
|
||||
* @return A Base64 encoder.
|
||||
*/
|
||||
public static Encoder getMimeEncoder() {
|
||||
return Encoder.RFC2045;
|
||||
|
@ -48,41 +51,37 @@ public class Base64 {
|
|||
* <a href="#mime">MIME</a> type base64 encoding scheme
|
||||
* with specified line length and line separators.
|
||||
*
|
||||
* @param lineLength
|
||||
* the length of each output line (rounded down to nearest multiple
|
||||
* of 4). If {@code lineLength <= 0} the output will not be separated
|
||||
* in lines
|
||||
* @param lineSeparator
|
||||
* the line separator for each output line
|
||||
*
|
||||
* @return A Base64 encoder.
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code lineSeparator} includes any
|
||||
* character of "The Base64 Alphabet" as specified in Table 1 of
|
||||
* RFC 2045.
|
||||
* @param lineLength the length of each output line (rounded down to nearest multiple
|
||||
* of 4). If {@code lineLength <= 0} the output will not be separated
|
||||
* in lines
|
||||
* @param lineSeparator the line separator for each output line
|
||||
* @return A Base64 encoder.
|
||||
* @throws IllegalArgumentException if {@code lineSeparator} includes any
|
||||
* character of "The Base64 Alphabet" as specified in Table 1 of
|
||||
* RFC 2045.
|
||||
*/
|
||||
public static Encoder getMimeEncoder(int lineLength, byte[] lineSeparator) {
|
||||
Objects.requireNonNull(lineSeparator);
|
||||
int[] base64 = Decoder.fromBase64;
|
||||
for (byte b : lineSeparator) {
|
||||
if (base64[b & 0xff] != -1)
|
||||
throw new IllegalArgumentException(
|
||||
"Illegal base64 line separator character 0x" + Integer.toString(b, 16));
|
||||
}
|
||||
if (lineLength <= 0) {
|
||||
return Encoder.RFC4648;
|
||||
}
|
||||
return new Encoder(false, lineSeparator, lineLength >> 2 << 2, true);
|
||||
Objects.requireNonNull(lineSeparator);
|
||||
int[] base64 = Decoder.fromBase64;
|
||||
for (byte b : lineSeparator) {
|
||||
if (base64[b & 0xff] != -1)
|
||||
throw new IllegalArgumentException(
|
||||
"Illegal base64 line separator character 0x" + Integer.toString(b, 16));
|
||||
}
|
||||
if (lineLength <= 0) {
|
||||
return Encoder.RFC4648;
|
||||
}
|
||||
return new Encoder(false, lineSeparator, lineLength >> 2 << 2, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Decoder} that decodes using the
|
||||
* <a href="#basic">Basic</a> type base64 encoding scheme.
|
||||
*
|
||||
* @return A Base64 decoder.
|
||||
* @return A Base64 decoder.
|
||||
*/
|
||||
public static Decoder getDecoder() {
|
||||
return Decoder.RFC4648;
|
||||
return Decoder.RFC4648;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,20 +89,20 @@ public class Base64 {
|
|||
* <a href="#url">URL and Filename safe</a> type base64
|
||||
* encoding scheme.
|
||||
*
|
||||
* @return A Base64 decoder.
|
||||
* @return A Base64 decoder.
|
||||
*/
|
||||
public static Decoder getUrlDecoder() {
|
||||
return Decoder.RFC4648_URLSAFE;
|
||||
return Decoder.RFC4648_URLSAFE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Decoder} that decodes using the
|
||||
* <a href="#mime">MIME</a> type base64 decoding scheme.
|
||||
*
|
||||
* @return A Base64 decoder.
|
||||
* @return A Base64 decoder.
|
||||
*/
|
||||
public static Decoder getMimeDecoder() {
|
||||
return Decoder.RFC2045;
|
||||
return Decoder.RFC2045;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,20 +117,20 @@ public class Base64 {
|
|||
* {@link java.lang.NullPointerException NullPointerException} to
|
||||
* be thrown.
|
||||
*
|
||||
* @see Decoder
|
||||
* @since 1.8
|
||||
* @see Decoder
|
||||
* @since 1.8
|
||||
*/
|
||||
public static class Encoder {
|
||||
|
||||
private final byte[] newline;
|
||||
private final int linemax;
|
||||
private final int line_max;
|
||||
private final boolean isURL;
|
||||
private final boolean doPadding;
|
||||
|
||||
private Encoder(boolean isURL, byte[] newline, int linemax, boolean doPadding) {
|
||||
private Encoder(boolean isURL, byte[] newline, int line_max, boolean doPadding) {
|
||||
this.isURL = isURL;
|
||||
this.newline = newline;
|
||||
this.linemax = linemax;
|
||||
this.line_max = line_max;
|
||||
this.doPadding = doPadding;
|
||||
}
|
||||
|
||||
|
@ -141,11 +140,11 @@ public class Base64 {
|
|||
* in "Table 1: The Base64 Alphabet" of RFC 2045 (and RFC 4648).
|
||||
*/
|
||||
private static final char[] toBase64 = {
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
||||
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
||||
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -154,30 +153,30 @@ public class Base64 {
|
|||
* '_'. This table is used when BASE64_URL is specified.
|
||||
*/
|
||||
private static final char[] toBase64URL = {
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
||||
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
||||
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
|
||||
};
|
||||
|
||||
private static final int MIMELINEMAX = 76;
|
||||
private static final byte[] CRLF = new byte[] {'\r', '\n'};
|
||||
private static final byte[] CRLF = new byte[]{'\r', '\n'};
|
||||
|
||||
static final Encoder RFC4648 = new Encoder(false, null, -1, true);
|
||||
static final Encoder RFC4648_URLSAFE = new Encoder(true, null, -1, true);
|
||||
static final Encoder RFC2045 = new Encoder(false, CRLF, MIMELINEMAX, true);
|
||||
|
||||
private final int outLength(int srclen) {
|
||||
int len = 0;
|
||||
private int outLength(int srclen) {
|
||||
int len;
|
||||
if (doPadding) {
|
||||
len = 4 * ((srclen + 2) / 3);
|
||||
} else {
|
||||
int n = srclen % 3;
|
||||
len = 4 * (srclen / 3) + (n == 0 ? 0 : n + 1);
|
||||
}
|
||||
if (linemax > 0) // line separators
|
||||
len += (len - 1) / linemax * newline.length;
|
||||
if (line_max > 0) // line separators
|
||||
len += (len - 1) / line_max * newline.length;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -186,17 +185,16 @@ public class Base64 {
|
|||
* byte array using the {@link Base64} encoding scheme. The returned byte
|
||||
* array is of the length of the resulting bytes.
|
||||
*
|
||||
* @param src
|
||||
* the byte array to encode
|
||||
* @return A newly-allocated byte array containing the resulting
|
||||
* encoded bytes.
|
||||
* @param src the byte array to encode
|
||||
* @return A newly-allocated byte array containing the resulting
|
||||
* encoded bytes.
|
||||
*/
|
||||
public byte[] encode(byte[] src) {
|
||||
int len = outLength(src.length); // dst array size
|
||||
byte[] dst = new byte[len];
|
||||
int ret = encode0(src, 0, src.length, dst);
|
||||
if (ret != dst.length)
|
||||
return Arrays.copyOf(dst, ret);
|
||||
return Arrays.copyOf(dst, ret);
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
@ -210,20 +208,17 @@ public class Base64 {
|
|||
* all bytes from the input byte array. No bytes will be written to the
|
||||
* output byte array if the output byte array is not big enough.
|
||||
*
|
||||
* @param src
|
||||
* the byte array to encode
|
||||
* @param dst
|
||||
* the output byte array
|
||||
* @return The number of bytes written to the output byte array
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code dst} does not have enough
|
||||
* space for encoding all input bytes.
|
||||
* @param src the byte array to encode
|
||||
* @param dst the output byte array
|
||||
* @return The number of bytes written to the output byte array
|
||||
* @throws IllegalArgumentException if {@code dst} does not have enough
|
||||
* space for encoding all input bytes.
|
||||
*/
|
||||
public int encode(byte[] src, byte[] dst) {
|
||||
int len = outLength(src.length); // dst array size
|
||||
if (dst.length < len)
|
||||
throw new IllegalArgumentException(
|
||||
"Output byte array is too small for encoding all input bytes");
|
||||
"Output byte array is too small for encoding all input bytes");
|
||||
return encode0(src, 0, src.length, dst);
|
||||
}
|
||||
|
||||
|
@ -240,9 +235,8 @@ public class Base64 {
|
|||
* effect as invoking
|
||||
* {@code new String(encode(src), StandardCharsets.ISO_8859_1)}.
|
||||
*
|
||||
* @param src
|
||||
* the byte array to encode
|
||||
* @return A String containing the resulting Base64 encoded characters
|
||||
* @param src the byte array to encode
|
||||
* @return A String containing the resulting Base64 encoded characters
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public String encodeToString(byte[] src) {
|
||||
|
@ -254,25 +248,24 @@ public class Base64 {
|
|||
* Encodes all remaining bytes from the specified byte buffer into
|
||||
* a newly-allocated ByteBuffer using the {@link Base64} encoding
|
||||
* scheme.
|
||||
*
|
||||
* <p>
|
||||
* Upon return, the source buffer's position will be updated to
|
||||
* its limit; its limit will not have been changed. The returned
|
||||
* output buffer's position will be zero and its limit will be the
|
||||
* number of resulting encoded bytes.
|
||||
*
|
||||
* @param buffer
|
||||
* the source ByteBuffer to encode
|
||||
* @return A newly-allocated byte buffer containing the encoded bytes.
|
||||
* @param buffer the source ByteBuffer to encode
|
||||
* @return A newly-allocated byte buffer containing the encoded bytes.
|
||||
*/
|
||||
public ByteBuffer encode(ByteBuffer buffer) {
|
||||
int len = outLength(buffer.remaining());
|
||||
byte[] dst = new byte[len];
|
||||
int ret = 0;
|
||||
int ret;
|
||||
if (buffer.hasArray()) {
|
||||
ret = encode0(buffer.array(),
|
||||
buffer.arrayOffset() + buffer.position(),
|
||||
buffer.arrayOffset() + buffer.limit(),
|
||||
dst);
|
||||
buffer.arrayOffset() + buffer.position(),
|
||||
buffer.arrayOffset() + buffer.limit(),
|
||||
dst);
|
||||
buffer.position(buffer.limit());
|
||||
} else {
|
||||
byte[] src = new byte[buffer.remaining()];
|
||||
|
@ -280,7 +273,7 @@ public class Base64 {
|
|||
ret = encode0(src, 0, src.length, dst);
|
||||
}
|
||||
if (ret != dst.length)
|
||||
dst = Arrays.copyOf(dst, ret);
|
||||
dst = Arrays.copyOf(dst, ret);
|
||||
return ByteBuffer.wrap(dst);
|
||||
}
|
||||
|
||||
|
@ -293,15 +286,14 @@ public class Base64 {
|
|||
* output stream. Closing the returned output stream will close the underlying
|
||||
* output stream.
|
||||
*
|
||||
* @param os
|
||||
* the output stream.
|
||||
* @return the output stream for encoding the byte data into the
|
||||
* specified Base64 encoded format
|
||||
* @param os the output stream.
|
||||
* @return the output stream for encoding the byte data into the
|
||||
* specified Base64 encoded format
|
||||
*/
|
||||
public OutputStream wrap(OutputStream os) {
|
||||
Objects.requireNonNull(os);
|
||||
return new EncOutputStream(os, isURL ? toBase64URL : toBase64,
|
||||
newline, linemax, doPadding);
|
||||
newline, line_max, doPadding);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -319,7 +311,7 @@ public class Base64 {
|
|||
public Encoder withoutPadding() {
|
||||
if (!doPadding)
|
||||
return this;
|
||||
return new Encoder(isURL, newline, linemax, false);
|
||||
return new Encoder(isURL, newline, line_max, false);
|
||||
}
|
||||
|
||||
private int encode0(byte[] src, int off, int end, byte[] dst) {
|
||||
|
@ -327,42 +319,42 @@ public class Base64 {
|
|||
int sp = off;
|
||||
int slen = (end - off) / 3 * 3;
|
||||
int sl = off + slen;
|
||||
if (linemax > 0 && slen > linemax / 4 * 3)
|
||||
slen = linemax / 4 * 3;
|
||||
if (line_max > 0 && slen > line_max / 4 * 3)
|
||||
slen = line_max / 4 * 3;
|
||||
int dp = 0;
|
||||
while (sp < sl) {
|
||||
int sl0 = Math.min(sp + slen, sl);
|
||||
for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) {
|
||||
for (int sp0 = sp, dp0 = dp; sp0 < sl0; ) {
|
||||
int bits = (src[sp0++] & 0xff) << 16 |
|
||||
(src[sp0++] & 0xff) << 8 |
|
||||
(src[sp0++] & 0xff);
|
||||
dst[dp0++] = (byte)base64[(bits >>> 18) & 0x3f];
|
||||
dst[dp0++] = (byte)base64[(bits >>> 12) & 0x3f];
|
||||
dst[dp0++] = (byte)base64[(bits >>> 6) & 0x3f];
|
||||
dst[dp0++] = (byte)base64[bits & 0x3f];
|
||||
(src[sp0++] & 0xff) << 8 |
|
||||
(src[sp0++] & 0xff);
|
||||
dst[dp0++] = (byte) base64[(bits >>> 18) & 0x3f];
|
||||
dst[dp0++] = (byte) base64[(bits >>> 12) & 0x3f];
|
||||
dst[dp0++] = (byte) base64[(bits >>> 6) & 0x3f];
|
||||
dst[dp0++] = (byte) base64[bits & 0x3f];
|
||||
}
|
||||
int dlen = (sl0 - sp) / 3 * 4;
|
||||
dp += dlen;
|
||||
sp = sl0;
|
||||
if (dlen == linemax && sp < end) {
|
||||
for (byte b : newline){
|
||||
if (dlen == line_max && sp < end) {
|
||||
for (byte b : newline) {
|
||||
dst[dp++] = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sp < end) { // 1 or 2 leftover bytes
|
||||
int b0 = src[sp++] & 0xff;
|
||||
dst[dp++] = (byte)base64[b0 >> 2];
|
||||
dst[dp++] = (byte) base64[b0 >> 2];
|
||||
if (sp == end) {
|
||||
dst[dp++] = (byte)base64[(b0 << 4) & 0x3f];
|
||||
dst[dp++] = (byte) base64[(b0 << 4) & 0x3f];
|
||||
if (doPadding) {
|
||||
dst[dp++] = '=';
|
||||
dst[dp++] = '=';
|
||||
}
|
||||
} else {
|
||||
int b1 = src[sp++] & 0xff;
|
||||
dst[dp++] = (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)];
|
||||
dst[dp++] = (byte)base64[(b1 << 2) & 0x3f];
|
||||
int b1 = src[sp] & 0xff;
|
||||
dst[dp++] = (byte) base64[(b0 << 4) & 0x3f | (b1 >> 4)];
|
||||
dst[dp++] = (byte) base64[(b1 << 2) & 0x3f];
|
||||
if (doPadding) {
|
||||
dst[dp++] = '=';
|
||||
}
|
||||
|
@ -395,8 +387,8 @@ public class Base64 {
|
|||
* {@link java.lang.NullPointerException NullPointerException} to
|
||||
* be thrown.
|
||||
*
|
||||
* @see Encoder
|
||||
* @since 1.8
|
||||
* @see Encoder
|
||||
* @since 1.8
|
||||
*/
|
||||
public static class Decoder {
|
||||
|
||||
|
@ -414,9 +406,9 @@ public class Base64 {
|
|||
* their 6-bit positive integer equivalents. Characters that
|
||||
* are not in the Base64 alphabet but fall within the bounds of
|
||||
* the array are encoded to -1.
|
||||
*
|
||||
*/
|
||||
private static final int[] fromBase64 = new int[256];
|
||||
|
||||
static {
|
||||
Arrays.fill(fromBase64, -1);
|
||||
for (int i = 0; i < Encoder.toBase64.length; i++)
|
||||
|
@ -437,9 +429,9 @@ public class Base64 {
|
|||
fromBase64URL['='] = -2;
|
||||
}
|
||||
|
||||
static final Decoder RFC4648 = new Decoder(false, false);
|
||||
static final Decoder RFC4648 = new Decoder(false, false);
|
||||
static final Decoder RFC4648_URLSAFE = new Decoder(true, false);
|
||||
static final Decoder RFC2045 = new Decoder(false, true);
|
||||
static final Decoder RFC2045 = new Decoder(false, true);
|
||||
|
||||
/**
|
||||
* Decodes all bytes from the input byte array using the {@link Base64}
|
||||
|
@ -447,13 +439,9 @@ public class Base64 {
|
|||
* byte array. The returned byte array is of the length of the resulting
|
||||
* bytes.
|
||||
*
|
||||
* @param src
|
||||
* the byte array to decode
|
||||
*
|
||||
* @return A newly-allocated byte array containing the decoded bytes.
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code src} is not in valid Base64 scheme
|
||||
* @param src the byte array to decode
|
||||
* @return A newly-allocated byte array containing the decoded bytes.
|
||||
* @throws IllegalArgumentException if {@code src} is not in valid Base64 scheme
|
||||
*/
|
||||
public byte[] decode(byte[] src) {
|
||||
byte[] dst = new byte[outLength(src, 0, src.length)];
|
||||
|
@ -471,13 +459,9 @@ public class Base64 {
|
|||
* <p> An invocation of this method has exactly the same effect as invoking
|
||||
* {@code decode(src.getBytes(StandardCharsets.ISO_8859_1))}
|
||||
*
|
||||
* @param src
|
||||
* the string to decode
|
||||
*
|
||||
* @return A newly-allocated byte array containing the decoded bytes.
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code src} is not in valid Base64 scheme
|
||||
* @param src the string to decode
|
||||
* @return A newly-allocated byte array containing the decoded bytes.
|
||||
* @throws IllegalArgumentException if {@code src} is not in valid Base64 scheme
|
||||
*/
|
||||
public byte[] decode(String src) {
|
||||
return decode(src.getBytes(StandardCharsets.ISO_8859_1));
|
||||
|
@ -497,22 +481,17 @@ public class Base64 {
|
|||
* then some bytes may have been written to the output byte array before
|
||||
* IllegalargumentException is thrown.
|
||||
*
|
||||
* @param src
|
||||
* the byte array to decode
|
||||
* @param dst
|
||||
* the output byte array
|
||||
*
|
||||
* @return The number of bytes written to the output byte array
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code src} is not in valid Base64 scheme, or {@code dst}
|
||||
* does not have enough space for decoding all input bytes.
|
||||
* @param src the byte array to decode
|
||||
* @param dst the output byte array
|
||||
* @return The number of bytes written to the output byte array
|
||||
* @throws IllegalArgumentException if {@code src} is not in valid Base64 scheme, or {@code dst}
|
||||
* does not have enough space for decoding all input bytes.
|
||||
*/
|
||||
public int decode(byte[] src, byte[] dst) {
|
||||
int len = outLength(src, 0, src.length);
|
||||
if (dst.length < len)
|
||||
throw new IllegalArgumentException(
|
||||
"Output byte array is too small for decoding all input bytes");
|
||||
"Output byte array is too small for decoding all input bytes");
|
||||
return decode0(src, 0, src.length, dst);
|
||||
}
|
||||
|
||||
|
@ -529,13 +508,9 @@ public class Base64 {
|
|||
* is not in valid Base64 encoding scheme. The position of the input
|
||||
* buffer will not be advanced in this case.
|
||||
*
|
||||
* @param buffer
|
||||
* the ByteBuffer to decode
|
||||
*
|
||||
* @return A newly-allocated byte buffer containing the decoded bytes
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code src} is not in valid Base64 scheme.
|
||||
* @param buffer the ByteBuffer to decode
|
||||
* @return A newly-allocated byte buffer containing the decoded bytes
|
||||
* @throws IllegalArgumentException if {@code src} is not in valid Base64 scheme.
|
||||
*/
|
||||
public ByteBuffer decode(ByteBuffer buffer) {
|
||||
int pos0 = buffer.position();
|
||||
|
@ -570,11 +545,9 @@ public class Base64 {
|
|||
* <p> Closing the returned input stream will close the underlying
|
||||
* input stream.
|
||||
*
|
||||
* @param is
|
||||
* the input stream
|
||||
*
|
||||
* @return the input stream for decoding the specified Base64 encoded
|
||||
* byte stream
|
||||
* @param is the input stream
|
||||
* @return the input stream for decoding the specified Base64 encoded
|
||||
* byte stream
|
||||
*/
|
||||
public InputStream wrap(InputStream is) {
|
||||
Objects.requireNonNull(is);
|
||||
|
@ -591,7 +564,7 @@ public class Base64 {
|
|||
if (isMIME && base64[0] == -1)
|
||||
return 0;
|
||||
throw new IllegalArgumentException(
|
||||
"Input byte[] should at least have 2 bytes for base64 bytes");
|
||||
"Input byte[] should at least have 2 bytes for base64 bytes");
|
||||
}
|
||||
if (isMIME) {
|
||||
// scan all bytes to fill out all non-alphabet. a performance
|
||||
|
@ -603,7 +576,7 @@ public class Base64 {
|
|||
len -= (sl - sp + 1);
|
||||
break;
|
||||
}
|
||||
if ((b = base64[b]) == -1)
|
||||
if (base64[b] == -1)
|
||||
n++;
|
||||
}
|
||||
len -= n;
|
||||
|
@ -614,7 +587,7 @@ public class Base64 {
|
|||
paddings++;
|
||||
}
|
||||
}
|
||||
if (paddings == 0 && (len & 0x3) != 0)
|
||||
if (paddings == 0 && (len & 0x3) != 0)
|
||||
paddings = 4 - (len & 0x3);
|
||||
return 3 * ((len + 3) / 4) - paddings;
|
||||
}
|
||||
|
@ -634,9 +607,9 @@ public class Base64 {
|
|||
// xx= shiftto==6&&sp==sl missing last =
|
||||
// xx=y shiftto==6 last is not =
|
||||
if (shiftto == 6 && (sp == sl || src[sp++] != '=') ||
|
||||
shiftto == 18) {
|
||||
shiftto == 18) {
|
||||
throw new IllegalArgumentException(
|
||||
"Input byte array has wrong 4-byte ending unit");
|
||||
"Input byte array has wrong 4-byte ending unit");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -644,29 +617,29 @@ public class Base64 {
|
|||
continue;
|
||||
else
|
||||
throw new IllegalArgumentException(
|
||||
"Illegal base64 character " +
|
||||
Integer.toString(src[sp - 1], 16));
|
||||
"Illegal base64 character " +
|
||||
Integer.toString(src[sp - 1], 16));
|
||||
}
|
||||
bits |= (b << shiftto);
|
||||
shiftto -= 6;
|
||||
if (shiftto < 0) {
|
||||
dst[dp++] = (byte)(bits >> 16);
|
||||
dst[dp++] = (byte)(bits >> 8);
|
||||
dst[dp++] = (byte)(bits);
|
||||
dst[dp++] = (byte) (bits >> 16);
|
||||
dst[dp++] = (byte) (bits >> 8);
|
||||
dst[dp++] = (byte) (bits);
|
||||
shiftto = 18;
|
||||
bits = 0;
|
||||
}
|
||||
}
|
||||
// reached end of byte array or hit padding '=' characters.
|
||||
if (shiftto == 6) {
|
||||
dst[dp++] = (byte)(bits >> 16);
|
||||
dst[dp++] = (byte) (bits >> 16);
|
||||
} else if (shiftto == 0) {
|
||||
dst[dp++] = (byte)(bits >> 16);
|
||||
dst[dp++] = (byte)(bits >> 8);
|
||||
dst[dp++] = (byte) (bits >> 16);
|
||||
dst[dp++] = (byte) (bits >> 8);
|
||||
} else if (shiftto == 12) {
|
||||
// dangling single "x", incorrectly encoded.
|
||||
throw new IllegalArgumentException(
|
||||
"Last unit does not have enough valid bits");
|
||||
"Last unit does not have enough valid bits");
|
||||
}
|
||||
// anything left is invalid, if is not MIME.
|
||||
// if MIME, ignore all non-base64 character
|
||||
|
@ -674,7 +647,7 @@ public class Base64 {
|
|||
if (isMIME && base64[src[sp++]] < 0)
|
||||
continue;
|
||||
throw new IllegalArgumentException(
|
||||
"Input byte array has incorrect ending byte at " + sp);
|
||||
"Input byte array has incorrect ending byte at " + sp);
|
||||
}
|
||||
return dp;
|
||||
}
|
||||
|
@ -686,40 +659,41 @@ public class Base64 {
|
|||
private static class EncOutputStream extends FilterOutputStream {
|
||||
|
||||
private int leftover = 0;
|
||||
private int b0, b1, b2;
|
||||
private int b0;
|
||||
private int b1;
|
||||
private boolean closed = false;
|
||||
|
||||
private final char[] base64; // byte->base64 mapping
|
||||
private final byte[] newline; // line separator, if needed
|
||||
private final int linemax;
|
||||
private final int line_max;
|
||||
private final boolean doPadding;// whether or not to pad
|
||||
private int linepos = 0;
|
||||
|
||||
EncOutputStream(OutputStream os, char[] base64,
|
||||
byte[] newline, int linemax, boolean doPadding) {
|
||||
byte[] newline, int line_max, boolean doPadding) {
|
||||
super(os);
|
||||
this.base64 = base64;
|
||||
this.newline = newline;
|
||||
this.linemax = linemax;
|
||||
this.line_max = line_max;
|
||||
this.doPadding = doPadding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
byte[] buf = new byte[1];
|
||||
buf[0] = (byte)(b & 0xff);
|
||||
buf[0] = (byte) (b & 0xff);
|
||||
write(buf, 0, 1);
|
||||
}
|
||||
|
||||
private void checkNewline() throws IOException {
|
||||
if (linepos == linemax) {
|
||||
if (linepos == line_max) {
|
||||
out.write(newline);
|
||||
linepos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
public void write(byte @NotNull [] b, int off, int len) throws IOException {
|
||||
if (closed)
|
||||
throw new IOException("Stream is closed");
|
||||
if (off < 0 || len < 0 || off + len > b.length)
|
||||
|
@ -735,7 +709,7 @@ public class Base64 {
|
|||
return;
|
||||
}
|
||||
}
|
||||
b2 = b[off++] & 0xff;
|
||||
int b2 = b[off++] & 0xff;
|
||||
len--;
|
||||
checkNewline();
|
||||
out.write(base64[b0 >> 2]);
|
||||
|
@ -749,19 +723,19 @@ public class Base64 {
|
|||
while (nBits24-- > 0) {
|
||||
checkNewline();
|
||||
int bits = (b[off++] & 0xff) << 16 |
|
||||
(b[off++] & 0xff) << 8 |
|
||||
(b[off++] & 0xff);
|
||||
(b[off++] & 0xff) << 8 |
|
||||
(b[off++] & 0xff);
|
||||
out.write(base64[(bits >>> 18) & 0x3f]);
|
||||
out.write(base64[(bits >>> 12) & 0x3f]);
|
||||
out.write(base64[(bits >>> 6) & 0x3f]);
|
||||
out.write(base64[(bits >>> 6) & 0x3f]);
|
||||
out.write(base64[bits & 0x3f]);
|
||||
linepos += 4;
|
||||
}
|
||||
}
|
||||
if (leftover == 1) {
|
||||
b0 = b[off++] & 0xff;
|
||||
b0 = b[off] & 0xff;
|
||||
} else if (leftover == 2) {
|
||||
b0 = b[off++] & 0xff;
|
||||
b1 = b[off++] & 0xff;
|
||||
b1 = b[off] & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -783,7 +757,7 @@ public class Base64 {
|
|||
out.write(base64[(b0 << 4) & 0x3f | (b1 >> 4)]);
|
||||
out.write(base64[(b1 << 2) & 0x3f]);
|
||||
if (doPadding) {
|
||||
out.write('=');
|
||||
out.write('=');
|
||||
}
|
||||
}
|
||||
leftover = 0;
|
||||
|
@ -802,9 +776,9 @@ public class Base64 {
|
|||
private final int[] base64; // base64 -> byte mapping
|
||||
private int bits = 0; // 24-bit buffer for decoding
|
||||
private int nextin = 18; // next available "off" in "bits" for input;
|
||||
// -> 18, 12, 6, 0
|
||||
// -> 18, 12, 6, 0
|
||||
private int nextout = -8; // next available "off" in "bits" for output;
|
||||
// -> 8, 0, -8 (no byte for output)
|
||||
// -> 8, 0, -8 (no byte for output)
|
||||
private boolean eof = false;
|
||||
private boolean closed = false;
|
||||
|
||||
|
@ -814,7 +788,7 @@ public class Base64 {
|
|||
this.isMIME = isMIME;
|
||||
}
|
||||
|
||||
private byte[] sbBuf = new byte[1];
|
||||
private final byte[] sbBuf = new byte[1];
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
|
@ -822,7 +796,7 @@ public class Base64 {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
public int read(byte @NotNull [] b, int off, int len) throws IOException {
|
||||
if (closed)
|
||||
throw new IOException("Stream is closed");
|
||||
if (eof && nextout < 0) // eof and no leftover
|
||||
|
@ -834,7 +808,7 @@ public class Base64 {
|
|||
do {
|
||||
if (len == 0)
|
||||
return off - oldOff;
|
||||
b[off++] = (byte)(bits >> nextout);
|
||||
b[off++] = (byte) (bits >> nextout);
|
||||
len--;
|
||||
nextout -= 8;
|
||||
} while (nextout >= 0);
|
||||
|
@ -849,14 +823,14 @@ public class Base64 {
|
|||
throw new IOException("Base64 stream has one un-decoded dangling byte.");
|
||||
// treat ending xx/xxx without padding character legal.
|
||||
// same logic as v == '=' below
|
||||
b[off++] = (byte)(bits >> (16));
|
||||
b[off++] = (byte) (bits >> (16));
|
||||
len--;
|
||||
if (nextin == 0) { // only one padding byte
|
||||
if (len == 0) { // no enough output space
|
||||
bits >>= 8; // shift to lowest byte
|
||||
nextout = 0;
|
||||
} else {
|
||||
b[off++] = (byte) (bits >> 8);
|
||||
b[off++] = (byte) (bits >> 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -871,17 +845,17 @@ public class Base64 {
|
|||
// xx= shiftto==6 && missing last '='
|
||||
// xx=y or last is not '='
|
||||
if (nextin == 18 || nextin == 12 ||
|
||||
nextin == 6 && is.read() != '=') {
|
||||
nextin == 6 && is.read() != '=') {
|
||||
throw new IOException("Illegal base64 ending sequence:" + nextin);
|
||||
}
|
||||
b[off++] = (byte)(bits >> (16));
|
||||
b[off++] = (byte) (bits >> (16));
|
||||
len--;
|
||||
if (nextin == 0) { // only one padding byte
|
||||
if (len == 0) { // no enough output space
|
||||
bits >>= 8; // shift to lowest byte
|
||||
nextout = 0;
|
||||
} else {
|
||||
b[off++] = (byte) (bits >> 8);
|
||||
b[off++] = (byte) (bits >> 8);
|
||||
}
|
||||
}
|
||||
eof = true;
|
||||
|
@ -892,14 +866,14 @@ public class Base64 {
|
|||
continue;
|
||||
else
|
||||
throw new IOException("Illegal base64 character " +
|
||||
Integer.toString(v, 16));
|
||||
Integer.toString(v, 16));
|
||||
}
|
||||
bits |= (v << nextin);
|
||||
if (nextin == 0) {
|
||||
nextin = 18; // clear for next
|
||||
nextout = 16;
|
||||
while (nextout >= 0) {
|
||||
b[off++] = (byte)(bits >> nextout);
|
||||
b[off++] = (byte) (bits >> nextout);
|
||||
len--;
|
||||
nextout -= 8;
|
||||
if (len == 0 && nextout >= 0) { // don't clean "bits"
|
|
@ -4,7 +4,6 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -32,7 +31,7 @@ import org.objectweb.asm.tree.ClassNode;
|
|||
public class ClassHelper {
|
||||
|
||||
public static Map<String, ClassNode> convertToMap(Collection<ClassNode> classes) {
|
||||
Map<String, ClassNode> map = new HashMap<String, ClassNode>();
|
||||
Map<String, ClassNode> map = new HashMap<>();
|
||||
for (ClassNode cn : classes) {
|
||||
map.put(cn.name, cn);
|
||||
}
|
||||
|
@ -40,7 +39,7 @@ public class ClassHelper {
|
|||
}
|
||||
|
||||
public static <T, K> Map<T, K> copyOf(Map<T, K> src) {
|
||||
Map<T, K> dst = new HashMap<T, K>();
|
||||
Map<T, K> dst = new HashMap<>();
|
||||
copy(src, dst);
|
||||
return dst;
|
||||
}
|
|
@ -1,18 +1,17 @@
|
|||
package the.bytecode.club.bootloader.util;
|
||||
|
||||
import static the.bytecode.club.bootloader.util.ClassHelper.convertToMap;
|
||||
import static the.bytecode.club.bootloader.util.ClassHelper.copyOf;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
|
||||
import static the.bytecode.club.bootloader.util.ClassHelper.convertToMap;
|
||||
import static the.bytecode.club.bootloader.util.ClassHelper.copyOf;
|
||||
|
||||
/***************************************************************************
|
||||
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
|
||||
* Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com *
|
||||
|
@ -36,16 +35,16 @@ import org.objectweb.asm.tree.MethodNode;
|
|||
* @created 25 May 2015 (actually before this)
|
||||
*/
|
||||
public class ClassTree {
|
||||
private static final SetCreator<ClassNode> SET_CREATOR = new SetCreator<ClassNode>();
|
||||
private static final SetCreator<ClassNode> SET_CREATOR = new SetCreator<>();
|
||||
|
||||
private final Map<String, ClassNode> classes;
|
||||
private final NullPermeableHashMap<ClassNode, Set<ClassNode>> supers;
|
||||
private final NullPermeableHashMap<ClassNode, Set<ClassNode>> delgates;
|
||||
|
||||
public ClassTree() {
|
||||
classes = new HashMap<String, ClassNode>();
|
||||
supers = new NullPermeableHashMap<ClassNode, Set<ClassNode>>(SET_CREATOR);
|
||||
delgates = new NullPermeableHashMap<ClassNode, Set<ClassNode>>(SET_CREATOR);
|
||||
classes = new HashMap<>();
|
||||
supers = new NullPermeableHashMap<>(SET_CREATOR);
|
||||
delgates = new NullPermeableHashMap<>(SET_CREATOR);
|
||||
}
|
||||
|
||||
public ClassTree(Collection<ClassNode> classes) {
|
||||
|
@ -54,8 +53,8 @@ public class ClassTree {
|
|||
|
||||
public ClassTree(Map<String, ClassNode> classes_) {
|
||||
classes = copyOf(classes_);
|
||||
supers = new NullPermeableHashMap<ClassNode, Set<ClassNode>>(SET_CREATOR);
|
||||
delgates = new NullPermeableHashMap<ClassNode, Set<ClassNode>>(SET_CREATOR);
|
||||
supers = new NullPermeableHashMap<>(SET_CREATOR);
|
||||
delgates = new NullPermeableHashMap<>(SET_CREATOR);
|
||||
|
||||
build(classes);
|
||||
}
|
||||
|
@ -70,7 +69,7 @@ public class ClassTree {
|
|||
|
||||
getDelegates0(ifacecs).add(node);
|
||||
|
||||
Set<ClassNode> superinterfaces = new HashSet<ClassNode>();
|
||||
Set<ClassNode> superinterfaces = new HashSet<>();
|
||||
buildSubTree(classes, superinterfaces, ifacecs);
|
||||
|
||||
getSupers0(node).addAll(superinterfaces);
|
||||
|
@ -84,7 +83,7 @@ public class ClassTree {
|
|||
if (ifacecs == null)
|
||||
continue;
|
||||
getDelegates0(ifacecs).add(currentSuper);
|
||||
Set<ClassNode> superinterfaces = new HashSet<ClassNode>();
|
||||
Set<ClassNode> superinterfaces = new HashSet<>();
|
||||
buildSubTree(classes, superinterfaces, ifacecs);
|
||||
getSupers0(currentSuper).addAll(superinterfaces);
|
||||
getSupers0(node).addAll(superinterfaces);
|
||||
|
@ -105,7 +104,7 @@ public class ClassTree {
|
|||
|
||||
getDelegates0(ifacecs).add(node);
|
||||
|
||||
Set<ClassNode> superinterfaces = new HashSet<ClassNode>();
|
||||
Set<ClassNode> superinterfaces = new HashSet<>();
|
||||
buildSubTree(classes, superinterfaces, ifacecs);
|
||||
|
||||
getSupers0(node).addAll(superinterfaces);
|
||||
|
@ -119,7 +118,7 @@ public class ClassTree {
|
|||
if (ifacecs == null)
|
||||
continue;
|
||||
getDelegates0(ifacecs).add(currentSuper);
|
||||
Set<ClassNode> superinterfaces = new HashSet<ClassNode>();
|
||||
Set<ClassNode> superinterfaces = new HashSet<>();
|
||||
buildSubTree(classes, superinterfaces, ifacecs);
|
||||
getSupers0(currentSuper).addAll(superinterfaces);
|
||||
getSupers0(node).addAll(superinterfaces);
|
||||
|
@ -133,21 +132,22 @@ public class ClassTree {
|
|||
classes.put(node.name, node);
|
||||
}
|
||||
|
||||
private void buildSubTree(Map<String, ClassNode> classes, Collection<ClassNode> superinterfaces, ClassNode current) {
|
||||
private void buildSubTree(Map<String, ClassNode> classes, Collection<ClassNode> superinterfaces,
|
||||
ClassNode current) {
|
||||
superinterfaces.add(current);
|
||||
for (String iface : current.interfaces) {
|
||||
ClassNode cs = classes.get(iface);
|
||||
if (cs != null) {
|
||||
getDelegates0(cs).add(current);
|
||||
buildSubTree(classes, superinterfaces, cs);
|
||||
} else {
|
||||
// System.out.println("Null interface -> " + iface);
|
||||
}
|
||||
} /*else {
|
||||
System.out.println("Null interface -> " + iface);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
public Set<MethodNode> getMethodsFromSuper(ClassNode node, String name, String desc) {
|
||||
Set<MethodNode> methods = new HashSet<MethodNode>();
|
||||
Set<MethodNode> methods = new HashSet<>();
|
||||
for (ClassNode super_ : getSupers(node)) {
|
||||
for (MethodNode mn : super_.methods) {
|
||||
if (mn.name.equals(name) && mn.desc.equals(desc)) {
|
||||
|
@ -159,7 +159,7 @@ public class ClassTree {
|
|||
}
|
||||
|
||||
public Set<MethodNode> getMethodsFromDelegates(ClassNode node, String name, String desc) {
|
||||
Set<MethodNode> methods = new HashSet<MethodNode>();
|
||||
Set<MethodNode> methods = new HashSet<>();
|
||||
for (ClassNode delegate : getDelegates(node)) {
|
||||
for (MethodNode mn : delegate.methods) {
|
||||
if (mn.name.equals(name) && mn.desc.equals(desc)) {
|
|
@ -35,7 +35,7 @@ public class NullPermeableHashMap<K, V> extends HashMap<K, V> {
|
|||
}
|
||||
|
||||
public NullPermeableHashMap() {
|
||||
this(new NullCreator<V>());
|
||||
this(new NullCreator<>());
|
||||
}
|
||||
|
||||
public V getNonNull(K k) {
|
|
@ -29,6 +29,6 @@ public class SetCreator<T> implements ValueCreator<Set<T>> {
|
|||
|
||||
@Override
|
||||
public Set<T> create() {
|
||||
return new HashSet<T>();
|
||||
return new HashSet<>();
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@ package the.bytecode.club.bootloader.util;
|
|||
* @author Bibl (don't ban me pls)
|
||||
* @created ages ago
|
||||
*/
|
||||
public abstract interface ValueCreator<V> {
|
||||
public interface ValueCreator<V> {
|
||||
|
||||
public abstract V create();
|
||||
V create();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue