ReVanced / revanced-manager

💊 Application to use ReVanced on Android
https://revanced.app
GNU General Public License v3.0
17.42k stars 724 forks source link

Unable to patch youtube #1511

Closed dev-leom closed 9 months ago

dev-leom commented 9 months ago

Bug description

i try 5 times to patch youtube with revanced manager. i have the good youtube version and i'm correctly rooted.

Version of ReVanced Manager and version & name of application you tried to patch

Manager: 1.16.0 Youtube v18.45.41

Installation type

Root

Device logs

- Device Info
ReVanced Manager: 1.16.0
Build: release
Model: Xiaomi 12
Android version: 13
Supported architectures: arm64-v8a, armeabi-v7a
Root permissions: Yes

- Patch Info
App: com.google.android.youtube v18.45.41
Patches version: v2.199.0
Patches: Alternative thumbnails, Always autorepeat, Announcements, Bypass URL redirects, Client spoof, Comments, Copy video url, Custom player overlay opacity, Disable auto captions, Disable fullscreen ambient mode, Disable player popup panels, Disable precise seeking gesture, Disable resuming Shorts on startup, Disable rolling number animations, Disable suggested video end screen, Disable zoom haptics, Enable debugging, Enable slide to seek, Enable tablet layout, External downloads, HDR auto brightness, Hide 'Load more' button, Hide Shorts components, Hide ads, Hide album cards, Hide autoplay button, Hide breaking news shelf, Hide captions button, Hide cast button, Hide crowdfunding box, Hide email address, Hide endscreen cards, Hide filter bar, Hide floating microphone button, Hide info cards, Hide layout components, Hide player buttons, Hide seekbar, Hide timestamp, Hide video action buttons, Minimized playback, Navigation buttons, Open links externally, Playback speed, Player flyout menu, Premium heading [Use premium heading: true], Remember video quality, Remove tracking query parameter, Restore old seekbar thumbnails, Restore old video quality menu, Return YouTube Dislike, Seekbar tapping, SponsorBlock, Spoof app version, Spoof device dimensions, Swipe controls, Tablet mini player, Theme [Dark theme background color: @android:color/black, Light theme background color: @android:color/white], Vanced MicroG support, Video ads, Wide searchbar

- Settings
Allow changing patch selection: false
Version compatibility check: true
Show universal patches: false
Patches source: revanced/revanced-patches
Integration source: revanced/revanced-integrations

- Logs
Copying APK
Reading APK
Decoding app manifest
Loading patches
Merging integrations
Deleting existing resource cache directory
Decoding resources
Executing patches
Alternative thumbnails succeeded
Always autorepeat succeeded
Announcements succeeded
Bypass URL redirects succeeded
Client spoof succeeded
Comments succeeded
Copy video url succeeded
Custom player overlay opacity succeeded
Disable auto captions succeeded
Disable fullscreen ambient mode succeeded
Disable player popup panels succeeded
Disable precise seeking gesture succeeded
Disable resuming Shorts on startup succeeded
Disable rolling number animations succeeded
Disable suggested video end screen succeeded
Disable zoom haptics succeeded
Enable debugging succeeded
Enable slide to seek succeeded
Enable tablet layout succeeded
External downloads succeeded
HDR auto brightness succeeded
Hide 'Load more' button succeeded
Hide Shorts components succeeded
Hide ads succeeded
Hide album cards succeeded
Hide autoplay button succeeded
Hide breaking news shelf succeeded
Hide captions button succeeded
Hide cast button succeeded
Hide crowdfunding box succeeded
Hide email address succeeded
Hide endscreen cards succeeded
Hide filter bar succeeded
Hide floating microphone button succeeded
Hide info cards succeeded
Hide layout components succeeded
Hide player buttons succeeded
Hide seekbar succeeded
Hide timestamp succeeded
Hide video action buttons succeeded
Minimized playback succeeded
Navigation buttons succeeded
Open links externally succeeded
Playback speed succeeded
Player flyout menu succeeded
Premium heading failed: app.revanced.patcher.patch.PatchException: /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/res/drawable-xxxhdpi/yt_premium_wordmark_header_light.png
    at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:185)
    at app.revanced.patcher.Patcher$apply$1.invokeSuspend(Patcher.kt:202)
    at app.revanced.patcher.Patcher$apply$1.invoke(Unknown Source:8)
    at app.revanced.patcher.Patcher$apply$1.invoke(Unknown Source:4)
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
    at app.revanced.manager.flutter.MainActivity$runPatcher$1$2$1.invokeSuspend(MainActivity.kt:324)
    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:1)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
    at app.revanced.manager.flutter.MainActivity.runPatcher$lambda$36(MainActivity.kt:323)
    at app.revanced.manager.flutter.MainActivity.$r8$lambda$wwTqh4bVDMuwAT_qXBREk8gLHGU(Unknown Source:0)
    at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda5.run(Unknown Source:24)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: java.nio.file.NoSuchFileException: /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/res/drawable-xxxhdpi/yt_premium_wordmark_header_light.png
    at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:526)
    at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
    at java.nio.file.Files.copy(Files.java:1274)
    at app.revanced.patches.youtube.layout.branding.header.PremiumHeadingPatch.execute(PremiumHeadingPatch.kt:58)
    at app.revanced.patches.youtube.layout.branding.header.PremiumHeadingPatch.execute(PremiumHeadingPatch.kt:11)
    at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:177)
    ... 18 more
Remember video quality succeeded
Remove tracking query parameter succeeded
Restore old seekbar thumbnails succeeded
Restore old video quality menu succeeded
Return YouTube Dislike succeeded
Seekbar tapping succeeded
SponsorBlock succeeded
Spoof app version succeeded
Spoof device dimensions succeeded
Swipe controls succeeded
Tablet mini player succeeded
Theme succeeded
Vanced MicroG support succeeded
Video ads succeeded
Wide searchbar succeeded
Change package name succeeded
Compiling patched dex files
Compiled classes.dex
Compiled classes2.dex
Compiled classes3.dex
Compiled classes4.dex
Compiled classes5.dex
Compiled classes6.dex
Compiled classes7.dex
Compiled classes8.dex
Compiling modified resources
An error occurred:
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/app/~~K0oDFfUZFjOcbYd-0fKD_Q==/app.revanced.manager.flutter-0yuawO6k4WG1pYuFmFG_aQ==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/aapt_temp_file, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 34, --version-code, 1541148096, --version-name, 18.45.41, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL5681247060061092952.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/build/resources.zip]
    at brut.androlib.AaptInvoker.invokeAapt2(AaptInvoker.java:246)
    at brut.androlib.AaptInvoker.invokeAapt(AaptInvoker.java:391)
    at app.revanced.patcher.data.ResourceContext.get(ResourceContext.kt:126)
    at app.revanced.patcher.Patcher.get(Patcher.kt:262)
    at app.revanced.manager.flutter.MainActivity.runPatcher$lambda$36(MainActivity.kt:354)
    at app.revanced.manager.flutter.MainActivity.$r8$lambda$wwTqh4bVDMuwAT_qXBREk8gLHGU(Unknown Source:0)
    at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda5.run(Unknown Source:24)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/data/app/~~K0oDFfUZFjOcbYd-0fKD_Q==/app.revanced.manager.flutter-0yuawO6k4WG1pYuFmFG_aQ==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/aapt_temp_file, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 34, --version-code, 1541148096, --version-name, 18.45.41, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL5681247060061092952.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/cache/patcher/tmp-RTASKU/cache/build/resources.zip]
    at brut.util.OS.exec(OS.java:104)
    at brut.androlib.AaptInvoker.invokeAapt2(AaptInvoker.java:242)
    ... 7 more

Patcher logs

No response

Acknowledgements

KobeW50 commented 9 months ago

https://github.com/ReVanced/revanced-manager/issues/1493#issuecomment-1809345566

Basically, see if you still get exit code 1 when you exclude the Premium heading patch.

dev-leom commented 9 months ago

done, still get exit code 1.

oSumAtrIX commented 9 months ago

You are patching a split APK file but need a full APK

raxod502 commented 9 months ago

You are patching a split APK file but need a full APK

What does this mean? Are there multiple distributions of the YouTube app available? The one I'm using is just the one from the Google Play Store (or Aurora Store really), and I assumed everyone would have pretty much the same.

How does one go about validating whether an APK is split or full, and how does one obtain a non-split version of the YouTube APK?

raxod502 commented 9 months ago

Answered my own question (perhaps we can add this to the documentation since it seems to be a common problem and seems to be broken by default?)

https://old.reddit.com/r/revancedapp/comments/xna2gn/youtube_unsupported_version_and_split_apk/ https://www.apkmirror.com/apk/google-inc/youtube/youtube-18-45-41-release/youtube-18-45-41-android-apk-download/

Apparently the version of the YouTube app you get from the Google Play Store is the split version, and indeed there is a separate non-split version that can be obtained from APKMirror. So, download and install that, then patch.

Red-M commented 9 months ago

it would be useful if the manager would combine split APKs then patch the merged APK, having to use APKMirror isn't great.

AndnixSH commented 9 months ago

How about auto merge apk? This project does decent job https://github.com/REAndroid/APKEditor

Ushie commented 9 months ago

You can make suggestions here https://github.com/ReVanced/revanced-patcher/issues/73

raxod502 commented 9 months ago

I submitted https://github.com/ReVanced/revanced-manager/pull/1543 to document this advice since it seems the maintainers are needing to answer this question a lot.

yonggamer commented 5 months ago

maby this helps download YouTube 19.09.37 split and apk change the extention apkm to zip extract the files select those you want Merge the files with APKEditor V1.3.7 decompile apk and the Merged apk copy yt_premium_wordmark_header_light.png from the apk to the decompiled Merged apk then compile the Merged apk the Merged apk it worked for me