2024-05-20
Decompiling A Jar File With Jd-Cli: Processes And Output Options

Java jar file decompiler

To decompile a single jar file we need more than just jd-core, which is a commandline tool to decompile a single class file at a time.

Use jd-cli which is downloadable at here.

Commandline usage:

1
2
3
4
5
6
# without docker
java -jar jd-cli.jar file-to-decompile.jar -ods decompiled-src
# with docker
docker run -it --rm -v `pwd`:/mnt --user $(id -u):$(id -g) \
kwart/jd-cli /mnt/file-to-decompile.jar -ods /mnt/decompiled-src

Full syntax:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Usage: java -jar jd-cli.jar [options] [Files to decompile]
Options:
--displayLineNumbers, -n
displays line numbers in decompiled classes
Default: false
--escapeUnicodeCharacters, -eu
escape unicode characters in decompiled classes
Default: false
--help, -h
shows this help
Default: false
--logLevel, -g
takes [level] as parameter and sets it as the CLI log level. Possible
values are: ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF
Default: INFO
--outputConsole, -oc
enables output to system output stream
Default: false
--outputDir, -od
takes a [directoryPath] as a parameter and configures a flat DIR output
for this path
--outputDirStructured, -ods
takes a [directoryPath] as a parameter and configures a structured DIR
output for this path
--outputZipFile, -oz
takes a [zipFilePath] as a parameter and configures ZIP output for this
path
--pattern, -p
RegExp pattern which the to-be-decompiled file has to match. Not matching
entries are skipped.
--serialProcessing, -sp
don't use parallel processing
Default: false
--skipResources, -sr
skips processing resources
Default: false
--version, -v
shows the version
Default: false

Read More

2022-12-06
Mirror Sites Change

if it only blocks a range of ip, you use proxy to avoid this constraint.

some mirror sites serves us poorly and block access from us. we point them out, list alternatives and provide quick fixes.

these actions are intentionally done against specific group of people. it does block a whole range of IPs.

actors:

1
2
3
https://mirrors.aliyun.com
https://mirrors.tuna.tsinghua.edu.cn/

fixes:

currently we use some previously picked up tunnel accounts provided by topsap. may fix this problem?

python pip:

1
2
pip3 config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple

taobao npm mirror:

1
2
3
http://npm.taobao.org => http://npmmirror.com
http://registry.npm.taobao.org => http://registry.npmmirror.com

Read More

2022-01-12
Ecosim

• You must demonstrate multiple examples of inheritance.

You may need to include classes that were not mentioned to demonstrate appropriate inheritance relationships.

• You must demonstrate multiple examples of aggregation/composition/association. You may need to create lists of animals or tiles in the EcoSim class.

• You must create methods not mentioned in the text above.

• You must include one more type of animal, and one more plant in your program.

• You must demonstrate polymorphism by calling overridden methods, or by checking the types of objects.

• You must demonstrate good encapsulation by making dangerous variables private or protected and providing getter or setter methods to them.

• You must include str and repr methods for each class. You may print(self) or print(animals) to help you with debugging.

• You must update your UML diagram written in part 1 and submit it with your code.

• Your code must be documented appropriately using docstrings.

• You must make at least 10 commits using git with appropriate comments.

You must use git version control to keep track of your progress during implementation. Only a local git repository is required in this assignment. You are not required to use an online repository, but if you choose to, please make sure your online repository is private. You should perform regular commits as you implement features and fix errors. Your commit comments should be short and reflect the changes that were made.

• You must write a unit test for the game.Vector2D class.

You will find Vector2D in the game.py file. You must create a new file called test_vector2d.py and write a test method for each of the following methods in Vector2D: add, subtract, scale, length, distance, normalize. You may either use the unittest or the pytest modules. Each test method should call those methods two times using different arguments: one safe set of arguments, and one dangerous set of arguments.

Read More