ReVanced / revanced-manager

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

bug: Exporting/saving a duplicate APK renders the extension #1527

Closed SubZero5 closed 7 months ago

SubZero5 commented 7 months ago

Bug description

If I re export a patched APK file, it is named as youtube-revanced_v18.45.41.apk (1) instead of youtube-revanced_v18.45.41 (1).apk thus making the file not installable unless it is renamed.

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

ReVanced Manager v1.16.0 YouTube v18.45.41

Installation type

Non-root

Device logs

--------- beginning of system
11-26 13:02:12.229 13845 13845 W HwApsManager: HwApsManagerService, registerCallback, start !
11-26 13:02:23.553 13845 13845 D RtgSched: resetRtgSchedHandle failed enable:0
11-26 13:02:23.586 13845 13845 I VRI[MainActivity]: send MSG_WINDOW_FOCUS_CHANGED msg
11-26 13:02:23.586 13845 13845 I ViewRootImpl: focus window changed, set pointer icon to default
11-26 13:02:42.298 13845 13845 D ActivityThread: Won't deliver top position change in state=4
11-26 13:02:42.302 13845 13845 D RtgSched: resetRtgSchedHandle failed enable:1
11-26 13:02:42.347 13845 13845 I VRI[MainActivity]: send MSG_WINDOW_FOCUS_CHANGED msg
11-26 13:02:46.248 13845 13845 I VRI[MainActivity]: send MSG_WINDOW_FOCUS_CHANGED msg
11-26 13:02:46.358 13845 13845 D RtgSched: resetRtgSchedHandle failed enable:0
11-26 13:03:15.633 13845 13845 I ActivityThread: Performing restart of ActivityRecord{cfdf8b5 token=android.os.BinderProxy@c5ecec {app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity}} start=false callers:android.app.servertransaction.TransactionExecutor.performLifecycleSequence:258 android.app.servertransaction.TransactionExecutor.cycleToPath:215 android.app.servertransaction.TransactionExecutor.cycleToPath:197 android.app.servertransaction.TransactionExecutor.executeCallbacks:146 android.app.servertransaction.TransactionExecutor.execute:103 android.app.ActivityThread$H.handleMessage:2842 android.os.Handler.dispatchMessage:114 android.os.Looper.loopOnce:206 android.os.Looper.loop:296 android.app.ActivityThread.main:9187 
--------- beginning of main
11-26 13:03:15.634 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@aa0691f
11-26 13:03:15.636 13845 13845 I DecorView[]: set decor visibility 0
11-26 13:03:15.637 13845 13845 I InstallPlugin: handleActivityResult(22643,0,null)
11-26 13:03:15.638 13845 13869 D ZrHung.AppEyeUiProbe: restart watching
11-26 13:03:15.638 13845 13845 I DecorView[]: set decor visibility 0
11-26 13:03:15.638 13845 13845 D Choreographer: still have 1 traversal callbacks
11-26 13:03:15.639 13845 13845 I SurfaceView: 51486316 win vis 8
11-26 13:03:15.639 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@34e646c
11-26 13:03:15.653 13845 13845 I PhoneWindow: REFRESH_STATUS_BAR_ATTRS OnContentApplyWindowInsetsListener has SYSTEM_UI_LAYOUT_FLAGS
11-26 13:03:15.654 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@281da35
11-26 13:03:15.654 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@bc43eca
11-26 13:03:15.663 13845 13845 I SurfaceView: 51486316 win vis 0
11-26 13:03:15.663 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@7ec783b
11-26 13:03:15.686 13845 13845 I SurfaceControl: SurfaceControl 0xb4000071731167a0
11-26 13:03:15.689 13845 13845 I BufferQueueConsumer: [](id:361500000002,api:0,p:-1,c:13845) connect: controlledByApp=false
11-26 13:03:15.690 13845 13845 I PhoneWindow: REFRESH_STATUS_BAR_ATTRS OnContentApplyWindowInsetsListener has SYSTEM_UI_LAYOUT_FLAGS
11-26 13:03:15.691 13845 13874 I BufferQueueProducer: [VRI[MainActivity]#2(BLAST Consumer)2](id:361500000002,api:0,p:-1,c:13845) connect: api=1 producerControlledByApp=true
11-26 13:03:15.691 13845 13845 I SurfaceView: 51486316 setWindowStopped false
11-26 13:03:15.691 13845 13874 E OpenGLRenderer: Unable to match the desired swap behavior.
11-26 13:03:15.692 13845 13845 I SurfaceControl: SurfaceControl 0xb4000071730f85b0
11-26 13:03:15.693 13845 13845 I SurfaceControl: SurfaceControl 0xb4000071731550a0
11-26 13:03:15.693 13845 13845 I SurfaceControl: SurfaceControl 0xb4000071730ff9e0
11-26 13:03:15.694 13845 13845 I SurfaceControl: SurfaceControl 0xb4000071731049a0
11-26 13:03:15.695 13845 13862 I SurfaceControl: SurfaceControl 0xb4000071730f7e20
11-26 13:03:15.695 13845 13845 I BufferQueueConsumer: [](id:361500000003,api:0,p:-1,c:13845) connect: controlledByApp=false
11-26 13:03:15.695 13845 13845 I SurfaceView: 51486316 create Surface(name=SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity])/@0x4f35b58 Surface(name=Background for SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity])/@0xf82e4b1 Surface(name=SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity](BLAST))/@0xe4f7d96 android.graphics.BLASTBufferQueue@8205d17
11-26 13:03:15.697 13845 13880 I BufferQueueProducer: [SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity]#3(BLAST Consumer)3](id:361500000003,api:0,p:-1,c:13845) connect: api=1 producerControlledByApp=true
11-26 13:03:15.706 13845 13874 I SurfaceControl: ~SurfaceControl 0xb400007173123530
11-26 13:03:15.706 13845 13845 I HwViewRootImpl: removeInvalidNode jank list is null
11-26 13:03:15.719 13845 13864 I SurfaceControl: ~SurfaceControl 0xb400007173115bf0
11-26 13:03:15.719 13845 13864 I SurfaceControl: ~SurfaceControl 0xb400007173114a10
11-26 13:03:15.719 13845 13864 I SurfaceControl: ~SurfaceControl 0xb400007173118690
11-26 13:03:15.809 13845 13864 I SurfaceControl: SurfaceControl 0xb400007173116c70
11-26 13:03:15.809 13845 13864 I SurfaceControl: SurfaceControl 0xb400007173123ab0
11-26 13:03:15.810 13845 13845 I SurfaceControl: nativeRelease 0xb4000071730f7e20 count: 2
11-26 13:03:15.811 13845 13845 I SurfaceControl: ~SurfaceControl 0xb4000071730f7e20
11-26 13:03:15.817 13845 13845 I PhoneWindow: REFRESH_STATUS_BAR_ATTRS OnContentApplyWindowInsetsListener has SYSTEM_UI_LAYOUT_FLAGS
11-26 13:03:15.990 13845 13845 I SurfaceControl: nativeRelease 0xb400007173123ab0 count: 2
11-26 13:03:15.990 13845 13845 I SurfaceControl: ~SurfaceControl 0xb400007173123ab0
11-26 13:03:15.991 13845 13845 I SurfaceControl: nativeRelease 0xb400007173116c70 count: 2
11-26 13:03:15.991 13845 13845 I SurfaceControl: ~SurfaceControl 0xb400007173116c70
11-26 13:03:15.992 13845 13845 I SurfaceView: 51486316 setWindowStopped true
11-26 13:03:15.994 13845 13880 I BufferQueueProducer: [SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity]#3(BLAST Consumer)3](id:361500000003,api:1,p:13845,c:13845) disconnect: api 1
11-26 13:03:15.994 13845 13845 I BufferQueueProducer: [SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity]#3(BLAST Consumer)3](id:361500000003,api:0,p:-1,c:13845) disconnect: api -1
11-26 13:03:15.995 13845 13845 I BufferQueueConsumer: [SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity]#3(BLAST Consumer)3](id:361500000003,api:0,p:-1,c:13845) disconnect
11-26 13:03:15.995 13845 13845 I SurfaceView: 51486316 REL Surface(name=SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity])/@0x4f35b58 Surface(name=Background for SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity])/@0xf82e4b1 Surface(name=SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity](BLAST))/@0xe4f7d96 T android.view.SurfaceControl$Transaction@63d70
11-26 13:03:15.995 13845 13845 I SurfaceControl: nativeRelease 0xb4000071731550a0 count: 4
11-26 13:03:15.995 13845 13845 I SurfaceControl: nativeRelease 0xb4000071731049a0 count: 4
11-26 13:03:15.995 13845 13845 I SurfaceControl: nativeRelease 0xb4000071730ff9e0 count: 3
11-26 13:03:15.995 13845 13845 I SurfaceControl: nativeRelease 0xb4000071730f85b0 count: 2
11-26 13:03:15.995 13845 13845 I SurfaceControl: ~SurfaceControl 0xb4000071730f85b0
11-26 13:03:15.995 13845 13845 I SurfaceControl: nativeRelease 0xb4000071731167a0 count: 6
11-26 13:03:16.000 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@e0078e9
11-26 13:03:16.000 13845 13845 I DecorView[]: set decor visibility 4
11-26 13:03:16.004 13845 13845 I SurfaceView: 51486316 win vis 4
11-26 13:03:16.004 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@840a96e
11-26 13:03:16.008 13845 13874 I BufferQueueProducer: [VRI[MainActivity]#2(BLAST Consumer)2](id:361500000002,api:1,p:13845,c:13845) disconnect: api 1
11-26 13:03:16.012 13845 13874 I BufferQueueConsumer: [VRI[MainActivity]#2(BLAST Consumer)2](id:361500000002,api:0,p:-1,c:13845) disconnect
11-26 13:03:16.019 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@3bd80f
11-26 13:03:16.639 13845 13869 D ZrHung.AppEyeUiProbe: not watching, wait.
11-26 13:03:18.199 13845 13845 D ActivityThread: Won't deliver top position change in state=5
11-26 13:03:18.205 13845 13845 I ActivityThread: Performing restart of ActivityRecord{cfdf8b5 token=android.os.BinderProxy@c5ecec {app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity}} start=false callers:android.app.servertransaction.TransactionExecutor.performLifecycleSequence:258 android.app.servertransaction.TransactionExecutor.cycleToPath:215 android.app.servertransaction.TransactionExecutor.executeLifecycleState:187 android.app.servertransaction.TransactionExecutor.execute:105 android.app.ActivityThread$H.handleMessage:2842 android.os.Handler.dispatchMessage:114 android.os.Looper.loopOnce:206 android.os.Looper.loop:296 android.app.ActivityThread.main:9187 java.lang.reflect.Method.invoke:-2 
11-26 13:03:18.207 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@fe9c09c
11-26 13:03:18.209 13845 13845 I DecorView[]: set decor visibility 0
11-26 13:03:18.211 13845 13845 I DecorView[]: set decor visibility 0
11-26 13:03:18.211 13845 13869 D ZrHung.AppEyeUiProbe: restart watching
11-26 13:03:18.218 13845 13845 I SurfaceView: 51486316 win vis 0
11-26 13:03:18.218 13845 13845 I SurfaceView: 51486316 REL null null null T android.view.SurfaceControl$Transaction@3debaa5
11-26 13:03:18.265 13845 13845 I SurfaceControl: SurfaceControl 0xb40000717311a2c0
11-26 13:03:18.266 13845 13845 I BufferQueueConsumer: [](id:361500000004,api:0,p:-1,c:13845) connect: controlledByApp=false
11-26 13:03:18.267 13845 13864 I SurfaceControl: SurfaceControl 0xb40000717310cae0
11-26 13:03:18.267 13845 13864 I SurfaceControl: SurfaceControl 0xb400007173118690
11-26 13:03:18.268 13845 13845 I PhoneWindow: REFRESH_STATUS_BAR_ATTRS OnContentApplyWindowInsetsListener has SYSTEM_UI_LAYOUT_FLAGS
11-26 13:03:18.268 13845 13874 I BufferQueueProducer: [VRI[MainActivity]#4(BLAST Consumer)4](id:361500000004,api:0,p:-1,c:13845) connect: api=1 producerControlledByApp=true
11-26 13:03:18.268 13845 13845 I SurfaceView: 51486316 setWindowStopped false
11-26 13:03:18.269 13845 13845 I SurfaceControl: SurfaceControl 0xb400007173123ab0
11-26 13:03:18.269 13845 13874 E OpenGLRenderer: Unable to match the desired swap behavior.
11-26 13:03:18.269 13845 13845 I SurfaceControl: SurfaceControl 0xb4000071730f7e20
11-26 13:03:18.270 13845 13845 I SurfaceControl: SurfaceControl 0xb40000717310edf0
11-26 13:03:18.271 13845 13845 I SurfaceControl: SurfaceControl 0xb40000717311b080
11-26 13:03:18.272 13845 13845 I BufferQueueConsumer: [](id:361500000005,api:0,p:-1,c:13845) connect: controlledByApp=false
11-26 13:03:18.272 13845 13845 I SurfaceView: 51486316 create Surface(name=SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity])/@0x351ee7a Surface(name=Background for SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity])/@0xce7e62b Surface(name=SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity](BLAST))/@0x7204a88 android.graphics.BLASTBufferQueue@ca55c21
11-26 13:03:18.275 13845 13880 I BufferQueueProducer: [SurfaceView[app.revanced.manager.flutter/app.revanced.manager.flutter.MainActivity]#5(BLAST Consumer)5](id:361500000005,api:0,p:-1,c:13845) connect: api=1 producerControlledByApp=true
11-26 13:03:18.280 13845 13874 I SurfaceControl: ~SurfaceControl 0xb4000071731167a0
11-26 13:03:18.297 13845 13864 I SurfaceControl: ~SurfaceControl 0xb4000071731550a0
11-26 13:03:18.297 13845 13864 I SurfaceControl: ~SurfaceControl 0xb4000071731049a0
11-26 13:03:18.297 13845 13864 I SurfaceControl: ~SurfaceControl 0xb4000071730ff9e0
11-26 13:03:18.334 13845 13845 I VRI[MainActivity]: send MSG_WINDOW_FOCUS_CHANGED msg
11-26 13:03:18.340 13845 13845 D DecorView: showOrHideHighlightView: hasFocus=true; winMode=1; isMrgNull=true
11-26 13:03:18.340 13845 13845 W InputMethodManager: startInputReason = 1
11-26 13:03:18.353 13845 13845 W InputMethodManager: startInputReason = 6
11-26 13:03:18.377 13845 14328 I SurfaceControl: SurfaceControl 0xb4000071730f5e80
11-26 13:03:18.377 13845 14328 I SurfaceControl: SurfaceControl 0xb4000071730f8a80
11-26 13:03:18.377 13845 14328 I SurfaceControl: SurfaceControl 0xb40000717310d7f0
11-26 13:03:18.378 13845 13845 I SurfaceControl: nativeRelease 0xb400007173118690 count: 2
11-26 13:03:18.378 13845 13845 I SurfaceControl: ~SurfaceControl 0xb400007173118690
11-26 13:03:18.378 13845 13845 I SurfaceControl: nativeRelease 0xb40000717310cae0 count: 2
11-26 13:03:18.378 13845 13845 I SurfaceControl: ~SurfaceControl 0xb40000717310cae0
11-26 13:03:18.654 13845 13845 E RtgSchedIpcFile: RtgSchedIpcFile failed to open /proc/13845/rtg
11-26 13:03:18.654 13845 13845 I RmeSchedManager: init Rme, version is: v1.0
11-26 13:03:18.654 13845 13845 E RtgSchedIpcFile: setCommandByIoctl not opened
11-26 13:03:18.654 13845 13845 D RtgSched: resetRtgSchedHandle failed enable:1
11-26 13:03:18.836 13845 14225 I SurfaceControl: nativeRelease 0xb4000071730fecd0 count: 5
11-26 13:03:18.857 13845 14328 I SurfaceControl: ~SurfaceControl 0xb4000071730fecd0

Patcher logs

- Device Info
ReVanced Manager: 1.16.0
Build: release
Model: REA-NX9
Android version: 13
Supported architectures: arm64-v8a, armeabi-v7a, armeabi
Root permissions: No

- Patch Info
App: com.google.android.youtube v18.45.41
Patches version: v2.201.0
Patches: Alternative thumbnails, Bypass URL redirects, Client spoof, Comments, Custom branding [App name: YouTube ReVanced, App icon: ReVanced*Logo], Custom player overlay opacity, Disable auto captions, Disable player popup panels, Enable tablet layout, External downloads, HDR auto brightness, 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, Seekbar tapping, SponsorBlock, Spoof app version, 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: true
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
Bypass URL redirects succeeded
Client spoof succeeded
Comments succeeded
Custom branding succeeded
Custom player overlay opacity succeeded
Disable auto captions succeeded
Disable player popup panels succeeded
Enable tablet layout succeeded
External downloads succeeded
HDR auto brightness 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 succeeded
Remember video quality succeeded
Seekbar tapping succeeded
SponsorBlock succeeded
Spoof app version 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
Signing APK
Patched

Acknowledgements

dhruvanbhalara commented 7 months ago

Hi,

Seems it's similar to #559 which was fixed https://github.com/revanced/revanced-manager/pull/837, as a new package is used for this functionality, I assume the package's native code needs to be modified.

@Ushie, I can migrate cr_file_saver to AGP8 then we can use the same fork to close this issue.

Ushie commented 7 months ago

Hey, @TheAabedKhan can you check this out? what was the motivation behind switching packages? I assume it was done during one of the patch options commits

Ushie commented 7 months ago

Nevermind, it seems like it was done in https://github.com/ReVanced/revanced-manager/pull/1404

@dhruvanbhalara I can assign you to this issue, thank you