ReVanced / revanced-patches

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

bug: Youtube `settings` patch failed to resolve ThemeSetterAppFingerprint #2476

Closed mikk150 closed 10 months ago

mikk150 commented 1 year ago

Type

Error while patching

Bug description

Patching youtube with patches that depend on patch settings fails with Failed to resolve ThemeSetterAppFingerprint

Steps to reproduce

  1. Download Youtube v17.49.37
  2. Select APK to patch via patcher
  3. Select General Adds
  4. Press Patch

Relevant log output

Failed to apply general-ads: 'general-ads' depends on 'GeneralAdsResourcePatch' but the following error was raised: 'GeneralAdsResourcePatch' depends on 'settings' but the following error was raised: Failed to resolve ThemeSetterAppFingerprint
Failed to apply minimized-playback: 'minimized-playback' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
Failed to apply settings: 'settings' did not succeed previously
Failed to apply video-ads: 'video-ads' depends on 'settings' but the following error was raised: 'settings' did not succeed previously

Screenshots or videos

No response

Solution

No response

Additional context

No response

Acknowledgements

bigyihsuan commented 1 year ago

I can confirm I'm getting this as well. It seems quite a few patches depend on this missing settings patch.

What's stranger is that it exists in the patches.json file (as of 2.147.0), but Vanced Manager is not recognizing it.

Initializing installer
Creating working directory
Copying original apk
Unpacking input apk
Reading dex files
Decoding AndroidManifest.xml only, because resources are not needed
Merging integrations
Deleting existing resource cache directory
Decoding resources
Applied custom-branding
Failed to apply general-ads: 'general-ads' depends on 'GeneralAdsResourcePatch' but the following error was raised: 'GeneralAdsResourcePatch' depends on 'settings' but the following error was raised: Failed to resolve ThemeSetterAppFingerprint
Failed to apply hdr-auto-brightness: 'hdr-auto-brightness' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
Applied premium-heading
Failed to apply return-youtube-dislike: 'return-youtube-dislike' depends on 'return-youtube-dislike-resource-patch' but the following error was raised: 'return-youtube-dislike-resource-patch' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
Failed to apply settings: 'settings' did not succeed previously
Failed to apply sponsorblock: 'sponsorblock' depends on 'sponsorblock-resource-patch' but the following error was raised: 'sponsorblock-resource-patch' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
Failed to apply swipe-controls: 'swipe-controls' depends on 'swipe-controls-resource-patch' but the following error was raised: 'swipe-controls-resource-patch' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
Applied theme
Failed to apply video-ads: 'video-ads' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
Repacking patched apk
Compiling resources
Writing modified dex files
Finished!
oSumAtrIX commented 1 year ago

It doesn't exist in the json.

bigyihsuan commented 1 year ago

Workaround found: uninstall and reinstall Revanced Manager, and try patching again. The only problem is that the settings doesn't show in the patches list.

mikk150 commented 1 year ago

So, new behaviors, if I give root access to Revanced Manager, it fails to patch, if I do not, then it succeeds, but cannot install(For obvious reasons)

FahimAnayet commented 1 year ago

So, new behaviors, if I give root access to Revanced Manager, it fails to patch, if I do not, then it succeeds, but cannot install(For obvious reasons)

This actually helps. But I got a walkarownd to install as root. First revoke root access of ReVanced then select the patches and start patching. And after finishing patch before install enable root access and than install. Works like a charm

oSumAtrIX commented 1 year ago

The patching process happens regardless of root. Reason why you can also patch on other devices with the CLI instead of directly on your phone.

cpc2 commented 1 year ago

The patching process happens regardless of root. Reason why you can also patch on other devices with the CLI instead of directly on your phone.

It should be like this but I can confirm revoking root access makes it so the patching succeeds. I tested it several times and it's definitely that.

Edit: though I still can't manage to install it successfully afterwards.

oSumAtrIX commented 1 year ago

That would be weird because the patching process has nothing to do with root or not. Root is first used when installing/mounting.

exzhawk commented 1 year ago

The patching process happens regardless of root. Reason why you can also patch on other devices with the CLI instead of directly on your phone.

It should be like this but I can confirm revoking root access makes it so the patching succeeds. I tested it several times and it's definitely that.

Edit: though I still can't manage to install it successfully afterwards.

I'm use microg patch(no need for root, but I gave revanced manager root access), and facing the same problem. Just use the workaround mikk150 and FahimAnayet mentioned above: revoke root access to make a successful patch. Though the revanced manager can not install the APK file, there is an option on the left top menu to allow the patched APK to be exported. Then I just opened a file manager to install the patched APK file. might be helpful for root patches.

universebreaker commented 1 year ago

I have the same error when using revanced-cli for patching already using latest release of cli, patches and integrations, and the error still exist the error only occurs when patching apk of 18.06.XX (18.06.35, 18.06.39, 18.06.41 tested at the time of writing) and doesn't happen when patching older versions (no youtube beta version tested)

Steps to reproduce java.exe -jar revanced-cli-2.20.0-all.jar -c -a youtube_18.06.41.apk -b revanced-patches-2.163.0.jar -m revanced-integrations-0.98.0.apk --experimental -o revanced-18.06.41.apk

Relevant log output

app.revanced.patcher.patch.PatchResultError: 'comments' depends on 'comments-resource-patch' but the following error was raised: 'comments-resource-patch' depends on 'settings' but the following error was raised: Failed to resolve ThemeSetterAppFingerprint
        at app.revanced.patcher.Patcher.executePatches$executePatch(Patcher.kt:311)
        at app.revanced.patcher.Patcher.access$executePatches$executePatch(Patcher.kt:37)
        at app.revanced.patcher.Patcher$executePatches$1.invokeSuspend(Patcher.kt:355)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:127)
        at app.revanced.utils.patcher.PatcherKt.applyPatchesVerbose(Patcher.kt:83)
        at app.revanced.cli.patcher.Patcher.start$revanced_cli(Patcher.kt:20)
        at app.revanced.cli.command.MainCommand.run(MainCommand.kt:152)
        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.main.MainKt.main(Main.kt:7)
嚴重: copy-video-url failed:
app.revanced.patcher.patch.PatchResultError: 'copy-video-url' depends on 'copy-video-url-resource' but the following error was raised: 'copy-video-url-resource' depends on 'settings' but the following error was raised: 'settings' did not succeed previously
        at app.revanced.patcher.Patcher.executePatches$executePatch(Patcher.kt:311)
        at app.revanced.patcher.Patcher.access$executePatches$executePatch(Patcher.kt:37)
        at app.revanced.patcher.Patcher$executePatches$1.invokeSuspend(Patcher.kt:355)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:127)
        at app.revanced.utils.patcher.PatcherKt.applyPatchesVerbose(Patcher.kt:83)
        at app.revanced.cli.patcher.Patcher.start$revanced_cli(Patcher.kt:20)
        at app.revanced.cli.command.MainCommand.run(MainCommand.kt:152)
        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.main.MainKt.main(Main.kt:7)
oSumAtrIX commented 1 year ago

These are not compatible versions by the patches, check the compatible versions.

vinceingithub commented 1 year ago

Is there any fix for this?

oSumAtrIX commented 1 year ago

Patch compatible versions

Martinligabue commented 1 year ago

Patch compatible versions

I have the exact same error with both compatible and incompatible versions.

LisoUseInAIKyrios commented 1 year ago

Patch compatible versions

I have the exact same error with both compatible and incompatible versions.

Using a non compatible version is unknown territory, and the expected outcome is failure.

For patching a compatible app version, try:

Martinligabue commented 1 year ago

Patch compatible versions

I have the exact same error with both compatible and incompatible versions.

Using a non compatible version is unknown territory, and the expected outcome is failure.

For patching a compatible app version, try:

  • Uninstall ReVanced Manager
  • Uninstall ReVanced YouTube
  • Reinstall latest Manager
  • Patch using recommended patches

I did that, even just applying the microg patch only with youtube at correct version and revanced stock gives the same error. As everyone has said, that's not the problem, it's root, using root gives the error, denying root solves it. I did that, even just applying the microg patch only with youtube at correct version and revanced stock gives the same error. As everyone has said, that's not the problem, it's root, using root gives the error, denying root solves it. Without root, even the incompatible versions are installed correctly with no problem, so until a fix is made to address the root issue, there is no other way but to manually deny root. It won't be solved by "patching compatible version". I hope that was clear enough.

oSumAtrIX commented 1 year ago

If that is really the case it's very weird. Root or not is first required at installing the app. At no time root is required for patching applications.

Martinligabue commented 1 year ago

If that is really the case it's very weird. Root or not is first required at installing the app. At no time root is required for patching applications.

should we move the issue to the app repo?

oSumAtrIX commented 1 year ago

Dunno, it kinda belongs to both.

SeasonPhan commented 1 year ago

i can confirm this problem exist on lastest 0.0.57 with patch 2.166.0 revoking root access fixes the problem (no need for reinstalling, clearing Manager data/cache , just purely revoking root access from magisk and restart Manager)

edit: im running android 13

rbyrnedugan commented 1 year ago

I was facing this issue today (non-rooted Pixel 7 Pro on Android 13) when trying to patch the 18.05.40 version of YouTube. After upgrading my stock YouTube app from 17.x to 18.05.40, the issue went away and patching worked properly.

Martinligabue commented 1 year ago

on rooted Pixel 3a it does work with root, not sure what's causing it then

VDavid003 commented 1 year ago

Fails on Youtube version 18.17.38 on both the manager app (root/no root), and CLI with this error. Works fine on 18.16.37.

hollowstrawberry commented 1 year ago

Same issue on a Xiaomi phone running Pixel Experience Android 11. Fixed by revoking root access.

oSumAtrIX commented 1 year ago

If this is still a problem, please open a new issue.