trishume / QuestSaberPatch

Patcher tool to add custom levels to the Oculus Quest version of Beat Saber
MIT License
64 stars 8 forks source link

Crash on mac - System.IO.InvalidDataException: End of Central Directory record could not be found. #4

Open sidequestlegend opened 5 years ago

sidequestlegend commented 5 years ago

Mac os Mojave

Input:

{
    "apkPath": "/Users/cams/Library/Application Support/SideQuest/bsaber-base_patched.apk",
    "patchSignatureCheck": true,
    "ensureInstalled": {
        "18947-20595_SpiralsV2": "/Users/cams/Library/Application Support/SideQuest/bsaber/18947-20595/Spirals V2"
    },
    "exitAfterward": true
}

song: https://cdn.discordapp.com/attachments/580534053271371790/584763424735756317/18947-20595.zip

Ouput:

{"didSignatureCheckPatch":false,"presentLevels":null,"installedLevels":[],"installSkipped":{},"error":"System.IO.InvalidDataException: End of Central Directory record could not be found.\n   at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()\n   at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)\n   at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)\n   at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding)\n   at jsonApp.Program.RunInvocation(Invocation inv) in /.../QuestSaberPatch/jsonApp/Program.cs:line 53"}

All files appear to be in place and are working.

trishume commented 5 years ago

I've experienced this once as well. It seems to be some kind of random race condition that corrupts the APK. The temporary fix is to just restore the base apk from the original backup and try again. It's mentioned in the readme.

Frankly I suspect that it's a bug in the .NET core implementation.

sidequestlegend commented 5 years ago

it looks like im seeing this with a few users, and resetting everything doesn't seem to fix it in all cases. Whats painful is some reports of it working after resetting multiple times. By resetting i mean deleting the app and its app data folder.

Had about 3-4 people so far that say it happens at least after a reset and reinstall - with fresh copy of beat saber from the store

sidequestlegend commented 5 years ago

one user on mac seemed to be using the windows version hmm?

System.IO.InvalidDataException: End of Central Directory record could not be found. at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) at jsonApp.Program.RunInvocation(Invocation inv) in C:\projects\QuestSaberPatch\jsonApp\Program.cs:line 60
trishume commented 5 years ago

Damn that sucks, I guess if it is a random race condition then it's one that triggers semi-reliably for some people.

The only way I really have to attempt to fix this barring some new development is to try reading over the code closely and try reading the corefx source.

sidequestlegend commented 5 years ago

more update on this, wiping does seem to fix it. it could be people not properly deleting the right folder. Ive managed to get about 4 working again

~360 downloads so it must be working for others ok too

I will update here with more info as i have it

Snake0457 commented 5 years ago

more update on this, wiping does seem to fix it. it could be people not properly deleting the right folder. Ive managed to get about 4 working again

~360 downloads so it must be working for others ok too

I will update here with more info as i have it

By wiping you mean uninstalling/reinstalling Beat Saber from the Oculus store? I'm having the same issue on Win7.

SCheeseman commented 5 years ago

Same problem on Linux (Ubuntu 19.04 specifically)

Snake0457 commented 5 years ago

Reinstalling did not help, resetting base APK/retrying didn't either. I don't know where Oculus hides the Beat Saber folder though, so I haven't tried deleting that yet...where is it? I even tried deleting the demo and some leftover APK download files out of desperation, still no luck.

JosephKrusling commented 5 years ago

Occurring on Antergos also. Resolved for me by deleting beat saber from the quest, downloading again from the store, creating new master, then syncing.