Unable to uninstall SoundHound application from android - android

I am having serious problems with the SoundHound application, from my HTC Desire S unit.
I should be able to remove it in the standard way, by entering "Applications > Manage Applications", finding SoundHound and uninstalling it. But alas, I have no options. All buttons are disabled. If the application is launched, I have the option of "Force stop" and "Clear data" available.
In the Android Market I am only able to "Update (manual)" - and if I do so, I then only have the options of "Open" and "Uninstall updates"
Then I figured it would be possible through adb, using the package-name found through adb shell to be com.melodis.midomiMusicIdentifier.freemium - and then do an uninstall on that.
lobner#:~$ ./adb uninstall com.melodis.midomiMusicIdentifier.freemium
Failure
I think the above attempts may fail, because the .apk file is located in the /system/app folder on my device.
And I seem to be unable to mount the folder, which may be due to the unit not being rooted.
lobner#:~$ ./adb shell mount system/app
Usage: mount [-r] [-w] [-o options] [-t type] device directory
And I can not just remove it, it seems
lobner#:~$ ./adb shell rm system/app/SoundHound_Freemium.apk
rm failed for system/app/SoundHound_Freemium.apk, Read-only file system
Does anyone have any ideas, how to (force)remove an app from a non-rooted phone?

I think the above attempts may fail, because the .apk file is located in the /system/app folder on my device.
This means the app is part of your firmware and cannot be removed, short of rooting your phone. Ice Cream Sandwich will support disabling such apps, though not removing them.

Related

What is the right way to turn an app into a system app under Android Oreo and above?

I have tried several methods to turn an app into a system app but even if in some case I managed to install the app inside /system/priv-app the app was not running as a system app as I could figure out by checking running the command "adb shell ps".
So please could someone tell me if I missed something or if there is some limitation linked to Lineage or may be Magisk or TWRP to have an app runing as a system app ?
I have tried with Lineage 15.1 (Oreo) and magisk 21.2 the phone is a Samsung S5 using TWRP 3.5.0_9-0 as system Recovery
First method was to
1 making a copy of the app folder to the internal storage
2 renaming that copied Folder with a short name without dot (like renaming com.example.myapp folder to Myapp Folder)
3 renaming the apk from base.apk to Myapp.apk
4 uninstalling the app
5 under TWRP recovery mode mount the system partiton and copying the Myapp folder to system/priv-app directory
6 chmod 755 Myapp Folder
7 chmod 644 Myapp.apk
8 wipe Dalvilk Cache and rebooting
Steps 2 and 3 might be useless it was just because I noticed the Priv-app directory used these naming Scheme for apps inside this folder
I tried this method under Lineage 17.1 and Magisk 21.4 but then the phone was not able to reboot until I delete the newly created folder inside Priv-app
I also tried another method using Magisk Systemize (Terminal) module but the result was the same (the app was running but not as a system app)
I also tried to put the app into System/app folder but the result was the same
As I have never seen that it was mentionned in any posted method explaning how to turn an app into a system app, the installed app was not signed with the platform key and the manifest was not including android:sharedUserId="android.uid.system"
Thanks in advance to those that will try to help.
I would try the following, after making sure I don't have a user copy of the installed app (somewhere in /data).
Get to root shell at first.
adb root && adb remount
Use /system/app path for system apps and /system/priv-app for privileged apps.
(for priv-app path you also need to create a priv-app-whitelist.xml with the said permissions, https://source.android.com/devices/tech/config/perms-allowlist)
adb shell mkdir -p /system/app/AppName
adb push AppName.apk /system/app/AppName
adb reboot
Not sure how are u confirming if the app is running as a system app or not?

Update AOSP built-in system app

Lets say we have downloaded, built and flashed AOSP source code. Now a change to a system app is made (e.g. changed a constant in the packages/apps/Nfc package).
The next step is to build it, and there are two ways to do it:
cd packages/apps/Nfc; mm
or
mmm Nfc
This will create out/target/product//system/app/NfcNci/NfcNci.apk file
Which is the proper way to update the system app?
I tried using adb install NfcNci.apk but no success:
~/android/aosp-7.1.2-3.10-v2/out/target/product/kugo/system/app/NfcNci$ adb install NfcNci.apk
Failed to install NfcNci.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.android.nfcnci without first uninstalling.]
~/android/aosp-7.1.2-3.10-v2/out/target/product/kugo/system/app/NfcNci$ adb install -r NfcNci.apk
Failed to install NfcNci.apk: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.android.nfcnci-1: Package /data/app/com.android.nfcnci-1/base.apk code is missing]
Found a way to easily 're-install' the app itself (let's put Settings app as an example):
mmm packages/apps/Settings # Build the module
adb root ; adb remount # Restart adbd as root and mount /system as writable
adb push out/target/product/<device_name>/system/priv-app/Settings /system/priv-app # Push the built files to the device
Then force-close and restart the app (by swiping it from Recents). No need to reboot device in order to take changes
NOTE: Depending on the app, the path may be on system/app instead of /system/priv-app
Another way is to:
copy the new apk to the sdcard of the device with adb push
mount /system read write: mount -o rw,remount,rw /system
copy your new .apk from /sdcard over your old .apk in /system/app
remove the .odex file of your old .apk
reboot the device
For development you can use a simple script for this steps.
Check build/envsetup.sh file - there's also commands mmp and mmmp to build and push a module to connected device. Also adb sync can be used to sync whole image, so if you updated a module, changed files will be pushed to device.
Also you can put the changed files via regular `adb push' and reboot device.
I do not know if system apps can be updated via adb install, probably yes, but I think you need to increment build number in the manifest file.
I do not think you can uninstall a system app with adb install -r, as apps can't be removed from system partition, only from data. I do not know why you are getting INSTALL_FAILED_INVALID_APK in that case, may be because app manager can't uninstall the base system apk indeed.

Adb backup does not work

I need help from you guys, because I don't know what I did wrong with adb backup.
I want to backup my Samsung Galaxy S3 LTE (GT-I9305) without root. I googled it and found Full Android Backup with SDK Manager. I installed all i need for this like Java Development Kit 8 version 66 (JDK 8u66 x64) and Android Studio which contains SDK Manager. Then they sad i should download the Google USB Driver. I downloaded it but nothing happened. I thought it should work now and then I went to C:\Users\MYNAME\AppData\Local\Android\sdk\platform-tools and left-clicked adb whilst holding Shift. Then I clicked "Open command window here". After this I typed in "adb devices" and it said:
List of devices attached
3204cfaaf8611199 device
Then I typed in:
adb backup -apk -shared -all -f C:\Users\NAME\backup.ab
It said
Now unlock your device and confirm the backup operation.
I did this and my Smartphone opened "Full Backup" and then I was able to set a password for the backup. I don`t need a password and I just clicked "Back up my data" Then it went back to my homescreen and said "Starting backup..." as a toast message and immediately after this it said "Backup finished" and created a backup file with 40 bytes. I don't know what I should do now.
Rather than trying to find an old version of adb, it's easier to add quotes to the arguments to adb backup :
adb backup "-apk -shared -all -f C:\Users\NAME\backup.ab"
The line, which correctly invokes adb, needs to look like this at my side:
adb backup "-apk -obb -shared -all -system" -f phone-20180522-120000.adb
This line is for Linux, but should do for Windows and OS-X as well. For Linux (and probably OS-X), you can use a script like following, which automatically assigns a timestamp to the file:
adb backup "-apk -obb -shared -all -system" -f "${PHONE:-phone}-`date +%Y%m%d-%H%M%S`.adb`"
Important After doing a backup, verify your data! At my side, sometimes some corruption of the file shows up (and I doubt it is my computer, as I only observe such errors with adb).
Here is a check instruction I use:
set -o pipefail
for a in *.adb;
do
echo "$a";
dd if="$a" bs=24 skip=1 | zlib-flate -uncompress | tar tf - >/dev/null;
echo "ret=$?";
done
It should show ret=0, but it doen't.
If you see inflate: data: invalid code lengths set your archive is corrupted and - very likely - unusable for restore!
If you see tar: Unexpected EOF in archive your backup probably is usable (all backups end this way, I do not know why).
Even if you see just ret=0 there might be undiscovered errors which still prevent a restore.
There is definitively missing an adb verify command, to verify correctness of a backup!
FYI
I post this update, as all other answers were helpful, but not exact to the last detail. (When used with full quotes, a backup was done, but called backup.ab)
Here is my environment:
OS: Ubuntu 16.04
Phone: Android 7.0
ADB: 1.0.32
The full procedure was (just in case somebody stumbles upon this not knowing what is needed):
Zeroth: Install adb (on Ubuntu: sudo apt-get install android-tools-adb)
First: Enable USB debugging mode on the phone.
Second: Attach phone to USB of the computer with an USB data cable (a charge only cable is not enough)
Note that the Ubuntu Phone Manager might show up and ask you for the phone's PIN. You do not need that, close this if it happens.
Third: run adb devices - you should see something like XXXXXXXXXXXX unauthorized
After some time on your phone a message shows up which asks for USB debugging permission
Allow this once. For security reasons, you should not automatically trust the computer, as the fingerprint can be easily faked.
Note that if something is obstructing a single pixel of this confirmation window (like some accessibility feature button) you cannot tap on the OK. First move the obstructing window.
Forth: Now again run adb devices - you should see something like XXXXXXXXXXXX device
If more than one line shows up, you attached more than one phone to the computer. The easy way is to unplug all those you do not want to backup. (The complex way is to set the environment variable ANDROID_SERIAL=XXXXXXXXXXXX.)
Now run adb backup as shown above. Change the file to your needs.
This brings up a window which asks for backup permission.
Do not close the backup window while the backup is taken. When I tried this, the backup stopped and the resulting archive was broken.
You can give a password to encrypt your backup. I do not have any information on how secure the password is. But it is very likely, that you cannot restore the backup taken in case you ever forget this password.
I have no idea on how to restore such a backup to other phones. I even never tried the restore, so I cannot help here, too.
Notes:
adb help shows all possible options to adb backup
Close all open applications on your phone before the backup. I do not know if this is needed, but it certainly cannot hurt.
Leave the phone alone while the backup runs. I do not know if this is needed, but it certainly cannot hurt.
Do not be impatient. Leave the backup plenty of time. At my side I see a progress of about 100 MB/Minute (YMMV). So the backup takes about half an hour for my phone (2.5 GB).
Apparently adb backup does not completely backup everything!
I had a look into the backup (cd X && dd if=../XXXX.adb bs=24 skip=1 | zlib-flate -uncompress | tar xf -) and did not find all installed applications.
What I was able to find was (note that this list is incomplete):
Internal emulated SD-Card: shared/0
External SD-Card: shared/1
Apps: apps/ - many apps (like Google Authenticator) were missing
Calendar: apps/com.android.providers.calendar/db/calendar.db (probably)
What I was not able to find (note that this list is incomplete):
Alarms. (I was probably not able to detect the right app)
Full external SD-card (there is more on this card than what is shown below share/1. For example the apps, which are moved-to-SD.)
Conclusions:
Sometimes adb backup might create corrupt backups, which can go unnoticed. So either check your backup or do frequent backups and pretend to be lucky enough such that not all backups go corrupt.
With adb backup you get a backup of most of your precious data, like camera images and so on. It might be a bit difficult to unpack it, though.
adb backup is not enough to do a complete backup of your phone.
adb backup is not enough to backup your SD-card such, that if it breaks, you are able to replace it by a new one with the contents restored. This is very sad!
PS: The typo "Forth" is not an accidental one.
PPS: zlib-flate can be found in package qpdf on Ubuntu 18.04
This just worked using Ubuntu 15.10 ("wily") to backup a Galaxy SM-G900V running Android version 6.0.1.
Installed using:
sudo apt-get install android-tools-adb
Then I ran the following from the command line (without 'sudo'):
adb backup -apk -shared -all -f backup.adb
Result:
user#hostname:~/droid$ ls -lah
total 1.2GB
drwxrwxr-x 2 user user 4.0BK Mar 6 18:43 .
drwxr-xr-x 52 user user 4.0KB Mar 6 17:40 ..
-rw-r----- 1 user user 1.2GB Mar 6 18:29 backup.ab
Thank you "NG". I was beginning to think my phone was borked.
Forgot to add: Running adb version: Android Debug Bridge version 1.0.31
Seem not all apps can be backed up. Android apparently allow apps to disable backup :(
https://developer.android.com/guide/topics/manifest/application-element.html (search for allowbackup)
The problem is the adb version of your PC. Using adb version 1.0.31 the backup/restore will be sucessfull.
More info on: https://android.stackexchange.com/questions/83080/adb-backup-creates-0-byte-file-prompts-for-current-backup-password-even-though
and How to downgrade my SDK Version?
If your device has an adb version prior to 1.0.31, then you must use an adb version of 1.0.31 on PC. Versions of adb 1.0.32+ broken the backwards compatibility. Source: Issue 208337
Just incase anyone is still having trouble - In windows, I found putting the quotes around only the directory, for example "C:\Users\NAME\backup.ab" worked.
I found this solution :
adb backup -apk -shared -all -f "<path-where-the-backup-will-be-created>.ab"
And to restore :
adb restore "<path-where-the-backup-is>.ab"

aggressive adware irremovable apk on android

A few days ago I received complaints from several customers who told me that "adware is installed automatically on your device Krono NET K5". I made invesigar and found a few apk on / system / app that had different permissions to the usual "rw-r - r--". I could erase the few simple steps in a shell:
adb shell "su -c 'mount -o rw, remount /'"
adb shell "su -c 'rm /system/app/156.apk'"
adb shell "su -c 'rm /system/app/Launcher0607wxDjbOa.apk'"
adb shell "su -c 'rm /system/app/Sync.apk'"
adb shell "su -c 'rm /system/app/SettingProvider.apk'"
(Note that a suspect name as there is a apk using the system call SettingsProvider.apk with letter s)
So far everything worked properly, however there is a apk which is the main cause of all adware and causing the discharge cone apk other battery savers, system cleaners, among others. This application is:
"/system/app/providerdown.apk" Permits "rwsr-sr-x"
I tried to remove it by the above method, I tried to change the permissions to remove it and it has not worked. I tried to install a recovery to eliminate apk thence Aroma File Manager (CWM, TWRP) MTK but this device does not support any custom recovery for devices MTK.
Any idea? Thanks in advance (sorry for my bad english)
I have same problem. You will have to be rooted for this, but i guess you have root because of that code you wrote, and the fact that app somehow gains root access and installs itself in system. Only thing I did to make things easier is:
Download Avast to your phone.
Download Clean Master to your phone and with Clean master make backup of your avast apk.
Go to your stock recovery. I used an app from google store to boot to recovery but any way is good.
Clean cache and do a factory reset.
Boot the device.
DO NOT CONNECT DEVICE TO ANY NETWORK.
Just skip all the stuff like login to your google account and other settings.
Find your Avast apk in the sd card and install it.
Turn on firewall and block all acces to TimeService-that is the name that apk uses when seen from android system.
Go to android system and disable time service. It is probably version 1.1.6
You will still have malware in your device but it wont make mess anymore.
I would like the permanent solution too.

Install APK from SD card no file browser Android phone

I need to install an APK on a phone with no built in file browser, and no connection (wifi/mobile). The LG Optimus M has no built in file browser... Not sure why, but it is making things very difficult. I was thinking if I could put an app in a special place on an SD card, or auto-run an APK install.
ADB is also not an option due to usb driver issues. I know this is pretty limited...
EDIT: I got down voted because you didn't read? There is no wifi/mobile connection available. Downloading a file manager etc. from market not an option.
Enable usb debugging
Install the drivers and android sdk
Connect the phone through usb to your computer
Call the following program from the command prompt: adb install
application.apk
Adb will now install your application
According to the about of just running adb, you can use the following command line arguments:
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
- push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
('--algo', '--key', and '--iv' mean the file is encrypted already)
Why not download one of the MANY file browsers in the market? May I suggest my favorite which is Astro File Manager
If you have a terminal emulator app on the device, you can put MyApp.apk on the SD card and run this, which should open the package installer:
am start -a "android.intent.action.VIEW" -d "file:///mnt/sdcard/external_sd/MyApp.apk" -t "application/vnd.android.package-archive"
You might need to change that path depending on your device — see How can I determine storage directory from ADB?
You will also need to enable the Unknown Sources option in the device settings.
Why not download astro file manager? it works great. Other than that I would host the apk on a server and download it from the phone.

Categories

Resources