-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
feat: Add installer status dialog #1473
base: compose-dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for the "invalid" error description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String changes in error dialog
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerDialog.kt
Outdated
Show resolved
Hide resolved
Is this also for when you update the Manager? |
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
No it's only for installing patched apps |
ReVanced Manager Updates will also use this, but this PR focuses on patched apps |
@ Axelen123 Currently, the extra status message is not used, but I don't know which extra status messages exist so that I can implement them. For example, if an existing installation is present, but the patched app mismatches signatures, then the dialogue will say: This flag is returned from installation, and there is no way to differentiate between an APK being invalid, for example, or a signature mismatch. Furthermore, when uninstalling, the dialogue may also be shown. But once again, there is no way to differentiate between installations, uninstallations or the status message, so the dialogue may say that the installation has failed while the uninstallation failed. |
msedge_XcwCJ412Tb.mp4(The recording is cut off at the end, it shows the success dialogue when installation succeeded) |
Not sure why Android says the app is invalid. Android should give you CONFLICT on signature mismatch. What is the content of the
Isn't it possible to make a separate dialog or enum for uninstalls? |
Yes, but ideally we would have the existing Flags enum have variants of the install and uninstall strings. |
Will root install be handled in this? |
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/screen/InstallerScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/component/InstallerStatusDialog.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/InstallerViewModel.kt
Outdated
Show resolved
Hide resolved
4d4d682
to
962e68d
Compare
@Axelen123 I have updated the PR description with up to date information. |
962e68d
to
b1a821d
Compare
app/src/main/java/app/revanced/manager/ui/viewmodel/PatcherViewModel.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/revanced/manager/ui/viewmodel/PatcherViewModel.kt
Outdated
Show resolved
Hide resolved
UninstallService.APP_UNINSTALL_ACTION -> { | ||
val pmStatus = intent.getIntExtra( | ||
UninstallService.EXTRA_UNINSTALL_STATUS, | ||
PackageInstaller.STATUS_FAILURE | ||
) | ||
|
||
// TODO: This is unused and may be completely removed everywhere. | ||
// intent.getStringExtra(UninstallService.EXTRA_UNINSTALL_STATUS_MESSAGE) | ||
|
||
if (pmStatus != PackageInstaller.STATUS_SUCCESS) { | ||
installerStatusDialogModel.packageInstallerStatus = pmStatus | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No logic for reattempting an installation that required uninstalling the installed app is present here. Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I understood correctly. If uninstallation fails, the appropriate dialog will be shown. If uninstallation succeeds, but the installation afterwards fails, the appropriate dialog will also be shown.
app.toast(app.getString(R.string.install_app_fail, extra)) | ||
} | ||
|
||
installerStatusDialogModel.packageInstallerStatus = pmStatus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PalmDevs should the dialog be shown for successful installs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not, after installation the only thing that changes is the button from "Install" to "Open"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the package installer dialog is hidden after the user clicks Install (some apps do that), yes. Otherwise, maybe not considering the package manager dialog already shows the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The popup is hidden once the user clicks install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be marked as resolved?
Please send a recording of the latest changes or link me to them, thanks 👍 |
explorer_IlN3nldlMq.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few string changes, need opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings and UI, LGTM.
I'll need some help regarding the pending TODOs in the PR body. I am unsure where to get context about root installations when doing regular installation. The idea is, that other dialogs are added in case root installations exist or a root installation can't be done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have nothing else to suggest that isn't already being discussed.
Not sure this is within the scope of the PR. One of the cases requires checking the signature of the installed app, which would require functionality that isn't currently present in revanced library.
Isn't this already handled? |
The dialog model has two functions for installing and uninstalling apps. explorer_IlN3nldlMq.mp4What I meant with that message is the issue shown in the recording which shows that the installer runs before the uninstaller. The cause is not known and its unclear if it is an issue outside my env.
The dialog currently ONLY handles Android installer status. It has no context about root installations and root installers also don't return any status code like the Android installer. As it is right now, the dialog is only handling Android installations. |
This PR shows a native dialogue after the installation finishes. It can handle all status flags. Business logic may move.
Todo
Review
uiSafe
has been used correctly (In some places, it seems it should be used but it seems out of scope for this PR)Warning
On installation, the install button is not greyed out, and no progress is visible, so it appears as if nothing happened.