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

Export APK button doesn't respond after Opening installed app #1537

Closed
4 tasks done
KobeW50 opened this issue Nov 29, 2023 · 8 comments · Fixed by #1611
Closed
4 tasks done

Export APK button doesn't respond after Opening installed app #1537

KobeW50 opened this issue Nov 29, 2023 · 8 comments · Fixed by #1611
Assignees
Labels
Bug report Something isn't working

Comments

@KobeW50
Copy link
Contributor

KobeW50 commented Nov 29, 2023

Bug description

After you install an app and open it (via the "Open" button), and then go back into the Manager and try to export the patched APK the export button will not work. All other buttons work except for the Back button, which is likely a different bug. (See #1510)

Steps to reproduce

  1. Patch YT with the default patches
  2. Install the patched app using the "Install" button
  3. Open the installed app with the "Open" button
  4. Exit the patched app and go into the Manager
  5. Press the "Export APK" button on the bottom left
Screen_Recording_20231129_123114_ReVanced.Manager.mp4

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

1.17.0
YT 18.45.41

Logs

The installation completed at 12:57:46 so the issue will be in the seconds shortly afterwards

https://drive.google.com/file/d/11q675aPBTo8XNUe2kK_TT3-DiOmQRq7x/view?usp=drivesdk

Installation type

Non-root

Device logs

Uploaded

Patcher logs

No response

Acknowledgements

  • This request is not a duplicate of an existing issue.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
  • The issue is solely related to the ReVanced Manager
@KobeW50 KobeW50 added the Bug report Something isn't working label Nov 29, 2023
@KobeW50
Copy link
Contributor Author

KobeW50 commented Dec 20, 2023

Now when I open the installed app using the "Open" button and then return to the manager, the manager will reset to the dashboard tab which means this bug can't be reproduced atm. (This occurs even when the Manager stays open in pop-up view or split screen while the patched app is being opened.)

I guess this new behavior is a bug, and it masks the bug reported in this issue.

@pehchankon
Copy link

Now when I open the installed app using the "Open" button and then return to the manager, the manager will reset to the dashboard tab which means this bug can't be reproduced atm. (This occurs even when the Manager stays open in pop-up view or split screen while the patched app is being opened.)

I guess this new behavior is a bug, and it masks the bug reported in this issue.

Is the behavior of returning back to the dashboard not intended? This was added in the following commit. c5fc54e7
The installer page is popped after opening the installed app.

{
                          model.openApp(),
                          model.cleanPatcher(),
                          Navigator.of(context).pop(),
 }

And as for the export APK button, it seems to be not working right after installing the app irrespective of you opening it or not. The APK file is probably cleared from the cache as soon as the app is installed.
Assuming this issue is still persisting, can I have a look at it?

@pehchankon
Copy link

await locator<HomeViewModel>().initialize(context);

This line seems to be the root cause for invalidating the cache. Going deeper, HomeViewModel's initializer is calling the PatcherAPI's initializer which clears the cache.

Similarly, the cleanPatcher() method(again this clears the cache etc) is called after opening the installed app as I mentioned in my previous comment.
This makes sense only if the intention is to go back to the dashboard after the user chooses to open the app. However, I'm not sure why HomeViewModel is initialized after the user installs the app.

@oSumAtrIX
Copy link
Member

@pehchankon Iirc it is to refresh the list of installed apps on the dashboard

@pehchankon
Copy link

pehchankon commented Jan 16, 2024

@oSumAtrIX Yeah that seems to be the case. Instead of initializing the HomeViewModel again, can we directly refresh the list of installed apps by something like this?

await _managerAPI.reAssessSavedApps().then((_) => locator<HomeViewModel>().getPatchedApps());

Edit: The HomeViewModel already contains a getPatchedApps function, however its scope is private, I think it can be made public to tackle this issue.

@oSumAtrIX
Copy link
Member

I had asked the same question in the past, and got an answer from @BenjaminHalko who said that other issues could be caused by that iirc. Maybe they can give an insight on that

@BenjaminHalko
Copy link
Member

I think reassessing apps would not cause any issues. In fact I think I do it in #1414

@oSumAtrIX
Copy link
Member

The question is not if reassessing apps causes any issues but if not reinitializing the home page. Last time I remember asking if it is necessary to do when changing the sources/API and related it to this case

@oSumAtrIX oSumAtrIX linked a pull request Mar 4, 2024 that will close this issue
@oSumAtrIX oSumAtrIX assigned oSumAtrIX and unassigned BenjaminHalko Mar 4, 2024
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.

4 participants