ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.54k stars 294 forks source link

bug: Patcher temporary path argument causes resource path error #3900

Open decipher3114 opened 1 week ago

decipher3114 commented 1 week ago

Bug description

Resource Patch which is probably a dependency fails for YouTube and YouTube Music. Not Tested for other apps.

Error logs

INFO: Loading patches 
INFO: Decoding app manifest 
INFO: "Export all activities" disabled 
INFO: "Spoof build info" disabled 
INFO: "Hide mock location" disabled 
INFO: "Spoof SIM country" disabled 
INFO: "Spoof Wi-Fi connection" disabled 
INFO: "Enable Android debugging" disabled 
INFO: "Change data directory location" disabled 
INFO: "Hex" disabled 
INFO: "Predictive back gesture" disabled 
INFO: "Override certificate pinning" disabled 
INFO: "Remove screen capture restriction" disabled 
INFO: "Remove screenshot restriction" disabled 
INFO: "Remove share targets" disabled 
INFO: "Change version code" disabled 
INFO: "Hide music video ads" disabled 
INFO: "Enable exclusive audio playback" disabled 
INFO: "Permanent repeat" disabled 
INFO: "Hide category bar" disabled 
INFO: Setting patch options 
INFO: Deleting existing temporary files directory 
INFO: Decoding resources 
INFO: Initializing lookup maps 
INFO: Executing patches 
INFO: "Bypass certificate checks" succeeded 
INFO: "GmsCore support" succeeded 
INFO: "Hide 'Get Music Premium' label" succeeded 
INFO: "Permanent shuffle" succeeded 
INFO: "Remove background playback restrictions" succeeded 
INFO: "Remove upgrade button" succeeded 
SEVERE: "ResourcePatch" failed:
app.revanced.patcher.patch.PatchException: The patch "ResourcePatch" raised an exception: app.revanced.patcher.patch.PatchException: TEMP/patcher/apk/TEMP/patcher/apk/res/values-ar/strings.xml (No such file or directory)
    at app.revanced.patcher.Patcher$invoke$1.invokeSuspend(Patcher.kt:132)
    at app.revanced.patcher.Patcher$invoke$1.invoke(Patcher.kt)
    at app.revanced.patcher.Patcher$invoke$1.invoke(Patcher.kt)
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:57)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:226)
    at app.revanced.cli.command.PatchCommand$run$1$4.invokeSuspend(PatchCommand.kt:315)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:314)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
    at picocli.CommandLine.execute(CommandLine.java:2174)
    at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Caused by: java.io.FileNotFoundException: TEMP/patcher/apk/TEMP/patcher/apk/res/values-ar/strings.xml (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
    at app.revanced.patcher.util.Document.<init>(Document.kt:21)
    at app.revanced.patcher.patch.ResourcePatchContext.document(ResourcePatchContext.kt:42)
    at app.revanced.patches.all.misc.resources.AddResourcesPatchKt.addResourcesPatch$lambda$35$lambda$34$invoke(AddResourcesPatch.kt:370)
    at app.revanced.patches.all.misc.resources.AddResourcesPatchKt.addResourcesPatch$lambda$35$lambda$34(AddResourcesPatch.kt:391)
    at app.revanced.patcher.patch.Patch.finalize(Patch.kt:87)
    at app.revanced.patcher.patch.ResourcePatch.finalize$revanced_patcher(Patch.kt:248)
    at app.revanced.patcher.Patcher$invoke$1.invokeSuspend(Patcher.kt:126)
    ... 23 more

    at app.revanced.patcher.Patcher$invoke$1.invokeSuspend(Patcher.kt:139)
    at app.revanced.patcher.Patcher$invoke$1.invoke(Patcher.kt)
    at app.revanced.patcher.Patcher$invoke$1.invoke(Patcher.kt)
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:57)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:226)
    at app.revanced.cli.command.PatchCommand$run$1$4.invokeSuspend(PatchCommand.kt:315)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:314)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
    at picocli.CommandLine.execute(CommandLine.java:2174)
    at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:12)
Caused by: app.revanced.patcher.patch.PatchException: TEMP/patcher/apk/TEMP/patcher/apk/res/values-ar/strings.xml (No such file or directory)
    at app.revanced.patcher.Patcher$invoke$1.invokeSuspend(Patcher.kt:132)
    ... 23 more
Caused by: java.io.FileNotFoundException: TEMP/patcher/apk/TEMP/patcher/apk/res/values-ar/strings.xml (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
    at app.revanced.patcher.util.Document.<init>(Document.kt:21)
    at app.revanced.patcher.patch.ResourcePatchContext.document(ResourcePatchContext.kt:42)
    at app.revanced.patches.all.misc.resources.AddResourcesPatchKt.addResourcesPatch$lambda$35$lambda$34$invoke(AddResourcesPatch.kt:370)
    at app.revanced.patches.all.misc.resources.AddResourcesPatchKt.addResourcesPatch$lambda$35$lambda$34(AddResourcesPatch.kt:391)
    at app.revanced.patcher.patch.Patch.finalize(Patch.kt:87)
    at app.revanced.patcher.patch.ResourcePatch.finalize$revanced_patcher(Patch.kt:248)
    at app.revanced.patcher.Patcher$invoke$1.invokeSuspend(Patcher.kt:126)
    ... 23 more

INFO: "Change package name" succeeded 
INFO: Compiling modified resources 
INFO: Aligning APK 
INFO: Signing APK 
INFO: Saved to /data/data/com.termux/files/home/revancify-data/apps/YouTube-Music/7.03.52-revanced.apk 
INFO: Purging temporary files 
INFO: Purged resource cache directory

Solution

No response

Additional context

Root Access: false Architecture: arm64-v8a App: YouTube-Music v7.03.52 CLI: revanced-cli-v5.0.0.jar Patches: revanced-patches-v5.0.0.rvp Arguments: --enable Change package name --enable Permanent shuffle --enable Hide 'Get Music Premium' label --enable Remove upgrade button --enable Bypass certificate checks --enable Remove background playback restrictions --enable GmsCore support --options=packageName=app.rvx.yt.m --options=gmsCoreVendorGroupId=app.revanced

Acknowledgements

decipher3114 commented 1 week ago

Update: Need fix for --temporary-files-path argument.

cyberboh commented 1 week ago

No issue here on cli for windows. You're using termux, maybe it needs some more treatment.

cyberboh commented 1 week ago

--options=packageName=app.rvx.yt.m is not default revanced options, that's why it breaks compilation. So, it's issue on your end.

oSumAtrIX commented 1 week ago

Neither should cause this issue. It has something to do with the paths.

cyberboh commented 1 week ago

But it works on windows. No resource issue here. The path from android and windows could be not same.

decipher3114 commented 1 week ago

@oSumAtrIX This only happens when a custom temp-path is chosen for patching. Probably it generates an incorrect path for decompiled resoures.

LisoUseInAIKyrios commented 1 week ago

If this is an issue with the custom path parameter then this issue could be moved to patched or CLI repo.