revanced-manager icon indicating copy to clipboard operation
revanced-manager copied to clipboard

bug: Can't select file paths

Open szbinks opened this issue 1 year ago • 14 comments

Bug description

On a Samsung phone:

  1. Launch Revanced Manager
  2. Patcher
  3. Select an application
  4. Storage
  5. Recommended version of youtube apk
  6. Selected Patches
  7. Custom Branding
  8. Add options
  9. App icon
  10. Custom value
  11. 3 dots next to ReVanced*logo
  12. Select folder
  13. Go to the folder that contain required folders with files
  14. Tap on "use this folder"
  15. Tap on authorize
  16. Start patching
  17. There's an error which says "No such file or directory" when revanced tries to eccess the given folder

Error logs

- Device Info
ReVanced Manager: 1.18.0
Model: SM-G991B
Android version: 14
Supported architectures: arm64-v8a, armeabi-v7a, armeabi
Root permissions: No

- Patch Info
App: com.google.android.youtube v19.04.37 (Suggested: v19.04.37)
Patches version: v4.2.0
Patches added: Change header, Custom branding [App name: YT Revanced, App icon: content://com.android.externalstorage.documents/tree/primary%3ARevanced%2FRevanced%20Icon%20Pack]
Patches removed: None
Default patch options changed: None

- 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
Applied 62 patches
Custom branding failed: app.revanced.patcher.patch.PatchException: content:/com.android.externalstorage.documents/tree/primary%3ARevanced%2FRevanced%20Icon%20Pack/mipmap-xxxhdpi/adaptiveproduct_youtube_background_color_108.png: open failed: ENOENT (No such file or directory)
    at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:185)
    at app.revanced.patcher.Patcher$apply$1.invokeSuspend(Patcher.kt:203)
    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:341)
    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:340)
    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.io.FileNotFoundException: content:/com.android.externalstorage.documents/tree/primary%3ARevanced%2FRevanced%20Icon%20Pack/mipmap-xxxhdpi/adaptiveproduct_youtube_background_color_108.png: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:574)
    at java.io.FileInputStream.<init>(FileInputStream.java:160)
    at kotlin.io.FilesKt__FileReadWriteKt.readBytes(FileReadWrite.kt:63)
    at app.revanced.patches.youtube.layout.branding.CustomBrandingPatch.execute(CustomBrandingPatch.kt:90)
    at app.revanced.patches.youtube.layout.branding.CustomBrandingPatch.execute(CustomBrandingPatch.kt:14)
    at app.revanced.patcher.Patcher$apply$1.invokeSuspend$executePatch(Patcher.kt:177)
    ... 18 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Linux.open(Native Method)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8756)
    at libcore.io.IoBridge.open(IoBridge.java:560)
    ... 23 more
Compiling patched dex files
Compiled 8 dex files
Compiling modified resources
Signing APK
Patched APK

Solution

Maybe the authorize button doesn't work ? Revanced doesn't let me chose an other file explorer...

Additional context

No response

Acknowledgements

  • [X] This issue is not a duplicate of an existing bug report.
  • [X] I have chosen an appropriate title.
  • [X] All requested information has been provided properly.

szbinks avatar Feb 25 '24 16:02 szbinks

The provided path is not a regular file path.

oSumAtrIX avatar Feb 25 '24 16:02 oSumAtrIX

So how am i supposed to give a regular path ? I just followed what the ui said

szbinks avatar Feb 25 '24 16:02 szbinks

By entering the path manually for example, this is not a support channel.

oSumAtrIX avatar Feb 25 '24 16:02 oSumAtrIX

This "isn't a support channel", but it's a very relevant question that poses a real issue, what's the point of the "Select folder" entry if it doesn't provide what's being requested correctly?

Ushie avatar Feb 25 '24 20:02 Ushie

Im not sure but iirc there was an issue regarding that open. But since I am not sure I left this issue open

oSumAtrIX avatar Feb 25 '24 20:02 oSumAtrIX

Im not sure but iirc there was an issue regarding that open. But since I am not sure I left this issue open

I am only able to find https://github.com/ReVanced/revanced-patches/issues/25 regarding this issue.

KobeW50 avatar Feb 25 '24 22:02 KobeW50

This is android shenanigan that i am not familiar with. @Axelen123 do you know how to allow permission to a specific folder without requesting all files access?

Aunali321 avatar Mar 07 '24 16:03 Aunali321

This is android shenanigan that i am not familiar with. @Axelen123 do you know how to allow permission to a specific folder without requesting all files access?

To access a specific folder, you have to use the android documents API (file picker).

https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory

These files cannot be accessed using the Unix filesystem APIs (which patch options uses) unless you have the all files permission. You have to copy them if that is required. This is why compose manager requests the all files permission if you use patch options.

Axelen123 avatar Mar 07 '24 17:03 Axelen123

any update on this? this used to work a few versions back, all one had to do was select the patch and select the revanced logo from the dropdown, no custom folder or anything (why even have a dropdown with 4 preselected values if it doesn't work?)

masterflitzer avatar Mar 21 '24 02:03 masterflitzer

My goal was to patch YT Revanced with my own logo that's why I needed the custom folder, the others ones doesn't have any problem iirc.

szbinks avatar Mar 21 '24 08:03 szbinks

My goal was to patch YT Revanced with my own logo that's why I needed the custom folder, the others ones doesn't have any problem iirc.

the 4 preselected ones throw exception on patching, if this issue is only for custom value i will open a new one in patches repo

masterflitzer avatar Mar 21 '24 19:03 masterflitzer

I confirm that the issue concerns custom value only

szbinks avatar Mar 21 '24 21:03 szbinks

consider closing this

Francesco146 avatar Aug 23 '24 08:08 Francesco146

consider closing this

👋 The issue will be closed when the changes are merged to main branch.

validcube avatar Aug 23 '24 08:08 validcube