mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 10:19:17 +02:00
refactor(adb): pre-encode packet ID as number in sync command
This commit is contained in:
parent
25efbe6402
commit
2db3e8f8b9
8 changed files with 90 additions and 48 deletions
|
@ -273,10 +273,17 @@ export class PackageManager extends AdbCommandBase {
|
|||
PACKAGE_MANAGER_INSTALL_OPTIONS_MAP,
|
||||
);
|
||||
if (!options?.skipExisting) {
|
||||
// Today `pm` defaults to replace existing application (`-r` will be ignored),
|
||||
// but old versions defaults to skip existing application (like `-R`, but obviously
|
||||
// they didn't have this switch and ignores it if present).
|
||||
// If `skipExisting` is not set, add `-r` to ensure compatibility with old versions.
|
||||
/*
|
||||
* | behavior | previous version | modern version |
|
||||
* | -------------------- | -------------------- | -------------------- |
|
||||
* | replace existing app | requires `-r` | default behavior [1] |
|
||||
* | skip existing app | default behavior [2] | requires `-R` |
|
||||
*
|
||||
* [1]: `-r` recognized but ignored)
|
||||
* [2]: `-R` not recognized but ignored
|
||||
*
|
||||
* So add `-r` when `skipExisting` is `false` for compatibility.
|
||||
*/
|
||||
args.push("-r");
|
||||
}
|
||||
return args;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue