-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINIT.py
More file actions
52 lines (45 loc) · 1.7 KB
/
INIT.py
File metadata and controls
52 lines (45 loc) · 1.7 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
import os
import subprocess as sub
import MirrorHandler as mirror
global editions
editions = []
def DownloadSources():
data = mirror.ParseVersion()
mirror.DecompilerJars(data)
def SelectEdition():
while True:
print("""
1 - Server
2 - Client
3 - All
""")
id = int(input(f"\nSelect game edition: "))
if id < 1 or id > 3:
print("Bruh..")
pass
if id == 1: editions.append("server")
if id == 2: editions.append("client")
if id == 3: editions.extend(["server", "client"])
print(f"EDITIONS: {editions}")
break
def CreateStructure():
os.makedirs("./patches/client", exist_ok=True)
os.makedirs("./patches/server", exist_ok=True)
os.makedirs("./jars/client", exist_ok=True)
os.makedirs("./jars/server", exist_ok=True)
os.makedirs("./src/client", exist_ok=True)
os.makedirs("./src/server", exist_ok=True)
os.makedirs("./mappings", exist_ok=True)
os.makedirs("./deobfuscated", exist_ok=True)
os.makedirs("./decompiled", exist_ok=True)
if __name__ == "__main__":
SelectEdition()
CreateStructure()
DownloadSources()
sub.run(["python", "RecreateMappings.py"])
for edition in editions:
sub.run(["java", "-jar", "./jars/SpecialSource.jar", "--in-jar",
f"./jars/{edition}/{edition}.jar", "--out-jar",
f"./deobfuscated/{edition}.jar", "--srg-in", "./mappings/packaged.srg"])
sub.run(["java", "-jar", "./jars/CFR.jar", f"./deobfuscated/{edition}.jar", "--outputdir", f"./decompiled/{edition}"])
sub.run(["python", "PostDecompile.py", edition])