filesystemstelegramandroid-7.1-nougat

Getting signature error while installing a different version of the app


Recently I installed a custom ROM named eelo. In that Telegram app comes pre-installed thus it can be regarded as a system app. But it is a custom built with a different it lacks a lot of features and it is outdated in nature. Hence, I wanted to install the official version of the app.

For installing the app I tried uninstalling the previous one using adb shell pm uninstall --user 0 org.telegram.messenger. The output came out as SUCCESS and to verify the uninstallation I tried adb uninstall --user 0 org.telegram.messenger. The output of it came as SUCCESS as well. When I moved on to the next step to install the new APK with the command adb install Telegram-5.7.1.apk it gave out

adb: failed to install Telegram-5.7.1.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package org.telegram.messenger signatures do not match the previously installed version; ignoring!]

After further research I found out that I need to comment out the telegram package part of /data/system/packages.xml file. But after editing the file and after rebooting the file reverts back to the original contents previous to the editing. I even tried to change the permission of the folder with chmod 744 /data/system and the file packages.xml with chmod 777 /data/system/packages.xml but with no effect since it all reverts back after the reboot.

I would like to uninstall the Telegram app from my system completely and install a new one. And how would it be possible to edit the /data/system/packages.xml file and stop the system from reverting it back.

Any sort of help or advice would be totally appreciable.


Solution

  • Ultimately found an answer to the query and how to solve it.

    1. The first is how to delete a system application completely? These are the following steps

      $ adb root - To start adbd with root privileges.

      $ adb shell - To interact with the phone system directly.

      $ pm uninstall --user 0 <package>.apk - To uninstall the package from the root user is any package you want to remove from the system.

      These few steps may remove the whole package but in my case it was different as it left behind few files from the previous built app. So these were the steps that I followed :

      $ adb shell mount -o rw,remount /system - This would remount the system as read-write. Originally /system is a read-only folder so you can't edit directly.

      $ adb shell rm -r /system/<package>.apk - This would remove the apk and there won't be anything left from the previous built.

    2. Why I couldn't edit the /data/system/packages.xml file?

      The answer to this is that though I can edit it with vim but it kept reverting back to the previous unedited form. This was happening because it was updating the information from /system/app files. Thus, editing it went in vain.

    Refer to the following links that actually helped me out

    Read only file system on Android

    https://www.besttechie.com/remove-preloaded-software-from-android/