Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: revanced manager requests all files permission twice and crashes afterwards #1172

Closed
4 tasks done
Ushie opened this issue Aug 28, 2023 · 9 comments · Fixed by #1177
Closed
4 tasks done

bug: revanced manager requests all files permission twice and crashes afterwards #1172

Ushie opened this issue Aug 28, 2023 · 9 comments · Fixed by #1177
Labels
Bug report Something isn't working

Comments

@Ushie
Copy link
Member

Ushie commented Aug 28, 2023

Type

Error while running the manager

Bug description

ReVanced Manager crashes after being given the requested all files/root permissions

Steps to reproduce

  1. Clean install ReVanced Manager
  2. Launch ReVanced Manager
  3. Give All Files permission (x2)
  4. Go back, ReVanced Manager crashes

Android version

14

Manager version

v1.9.4

Target package name

Not applicable

Target package version.

Not applicable

Installation type

Non-root

Patches selected.

Not applicable

Device logs (exported using Manager settings).

E/AndroidRuntime( 8536): FATAL EXCEPTION: main
E/AndroidRuntime( 8536): Process: app.revanced.manager.flutter.debug, PID: 8536
E/AndroidRuntime( 8536): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=210, result=0, data=null} to activity {app.revanced.manager.flutter.debug/app.revanced.manager.flutter.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 8536): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5338)
E/AndroidRuntime( 8536): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5377)
E/AndroidRuntime( 8536): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
E/AndroidRuntime( 8536): 	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
E/AndroidRuntime( 8536): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
E/AndroidRuntime( 8536): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime( 8536): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2306)
E/AndroidRuntime( 8536): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 8536): 	at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime( 8536): 	at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime( 8536): 	at android.app.ActivityThread.main(ActivityThread.java:7918)
E/AndroidRuntime( 8536): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8536): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime( 8536): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime( 8536): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 8536): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435)
E/AndroidRuntime( 8536): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:263)
E/AndroidRuntime( 8536): 	at com.baseflow.permissionhandler.MethodCallHandlerImpl$$ExternalSyntheticLambda6.onSuccess(Unknown Source:2)
E/AndroidRuntime( 8536): 	at com.baseflow.permissionhandler.PermissionManager.onActivityResult(PermissionManager.java:101)
E/AndroidRuntime( 8536): 	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:809)
E/AndroidRuntime( 8536): 	at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:432)
E/AndroidRuntime( 8536): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:872)
E/AndroidRuntime( 8536): 	at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:917)
E/AndroidRuntime( 8536): 	at android.app.Activity.dispatchActivityResult(Activity.java:8665)
E/AndroidRuntime( 8536): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5331)
E/AndroidRuntime( 8536): 	... 13 more

Installer logs (exported using Installer menu option) [unneeded if the issue is not during patching].

No response

Screenshots or video

2023-08-28.18-47-16.mp4

Solution

No response

Additional context

No response

Acknowledgments

  • I have searched the existing issues; this is new and no duplicate or related to another open issue.
  • I have written a short but informative title.
  • I properly filled out all of the requested information in this issue.
  • The issue is solely related to ReVanced Manager and not caused by patches.
@Ushie Ushie added the Bug report Something isn't working label Aug 28, 2023
@TheAabedKhan TheAabedKhan linked a pull request Aug 31, 2023 that will close this issue
@eiqnepm
Copy link

eiqnepm commented Oct 8, 2023

I have been using ReVanced Manager without the all files permission up until the last release, due to the crashing after exiting the permissions manager prompt.

I really hope I will continue to be able to use ReVanced Manager without the all files permission when this issue is fixed.

ReVanced Manager does not need access to all of my files, I understand that it may have been easier to implement certain features, it would have been possible to implement them with a single user selected folder, Android apps developed today have little to no reason to access all files.

@oSumAtrIX
Copy link
Member

It does because there are patches that need it

@eiqnepm
Copy link

eiqnepm commented Oct 8, 2023

It does because there are patches that need it

I am aware, however these patches could still have the user select the text files manually, or give ReVanced Manager access to a user selectable folder, without the need for the all files permission.

Android implemented these features for user trust and security by isolation. Outdated versions of Android will have to default to all files.

I will never trust an app with all my files, unless it is a reputable registered company with repercussions if they do anything nefarious.

@oSumAtrIX
Copy link
Member

oSumAtrIX commented Oct 8, 2023

No, manager can not because it is unaware of the patches implementation and agnostic towards any patch.

Code is open source, you can review it and compile it yourself. Don't trust it, don't use it

@Ushie
Copy link
Member Author

Ushie commented Oct 8, 2023

The All Files permission will be removed once Patch Options are implemented in ReVanced Manager, which is currently work in progress in this branch

This specific issue talks about the duplicate request & crash, which have been resolved a few versions back, so I'll be closing this issue as completed

@Ushie Ushie closed this as completed Oct 8, 2023
@eiqnepm
Copy link

eiqnepm commented Oct 8, 2023

No, manager can not because it is unaware of the patches implementation and agnostic towards any patch.

Code is open source, you can review it and compile it yourself. Don't trust it, don't use it

It requires access to all files because it assumes patch specific files will be placed in the root of internal storage by the user, this could also be done by having the user give ReVanced Manager access to a single folder, and then placing patch specific files in there. I assume the all files permission soft requirement was simpler to implement initially to get the feature out quicker.

Building myself doesn't help if I don't understand the code I'm compiling. I will use ReVanced Manager when I am able to dismiss the all files prompt once again, or the Patch Options are released.

The All Files permission will be removed once Patch Options are implemented in ReVanced Manager, which is currently work in progress in this branch

This specific issue talks about the duplicate request & crash, which have been resolved a few versions back, so I'll be closing this issue as completed

Thanks for the update! This definitely looks like a far better solution for user security.

@oSumAtrIX
Copy link
Member

this could also be done by having the user give ReVanced Manager access to a single folder

No because the app can not assume what a patch does

@Ushie
Copy link
Member Author

Ushie commented Oct 8, 2023

I assume the all files permission soft requirement was simpler to implement initially to get the feature out quicker.

Yeah, it mainly exists for Reddit custom clients, these patches are impossible to use without Patch Options and there was no progress on adding that at the time

No because the app can not assume what a patch does

It isn't ReVanced Manager's job to assume, however All Files permission is a security concern and patches should NOT have unrestricted access to all your files, the only plausible options are either an application folder in Internal Storage or Patch Options which both will give a sandboxed environment for the patches

@oSumAtrIX
Copy link
Member

however All Files permission is a security concern

Yes, ReVanced manager can freely restrict this without considering any patch. This will make specific patches incompatible with the app, but it is a valid motivation to remove the permission at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants