Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid classpath when username has .jar #353

Open
taranovegor opened this issue May 19, 2024 · 3 comments
Open

Invalid classpath when username has .jar #353

taranovegor opened this issue May 19, 2024 · 3 comments

Comments

@taranovegor
Copy link

If the username contains .jar, for example baton.jar the classpath will not be processed correctly and will be a string like C:\Users\baton.jar instead of C:\Users\baton.jar\...\asset.jar.

_processClassPathList(list) {
const ext = '.jar'
const extLen = ext.length
for(let i=0; i<list.length; i++) {
const extIndex = list[i].indexOf(ext)
if(extIndex > -1 && extIndex !== list[i].length - extLen) {
list[i] = list[i].substring(0, extIndex + extLen)
}
}
}

Pretty freaky case, but it can happen...

@dscalzi
Copy link
Owner

dscalzi commented May 20, 2024

Have you actually seen this happen?

@taranovegor
Copy link
Author

Of course, here is more information about accident.

Console output:

[2024-05-16 22:33:48] [info] [ProcessBuilder]: Launch Arguments: [
  '-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump',
  '-Djava.library.path=C:\\Temp\\WCNatives\\8fc83e98c373294b92ab93bbcf1534b4',
  '-Djna.tmpdir=C:\\Temp\\WCNatives\\8fc83e98c373294b92ab93bbcf1534b4',
  '-Dorg.lwjgl.system.SharedLibraryExtractPath=C:\\Temp\\WCNatives\\8fc83e98c373294b92ab93bbcf1534b4',
  '-Dio.netty.native.workdir=C:\\Temp\\WCNatives\\8fc83e98c373294b92ab93bbcf1534b4',
  '-cp',
  'C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar;C:\\Users\\baton.jar',
  '-DFabricMcEmu= net.minecraft.client.main.Main ',
  '-Xmx3G',
  '-Xms3G',
  '-XX:+UnlockExperimentalVMOptions',
  '-XX:+UseG1GC',
  '-XX:G1NewSizePercent=20',
  '-XX:G1ReservePercent=20',
  '-XX:MaxGCPauseMillis=50',
  '-XX:G1HeapRegionSize=32M',
  'net.fabricmc.loader.impl.launch.knot.KnotClient',
  '--username',
  '***',
  '--version',
  'vanilla',
  '--gameDir',
  'C:\\Users\\baton.jar\\AppData\\Roaming\\.helioslauncher\\instances\\vanilla',
  '--assetsDir',
  'C:\\Users\\baton.jar\\AppData\\Roaming\\.helioslauncher\\common\\assets',
  '--assetIndex',
  '12',
  '--uuid',
  '***',
  '--accessToken',
  '***',
  '--clientId',
  '${clientid}',
  '--xuid',
  '${auth_xuid}',
  '--userType',
  'mojang',
  '--versionType',
  'release',
  '--width',
  1280,
  '--height',
  720,
  '--quickPlayMultiplayer',
  '127.0.0.1:25565'
]

The result of executing the _processClassPathList function:
image

@Codixer
Copy link

Codixer commented May 23, 2024

I question why someone would even have .jar in their username for their OS, lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants