MSA ID fetching

This commit is contained in:
sneedium 2022-02-23 22:39:42 -05:00
parent c41305d8f9
commit 6df00ddf73
Signed by: sneedium
GPG Key ID: 906F66490FBE722F
3 changed files with 27 additions and 1 deletions

View File

@ -67,7 +67,7 @@ set(Launcher_META_URL "https://meta.multimc.org/v1/" CACHE STRING "URL to fetch
set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application") set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application")
# MSA Client ID # MSA Client ID
set(Launcher_MSA_CLIENT_ID "0d742867-f14f-4ad9-9d0b-13692c38dc3a" CACHE STRING "Client ID you can get from Microsoft Identity Platform when you register an application") execute_process(COMMAND ./id.sh OUTPUT_VARIABLE Launcher_MSA_CLIENT_ID)
# Bug tracker URL # Bug tracker URL
set(Launcher_BUG_TRACKER_URL "https://github.com/Sneederix/SneedMC/issues" CACHE STRING "URL for the bug tracker.") set(Launcher_BUG_TRACKER_URL "https://github.com/Sneederix/SneedMC/issues" CACHE STRING "URL for the bug tracker.")

View File

@ -688,6 +688,7 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee. copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs

25
id.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
#git fetch --all
#git reset --hard origin/develop
wget "https://files.multimc.org/downloads/mmc-stable-lin64.tar.gz"
tar xzf mmc-stable-lin64.tar.gz
#pushd MultiMC/bin
cd MultiMC/bin
client_id_asm=$(objdump -j '.text' --no-show-raw-insn -C --disassemble='Secrets::getMSAClientID(unsigned char)' MultiMC)
client_id="$(grep -oP '[a-z0-9]{2}(?=,%r[89]d)' <<< ${client_id_asm} | tac | tr -d '\n')$(grep -oP '(push.+0x)\K[a-z0-9]{2}' <<< ${client_id_asm} | tac | tr -d '\n')"
client_id="${client_id:0:8}-${client_id:8:4}-${client_id:12:4}-${client_id:16:4}-${client_id:20}"
#popd
cd ../../
echo -n $client_id
rm -rf mmc-stable-lin64.tar.gz MultiMC
#sed -i "s/.*Launcher_MSA_CLIENT_ID.*/set(Launcher_MSA_CLIENT_ID \"$client_id\" CACHE STRING \"Client ID you can get from Microsoft Identity Platform when you register an application\")/g" CMakeLists.txt
#git commit -S -am "update to new MultiMC MSA ID" || echo "not changing ID" && (git remote | xargs -L1 git push --all)