* more windows porting, added helper

launcher
Dominika 2022-06-15 01:39:20 +02:00
parent 6969c5fcbc
commit 8feef9892f
5 changed files with 83 additions and 1 deletions

36
launcher/helper.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# helper.sh - sources everything and tries to refresh the token
cd /meow
source auth.sh
source ms_auth.sh
source launch.sh
source version.sh
function _login() {
read -p "E-Mail: " login
read -s -p "Password: " pass
_login "$login" "$pass"
cat auth.json
}
echo "Welcome to CurseMe (WIP)!"
if [[ -f auth.json ]]; then
refresh
else
echo -e 'This looks like your first launch. Start with logging in by executing `_login` or `ms_login` (i will rename those later)'
fi
PS1='CurseMe$ '
echo "Available (user-facing) commands:
list_versions - well...
fetch_version <version> - downloads a specific version
launch <version> - launches a previously downloaded version
_login - classic Mojang login
ms_login - microsoft login
Have fun!"

View File

@ -1,6 +1,10 @@
#!/bin/bash
function launch() {
if [[ "$1" == '' ]]; then
echo uh oh
exit 1
fi
cd "$1"
mkdir -p natives

View File

@ -4,7 +4,7 @@ function get_client_id() {
curl https://raw.githubusercontent.com/PolyMC/PolyMC/develop/CMakeLists.txt | grep Launcher_MSA_CLIENT_ID | awk '{print $2}' | sed 's/"//g' > client_id
}
function login() {
function ms_login() {
res="$(curl "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode?client_id=$(cat client_id)&scope=XboxLive.signin%20offline_access")"
jq '.message' <<< "$res"
echo "Press <return> after authenticating"

View File

@ -0,0 +1,8 @@
#!/bin/bash
rm -R build/curseme-w32/meow/
curl -L -o meow.tar.gz https://git.sakamoto.pl/domi/curseme/-/archive/launcher/curseme-launcher.tar.gz?path=launcher
tar xvf meow.tar.gz
mkdir -p build/curseme-w32/meow
mv curseme-launcher-launcher/launcher/* build/curseme-w32/meow/
styrene -o ./build ./curseme.cfg

View File

@ -0,0 +1,34 @@
# Styrene config file for gtk-demo and related apps.
# https://github.com/achadwick/styrene/
[bundle]
packages = p7zip {pkg_prefix}jq {pkg_prefix}curl msys2-runtime
filename_stub = curseme
display_name = CurseMe
description = 3rd-party Minecraft launcher
version = 0.1
url = https://git.sakamoto.pl/domi/curseme/
launchers = meow
delete =
mingw*/share/man/*
mingw*/share/doc/*
mingw*/include/*
# messy, but idc
nodelete =
usr/bin/7z
usr/bin/msys-2.0.dll
usr/lib/p7zip/*
usr/bin/cygpath.exe
mingw*/bin/*.dll
mingw*/bin/*.exe
[meow]
name = CurseMe
comment = nie wiem
exec = bash --rcfile /meow/helper.sh
icon = input-tablet
terminal = true