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

Support downgrading APKs #32

Closed
nfischer opened this issue Oct 12, 2018 · 3 comments
Closed

Support downgrading APKs #32

nfischer opened this issue Oct 12, 2018 · 3 comments

Comments

@nfischer
Copy link

Is your feature request related to a problem? Please describe.

It would be nice to have the option to downgrade APKs on debuggable devices (i.e., install an older versionCode than what is currently installed). Specifically, this should match adb install -d behavior.

Describe the solution you'd like

I think it's fine to pass -d on user, userdebug, eng devices, I think package manager will simply ignore the request to downgrade if the device is not debuggable. This is how adb install -d seems to work.

Describe alternatives you've considered

The alternative is for our script to first uninstall the on-device APK, and to then install the new APK. This poses some issues: what if the uninstall succeeds but the install fails for some unexpected reason? The device is now in a worse state than before, when the preferred outcome would be to leave the original APK on the device.

We currently perform this workaround for user devices, but it would be nice to avoid it whenever possible, and I think there's value in matching adb install's features whenever possible.

@plecesne
Copy link
Contributor

Flag --allow-downgrade now available in the install-apks command in release 0.7.1.

@nfischer
Copy link
Author

Thanks, @plecesne! Seems to work just like adb install -d, which is exactly what we needed.

Although, it looks like this still needs help documentation?

$ java -jar "$BTOOL" version
0.7.1
$ java -jar "$BTOOL" help | grep 'allow-downgrade' # no docs for this option
$ java -jar "$BTOOL" help install-apks | grep 'allow-downgrade' # not here either

@plecesne
Copy link
Contributor

Oh right, well spotted. Stupid copy/paste. It'll be fixed in the next release.

aarongable pushed a commit to chromium/chromium that referenced this issue Nov 20, 2018
This is mostly to get the bugfix from [1], which will
allow the removal of 2 workarounds in our build system.
See [2]

[1] google/bundletool#32
[2] https://chrome-internal-review.googlesource.com/c/clank/internal/apps/+/719231

BUG=891931
R=agrieve@chromium.org, ntfschr@chromium.org

Change-Id: Ibc6f406ce3b2d920b19435e392b51181308e24a2
Reviewed-on: https://chromium-review.googlesource.com/c/1343107
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: David Turner <digit@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609711}
piscisaureus pushed a commit to denoland/chromium_build that referenced this issue Dec 8, 2018
This is mostly to get the bugfix from [1], which will
allow the removal of 2 workarounds in our build system.
See [2]

[1] google/bundletool#32
[2] https://chrome-internal-review.googlesource.com/c/clank/internal/apps/+/719231

BUG=891931
R=agrieve@chromium.org, ntfschr@chromium.org

Change-Id: Ibc6f406ce3b2d920b19435e392b51181308e24a2
Reviewed-on: https://chromium-review.googlesource.com/c/1343107
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: David Turner <digit@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#609711}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7f3b69acd2e3211f940c407c0dcb4683b6d5e251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants