revanced-patcher
revanced-patcher copied to clipboard
bug: ReVanced closes when MIUI Optimization is turned on
Type
Crash
Bug description
On MIUI 13.0.6 with MIUI Optimization turned on, the app closes back to the launcher. It takes around half a second for it to close, and you can see the full UI during that time and video thumbnails as well. I wouldn't consider it a crash, and i don't see any relevant data in logcat, but i supplied it anyway.
Steps to reproduce
Build ReVanced Install VancedMicroG Install ReVanced Run ReVanced, will close to launcher
Relevant log output
08-20 21:49:26.532 6056 6056 D DecorView[]: onWindowFocusChanged hasWindowFocus false
08-20 21:49:26.533 6056 6056 I DecorView: showOrHideHighlightView: hasFocus=false; winMode=1; isMrgNull=true
08-20 21:49:28.516 6056 6113 D AnrScout: AppScoutStateMachine created
08-20 21:49:28.521 6056 7982 D CCodec : allocate(c2.android.vorbis.decoder)
08-20 21:49:28.523 6056 7982 I CCodec : setting up 'default' as default (vendor) store
08-20 21:49:28.524 6056 7982 I CCodec : Created component [c2.android.vorbis.decoder]
08-20 21:49:28.524 6056 7982 D CCodecConfig: read media type: audio/vorbis
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.max-count.values
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: output.subscribed-indices.values
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: input.buffers.allocator-ids.values
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.allocator-ids.values
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.allocator-ids.values
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values
08-20 21:49:28.525 6056 7982 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.pool-ids.values
08-20 21:49:28.526 6056 7982 I CCodecConfig: query failed after returning 7 values (BAD_INDEX)
08-20 21:49:28.526 6056 7982 D CCodecConfig: c2 config diff is Dict {
08-20 21:49:28.526 6056 7982 D CCodecConfig: c2::u32 coded.bitrate.value = 64000
08-20 21:49:28.526 6056 7982 D CCodecConfig: c2::u32 input.buffers.max-size.value = 32768
08-20 21:49:28.526 6056 7982 D CCodecConfig: c2::u32 input.delay.value = 0
08-20 21:49:28.526 6056 7982 D CCodecConfig: string input.media-type.value = "audio/vorbis"
08-20 21:49:28.526 6056 7982 D CCodecConfig: string output.media-type.value = "audio/raw"
08-20 21:49:28.526 6056 7982 D CCodecConfig: c2::u32 raw.channel-count.value = 1
08-20 21:49:28.526 6056 7982 D CCodecConfig: c2::u32 raw.sample-rate.value = 48000
08-20 21:49:28.526 6056 7982 D CCodecConfig: }
08-20 21:49:28.527 6056 7981 D MediaCodec: in configure at 1369
08-20 21:49:28.527 6056 7982 D CCodec : [c2.android.vorbis.decoder] buffers are bound to CCodec for this session
08-20 21:49:28.527 6056 7982 D CCodecConfig: no c2 equivalents for durationUs
08-20 21:49:28.528 6056 7982 D CCodecConfig: no c2 equivalents for track-id
08-20 21:49:28.528 6056 7982 D CCodecConfig: no c2 equivalents for csd-1
08-20 21:49:28.528 6056 7982 D CCodecConfig: no c2 equivalents for language
08-20 21:49:28.528 6056 7982 D CCodecConfig: no c2 equivalents for file-format
08-20 21:49:28.528 6056 7982 D CCodecConfig: no c2 equivalents for flags
08-20 21:49:28.528 6056 7982 D CCodecConfig: config failed => CORRUPTED
08-20 21:49:28.528 6056 7982 D CCodecConfig: c2 config diff is c2::u32 raw.sample-rate.value = 44100
08-20 21:49:28.528 6056 7982 W Codec2Client: query -- param skipped: index = 1107298332.
08-20 21:49:28.528 6056 7982 D CCodec : setup formats input: AMessage(what = 0x00000000) = {
08-20 21:49:28.528 6056 7982 D CCodec : int32_t channel-count = 1
08-20 21:49:28.528 6056 7982 D CCodec : int32_t max-input-size = 65307
08-20 21:49:28.528 6056 7982 D CCodec : string mime = "audio/vorbis"
08-20 21:49:28.528 6056 7982 D CCodec : int32_t sample-rate = 44100
08-20 21:49:28.528 6056 7982 D CCodec : } and output: AMessage(what = 0x00000000) = {
08-20 21:49:28.528 6056 7982 D CCodec : int32_t channel-count = 1
08-20 21:49:28.528 6056 7982 D CCodec : string mime = "audio/raw"
08-20 21:49:28.528 6056 7982 D CCodec : int32_t sample-rate = 44100
08-20 21:49:28.528 6056 7982 D CCodec : }
08-20 21:49:28.530 6056 7982 W Codec2Client: query -- param skipped: index = 1342179345.
08-20 21:49:28.530 6056 7982 W Codec2Client: query -- param skipped: index = 2415921170.
08-20 21:49:28.530 6056 7982 E FMQ : grantorIdx must be less than 3
08-20 21:49:28.530 6056 7982 E FMQ : grantorIdx must be less than 3
08-20 21:49:28.530 6056 7982 D CCodecBufferChannel: [c2.android.vorbis.decoder#119] Created input block pool with allocatorID 16 => poolID 20 - OK (0)
08-20 21:49:28.531 6056 6222 D BufferPoolAccessor2.0: bufferpool2 0x6f0c1fca28 : 0(0 size) total buffers - 0(0 size) used buffers - 2/9 (recycle/alloc) - 7/24 (fetch/transfer)
08-20 21:49:28.531 6056 6222 D BufferPoolAccessor2.0: Destruction - bufferpool2 0x6f0c1fca28 cached: 0/0M, 0/0% in use; allocs: 9, 22% recycled; transfers: 24, 71% unfetched
08-20 21:49:28.531 6056 7982 I CCodecBufferChannel: [c2.android.vorbis.decoder#119] Created output block pool with allocatorID 16 => poolID 29 - OK
08-20 21:49:28.531 6056 7982 D CCodecBufferChannel: [c2.android.vorbis.decoder#119] Configured output block pool ids 29 => OK
08-20 21:49:28.531 6056 7982 D CCodecBufferChannel: [c2.android.vorbis.decoder#119] start: updating output delay 0
08-20 21:49:28.532 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.532 6056 7982 E FMQ : grantorIdx must be less than 3
08-20 21:49:28.532 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.533 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.533 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.534 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.534 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.534 6056 6222 E FMQ : grantorIdx must be less than 3
08-20 21:49:28.535 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.535 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.535 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.535 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.536 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.536 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.536 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.536 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.536 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.536 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.537 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.537 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.537 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.537 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.540 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.540 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.541 6056 7981 D MediaCodec: in queueInputBuffer at 1738
08-20 21:49:28.541 6056 7982 D MediaCodec: in onQueueInputBuffer at 4210
08-20 21:49:28.551 6056 7982 D CCodecBufferChannel: [c2.android.vorbis.decoder#119] MediaCodec discarded an unknown buffer
08-20 21:49:28.551 6056 7982 I chatty : uid=10364(com.termux) identical 1 line
08-20 21:49:28.551 6056 7982 D CCodecBufferChannel: [c2.android.vorbis.decoder#119] MediaCodec discarded an unknown buffer
08-20 21:49:28.552 6056 7982 I hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients
08-20 21:49:28.553 6056 7982 E libc : Access denied finding property "ro.vendor.media.video.frc.support"
08-20 21:49:28.567 6056 6056 D DecorView[]: onWindowFocusChanged hasWindowFocus true
08-20 21:49:28.567 6056 6056 I DecorView: showOrHideHighlightView: hasFocus=true; winMode=1; isMrgNull=true
08-20 21:49:30.409 6056 6056 W Choreographer: Frame time is 0.358702 ms in the future! Check that graphics HAL is generating vsync timestamps using the correct timebase.
08-20 21:49:30.525 6056 6056 W Choreographer: Frame time is 0.330202 ms in the future! Check that graphics HAL is generating vsync timestamps using the correct timebase.
08-20 21:49:33.209 6056 6056 W Choreographer: Frame time is 0.357569 ms in the future! Check that graphics HAL is generating vsync timestamps using the correct timebase.
08-20 21:49:33.531 6056 6221 D BufferPoolAccessor2.0: bufferpool2 0x6f0c1fcc28 : 0(0 size) total buffers - 0(0 size) used buffers - 2/9 (recycle/alloc) - 7/24 (fetch/transfer)
08-20 21:49:33.531 6056 6221 D BufferPoolAccessor2.0: evictor expired: 1, evicted: 1
08-20 21:49:34.531 6056 6221 D BufferPoolAccessor2.0: evictor expired: 1, evicted: 0
Screenshots or videos
https://www.youtube.com/watch?v=Pp5usAKALJw
Solution
Disabling MIUI Optimizations fixes the issue.
Additional context
No response
Disable all patches and report back if the issue still exists.
Could you send me the command to disable all patches? I tried doing "--exclusive". It does disable all the patches, but it also gives me errors when it tries to compile the apk:
INFO: Decoding resources
INFO: Reading dex files
INFO: Merging app-release-unsigned.apk
INFO: Skipping timeline-ads: Not explicitly included
INFO: Skipping general-reddit-ads: Not explicitly included
INFO: Skipping pflotsh-ecmwf-subscription-unlock: Not explicitly included
INFO: Skipping minimized-playback-music: Not explicitly included
INFO: Skipping tasteBuilder-remover: Not explicitly included
INFO: Skipping hide-get-premium: Not explicitly included
INFO: Skipping compact-header: Not explicitly included
INFO: Skipping upgrade-button-remover: Not explicitly included
INFO: Skipping background-play: Not explicitly included
INFO: Skipping music-microg-support: Not explicitly included
INFO: Skipping music-video-ads: Not explicitly included
INFO: Skipping codecs-unlock: Not explicitly included
INFO: Skipping exclusive-audio-playback: Not explicitly included
INFO: Skipping promo-code-unlock: Not explicitly included
INFO: Skipping tiktok-ads: Not explicitly included
INFO: Skipping swipe-controls: Not explicitly included
INFO: Skipping seekbar-tapping: Not explicitly included
INFO: Skipping minimized-playback: Not explicitly included
INFO: Skipping amoled: Not explicitly included
INFO: Skipping disable-create-button: Not explicitly included
INFO: Skipping hide-cast-button: Not explicitly included
INFO: Skipping return-youtube-dislike: Not explicitly included
INFO: Skipping hide-autoplay-button: Not explicitly included
INFO: Skipping premium-heading: Not explicitly included
INFO: Skipping custom-branding: Not explicitly included
INFO: Skipping disable-fullscreen-panels: Not explicitly included
INFO: Skipping old-quality-layout: Not explicitly included
INFO: Skipping hide-shorts-button: Not explicitly included
INFO: Skipping hide-watermark: Not explicitly included
INFO: Skipping sponsorblock: Not explicitly included
INFO: Skipping enable-wide-searchbar: Not explicitly included
INFO: Skipping tablet-mini-player: Not explicitly included
INFO: Skipping custom-video-buffer: Not explicitly included
INFO: Skipping always-autorepeat: Not explicitly included
INFO: Skipping microg-support: Not explicitly included
INFO: Skipping settings: Not explicitly included
INFO: Skipping enable-debugging: Not explicitly included
INFO: Skipping custom-playback-speed: Not explicitly included
INFO: Skipping hdr-auto-brightness: Not explicitly included
INFO: Skipping remember-video-quality: Not explicitly included
INFO: Skipping video-ads: Not explicitly included
INFO: Skipping general-ads: Not explicitly included
INFO: Skipping hide-infocard-suggestions: Not explicitly included
INFO: Compiling resources
WARNING: /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/AndroidManifest.xml:106: error: attribute android:localeConfig not found.
WARNING: error: failed processing manifest.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_6696628653991141613735582421301283419.tmp, link, -o, /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/aapt_temp_file, --min-sdk-version, 23, --target-sdk-version, 33, --version-code, 1531043264, --version-name, 17.32.35, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /tmp/APKTOOL4770007872767168087.tmp, -0, arsc, -I, revanced-cache/1.apk, --manifest, /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/AndroidManifest.xml, /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/build/resources.zip]
at brut.androlib.res.AndrolibResources.aapt2Package(AndrolibResources.java:491)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:626)
at app.revanced.patcher.Patcher.save(Patcher.kt:204)
at app.revanced.cli.patcher.Patcher.start$revanced_cli(Patcher.kt:28)
at app.revanced.cli.command.MainCommand.run(MainCommand.kt:160)
at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at app.revanced.cli.main.MainKt.main(Main.kt:7)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_6696628653991141613735582421301283419.tmp, link, -o, /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/aapt_temp_file, --min-sdk-version, 23, --target-sdk-version, 33, --version-code, 1531043264, --version-name, 17.32.35, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /tmp/APKTOOL4770007872767168087.tmp, -0, arsc, -I, revanced-cache/1.apk, --manifest, /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/AndroidManifest.xml, /mnt/d/_Johnex/Desktop/ReVanced/revanced-cache/build/resources.zip]
at brut.util.OS.exec(OS.java:99)
at brut.androlib.res.AndrolibResources.aapt2Package(AndrolibResources.java:487)
... 13 more
Use -r
to skip resource patching.
The behavior is the same
And just to confirm, the unpatched youtube app from the playstore does not have this issue.
Here is a video showing the revanced apk and the playstore install:
https://www.youtube.com/watch?v=5f2Z-tNx-tA
I also got that problem. However, I try enable auto start for microg and it worked normally.
This works for me too. Would there be a way for ReVanced to check if the OS is MIUI, and force enable the microg autostarting?
Hasn't worked for me. I checked "autostart" in app details, still crashing. MIUI
Reopen in revanced/revanced-patches.
https://github.com/revanced/revanced-patches/issues/1167