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

Failure [INSTALL_FAILED_VERSION_DOWNGRADE] #2

Open
reThink23 opened this issue Jun 2, 2022 · 17 comments
Open

Failure [INSTALL_FAILED_VERSION_DOWNGRADE] #2

reThink23 opened this issue Jun 2, 2022 · 17 comments

Comments

@reThink23
Copy link

I tried to get the script to run with a LegacyWhatsApp.apk from APKMirror.
First I forgot to enable Installing via USB so the program failed.
After figuring this out, I tried running again, and the only things what appeared to not working was an error Failure [INSTALL_FAILED_VERSION_DOWNGRADE] while installing the LegacyWhatsApp.apk
I think it has something to do with the adb install command and after some research I found this:
https://stackoverflow.com/questions/13400499/is-there-any-way-to-ignore-install-failed-version-downgrade-on-application-insta/13772620#13772620

It is worth mentioning that the error might be caused by having a dual app for WhatsApp installed, but I'm not quite sure.

Below there is the terminal output
image

@KnugiHK
Copy link
Owner

KnugiHK commented Jul 3, 2022

What is the Android version you are working on?

@KnugiHK
Copy link
Owner

KnugiHK commented Oct 1, 2023

Possibly the script detected a wrong API version.

@chezihp
Copy link

chezihp commented Dec 28, 2023

I also got the same error:

=========================================================================
= This script will extract the WhatsApp Key file and DB on Android 4.0+ =
= You DO NOT need root for this to work but you DO need Java installed. =
= If your WhatsApp version is greater than 2.11.431 (most likely), then =
= a legacy version will be installed temporarily in order to get backup =
= permissions. You will NOT lose ANY data and your current version will =
= be restored at the end of the extraction process so try not to panic. =
= Script by: TripCode (Greets to all who visit: XDA Developers Forums). =
= Thanks to: dragomerlin for ABE and to Abinash Bishoyi for being cool. =
=         ###          Version: v5.1 (22/02/2022)          ###          =
=========================================================================


Please connect your Android device with USB Debugging enabled:

* daemon not running; starting now at tcp:5037
* daemon started successfully

Found legacy WhatsApp 2.11.431 in local folder

WhatsApp 2.23.25.83 installed

Backing up WhatsApp 2.23.25.83
/data/app/~~R3Wp_IumaBes56BwnlAlQQ==/com.whatsapp-La0oBEG0XmBIZ_smr6ZUEQ==/base.apk: 1 file pulled, 0 skipped. 36.8 MB/s (52976124 bytes in 1.371s)
Backup complete

Removing WhatsApp 2.23.25.83 skipping data
Success
Removal complete

Installing legacy WhatsApp 2.11.431
Performing Streamed Install
adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 450146 is older than current 232583004]
Install complete! Open Whatsapp, allow the permissions request, if any. Then, press Enter to continue.

Iv'e ended up uninstalling it manually from phone which solved the original problem. However I bumped into another error:

➜  WhatsApp-Key-DB-Extractor-master adb install -r -d tmp/LegacyWhatsApp.apk
Performing Streamed Install
adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 23, but found 19]

which IIUC implies my android is too advanced to install that apk. Here is my version:

➜  WhatsApp-Key-DB-Extractor-master adb shell getprop ro.build.version.sdk
34

@BotsaJaswanth
Copy link

@chezihp The issue Deprecated SDK Version is due to the behavioural changes in SDK 34 (Android 14)
Reference : https://developer.android.com/about/versions/14/behavior-changes-all#minimum-target-api-level

To solve this you can try this command : adb install --bypass-low-target-sdk-block tmp/LegacyWhatsApp.apk

@BotsaJaswanth
Copy link

@chezihp The issue Deprecated SDK Version is due to the behavioural changes in SDK 34 (Android 14) Reference : https://developer.android.com/about/versions/14/behavior-changes-all#minimum-target-api-level

To solve this you can try this command : adb install --bypass-low-target-sdk-block tmp/LegacyWhatsApp.apk

@chezihp can you explain how you bypassed adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 450146 is older than current 232583004] im struggling with it

@chezihp
Copy link

chezihp commented Feb 15, 2024

@chezihp The issue Deprecated SDK Version is due to the behavioural changes in SDK 34 (Android 14) Reference : https://developer.android.com/about/versions/14/behavior-changes-all#minimum-target-api-level
To solve this you can try this command : adb install --bypass-low-target-sdk-block tmp/LegacyWhatsApp.apk

@chezihp can you explain how you bypassed adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 450146 is older than current 232583004] im struggling with it

I can't remember but in my post from back then I mentioned that I had to uninstall it manually

@BotsaJaswanth
Copy link

BotsaJaswanth commented Feb 15, 2024

@chezihp The issue Deprecated SDK Version is due to the behavioural changes in SDK 34 (Android 14) Reference : https://developer.android.com/about/versions/14/behavior-changes-all#minimum-target-api-level
To solve this you can try this command : adb install --bypass-low-target-sdk-block tmp/LegacyWhatsApp.apk

@chezihp can you explain how you bypassed adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 450146 is older than current 232583004] im struggling with it

I can't remember but in my post from back then I mentioned that I had to uninstall it manually

You uninstalled with using -k flag? Because manually uninstalling actually deletes app data too that is com.whatsapp

@KnugiHK
Copy link
Owner

KnugiHK commented Feb 15, 2024

Just a reminder, ALWAYS do backup before you execute the scripts.

@marcello-pietrobon
Copy link

Hi,

unfortunately this issue seems not solved.

I have been able to backup wa chats two months ago, but now I receive this message:

Installing legacy WhatsApp 2.11.431
Performing Streamed Install
adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
Install complete! Open Whatsapp, allow the permissions request, if any. Then, press Enter to continue.

and also adding the flag '--bypass-low-target-sdk-block' doesn't work because such flag is not recognized:

Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown option --bypass-low-target-sdk-block
	at com.android.server.pm.PackageManagerShellCommand.makeInstallParams(PackageManagerShellCommand.java:2245)
	at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:903)
	at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
	at android.os.ShellCommand.exec(ShellCommand.java:103)
	at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21815)
	at android.os.Binder.shellCommand(Binder.java:638)
	at android.os.Binder.onTransact(Binder.java:536)
	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2845)
	at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4046)
	at android.os.Binder.execTransact(Binder.java:735)
bin\adb.exe : 4398 KB/s (58654423 bytes in 13.022s)
At line:1 char:1
+ bin\adb.exe install --bypass-low-target-sdk-block -r -d tmp\base.apk
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (4398 KB/s (58654423 bytes in 13.022s):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Any idea of how this could be solved or of any way to workaround this issues or should I give up on a proper whatsapp chats backup/export to html?

@marcello-pietrobon
Copy link

Forgot to say, both with Windows and Linux and using Android 9 on moto g(6) play. I tried with Pixel 2XL with Android 11 but this last one connects to a PC once every 100 trials no matter which cable I use.

@KnugiHK
Copy link
Owner

KnugiHK commented Jun 5, 2024

Hi,

unfortunately this issue seems not solved.

I have been able to backup wa chats two months ago, but now I receive this message:

Installing legacy WhatsApp 2.11.431
Performing Streamed Install
adb: failed to install tmp/LegacyWhatsApp.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
Install complete! Open Whatsapp, allow the permissions request, if any. Then, press Enter to continue.

and also adding the flag '--bypass-low-target-sdk-block' doesn't work because such flag is not recognized:

Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown option --bypass-low-target-sdk-block
	at com.android.server.pm.PackageManagerShellCommand.makeInstallParams(PackageManagerShellCommand.java:2245)
	at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:903)
	at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
	at android.os.ShellCommand.exec(ShellCommand.java:103)
	at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21815)
	at android.os.Binder.shellCommand(Binder.java:638)
	at android.os.Binder.onTransact(Binder.java:536)
	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2845)
	at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4046)
	at android.os.Binder.execTransact(Binder.java:735)
bin\adb.exe : 4398 KB/s (58654423 bytes in 13.022s)
At line:1 char:1
+ bin\adb.exe install --bypass-low-target-sdk-block -r -d tmp\base.apk
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (4398 KB/s (58654423 bytes in 13.022s):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Any idea of how this could be solved or of any way to workaround this issues or should I give up on a proper whatsapp chats backup/export to html?

Hi. Can you show the full logs?

@marcello-pietrobon
Copy link

Hello, thank you for replying me and sorry for getting back so late... I have really very very little time.

How to I generate a file log? is there an option for it?
but I kept on a file the output on the console, would that suffice?

To try again is hard because I would have to transfer again all whatsup data from my cell (a Pixel2 XL) to the one that is normally able to connect with a cable to my laptop, and that would cost me many hours which are very hard to find.

At the same time, I happened few days ago to be able to connect my cell (the Pixel2 XL) directly to my PC (I couldn't for months even trying with different good quality cables)... and it worked on Windows 10.

In other words it seems like that the legacy apk is today allowed to run on the 'Pixel2 XL', but not on the Motorola 'moto g(6)'

Cheers,
M

@Arch-Zero
Copy link

Any proper solutions to backing up on android 14?

@agoshigagoroba
Copy link

I do have the same issue.

@KnugiHK
Copy link
Owner

KnugiHK commented Sep 9, 2024

In the meantime, if anyone encounters this issue, I recommend attempting the extraction manually, as it might offer more insight into the problem.

@marcello-pietrobon
Copy link

Lately I maybe partly solved the issue for myself.

I'm using a 'Realme Note 50'

As strange as it seems it the 'File Transfer' only works with my old laptop running Win7 AND only
with a cable which seems better than others. With all my many other, also good quality cables, it doesn't work.

Because this behaviour is so unexpected I only want to report my experience but please, don't take it as an absolute truth, I don't want to mislead anyone. Maybe the problem is still a software one. For example my strong impression is that Windows gives you the impression that the cell is not connecting well, while actually it technically could, as often I only need to wait one minute (!!!) in order to have the 'Transfer files' option enabled (not grayed). Hope it helps.

@KnugiHK
Copy link
Owner

KnugiHK commented Dec 8, 2024

Any proper solutions to backing up on android 14?

@Arch-Zero Your best option would likely be to use the end-to-end encrypted backup feature to extract the chat database. Check out the discussion in #5 for more details.

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

7 participants