Homebrew RELEASE JKSV (save manager) for Switch

  • Thread starter Thread starter JK_
  • Start date Start date
  • Views Views 202,588
  • Replies Replies 633
  • Likes Likes 27
Good news and bad news:

Good news is that I've located my original stuff for building the JKSV NSP. Bad news is: it looks like it's somewhat incomplete. Since a few of the files only needed to be built once, I don't have the original source files that made them. I'll get it done though. Looks like the last time I built it as an NSP was October 2021.
 
There was back in the day. I'll see if I can find the batch script I had and if it still works. I remember making custom boot gifs and everything for it.

That's bizarre. There's only one JKSV folder on your drive though, right? When JKSV boots, it basically downloads and caches your entire drive contents in RAM to make navigating it a smoother experience. Working with Drive and Webdav isn't like a SD card or anything. I have to match strings and IDs for everything. I'm willing to touch it up sometime if you wanna help debug it. Someone else added webdav to it and made some changes to both parts. I don't wanna be an asshole, but I did fix a couple of memory leaks they missed when I was going through it again. I missed them the first time too.
Yes, only one folder. In fact, this issue began with last version of JKSV and sometimes this duplication issue happens with game folders, and sometimes with the whole JKSV folder. It is very strange.

What I will try to do as soon as I get more time is to go back to a previous version of JKSV, to see what happens.

Thanks a lot.
 
Yes, only one folder. In fact, this issue began with last version of JKSV and sometimes this duplication issue happens with game folders, and sometimes with the whole JKSV folder. It is very strange.

What I will try to do as soon as I get more time is to go back to a previous version of JKSV, to see what happens.

Thanks a lot.
Before this release, it was all my own code running drive and it seemed to work fairly well, even if it wasn't perfect. I guess I can just reuse it in the rewrite anyway... I didn't have time to test both super thoroughly when I pulled it and I'm regretting it now.

There's nothing like reading snarky comments in your code while the other person left memory leaks in a few places and clearly screwed something up that was working fine before...
Post automatically merged:

I'm prototyping the new remote storage code now on my PC. I don't know how easily it'll integrate into master branch JKSV, but it'll get there. I just wanted to say guys: I'm being pulled in like ten different directions at the moment. I promised someone I'd help them with Minecraft saves on the 3DS, I'm still working on FsLib and taking feedback on it, I'm working on biggestDump (it's close), I promised someone I'd help them with getting Chinese characters to load and render in something cause apparently most people don't bother? Yeah, I've got a lot on my plate on top of everything else. I'm trying not to burn myself out on top of it, so patience is all I ask.

Thanks.
 
Last edited by JK_,
Thoughts about zip compression.
I can't see settings for compression level. Maybe wrong, but after a look at the code it seems that defaults are used.
Perhaps a more convenient approach would be setting the compression level to 'minimal'. This would suffice to remove all the most obvious redundancies while still being fast.

(Edit) a possible issue with zip files, empty folders aren't stored in the archive, as opposed to file based backups.
 
Last edited by ber71,
@ber71
For the first: When I first added ZIP there actually was a setting that controlled the compression level used. The difference it made wasn't huge, and in the end I removed it and stuck with default. Rewrite maybe because of how much cleaner it is.

The second: I never thought of that. Good point. I'm using minizip though, so I might have to add empty files named ".keep" or something to preserve them.
 
  • Like
Reactions: ber71
Seems minizip had struggle with empty folders management, also seems was corrected back on june on develop branch:

https://github.com/zlib-ng/minizip-ng/issues/756

Screenshot_2024-11-17-08-44-24-558_org.mozilla.firefox-edit.jpg
 
Last edited by impeeza,
  • Like
Reactions: alcab
@impeeza
I'll check it out when I have time, but that version of minizip doesn't look like the one that devkitPro has. I know it has a couple of different libraries for compression though. I have to focus on one thing at a time, and right now that is getting the new Drive and WebDav code up and running. I gotta say, it's already a million times cleaner and self contained compared to what it was. Hopefully my new way of using polymorphism and only needing one instance of a derived Remote::Storage class will make sense to other people and make it easier to add different services and protocols.
 
Good news everyone. It feels like I'm performing delicate surgery on the master branch, but Google Drive code is working. It still needs a lot of testing and tweaks, but I'm getting a root listing again. I plan to reuse the code in the rewrite with some tweaks. I had to add a few things to make it compatible with the master branch. It also logs errors the best I can. I seem to recall Google's error responses to be inconsistently structured.

I've made changes so json-c objects, curl handles, and everything in the Remote::Storage code literally can't leak memory anymore by wrapping everything in unique and shared pointers that free the data automatically at destruction. They have factory template functions that wrap and return them. This is one of the things I was talking about earlier. When WebDav was added, I caught a few times they forgot to call json_object_put. That literally shouldn't be able to happen now. It wasn't enough to cause major issues for a majority of people, but yeah...

I've also corrected a few things Google has changed or updated since I last touched it. When I first wrote the old code, the authentication code always ended in a #, but now it seems it can end with an & too? Both are now checked when searching for and cutting the code out from the reply URL. I also remembered to unescape the string after cutting it out of the reply URL cause apparently I didn't last time... From now on, after your first login, your refresh token is appended to the end of your Google Drive JSON immediately after it is received. I used to save it in JKSV's config file, but we all now know how that goes.

Both Drive and WebDav are derived from a base Storage class now and share all of functions they have in common. The person who added WebDav implemented something similar, but separated a lot of stuff between them that I just find odd. A lot of things they kept separated are now protected in the base class and shared between them. I'm not sure what their reasoning was, but it doesn't make much sense to me. Everything in them will be redone in the coming days or weeks. I know some of the Drive stuff definitely feels snappier compared to what it was. We'll see with WebDav.

I touched a few other things, but not a lot. I wanted to eradicate every use of new and delete, but I'm not sure how doable that is given how this thing currently works. Since this new remote storage system was written around modernish C++, it was an easy thing to pull off. I removed all of the legacy configuration loading functions too. It's been years since JKSV saved its config in binary, so it's gone. I wish I could say this won't have any impact on anyone, but I did see someone complaining about the April fools joke I took out years ago triggering again this year.

That's where it stands. I might dump test builds in this thread before Github, because I just got done clearing out issues that are user error and stuff.

See ya guys soon.
 
Hi! noob question here. Got JKSV to backup my saves to Google just fine, but I'm unable to download them now. How do I manage to get the files back from the cloud?

I was hoping this would be the solution to "sync" saves across 2 different switch consoles


Just had to update the games on my other switch, it seems it won't see the save if the version is different. All good now!
 
Curious: Would anyone out there be interested in making actual icons to replace the options in the main menu? I'm talking about everything beyond the actual accounts found on your Switch. Reason is because with having translations, the text doesn't always fit and I don't like that. I'd rather just have icons that sort of represent what they are. If you're interested, let me know.

Thanks.
 
Curious: Would anyone out there be interested in making actual icons to replace the options in the main menu? I'm talking about everything beyond the actual accounts found on your Switch. Reason is because with having translations, the text doesn't always fit and I don't like that. I'd rather just have icons that sort of represent what they are. If you're interested, let me know.

Thanks.
You mean something like:

Instead of the bottom menu display:

1733438181442.png


Show something like:

1733438202292.png
 
@impeeza
I'm actually talking about the menu. After the accounts, like where it says "Device", "BCAT, "System", "Settings". Those. I can't help but notice that some of the translated versions of those strings are wider than the 256x256 icon allows. I'm having problems coming up with ideas besides like a gear for settings too. I'm no artist either.
 
  • Love
Reactions: impeeza
Ah, ok, a symbol for DEVICE (like the user icon) another for BCAT , Caché, System, and Config?

That 's cool!!

Maybe the name of the selected option can appear on the top of the page (beside JKSV) there the name can fit easy.
 
Small update: I've decided to move full steam ahead with the rewrite instead, guys. The master branch is too touchy to do much with. The rewrite is based entirely on pushing states to a vector, whereas the old build handled it all with variables. I've got good news too, and maybe something most people won't care about: I've added back the text menu mode since handling it is a lot easier this time around:
2024120911244900-E58C03FD2FF562F462515FB73597EDA6.jpg

I've also completely reworked the menu scrolling logic and it's as close to perfect as it can be. Something that always bothered me about old master branch JKSV is that the bottom can sometimes get cut off. The new logic is a lot more accurate. If anyone would like to complain about or make suggestions for better icons to represent the system save data types, please be my guest. These were the best I could come up with browsing free SVG graphics sites. I'm not an artist and don't have time to make my own. This is actually getting exciting for me. I've learned so much over the past year and JKSV is making me put it all to good use.
 
I'm at a loss here, at one point I had google drive integration working fine, but one day a few months ago it just broke. When I launch JKSV it takes me to the web browser applet but the page says "This page cannot be displayed" with a "Return to previous page." Button.
/JKSV/log.txt reads:

Drive/exchangeAuthCode: ( "error": "invalid_request" "error_description": "Missing required parameter: code" )

My understanding is that this is typically an issue with the clock, but I've ran the stock nintendo NTP, quickNTP, and DBI NTP, and none of them fixed the issue. I've also tried deleting and reinstalling the /config/JKSV, /JKSV/, and /switch/JKSV/ folders, and I've done the entire setup on the google cloud side over again with a new project and new credential file for said fresh JKSV install, to no avail. When I open the web applet on its own and go to google I'm able to sign in fine there. Has anyone figured out how to solve this issue before?
Post automatically merged:

I'm at a loss here, at one point I had google drive integration working fine, but one day a few months ago it just broke, probably something I did but I can't remember what. When I launch JKSV it takes me to the web browser applet but the page says "This page cannot be displayed" with a "Return to previous page." Button.
/JKSV/log.txt reads:

Drive/exchangeAuthCode: ( "error": "invalid_request" "error_description": "Missing required parameter: code" )

My understanding is that this is typically an issue with the clock, but I've ran the stock nintendo NTP, quickNTP, and DBI NTP, and none of them fixed the issue. I've also tried deleting and reinstalling the /config/JKSV, /JKSV/, and /switch/JKSV/ folders, and I've done the entire setup on the google cloud side over again with a new project and new credential file for said fresh JKSV install, to no avail. When I open the web applet on its own and go to google I'm able to sign in fine there. Has anyone figured out how to solve this issue before?
 
Last edited by autumns,

Site & Scene News

Popular threads in this forum