revanced-patches icon indicating copy to clipboard operation
revanced-patches copied to clipboard

bug: Integrations patch fails due to `BaseIntegrationsPatch.getCurrentJarFilePath`

Open oSumAtrIX opened this issue 1 year ago • 11 comments

Bug description

When a path to the patches jar contains spaces, it is URL encoded. This encoding causes the patch to fail

Error logs

SEVERE: Disable auto captions failed:
app.revanced.patcher.patch.PatchException: 'Disable auto captions' depends on 'IntegrationsPatch' that raised an exception:
app.revanced.patcher.patch.PatchException: C:\Users\User\Desktop\Desktop%20Shortcuts\Revanced\revanced-patches.jar
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:187)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:155)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend(Patcher.kt:205)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
        at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
        at app.revanced.cli.command.PatchCommand$run$4$1$1.invokeSuspend(PatchCommand.kt:303)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:302)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Caused by: java.nio.file.NoSuchFileException: C:\Users\User\Desktop\Desktop%20Shortcuts\Revanced\revanced-patches.jar

Solution

Decode the URL here: https://github.com/ReVanced/revanced-patches/blob/5abf89444a3e6a211ec03c242eb9a7847542b08c/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt#L73

Additional context

No response

Acknowledgements

  • [X] This issue is not a duplicate of an existing bug report.
  • [X] I have chosen an appropriate title.
  • [X] All requested information has been provided properly.

oSumAtrIX avatar Apr 23 '24 17:04 oSumAtrIX

Even with latest dev release, the issue isn't resolved I guess!

SEVERE: Alternative thumbnails failed:
app.revanced.patcher.patch.PatchException: 'Alternative thumbnails' depends on 'IntegrationsPatch' that raised an exception:
app.revanced.patcher.patch.PatchException: G:\ (The system cannot find the path specified)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:187)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:155)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend(Patcher.kt:205)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
        at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
        at app.revanced.cli.command.PatchCommand$run$4$1$1.invokeSuspend(PatchCommand.kt:303)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:302)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Caused by: java.io.FileNotFoundException: G:\ (The system cannot find the path specified)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:344)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:213)
        at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1442)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1407)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:716)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:250)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:179)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:346)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:317)
        at java.base/java.util.jar.JarFile.<init>(JarFile.java:256)
        at app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.getPatchesManifestEntry(BaseIntegrationsPatch.kt:63)
        at app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.execute(BaseIntegrationsPatch.kt:46)
        at app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.execute(BaseIntegrationsPatch.kt:19)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:173)
        ... 25 more

        at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:160)
        at app.revanced.patcher.Patcher$apply$1.invokeSuspend(Patcher.kt:205)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at app.revanced.patcher.Patcher$apply$1.invoke(Patcher.kt)
        at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
        at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
        at app.revanced.cli.command.PatchCommand$run$4$1$1.invokeSuspend(PatchCommand.kt:303)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:302)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)

kazimmt avatar Apr 29 '24 17:04 kazimmt

Open a new issue with all requested information properly

oSumAtrIX avatar Apr 29 '24 17:04 oSumAtrIX

Why do I need to create a new issue when the problem is the same as this one and hasn't been resolved in the dev release?

Then you'll close the issue as duplicate of #3078 :/

kazimmt avatar Apr 29 '24 18:04 kazimmt

@kazimmt What is the actual path of your patches jar? Is it in the root drive g?

Try putting it in a subdirectory and see if that fixes it.

LisoUseInAIKyrios avatar Apr 29 '24 18:04 LisoUseInAIKyrios

Try putting it in a subdirectory and see if that fixes it.

image

kazimmt avatar Apr 29 '24 18:04 kazimmt

Try removing the exclamation marks from the directory and see if that fixes it

LisoUseInAIKyrios avatar Apr 29 '24 18:04 LisoUseInAIKyrios

https://github.com/ReVanced/revanced-patches/blob/f74a87d6a10598381568dd3374938458143a4a2b/src/main/kotlin/app/revanced/patches/shared/misc/integrations/BaseIntegrationsPatch.kt#L78

That probably needs to be the last index of.

LisoUseInAIKyrios avatar Apr 29 '24 18:04 LisoUseInAIKyrios

Try removing the exclamation marks from the directory and see if that fixes it

Yeah, it works after removing the exclamation marks. But it worked with those marks before!

kazimmt avatar Apr 29 '24 18:04 kazimmt

The exclamation marks extend beyond the file directories 😂

It'll be fixed soon.

LisoUseInAIKyrios avatar Apr 29 '24 18:04 LisoUseInAIKyrios

Fixed with https://github.com/ReVanced/revanced-patches/commit/056e2d7dd5bbacb7dc6b109b3e2d44d55e7eb7d3

LisoUseInAIKyrios avatar Apr 29 '24 18:04 LisoUseInAIKyrios

when the problem is the same

The problems are different evidently by the error logs

oSumAtrIX avatar Apr 29 '24 19:04 oSumAtrIX