HGStyle / GD-SaveFileFixer

Fixes Geometry Dash savefiles if corrupted for unknown reasons, from WEGFan's tool Geometry-Dash-Savefile-Fix.
MIT License
10 stars 1 forks source link

Geometry Dash Savefile Fixer

This tool can fix most problems that make unable to open the game by the savefiles. (which the game will only launch if you move the savefiles to other folders.) This is an ameliorated version of the Geometry-Dash-Savefile-Fix made by WEGFan but since he seems inactive now, and there are some issues opened, I wanted to help these people to don't lose their data. This is an entire rewrite of the code, I licensed it under MIT License so you can do almost anything you want on this software, including using it in closed-source projects and so on... Only 1 thing: credit me (plz). Thanks you all.

Note

THE UPDATE 2.0.0 IS NOW OUT !!!!!! EVERYTHING SHOULD NOW BE FIXED

Instructions

If they seem really long, its because I try to include every cases to make everyone can use this programm. You can skip sections for Linux users (since they are really long) if you aren't using Linux (remember, Ubuntu, Debian, etc... are Linux!). If its so complicated on Linux, it's because there are many different "editions" of Linux (actually called distributions or distros, example: Ubuntu and Debian are Linux distributions) and they have different applications, with different versions, and its sometimes hard to make an operation working on every distribution.

Not working?

Firstly, check the project FAQ If you encounter any problem (unable to fix / doesn't work after fixed), get help by creating an issue (edit: @superchupu on Discord told me issues are disabled, now they are back - sorry) or contact me on Discord.

Using prebuilt binaries

In the GitHub Releases, I post the source code of the project per version, but also binaries (= executable files) that I build myself on my computer (mostly on live sessions like MX Linux or Hirens BootCD). You can download these and run them on your computer directly without installing the whole Python programming language (if you dont know if your computer is 64bits or 32bits, choose the 32bits version). Note that I dont post binaries for MacOS, iOS and iPadOS due to the fact that I dont own any Apple device since I hate Apple (no drama please, its just my opinion. OK, actually I own some iPhones from 2013 but they are so old that I can't even install new apps on them). Even if you download prebuilt binaries, you will still have to install some apps if you are on mobile.

Using the source code

You may use the source code because there isn't any binary file for you system, or because you dont know which binary file corresponds to your device, or simply because you think that just before compiling binaries I injected a malware in them. (which, I guarrentee it, is false) but if you dont want to risk to be hacked (which is something that I entirelly respect, even me sometimes I prefer running source code that binaries because people reads the code and sees there is no malware in it), you may download the source code in GitHub Releases, which is the only file that ends with .py. You could also download the source code ZIP or TAR file automatically made by GitHub, but you will have to decompress it to get the Python script file. You could also download it from the master branch, but I don't recommend that way since I can make changes that makes the someware buggy (since I use online GitHub code editor to edit code of this repository and then I test it on annother PC that have Geometry Dash installed, since my main PC can't support Geometry Dash for the reason that I'm on Linux and when running Geometry Dash with WINE, it says it's a 32 bits program and it can't run it since my PC is 64 bits).

Running on Windows, MacOS or Linux

If you have downloaded the source code and you are on Windows or MacOS, go to the Python 3.11.4 downloads which is the latest Python version for now and is tested to be functionnal with my code, scroll down until you see the header "Files", then download and install the version that is right for you (if you dont know if your computer is 64bits or 32bits, choose the 32bits version). Linux users does not have any Python installer on the Python website. Instead, open your package manager (either in graphical UI or in command line) and install the package python3 and python3-pip. After, check the Python version by running the command python3 --version in a terminal (don't use python3 -v because some old Python versions understands that -v means --verbose instead of --version, if you do it you will get a Python interpreter with lots of weird logs texts for debugging Python, to exit type exit() and validate using the Enter key). If your Python version is 3.8 or newer (Python 3.9, 3.10, 3.11, etc...) it should work fine (programm tested on Python 3.8, 3.9 and 3.11). If you get an older version (example: Python 3.6) try to install in your package manager the package called python3.8 or python3.10 and then, instead of running the command python3 --version, run [the name of the package you installed] --version (example for package python3.8: python3.8 --version). And make sure its Python 3.8 or newer. If the command isn't found, you will have to compile Python yourself from the source code, but don't panic, its pretty easy if you follow this tutorial (if the commands containing apt does not works, try replacing apt by yum, pacman or dnf, else try skipping these commands containing apt or search Google for annother tutorial, search How to compile Python 3.10 on [your operating system name, example: Debian]). For every OS, after installing Python, you will have to open a terminal (search and run cmd on Windows, on MacOS and Linux, search and run Terminal) and run the command: pip install pycryptodome (its really important on MacOS, if it fails on Windows or Linux just skip). If you have downloaded a prebuilt binary, you dont have to do anything. To run the program, on Windows and MacOS, double-click on it. Linux users could try clicking on it (generaly one time) but in most cases it will not work. The solution in that case is to right-click anywhere in the folder on an empty zone, click on "Open terminal here". If this option isn't here, it should be accessible via the options bar at the top of the file manager window, in most cases, under tools, then click on "Open terminal here" or something similar. Then, execute this command in the terminal: [the name of the python package you installed] [the name of the source code file you downloaded from the github repo]. In most of case this command will be: python3 GD-SaveFileFixer-SourceCode.py. Also, if you downloaded a zip or a tar file, make sure to extract before running the command. You can use 7-zip by example (also notice that Windows, MacOS and Linux have a tool installed by default to extract ZIP files, but not TAR files, except on Linux).

Running on Android

Firstly, you will have to make the Geometry Dash app data accessible to you. By default, to avoid others apps to steal your data, Android has a protection that only allows the installed app to access to his data. Even you, the user, cannot access to it. To bypass this, the most known way is rooting your Android device. This task is dangerous. Really dangerous: do it incorrectly and you may never see your phone starts again. Also, rooting your Android device may cancel the warenty of the device, depending on what you have signed for while getting the warrenty. To avoid users to do this dangerous task and risk to lose all of their data, I found another way, which is still a bit hard to realise but is way much more safer. I'm sorry, but if you have a GDPS (or any Geometry Dash app that has been signed using a test development key like old App Cloner versions or any version of APK Editor with default settings for signing apps) you can do this using only your Android device, but this way is really long to do, and if you have the real Geometry Dash or annother app that hasn't been signed using the test development key (including the Geometry Dash app from the Play Store, every Android mod menus and modified GDPS such as GDPS Editor 2.2) you will need two devices: your Android device and a Windows, MacOS or Linux (they cannot be the same). Here are the steps:

To know is your Geometry Dash app signed with testkey (so you can use the "is a GDPS" version of the fixer, which requires only your device and is less long):

If your Geometry Dash version is a GDPS (or your Geometry Dash is signed using testkey, or has been modified and signed using any version of APK Editor with default signing settings, or modified using an old version of App Cloner) and you aren't on a rooted device:

If you dont have a rooted phone and the method before this one does not works for you:

If your Android device is rooted (its a very lot more fast):

Running on iOS or iPadOS

READ THIS. You have to extract the game files, run the program on MacOS (Windows won't work until I decide to update), use the manual option, select the savefiles one by one, fix them, but them back into the folder where you got them. (Maybe someday I'll try to make a tutorial about this)

As I said before, I dont own any iOS or iPadOS devices that are up to date, I can't install apps on them since they are way too old. But here is a way that will probably work that I haven't tested. Firstly, jailbreak your iDevice, here is a list of tutorials depending on your iOS/iPadOS version and/or iPhone/iPad edition. You may (or not) also see these jailbreaking tools: unc0ver, checkra1n, palera1n, Dopamine, Taurine, Odyssey, Chimera, Electra, H3lix, Phoenix, EtasonJB, backr00m (french old tutorial) etc... You can find many more on the Internet but be careful ! Malwares exists on iOS and iPadOS !. Then install iSH and the Python programm, open iSH, install Python, run the Python program and exit iSH and finally open Geometry Dash, It should be fixed. NOTE: I havn't tested this because as I said, I dont own any iDevice that can install apps ! (they are too old, Apple Store refuses to install apps on it).

Note

Even if it should have support for MacOS and iOS, I made a little mistake in the code. I will fix that later, but for now, support for Apple ecosystem doesn't works. Technical reason: In function is_valid_savefile, code only ran on MacOS and iOS to decrypt savefiles tries to use an undefined variable last...

More info about savefile encoding/decoding

These pages were useful to me to encrypt/decrypt GD savefiles:

Click here to see Savefiles page backup from a GD Wiki user

Click here to see GD Programming Docs about Savefiles

Credits and legality

Thanks to WEGFan because this would not exist without his GitHub repo. I dont see any license on his GitHub repo, but I credit him anyways, even if its not needed. Note that this is an entire rewrite, actually what was reused from WEGFan's code is actually one single line of code. And some sentances of the README.md file. But that's all. Edit: It seems like WEGFan has seen this repo, since he made a modification in his GitHub repo to redirect users from his archived repo to mine! Just thanks bro, I think I can license the software without having problems with him. (it's the first time a known gd coder does that so thx)

Thanks you all!