kiraio-moe / USSR

Easily remove Unity splash screen & watermark.
GNU General Public License v3.0
232 stars 23 forks source link

[BUG] Unhandled exception and no error handling for unsupported Unity version #13

Closed dmitry343 closed 11 months ago

dmitry343 commented 11 months ago

How to Use Select the Action, find and choose one of these files in you game data: globalgamemanagers | data.unity3d | .data | .data.br | .data.gz

( INFO ) unity3d file selected. ( INFO ) Loading class types package: C:\USSR\USSR-v1.1.6-net8.0-win-x64\classdata.tpk... ( INFO ) Loading asset class types database... Unhandled exception. System.ArgumentOutOfRangeException: count ('-1023778293') must be a non-negative value. (Parameter 'count') Actual value was -1023778293. at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName) at System.IO.BinaryReader.ReadBytes(Int32 count) at AssetsTools.NET.AssetTypeTemplateField.ReadType(AssetsFileReader reader, AssetTypeValueField valueField, RefTypeManager refMan) at AssetsTools.NET.AssetTypeTemplateField.ReadType(AssetsFileReader reader, AssetTypeValueField valueField, RefTypeManager refMan) at AssetsTools.NET.AssetTypeTemplateField.MakeValue(AssetsFileReader reader, RefTypeManager refMan) at AssetsTools.NET.AssetTypeTemplateField.MakeValue(AssetsFileReader reader, Int64 position, RefTypeManager refMan) at AssetsTools.NET.Extra.AssetsManager.GetBaseField(AssetsFileInstance inst, AssetFileInfo info, AssetReadFlags readFlags) at USSR.Core.USSR.RemoveSplashScreen(AssetsManager assetsManager, AssetsFileInstance assetFileInstance) in E:\Projects\USSR\USSR.cs:line 546 at USSR.Core.USSR.Main(String[] args) in E:\Projects\USSR\USSR.cs:line 307

unity version 2022.3.12f1 webgl build

kiraio-moe commented 11 months ago

Can you send me the file? I want to reproduce the error. I have used .NET 6 with Unity 2022 and it didn't throw me any error.

dmitry343 commented 11 months ago

This error disappears, but when I using ussr my app crashing build.zip UnityPlayer.zip

tried to use net6, the same result

kiraio-moe commented 11 months ago

Thanks. After I checked, currently there's no Type Tree Dumps (a required file to read Unity asset file) supported for this Unity version yet. So, USSR will fail to write the asset file correctly and it will crash the game. I think I should add an error handling for this.

dmitry343 commented 11 months ago

Which Unity version do you use?

kiraio-moe commented 11 months ago

Which Unity version do you use?

2022.3.0f1c1. But before that, can you replace classdata.tpk in your USSR with this? https://nightly.link/AssetRipper/Tpk/workflows/type_tree_tpk/master/uncompressed_file.zip Then remove the splash screen again and see if it's works or not.

dmitry343 commented 11 months ago

Now it works But I can see a few frames of background of splash screen before app started Its already good result

kiraio-moe commented 11 months ago

Now it works But I can see a few frames of background of splash screen before app started Its already good result

Good to know! The black screen are not much of a big deal.. I haven't updated the Type Tree package for a while, so there's some minor Unity version that aren't supported yet.