Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
v-pun215 authored Jul 9, 2023
1 parent 48f83ca commit 10e4355
Show file tree
Hide file tree
Showing 21 changed files with 542 additions and 79 deletions.
4 changes: 4 additions & 0 deletions authlib-injector.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Logging started at 2023-07-09T07:18:05.533Z
[authlib-injector] [INFO] Version: 1.1.39
[authlib-injector] [INFO] Authentication server: https://ely.by
[authlib-injector] [ERROR] Failed to fetch metadata: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
10 changes: 10 additions & 0 deletions check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os
with open('check.txt') as f:
content = f.read()
if content == '0':
os.system("python main.py")
f = open("check.txt", "w")
f.write("1")
f.close()
else:
pass
1 change: 1 addition & 0 deletions check.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
293 changes: 293 additions & 0 deletions eclient.pyw
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
import json
from ttkbootstrap import Style
from tkinter.ttk import Progressbar
from tkinter.messagebox import askquestion, showinfo
from tkinter import Label, Canvas, PhotoImage
import tkinter as tk
import sys
import os
import time
from threading import Thread
from tkvideo import tkvideo
import platform
import psutil
import platform
import base64
from ctypes import windll
import ctypes
windll.shcore.SetProcessDpiAwareness(1)
myappid = u'vpun215.eclient.idk.1.0' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)

currn_dir = os.getcwd()
mc_dir = r"{}/.minecraft".format(currn_dir)
os_name = platform.platform()

def get_size(bytes, suffix="B"):
#Found this on some website, i don't remember now. Used to get the total ram in GB.
"""
Scale bytes to its proper format
e.g:
1253656 => '1.20MB'
1253656678 => '1.17GB'
"""
factor = 1024
for unit in ["", "K", "M", "G", "T", "P"]:
if bytes < factor:
return f"{bytes:.2f}{unit}{suffix}"
bytes /= factor


svmem = psutil.virtual_memory()

if os_name.startswith("Linux"):

settings = {
"accessToken": None,
"clientToken": None,
"User-info" : [
{
"username": None,
"AUTH_TYPE": None,
"UUID": None
}
],
"PC-info" : [
{
"OS": platform.platform(),
"Total-Ram": f"{get_size(svmem.total)}",
}
],
"Minecraft-home" : mc_dir,
"selected-version": None,
"Fps-Boost" : False,
"Tor-Enabled" : False,
"setting-info" : [
{
"fps_boost_selected" : False,
"tor_enabled_selected" : False,
"allocated_ram_selected" : None,
}
],
"allocated_ram" : None,
"jvm-args": None,
"executablePath": "java",
"ramlimiterExceptionBypassed": False,
"ramlimiterExceptionBypassedSelected": False
#"executablePath": r"{}/runtime/jre-legacy/linux/jre-legacy/bin/java".format(mc_dir)
}

elif os_name.startswith("Windows"):
settings = {
"accessToken": None,
"clientToken": None,
"User-info" : [
{
"username": None,
"AUTH_TYPE": None,
"UUID": None
}
],
"PC-info" : [
{
"OS": platform.platform(),
"Total-Ram": f"{get_size(svmem.total)}",
}
],
"Minecraft-home" : mc_dir,
"selected-version": None,
"Fps-Boost" : False,
"Tor-Enabled" : False,
"setting-info" : [
{
"fps_boost_selected" : False,
"tor_enabled_selected" : False,
"allocated_ram_selected" : None
}
],
"allocated_ram" : None,
"jvm-args": None,
"executablePath": r"C:\\Program Files\\BellSoft\\LibericaJDK-17\\bin\\java",
"ramlimiterExceptionBypassed": False,
"ramlimiterExceptionBypassedSelected": False
#"executablePath": r"{}/runtime/jre-legacy/windows/jre-legacy/bin/java".format(mc_dir)
}

if not os.path.exists(r"{}/settings.json".format(currn_dir)):
with open("settings.json", "w") as js_set:
json.dump(settings, js_set, indent=4)
js_set.close()
else:
pass

with open("settings.json", "r") as js_read:
s = js_read.read()
s = s.replace('\t','') #Trailing commas in dict cause file read problems, these lines will fix it.
s = s.replace('\n','')
s = s.replace(',}','}')
s = s.replace(',]',']')
data = json.loads(s)
#print(json.dumps(data, indent=4,))

os_name = data["PC-info"][0]["OS"]
username = data["User-info"][0]["username"]
mc_home = data["Minecraft-home"]
fps_boost = data["Fps-Boost"]
tor_enabled = data["Tor-Enabled"]
fps_boost_selected = data["setting-info"][0]["fps_boost_selected"]
tor_enabled_selected = data["setting-info"][0]["tor_enabled_selected"]
ramlimiterExceptionBypassed = data["ramlimiterExceptionBypassed"]
ramlimiterExceptionBypassedSelected = data["ramlimiterExceptionBypassedSelected"]

style = Style()


root = style.master
root.configure(bg = "#3a3a3a")
root.title("eClient Updater")
root.iconbitmap("mc.ico")
root.geometry("761x403+140+50")


Tk_Width = 761
Tk_Height = 403

x_Left = int(root.winfo_screenwidth()/2 - Tk_Width/2)
y_Top = int(root.winfo_screenheight()/2 - Tk_Height/2)

root.geometry(f"+{x_Left}+{y_Top}")


root.resizable(False, False)







canvas = Canvas(
root,
bg = "#3a3a3a",
height = 768,
width = 1024,
bd = 0,
highlightthickness = 0,
relief = "ridge")
canvas.place(x = 0, y = 0)

background_img = PhotoImage(file = "img/mc1.png")
background = canvas.create_image(
380.5,201.5,
image=background_img)





if not os.path.exists(r"{}/settings.json".format(currn_dir)):
c1 = Label(
text = "Generating settings.....",
font = ("SF Pro Display", int(13.0)),
bg="#3a3a3a",
fg="cyan1")

else:
c1 = Label(
text = "Reading settings.....",
font = ("SF Pro Display", int(13.0)),
bg="#3a3a3a",
fg="cyan1")

c1.place(x=248, y=350)

root.after(10000, lambda: c1.configure(text="Getting everything ready...."))

canvas.create_text(
400, 200,
text = "eClient Launcher",
fill = "white",
font = ("SF Pro Display", int(26.0), "bold"))




#l1 = Label(root)
#l1.pack()

#v1 = tkvideo(r"{}/intro_gif.mp4".format(currn_dir), l1, loop=1, size=(640,360))


pb1 = Progressbar(root, value=0, style='info.Horizontal.TProgressbar', length=300, mode="indeterminate")
pb1.place(x=250, y=400)


t1 = Thread(target=lambda: os.system("./main.sh"))
t2 = Thread(target=lambda: os.system("main.bat"))
#t3 = Thread(target=lambda: v1.play())


def checksettings():
'''A small hack to check settings and start the launcher accordingly.'''
if tor_enabled and tor_enabled_selected == True:

#time.sleep(20.0)
#pb1.stop()
if os_name.startswith("Linux"):
res2 = askquestion(title="Grant permission", message="Grant permission to permform administrative task?")
if res2 == "yes":
showinfo(title="Ok", message="Please enter your password in the next window to start tor")
os.system("gksudo service tor start")
elif res2 == "no":
showinfo(title="Abort", message="Tor cannot start without administrative privileges.")
sys.exit(0)
with open("main.sh", "w") as f:
f.write("torsocks python3 main.py\n")
f.close()
os.system("chmod 700 main.sh")
root.after(23000, lambda:t1.start())
elif os_name.startswith("Windows"):
with open("main.bat", "w") as f:
f.write("taskkill /f /im python.exe\n") #frees up cpu and memory
f.write("yeah.cmd")
f.close()
root.after(23000, lambda: t2.start())

else:
#time.sleep(20.0)
#pb1.stop()
if os_name.startswith("Linux"):
with open("main.sh", "w") as f:
f.write("python3 main.py\n")
f.close()
os.system("chmod 700 main.sh")
root.after(23000, lambda: t1.start())
elif os_name.startswith("Windows"):
with open("main.bat", "w") as f:
f.write("taskkill /f /im python.exe\n") #frees up cpu and memory
f.write("yeah.cmd")
f.close()
root.after(23000, lambda: t2.start())




#root.after(1000, lambda:t3.start())
#root.after(2000, lambda:pb1.start())
window_running = True
pb1.start()
checksettings()
#root.after(20000, lambda: pb1.stop())
root.after(24000, lambda: root.withdraw())
root.after(30000, lambda: root.destroy())



if t1.is_alive() or t2.is_alive():
pb1.stop()

try:
root.mainloop()
except KeyboardInterrupt:
print("Program Exited")

Binary file modified icon.ico
Binary file not shown.
Binary file added img/bg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/mc1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/mc2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/play2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/rename.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/wall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 6 additions & 21 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,12 @@
os.system("cls")
os.chdir(r"C:\\Users\\{}\\Downloads\\ ".format(usr_accnt))
import wget
print("Do you want to install python? It is necessary for the launcher to run. (y/n)")
c1 = ("Enter y if you don't have python installed, n if you have it already : ")
if c1 == "y":
print("Installing python 3.10.8....")
wget.download("https://www.python.org/ftp/python/3.10.8/python-3.10.8-amd64.exe", bar=wget.bar_adaptive)
filename = wget.detect_filename("https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd64.exe")
os.system(filename)
time.sleep(5)
os.remove(filename)
else:
print("Do you already have Java 17 installed?")
les = input("Y/N: ")
if les == "Y" or "y" or "yes" or "YES" or "yeah" or "YEAH":
print("Ok I guess. ;)")
else:

os.system("cls")
print("Installing Java 17.....")
wget.download("https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64.msi", bar=wget.bar_adaptive)
filename = wget.detect_filename("https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64.msi")
os.system(f"msiexec /i {filename}")

os.system("cls")
print("Installing Java 17.....")
wget.download("https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64.msi", bar=wget.bar_adaptive)
filename = wget.detect_filename("https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64.msi")
os.system(f"msiexec /i {filename}")
time.sleep(5)
os.remove(f"{filename}")
print("All requirements installed. Run eclient.py now to run the launcher.")
Expand Down
Loading

0 comments on commit 10e4355

Please sign in to comment.